コード例 #1
0
        public override void Save()
        {
            List <Item> Itms = Items.ToList();

            Itms.AddRange(BuyBack.ToList());

            if (Obj.IsPlayer())
            {
                CharMgr.SaveItems(GetPlayer()._Info.CharacterId, Itms.ToArray());
            }
        }
コード例 #2
0
 public BaseMainConfigAdmin()
 {
     //
     // TODO: Add constructor logic here
     //
     if (c.Sections["CWSAdminConfig"] != null)
     {
         _b = c.Sections["CWSAdminConfig"] as AdminConfig;
     }
     if (c.Sections["buybackConfig"] != null)
     {
         _a = c.Sections["buybackConfig"] as BuyBack;
     }
 }
コード例 #3
0
        public void AddCreatureItem(Item Item)
        {
            if (Item.SlotId < Items.Length && Item.SlotId >= 0)
            {
                if (Item.SlotId == 0)
                {
                    BuyBack.Add(Item);
                    return;
                }

                Items[Item.SlotId] = Item;
            }

            if (IsEquipedSlot(Item.SlotId))
            {
                SendEquiped(null);
            }
        }
コード例 #4
0
        public void Load(List <Character_items> NItems)
        {
            if (IsLoad)
            {
                return;
            }

            foreach (Character_items Item in NItems)
            {
                if (Item.SlotId < Items.Length && Item.SlotId >= 0)
                {
                    Item Itm = new Item(Obj);
                    if (!Itm.Load(Item))
                    {
                        continue;
                    }

                    if (Itm.SlotId == 0)
                    {
                        BuyBack.Add(Itm);
                        continue;
                    }

                    if (Items[Itm.SlotId] == null)
                    {
                        Items[Itm.SlotId] = Itm;
                        if (IsEquipedSlot(Itm.SlotId))
                        {
                            EquipItem(Itm);
                        }
                    }
                    else
                    {
                        DuplicatedSlot.Add(Itm);
                    }
                }
            }

            CheckDuplicated();

            base.Load();
        }
コード例 #5
0
        public void Load(List <Creature_item> CItems)
        {
            if (IsLoad)
            {
                return;
            }

            foreach (Creature_item Item in CItems)
            {
                if (Item.SlotId < Items.Length && Item.SlotId >= 0)
                {
                    Item Itm = new Item(Item);

                    if (Itm.SlotId == 0)
                    {
                        BuyBack.Add(Itm);
                        continue;
                    }

                    Items[Itm.SlotId] = Itm;
                }
            }
        }
コード例 #6
0
        public void Load(Item[] NItems)
        {
            if (IsLoad)
            {
                return;
            }

            foreach (Item Itm in NItems)
            {
                if (Itm != null && Itm.SlotId >= 0 && Itm.SlotId < Items.Length)
                {
                    if (Itm.SlotId == 0)
                    {
                        BuyBack.Add(Itm);
                        continue;
                    }

                    if (Items[Itm.SlotId] == null)
                    {
                        Items[Itm.SlotId] = Itm;
                        if (IsEquipedSlot(Itm.SlotId))
                        {
                            EquipItem(Itm);
                        }
                    }
                    else
                    {
                        DuplicatedSlot.Add(Itm);
                    }
                }
            }

            CheckDuplicated();

            base.Load();
        }