6#ifndef SF_SKYFIRE_VEHICLE_H
7#define SF_SKYFIRE_VEHICLE_H
33 void Reset(
bool evading =
false);
std::set< uint64 > GuidSet
std::set< uint64 > GuidSet
std::map< int8, VehicleSeat > SeatMap
virtual void CalculatePassengerPosition(float &x, float &y, float &z, float *o=NULL) const =0
This method transforms supplied transport offsets into global coordinates.
virtual void CalculatePassengerOffset(float &x, float &y, float &z, float *o=NULL) const =0
This method transforms supplied global coordinates into local offsets.
void RemoveVehicleKit(bool remove=false)
bool CreateVehicleKit(uint32 id, uint32 creatureEntry, bool loading=false)
Vehicle(Unit *unit, VehicleEntry const *vehInfo, uint32 creatureEntry)
uint8 GetAvailableSeatCount() const
Gets the available seat count.
Unit * GetBase() const
May be called from scripts.
Unit * GetPassenger(int8 seatId) const
Gets a passenger on specified seat.
void ApplyAllImmunities()
Applies specific immunities that cannot be set in DB.
void RemovePendingEvent(VehicleJoinEvent *e)
Removes @VehicleJoinEvent objects from pending join event store. This method only removes it after it...
SeatMap::iterator GetSeatIteratorForPassenger(Unit *passenger)
Gets seat iterator for specified passenger.
void SetLastShootPos(Position const &pos)
VehicleEntry const * GetVehicleInfo() const
void Reset(bool evading=false)
Reapplies immunities and reinstalls accessories. Only has effect for creatures.
Vehicle * RemovePassenger(Unit *passenger)
Removes the passenger from the vehicle.
void InitMovementInfoForBase()
Sets correct MovementFlags2 based on VehicleFlags from DBC.
bool AddPassenger(Unit *passenger, int8 seatId=-1)
Attempts to add a passenger to the vehicle on 'seatId'.
void CalculatePassengerPosition(float &x, float &y, float &z, float *o) const
This method transforms supplied transport offsets into global coordinates.
uint32 GetCreatureEntry() const
void RemoveAllPassengers()
Removes all current and pending passengers from the vehicle.
void InstallAccessory(uint32 entry, int8 seatId, bool minion, TempSummonType type, uint32 summonTime)
Installs an accessory.
bool IsVehicleInUse() const
Returns information whether the vehicle is currently used by any unit.
uint32 UsableSeatNum
Number of seats that match VehicleSeatEntry::UsableByPlayer, used for proper display flags.
std::list< VehicleJoinEvent * > PendingJoinEventContainer
uint32 _creatureEntry
Can be different than the entry of _me in case of players.
Status _status
Internal variable for sanity checks.
void Uninstall()
Removes all passengers and sets status to STATUS_UNINSTALLING. No new passengers can be added to the ...
void RemovePendingEventsForSeat(int8 seatId)
Removes any pending events for given seatId. Executed when a @VehicleJoinEventExecute is called.
Unit * _me
The underlying unit with the vehicle kit. Can be player or creature.
bool HasEmptySeat(int8 seatId) const
Checks if vehicle's seat specified by 'seatId' is empty.
PendingJoinEventContainer _pendingJoinEvents
Collection of delayed join events for prospective passengers.
VehicleSeatEntry const * GetSeatForPassenger(Unit const *passenger) const
Returns information on the seat of specified passenger, represented by the format in VehicleSeat....
void Install()
Initializes power type for vehicle. Nothing more.
void RelocatePassengers()
Relocate passengers. Must be called after m_base::Relocate.
SeatMap Seats
The collection of all seats on the vehicle. Including vacant ones.
Position const & GetLastShootPos() const
SeatMap::const_iterator GetNextEmptySeat(int8 seatId, bool next) const
Gets the next empty seat based on current seat.
friend class VehicleJoinEvent
void RemovePendingEventsForPassenger(Unit *passenger)
VehicleEntry const * _vehicleInfo
DBC data for vehicle.
void InstallAllAccessories(bool evading)
void CalculatePassengerOffset(float &x, float &y, float &z, float *o) const
This method transforms supplied global coordinates into local offsets.
bool Execute(uint64, uint32)
Actually adds the passenger @Passenger to vehicle @Target.
void Abort(uint64)
Aborts the event. Implies that unit @Passenger will not be boarding vehicle @Target after all.
VehicleJoinEvent(Vehicle *v, Unit *u)