need a smart idea for portable wh

09/02/2014 15:14 Xio.#16
Quote:
Originally Posted by abdoumatrix View Post
just making sure cuz when i tried to send the packet it take the nearest npcuid and send it in warehousepacket
That is a kinda stupid approach im my head. But if it works reliably its ingenius!
09/02/2014 23:32 turk55#17
Quote:
Originally Posted by abdoumatrix View Post
just making sure cuz when i tried to send the packet it take the nearest npcuid and send it in warehousepacket
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))
09/02/2014 23:41 abdoumatrix#18
Quote:
Originally Posted by turk55 View Post
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
09/03/2014 08:12 OverKillasdwqe#19
okay it's about time to give some updated

couldn't find postCmd parameter for the sash gui, did test 0->3500

Quote:
The client doesn't need to know what warehouse it is as long as the server knows.
it does because the client doesn't have an event on closing a wh so the server will never know if the user closed the wh or not
i have a way around that but won't work with vip wh as it will keep sending a new 1102 packet everytime the user change his wh to another city wh also normal wh will not send a packet if no npc where clicked since login

if what i've just said didn't make sense then please give me a valid example to make it work

Quote:
summon itembox npc with item or whatever u want
that would get it done but it looks gay to click npc dialog to summon an itembox to click it to show the wh, kinda gay isn't it ?
09/03/2014 13:38 abdoumatrix#20
Quote:
Originally Posted by OverKillasdwqe View Post
okay it's about time to give some updated

couldn't find postCmd parameter for the sash gui, did test 0->3500


it does because the client doesn't have an event on closing a wh so the server will never know if the user closed the wh or not
i have a way around that but won't work with vip wh as it will keep sending a new 1102 packet everytime the user change his wh to another city wh also normal wh will not send a packet if no npc where clicked since login

if what i've just said didn't make sense then please give me a valid example to make it work



that would get it done but it looks gay to click npc dialog to summon an itembox to click it to show the wh, kinda gay isn't it ?
xD no u press the item ,the item summon the itembox

u try to talk with the itembox
1. it open the warehouse gui for u
2.send u messagebox for if u want to remove it :D