View Full Version : Looking for a way to clear vendor temp inventory
ChaosSlayerZ
10-15-2020, 10:22 PM
Greetings!
I am Looking for a way to clear vendor temp inventory.
Apparently there is no actual quest commands available for that
other than: (which set, count, but don't clear)
quest::MerchantCountItem(uint32 npc_id, uint32 item_id)
quest::MerchantSetItem(uint32 npc_id, uint32 item_id, [uint32 quantity])
Thank You!
Thalix
10-16-2020, 06:41 AM
LUA NPC:ClearItemList() or Perl $npc->ClearItemList() does not work?
ChaosSlayerZ
10-16-2020, 07:32 AM
LUA NPC:ClearItemList() or Perl $npc->ClearItemList() does not work?
Sadly no. KinglyKrab explains that they are for clearing of loot of npc.
blackdragonsdg
10-16-2020, 08:37 PM
If all else fails you can use a perl script to run sql against your db clearing the merchant temp list then reload npc data to make it update. It may also be possible with lua but I have never tried anything along those lines in lua. It is probably best to do what your wanting within the confines of the quest system but if that doesn't work out then this can be another option.
ChaosSlayerZ
10-16-2020, 09:34 PM
I figured out a solution - by using a combination of MerchantCountItem and MerchantSetItem I managed to enforce a list clear by doing a loop on range of items. Its cumbersome but it works for now =)
My next goal is - NPC run Auction house =) I know some server implemented that few years back, so if anyone aware of any free code - I would much appreciate that =)
Otherwise I will have to code it from ground up =)
demonstar55
10-16-2020, 09:36 PM
LUA NPC:ClearItemList() or Perl $npc->ClearItemList() does not work?
Those are loot functions it looks like (if anyone was wondering why they didn't work)
ChaosSlayerZ
10-16-2020, 09:53 PM
Ok i think i have one question left. I been working with pre-defined list of items. What if I want to look over entire vendor inventory (I don't know what he has there) and ask him to list all items he got on him?
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.