Exemplo n.º 1
0
        public CharacterInventory(Player character)
        {
            this.Player = character;
            if (!String.IsNullOrEmpty(character.Stuff))
            {
                if (character.Stuff[character.Stuff.Length - 1] == '|')
                {
                    character.Stuff = character.Stuff.Substring(0, character.Stuff.Length - 1);
                }
                InventoryItemTable.Load(character.Stuff.Replace("|", ","));
            }
            foreach (String item in Regex.Split(character.Stuff, "\\|"))
            {
                if (String.IsNullOrEmpty(item))
                {
                    continue;
                }
                int guid = int.Parse(item);

                InventoryItemModel obj = InventoryItemTable.getItem(guid);
                if (obj != null)
                {
                    Add(obj);
                }
            }
        }
Exemplo n.º 2
0
 public void Intialize()
 {
     if (Intialized)
     {
         return;
     }
     if (this.LivingItem != 0)
     {
         InventoryItemTable.Load(this.LivingItem);
     }
     Intialized = true;
 }
Exemplo n.º 3
0
        public void Initialize()
        {
            Item = InventoryItemTable.Load(ItemID);

            if (Item == null)
            {
                BidHouseTable.Delete(ItemID);
                return;
            }

            BH.addObject(this);
            BH = null;
        }
Exemplo n.º 4
0
        public void Intialize()
        {
            if (myIntialized)
            {
                return;
            }

            foreach (String str in ItemList.Split(';'))
            {
                try
                {
                    if (String.IsNullOrEmpty(str))
                    {
                        continue;
                    }
                    long idd;
                    if (!long.TryParse(str, out idd))
                    {
                        continue;
                    }
                    InventoryItemModel obj = InventoryItemTable.getItem(idd);
                    if (obj != null)
                    {
                        Items.Add(obj.ID, obj);
                    }
                    else
                    {
                        obj = InventoryItemTable.Load(idd);
                        if (obj != null)
                        {
                            Items.Add(obj.ID, obj);
                        }
                    }
                }
                catch (Exception e) { continue; }
            }


            myIntialized = true;
        }
Exemplo n.º 5
0
 public void Initialize()
 {
     if (myInitialized)
     {
         return;
     }
     try
     {
         BHI = new Dictionary <int, List <BidHouseItem> >();
         if (!BidHouseTable.BHITEMS.ContainsKey(this.Guid))
         {
             BidHouseTable.BHITEMS.Add(Guid, new Dictionary <int, List <BidHouseItem> >());
         }
         BHI = BidHouseTable.BHITEMS[Guid];
         foreach (String s in Friends.Split(';'))
         {
             if (String.IsNullOrEmpty(s))
             {
                 continue;
             }
             FriendsList.Add(Convert.ToInt32(s.Split('|')[0]), s.Split('|')[1]);
         }
         foreach (String s in Ennemys.Split(';'))
         {
             if (String.IsNullOrEmpty(s))
             {
                 continue;
             }
             EnnemyList.Add(Convert.ToInt32(s.Split('|')[0]), s.Split('|')[1]);
         }
         foreach (String s in Bank.Split(';'))
         {
             if (String.IsNullOrEmpty(s))
             {
                 continue;
             }
             long id;
             if (!long.TryParse(s, out id))
             {
                 continue;
             }
             InventoryItemModel obj = InventoryItemTable.getItem(id);
             if (obj != null)
             {
                 bankItems.Add(id, obj);
             }
             else
             {
                 obj = InventoryItemTable.Load(id);
                 if (obj != null)
                 {
                     bankItems.Add(id, obj);
                 }
             }
         }
         foreach (String s in Stables.Split(';'))
         {
             if (String.IsNullOrEmpty(s))
             {
                 continue;
             }
             int id;
             if (!int.TryParse(s, out id))
             {
                 continue;
             }
             Mount DD = MountTable.getMount(id);
             if (DD != null)
             {
                 Mounts.Add(id, DD);
             }
         }
     }
     catch (Exception e)
     {
         Logger.Error(e);
     }
     myInitialized = true;
 }