Exchange NPC with diffrent items?
#1

Hay guys, does anyone know what code I need to add to the Songkran exchage system to make diffrent items display on diffrent npcs? Right now every items shows on both npc's even when a_npc_index is used.

If anyone knows what code I need for this let me know

Thanks

?

#2

as far as i remember the client never checks for the npc index itself, so you would have to add that code to the client.

#3


On 3/6/2022 at 9:40 AM, Veni said:




as far as i remember the client never checks for the npc index itself, so you would have to add that code to the client.




Yes, there should be a flag which enables the "craft system" and you should be able to easy split the items sent by the server, just by looking at the struct! 

#4

i would like dump this conversation to talk about it.

Now that i have time, i started to take a look inside the code, and as /index.php?/profile/20534-veni/&do=hovercard" data-mentionid="20534" href="/index.php?/profile/20534-veni/" rel="">@Veni say, the client NEVER check for the npc's id and just load the entire list:

2

 

Of course you need to add the flag at the new npc to make the client side open the craft system menù, but even with that, the npc just load a clone of the entire array of the items, instead of split it by npc_index:

 

2

 

As you can see it only load the:

pItem->Clone

 I've tried to take a look inside the GetItemList function which should allow us to load the list from scratch, but i didn't get how to divide the items and check the current npc select to split the list:

 

2

 

Guess we should deserialize the array here and only push back the value filtered, but is out of my skills ... if someone wanna join and talk about it, guess shouldn't be pretty hard 

 



Forum Jump:


Users browsing this thread: 1 Guest(s)