Jump to content
Sign in to follow this  
plzzz

how to calculate the location of the NPCS/creatures

Recommended Posts

I want to get the NPC/creature's coordinates from  database. such as:

-- this data copy from !questie, {Continent, Zone, X, Y}
	["Gol'dir"] = {2, 1, 0.59957194328308, 0.43740105628967},
	["Deino"] = {1, 12, 0.38448387384415, 0.86132436990738},

But I can only get these below, So how to make (683.518, -895.468) convert to (0.59957194328308, 0.43740105628967)

-- 2316 = Gol'dir, 5885 = Deino ......
SELECT id, map, position_x, position_y, position_z FROM `creature` WHERE id IN (2316, 5885)

-- result:
    id     map  position_x  position_y  position_z  
------  ------  ----------  ----------  ------------
  2316       0     683.518    -895.468       171.889
  5885       1     1468.18    -4219.88       43.0424

 

Share this post


Link to post
Share on other sites

I tried something similiar once. But I came to the conclusion that there are just too few information. 

To start with: There is no direct function that gives you these kind of information, so you have to take a few workarounds.

I think the best approach is to look how addons like questie did something like that, but I think there will be no exact way to get these information.

 

cheers!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×