Exemplo n.º 1
0
 public void InitializeDamage(Solver solver, bool areaEffect, int range, MagicSchool magicSchool, SpellData spellData)
 {
     InitializeDamage(solver, areaEffect, range, magicSchool, spellData, 1, 1, 0);
 }
Exemplo n.º 2
0
        public void InitializeDamage(Solver solver, bool areaEffect, int range, MagicSchool magicSchool, SpellData spellData, float hitProcs, float castProcs, float dotDuration)
        {
            Stats                  baseStats          = solver.BaseStats;
            MageTalents            mageTalents        = solver.MageTalents;
            CalculationOptionsMage calculationOptions = solver.CalculationOptions;

            AreaEffect             = areaEffect;
            BaseCost               = spellData.Cost - (int)baseStats.SpellsManaReduction;
            MagicSchool            = magicSchool;
            Ticks                  = hitProcs;
            CastProcs              = castProcs;
            CastProcs2             = castProcs;
            BaseMinDamage          = spellData.MinDamage;
            BaseMaxDamage          = spellData.MaxDamage;
            SpellDamageCoefficient = spellData.SpellDamageCoefficient;
            BasePeriodicDamage     = spellData.PeriodicDamage;
            DotDamageCoefficient   = spellData.DotDamageCoefficient;
            DotDuration            = dotDuration;

            BaseDirectDamageModifier = 1.0f;
            BaseDotDamageModifier    = 1.0f;
            BaseCostModifier         = 1.0f;

            float baseCostAmplifier = calculationOptions.EffectCostMultiplier;

            baseCostAmplifier *= (1.0f - 0.01f * mageTalents.Precision);
            if (mageTalents.FrostChanneling > 0)
            {
                baseCostAmplifier *= (1.0f - 0.01f - 0.03f * mageTalents.FrostChanneling);
            }
            if (MagicSchool == MagicSchool.Arcane)
            {
                baseCostAmplifier *= (1.0f - 0.01f * mageTalents.ArcaneFocus);
            }
            BaseCostAmplifier = baseCostAmplifier;

            float baseInterruptProtection = baseStats.InterruptProtection;

            if (MagicSchool == MagicSchool.Fire || MagicSchool == MagicSchool.FrostFire)
            {
                baseInterruptProtection += 0.35f * mageTalents.BurningSoul;
            }
            BaseInterruptProtection = baseInterruptProtection;

            float realResistance;

            switch (MagicSchool)
            {
            case MagicSchool.Arcane:
                BaseSpellModifier         = solver.BaseArcaneSpellModifier;
                BaseAdditiveSpellModifier = solver.BaseArcaneAdditiveSpellModifier;
                BaseCritRate     = solver.BaseArcaneCritRate;
                CritBonus        = solver.BaseArcaneCritBonus;
                HitRate          = solver.BaseArcaneHitRate;
                ThreatMultiplier = solver.ArcaneThreatMultiplier;
                realResistance   = calculationOptions.ArcaneResist;
                if (range != 0)
                {
                    Range = range + mageTalents.MagicAttunement * 3;
                }
                break;

            case MagicSchool.Fire:
                BaseSpellModifier         = solver.BaseFireSpellModifier;
                BaseAdditiveSpellModifier = solver.BaseFireAdditiveSpellModifier;
                BaseCritRate     = solver.BaseFireCritRate;
                CritBonus        = solver.BaseFireCritBonus;
                HitRate          = solver.BaseFireHitRate;
                ThreatMultiplier = solver.FireThreatMultiplier;
                realResistance   = calculationOptions.FireResist;
                if (range != 0)
                {
                    Range = range + mageTalents.FlameThrowing * 3;
                }
                break;

            case MagicSchool.FrostFire:
                BaseSpellModifier         = solver.BaseFrostFireSpellModifier;
                BaseAdditiveSpellModifier = solver.BaseFrostFireAdditiveSpellModifier;
                BaseCritRate     = solver.BaseFrostFireCritRate;
                CritBonus        = solver.BaseFrostFireCritBonus;
                HitRate          = solver.BaseFrostFireHitRate;
                ThreatMultiplier = solver.FrostFireThreatMultiplier;
                if (calculationOptions.FireResist == -1)
                {
                    realResistance = calculationOptions.FrostResist;
                }
                else if (calculationOptions.FrostResist == -1)
                {
                    realResistance = calculationOptions.FireResist;
                }
                else
                {
                    realResistance = Math.Min(calculationOptions.FireResist, calculationOptions.FrostResist);
                }
                Range = range;
                break;

            case MagicSchool.Frost:
                BaseSpellModifier         = solver.BaseFrostSpellModifier;
                BaseAdditiveSpellModifier = solver.BaseFrostAdditiveSpellModifier;
                BaseCritRate     = solver.BaseFrostCritRate;
                CritBonus        = solver.BaseFrostCritBonus;
                HitRate          = solver.BaseFrostHitRate;
                ThreatMultiplier = solver.FrostThreatMultiplier;
                realResistance   = calculationOptions.FrostResist;
                Range            = range * (1 + mageTalents.ArcticReach * 0.1f);
                break;

            case MagicSchool.Nature:
                BaseSpellModifier         = solver.BaseNatureSpellModifier;
                BaseAdditiveSpellModifier = solver.BaseNatureAdditiveSpellModifier;
                BaseCritRate     = solver.BaseNatureCritRate;
                CritBonus        = solver.BaseNatureCritBonus;
                HitRate          = solver.BaseNatureHitRate;
                ThreatMultiplier = solver.NatureThreatMultiplier;
                realResistance   = calculationOptions.NatureResist;
                Range            = range;
                break;

            case MagicSchool.Shadow:
                BaseSpellModifier         = solver.BaseShadowSpellModifier;
                BaseAdditiveSpellModifier = solver.BaseShadowAdditiveSpellModifier;
                BaseCritRate     = solver.BaseShadowCritRate;
                CritBonus        = solver.BaseShadowCritBonus;
                HitRate          = solver.BaseShadowHitRate;
                ThreatMultiplier = solver.ShadowThreatMultiplier;
                realResistance   = calculationOptions.ShadowResist;
                Range            = range;
                break;

            case MagicSchool.Holy:
            default:
                BaseSpellModifier         = solver.BaseHolySpellModifier;
                BaseAdditiveSpellModifier = solver.BaseHolyAdditiveSpellModifier;
                BaseCritRate     = solver.BaseHolyCritRate;
                CritBonus        = solver.BaseHolyCritBonus;
                HitRate          = solver.BaseHolyHitRate;
                ThreatMultiplier = solver.HolyThreatMultiplier;
                realResistance   = calculationOptions.HolyResist;
                Range            = range;
                break;
            }

            int playerLevel = calculationOptions.PlayerLevel;
            int targetLevel;

            if (areaEffect)
            {
                targetLevel = calculationOptions.AoeTargetLevel;
                float hitRate = ((targetLevel <= playerLevel + 2) ? (0.96f - (targetLevel - playerLevel) * 0.01f) : (0.94f - (targetLevel - playerLevel - 2) * 0.11f)) + solver.BaseSpellHit;
                if (MagicSchool == MagicSchool.Arcane)
                {
                    hitRate += 0.01f * mageTalents.ArcaneFocus;
                }
                if (hitRate > Spell.MaxHitRate)
                {
                    hitRate = Spell.MaxHitRate;
                }
                HitRate = hitRate;
            }
            else
            {
                targetLevel = calculationOptions.TargetLevel;
            }

            RealResistance      = realResistance;
            PartialResistFactor = (realResistance == -1) ? 0 : (1 - StatConversion.GetAverageResistance(playerLevel, targetLevel, realResistance, baseStats.SpellPenetration));
        }
Exemplo n.º 3
0
 public void InitializeDamage(Solver solver, bool areaEffect, int range, MagicSchool magicSchool, SpellData spellData, float hitProcs, float castProcs, float dotDuration)
 {
     InitializeDamage(solver, areaEffect, range, magicSchool, spellData.Cost, spellData.MinDamage, spellData.MaxDamage, spellData.SpellDamageCoefficient, spellData.PeriodicDamage, spellData.DotDamageCoefficient, hitProcs, castProcs, dotDuration);
 }