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
102: _self(self), _duration(duration) { }
Unit & _self
Definition: Vehicle.h:106
uint32 _duration
Definition: Vehicle.h:107

Member Function Documentation

◆ Execute()

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

Reimplemented from BasicEvent.

19710{
19711 Position pos = _self;
19712 _self.MovePositionToFirstCollision(pos, 20.0f, M_PI);
19713 _self.GetMotionMaster()->MovePoint(0, pos);
19715 return true;
19716}
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2173
Creature * ToCreature()
Definition: Object.h:202
void MovePositionToFirstCollision(Position &pos, float dist, float angle)
Definition: Object.cpp:2858
Definition: Position.h:28
MotionMaster * GetMotionMaster()
Definition: Unit.h:1601
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:211

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().