mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
Scripts/IcecrownCitadel: Prevent players from becoming inaccessible when killed by Lord Marrowgar's Impale spell (the initial damage, not the DoT). Also fix the underlying bug in vehicle logic.
This commit is contained in:
@@ -402,7 +402,7 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion, uint8 typ
|
||||
* @author Machiavelli
|
||||
* @date 17-2-2013
|
||||
*
|
||||
* @param [in, out] The prospective passenger.
|
||||
* @param unit The prospective passenger.
|
||||
* @param seatId Identifier for the seat. Value of -1 indicates the next available seat.
|
||||
*
|
||||
* @return true if it succeeds, false if it fails.
|
||||
@@ -773,6 +773,13 @@ bool VehicleJoinEvent::Execute(uint64, uint32)
|
||||
Target->RemovePendingEventsForSeat(Seat->first);
|
||||
Target->RemovePendingEventsForPassenger(Passenger);
|
||||
|
||||
// Passenger might've died in the meantime - abort if this is the case
|
||||
if (!Passenger->IsAlive())
|
||||
{
|
||||
Abort(0);
|
||||
return true;
|
||||
}
|
||||
|
||||
Passenger->SetVehicle(Target);
|
||||
Seat->second.Passenger.Guid = Passenger->GetGUID();
|
||||
Seat->second.Passenger.IsUnselectable = Passenger->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
@@ -654,6 +654,15 @@ class spell_marrowgar_bone_spike_graveyard : public SpellScriptLoader
|
||||
{
|
||||
Unit* target = *itr;
|
||||
target->CastSpell(target, BoneSpikeSummonId[i], true);
|
||||
if (!target->IsAlive()) // make sure we don't get any stuck spikes on dead targets
|
||||
{
|
||||
if (Aura* aura = target->GetAura(SPELL_IMPALED))
|
||||
{
|
||||
if (Creature* spike = ObjectAccessor::GetCreature(*target, aura->GetCasterGUID()))
|
||||
spike->DespawnOrUnsummon();
|
||||
aura->Remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
marrowgarAI->Talk(SAY_BONESPIKE);
|
||||
|
||||
Reference in New Issue
Block a user