• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Fixed Curse of Cortez: Character HP reduced to 20 HP permanently

Odieman

Powder Monkey
NEW UPDATE, scroll down to my latest post in the thread. The bug is caused by the cortez treasure curse.


------------------------------------------------------------------------------------------------------------
Hi I am currently playing: Build 14 Beta 4 WIP 14 Feb. Couldnt find this bug beeing reported anywhere, so I am posting in the hopes someone recognises it.

I didnt notice this bug untill several hours of gameplay later, and therefore do not have a save game which explains why this happened, the second savegame (lvl 19), is the closest I have after the bug/glitch. I have also uploaded the current save game I am playing.

Somewhere/sometime after or perhaps during my little exploration of the Abbey of the Maltese order (lvl 16), my HP was reduced to 20 HP. I have 3 possible explanations for this. Whilst in the abbey of the maltese order (first save, with normal HP). I dug up one of the cortez coins, an became cursed, a curse I have since lifted. The curse may have caused the glitch. OR, I touched/went through some of the shining lights, and white fountains down there and also fought witch doctors, and some bishop looking guy. Any of these might have caused it. Also on my way out of there I died and woke up in the tavern, which may or may not have caused it. It may also be that none of the above are the cause of it. The only thing I have to add, is that I dont think its the toughness perk causing it. As I seem to remember adding this after the bug/glitch had occurred (it didnt give me any extra hp though)

I am playing the Johan Elting (Assassin) storyline (which I am really enjoying, great work :).), I have all the defensive perks including toughness, I also have the best armour available (I think). The middle save Ive uploaded (Guadelope. Point a Pitre Port September 27th 1663), where I am lvl 19) You can see I have 20 hp, in my current save (lvl 25), I still have 20 HP, and the cortez curse is gone.

Hope somebody can help me or enlighten me as to the cause of this, and or any fixes I can do.

I couldnt upload the savegames with their original title, so I have included them here if needed.

1 (before)= -=Odieman=- Barbados. Abbey of the Maltese order June 1st, 1663

2 (after)= -=Odieman=- Guadeloupe. Pointe a Pitre Port. September 27th, 1663

3 (current) -=Odieman=- Open Sea June 25th, 1664

PS: Is there a way I can "cheat" and add HP in the save files or something?, so that I dont die as soon as somebody hits me? If so how muh do you reckon I should have at lvl 25 with the toughness perk?

PPS: Dont know If you need to create a new profile in game, but these save games are under the profile Odieman in my game

Thanks

PPS: I get an error message when trying to upload the save files, "the file does not have the required extension" What does this mean?
 
Last edited:
The white mist in the Maltese Knight Abbey INCREASES your maximum HP.

The Curse of the Aztec Coins gives you a huge INCREASE in maximum HP at night, which is reset again during daytime.

Using opium can decrease maximum health.

PPS: I get an error message when trying to upload the save files, "the file does not have the required extension" What does this mean?
Zip them up first.

PS: Is there a way I can "cheat" and add HP in the save files or something?, so that I dont die as soon as somebody hits me? If so how muh do you reckon I should have at lvl 25 with the toughness perk?
Easiest is probably to execute this through console:
Code:
DeleteAttribute(pchar, "HPBonus");
See here point 4 for how: Tutorial - Modding Tips & Tricks | PiratesAhoy!
 
Ok thx for the help, also I should note, I do not know if My HP is actually 20, but my character portrait in game says 20 HP

Edit: So I found the console file, but where exactly do I put the code?

Like this? If so It did not do anything

// Jerry-rigged console file.
//put code under ExecuteConsole() below.
//NK 04-08-28
// not needed I think extern void InitShips();
#include "SDK\LocatorWrite.c"
#include "Upgrade.c";
extern void InitItems();
extern void InitCannons();


void ExecuteConsole()
{DeleteAttribute(pchar, "HPBonus");
ref pchar = GetMainCharacter();
ref ch;
int i;
 
Last edited:
Hi I am currently playing: Build 14 Beta 4 WIP 14 Feb
Just so you know, the latest version is dated today and can at the moment be found here:
Poll - Build 14: New Installer Method for Testing and Feedback | Page 7 | PiratesAhoy!
This is the FINAL PUBLIC RELEASE version of Build 14 Beta 4. I just haven't had the time yet to properly announce it.

I strongly recommend getting this new version as I cannot afford to support anything older than that.
New game required, I'm afraid.
 
Thank you for all your help, executed the console and I am now at 247 HP. I will download and play the new version eventually, but for now I think I want to complete the Assasin storyline, seeing as Ive invested alot of time already. Will definetly check it out within a months time though, looking forward to it :)

Thanks again :)
 
Hi guys NEW UPDATE! BUG Confirmed.

