Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public abstract bool ItemSold(Interfaces.IServerConnection server, Interfaces.IPlayer buyer, IShopItem shopItem, int amount, int price);
Exemplo n.º 4
0
 public override int EvaluateSell(Interfaces.IServerConnection server, Interfaces.IPlayer seller, IShopItem item, int amount)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 5
0
 public override int EvaluateBuy(Interfaces.IServerConnection server, Interfaces.IPlayer buyer, IShopItem item, int amount)
 {
     //TODO: SKillcheck
     return(item.SellPrice * amount);
 }
Exemplo n.º 6
0
 public override bool ItemSold(Interfaces.IServerConnection server, Interfaces.IPlayer seller, IShopItem item, int amount, int price)
 {
     throw new NotImplementedException();
 }