private static void FixUnholyFeverAndEbonPlague()
        {
            // Both diseases toggle this spell to increase disease damage taken percent
            var dmgAmplifier       = SpellHandler.AddCustomSpell(65142, "Overridden Disease Damage Percent");
            var dmgAmplifierEffect = dmgAmplifier.AddAuraEffect(() => new ModDiseaseDamagePercentHandler());

            dmgAmplifierEffect.OverrideEffectValue = true;

            // Crypt Fever does not proc correctly
            SpellLineId.DeathKnightUnholyCryptFever.Apply(spell =>
            {
                // proc when a new Aura is applied to a target
                spell.ProcTriggerFlags = ProcTriggerFlags.DoneHarmfulMagicSpell;

                var effect                      = spell.GetEffect(AuraType.OverrideClassScripts);
                effect.IsProc                   = true;
                effect.TriggerSpellId           = CryptFeverRanks[spell.Rank - 1];
                effect.AuraEffectHandlerCreator = () => new CryptFeverHandler();
                effect.ClearAffectMask();
            });

            // The Ebon Plague effect also "increases magic damage taken by $s2%"
            SpellHandler.Apply(spell =>
            {
                var effect      = spell.GetEffect(AuraType.Dummy);
                effect.AuraType = AuraType.ModDamageTakenPercent;
            }, EbonPlagueRanks);
        }
Example #2
0
        private static void FixStrongBuffs()
        {
            // used by client only to prevent casting of Invul buffs
            var avengingWrathMarker2 = SpellHandler.AddCustomSpell(61988, "Invul Prevention");

            avengingWrathMarker2.IsPreventionDebuff = true;                                     // is prevention debuff
            avengingWrathMarker2.AddAuraEffect(AuraType.Dummy);                                 // make Aura
            avengingWrathMarker2.Attributes    |= SpellAttributes.InvisibleAura | SpellAttributes.UnaffectedByInvulnerability;
            avengingWrathMarker2.AttributesExC |= SpellAttributesExC.PersistsThroughDeath;
            //avengingWrathMarker2.Durations = new Spell.DurationEntry { Min = 180000, Max = 180000 };
            avengingWrathMarker2.Durations = new Spell.DurationEntry {
                Min = 120000, Max = 120000
            };

            SpellHandler.Apply(spell => spell.AddTargetTriggerSpells(SpellId.Forbearance),
                               SpellLineId.PaladinHandOfProtection,
                               //SpellLineId.PaladinLayOnHands,
                               SpellId.ClassSkillDivineShield,
                               SpellId.ClassSkillDivineProtection);

            SpellHandler.Apply(spell => spell.AddTargetTriggerSpells(SpellId.AvengingWrathMarker, avengingWrathMarker2.SpellId),
                               SpellLineId.PaladinHandOfProtection,
                               SpellId.ClassSkillAvengingWrath,
                               SpellId.ClassSkillDivineShield,
                               SpellId.ClassSkillDivineProtection);

            SpellHandler.Apply(spell => { spell.IsPreventionDebuff = true; },
                               SpellId.AvengingWrathMarker, SpellId.Forbearance);
        }
Example #3
0
        private static void FixDeathKnightFrostAcclimation()
        {
            // Frost Acclimation trigger a server-side Aura on the entire party to improve resistences
            // http://www.wowhead.com/spell=50152#comments
            var triggerSpellId = (uint)SpellLineId.DeathKnightFrostAcclimation.GetLine().FirstRank.GetEffect(AuraType.ProcTriggerSpell).TriggerSpellId;
            var triggerSpell   = SpellHandler.AddCustomSpell(triggerSpellId, "DeathKnightFrostAcclimation Buff");

            triggerSpell.AddAuraEffect(() => new FrostAcclimationBuffHandler(), ImplicitSpellTargetType.AllParty);
            triggerSpell.SetDuration(18000);                    // "for 18 sec"

            SpellLineId.DeathKnightFrostAcclimation.Apply(spell =>
            {
                var effect = spell.GetEffect(AuraType.ProcTriggerSpell);

                // not restricted by any particular spell
                effect.ClearAffectMask();
            });
        }
