Ejemplo n.º 1
0
        private static Equipment CreateShield(Int32 p_modelLevel, ESubModel p_subModel, EEquipmentType[] p_specificationList, Int32 p_prefixLevel, Int32 p_suffixLevel)
        {
            IEnumerable <ShieldStaticData> iterator = StaticDataHandler.GetIterator <ShieldStaticData>(EDataType.SHIELD_MODEL);
            EEquipmentType eequipmentType           = DetermineType(SHIELD_TYPES, p_specificationList);

            foreach (ShieldStaticData shieldStaticData in iterator)
            {
                if (shieldStaticData.Type == eequipmentType && shieldStaticData.ModelLevel == p_modelLevel && shieldStaticData.SubModel == p_subModel)
                {
                    Int32 p_suffixId = -1;
                    Int32 p_prefixId = -1;
                    if (p_prefixLevel > 0)
                    {
                        m_prefixProbabilities[EEquipmentType.SHIELD].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_prefixId = m_prefixProbabilities[EEquipmentType.SHIELD].GetRandomId();
                    }
                    if (p_suffixLevel > 0)
                    {
                        m_suffixProbabilities[EEquipmentType.SHIELD].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_suffixId = m_suffixProbabilities[EEquipmentType.SHIELD].GetRandomId();
                    }
                    Shield shield = new Shield();
                    shield.InitFromModel(shieldStaticData, p_prefixId, p_suffixId);
                    shield.PrefixLevel = p_prefixLevel;
                    shield.SuffixLevel = p_suffixLevel;
                    return(shield);
                }
            }
            return(null);
        }
Ejemplo n.º 2
0
        private static Equipment CreateMagicFocus(Int32 p_modelLevel, ESubModel p_subModel, EEquipmentType[] p_specificationList, Int32 p_prefixLevel, Int32 p_suffixLevel)
        {
            IEnumerable <MagicFocusStaticData> iterator = StaticDataHandler.GetIterator <MagicFocusStaticData>(EDataType.MAGIC_FOCUS_MODEL);
            EEquipmentType eequipmentType = DetermineType(MAGIC_FOCUS_TYPES, p_specificationList);

            foreach (MagicFocusStaticData magicFocusStaticData in iterator)
            {
                if (magicFocusStaticData.Type == eequipmentType && magicFocusStaticData.ModelLevel == p_modelLevel && magicFocusStaticData.SubModel == p_subModel)
                {
                    Int32 p_suffixId = -1;
                    Int32 p_prefixId = -1;
                    if (p_prefixLevel > 0)
                    {
                        m_prefixProbabilities[EEquipmentType.MAGIC_FOCUS].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_prefixId = m_prefixProbabilities[EEquipmentType.MAGIC_FOCUS].GetRandomId();
                    }
                    if (p_suffixLevel > 0)
                    {
                        m_suffixProbabilities[EEquipmentType.MAGIC_FOCUS].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_suffixId = m_suffixProbabilities[EEquipmentType.MAGIC_FOCUS].GetRandomId();
                    }
                    MagicFocus magicFocus = new MagicFocus();
                    magicFocus.InitFromModel(magicFocusStaticData, p_prefixId, p_suffixId);
                    magicFocus.PrefixLevel = p_prefixLevel;
                    magicFocus.SuffixLevel = p_suffixLevel;
                    return(magicFocus);
                }
            }
            return(null);
        }
Ejemplo n.º 3
0
        private static Equipment CreateRangedWeapon(Int32 p_modelLevel, ESubModel p_subModel, EEquipmentType[] p_specificationList, Int32 p_prefixLevel, Int32 p_suffixLevel)
        {
            IEnumerable <RangedWeaponStaticData> iterator = StaticDataHandler.GetIterator <RangedWeaponStaticData>(EDataType.RANGED_WEAPON_MODEL);
            EEquipmentType eequipmentType = DetermineType(RANGED_WEAPON_TYPES, p_specificationList);

            foreach (RangedWeaponStaticData rangedWeaponStaticData in iterator)
            {
                if (rangedWeaponStaticData.Type == eequipmentType && rangedWeaponStaticData.ModelLevel == p_modelLevel && rangedWeaponStaticData.SubModel == p_subModel)
                {
                    Int32 p_suffixId = -1;
                    Int32 p_prefixId = -1;
                    if (p_prefixLevel > 0)
                    {
                        m_prefixProbabilities[EEquipmentType.RANGED_WEAPON].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_prefixId = m_prefixProbabilities[EEquipmentType.RANGED_WEAPON].GetRandomId();
                    }
                    if (p_suffixLevel > 0)
                    {
                        m_suffixProbabilities[EEquipmentType.RANGED_WEAPON].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_suffixId = m_suffixProbabilities[EEquipmentType.RANGED_WEAPON].GetRandomId();
                    }
                    RangedWeapon rangedWeapon = new RangedWeapon();
                    rangedWeapon.InitFromModel(rangedWeaponStaticData, p_prefixId, p_suffixId);
                    rangedWeapon.PrefixLevel = p_prefixLevel;
                    rangedWeapon.SuffixLevel = p_suffixLevel;
                    return(rangedWeapon);
                }
            }
            return(null);
        }
