mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 02:11:30 +00:00
Change to allow pets to use better of db/oocregen if oocregen is turned
on in the rule_set.
This commit is contained in:
parent
eff8000196
commit
4a84c311b2
47
zone/npc.cpp
47
zone/npc.cpp
@ -615,37 +615,54 @@ bool NPC::Process()
|
|||||||
if (currently_fleeing)
|
if (currently_fleeing)
|
||||||
ProcessFlee();
|
ProcessFlee();
|
||||||
|
|
||||||
uint32 bonus = 0;
|
uint32 sitting_bonus = 0;
|
||||||
|
uint32 petbonus = 0;
|
||||||
|
uint32 bestregen = 0;
|
||||||
|
int32 dbregen = GetNPCHPRegen();
|
||||||
|
|
||||||
if (GetAppearance() == eaSitting)
|
if (GetAppearance() == eaSitting)
|
||||||
bonus += 3;
|
sitting_bonus += 3;
|
||||||
|
|
||||||
int32 OOCRegen = 0;
|
int32 OOCRegen = 0;
|
||||||
if (oocregen > 0) { //should pull from Mob class
|
if (oocregen > 0) { //should pull from Mob class
|
||||||
OOCRegen += GetMaxHP() * oocregen / 100;
|
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.
|
|
||||||
|
//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.
|
||||||
|
//
|
||||||
|
// Noudess Edit: If oocregen set in db, apply to pets as well.
|
||||||
|
// This allows the obscene #s for pets in the db to be tweaked
|
||||||
|
// while maintaining a decent ooc regen.
|
||||||
|
|
||||||
|
bestregen = std::max(dbregen,OOCRegen);
|
||||||
|
|
||||||
if ((GetHP() < GetMaxHP()) && !IsPet()) {
|
if ((GetHP() < GetMaxHP()) && !IsPet()) {
|
||||||
if (!IsEngaged()) {//NPC out of combat
|
if (!IsEngaged())
|
||||||
if (GetNPCHPRegen() > OOCRegen)
|
SetHP(GetHP() + bestregen + sitting_bonus);
|
||||||
SetHP(GetHP() + GetNPCHPRegen());
|
|
||||||
else
|
|
||||||
SetHP(GetHP() + OOCRegen);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
SetHP(GetHP() + GetNPCHPRegen());
|
SetHP(GetHP() + dbregen);
|
||||||
}
|
}
|
||||||
else if (GetHP() < GetMaxHP() && GetOwnerID() != 0) {
|
else if (GetHP() < GetMaxHP() && GetOwnerID() != 0) {
|
||||||
if (!IsEngaged()) //pet
|
if (!IsEngaged()) {
|
||||||
SetHP(GetHP() + GetNPCHPRegen() + bonus + (GetLevel() / 5));
|
if (oocregen > 0) {
|
||||||
|
petbonus = std::max(OOCRegen,dbregen);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
petbonus = dbregen + (GetLevel() / 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
SetHP(GetHP() + sitting_bonus + petbonus);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
SetHP(GetHP() + GetNPCHPRegen() + bonus);
|
SetHP(GetHP() + dbregen);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
SetHP(GetHP() + GetNPCHPRegen());
|
SetHP(GetHP() + dbregen + sitting_bonus);
|
||||||
|
|
||||||
if (GetMana() < GetMaxMana()) {
|
if (GetMana() < GetMaxMana()) {
|
||||||
SetMana(GetMana() + mana_regen + bonus);
|
SetMana(GetMana() + mana_regen + sitting_bonus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user