Inheritance: ISerializableData
        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;
        }
Beispiel #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;
 }
Beispiel #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;
 }
Beispiel #4
0
 public static bool IsDye(ItemTypeTable itemType)
 {
     return ItemGroup.IsSubType(itemType, "Dye");
 }
Beispiel #5
0
 public static bool IsJournalOrScroll(ItemTypeTable itemType)
 {
     return ItemGroup.IsSubType(itemType, "Scroll") ||
         ItemGroup.IsSubType(itemType, "Book");
 }
Beispiel #6
0
 public static bool IsRuneOrJewel(ItemTypeTable itemType)
 {
     return ItemGroup.IsSubType(itemType, "Gem") ||
         ItemGroup.IsSubType(itemType, "SpellRune");
 }
Beispiel #7
0
 public static bool IsAccessory(ItemTypeTable itemType)
 {
     return ItemGroup.IsSubType(itemType, "Jewelry");
 }
Beispiel #8
0
 public static bool IsGold(ItemTypeTable itemType)
 {
     return ItemGroup.IsSubType(itemType, "Gold");
 }
Beispiel #9
0
 public static bool IsBelt(ItemTypeTable itemType)
 {
     return ItemGroup.IsSubType(itemType, "Belt");
 }
Beispiel #10
0
 public static bool IsOffhand(ItemTypeTable itemType)
 {
     return ItemGroup.IsSubType(itemType, "Offhand");
 }
Beispiel #11
0
 public static bool Is2H(ItemTypeTable type)
 {
     return (type.Array[0] & 0x400) != 0;
 }
Beispiel #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;
        }
Beispiel #13
0
 public static bool IsSubType(ItemTypeTable type, string rootTypeName)
 {
     return IsSubType(type, StringHashHelper.HashItemName(rootTypeName));
 }
Beispiel #14
0
 public static bool IsWeapon(ItemTypeTable itemType)
 {
     return ItemGroup.IsSubType(itemType, "Weapon");
 }
Beispiel #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);
 }
Beispiel #16
0
 public static bool IsArmor(ItemTypeTable itemType)
 {
     return ItemGroup.IsSubType(itemType, "Armor");
 }
Beispiel #17
0
 public static bool IsHealthGlobe(ItemTypeTable itemType)
 {
     return ItemGroup.IsSubType(itemType, "HealthGlyph");
 }
Beispiel #18
0
 public static bool Is2H(ItemTypeTable itemType)
 {
     return ItemGroup.Is2H(itemType);
 }
Beispiel #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);
 }