AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
VehicleDespawnEvent Class Reference

#include "Vehicle.h"

Inheritance diagram for VehicleDespawnEvent:
BasicEvent

Public Member Functions

 VehicleDespawnEvent (Unit &self, uint32 duration)
 
bool Execute (uint64 e_time, uint32 p_time) override
 
- Public Member Functions inherited from BasicEvent
 BasicEvent ()=default
 
virtual ~BasicEvent ()=default
 
virtual bool Execute (uint64, uint32)
 
virtual bool IsDeletable () const
 
virtual void Abort (uint64)
 
void ScheduleAbort ()
 

Protected Attributes

Unit_self
 
uint32 _duration
 

Detailed Description

Constructor & Destructor Documentation

◆ VehicleDespawnEvent()

VehicleDespawnEvent::VehicleDespawnEvent ( Unit self,
uint32  duration 
)
inline
103: _self(self), _duration(duration) { }
Unit & _self
Definition: Vehicle.h:107
uint32 _duration
Definition: Vehicle.h:108

Member Function Documentation

◆ Execute()

bool VehicleDespawnEvent::Execute ( uint64  e_time,
uint32  p_time 
)
overridevirtual

Reimplemented from BasicEvent.

19764{
19765 Position pos = _self;
19766 _self.MovePositionToFirstCollision(pos, 20.0f, M_PI);
19767 _self.GetMotionMaster()->MovePoint(0, pos);
19769 return true;
19770}
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2178
Creature * ToCreature()
Definition: Object.h:205
void MovePositionToFirstCollision(Position &pos, float dist, float angle)
Definition: Object.cpp:2871
Definition: Position.h:27
MotionMaster * GetMotionMaster()
Definition: Unit.h:1620
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:213

References _duration, _self, Creature::DespawnOrUnsummon(), Unit::GetMotionMaster(), MotionMaster::MovePoint(), WorldObject::MovePositionToFirstCollision(), and Object::ToCreature().

Member Data Documentation

◆ _duration

uint32 VehicleDespawnEvent::_duration
protected

Referenced by Execute().

◆ _self

Unit& VehicleDespawnEvent::_self
protected

Referenced by Execute().