diff options
author | Matan Shukry <matanshukry@gmail.com> | 2021-02-13 13:26:53 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-02-13 14:08:16 +0100 |
commit | bb0194aede293d029ec1db628f555b6a138c1e6c (patch) | |
tree | fed99f6f2487113cd7587a2547d0f7a8267e25f4 | |
parent | 7159de62b6a863de39fffc672ac79832a3bbd323 (diff) |
Scripts/Spells: Touch of the Magi - accumulate damage and DoT duration
-rw-r--r-- | sql/updates/world/master/2021_02_13_00_world_mage_spell_touch_of_the_magi.sql | 4 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_mage.cpp | 44 |
2 files changed, 48 insertions, 0 deletions
diff --git a/sql/updates/world/master/2021_02_13_00_world_mage_spell_touch_of_the_magi.sql b/sql/updates/world/master/2021_02_13_00_world_mage_spell_touch_of_the_magi.sql new file mode 100644 index 00000000000..3b0b3fada9a --- /dev/null +++ b/sql/updates/world/master/2021_02_13_00_world_mage_spell_touch_of_the_magi.sql @@ -0,0 +1,4 @@ +-- Attach touch of the magi aura script +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_mage_touch_of_the_magi_aura'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(210824,'spell_mage_touch_of_the_magi_aura'); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 61d443a1a44..3679fbc9b7c 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -64,6 +64,8 @@ enum MageSpells SPELL_MAGE_ICY_VEINS = 12472, SPELL_MAGE_CHAIN_REACTION_DUMMY = 278309, SPELL_MAGE_CHAIN_REACTION = 278310, + SPELL_MAGE_TOUCH_OF_THE_MAGI_AURA = 210824, + SPELL_MAGE_TOUCH_OF_THE_MAGI_EXPLODE = 210833, }; enum MiscSpells @@ -753,6 +755,47 @@ class spell_mage_time_warp : public SpellScript } }; +// 210824 - Touch of the Magi (Aura) +class spell_mage_touch_of_the_magi_aura : public AuraScript +{ + PrepareAuraScript(spell_mage_touch_of_the_magi_aura); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_MAGE_TOUCH_OF_THE_MAGI_EXPLODE }); + } + + void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo) + { + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (damageInfo) + { + if (damageInfo->GetAttacker() == GetCaster() && damageInfo->GetVictim() == GetTarget()) + { + uint32 extra = CalculatePct(damageInfo->GetDamage(), 25); + if (extra > 0) + aurEff->ChangeAmount(aurEff->GetAmount() + extra); + } + } + } + + void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + int32 amount = aurEff->GetAmount(); + if (!amount || GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) + return; + + if (Unit* caster = GetCaster()) + caster->CastCustomSpell(SPELL_MAGE_TOUCH_OF_THE_MAGI_EXPLODE, SPELLVALUE_BASE_POINT0, amount, GetTarget(), TRIGGERED_FULL_MASK); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_mage_touch_of_the_magi_aura::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + AfterEffectRemove += AuraEffectRemoveFn(spell_mage_touch_of_the_magi_aura::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } +}; + /* 228597 - Frostbolt 84721 - Frozen Orb 190357 - Blizzard */ @@ -824,6 +867,7 @@ void AddSC_mage_spell_scripts() RegisterAuraScript(spell_mage_ring_of_frost); RegisterSpellAndAuraScriptPair(spell_mage_ring_of_frost_freeze, spell_mage_ring_of_frost_freeze_AuraScript); RegisterSpellScript(spell_mage_time_warp); + RegisterAuraScript(spell_mage_touch_of_the_magi_aura); RegisterSpellScript(spell_mage_trigger_chilled); RegisterSpellScript(spell_mage_water_elemental_freeze); } |