Exemplo n.º 1
0
 static void ObserveEquipment(Data generalData, Client.GameState client)
 {
     Client.GameState pclient = null;
     if (ServerBase.Kernel.GamePool.TryGetValue(generalData.dwParam, out pclient))
     {
         //if (generalData.ID != 117)
         //{
         // client.Send(pclient.Entity.WindowSpawn());
         //    client.Send(new GamePackets.ObserveStats(pclient).ToArray());
         //    pclient.Entity.SetVisible();
         //}
         pclient.Send(new Message(client.Entity.Name + " is observing your gear carefully.", System.Drawing.Color.Red, Message.TopLeft));
         if (ServerBase.Kernel.GamePool.TryGetValue(generalData.dwParam, out pclient))
         {
             client.Send(new GamePackets.ObserveStats(pclient).ToArray());
             IConquerItem[] Equipment = pclient.Equipment.Objects;
             foreach (ConquerItem item in Equipment)
             {
                 if (item != null)
                 {
                     uint UID = item.UID;
                     item.UID = pclient.Entity.UID;
                     item.Mode = Game.Enums.ItemMode.View;
                     item.Send(client);
                     item.UID = UID;
                     //item.Mode = Game.Enums.ItemMode.Default;
                 }
                 if (item != null)
                 {
                     BoothItem Item = new BoothItem(true);
                     Item.Fill(item, pclient.Entity.UID);
                     Item.Send(client);
                     if (item.Purification.Available)
                     {
                         ItemAdding add = new ItemAdding(true);
                         add = new ItemAdding(true);
                         add.Append(item.Purification);
                         add.Send(client);
                     }
                 }
             }
             _String packet = new _String(true);
             packet.Type = 16;
             packet.UID = client.Entity.UID;
             packet.TextsCount = 1;
             packet.Texts = new List<string>() { pclient.Entity.Spouse };
             client.Send(packet);
             packet.Type = 10;
             client.Send(packet);
         }
     }
 }
Exemplo n.º 2
0
 static void ShowBoothItems(ItemUsage usage, Client.GameState client)
 {
     Client.GameState Owner = null;
     Game.Entity entity = null;
     if (client.Screen.TryGetValue((uint)((usage.UID - (usage.UID % 100000)) * 10 + (usage.UID % 100000)), 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);
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
 static void AddItemOnBooth(ItemUsage usage, Client.GameState client)
 {
     if (client.Booth != null)
     {
         if (!client.Booth.ItemList.ContainsKey(usage.UID))
         {
             if (client.Inventory.ContainsUID(usage.UID))
             {
                 Game.ConquerStructures.BoothItem item = new Conquer_Online_Server.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 ? Conquer_Online_Server.Game.ConquerStructures.BoothItem.CostType.Silvers : Conquer_Online_Server.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);
             }
         }
     }
 }