From 0097fd95b65a57c0e246b8250920edddebdb0e0c Mon Sep 17 00:00:00 2001 From: offl <11556157+offl@users.noreply.github.com> Date: Wed, 1 Dec 2021 02:52:31 +0200 Subject: Scripts/Spells: Generic spell script for quest portals (#27305) (cherry picked from commit 251304b19c2fc42ee330b9a533b54f7b80df5d4a) --- .../EasternKingdoms/ScarletEnclave/chapter5.cpp | 33 ---------------------- 1 file changed, 33 deletions(-) (limited to 'src/server/scripts/EasternKingdoms') diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 572b93e11a0..ed6910f792d 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -1672,41 +1672,8 @@ public: }; -// 58418 - Portal to Orgrimmar -// 58420 - Portal to Stormwind -class spell_teleport_leaders_blessing : public SpellScript -{ - PrepareSpellScript(spell_teleport_leaders_blessing); - - bool Validate(SpellInfo const* spellInfo) override - { - return spellInfo->GetEffects().size() > EFFECT_1 - && ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) }) - && sObjectMgr->GetQuestTemplate(spellInfo->GetEffect(EFFECT_1).CalcValue()) != nullptr; - } - - void HandleScriptEffect(SpellEffIndex /* effIndex */) - { - Player* target = GetHitPlayer(); - if (!target) - return; - - uint32 spellID = GetSpellInfo()->GetEffect(EFFECT_0).CalcValue(); - uint32 questID = GetSpellInfo()->GetEffect(EFFECT_1).CalcValue(); - - if (target->GetQuestStatus(questID) == QUEST_STATUS_COMPLETE) - target->CastSpell(target, spellID, true); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_teleport_leaders_blessing::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } -}; - void AddSC_the_scarlet_enclave_c5() { new npc_highlord_darion_mograine(); new npc_the_lich_king_tirion_dawn(); - RegisterSpellScript(spell_teleport_leaders_blessing); } -- cgit v1.2.3