void OnPeriodic(AuraEffect aurEff) { Unit target = GetTarget(); if (target.HasAura(SpellIds.ExhaustedRam)) { return; } switch (GetId()) { case SpellIds.RamLevelNeutral: { Aura aura = target.GetAura(SpellIds.RamFatigue); if (aura != null) { aura.ModStackAmount(-4); } } break; case SpellIds.RamTrot: // green { Aura aura = target.GetAura(SpellIds.RamFatigue); if (aura != null) { aura.ModStackAmount(-2); } if (aurEff.GetTickNumber() == 4) { target.CastSpell(target, QuestIds.BrewfestSpeedBunnyGreen, true); } } break; case SpellIds.RamCanter: target.CastCustomSpell(SpellIds.RamFatigue, SpellValueMod.AuraStack, 1, target, TriggerCastFlags.FullMask); if (aurEff.GetTickNumber() == 8) { target.CastSpell(target, QuestIds.BrewfestSpeedBunnyYellow, true); } break; case SpellIds.RamGallop: target.CastCustomSpell(SpellIds.RamFatigue, SpellValueMod.AuraStack, target.HasAura(SpellIds.RamFatigue) ? 4 : 5 /*Hack*/, target, TriggerCastFlags.FullMask); if (aurEff.GetTickNumber() == 8) { target.CastSpell(target, QuestIds.BrewfestSpeedBunnyRed, true); } break; default: break; } }
void HandleTickUpdate(AuraEffect aurEff) { Unit caster = GetCaster(); if (!caster) { return; } // calculate from base damage, not from aurEff->GetAmount() (already modified) float damage = caster.CalculateSpellDamage(GetUnitOwner(), GetSpellInfo(), aurEff.GetEffIndex()); // Wild Growth = first tick gains a 6% bonus, reduced by 2% each tick float reduction = 2.0f; AuraEffect bonus = caster.GetAuraEffect(SpellIds.RestorationT102PBonus, 0); if (bonus != null) { reduction -= MathFunctions.CalculatePct(reduction, bonus.GetAmount()); } reduction *= (aurEff.GetTickNumber() - 1); MathFunctions.AddPct(ref damage, 6.0f - reduction); aurEff.SetAmount((int)damage); }
void PeriodicTick(AuraEffect aurEff) { if (aurEff.GetTickNumber() == 2) { Unit caster = GetCaster(); if (caster) { caster.CastSpell(GetTarget(), SpellIds.CorpseExplodeDamage, true, null, aurEff); } } }
void HandlePeriodicTick(AuraEffect aurEff) { PreventDefaultAction(); GetTarget().CastSpell(GetTarget(), Misc.SoulstormVisualSpells[aurEff.GetTickNumber() % 8], true); }