Packets 2030/2031 Requesting NPCs

07/17/2014 22:46 Aceking#1
So I am trying to figure out how this system works in 5065 and I feel like I am missing something.

From what I understand, anytime you use a guild statue scroll, guild teleporter scroll or any kind of furniture voucher. The server sends packet 2031 to the client with the action (offset 12) to add (value 5). Followed by the sub action (offset 14) with the value depending on the item. 8 for GC, 9 for Statue, 25/26 for Furniture.

This brings up either the statue window or places an npc on the mouse for you to place at the location of your choice.
After rotating or whatever you desire, you click on OK and then the client sends the server packet 2030 to request the NPC.

This is all fine and good so far, but receiving this packet 2030 is where I am struggling.
The packet coming back, as far as I can tell, has no value to distinguish the type of NPC it is. I don't know if its a guild statue, guild teleporter or a piece of furniture.
This is where I appear to be missing something as I feel there should be some kind of type value to tell me what specific code I need to execute.
Statues require packet 1014 to be visible.
GCs and Furniture require NPC packets but are also handled somewhat differently.

My only thinking is that I can use the map ID to sort through what exactly is being used. Guild Map, House Maps and then everything else is placing a GC.
But if there is a 'correct' way of doing it, I would much prefer to go that route.

Anyone have any ideas or can point me in the right direction?
08/08/2014 11:09 InsomniacPro#2
I know this is a bit old, but I'm giving this a bump. Research on this topic is very limited. I'm also working on this at the moment.
08/08/2014 11:38 KraHen#3
I`ve never done this TBH but you said that you send 2031 based on the item. At that given point as far as I understand you know what the type of NPC is, so just store it and use that data when you receive the 2030 packet. I know it sounds hack-ish but for me it seems that this is how it works (based on nothing just reading your post, I might be completely wrong).
08/08/2014 11:44 abdoumatrix#4
most will do it by the same way by storing the item or item uid to be removed when spwan confirmed.
08/08/2014 12:40 Aceking#5
Quote:
Originally Posted by KraHen View Post
I`ve never done this TBH but you said that you send 2031 based on the item. At that given point as far as I understand you know what the type of NPC is, so just store it and use that data when you receive the 2030 packet. I know it sounds hack-ish but for me it seems that this is how it works (based on nothing just reading your post, I might be completely wrong).
Essentially this is what I did, along with checking map ID's and executing code based on certain maps.
Guild map has statues, House maps have furniture, everything else is a GC.

I just know that there has to be a better and more efficient way of handling it.

This is especially true when handling GC's through this system. Statues and furniture can be done without the need of knowing what item was used. But GC's are different because the packet being received by the server gives you NO clue as to what GC it is. The only way you can distinguish what it is, is by storing the item ID that was last used and checking that against scroll ID's. Or, I suppose you could also do a check against the Mesh of the npc contained in the packet. Just have to remember to account for the direction.

I dunno, it just all seems a bit wishy washy to me.
08/08/2014 13:15 KraHen#6
Quote:
Originally Posted by Aceking View Post
Essentially this is what I did, along with checking map ID's and executing code based on certain maps.
Guild map has statues, House maps have furniture, everything else is a GC.

I just know that there has to be a better and more efficient way of handling it.

This is especially true when handling GC's through this system. Statues and furniture can be done without the need of knowing what item was used. But GC's are different because the packet being received by the server gives you NO clue as to what GC it is. The only way you can distinguish what it is, is by storing the item ID that was last used and checking that against scroll ID's. Or, I suppose you could also do a check against the Mesh of the npc contained in the packet. Just have to remember to account for the direction.

I dunno, it just all seems a bit wishy washy to me.
There are worse things out there, I think that this (although ugly) is acceptable. Also you`d have the last used item ID for other stuff as well later on (dunno, maybe combo item usage or whatever - like that equipment bonus quest where you had to take 3 potions in a given order).
08/08/2014 13:18 Aceking#7
Quote:
Originally Posted by KraHen View Post
There are worse things out there, I think that this (although ugly) is acceptable. Also you`d have the last used item ID for other stuff as well later on (dunno, maybe combo item usage or whatever - like that equipment bonus quest where you had to take 3 potions in a given order).
That is true. I just don't like doing things in an unconventional way when there is a much better option available. So I was just looking to see if anyone had ideas on that option :)
08/10/2014 04:45 InsomniacPro#8
Quote:
Originally Posted by KraHen View Post
There are worse things out there, I think that this (although ugly) is acceptable.
You'd think there's a more conventional way to do this though. I mean, we all know TQ isn't the smartest, but even this seems kind of too unconventional for them.