Scripts/Icecrown Citadel: Fixed Vengeful Shade despawning after it casts Vengeful Blast (Lady Deathwhisper)

Core/Auras: Implemented SPELL_AURA_SET_VEHICLE_ID (296)
Core/Scripts: Moved DefaultTargetSelector class into header file

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-11-10 12:18:43 +01:00
parent cc220ca7b6
commit e3d4b36a6b
5 changed files with 94 additions and 52 deletions
@@ -6348,3 +6348,35 @@ void AuraEffect::HandleAuraOpenStable(AuraApplication const * aurApp, uint8 mode
// client auto close stable dialog at !apply aura
}
void AuraEffect::HandleAuraSetVehicle(AuraApplication const * aurApp, uint8 mode, bool apply) const
{
if (!(mode & AURA_EFFECT_HANDLE_REAL))
return;
Unit * target = aurApp->GetTarget();
if (target->GetTypeId() != TYPEID_PLAYER || !target->IsInWorld())
return;
uint32 vehicleId = GetMiscValue();
if (apply)
{
if (!target->CreateVehicleKit(vehicleId))
return;
}
else if (target->GetVehicleKit())
target->RemoveVehicleKit();
WorldPacket data(SMSG_PLAYER_VEHICLE_DATA, target->GetPackGUID().size()+4);
data.appendPackGUID(target->GetGUID());
data << uint32(apply ? vehicleId : 0);
target->SendMessageToSet(&data, true);
if (apply)
{
data.Initialize(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0);
target->ToPlayer()->GetSession()->SendPacket(&data);
}
}