Some Vehicle Questions

Hello. I have some problems turning an NPC into a vehicle.

Sometimes I got it right, sometimes I didn’t /emoticons/default_smile.png

I searched google and the forum but didn’t find anything good.

So I’m going directly to the source.

Creature template table:

NPC_flag does nothing to influence.

unit_flags - I was thinking of UNIT_FLAG_PLAYER_CONTROLLED


type_flags - I don’t know if anything is to be used

VehicleID - this has to be something, but I don’t know how to use it properly

flags_extra - I don’t know if anything is to be used

Vehicle Accessory table:

This is empty.

Vehicle Template Accessory table:

This is probably a customization of the vehicle.

So in order to make an NPC into a vehicle so I can use SAI to make a script, what do I have to use?

Thank you.

You want the NPC mount on a vehicle at a certain time via SAI or a NPC spawn already mounted on the vehicle?

How I would solve the first case:

  • add an entry in npc_spellclick with the hardcoded mount spell (46598 I’m going by heart, not sure)

  • make the npc cast that spell during the SAI script, targetting the vehicle

second case:

  • check that vehicleid != 0 in creature_template

  • add the hardcoded mount spell in npc_spellclick with the vehicle entry

  • add the npc that has to mount the vehicle in vehicle_template_accessory

No no. There is an NPC in X zone. It should be a vehicle and when you mount it, a script is called and it carries you somewhere.

I want to transform that NPC into a vehicle. Atm nothing happens when you click the NPC. I want to have that green arrow and also mount it.

You will have to have a vehicleid != 0 in creature_template for the npc you want to be a vehicle.

Then you need an entry in npc_spellclick for the npc. If you don’t find any special spell use

Next the npc needs a set of waypoints to “know” its way.

Last you have to change IconName in creature_template to vehichleCursor I guess and apply an SmartAI to that npc.


so unit_flags - I was thinking of UNIT_FLAG_PLAYER_CONTROLLED does nothing eh?

Yea the script will be something like that, but I’m going to use move to pos, so waypoints are not needed I guess.

Also the vehicleId can be whatever I want? there is an example in the creature_template from, but I don’t understand what ID I should use “For example, a VehicleID of 292 will make the player invisible, prevent the vehicle from strafing left/right (but will allow fowards/backwards),”. Is there a list where I can find the vehicleIDs? Or the vehicleID is related to vehicle template accessory?

Thank you for your answers.

You can either obtain the correct id from sniff or just try and error. If you don’t mind the “seat position” you can just take any.

I don’t think there is a list of the ids. The vehicle_template_accessory is for npcs mounting npcs. You won’t need it for players.

You won’t need the unit_flags either. Maybe you don’t want the npc to be attackable during the ride… Apply unit_flags 768 then.

And very important use a SmartAI timed actionlist for the movement or it won’t work.

I understand. Thanks for the help, I’ll try making it, if it works I’ll tell you so you can close this ( maybe even type it here in case you guys might use it ) and if it doesn’t, I’ll be sure to bug you again ^^

Thank you again.