Core/Quest: Threat From Above
Port From (https://github.com/TrinityCore/TrinityCore/commit/8202dc28c2dae613c14a52ef4e84932d8c1c9e39)
This commit is contained in:
@@ -1126,6 +1126,15 @@ namespace Game.Entities
|
|||||||
return $"{base.GetDebugInfo()}\nAIName: {GetAIName()} ScriptName: {GetScriptName()} WaypointPath: {GetWaypointPath()} SpawnId: {GetSpawnId()}";
|
return $"{base.GetDebugInfo()}\nAIName: {GetAIName()} ScriptName: {GetScriptName()} WaypointPath: {GetWaypointPath()} SpawnId: {GetSpawnId()}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void ExitVehicle(Position exitPosition = null)
|
||||||
|
{
|
||||||
|
base.ExitVehicle();
|
||||||
|
|
||||||
|
// if the creature exits a vehicle, set it's home position to the
|
||||||
|
// exited position so it won't run away (home) and evade if it's hostile
|
||||||
|
SetHomePosition(GetPosition());
|
||||||
|
}
|
||||||
|
|
||||||
public override bool IsMovementPreventedByCasting()
|
public override bool IsMovementPreventedByCasting()
|
||||||
{
|
{
|
||||||
// first check if currently a movement allowed channel is active and we're not casting
|
// first check if currently a movement allowed channel is active and we're not casting
|
||||||
|
|||||||
@@ -999,7 +999,7 @@ namespace Game.Entities
|
|||||||
rideVehicleEffect.ChangeAmount((seatId < 0 ? GetTransSeat() : seatId) + 1);
|
rideVehicleEffect.ChangeAmount((seatId < 0 ? GetTransSeat() : seatId) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ExitVehicle(Position exitPosition = null)
|
public virtual void ExitVehicle(Position exitPosition = null)
|
||||||
{
|
{
|
||||||
//! This function can be called at upper level code to initialize an exit from the passenger's side.
|
//! This function can be called at upper level code to initialize an exit from the passenger's side.
|
||||||
if (m_vehicle == null)
|
if (m_vehicle == null)
|
||||||
|
|||||||
@@ -3445,6 +3445,34 @@ namespace Scripts.Spells.Generic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Script("spell_gen_eject_passenger_1", 0)]
|
||||||
|
[Script("spell_gen_eject_passenger_3", 2)]
|
||||||
|
class spell_gen_eject_passenger_with_seatId : SpellScript
|
||||||
|
{
|
||||||
|
sbyte _seatId;
|
||||||
|
|
||||||
|
public spell_gen_eject_passenger_with_seatId(sbyte seatId)
|
||||||
|
{
|
||||||
|
_seatId = seatId;
|
||||||
|
}
|
||||||
|
|
||||||
|
void EjectPassenger(uint effIndex)
|
||||||
|
{
|
||||||
|
Vehicle vehicle = GetHitUnit().GetVehicleKit();
|
||||||
|
if (vehicle != null)
|
||||||
|
{
|
||||||
|
Unit passenger = vehicle.GetPassenger(_seatId);
|
||||||
|
if (passenger != null)
|
||||||
|
passenger.ExitVehicle();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Register()
|
||||||
|
{
|
||||||
|
OnEffectHitTarget.Add(new EffectHandler(EjectPassenger, 0, SpellEffectName.ScriptEffect));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[Script]
|
[Script]
|
||||||
class spell_gen_gm_freeze : AuraScript
|
class spell_gen_gm_freeze : AuraScript
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user