[SOLVED]Lua script help

Is there a Lua script that will return the players current x,y,z and orientation? This would make it easier to spawn new vendors by moving to the position and direction then looking at the current values for the player. Something like coordinates addon, but with more data like orientation, etc.

you could execute

/target self

and then wait for the message from server and then parse it for the coordinates.

But I dont see how any of what you talk about is easier than moving to where you want to spawn stuff and just do .npc add ###

Thanks! That’s exactly what I was looking for.

I’m programming a tool to add npcs either directly, or by generating an sql file that can be imported in through a program like HeidiSQL. It’ll help me add characters (creatures) and other things more easily whose field data requires something I can’t easily determine without trial and error. Does .npc add ### spawn the npc and add it to the database?

Yes. But .npc add temp ### does not save to database, only spawns it ingame.

That’s what I was afraid of. The biggest problem I see with spawned npcs, or getting them in the database at least,is a standardized guid assignment for some of the database/fields. I’m just starting to learn SQL and crawl the database structure, so I’m sure I’m missing something somewhere but I believe those are unique to the TC core and not used by the wow client. I’m hoping at this point, that all the data for the npcs are there, including guid assignments where needed (that’ll keep conflict resolution down between duplicate #'s) if they are custom spawned, including creating their creature_template and associated other database records.