Beispiel #1
0
        public virtual int GetNewAosDamage(int bonus, int dice, int sides, bool playerVsPlayer, double scalar, IDamageable damageable)
        {
            Mobile target = damageable as Mobile;

            int damage      = Utility.Dice(dice, sides, bonus) * 100;
            int damageBonus = 0;

            int inscribeSkill = GetInscribeFixed(m_Caster);
            int inscribeBonus = (inscribeSkill + (1000 * (inscribeSkill / 1000))) / 200;

            damageBonus += inscribeBonus;

            int intBonus = Caster.Int / 10;

            damageBonus += intBonus;

            int sdiBonus = AosAttributes.GetValue(m_Caster, AosAttribute.SpellDamage);

            #region Mondain's Legacy
            sdiBonus += ArcaneEmpowermentSpell.GetSpellBonus(m_Caster, playerVsPlayer);
            #endregion

            if (target != null && RunedSashOfWarding.IsUnderEffects(target, WardingEffect.SpellDamage))
            {
                sdiBonus -= 10;
            }

            sdiBonus -= Block.GetSpellReduction(target);

            // PvP spell damage increase cap of 15% from an item’s magic property, 30% if spell school focused.
            if (playerVsPlayer)
            {
                if (SpellHelper.HasSpellFocus(m_Caster, CastSkill) && sdiBonus > 30)
                {
                    sdiBonus = 30;
                }

                if (!SpellHelper.HasSpellFocus(m_Caster, CastSkill) && sdiBonus > 15)
                {
                    sdiBonus = 15;
                }
            }

            damageBonus += sdiBonus;

            damage = AOS.Scale(damage, 100 + damageBonus);

            if (target != null && Feint.Registry.ContainsKey(target) && Feint.Registry[target].Enemy == Caster)
            {
                damage -= (int)((double)damage * ((double)Feint.Registry[target].DamageReduction / 100));
            }

            int evalSkill = GetDamageFixed(m_Caster);
            int evalScale = 30 + ((9 * evalSkill) / 100);

            damage = AOS.Scale(damage, evalScale);

            damage = AOS.Scale(damage, (int)(scalar * 100));

            #region Skill Mastery
            SkillMasterySpell spell = SkillMasterySpell.GetHarmfulSpell(Caster, typeof(TribulationSpell));

            if (spell != null)
            {
                spell.AbsorbDamage(ref damage);
            }
            #endregion

            return(damage / 100);
        }