Ejemplo n.º 4
0
        private static Equipment CreateJewelry(Int32 p_modelLevel, ESubModel p_subModel, EEquipmentType[] p_specificationList, Int32 p_prefixLevel, Int32 p_suffixLevel)
        {
            IEnumerable <JewelryStaticData> iterator = StaticDataHandler.GetIterator <JewelryStaticData>(EDataType.JEWELRY_MODEL);
            EEquipmentType eequipmentType            = DetermineType(JEWELRY_TYPES, p_specificationList);

            foreach (JewelryStaticData jewelryStaticData in iterator)
            {
                if (jewelryStaticData.Type == eequipmentType && jewelryStaticData.ModelLevel == p_modelLevel && jewelryStaticData.SubModel == p_subModel)
                {
                    Int32 p_suffixId = -1;
                    Int32 p_prefixId = -1;
                    if (p_prefixLevel > 0)
                    {
                        m_prefixProbabilities[EEquipmentType.JEWELRY].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_prefixId = m_prefixProbabilities[EEquipmentType.JEWELRY].GetRandomId();
                    }
                    if (p_suffixLevel > 0)
                    {
                        m_suffixProbabilities[EEquipmentType.JEWELRY].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_suffixId = m_suffixProbabilities[EEquipmentType.JEWELRY].GetRandomId();
                    }
                    Jewelry jewelry = new Jewelry();
                    jewelry.InitFromModel(jewelryStaticData, p_prefixId, p_suffixId);
                    jewelry.PrefixLevel = p_prefixLevel;
                    jewelry.SuffixLevel = p_suffixLevel;
                    return(jewelry);
                }
            }
            return(null);
        }
Ejemplo n.º 5
0
 public override void PostDeserialization()
 {
     if (m_modelLevelComplete.Length > 1)
     {
         Int32.TryParse(m_modelLevelComplete.Substring(0, 1), out m_modelLevel);
         m_subModel = (ESubModel)Enum.Parse(typeof(ESubModel), m_modelLevelComplete.Substring(1, 1), true);
     }
 }
Ejemplo n.º 6
0
 public EquipmentStaticData()
 {
     m_type            = EEquipmentType.HEADGEAR;
     m_modelLevel      = 1;
     m_subModel        = ESubModel.A;
     m_level           = 0;
     m_requiredXP      = 0;
     m_nextLevelItemID = 0;
     m_description     = String.Empty;
 }
Ejemplo n.º 7
0
        private static Equipment CreateMeleeWeapon(Int32 p_modelLevel, ESubModel p_subModel, EEquipmentType[] p_specificationList, Int32 p_prefixLevel, Int32 p_suffixLevel)
        {
            IEnumerable <MeleeWeaponStaticData> iterator = StaticDataHandler.GetIterator <MeleeWeaponStaticData>(EDataType.MELEE_WEAPON_MODEL);
            EEquipmentType eequipmentType = DetermineType(MELEE_WEAPON_TYPES, p_specificationList);
            EEquipmentType eequipmentType2;

            if (eequipmentType == EEquipmentType.DAGGER)
            {
                eequipmentType2 = EEquipmentType.ONEHANDED;
            }
            else if (eequipmentType == EEquipmentType.SPEAR)
            {
                eequipmentType2 = EEquipmentType.TWOHANDED;
            }
            else
            {
                eequipmentType2 = DetermineType(MELEE_WEAPON_SUBTYPES, p_specificationList);
            }
            foreach (MeleeWeaponStaticData meleeWeaponStaticData in iterator)
            {
                if (meleeWeaponStaticData.Type == eequipmentType && meleeWeaponStaticData.Subtype == eequipmentType2 && meleeWeaponStaticData.ModelLevel == p_modelLevel && meleeWeaponStaticData.SubModel == p_subModel)
                {
                    Int32 p_suffixId = -1;
                    Int32 p_prefixId = -1;
                    if (p_prefixLevel > 0)
                    {
                        m_prefixProbabilities[EEquipmentType.MELEE_WEAPON].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_prefixId = m_prefixProbabilities[EEquipmentType.MELEE_WEAPON].GetRandomId();
                    }
                    if (p_suffixLevel > 0)
                    {
                        m_suffixProbabilities[EEquipmentType.MELEE_WEAPON].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_suffixId = m_suffixProbabilities[EEquipmentType.MELEE_WEAPON].GetRandomId();
                    }
                    MeleeWeapon meleeWeapon = new MeleeWeapon();
                    meleeWeapon.InitFromModel(meleeWeaponStaticData, p_prefixId, p_suffixId);
                    meleeWeapon.PrefixLevel = p_prefixLevel;
                    meleeWeapon.SuffixLevel = p_suffixLevel;
                    return(meleeWeapon);
                }
            }
            return(null);
        }
