Jump to content
TrinityCore

[SOLVED]Lua script help


MysticalPanda
 Share

Recommended Posts

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.

Link to comment
Share on other sites

you could execute

/target self
.gps

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 ###

Link to comment
Share on other sites

2 hours ago, Rochet2 said:

/target self
.gps

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

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

 

2 hours ago, Rochet2 said:

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 ###

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?

Link to comment
Share on other sites

3 hours ago, Rochet2 said:

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.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...