LordFenris

Member
Hi All!
I have a question about the solution of setting the NPC vendors a quota limit (renewable from time to time), up to what amount they would buy - in a given period - goods offered by players. After reaching this limit, the NPC would not offer to buy goods until the limit is renewed.

I know some servers use this solution. Do any of you know any older topic devoted to such a solution, or could you share the modifications?
Thanks alot for any helps and suggestions.
 
Where is restock refresh script?
BaseVendor.cs
C#:
public virtual void Restock()
// here just add condition for check vendor gold amount. If it <= 0 update base gold amount.

C#:
public virtual bool OnBuyItems(Mobile buyer, List<BuyItemResponse> list)
// here you can replenish funds from sales. 
// goldAmount += totalCost;

C#:
public virtual bool OnSellItems(Mobile seller, List<SellItemResponse> list)
// here you can consume goldAmount from purchases
// also need add checks to current goldAmount if player's trying sell more items than vendor can give to him.
// if(moneyReq > goldAmount)
// {
// if(goldAmount > 0)
// "Sorry, but I have only {0} gold!", goldAmount
// else
// "Sorry, but I don't have any money!"
// }
// else
// goldAmount -= moneyReq;
I want a vendor that don't stock up sells what he buys?
Most easy way - you can just override Restock method in your new class to leave from default logic.
C#:
        public override void Restock()
        {
        }
But need to look better, perhaps there are more correct options. Did not watch.
 
Adjusted time to 240000 hours..
How about making items bought not being 10 sell items? Organize and avg sell price from bought...?
Eventually mission is to have vendors and gambling use a pile of gold in Kings castle as gold amount to buy from and taking out profit /difference of buy...sell+gambling/ and that being Kings tax money...
Kings must have taxes for protection..lol..
 
You can just add gold_amount variable with 2-5k gold to vendor class, and in Sell method just add value to this variable, to Buy method just consume it. And on Restock/Refresh method just add update your gold amount if you want.

find msyelf needing to do this now lol
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back