From b31a9379b8da0bdeed0a11ce936876436bb32b76 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Tue, 24 Feb 2026 22:25:16 -0300 Subject: [PATCH] fix(Scripts/Ulduar): fix teleporters not activating after boss kills (#24860) Co-authored-by: Vincent-Michael Co-authored-by: Claude Sonnet 4.6 Co-authored-by: Keader --- .../rev_1771973777858165300.sql | 2 ++ .../rev_1771974367980813900.sql | 14 ++++++++ .../Northrend/Ulduar/Ulduar/ulduar.cpp | 36 +++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1771973777858165300.sql create mode 100644 data/sql/updates/pending_db_world/rev_1771974367980813900.sql diff --git a/data/sql/updates/pending_db_world/rev_1771973777858165300.sql b/data/sql/updates/pending_db_world/rev_1771973777858165300.sql new file mode 100644 index 000000000..515a8ce6e --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1771973777858165300.sql @@ -0,0 +1,2 @@ +-- +UPDATE `conditions` SET `ConditionValue3` = 2 WHERE `SourceGroup` = 10389 AND `SourceEntry` IN (0, 1, 2, 3, 4, 5, 6, 8) AND `SourceTypeOrReferenceId` = 15; diff --git a/data/sql/updates/pending_db_world/rev_1771974367980813900.sql b/data/sql/updates/pending_db_world/rev_1771974367980813900.sql new file mode 100644 index 000000000..3a4311632 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1771974367980813900.sql @@ -0,0 +1,14 @@ +DELETE FROM `smart_scripts` WHERE `entryorguid` = 194569 AND `source_type` = 1 AND `id` IN (0, 1, 2); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceGroup` = 2 AND `SourceEntry` = 194569 AND `SourceId` = 1; +DELETE FROM `spell_script_names` WHERE `spell_id` IN (64014, 64024, 64025, 64028, 64029, 64030, 64031, 64032, 65042); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(64014, 'spell_ulduar_teleporter'), +(64024, 'spell_ulduar_teleporter'), +(64025, 'spell_ulduar_teleporter'), +(64028, 'spell_ulduar_teleporter'), +(64029, 'spell_ulduar_teleporter'), +(64030, 'spell_ulduar_teleporter'), +(64031, 'spell_ulduar_teleporter'), +(64032, 'spell_ulduar_teleporter'), +(65042, 'spell_ulduar_teleporter'); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.cpp index 4a72bf5ab..0601363a2 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.cpp @@ -23,6 +23,7 @@ #include "Player.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" +#include "Spell.h" #include "SpellAuraEffects.h" #include "SpellScript.h" #include "SpellScriptLoader.h" @@ -544,9 +545,44 @@ struct npc_salvaged_siege_engine : public VehicleAI } }; +// 64014 - Expedition Base Camp Teleport +// 64024 - Conservatory of Life Teleport +// 64025 - Halls of Invention Teleport +// 64028 - Colossal Forge Teleport +// 64029 - Shattered Walkway Teleport +// 64030 - Antechamber of Ulduar Teleport +// 64031 - Scrapyard Teleport +// 64032 - Formation Grounds Teleport +// 65042 - Prison of Yogg-Saron Teleport +class spell_ulduar_teleporter : public SpellScript +{ + PrepareSpellScript(spell_ulduar_teleporter); + + SpellCastResult CheckRequirement() + { + Unit* target = GetExplTargetUnit(); + if (!target || !target->IsPlayer()) + return SPELL_FAILED_DONT_REPORT; + + if (target->IsInCombat()) + { + Spell::SendCastResult(target->ToPlayer(), GetSpellInfo(), 0, SPELL_FAILED_AFFECTING_COMBAT); + return SPELL_FAILED_AFFECTING_COMBAT; + } + + return SPELL_CAST_OK; + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_ulduar_teleporter::CheckRequirement); + } +}; + void AddSC_ulduar() { new npc_ulduar_keeper(); + RegisterSpellScript(spell_ulduar_teleporter); RegisterSpellScript(spell_ulduar_energy_sap_aura); RegisterUlduarCreatureAI(npc_ulduar_snow_mound); RegisterUlduarCreatureAI(npc_ulduar_storm_tempered_keeper);