diff options
| author | PolarCookie <sei009@post.uit.no> | 2018-12-31 11:50:16 +0100 |
|---|---|---|
| committer | Aokromes <Aokromes@users.noreply.github.com> | 2018-12-31 11:50:16 +0100 |
| commit | 66720e5fd94015e9884060bb66c3093484855880 (patch) | |
| tree | 5e3ab77e8989e7ddd6dd092df388377d474fb964 /src/server/scripts/EasternKingdoms | |
| parent | 1c4cdfd32503d9331be21d144581f48c8b4175fd (diff) | |
Spell/Script: Scourge Disguise and Haunting Phantoms (#22727)
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
| -rw-r--r-- | src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp index ee9f5764354..93bbe8f88ed 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp @@ -41,6 +41,7 @@ EndContentData */ #include "ScriptedCreature.h" #include "SpellInfo.h" #include "SpellScript.h" +#include "SpellAuraEffects.h" #include "stratholme.h" /*###### @@ -332,10 +333,48 @@ class spell_ysida_saved_credit : public SpellScript } }; +enum HauntingPhantoms +{ + SPELL_SUMMON_SPITEFUL_PHANTOM = 16334, + SPELL_SUMMON_WRATH_PHANTOM = 16335 +}; + +class spell_stratholme_haunting_phantoms : public AuraScript +{ + PrepareAuraScript(spell_stratholme_haunting_phantoms); + + void CalcPeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& amplitude) + { + isPeriodic = true; + amplitude = irand(30, 90) * IN_MILLISECONDS; + } + + void HandleDummyTick(AuraEffect const* /*aurEff*/) + { + if (roll_chance_i(50)) + GetTarget()->CastSpell(nullptr, SPELL_SUMMON_SPITEFUL_PHANTOM, true); + else + GetTarget()->CastSpell(nullptr, SPELL_SUMMON_WRATH_PHANTOM, true); + } + + void HandleUpdatePeriodic(AuraEffect* aurEff) + { + aurEff->CalculatePeriodic(GetCaster()); + } + + void Register() override + { + DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_stratholme_haunting_phantoms::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_stratholme_haunting_phantoms::HandleDummyTick, EFFECT_0, SPELL_AURA_DUMMY); + OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_stratholme_haunting_phantoms::HandleUpdatePeriodic, EFFECT_0, SPELL_AURA_DUMMY); + } +}; + void AddSC_stratholme() { new go_gauntlet_gate(); new npc_restless_soul(); new npc_spectral_ghostly_citizen(); RegisterSpellScript(spell_ysida_saved_credit); + RegisterAuraScript(spell_stratholme_haunting_phantoms); } |
