aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeader <keader.android@gmail.com>2021-01-17 10:22:02 -0300
committerKeader <keader.android@gmail.com>2021-01-17 10:22:02 -0300
commit740a59d1cd83bffeef6953abd9197acd5f2f5aa1 (patch)
tree72bd8d6e6ee7f4f501e74d91fdbbcf30596e6609 /src
parent9af6bf15aa2fe836c3ebba306eaaa8971f00fac4 (diff)
Scripts/Priest: Fixed Lightwell getting removed in first damage
* Spell should drop charge, only when damage > 30% of total health.
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index 43865fa3f54..7566035e923 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -810,7 +810,7 @@ class spell_pri_lightwell_renew : public SpellScriptLoader
_remainingAmount = GetTarget()->CountPctFromMaxHealth(30);
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void CheckDropCharge(ProcEventInfo& eventInfo)
{
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
if (!damageInfo)
@@ -818,20 +818,19 @@ class spell_pri_lightwell_renew : public SpellScriptLoader
uint32 damage = damageInfo->GetDamage();
if (_remainingAmount <= damage)
- {
- DropCharge(AURA_REMOVE_BY_ENEMY_SPELL);
return;
- }
_remainingAmount -= damage;
+ // prevent drop charge
+ PreventDefaultAction();
}
void Register() override
{
+ DoPrepareProc += AuraProcFn(spell_pri_lightwell_renew_AuraScript::CheckDropCharge);
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pri_lightwell_renew_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL);
AfterEffectApply += AuraEffectApplyFn(spell_pri_lightwell_renew_AuraScript::InitializeAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
- OnEffectProc += AuraEffectProcFn(spell_pri_lightwell_renew_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PERIODIC_HEAL);
}
uint32 _remainingAmount = 0;