Quote:
Originally Posted by turk55
It isn't hard to figure out which one is the closest though. Here is a quick thought on how to approach it:
A list or dictionary with warehouse npcs including their locations (mapid, x, y)
Loop through the npcs that are in the same map and calculate the distance ->
((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2))
|
xD client does this not server
that what happen with me when i tried to open warehouse interface with datapacket :D it send me a warehouse packet with npcid of the nearest npc.
maybe it just some luck i will test again to make sure :D
========
nah i was wrong.
1. first u talk with npc
2. u use datapacket to open warehouse interface
3. the warehousepacket will be send with the lastest npcid u talk with.
so u can use a portable warehouse like this
1. summon itembox npc with item or whatever u want
2. from its npcdialogpacket u forced it to open warehouse interface
(u can use it too in option removing it)
3. the warehouse packet will send with this npc uid and the rest is easy. :D