I just confirmed the existence of this bug, and atleast 1 cause of it. The bug is caused by the Cortez Curse (detailed explanation below). I have now encountered the 20 HP bug two times in 2 different storylines and 2 different versions. I cant remember what caused it in the assasin storyline, or if it was the same cause as the one below, but it might have been.

I am playing the Tales of Sea Hawk Storyline, my lvl is 16 and I have the toughness ability, my HP was 187, and I am playing the newest release/version of the mod

1. Whilst doing a quest, I looted a chest in the office of the Governor of Guadelope, and picked up a cursed coin.

2. I then went straight to La Tortue in order to get the aztec compass. Upon going to shore I deliberatly went during the night, my HP got boosted to 391 (or there abouts).

3. I got back on my ship, waited untill daytime, and went ashore again. My HP was now at 61 (!!!Not 183 as it should have been!!!).

4. I got the Aztec compass, went to Isla de Muerta (during the night), in skeleton form my HP was now 241.

5. Upon putting the cursed coin back in the chest I reverted to human form, and my HP was now at 20.

Bug confirmed. It seems that whenever you revert back to human form after having been a skeleton at night, your HP goes down to a lower number than it should be, and this carries over and continues untill your HP is at 20, at which point I believe it cant get any lower.

EDIT: I just did some further testing to confirm the above assumption. I reloaded the save I did after aquiring the coin, went to la tortue got the compass, then went to Isla Muerta and placed the coin in the chest. However this time, I made sure to only go out in the daytime, and never transformed into a skeleton. I did that and my HP remained 187 the whole time, which means the HP bug isnt caused by the curse itself, but rather the skeletal transformation and reverting to human form process which is part of the curse.
 
Last edited:
What is supposed to happen is very simple:
When the curse takes effect (e.g. at night), you get 300 HP points extra.
And when that effect stops, those 300 points are taken away again.

This is the relevant code from PROGRAM\NK.c:
Code:
void CheckCharacterCurse(ref chr)
{
   float x,y,z;
   bool UnCurse = false;
   bool DoCurse = false;
   if(!CheckAttribute(chr, "location")) return;
   ref lcn = &Locations[FindLocation(chr.location)];

   DoCurse = Whr_IsNight() && GetAttribute(lcn, "environment.weather") == "true";
   if(DoCurse && GetAttribute(lcn, "environment.curse") == "false")
   {
     DoCurse = false;
   }

   if(CheckCharacterItem(chr,"cursedcoin") && GetCursedCoinCount()>0)
   {
     if(!CheckAttribute(chr, "model.old"))
     {
       if(DoCurse)
       {
         chr.model.old = chr.model;
         if(!CheckAttribute(chr, "model.cursed"))
           chr.model.cursed = GetCharacterCursedModel(chr);
         SetModelFromID(chr, chr.model.cursed);
         ChangeHPBonus(chr, 300);
         ResetHP(chr);
       }
     }
     else
     {
       if(!DoCurse)
       {
         UnCurse = true;
       }
     }
   }
   else
   {
     UnCurse = true;
   }
   if(CheckAttribute(chr, "model.old") && UnCurse)
   {
     SetModelFromID(chr, chr.model.old);
     DeleteAttribute(chr, "model.old");
     ChangeHPBonus(chr, -300);
     ResetHP(chr);
   }
}

I know that used to work fine, so something tells me the recent Levelling-related rewrites have messed it up.

Relevant functions from PROGRAM\Characters\Leveling.c:
Code:
//=====================================================
//  HP Functions
//=====================================================

float ResetHP(ref chr)
{
   if(CheckAttribute(chr,"old.chr_ai.hp"))
   {
     DeleteAttribute(chr,"old.chr_ai.hp");
     DeleteAttribute(chr,"old.chr_ai.hp_max");
   }
   ResetMaxHP(chr);
   float HP = stf(chr.chr_ai.hp_max);
   chr.chr_ai.hp = HP;
   return HP;
}

