View Single Post
  #7  
Old 10-07-2008, 04:09 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

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).
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote