PDA

View Full Version : Quest Command to Disable OOC Regen


trevius
09-25-2008, 07:05 AM
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:

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.

ChaosSlayer
09-25-2008, 10:43 AM
yeah thsi woudl be helpfull during scripted encounters when you want to temporary take NPC out of action but not have him insta heal himself while event takes place.

BTW Trev, related question: in Rule the OOC regeneration set to 0.66 by default excatly does does this reads? 66% per second? Then 1 is = 100%?