Ejemplo n.º 8
0
        private static Equipment CreateArmor(Int32 p_modelLevel, ESubModel p_subModel, EEquipmentType[] p_specificationList, Int32 p_prefixLevel, Int32 p_suffixLevel)
        {
            IEnumerable <ArmorStaticData> iterator = StaticDataHandler.GetIterator <ArmorStaticData>(EDataType.ARMOR_MODEL);
            EEquipmentType eequipmentType          = DetermineType(ARMOR_TYPES, p_specificationList);
            EEquipmentType eequipmentType2;

            if (eequipmentType == EEquipmentType.GARMENT)
            {
                eequipmentType2 = DetermineType(GARMENT_SUBTYPES, p_specificationList);
            }
            else
            {
                eequipmentType2 = DetermineType(ARMOR_SUBTYPES, p_specificationList);
            }
            foreach (ArmorStaticData armorStaticData in iterator)
            {
                if (armorStaticData.Type == eequipmentType && armorStaticData.Subtype == eequipmentType2 && armorStaticData.ModelLevel == p_modelLevel && armorStaticData.SubModel == p_subModel)
                {
                    Int32 p_suffixId = -1;
                    Int32 p_prefixId = -1;
                    if (p_prefixLevel > 0)
                    {
                        m_prefixProbabilities[eequipmentType2].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_prefixId = m_prefixProbabilities[eequipmentType2].GetRandomId();
                    }
                    if (p_suffixLevel > 0)
                    {
                        m_suffixProbabilities[eequipmentType2].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_suffixId = m_suffixProbabilities[eequipmentType2].GetRandomId();
                    }
                    Armor armor = new Armor();
                    armor.InitFromModel(armorStaticData, p_prefixId, p_suffixId);
                    armor.PrefixLevel = p_prefixLevel;
                    armor.SuffixLevel = p_suffixLevel;
                    return(armor);
                }
            }
            return(null);
        }
Ejemplo n.º 9
0
 public ModelProbability(Int32 p_modelLevel, ESubModel p_subModel, Single p_weight)
 {
     ModelLevel = p_modelLevel;
     SubModel   = p_subModel;
     Weight     = p_weight;
 }
