From bdb6ebf1ef20ff75754e856dbe7ef2d5c9688299 Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Sun, 22 Mar 2026 09:21:58 -0500 Subject: [PATCH] fix(Scripts/Stormpeaks): Add Oathbound Warder pet abilities (#24062) Co-authored-by: blinkysc Co-authored-by: Gultask <100873791+Gultask@users.noreply.github.com> Co-authored-by: sudlud --- .../rev_1765066149291553835.sql | 9 +++++ .../scripts/Northrend/zone_storm_peaks.cpp | 38 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1765066149291553835.sql diff --git a/data/sql/updates/pending_db_world/rev_1765066149291553835.sql b/data/sql/updates/pending_db_world/rev_1765066149291553835.sql new file mode 100644 index 000000000..14915bbd1 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1765066149291553835.sql @@ -0,0 +1,9 @@ +-- +UPDATE `creature_template` SET `ScriptName` = 'npc_oathbound_warder' WHERE `entry` = 30270; + +DELETE FROM `creature_template_spell` WHERE `CreatureID` = 30270; +INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES +(30270, 0, 56491, 0), +(30270, 1, 56425, 0), +(30270, 2, 56451, 0), +(30270, 3, 56506, 0); diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index 4b4b17728..7f3c5873a 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -20,6 +20,7 @@ #include "CreatureScript.h" #include "Player.h" #include "ScriptedCreature.h" +#include "SpellMgr.h" #include "ScriptedEscortAI.h" #include "ScriptedGossip.h" #include "SpellAuraEffects.h" @@ -1340,9 +1341,46 @@ class spell_eject_passenger_wild_wyrm : public SpellScript } }; +struct npc_oathbound_warder : public ScriptedAI +{ + npc_oathbound_warder(Creature* creature) : ScriptedAI(creature) { } + + void AttackStart(Unit* /*who*/) override { } + void JustEngagedWith(Unit* /*who*/) override { } + void UpdateAI(uint32 /*diff*/) override { } // Need so AI doesn't stop casting when hit in combat + + void InitializeAI() override + { + ScriptedAI::InitializeAI(); + me->SetReactState(REACT_PASSIVE); + + CharmInfo* charmInfo = me->GetCharmInfo(); + if (!charmInfo) + return; + + charmInfo->InitEmptyActionBar(false); + + uint32 slot = 0; + for (uint32 i = 0; i < MAX_CREATURE_SPELLS; ++i) + { + uint32 spellId = me->m_spells[i]; + if (!spellId) + continue; + + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); + if (spellInfo && spellInfo->IsPassive()) + me->CastSpell(me, spellInfo, true); + + charmInfo->SetActionBar(6 + slot, spellId, ACT_PASSIVE); + ++slot; + } + } +}; + void AddSC_storm_peaks() { RegisterCreatureAI(npc_frosthound); + RegisterCreatureAI(npc_oathbound_warder); new npc_iron_watcher(); new npc_time_lost_proto_drake(); RegisterSpellScript(spell_q13007_iron_colossus);