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); } }
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(); }
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(); }
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); }
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); } } }
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(); } } }
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); }