Example #1
0
        // =========== Check if Choosen Attribute Replaces Another =================
        public static TextDefinition WhatReplacesWhat(int id, Item item)
        {
            if (Imbuing.GetValueForID(item, id) > 0)
            {
                return(ItemPropertyInfo.GetAttributeName(id));
            }

            if (item is BaseWeapon)
            {
                BaseWeapon i = item as BaseWeapon;

                // Slayers replace Slayers
                if (id >= 101 && id <= 127)
                {
                    if (i.Slayer != SlayerName.None)
                    {
                        return(GetNameForAttribute(i.Slayer));
                    }

                    if (i.Slayer2 != SlayerName.None)
                    {
                        return(GetNameForAttribute(i.Slayer2));
                    }
                }
                // OnHitEffect replace OnHitEffect
                if (id >= 35 && id <= 39)
                {
                    if (i.WeaponAttributes.HitMagicArrow > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitMagicArrow));
                    }
                    else if (i.WeaponAttributes.HitHarm > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitHarm));
                    }
                    else if (i.WeaponAttributes.HitFireball > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitFireball));
                    }
                    else if (i.WeaponAttributes.HitLightning > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitLightning));
                    }
                    else if (i.WeaponAttributes.HitDispel > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitDispel));
                    }
                }
                // OnHitArea replace OnHitArea
                if (id >= 30 && id <= 34)
                {
                    if (i.WeaponAttributes.HitPhysicalArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitPhysicalArea));
                    }
                    else if (i.WeaponAttributes.HitColdArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitFireArea));
                    }
                    else if (i.WeaponAttributes.HitFireArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitColdArea));
                    }
                    else if (i.WeaponAttributes.HitPoisonArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitPoisonArea));
                    }
                    else if (i.WeaponAttributes.HitEnergyArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitEnergyArea));
                    }
                }
            }
            if (item is BaseJewel)
            {
                BaseJewel jewel = item as BaseJewel;

                if (id >= 151 && id <= 183)
                {
                    AosSkillBonuses bonuses = jewel.SkillBonuses;
                    SkillName[]     group   = Imbuing.GetSkillGroup((SkillName)ItemPropertyInfo.GetAttribute(id));

                    for (int i = 0; i < 5; i++)
                    {
                        if (bonuses.GetBonus(i) > 0 && group.Any(sk => sk == bonuses.GetSkill(i)))
                        {
                            return(GetNameForAttribute(bonuses.GetSkill(i)));
                        }
                    }
                }
            }

            return(null);
        }
Example #2
0
        // =========== Check if Choosen Attribute Replaces Another =================
        public static TextDefinition WhatReplacesWhat(int id, Item item)
        {
            if (Imbuing.GetValueForID(item, id) > 0)
            {
                return(ItemPropertyInfo.GetAttributeName(id));
            }

            if (item is BaseWeapon)
            {
                BaseWeapon i = item as BaseWeapon;

                // Slayers replace Slayers
                if (id >= 101 && id <= 127)
                {
                    if (i.Slayer != SlayerName.None)
                    {
                        return(GetNameForAttribute(i.Slayer));
                    }

                    if (i.Slayer2 != SlayerName.None)
                    {
                        return(GetNameForAttribute(i.Slayer2));
                    }
                }
                // OnHitEffect replace OnHitEffect
                if (id >= 35 && id <= 39)
                {
                    if (i.WeaponAttributes.HitMagicArrow > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitMagicArrow));
                    }
                    else if (i.WeaponAttributes.HitHarm > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitHarm));
                    }
                    else if (i.WeaponAttributes.HitFireball > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitFireball));
                    }
                    else if (i.WeaponAttributes.HitLightning > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitLightning));
                    }
                    else if (i.WeaponAttributes.HitDispel > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitDispel));
                    }
                }
                // OnHitArea replace OnHitArea
                if (id >= 30 && id <= 34)
                {
                    if (i.WeaponAttributes.HitPhysicalArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitPhysicalArea));
                    }
                    else if (i.WeaponAttributes.HitColdArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitFireArea));
                    }
                    else if (i.WeaponAttributes.HitFireArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitColdArea));
                    }
                    else if (i.WeaponAttributes.HitPoisonArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitPoisonArea));
                    }
                    else if (i.WeaponAttributes.HitEnergyArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitEnergyArea));
                    }
                }
            }
            if (item is BaseJewel)
            {
                BaseJewel jewel = item as BaseJewel;

                if (id >= 151 && id <= 183)
                {
                    AosSkillBonuses bonuses = jewel.SkillBonuses;
                    SkillName[]     group   = Imbuing.GetSkillGroup((SkillName)ItemPropertyInfo.GetAttribute(id));

                    for (int i = 0; i < 5; i++)
                    {
                        if (bonuses.GetBonus(i) > 0 && group.Any(sk => sk == bonuses.GetSkill(i)))
                        {
                            return(GetNameForAttribute(bonuses.GetSkill(i)));
                        }
                    }
                }

                // SkillGroup1 replace SkillGroup1

                /*if (id >= 151 && id <= 155)
                 * {
                 *  if (i.SkillBonuses.GetBonus(0) > 0)
                 *  {
                 *      foreach (SkillName sk in Imbuing.PossibleSkills)
                 *      {
                 *          if (i.SkillBonuses.GetSkill(0) == sk)
                 *              return GetNameForAttribute(sk);
                 *      }
                 *  }
                 * }
                 * // SkillGroup2 replace SkillGroup2
                 * if (id >= 156 && id <= 160)
                 * {
                 *  if (i.SkillBonuses.GetBonus(1) > 0)
                 *  {
                 *      foreach (SkillName sk in Imbuing.PossibleSkills)
                 *      {
                 *          if (i.SkillBonuses.GetSkill(1) == sk)
                 *              return GetNameForAttribute(sk);
                 *      }
                 *  }
                 * }
                 * // SkillGroup3 replace SkillGroup3
                 * if (id >= 161 && id <= 166)
                 * {
                 *  if (i.SkillBonuses.GetBonus(2) > 0)
                 *  {
                 *      foreach (SkillName sk in Imbuing.PossibleSkills)
                 *      {
                 *          if (i.SkillBonuses.GetSkill(2) == sk)
                 *              return GetNameForAttribute(sk);
                 *      }
                 *  }
                 * }
                 * // SkillGroup4 replace SkillGroup4
                 * if (id >= 167 && id <= 172)
                 * {
                 *  if (i.SkillBonuses.GetBonus(3) > 0)
                 *  {
                 *      foreach (SkillName sk in Imbuing.PossibleSkills)
                 *      {
                 *          if (i.SkillBonuses.GetSkill(3) == sk)
                 *              return GetNameForAttribute(sk);
                 *      }
                 *  }
                 * }
                 * // SkillGroup5 replace SkillGroup5
                 * if (id >= 173 && id <= 178)
                 * {
                 *  if (i.SkillBonuses.GetBonus(4) > 0)
                 *  {
                 *      foreach (SkillName sk in Imbuing.PossibleSkills)
                 *      {
                 *          if (i.SkillBonuses.GetSkill(4) == sk)
                 *              return GetNameForAttribute(sk);
                 *      }
                 *  }
                 * }*/
            }

            return(null);
        }