float ResetMaxHP(ref chr)
{
   float HP = CHAR_START_HITPOINTS;
   if(!CheckAttribute(chr,"old.chr_ai.hp"))
   {
     //First let's save the percentage of HP we have at the moment.
     float HPper = 1;
     if(CheckAttribute(chr,"chr_ai.hp") && CheckAttribute(chr,"chr_ai.hp_max")) HPper = stf(chr.chr_ai.hp)/stf(chr.chr_ai.hp_max);
     int type = 0;
     int PlayerHPperLevel = CHAR_HITPOINTS_PER_LEVEL;
     float level = makefloat(GetLevel(&chr));
     if(!CheckAttribute(chr,"FakeLevels")) chr.FakeLevels = 0; //Levis
     level = level + sti(chr.FakeLevels); //Levis
     if(CheckAttribute(chr, "HPBonus")) HP += stf(chr.HPBonus);
     HP += GetHPBaseBonusOT(chr);
     //For now friendly and not friendly are the same, might change later.
     if(CharacterIsFriend(chr))
     {
       //Friendly
       PlayerHPperLevel = (PlayerHPperLevel+1)-GetDifficulty()+GetHPLevelBonusOT(chr);
     }
     else
     {
       //Not Friendly
       PlayerHPperLevel = (PlayerHPperLevel)-(4-GetDifficulty())+GetHPLevelBonusOT(chr);
     }
     HP += (level-1) * PlayerHPperLevel;
     if(IsCharacterPerkOn(chr, "Toughness"))
     {
       HP = HP * 1.1;       // 10% health bonus for the tough guys
       chr.chr_ai.hp_dlt = LAI_DEFAULT_DLTHP * TOUGHNESS_REGEN_MULT; // higher regeneration rate, default is 0.1 - LDH 14Apr09
     }
     if(CheckAttribute(chr,"chr_ai.hpchecker")) //Check if there is an hpchecker, if so we need to change that too
     {
       float diff = stf(chr.chr_ai.hp_max) - stf(chr.chr_ai.hpchecker);
       if((HP - diff) < 20) //Check if we are below 20 (to have some margin)
       {
         chr.chr_ai.hpchecker = 20;
       }
       else
       {
         chr.chr_ai.hpchecker = HP - diff;
       }
     }
     if(HP < 20) //Incase a very large negative modification is applied
     {
       HP = 20;
     }
     chr.chr_ai.hp_max = HP;
     //Apply the percentage again to the new HP (if we have any change)
     chr.chr_ai.hp = HP * HPper;
   }
   else
   {
     HP = stf(chr.chr_ai.hp_max);
   }
   return HP;
}

int ChangeHPBonus(ref chr, int offset)
{
   if(CheckAttribute(chr, "HPBonus")) offset += sti(chr.HPBonus);
   if(offset > sti(chr.chr_ai.hp_max)) //Never have a HPbonus larger then the max HP
   {
     offset = sti(chr.chr_ai.hp_max) - 1;
   }
   chr.HPBonus = offset;
   return sti(offset);
}

The error cannot be in my NK.c code as that is simple enough, which means it must be somewhere in that other code.
 
Hi there lads, I've been keen on taking screenshots of my adventures now and I've done what @Odieman said. Yup, the bug is due to the trasnformation process

Normal character
Mysterious Coin in my ship 6.png

Cursed character
Mysterious Coin in my ship 2.png

Transformed
Mysterious Coin in my ship 3.png

20 HP
Mysterious Coin in my ship 5.png

The scene from the port in the upper part is there because I forgot to press Ctrl+N in paint. :facepalm:razz
 
Thanks for confirming. I bet it is because of ill-considered changes to the HP code because this used to work quite fine before.

So do I just need to:
1. Get myself cursed
2. Wait until night for the HP to go up
3. Wait for day for the HP to be reduced to 20?
 
Also strange that your HP before being cursed is 100 and after being cursed it is only 199.
Should have been 400 because it is supposed to be "+300".
 
Do you have a savegame when your HP was still 100?
I did a very, very quick test myself but that seemed to work as I'd expect.
I wonder if the "Player/Captain Type" has something to do with it.
 
The one at open sea I am just arriving at Port Royale, after i moored in the port I found the coin in the chest at the crew quarters.
In the other save I'm with the coin, 100 HP, no transformation.

EDIT: Wait, now I remember, I actually found the coin in the crew quarters before leaving Charlestown, sorry for that! I remember the log saying 3% of crew cursed in the world map. Will look for a save actually before the coin.
 

Attachments

  • -=Player=- Open Sea June 22nd, 1750.rar
    606.7 KB · Views: 95
  • -=Player=- Jamaica. Port Royale port June 22nd, 1750.rar
    624.8 KB · Views: 100
Yup, it was right before leaving Charlestown. I've loaded that save and was lucky enough to find the coin again, this time in the cargo hold. Follows the save.

I'm glad I'm following the FAQ's advise to save often. :onya I'm also backing up the entire save - standard folder, just in case what happened with Laurens' saves occurs again, but I don't think it will.

@Pieter, I remember changing the profile name at the game start menu to "Tales of a Sea Hawk", but at the load menu there's no such profile, just the player profile.:shrug
 

Attachments

  • -=Player=- Nevis. Charlestown Port June 13th, 1750.rar
    620 KB · Views: 101
You may have to close the game before your profile shows. Assuming it does indeed have a save in it.
The profiles system can be a bit dodgy like that.
 
The fact that my HP was 199 in my first, and only, transformation may be due to that not being my actual first night as a cursed captain, some days passed in the travel between Charlestown and Port Royale. I've tried to test that just now, but the game tantrums like a child on me and don't make the coin appear again.
Oh if had thought of it the first time I loaded and it did appear! :facepalm
 
Last edited:
Back
Top