static void AddItemOnBooth(ItemUsage usage, Client.GameState client) { if (client.Booth != null && !client.Trade.InTrade) { if (!client.Booth.ItemList.ContainsKey(usage.UID)) { if (client.Inventory.ContainsUID(usage.UID)) { Game.ConquerStructures.BoothItem item = new PhoenixProject.Game.ConquerStructures.BoothItem(); item.Cost = usage.dwParam; client.Inventory.TryGetItem(usage.UID, out item.Item); Database.ConquerItemInformation infos = new Database.ConquerItemInformation(item.Item.ID, 0); if (item.Item.Lock != 0 || item.Item.Suspicious || item.Item.Bound || infos.BaseInformation.Type != Database.ConquerItemBaseInformation.ItemType.Dropable) { return; } item.Cost_Type = usage.ID == ItemUsage.AddItemOnBoothForSilvers ? PhoenixProject.Game.ConquerStructures.BoothItem.CostType.Silvers : PhoenixProject.Game.ConquerStructures.BoothItem.CostType.ConquerPoints; client.Booth.ItemList.Add(item.Item.UID, item); client.Send(usage); BoothItem Item = new BoothItem(true); Item.Fill(item, client.Booth.Base.UID); client.SendScreen(Item, false); } } } }
static void ShowBoothItems(ItemUsage usage, Client.GameState client) { Client.GameState Owner = null; Game.Entity entity = null; if (usage.UID > 1000000) { //Console.WriteLine("Sk: " + usage.UID + "");//1000176 //Console.WriteLine("Sv: " + (uint)((usage.UID - 1000000) + 10000000) + ""); if (client.Screen.TryGetValue((uint)((usage.UID - 1000000) + 10000000), out entity)) { Owner = entity.Owner; if (Owner != null) { if (Owner.Entity.UID != client.Entity.UID) { BoothItem Item = new BoothItem(true); if (Owner.Booth != null) { foreach (Game.ConquerStructures.BoothItem item in Owner.Booth.ItemList.Values) { Item.Fill(item, Owner.Booth.Base.UID); client.Send(Item); } } } } } } else { // Console.WriteLine("Methods: " + usage.UID + "");//10000176 //Console.WriteLine("Method: " + (uint)((usage.UID - 100000) + 1000000) + ""); if (client.Screen.TryGetValue((uint)((usage.UID - 100000) + 1000000), out entity)) { Owner = entity.Owner; if (Owner != null) { if (Owner.Entity.UID != client.Entity.UID) { BoothItem Item = new BoothItem(true); if (Owner.Booth != null) { foreach (Game.ConquerStructures.BoothItem item in Owner.Booth.ItemList.Values) { Item.Fill(item, Owner.Booth.Base.UID); client.Send(Item); } } } } } } }