From efe62bea4a598f13d9b8f30fb95723486b35786a Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Wed, 1 Mar 2023 17:16:37 -0300 Subject: [PATCH] fix(Scripts/IcecrownCitadel): fix Lord Marrowgar bone spikes (#15238) --- .../IcecrownCitadel/boss_lord_marrowgar.cpp | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index 1fa5d63ad..57b90967d 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -408,27 +408,29 @@ public: { if (!summoner) return; - - if (summoner->GetTypeId() != TYPEID_UNIT) + if (Unit* summonerUnit = summoner->ToUnit()) { - return; + if (Vehicle* v = summonerUnit->GetVehicle()) + { + if (Unit* u = v->GetBase()) + { + if (u->GetEntry() == NPC_BONE_SPIKE && u->GetTypeId() == TYPEID_UNIT) + { + u->ToCreature()->AI()->DoAction(-1337); + } + } + } + ObjectGuid petGUID = summonerUnit->GetPetGUID(); + summonerUnit->SetPetGUID(ObjectGuid::Empty); + me->CastSpell(summonerUnit, SPELL_IMPALED, true); + summonerUnit->CastSpell(me, SPELL_RIDE_VEHICLE, true); + //summoner->ClearUnitState(UNIT_STATE_ONVEHICLE); + summonerUnit->SetPetGUID(petGUID); + summonerUnit->GetMotionMaster()->Clear(); + summonerUnit->StopMoving(); + events.ScheduleEvent(1, 8000); + hasTrappedUnit = true; } - - if (Vehicle* v = summoner->ToUnit()->GetVehicle()) - if (Unit* u = v->GetBase()) - if (u->GetEntry() == NPC_BONE_SPIKE && u->GetTypeId() == TYPEID_UNIT) - u->ToCreature()->AI()->DoAction(-1337); - - ObjectGuid petGUID = summoner->ToUnit()->GetPetGUID(); - summoner->ToUnit()->SetPetGUID(ObjectGuid::Empty); - me->CastSpell(summoner->ToUnit(), SPELL_IMPALED, true); - summoner->ToUnit()->CastSpell(me, SPELL_RIDE_VEHICLE, true); - //summoner->ClearUnitState(UNIT_STATE_ONVEHICLE); - summoner->ToUnit()->SetPetGUID(petGUID); - summoner->ToUnit()->GetMotionMaster()->Clear(); - summoner->ToUnit()->StopMoving(); - events.ScheduleEvent(1, 8000); - hasTrappedUnit = true; } void UpdateAI(uint32 diff) override