Example #4
0
        public static void FixIt()
        {
            // Devotion Aura: Improved devotion aura needs all auras to have a 2nd effect for healing
            SpellHandler.Apply(spell =>
            {
                var firstEffect = spell.Effects[0];
                for (var i = spell.Effects.Length; i < 3; i++)
                {
                    // add up to two filler effects, so the heal effect is at the 4th place
                    spell.AddEffect(SpellEffectType.Dummy, ImplicitSpellTargetType.None);
                }

                if (spell.Effects.Length != 3)
                {
                    throw new Exception("Spell has invalid amount of effects: " + spell);
                }

                // add heal effect as the 4th effect
                var healEffect             = spell.AddEffect(SpellEffectType.ApplyRaidAura, ImplicitSpellTargetType.AllPartyInArea);
                healEffect.ImplicitTargetA = firstEffect.ImplicitTargetA;
                healEffect.Radius          = firstEffect.Radius;
                healEffect.AuraType        = AuraType.ModHealingTakenPercent;
            }, PaladinFixes.PaladinAuras);


            // Improved devotion needs to apply the healing bonus to the 4th effect
            SpellLineId.PaladinProtectionImprovedDevotionAura.Apply(spell =>
            {
                var effect       = spell.Effects[1];
                effect.MiscValue = (int)SpellModifierType.EffectValue4AndBeyond;
                effect.AddToAffectMask(PaladinFixes.PaladinAuras);                      // applies to all auras
            });


            // Spiritual Attunement gives mana "equal to $s1% of the amount healed"
            SpellLineId.PaladinProtectionSpiritualAttunement.Apply(spell =>
            {
                var effect = spell.GetEffect(AuraType.Dummy);
                effect.AuraEffectHandlerCreator = () => new SpiritualAttunementHandler();
            });


            // Combat Expertise increases "chance to critically hit by $s2%"
            SpellLineId.PaladinProtectionCombatExpertise.Apply(spell =>
            {
                var effect      = spell.GetEffect(AuraType.Aura_290_Unused);
                effect.AuraType = AuraType.ModCritPercent;
            });


            // Avenger's Shield should be "dealing ${$m1+0.07*$SPH+0.07*$AP} to ${$M1+0.07*$SPH+0.07*$AP} Holy damage"
            SpellLineId.PaladinProtectionAvengersShield.Apply(spell =>
            {
                var dmgEffect                = spell.GetEffect(SpellEffectType.SchoolDamage);
                dmgEffect.APValueFactor      = 0.07f;
                dmgEffect.SpellPowerValuePct = 7;
            });

            // Shield of the Templar should proc from Avenger's Shield
            SpellLineId.PaladinProtectionShieldOfTheTemplar.Apply(spell =>
            {
                spell.GetEffect(AuraType.ProcTriggerSpell).AddToAffectMask(SpellLineId.PaladinProtectionAvengersShield);
            });

            // Shield of Righteousness "causing Holy damage based on your block value plus an additional $s1"
            SpellLineId.PaladinShieldOfRighteousness.Apply(spell =>
            {
                var dmgEffect = spell.GetEffect(SpellEffectType.SchoolDamage);
                dmgEffect.SpellEffectHandlerCreator = (cast, effct) => new ShieldOfRighteousnessHandler(cast, effct);
            });

            // Righteous Defense should be "commanding up to 3 enemies attacking the target to attack the Paladin instead."
            SpellLineId.PaladinRighteousDefense.Apply(spell =>
            {
                // trigger uses a server-side spell to taunt 3 guys around the target
                var triggerEffect = spell.GetEffect(SpellEffectType.TriggerSpell);

                // create spell, give it 3 targets
                var triggerSpell        = SpellHandler.AddCustomSpell((uint)triggerEffect.TriggerSpellId, "Righteous Defense Trigger");
                triggerSpell.MaxTargets = 3;

                // add taunt effect
                var tauntEff             = triggerSpell.AddAuraEffect(AuraType.ModTaunt);
                tauntEff.ImplicitTargetA = ImplicitSpellTargetType.AllEnemiesInArea;
                tauntEff.Radius          = 5;
            });

            // Hand of reckoning also deals 1 + 0.5 * AP damage
            SpellLineId.PaladinHandOfReckoning.Apply(spell =>
            {
                var dmgEffect           = spell.AddEffect(SpellEffectType.SchoolDamage, spell.Effects[0].ImplicitTargetA);
                dmgEffect.APValueFactor = 0.5f;
            });

            // Hammer of Justice also interrupts spell casting
            SpellLineId.PaladinHammerOfJustice.Apply(spell =>
            {
                spell.AddTriggerSpellEffect(SpellId.InterruptRank1, ImplicitSpellTargetType.SingleEnemy);
            });
        }
