View Single Post
  #1  
Old 09-25-2008, 07:05 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default Quest Command to Disable OOC Regen

The out of combat regen rule is great, but I would like to have an option for an NPC to disable it on themself, or to somehow keep them in combat mode even when they really aren't.

Maybe a new quest command like quest::ooc_regen() could be created to disable it, but I am not exactly sure how to go about doing that. The command would just have a bool argument so it could turn it on or off on the fly for a single NPC.

Here is the OOC Regen code, so any quest command created to stop it would somehow have to intervene here I think:

Code:
		sint32 OOCRegen = 0;
		if(RuleI(NPC, OOCRegen) > 0){
			OOCRegen += GetMaxHP() * RuleI(NPC, 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()) //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);

		if(GetMana() < GetMaxMana()) {
			SetMana(GetMana()+mana_regen+bonus);
		}
If anyone has an idea of how to do it, let me know, please. I will try to look into it further as well. But, right now, I don't even know where to begin other than to figure out a way to maybe set an NPC to IsEngaged and keep them that way.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote