aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp39
-rw-r--r--src/server/scripts/Northrend/zone_zuldrak.cpp98
2 files changed, 137 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);
}
diff --git a/src/server/scripts/Northrend/zone_zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp
index af666d28170..ecaeda85eb1 100644
--- a/src/server/scripts/Northrend/zone_zuldrak.cpp
+++ b/src/server/scripts/Northrend/zone_zuldrak.cpp
@@ -949,6 +949,100 @@ public:
}
};
+enum ScourgeDisguise
+{
+ SPELL_SCOURGE_DISGUISE = 51966,
+ SPELL_SCOURGE_DISGUISE_INSTABILITY = 51971,
+ SPELL_SCOURGE_DISGUISE_EXPIRING = 52010,
+ SPELL_DROP_DISGUISE = 54089,
+ TEXT_DISGUISE_WARNING = 28891
+};
+
+class spell_scourge_disguise : public AuraScript
+{
+ PrepareAuraScript(spell_scourge_disguise);
+
+ void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+ target->CastSpell(target, SPELL_SCOURGE_DISGUISE_INSTABILITY, true);
+ }
+
+ void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+ target->RemoveAura(SPELL_SCOURGE_DISGUISE_INSTABILITY);
+ }
+
+ void Register() override
+ {
+ OnEffectRemove += AuraEffectRemoveFn(spell_scourge_disguise::RemoveEffect, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL);
+ OnEffectApply += AuraEffectApplyFn(spell_scourge_disguise::ApplyEffect, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL);
+ }
+};
+
+class spell_scourge_disguise_instability : public AuraScript
+{
+ PrepareAuraScript(spell_scourge_disguise_instability);
+
+ void CalcPeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& amplitude)
+ {
+ isPeriodic = true;
+ amplitude = irand(30, 240) * IN_MILLISECONDS;
+ }
+
+ void HandleDummyTick(AuraEffect const* /*aurEff*/)
+ {
+ GetTarget()->CastSpell(GetTarget(), SPELL_SCOURGE_DISGUISE_EXPIRING, true);
+ }
+
+ void HandleUpdatePeriodic(AuraEffect* aurEff)
+ {
+ aurEff->CalculatePeriodic(GetCaster());
+ }
+
+ void Register() override
+ {
+ DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_scourge_disguise_instability::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_scourge_disguise_instability::HandleDummyTick, EFFECT_0, SPELL_AURA_DUMMY);
+ OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_scourge_disguise_instability::HandleUpdatePeriodic, EFFECT_0, SPELL_AURA_DUMMY);
+ }
+};
+
+class spell_scourge_disguise_expiring : public AuraScript
+{
+ PrepareAuraScript(spell_scourge_disguise_expiring);
+
+ void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Player* player = GetTarget()->ToPlayer())
+ if (Aura* aura = player->GetAura(SPELL_SCOURGE_DISGUISE))
+ player->Unit::Whisper(TEXT_DISGUISE_WARNING, player, true);
+ }
+
+ void Register() override
+ {
+ OnEffectApply += AuraEffectApplyFn(spell_scourge_disguise_expiring::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+};
+
+class spell_drop_disguise : public SpellScript
+{
+ PrepareSpellScript(spell_drop_disguise);
+
+ void HandleHit()
+ {
+ if (Unit* target = GetHitUnit())
+ if (Aura* aura = target->GetAura(SPELL_SCOURGE_DISGUISE))
+ target->CastSpell(target, SPELL_SCOURGE_DISGUISE_EXPIRING, true);
+ }
+
+ void Register() override
+ {
+ AfterHit += SpellHitFn(spell_drop_disguise::HandleHit);
+ }
+};
+
void AddSC_zuldrak()
{
new npc_drakuru_shackles();
@@ -963,4 +1057,8 @@ void AddSC_zuldrak()
new spell_pot_check();
new spell_fetch_ingredient_aura();
new npc_storm_cloud();
+ RegisterAuraScript(spell_scourge_disguise);
+ RegisterAuraScript(spell_scourge_disguise_instability);
+ RegisterAuraScript(spell_scourge_disguise_expiring);
+ RegisterSpellScript(spell_drop_disguise);
}