EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Clearing Merchant Inventory (https://www.eqemulator.org/forums/showthread.php?t=37425)

provocating 10-24-2013 04:23 PM

Clearing Merchant Inventory
 
I could had sworn I used to be able to clear merchant inventory like this.

Code:

quest::merchantclear($npc->GetNPCTypeID());
But it does not appear to be working anymore. What am I doing wrong here?

joligario 10-24-2013 06:38 PM

I don't see that command. Are you thinking the ClearMerchantTemp()?

provocating 10-24-2013 07:00 PM

I am thinking a few years ago I may had created a custom command. Is that ClearMerchantTemp valid and working?

joligario 10-24-2013 07:28 PM

It is in the code, but I don't think there is a perl export for it.

Kingly_Krab 10-24-2013 08:20 PM

Would $npc->ClearItemList() not work?

provocating 10-24-2013 08:26 PM

Quote:

Originally Posted by joligario (Post 225240)
It is in the code, but I don't think there is a perl export for it.

That is probably what I did last time was modify the source.

Kingly_Krab 10-24-2013 08:32 PM

Quote:

Originally Posted by provocating (Post 225245)
That is probably what I did last time was modify the source.

Did you attempt what I said?

provocating 10-24-2013 09:00 PM

Not yet, have not had a chance yet.

Kingly_Krab 10-24-2013 09:01 PM

Quote:

Originally Posted by provocating (Post 225247)
Not yet, have not had a chance yet.

Okay, just keep me posted.

joligario 10-24-2013 09:46 PM

That looks like it is for loot only.

Kingly_Krab 10-24-2013 09:49 PM

Quote:

Originally Posted by joligario (Post 225249)
That looks like it is for loot only.

Okay, I was unsure, and my server was down, thanks for the information.

provocating 10-24-2013 11:18 PM

It did not seem to work, I put a

Code:

$npc->ClearItemList();
in the script right before a shout, I heard the shout but the merchant still had the same items. I am doing a script that dumps random items on the merchant and indeed the random items get loaded during the initial run, but never get cleared out before the next item load.

provocating 10-24-2013 11:22 PM

Quote:

Originally Posted by Kingly_Krab (Post 225246)
Did you attempt what I said?

Yeah definitely not working, the temp merchant list keeps getting larger.

rencro 10-25-2013 09:24 AM

Is this what you are looking for? If not perhaps it can do what you need..


Code:

quest::MerchantSetItem(merchant's npc id, item id, quanity of item) - changes the number of the item that the merchant has available to sell
quest::MerchantCountItem(merchant npc id, item id) returns the number of that item in stock.


provocating 10-25-2013 12:31 PM

I knew about those two, I need a simple clear inventory.

provocating 10-25-2013 02:22 PM

I had to edit around 4~5 .cpp files but now it is working like a champ. I created a function in C++ to delete the table rows for that NPC and made the companion PERL function and it works like a champ. One step closer.

provocating 10-28-2013 05:58 PM

Okay one last thing, I can clear the merchant's inventory in the database but it does not seem to reflect the change until the zone loads again. Is there some way to make the merchant reread the table?


All times are GMT -4. The time now is 12:28 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.