From 5ed83ed27c676ae2dcf661409550ce0fcbffe5c8 Mon Sep 17 00:00:00 2001 From: offl <11556157+offl@users.noreply.github.com> Date: Fri, 9 May 2025 01:10:43 +0300 Subject: Scripts/Spells: Get rid of some database spell scripts (#30915) --- .../TempleOfAhnQiraj/temple_of_ahnqiraj.cpp | 74 ++++++++++++++++++++++ .../scripts/Kalimdor/kalimdor_script_loader.cpp | 2 + 2 files changed, 76 insertions(+) create mode 100644 src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.cpp (limited to 'src/server/scripts/Kalimdor') diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.cpp new file mode 100644 index 00000000000..998138c40d7 --- /dev/null +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.cpp @@ -0,0 +1,74 @@ +/* + * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include "ScriptMgr.h" +#include "SpellScript.h" +#include "Unit.h" + +enum Spells +{ + SPELL_TELEPORT_TO_TWIN_EMPS_EFFECT = 29181, + SPELL_TELEPORT_TO_FINAL_CHAMBER_EFFECT = 29190 +}; + +// 29182 - Teleport to Twin Emperors +class spell_temple_of_ahnqiraj_teleport_to_twin_emperors : public SpellScript +{ + PrepareSpellScript(spell_temple_of_ahnqiraj_teleport_to_twin_emperors); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_TELEPORT_TO_TWIN_EMPS_EFFECT }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->CastSpell(GetHitUnit(), SPELL_TELEPORT_TO_TWIN_EMPS_EFFECT); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_temple_of_ahnqiraj_teleport_to_twin_emperors::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + +// 29188 - Teleport to Final Chamber +class spell_temple_of_ahnqiraj_teleport_to_final_chamber : public SpellScript +{ + PrepareSpellScript(spell_temple_of_ahnqiraj_teleport_to_final_chamber); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_TELEPORT_TO_FINAL_CHAMBER_EFFECT }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->CastSpell(GetHitUnit(), SPELL_TELEPORT_TO_FINAL_CHAMBER_EFFECT); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_temple_of_ahnqiraj_teleport_to_final_chamber::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + +void AddSC_temple_of_ahnqiraj() +{ + RegisterSpellScript(spell_temple_of_ahnqiraj_teleport_to_twin_emperors); + RegisterSpellScript(spell_temple_of_ahnqiraj_teleport_to_final_chamber); +} diff --git a/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp b/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp index 7f0d324e920..4506c2e4b7f 100644 --- a/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp +++ b/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp @@ -95,6 +95,7 @@ void AddSC_boss_twinemperors(); void AddSC_boss_ouro(); void AddSC_npc_anubisath_sentinel(); void AddSC_instance_temple_of_ahnqiraj(); +void AddSC_temple_of_ahnqiraj(); // Wailing caverns void AddSC_wailing_caverns(); void AddSC_instance_wailing_caverns(); @@ -208,6 +209,7 @@ void AddKalimdorScripts() AddSC_boss_ouro(); AddSC_npc_anubisath_sentinel(); AddSC_instance_temple_of_ahnqiraj(); + AddSC_temple_of_ahnqiraj(); // Wailing caverns AddSC_wailing_caverns(); AddSC_instance_wailing_caverns(); -- cgit v1.2.3