Beneficial spells will now correctly inherit targets RestTimer

Example PC A is fighting mob B. PC C casts a heal on PC A. PC C will
inherit the timer from PC A. This is done because beneficial spells have
a "witness" check from NPCs so there is a chance PC C would not gain
aggro and could just keep on going with no RestTimer which allows them
to fast regen while actively participating.
This commit is contained in:
Michael Cook (mackal)
2018-07-14 18:50:02 -04:00
parent 18005ac7a9
commit 6ab2871fd1
3 changed files with 34 additions and 0 deletions
+2
View File
@@ -3895,6 +3895,8 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
spelltar->SetHateAmountOnEnt(this, std::max(newhate, 1));
}
} else if (IsBeneficialSpell(spell_id) && !IsSummonPCSpell(spell_id)) {
if (spelltar->IsClient() && IsClient())
CastToClient()->UpdateRestTimer(spelltar->CastToClient()->GetRestTimer());
entity_list.AddHealAggro(
spelltar, this,
CheckHealAggroAmount(spell_id, spelltar, (spelltar->GetMaxHP() - spelltar->GetHP())));