From 723b24ce9ade039d32e518cc94582fe0253ed306 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Wed, 17 Jun 2026 21:28:56 -0300 Subject: [PATCH] fix(Scripts/Ulduar): Salvaged Chopper can grab pyrite during Flame Leviathan (#26244) Co-authored-by: Claude Opus 4.8 --- .../rev_1781653877222108900.sql | 12 ++++++ .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 43 +++++++++++++------ 2 files changed, 42 insertions(+), 13 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1781653877222108900.sql diff --git a/data/sql/updates/pending_db_world/rev_1781653877222108900.sql b/data/sql/updates/pending_db_world/rev_1781653877222108900.sql new file mode 100644 index 000000000..802858190 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1781653877222108900.sql @@ -0,0 +1,12 @@ +-- Ulduar: Flame Leviathan - give the Salvaged Chopper its "Grab Pyrite" hook ability (spell 67372 -> 67387). +-- Mirrors the Salvaged Demolisher's "Grab Crate" (62479 -> 62482). + +-- Add "Grab Pyrite" (67372) to the Salvaged Chopper (33062) vehicle action bar. +DELETE FROM `creature_template_spell` WHERE `CreatureID`=33062 AND `Index`=4; +INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES +(33062, 4, 67372, 0); + +-- Bind the chopper's "Grab Crate" (67387, triggered by 67372) to the existing grab-pyrite script. +DELETE FROM `spell_script_names` WHERE `spell_id`=67387 AND `ScriptName`='spell_vehicle_grab_pyrite'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(67387, 'spell_vehicle_grab_pyrite'); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 610dce8ba..f763c60a4 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -1445,22 +1445,39 @@ class spell_vehicle_grab_pyrite : public SpellScript void HandleScript(SpellEffIndex /*effIndex*/) { - if (Unit* target = GetHitUnit()) - if (Unit* seat = GetCaster()->GetVehicleBase()) + Unit* target = GetHitUnit(); + if (!target) + return; + + // The grabbing vehicle: the demolisher's mechanic seat, or the chopper itself. + Unit* seat = GetCaster()->GetVehicleBase(); + if (!seat) + return; + + if (Vehicle* vehicle = seat->GetVehicleKit()) + if (Unit* passenger = vehicle->GetPassenger(1)) { - if (Vehicle* vehicle = seat->GetVehicleKit()) - if (Unit* pyrite = vehicle->GetPassenger(1)) - pyrite->ExitVehicle(); + // On the chopper the rear seat may carry a player; never eject them to grab. + if (passenger->IsPlayer()) + return; - if (Unit* parent = seat->GetVehicleBase()) - { - GetCaster()->CastSpell(parent, SPELL_ADD_PYRITE, true); - target->CastSpell(seat, GetEffectValue()); - - if (target->IsCreature()) - target->ToCreature()->DespawnOrUnsummon(1300ms); - } + passenger->ExitVehicle(); } + + if (Unit* parent = seat->GetVehicleBase()) + { + // Demolisher: the seat is mounted on a parent vehicle that the pyrite fuels. + GetCaster()->CastSpell(parent, SPELL_ADD_PYRITE, true); + target->CastSpell(seat, GetEffectValue()); + + if (target->IsCreature()) + target->ToCreature()->DespawnOrUnsummon(1300ms); + } + else + { + // Chopper: load the crate into the rear seat so it can be ferried to other vehicles. + target->CastSpell(seat, GetEffectValue()); + } } void Register() override