Quantcast
WoWInterface - View Single Post - Unit_entered_vehicle!!
View Single Post
09-15-10, 06:06 AM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
UNIT_ENTERING_VEHICLE fires when the unit begins entering a vehicle.
UNIT_ENTERED_VEHICLE fires when the unit finishes entering a vehicle.
UNIT_EXITING_VEHICLE fires when the unit begins exiting a vehicle.
UNIT_EXITED_VEHICLE fires when the unit finishes exiting a vehicle.

In all cases, the unit passed as an argument to your event handler is the actual unit transitioning into/out of a vehicle. So, if you (the player unit) enter a vehicle, the ENTERING and ENTERED events will fire with "player" as their first argument.

I haven't played with these events extensively, but information about the unit's vehicle is definitely available after ENTERED has fired.

For units like "party2" you can just stick "pet" in there before the number, and query for information on the "partypet2" unit to learn about the unit's vehicle (eg. UnitHealth, UnitName); I'm not sure if "partyvehicle2" would work, as I've never tried it or seen any other addon using it.

The "player" unit is the only one where you actually have to change the unit token for API queries (since "playerpet" is not a valid unit token as of... some patch quite a while ago) to "pet", and the only one where I know "vehicle" will work.

If you're having a problem using these events to accomplish something, perhaps you could be more specific about what you're trying to accomplish and what problem(s) you're having.

@Hoern, COMPANION_UPDATE should fire when you enter a vehicle if (a) you had a non-combat pet summoned, since that pet is unsummoned when you enter a vehicle, or (b) you're summoning a mount that's also a vehicle, such as the Traveler's Tundra Mammoth.
  Reply With Quote