diff options
| author | offl <11556157+offl@users.noreply.github.com> | 2025-07-12 15:55:24 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-12 14:55:24 +0200 |
| commit | 53daa087aedcc0f68c935628f181256d89914ae2 (patch) | |
| tree | 071367620770ded1bc3db854c142d337c1ed8b38 /src/server/scripts/EasternKingdoms | |
| parent | a2a3c6531152fc5e8b7fabb51e932caa7b8e94f5 (diff) | |
Scripts/Spells: Migrate & update non-generic quest spell scripts to zone files (#31100)
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
| -rw-r--r-- | src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp | 134 | ||||
| -rw-r--r-- | src/server/scripts/EasternKingdoms/eastern_kingdoms.cpp | 39 |
2 files changed, 172 insertions, 1 deletions
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 60437c0eb78..a67d266d288 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -31,6 +31,7 @@ #include "Player.h" #include "ScriptedEscortAI.h" #include "ScriptedGossip.h" +#include "SpellAuraEffects.h" #include "SpellInfo.h" #include "SpellScript.h" #include "TemporarySummon.h" @@ -517,6 +518,92 @@ private: EventMap _events; }; +enum DeathComesFromOnHigh +{ + SPELL_FORGE_CREDIT = 51974, + SPELL_TOWN_HALL_CREDIT = 51977, + SPELL_SCARLET_HOLD_CREDIT = 51980, + SPELL_CHAPEL_CREDIT = 51982, + + NPC_NEW_AVALON_FORGE = 28525, + NPC_NEW_AVALON_TOWN_HALL = 28543, + NPC_SCARLET_HOLD = 28542, + NPC_CHAPEL_OF_THE_CRIMSON_FLAME = 28544 +}; + +// 51858 - Siphon of Acherus +class spell_chapter1_siphon_of_acherus : public SpellScript +{ + PrepareSpellScript(spell_chapter1_siphon_of_acherus); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( + { + SPELL_FORGE_CREDIT, + SPELL_TOWN_HALL_CREDIT, + SPELL_SCARLET_HOLD_CREDIT, + SPELL_CHAPEL_CREDIT + }); + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + uint32 spellId = 0; + + switch (GetHitCreature()->GetEntry()) + { + case NPC_NEW_AVALON_FORGE: + spellId = SPELL_FORGE_CREDIT; + break; + case NPC_NEW_AVALON_TOWN_HALL: + spellId = SPELL_TOWN_HALL_CREDIT; + break; + case NPC_SCARLET_HOLD: + spellId = SPELL_SCARLET_HOLD_CREDIT; + break; + case NPC_CHAPEL_OF_THE_CRIMSON_FLAME: + spellId = SPELL_CHAPEL_CREDIT; + break; + default: + return; + } + + GetCaster()->CastSpell(nullptr, spellId, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_chapter1_siphon_of_acherus::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + +// 52694 - Recall Eye of Acherus +class spell_chapter1_recall_eye_of_acherus : public SpellScript +{ + PrepareSpellScript(spell_chapter1_recall_eye_of_acherus); + + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo({ SPELL_THE_EYE_OF_ACHERUS }); + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Player* player = Object::ToPlayer(GetCaster()->GetCharmerOrOwner())) + { + player->StopCastingCharm(); + player->StopCastingBindSight(); + player->RemoveAura(SPELL_THE_EYE_OF_ACHERUS); + } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_chapter1_recall_eye_of_acherus::HandleDummy, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + /*###### ## npc_death_knight_initiate ######*/ @@ -1169,6 +1256,49 @@ class spell_chapter1_sky_darkener_assault : public SpellScript } }; +/*###### +## Quest 12619: The Emblazoned Runeblade +######*/ + +// 51769 - Emblazon Runeblade +class spell_chapter1_emblazon_runeblade : public AuraScript +{ + PrepareAuraScript(spell_chapter1_emblazon_runeblade); + + void HandleEffectPeriodic(AuraEffect const* aurEff) + { + PreventDefaultAction(); + if (Unit* caster = GetCaster()) + caster->CastSpell(caster, aurEff->GetSpellEffectInfo().TriggerSpell, aurEff); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_chapter1_emblazon_runeblade::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + +// 51770 - Emblazon Runeblade +class spell_chapter1_emblazon_runeblade_effect : public SpellScript +{ + PrepareSpellScript(spell_chapter1_emblazon_runeblade_effect); + + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetCaster(), uint32(GetEffectValue()), false); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_chapter1_emblazon_runeblade_effect::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_the_scarlet_enclave_c1() { new npc_unworthy_initiate(); @@ -1176,6 +1306,8 @@ void AddSC_the_scarlet_enclave_c1() new go_acherus_soul_prison(); RegisterSpellScript(spell_death_knight_initiate_visual); RegisterCreatureAI(npc_eye_of_acherus); + RegisterSpellScript(spell_chapter1_siphon_of_acherus); + RegisterSpellScript(spell_chapter1_recall_eye_of_acherus); new npc_death_knight_initiate(); RegisterCreatureAI(npc_dark_rider_of_acherus); new npc_salanar_the_horseman(); @@ -1187,4 +1319,6 @@ void AddSC_the_scarlet_enclave_c1() RegisterSpellScript(spell_gift_of_the_harvester); RegisterSpellScript(spell_chapter1_runeforging_credit); RegisterSpellScript(spell_chapter1_sky_darkener_assault); + RegisterSpellScript(spell_chapter1_emblazon_runeblade); + RegisterSpellScript(spell_chapter1_emblazon_runeblade_effect); } diff --git a/src/server/scripts/EasternKingdoms/eastern_kingdoms.cpp b/src/server/scripts/EasternKingdoms/eastern_kingdoms.cpp index 4e36f5e5c39..c9c77f79970 100644 --- a/src/server/scripts/EasternKingdoms/eastern_kingdoms.cpp +++ b/src/server/scripts/EasternKingdoms/eastern_kingdoms.cpp @@ -20,7 +20,7 @@ #include "SpellScript.h" #include "Unit.h" -enum Translocation +enum EasternKingdomsTranslocation { SPELL_TRANSLOCATION_DUSKWITHER_SPIRE_UP = 26566, SPELL_TRANSLOCATION_DUSKWITHER_SPIRE_DOWN = 26572, @@ -112,6 +112,10 @@ class spell_eastern_kingdoms_undercity_to_silvermoon : public SpellScript } }; +/*###### +## Quest 11532: Distraction at the Dead Scar / 11533: The Air Strikes Must Continue +######*/ + enum DeadScarBombingRun { SOUND_ID_BOMBING_RUN = 12318 @@ -164,6 +168,38 @@ class spell_eastern_kingdoms_dawnblade_attack : public SpellScript } }; +/*###### +## Quest 2203: Badlands Reagent Run II +######*/ + +enum BadlandsReagentRun +{ + SPELL_THAUMATURGY_CHANNEL = 21029 +}; + +// 9712 - Thaumaturgy Channel +class spell_eastern_kingdoms_thaumaturgy_channel : public AuraScript +{ + PrepareAuraScript(spell_eastern_kingdoms_thaumaturgy_channel); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_THAUMATURGY_CHANNEL }); + } + + void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) + { + PreventDefaultAction(); + if (Unit* caster = GetCaster()) + caster->CastSpell(caster, SPELL_THAUMATURGY_CHANNEL, false); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_eastern_kingdoms_thaumaturgy_channel::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + void AddSC_eastern_kingdoms() { RegisterSpellScript(spell_eastern_kingdoms_duskwither_spire_up); @@ -172,4 +208,5 @@ void AddSC_eastern_kingdoms() RegisterSpellScript(spell_eastern_kingdoms_undercity_to_silvermoon); RegisterSpellScript(spell_eastern_kingdoms_dead_scar_bombing_run); RegisterSpellScript(spell_eastern_kingdoms_dawnblade_attack); + RegisterSpellScript(spell_eastern_kingdoms_thaumaturgy_channel); } |
