diff options
-rw-r--r-- | sql/updates/world/3.3.5/2019_06_22_01_world.sql | 4 | ||||
-rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 14 | ||||
-rw-r--r-- | src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp | 28 |
3 files changed, 32 insertions, 14 deletions
diff --git a/sql/updates/world/3.3.5/2019_06_22_01_world.sql b/sql/updates/world/3.3.5/2019_06_22_01_world.sql new file mode 100644 index 00000000000..3ae3cc42291 --- /dev/null +++ b/sql/updates/world/3.3.5/2019_06_22_01_world.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_teleport_leaders_blessing'); +INSERT INTO `spell_script_names` VALUES +(58418,'spell_teleport_leaders_blessing'), +(58420,'spell_teleport_leaders_blessing'); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 3f277336e4b..130aa55d41e 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3666,20 +3666,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) return; } - case 58418: // Portal to Orgrimmar - case 58420: // Portal to Stormwind - { - if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER || effIndex != 0) - return; - - uint32 spellID = m_spellInfo->Effects[EFFECT_0].CalcValue(); - uint32 questID = m_spellInfo->Effects[EFFECT_1].CalcValue(); - - if (unitTarget->ToPlayer()->GetQuestStatus(questID) == QUEST_STATUS_COMPLETE) - unitTarget->CastSpell(unitTarget, spellID, true); - - return; - } case 62482: // Grab Crate { if (!unitCaster) diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 1cd958c75cb..3f9b7f814c7 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -23,6 +23,8 @@ #include "Player.h" #include "ScriptedEscortAI.h" #include "ScriptedGossip.h" +#include "SpellInfo.h" +#include "SpellScript.h" #include "TemporarySummon.h" #define LESS_MOB // if you do not have a good server and do not want it to be laggy as hell @@ -1664,8 +1666,34 @@ public: }; +// 58418 - Portal to Orgrimmar +// 58420 - Portal to Stormwind +class spell_teleport_leaders_blessing : public SpellScript +{ + PrepareSpellScript(spell_teleport_leaders_blessing); + + void HandleScriptEffect(SpellEffIndex /* effIndex */) + { + Player* target = GetHitPlayer(); + if (!target) + return; + + uint32 spellID = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); + uint32 questID = GetSpellInfo()->Effects[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); } |