public override bool ItemBought(Interfaces.IServerConnection server, Interfaces.IPlayer buyer, IShopItem shopItem, int amount, int price) { buyer.AddCoins((-1) * price, String.Format("{0} {1} shop {2}", amount, shopItem.ItemName, shopItem.Shop.ShopName)); buyer.Confirm("You bought {0} {1} for {2} coins.", amount, shopItem.ItemName, price); shopItem.TotalSold += amount; shopItem.Shop.TotalDeals++; shopItem.Shop.TotalSales += price; shopItem.Shop.TotalRevenue += price; //TODO: Economy Factor! shopItem.Shop.TotalCustomers++; Program.Config.Save(); return(true); }
public override bool ItemBought(Interfaces.IServerConnection server, Interfaces.IPlayer buyer, IShopItem shopItem, int amount, int price) { server.Execute("give {0} {1} {2}", buyer.EntityID, shopItem.ItemName, amount); buyer.AddCoins((-1) * price, String.Format("{0} {1} shop {2}", amount, shopItem.ItemName, shopItem.Shop.ShopName)); buyer.Confirm("You bought {0} {1} for {2} coins.", amount, shopItem.ItemName, price); buyer.Message("Your items have been placed next to you."); shopItem.StockAmount -= amount; shopItem.TotalSold += amount; shopItem.Shop.TotalDeals++; shopItem.Shop.TotalSales += price; shopItem.Shop.TotalRevenue += price; //TODO: Economy Factor! shopItem.Shop.TotalCustomers++; Program.Config.Save(); return(true); }
public abstract bool ItemSold(Interfaces.IServerConnection server, Interfaces.IPlayer buyer, IShopItem shopItem, int amount, int price);
public override int EvaluateSell(Interfaces.IServerConnection server, Interfaces.IPlayer seller, IShopItem item, int amount) { throw new NotImplementedException(); }
public override int EvaluateBuy(Interfaces.IServerConnection server, Interfaces.IPlayer buyer, IShopItem item, int amount) { //TODO: SKillcheck return(item.SellPrice * amount); }
public override bool ItemSold(Interfaces.IServerConnection server, Interfaces.IPlayer seller, IShopItem item, int amount, int price) { throw new NotImplementedException(); }