fix(Scripts/IcecrownCitadel): fix Lord Marrowgar bone spikes (#15238)

This commit is contained in:
Skjalf
2023-03-01 17:16:37 -03:00
committed by GitHub
parent 78b97930f3
commit efe62bea4a
@@ -408,28 +408,30 @@ public:
{ {
if (!summoner) if (!summoner)
return; return;
if (Unit* summonerUnit = summoner->ToUnit())
if (summoner->GetTypeId() != TYPEID_UNIT) {
if (Vehicle* v = summonerUnit->GetVehicle())
{ {
return;
}
if (Vehicle* v = summoner->ToUnit()->GetVehicle())
if (Unit* u = v->GetBase()) if (Unit* u = v->GetBase())
{
if (u->GetEntry() == NPC_BONE_SPIKE && u->GetTypeId() == TYPEID_UNIT) if (u->GetEntry() == NPC_BONE_SPIKE && u->GetTypeId() == TYPEID_UNIT)
{
u->ToCreature()->AI()->DoAction(-1337); u->ToCreature()->AI()->DoAction(-1337);
}
ObjectGuid petGUID = summoner->ToUnit()->GetPetGUID(); }
summoner->ToUnit()->SetPetGUID(ObjectGuid::Empty); }
me->CastSpell(summoner->ToUnit(), SPELL_IMPALED, true); ObjectGuid petGUID = summonerUnit->GetPetGUID();
summoner->ToUnit()->CastSpell(me, SPELL_RIDE_VEHICLE, true); summonerUnit->SetPetGUID(ObjectGuid::Empty);
me->CastSpell(summonerUnit, SPELL_IMPALED, true);
summonerUnit->CastSpell(me, SPELL_RIDE_VEHICLE, true);
//summoner->ClearUnitState(UNIT_STATE_ONVEHICLE); //summoner->ClearUnitState(UNIT_STATE_ONVEHICLE);
summoner->ToUnit()->SetPetGUID(petGUID); summonerUnit->SetPetGUID(petGUID);
summoner->ToUnit()->GetMotionMaster()->Clear(); summonerUnit->GetMotionMaster()->Clear();
summoner->ToUnit()->StopMoving(); summonerUnit->StopMoving();
events.ScheduleEvent(1, 8000); events.ScheduleEvent(1, 8000);
hasTrappedUnit = true; hasTrappedUnit = true;
} }
}
void UpdateAI(uint32 diff) override void UpdateAI(uint32 diff) override
{ {