aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/3.3.5/2017_01_23_02_world_335.sql3
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp27
2 files changed, 30 insertions, 0 deletions
diff --git a/sql/updates/world/3.3.5/2017_01_23_02_world_335.sql b/sql/updates/world/3.3.5/2017_01_23_02_world_335.sql
new file mode 100644
index 00000000000..e26f76152dc
--- /dev/null
+++ b/sql/updates/world/3.3.5/2017_01_23_02_world_335.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_proc` WHERE `SpellId`=-7001;
+INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES
+(-7001, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0x0, 0x2, 0, 0, 0, 0);
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index 7b3b6959c0a..86a8c376dc2 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -703,10 +703,37 @@ class spell_pri_lightwell_renew : public SpellScriptLoader
}
}
+ void InitializeAmount(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ // Attacks done to you equal to 30% of your total health will cancel the effect
+ _remainingAmount = GetTarget()->CountPctFromMaxHealth(30);
+ }
+
+ void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ {
+ DamageInfo* damageInfo = eventInfo.GetDamageInfo();
+ if (!damageInfo)
+ return;
+
+ uint32 damage = damageInfo->GetDamage();
+ if (_remainingAmount <= damage)
+ {
+ DropCharge(AURA_REMOVE_BY_ENEMY_SPELL);
+ return;
+ }
+
+ _remainingAmount -= damage;
+ }
+
void Register() override
{
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;
};
AuraScript* GetAuraScript() const override