[Bug Fix] DI/Death Pact Fix (#3867)

* [Bug Fix] DI/Death Pact Fix

Divine Intervention/Death Pact buffs were always fading the moment a person dropped below 16% regardless if it healed or not.  It will now only fade if it succeeds in healing, and it will only check to heal when a person drops below 16%

* Requested Updates
This commit is contained in:
Fryguy
2024-01-07 02:05:16 -05:00
committed by GitHub
parent 7923d7bc6c
commit 70a4b6a2b1
3 changed files with 42 additions and 29 deletions
+4 -1
View File
@@ -3810,6 +3810,8 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
if (damage > 0) {
//if there is some damage being done and theres an attacker involved
int previous_hp_ratio = GetHPRatio();
if (attacker) {
// if spell is lifetap add hp to the caster
if (IsValidSpell(spell_id) && IsLifetapSpell(spell_id)) {
@@ -4035,8 +4037,9 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
}
}
else {
if (GetHPRatio() < 16)
if (GetHPRatio() < 16 && previous_hp_ratio >= 16) {
TryDeathSave();
}
}
TryTriggerOnCastRequirement();