aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/EasternKingdoms
diff options
context:
space:
mode:
authorPolarCookie <sei009@post.uit.no>2018-12-31 11:50:16 +0100
committerShauren <shauren.trinity@gmail.com>2021-11-16 22:00:58 +0100
commitfa07f74db26bacf05745284038b4526435dfae7e (patch)
tree73e8fffbc649caf81b84cc39db8c04adee75d564 /src/server/scripts/EasternKingdoms
parent3ba2547ec066ef0feadad8e80ab8a92a89f07f2b (diff)
Spell/Script: Scourge Disguise and Haunting Phantoms (#22727)
(cherry picked from commit 66720e5fd94015e9884060bb66c3093484855880)
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp39
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 ac11c7eea34..0e3bed8db8f 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
@@ -40,6 +40,7 @@ EndContentData */
#include "ScriptedCreature.h"
#include "SpellInfo.h"
#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "stratholme.h"
/*######
@@ -331,10 +332,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);
}