Пример #1
0
        public Armor(StatsSet set) : base(set)
        {
            Type          = Utilz.GetEnumFromString(set.GetString("armor_type", "none"), ArmorTypeId.None);
            AvoidModifier = set.GetInt("avoid_modify");
            Pdef          = set.GetInt("p_def");
            Mdef          = set.GetInt("m_def");
            MpBonus       = set.GetInt("mp_bonus");
            HpBonus       = set.GetInt("hp_bonus");

            int bodyPart = BodyPart;

            if ((bodyPart == SlotNeck) || (bodyPart == SlotFace) || (bodyPart == SlotHair) || (bodyPart == SlotHairall) || ((bodyPart & SlotREar) != 0) || ((bodyPart & SlotLFinger) != 0) || ((bodyPart & SlotBack) != 0))
            {
                Type1 = Type1WeaponRingEarringNecklace;
                Type2 = Type2Accessory;
            }
            else
            {
                if ((Type == ArmorType.None.Id) && (BodyPart == SlotLHand)) // retail define shield as NONE
                {
                    Type = ArmorType.Shield.Id;
                }

                Type1 = Type1ShieldArmor;
                Type2 = Type2ShieldArmor;
            }
        }
Пример #2
0
 public Weapon(StatsSet set) : base(set)
 {
     Type            = Utilz.GetEnumFromString(set.GetString("weaponType", "none"), WeaponTypeId.None);
     SoulshotCount   = set.GetInt("soulshots");
     SpiritshotCount = set.GetInt("spiritshots");
     PDam            = set.GetInt("p_dam");
     RndDam          = set.GetInt("rnd_dam");
     Critical        = set.GetInt("critical");
     HitModifier     = set.GetDouble("hit_modify");
     AvoidModifier   = set.GetInt("avoid_modify");
     ShieldDef       = set.GetInt("shield_def");
     ShieldDefRate   = set.GetDouble("shield_def_rate");
     AtkSpeed        = set.GetInt("atk_speed");
     AtkReuse        = set.GetInt("atk_reuse", Type == WeaponTypeId.Bow ? 1500 : 0);
     MpConsume       = set.GetInt("mp_consume");
     MDam            = set.GetInt("m_dam");
 }
Пример #3
0
        private void LoadEtcItemModels()
        {
            Dictionary <int, EtcItemModel> etcItemModels = ItemService.GetAllEtcItemModelsDict();

            foreach (KeyValuePair <int, EtcItemModel> modelPair in etcItemModels)
            {
                StatsSet     set     = new StatsSet();
                EtcItemModel model   = modelPair.Value;
                EtcItem      etcItem = new EtcItem(set)
                {
                    Type        = Utilz.GetEnumFromString(model.ItemType, EtcItemTypeId.None),
                    ItemId      = model.ItemId,
                    Name        = model.Name,
                    Sellable    = model.Sellable,
                    Dropable    = model.Dropable,
                    Destroyable = model.Destroyable,
                    Tradable    = model.Tradeable,
                    Weight      = model.Weight,
                    Duration    = model.Duration
                };
                EtcItems.Add(modelPair.Key, etcItem);
            }
        }
Пример #4
0
        private void LoadWeaponModels()
        {
            Dictionary <int, WeaponModel> weaponModels = ItemService.GetAllWeaponModelsDict();

            foreach (KeyValuePair <int, WeaponModel> modelPair in weaponModels)
            {
                StatsSet    set    = new StatsSet();
                WeaponModel model  = modelPair.Value;
                Weapon      weapon = new Weapon(set)
                {
                    Type            = Utilz.GetEnumFromString(model.WeaponType, WeaponTypeId.None),
                    ItemId          = model.ItemId,
                    Name            = model.Name,
                    BodyPart        = Slots[model.BodyPart],
                    Sellable        = model.Sellable,
                    Dropable        = model.Dropable,
                    Destroyable     = model.Destroyable,
                    Tradable        = model.Tradeable,
                    Weight          = model.Weight,
                    Duration        = model.Duration,
                    ReferencePrice  = model.Price,
                    SpiritshotCount = model.Spiritshots,
                    SoulshotCount   = model.Soulshots,
                    PDam            = model.Pdam,
                    RndDam          = model.RndDam,
                    Critical        = model.Critical,
                    HitModifier     = model.HitModify,
                    AvoidModifier   = model.AvoidModify,
                    ShieldDef       = model.ShieldDef,
                    ShieldDefRate   = model.ShieldDefRate,
                    AtkSpeed        = model.AtkSpeed,
                    MpConsume       = model.MpConsume,
                    MDam            = model.Mdam
                };
                Weapons.Add(modelPair.Key, weapon);
            }
        }
Пример #5
0
        private void LoadArmorModels()
        {
            Dictionary <int, ArmorModel> armorsModels = ItemService.GetAllArmorModelsDict();

            foreach (KeyValuePair <int, ArmorModel> modelPair in armorsModels)
            {
                StatsSet   set   = new StatsSet();
                ArmorModel model = modelPair.Value;
                Armor      armor = new Armor(set)
                {
                    Type        = Utilz.GetEnumFromString(model.ArmorType, ArmorTypeId.None),
                    ItemId      = model.ItemId,
                    Name        = model.Name,
                    BodyPart    = Slots[model.BodyPart],
                    Sellable    = model.Sellable,
                    Dropable    = model.Dropable,
                    Destroyable = model.Destroyable,
                    Tradable    = model.Tradeable,
                    Weight      = model.Weight,
                    Duration    = model.Duration
                };
                Armors.Add(modelPair.Key, armor);
            }
        }
Пример #6
0
 public EtcItem(StatsSet set) : base(set)
 {
     Type = Utilz.GetEnumFromString(set.GetString("item_type", "None"), EtcItemTypeId.None);
 }