Ejemplo n.º 10
0
 private static void ResolveColumnValue(Object sender, ColumnValueResolveEventArg e)
 {
     if (e.Type == typeof(Resistance[]))
     {
         String[]          array = e.Value.Split(s_Seperator, StringSplitOptions.RemoveEmptyEntries);
         List <Resistance> list  = new List <Resistance>(array.Length / 2);
         for (Int32 i = 1; i < array.Length; i += 2)
         {
             Resistance item;
             item.Type  = (EDamageType)Enum.Parse(typeof(EDamageType), array[i - 1], true);
             item.Value = Int32.Parse(array[i], CultureInfo.InvariantCulture);
             list.Add(item);
         }
         e.Output = list.ToArray();
     }
     else if (e.Type == typeof(DamageData[]))
     {
         String[]          array2 = e.Value.Split(s_Seperator, StringSplitOptions.RemoveEmptyEntries);
         List <DamageData> list2  = new List <DamageData>(array2.Length / 3);
         for (Int32 j = 2; j < array2.Length; j += 3)
         {
             EDamageType p_type    = (EDamageType)Enum.Parse(typeof(EDamageType), array2[j - 2], true);
             Int32       p_minimum = Int32.Parse(array2[j - 1]);
             Int32       p_maximum = Int32.Parse(array2[j]);
             DamageData  item2     = new DamageData(p_type, p_minimum, p_maximum);
             list2.Add(item2);
         }
         e.Output = list2.ToArray();
     }
     else if (e.Type == typeof(NpcEffect[]))
     {
         String[]         array3 = e.Value.Split(s_Seperator, StringSplitOptions.RemoveEmptyEntries);
         List <NpcEffect> list3  = new List <NpcEffect>(array3.Length / 4);
         for (Int32 k = 3; k < array3.Length; k += 4)
         {
             ETargetCondition   p_targetEffect = (ETargetCondition)Enum.Parse(typeof(ETargetCondition), array3[k - 3], true);
             EEffectPeriodicity p_effectType   = (EEffectPeriodicity)Enum.Parse(typeof(EEffectPeriodicity), array3[k - 2], true);
             Single             p_effectValue  = Single.Parse(array3[k - 1]);
             Int32     p_effectPrice           = Int32.Parse(array3[k]);
             NpcEffect item3 = new NpcEffect(p_targetEffect, p_effectType, p_effectValue, p_effectPrice);
             list3.Add(item3);
         }
         e.Output = list3.ToArray();
     }
     else if (e.Type == typeof(IntRange))
     {
         String[] array4 = e.Value.Split(s_Seperator, StringSplitOptions.RemoveEmptyEntries);
         IntRange zero   = IntRange.Zero;
         if (array4.Length == 1)
         {
             zero.Min = (zero.Max = Int32.Parse(array4[0]));
         }
         else if (array4.Length > 1)
         {
             zero.Min = Int32.Parse(array4[0]);
             zero.Max = Int32.Parse(array4[1]);
         }
         e.Output = zero;
     }
     else if (e.Type == typeof(FloatRange))
     {
         String[]   array5 = e.Value.Split(s_Seperator, StringSplitOptions.RemoveEmptyEntries);
         FloatRange zero2  = FloatRange.Zero;
         if (array5.Length == 1)
         {
             zero2.Min = (zero2.Max = Single.Parse(array5[0]));
         }
         else if (array5.Length > 1)
         {
             zero2.Min = Single.Parse(array5[0]);
             zero2.Max = Single.Parse(array5[1]);
         }
         e.Output = zero2;
     }
     else if (e.Type == typeof(MonsterStaticData.SpellData[]))
     {
         String[] array6 = e.Value.Split(s_Seperator, StringSplitOptions.RemoveEmptyEntries);
         List <MonsterStaticData.SpellData> list4 = new List <MonsterStaticData.SpellData>(array6.Length / 4);
         for (Int32 l = 2; l < array6.Length; l += 4)
         {
             String p_animationClipName = array6[l - 2];
             Int32  p_spellID           = Int32.Parse(array6[l - 1]);
             Int32  p_spellProbability  = Int32.Parse(array6[l]);
             Int32  p_level             = Int32.Parse(array6[l + 1]);
             list4.Add(new MonsterStaticData.SpellData(p_animationClipName, p_spellID, p_spellProbability, p_level));
         }
         e.Output = list4.ToArray();
     }
     else if (e.Type == typeof(MonsterStaticData.ExtraDamage))
     {
         String[] array7 = e.Value.Split(s_Seperator, StringSplitOptions.RemoveEmptyEntries);
         if (array7.Length > 0)
         {
             MonsterStaticData.ExtraDamage extraDamage = new MonsterStaticData.ExtraDamage((EDamageType)Enum.Parse(typeof(EDamageType), array7[0], true), Int32.Parse(array7[1]));
             e.Output = extraDamage;
         }
     }
     else if (e.Type == typeof(ItemOffer[]))
     {
         String[]    array8 = e.Value.Split(s_Seperator, StringSplitOptions.RemoveEmptyEntries);
         ItemOffer[] array9 = new ItemOffer[array8.Length / 3];
         for (Int32 m = 0; m < array9.Length; m++)
         {
             EDataType p_itemType     = (EDataType)Enum.Parse(typeof(EDataType), array8[m * 3], true);
             Int32     p_itemID       = Int32.Parse(array8[m * 3 + 1]);
             Int32     p_itemQuantity = Int32.Parse(array8[m * 3 + 2]);
             array9[m] = new ItemOffer(p_itemType, p_itemID, p_itemQuantity);
         }
         e.Output = array9;
     }
     else if (e.Type == typeof(Position))
     {
         String[] array10  = e.Value.Split(s_Seperator, StringSplitOptions.RemoveEmptyEntries);
         Position position = default(Position);
         if (array10.Length == 2)
         {
             position.X = Int32.Parse(array10[0]);
             position.Y = Int32.Parse(array10[1]);
         }
         e.Output = position;
     }
     else if (e.Type == typeof(EquipmentData[]))
     {
         String[]        array11 = e.Value.Split(s_Seperator, StringSplitOptions.RemoveEmptyEntries);
         EquipmentData[] array12 = new EquipmentData[array11.Length / 2];
         for (Int32 n = 0; n < array12.Length; n++)
         {
             EDataType p_type2    = (EDataType)Enum.Parse(typeof(EDataType), array11[n * 2], true);
             Int32     p_staticId = Int32.Parse(array11[n * 2 + 1]);
             array12[n] = new EquipmentData(p_type2, p_staticId);
         }
         e.Output = array12;
     }
     else if (e.Type == typeof(SteadyLoot[]))
     {
         String[]     array13 = e.Value.Split(s_Seperator, StringSplitOptions.RemoveEmptyEntries);
         SteadyLoot[] array14 = new SteadyLoot[array13.Length / 5];
         for (Int32 num = 0; num < array14.Length; num++)
         {
             EDataType p_itemClass  = (EDataType)Enum.Parse(typeof(EDataType), array13[num * 5], true);
             Int32     p_itemID2    = Int32.Parse(array13[num * 5 + 1]);
             Int32     p_min        = Int32.Parse(array13[num * 5 + 2]);
             Int32     p_max        = Int32.Parse(array13[num * 5 + 3]);
             Single    p_dropChance = Single.Parse(array13[num * 5 + 4]);
             array14[num] = new SteadyLoot(p_itemClass, p_itemID2, p_min, p_max, p_dropChance);
         }
         e.Output = array14;
     }
     else if (e.Type == typeof(ModelProbability[]))
     {
         String[]           array15 = e.Value.Split(s_Seperator, StringSplitOptions.RemoveEmptyEntries);
         ModelProbability[] array16 = new ModelProbability[array15.Length / 2];
         for (Int32 num2 = 0; num2 < array16.Length; num2++)
         {
             String    text         = array15[num2 * 2];
             Int32     p_modelLevel = Int32.Parse(text.Substring(0, 1));
             ESubModel p_subModel   = (ESubModel)Enum.Parse(typeof(ESubModel), text.Substring(1, 1), true);
             Single    p_weight     = Single.Parse(array15[num2 * 2 + 1]);
             array16[num2] = new ModelProbability(p_modelLevel, p_subModel, p_weight);
         }
         e.Output = array16;
     }
     else if (e.Type == typeof(EnchantmentProbability[]))
     {
         String[] array17 = e.Value.Split(s_Seperator, StringSplitOptions.RemoveEmptyEntries);
         EnchantmentProbability[] array18 = new EnchantmentProbability[array17.Length / 2];
         for (Int32 num3 = 0; num3 < array18.Length; num3++)
         {
             Int32  p_modelLevel2 = Int32.Parse(array17[num3 * 2]);
             Single p_weight2     = Single.Parse(array17[num3 * 2 + 1]);
             array18[num3] = new EnchantmentProbability(p_modelLevel2, p_weight2);
         }
         e.Output = array18;
     }
     else if (e.Type == typeof(StepsOnTerrainData))
     {
         StepsOnTerrainData empty   = StepsOnTerrainData.Empty;
         String[]           array19 = e.Value.Split(s_Seperator, StringSplitOptions.RemoveEmptyEntries);
         if (array19.Length == 2)
         {
             Int32        p_numberOfSteps = Int32.Parse(array19[0]);
             ETerrainType p_type3         = (ETerrainType)Enum.Parse(typeof(ETerrainType), array19[1], true);
             empty = new StepsOnTerrainData(p_numberOfSteps, p_type3);
         }
         e.Output = empty;
     }
     else if (e.Type == typeof(MonsterAbilityID[]))
     {
         String[]           array20 = e.Value.Split(s_Seperator, StringSplitOptions.RemoveEmptyEntries);
         MonsterAbilityID[] array21 = new MonsterAbilityID[array20.Length / 2];
         for (Int32 num4 = 0; num4 < array21.Length; num4++)
         {
             MonsterAbilityID monsterAbilityID;
             monsterAbilityID.AbilityType = (EMonsterAbilityType)Enum.Parse(typeof(EMonsterAbilityType), array20[num4 * 2]);
             monsterAbilityID.Level       = Int32.Parse(array20[num4 * 2 + 1]);
             array21[num4] = monsterAbilityID;
         }
         e.Output = array21;
     }
 }