Example #1
0
        void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
        {
            PreventDefaultAction();

            Unit caster = eventInfo.GetActor();
            Unit target = eventInfo.GetProcTarget();

            // try to find spell Flame Shock on the target
            AuraEffect flameShock = target.GetAuraEffect(AuraType.PeriodicDamage, SpellFamilyNames.Shaman, new FlagArray128(0x10000000), caster.GetGUID());

            if (flameShock == null)
            {
                return;
            }

            Aura flameShockAura = flameShock.GetBase();

            int maxDuration = flameShockAura.GetMaxDuration();
            int newDuration = flameShockAura.GetDuration() + aurEff.GetAmount() * Time.InMilliseconds;

            flameShockAura.SetDuration(newDuration);
            // is it blizzlike to change max duration for FS?
            if (newDuration > maxDuration)
            {
                flameShockAura.SetMaxDuration(newDuration);
            }
        }
Example #2
0
        void HandleEffectCalcSpellMod(AuraEffect aurEff, ref SpellModifier spellMod)
        {
            if (spellMod == null)
            {
                spellMod         = new SpellModifier(aurEff.GetBase());
                spellMod.op      = SpellModOp.Damage;
                spellMod.type    = SpellModType.Flat;
                spellMod.spellId = GetId();
                spellMod.mask[1] = 0x200002;
            }

            spellMod.value = aurEff.GetAmount();
        }
Example #3
0
            void HandleEffectCalcSpellMod(AuraEffect aurEff, ref SpellModifier spellMod)
            {
                if (spellMod == null)
                {
                    spellMod         = new SpellModifier(aurEff.GetBase());
                    spellMod.op      = (SpellModOp)aurEff.GetMiscValue();
                    spellMod.type    = SpellModType.Flat;
                    spellMod.spellId = GetId();
                    spellMod.mask    = GetSpellInfo().GetEffect(aurEff.GetEffIndex()).SpellClassMask;
                }

                spellMod.value = aurEff.GetAmount();
            }
Example #4
0
        void HandleEffectScriptEffect(uint effIndex)
        {
            // Refresh Shadow Word: Pain on target
            Unit unitTarget = GetHitUnit();

            if (unitTarget)
            {
                AuraEffect aur = unitTarget.GetAuraEffect(AuraType.PeriodicDamage, SpellFamilyNames.Priest, new FlagArray128(0x8000, 0, 0), GetCaster().GetGUID());
                if (aur != null)
                {
                    aur.GetBase().RefreshDuration();
                }
            }
        }
            void HandlePeriodicTick(AuraEffect aurEff)
            {
                if (aurEff.GetBase().GetStackAmount() < 2)
                {
                    return;
                }
                Unit caster = GetCaster();

                /// @todo the caster should be boss but not the player
                if (!caster || caster.GetAI() == null)
                {
                    return;
                }

                caster.GetAI().SetGUID(GetTarget().GetGUID(), (int)KeristraszaConst.DataIntenseCold);
            }
Example #6
0
        void HandleScriptEffect(uint effIndex)
        {
            Unit caster = GetCaster();
            Unit target = GetHitUnit();

            if (target)
            {
                // Refresh corruption on target
                AuraEffect aurEff = target.GetAuraEffect(AuraType.PeriodicDamage, SpellFamilyNames.Warlock, new FlagArray128(0x2, 0, 0), caster.GetGUID());
                if (aurEff != null)
                {
                    uint damage = (uint)Math.Max(aurEff.GetAmount(), 0);
                    Global.ScriptMgr.ModifyPeriodicDamageAurasTick(target, caster, ref damage);
                    aurEff.SetDamage((int)(caster.SpellDamageBonusDone(target, aurEff.GetSpellInfo(), damage, DamageEffectType.DOT, GetEffectInfo(effIndex)) * aurEff.GetDonePct()));
                    aurEff.CalculatePeriodic(caster, false, false);
                    aurEff.GetBase().RefreshDuration(true);
                }
            }
        }
Example #7
0
        void HandleBeforeHit(SpellMissInfo missInfo)
        {
            if (missInfo != SpellMissInfo.None)
            {
                return;
            }

            Unit target = GetHitUnit();

            if (target != null)
            {
                // Deadly Poison
                AuraEffect aurEff = target.GetAuraEffect(AuraType.PeriodicDummy, SpellFamilyNames.Rogue, new FlagArray128(0x10000, 0x80000, 0), GetCaster().GetGUID());
                if (aurEff != null)
                {
                    _stackAmount = aurEff.GetBase().GetStackAmount();
                }
            }
        }
Example #8
0
        void HandleHitTarget()
        {
            int damage = GetHitDamage();

            AuraEffect aurEff = GetCaster().GetAuraEffect(SpellIds.FirstBlood, 0);

            if (aurEff != null)
            {
                spell_dh_first_blood script = aurEff.GetBase().GetScript <spell_dh_first_blood>();
                if (script != null)
                {
                    if (GetHitUnit().GetGUID() == script.GetFirstTarget())
                    {
                        MathFunctions.AddPct(ref damage, aurEff.GetAmount());
                    }
                }
            }

            SetHitDamage(damage);
        }