void HandleOnHit(uint effIndex) { Unit caster = GetCaster(); Unit target = GetHitUnit(); int index = _orderedTargets.IndexOf(target.GetGUID()); if (index == 0 && // only primary target triggers these benefits target.HasAuraState(AuraStateType.Frozen, GetSpellInfo(), caster)) { // Thermal Void Aura thermalVoid = caster.GetAura(SpellIds.ThermalVoid); if (thermalVoid != null) { SpellEffectInfo thermalVoidEffect = thermalVoid.GetSpellInfo().GetEffect(0); if (thermalVoidEffect != null) { Aura icyVeins = caster.GetAura(SpellIds.IcyVeins); if (icyVeins != null) { icyVeins.SetDuration(icyVeins.GetDuration() + thermalVoidEffect.CalcValue(caster) * Time.InMilliseconds); } } } // Chain Reaction if (caster.HasAura(SpellIds.ChainReactionDummy)) { caster.CastSpell(caster, SpellIds.ChainReaction, true); } } // put target index for chain value multiplier into EFFECT_1 base points, otherwise triggered spell doesn't know which damage multiplier to apply caster.CastCustomSpell(SpellIds.IceLanceTrigger, SpellValueMod.BasePoint1, index, target, true); }
void OnTargetSelect(List <WorldObject> targets) { SpellEffectInfo eff2 = GetEffectInfo(2); if (eff2 == null) { return; } uint maxTargets = (uint)(eff2.CalcValue(GetCaster()) + 1); // adding 1 for explicit target unit if (targets.Count > maxTargets) { Unit explTarget = GetExplTargetUnit(); // Sort targets so units with no atonement are first, then units who are injured, then oher units // Make sure explicit target unit is first targets.Sort((lhs, rhs) => { if (lhs == explTarget) // explTarget > anything: always true { return(1); } if (rhs == explTarget) // anything > explTarget: always false { return(-1); } return(MakeSortTuple(lhs).Equals(rhs) ? 1 : -1); }); targets.Resize(maxTargets); } }
public override bool Validate(SpellInfo spellInfo) { SpellEffectInfo effect2 = spellInfo.GetEffect(2); if (effect2 == null || effect2.IsEffect() || effect2.CalcValue() <= 0) { return(false); } return(true); }
void OnSuccessfulDispel(uint effIndex) { SpellEffectInfo effect = GetSpellInfo().GetEffect(1); if (effect != null) { Unit caster = GetCaster(); int heal_amount = effect.CalcValue(caster); caster.CastCustomSpell(caster, SpellIds.DevourMagicHeal, heal_amount, 0, 0, true); // Glyph of Felhunter Unit owner = caster.GetOwner(); if (owner) { if (owner.GetAura(SpellIds.GlyphOfDemonTraining) != null) { owner.CastCustomSpell(owner, SpellIds.DevourMagicHeal, heal_amount, 0, 0, true); } } } }
void OnSuccessfulDispel(uint effIndex) { SpellEffectInfo effect = GetSpellInfo().GetEffect(1); if (effect != null) { Unit caster = GetCaster(); CastSpellExtraArgs args = new(TriggerCastFlags.FullMask); args.AddSpellMod(SpellValueMod.BasePoint0, effect.CalcValue(caster)); caster.CastSpell(caster, SpellIds.DevourMagicHeal, args); // Glyph of Felhunter Unit owner = caster.GetOwner(); if (owner) { if (owner.GetAura(SpellIds.GlyphOfDemonTraining) != null) { owner.CastSpell(owner, SpellIds.DevourMagicHeal, args); } } } }
void HandleEffectHitTarget(uint effIndex) { Unit caster = GetCaster(); if (caster.HasAura(SpellIds.Trinity)) { return; } SpellEffectInfo effect3 = GetEffectInfo(3); if (effect3 == null) { return; } int durationPct = effect3.CalcValue(caster); if (caster.HasAura(SpellIds.Atonement)) { caster.CastSpell(GetHitUnit(), SpellIds.AtonementTriggered, new CastSpellExtraArgs(SpellValueMod.DurationPct, durationPct).SetTriggerFlags(TriggerCastFlags.FullMask)); } }
void HandleJump(uint effIndex) { Unit origCaster = GetOriginalCaster(); // the one that started the prayer of mending chain Unit target = GetHitUnit(); // the target we decided the aura should jump to if (origCaster) { uint basePoints = origCaster.SpellHealingBonusDone(target, _spellInfoHeal, (uint)_healEffectDummy.CalcValue(origCaster), DamageEffectType.Heal, _healEffectDummy); CastSpellExtraArgs args = new(TriggerCastFlags.FullMask); args.AddSpellMod(SpellValueMod.AuraStack, GetEffectValue()); args.AddSpellMod(SpellValueMod.BasePoint0, (int)basePoints); origCaster.CastSpell(target, SpellIds.PrayerOfMendingAura, args); } }
void HandleEffectDummy(uint effIndex) { uint basePoints = GetCaster().SpellHealingBonusDone(GetHitUnit(), _spellInfoHeal, (uint)_healEffectDummy.CalcValue(GetCaster()), DamageEffectType.Heal, _healEffectDummy); CastSpellExtraArgs args = new(TriggerCastFlags.FullMask); args.AddSpellMod(SpellValueMod.AuraStack, GetEffectValue()); args.AddSpellMod(SpellValueMod.BasePoint0, (int)basePoints); GetCaster().CastSpell(GetHitUnit(), SpellIds.PrayerOfMendingAura, args); }
void HandleJump(uint effIndex) { Unit origCaster = GetOriginalCaster(); // the one that started the prayer of mending chain Unit target = GetHitUnit(); // the target we decided the aura should jump to if (origCaster) { uint basePoints = origCaster.SpellHealingBonusDone(target, _spellInfoHeal, (uint)_healEffectDummy.CalcValue(origCaster), DamageEffectType.Heal, _healEffectDummy); Dictionary <SpellValueMod, int> values = new Dictionary <SpellValueMod, int>(); values.Add(SpellValueMod.AuraStack, (byte)GetEffectValue()); values.Add(SpellValueMod.BasePoint0, (int)basePoints); origCaster.CastCustomSpell(SpellIds.PrayerOfMendingAura, values, target, TriggerCastFlags.FullMask); } }
void HandleEffectDummy(uint effIndex) { uint basePoints = GetCaster().SpellHealingBonusDone(GetHitUnit(), _spellInfoHeal, (uint)_healEffectDummy.CalcValue(GetCaster()), DamageEffectType.Heal, _healEffectDummy); Dictionary <SpellValueMod, int> values = new Dictionary <SpellValueMod, int>(); values.Add(SpellValueMod.AuraStack, (byte)GetEffectValue()); values.Add(SpellValueMod.BasePoint0, (int)basePoints); GetCaster().CastCustomSpell(SpellIds.PrayerOfMendingAura, values, GetHitUnit(), TriggerCastFlags.FullMask); }