示例#1
0
 public static void WriteItemSetId()
 {
     ItemMgr.ForceInitialize();
     WriteEnum("ItemSetId", "Items", ItemMgr.Sets, false,
               (item) => { return(true); },
               (item) => {
         return(item.Name);
     },
               set => {
         var strs = new List <string>();
         foreach (var templ in set.Templates)
         {
             strs.Add(templ.ToString());
         }
         strs.Add(" \nBoni:");
         for (int i = 0; i < set.Boni.Length; i++)
         {
             var boni = set.Boni[i];
             if (boni != null)
             {
                 strs.Add((i + 1) + " Items: " + boni.ToString(", "));
             }
         }
         if (set.RequiredSkillValue > 0)
         {
             strs.Add(" \nRequires: " + set.RequiredSkillValue + " " + set.RequiredSkill);
         }
         return(strs.ToString("\n"));
     },
               (item, name) => null,
               (item) => { return(item.Id.ToString()); });
 }
示例#2
0
 public static void WriteItemId()
 {
     ItemMgr.ForceInitialize();
     WriteEnum("ItemId", "Items", ItemMgr.Templates, false,
               (item) => { return(true); },
               (item) => {
         return(item.Name);
     },
               template => {
         var strs = new List <string>();
         if (template.Description.Length > 0)
         {
             strs.Add("Desc: " + template.Description);
         }
         if (template.InventorySlotType != InventorySlotType.None)
         {
             strs.Add(template.InventorySlotType.ToString());
         }
         if (template.Level > 0)
         {
             strs.Add("Level: " + template.Level);
         }
         if (template.Set != null)
         {
             strs.Add("Set: " + template.Set);
         }
         if (template.Class != ItemClass.None)
         {
             strs.Add("Class: " + template.Class);
         }
         if (template.ItemProfession != SkillId.None)
         {
             strs.Add("Skill: " + template.ItemProfession);
         }
         if (template.MaxAmount > 1)
         {
             strs.Add("Max Stack: " + template.MaxAmount);
         }
         if (template.Lock != null)
         {
             strs.Add("Lock: " + template.Lock);
         }
         if (template.TeachSpell != null)
         {
             strs.Add("Teaches: " + template.TeachSpell);
         }
         if (template.UseSpell != null)
         {
             strs.Add("Use: " + template.UseSpell.Spell +
                      (template.UseSpell.Charges > 0 && template.UseSpell.Charges < int.MaxValue ? " (" + template.UseSpell.Charges + ")" : ""));
         }
         if (template.EquipSpell != null)
         {
             strs.Add("OnEquip: " + template.EquipSpell);
         }
         return(strs.ToString("\n"));
     },
               (item, name) => null,
               (item) => { return(item.Id.ToString()); });
 }
示例#3
0
        public static void WriteItemSetId()
        {
            RealmDBMgr.Initialize();
            World.InitializeWorld();
            SpellHandler.LoadSpells();
            ItemMgr.ForceInitialize();

            WriteEnum("ItemSetId", " : uint", "Items", ItemMgr.Sets, false,
                      (item) => true,
                      (item) => item.Name,
                      set =>
            {
                var strs = new List <string>();
                foreach (ItemTemplate templ in set.Templates)
                {
                    strs.Add(templ.ToString());
                }
                strs.Add(" \nBoni:");
                for (int i = 0; i < set.Boni.Length; i++)
                {
                    Spell[] boni = set.Boni[i];
                    if (boni != null)
                    {
                        strs.Add((i + 1) + " Items: " + boni.ToString(", "));
                    }
                }
                if (set.RequiredSkillValue > 0)
                {
                    strs.Add(" \nRequires: " + set.RequiredSkillValue + " " + set.RequiredSkill);
                }
                return(strs.ToString("\n"));
            },
                      (item, name) => null,
                      (item) => item.Id.ToString());
        }
示例#4
0
        public static void EnsureItemsLoaded()
        {
            EnsureBasicSetup();
            ItemMgr.ForceInitialize();

            //ItemMgr.InitMisc();

            //// add Dummy items
            //foreach (ItemId itemId in Enum.GetValues(typeof(ItemId)))
            //{
            //    new ItemTemplate {
            //        Id = (uint)itemId,
            //        ItemId = itemId,
            //        Name = itemId.ToString(),
            //        Resistances = new int[0],
            //        Damages = new[] { new DamageInfo(DamageSchoolMask.Physical, 1, 2) },
            //        Sockets = new SocketInfo[3]

            //    }.FinalizeAfterLoad();
            //}
        }
示例#5
0
        public void TestAddSet()
        {
            ItemMgr.ForceInitialize();
            var setId      = ItemSetId.VolcanicArmor;
            var setBagSlot = 0;

            // make sure the first slot is empty so the set will be added to it
            m_char.Inventory.EquippedContainers.Destroy(setBagSlot + (int)EquipmentSlot.Bag1);

            var set = ItemMgr.GetSet(setId);

            Assert.IsNotNull(set);
            var result = ItemSet.CreateSet(m_char, setId);

            Assert.IsTrue(result);

            var bag = m_char.Inventory.EquippedContainers.GetBag(setBagSlot);

            Assert.IsNotNull(bag);

            Assert.AreEqual(set.Templates.Length, bag.BaseInventory.Count);
        }
示例#6
0
        public static void WriteItemId()
        {
            World.InitializeWorld();
            SpellHandler.LoadSpells();
            FactionMgr.Initialize();
            NPCMgr.LoadAll();
            ItemMgr.ForceInitialize();

            WriteEnum("ItemId", " : uint", "Items", ItemMgr.Templates, false,
                      (item) => { return(item.DefaultName != null); },
                      (item) => { return(item.DefaultName); },
                      template =>
            {
                var strs = new List <string>();
                if (!string.IsNullOrEmpty(template.DefaultDescription))
                {
                    strs.Add("Desc: " + template.DefaultDescription);
                }
                if (template.InventorySlotType != InventorySlotType.None)
                {
                    strs.Add(template.InventorySlotType.ToString());
                }
                if (template.Level > 0)
                {
                    strs.Add("Level: " + template.Level);
                }
                if (template.Set != null)
                {
                    strs.Add("Set: " + template.Set);
                }
                if (template.Class != ItemClass.None)
                {
                    strs.Add("Class: " + template.Class);
                }
                return(strs.ToString("\n"));
            },
                      (item, name) => null,
                      (item) => { return(item.Id.ToString()); });
        }