View Full Version : Eluna | Added Vehicle Support (Hooks & Methods) and Auction Hooks

12-29-2013, 01:33 AM
After finally finishing up and testing, it is here! Note: The wiki will be updated tomorrow.

Auction Hooks

-- RegisterServerEvent(eventId, function)

OnAdd(event, ah)
OnRemove(event, ah)
OnSuccessful(event, ah)
OnExpire(event, ah)

New Vehicle Support:

Vehicle Hooks

RegisterVehicleEvent(eventId, function)
OnInstall(event, vehicle)
OnUninstall(event, vehicle)
OnReset(event, vehicle)
OnInstallAccessory(event, vehicle, accessory)
OnAddPassenger(event, vehicle, passenger, seatId)
OnRemovePassenger(event, vehicle, passenger)

Vehicle Methods

GetBase() -- Returns the vehicle base (unit)
GetAvailableSeatCount() -- Returns the available seats
GetCreatureEntry() -- Returns the vehicle's entryId
GetPassenger(seatId) -- Returns the passenger (unit) by seatId
HasEmptySeat(seatId) -- Returns true if the specified seatId is empty
IsVehicleInUse() -- Returns true if the vehicle is being used
InstallAccessory(entry, seatId, bool minion, typeId, summonTime) -- Installs an accessory
ApplyAllImmunities() -- Applies all Vehicle immunities
AddPassenger(passenger, seatId) -- Adds a vehicle passenger
EjectPassenger(passenger, controller) -- Disabled for now
RelocatePassengers() -- Relocates Passengers
RemoveAllPassengers() -- Removes all Passengers from the Vehicle
RemovePassenger(passenger) -- Removes the passenger from the vehicle
RemovePendingEventsForPassenger(passenger) -- Removes pending join events from the passenger
Reset(evading) -- Resets the vehicle, the boolean is optional

Unit Method

All of the vehicle methods from Unit has been removed and added in Vehicle methods instead

GetVehicle() -- Returns the unit's vehicle (if it is a vehicle)

Test Vehicle Hook / Methods script:

function OnAddPassenger(event, vehicle, passenger, seatId)
local unit = vehicle:GetBase()
print (vehicle:GetCreatureEntry())
print (unit:GetName())

function OnRemovePassenger(event, vehicle, passenger)
local unit = vehicle:GetBase()
print (vehicle:GetCreatureEntry())
print (unit:GetName())

RegisterVehicleEvent(5, OnAddPassenger)
RegisterVehicleEvent(6, OnRemovePassenger)