I just tried to compile the changes, and it looks like I didn't work the function correctly. If you put it around line 401 & add inline:
Code:
inline virtual void SetHP(sint32 hp) { if (hp >= max_hp) cur_hp = max_hp; else cur_hp = hp;}
bool ChangeHP(Mob* other, sint32 amount, int16 spell_id = 0, sint8 buffslot = -1, bool iBuffTic = false);
inline void SetOOCRegen(sint32 newoocregen) {oocregen = newoocregen;}
int MonkSpecialAttack(Mob* other, int8 skill_used);
void TryBackstab(Mob *other);
it should compile fine (I did verify this).
Of course, I also forgot the most important part: adding the check on whether or not to calculate OOC regen:
in zone/npc.cpp, around line 558, change
Code:
sint32 OOCRegen = 0;
if(oocregen > 0){ //should pull from Mob class
OOCRegen += GetMaxHP() * oocregen / 100;
}
//Lieka Edit: Fixing NPC regen. NPCs should regen to full during a set duration, not based on their HPs. Increase NPC's HPs by % of total HPs / tick.
if((GetHP() < GetMaxHP()) && !IsPet()) {
if(!IsEngaged() && oocregen > 0) //NPC out of combat
SetHP(GetHP() + hp_regen + OOCRegen);
else
SetHP(GetHP()+hp_regen);
} else if(GetHP() < GetMaxHP() && GetOwnerID() !=0) {
if(!IsEngaged()) //pet
SetHP(GetHP()+hp_regen+bonus+(GetLevel()/5));
else
SetHP(GetHP()+hp_regen+bonus);
} else
SetHP(GetHP()+hp_regen);
Verified that compiles also, just need to see if/how it works (if at all, lol).