Inheritance: ISerializableData
Example #1
0
        public List<IItemAttributeCreator> Create(ItemTypeTable itemType)
        {
            var creatorList = new List<IItemAttributeCreator> {new DefaultAttributeCreator()};

            //if (Item.IsWeapon(itemType)) creatorList.Add(new WeaponAttributeCreator());
            //else if (Item.IsPotion(itemType))  creatorList.Add(new PotionAttributeCreator());

            return creatorList;
        }
Example #2
0
 public static List<int> HierarchyToHashList(ItemTypeTable itemType)
 {
     List<int> result = new List<int>();
     var types = HierarchyToList(itemType);
     foreach (var type in types)
     {
         result.Add(type.Hash);
     }
     return result;
 }
Example #3
0
 public static List<ItemTypeTable> HierarchyToList(ItemTypeTable itemType)
 {
     List<ItemTypeTable> result = new List<ItemTypeTable>();
     var curType = itemType;
     if (curType != null)
     {
         result.Add(curType);
         while (curType.ParentType != -1)
         {
             curType = ItemTypes[curType.ParentType];
             result.Add(curType);
         }
     }
     return result;
 }
Example #4
0
 public static bool IsDye(ItemTypeTable itemType)
 {
     return ItemGroup.IsSubType(itemType, "Dye");
 }
Example #5
0
 public static bool IsJournalOrScroll(ItemTypeTable itemType)
 {
     return ItemGroup.IsSubType(itemType, "Scroll") ||
         ItemGroup.IsSubType(itemType, "Book");
 }
Example #6
0
 public static bool IsRuneOrJewel(ItemTypeTable itemType)
 {
     return ItemGroup.IsSubType(itemType, "Gem") ||
         ItemGroup.IsSubType(itemType, "SpellRune");
 }
Example #7
0
 public static bool IsAccessory(ItemTypeTable itemType)
 {
     return ItemGroup.IsSubType(itemType, "Jewelry");
 }
Example #8
0
 public static bool IsGold(ItemTypeTable itemType)
 {
     return ItemGroup.IsSubType(itemType, "Gold");
 }
Example #9
0
 public static bool IsBelt(ItemTypeTable itemType)
 {
     return ItemGroup.IsSubType(itemType, "Belt");
 }
Example #10
0
 public static bool IsOffhand(ItemTypeTable itemType)
 {
     return ItemGroup.IsSubType(itemType, "Offhand");
 }
Example #11
0
 public static bool Is2H(ItemTypeTable type)
 {
     return (type.Array[0] & 0x400) != 0;
 }
Example #12
0
        public static bool IsSubType(ItemTypeTable type, int rootTypeHash)
        {
            if (type == null)
                return false;

            if (type.Hash == rootTypeHash)
                return true;
            var curType = type;
            while (curType.ParentType != -1)
            {
                curType = ItemTypes[curType.ParentType];
                if (curType.Hash == rootTypeHash)
                {
                    return true;
                }
            }
            return false;
        }
Example #13
0
 public static bool IsSubType(ItemTypeTable type, string rootTypeName)
 {
     return IsSubType(type, StringHashHelper.HashItemName(rootTypeName));
 }
Example #14
0
 public static bool IsWeapon(ItemTypeTable itemType)
 {
     return ItemGroup.IsSubType(itemType, "Weapon");
 }
Example #15
0
 // generates a random item from given type category.
 // we can also set a difficulty mode parameter here, but it seems current db doesnt have nightmare or hell-mode items with valid snoId's /raist.
 public static Item GenerateRandom(Mooege.Core.GS.Actors.Actor player, ItemTypeTable type)
 {
     var itemDefinition = GetRandom(Items.Values
         .Where(def => ItemGroup
             .HierarchyToHashList(ItemGroup.FromHash(def.ItemType1)).Contains(type.Hash)).ToList());
     return CreateItem(player, itemDefinition);
 }
Example #16
0
 public static bool IsArmor(ItemTypeTable itemType)
 {
     return ItemGroup.IsSubType(itemType, "Armor");
 }
Example #17
0
 public static bool IsHealthGlobe(ItemTypeTable itemType)
 {
     return ItemGroup.IsSubType(itemType, "HealthGlyph");
 }
Example #18
0
 public static bool Is2H(ItemTypeTable itemType)
 {
     return ItemGroup.Is2H(itemType);
 }
Example #19
0
 // generates a random item from given type category.
 // we can also set a difficulty mode parameter here, but it seems current db doesnt have nightmare or hell-mode items with valid snoId's /raist.
 public static Item GenerateRandom(Mooege.Core.GS.Actors.Actor player, ItemTypeTable type)
 {
     // TODO
     var itemDefinition = GetRandom(Items.Values.ToList());
     return CreateItem(player, itemDefinition);
 }