Example #5
0
        public static void FixWarlock()
        {
            // Curse of Doom cannot be casted on Players and spawns a Demon on target death
            SpellLineId.WarlockCurseOfDoom.Apply(spell =>
            {
                spell.CanCastOnPlayer = false;
                spell.Effects[0].AuraEffectHandlerCreator = () => new SummonDoomguardOnDeathHandler();
            });

            // Armors are mutually exclusive
            AuraHandler.AddAuraGroup(SpellLineId.WarlockFelArmor, SpellLineId.WarlockDemonArmor, SpellLineId.WarlockDemonSkin);

            // can't have more than one of these per caster
            AuraHandler.AddAuraCasterGroup(
                SpellLineId.WarlockCurseOfTongues, SpellLineId.WarlockCurseOfTheElements,
                SpellLineId.WarlockCurseOfDoom, SpellLineId.WarlockCurseOfAgony,
                SpellLineId.WarlockCurseOfWeakness, SpellLineId.WarlockAfflictionCurseOfExhaustion);

            // Shadowflame DoT
            SpellHandler.Apply(spell => spell.AddTargetTriggerSpells(SpellId.Shadowflame_3), SpellId.ClassSkillShadowflameRank1);
            SpellHandler.Apply(spell => spell.AddTargetTriggerSpells(SpellId.Shadowflame_5), SpellId.ClassSkillShadowflameRank2);
            SpellHandler.Apply(spell =>
            {
                spell.Effects[0].ImplicitTargetA = ImplicitSpellTargetType.ConeInFrontOfCaster;
                spell.AddAuraEffect(() => new ApplyImmolateStateHandler(), ImplicitSpellTargetType.SingleEnemy);
            }, SpellId.Shadowflame_3);
            SpellHandler.Apply(spell =>
            {
                spell.Effects[0].ImplicitTargetA = ImplicitSpellTargetType.ConeInFrontOfCaster;
                spell.AddAuraEffect(() => new ApplyImmolateStateHandler(), ImplicitSpellTargetType.SingleEnemy);
            }, SpellId.Shadowflame_5);

            // Incinerate has extra damage if target has Immolate
            SpellLineId.WarlockIncinerate.Apply(spell =>
                                                spell.Effects[0].SpellEffectHandlerCreator = (cast, effect) => new IncreaseDamageIfAuraPresentHandler(cast, effect));

            // Demonic Circle Teleport
            var teleReqSpell = SpellHandler.AddCustomSpell(62388, "DemonicCircleTeleportRequirement");

            teleReqSpell.IsPreventionDebuff = false;
            teleReqSpell.AddAuraEffect(AuraType.Dummy);
            teleReqSpell.Attributes |= SpellAttributes.InvisibleAura;
            teleReqSpell.Durations   = new Spell.DurationEntry {
                Min = 360000, Max = 360000
            };
            SpellHandler.Apply(spell =>
            {
                var efct       = spell.AddEffect(SpellEffectType.Dummy, ImplicitSpellTargetType.None);
                efct.MiscValue = (int)GOEntryId.DemonicCircleSummon;
                efct.SpellEffectHandlerCreator = (cast, effect) => new RecallToGOHandler(cast, effect);
                spell.AddCasterTriggerSpells(teleReqSpell);
            }, SpellId.ClassSkillDemonicCircleTeleport);

            // Demonic Circle Summon
            SpellHandler.Apply(spell => spell.AddCasterTriggerSpells(teleReqSpell.SpellId), SpellLineId.WarlockDemonicCircleSummon);

            //life tap
            SpellHandler.Apply(spell =>
            {
                var spellEffect = spell.GetEffect(SpellEffectType.Dummy);
                spellEffect.SpellEffectHandlerCreator = (cast, effect) => new LifeTapHandler(cast, effect);
            }, SpellLineId.WarlockLifeTap);

            SpellLineId.WarlockImmolate.Apply(spell =>
            {
                spell.AddAuraEffect(() => new ApplyImmolateStateHandler(), ImplicitSpellTargetType.SingleEnemy);
            });

            SpellLineId.WarlockDestructionConflagrate.Apply(spell =>
            {
                var dmgeff         = spell.GetEffect(SpellEffectType.SchoolDamage);
                var periodicdmgeff = spell.GetEffect(AuraType.PeriodicDamage);
                dmgeff.SpellEffectHandlerCreator        = (cast, effect) => new ConflagrateHandler(cast, effect);
                periodicdmgeff.AuraEffectHandlerCreator = () => new ConflagratePeriodicHandler();
            });
        }