void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo) { PreventDefaultAction(); GetTarget().CastSpell(GetTarget(), SpellIds.MisdirectionProc, new CastSpellExtraArgs(aurEff)); }
void HandleEffectProc(AuraEffect aurEff, ProcEventInfo eventInfo) { PreventDefaultAction(); _procTargetGuid = eventInfo.GetProcTarget().GetGUID(); eventInfo.GetActor().CastSpell(eventInfo.GetActor(), SpellIds.EarthenRagePeriodic, true); }
void HandleEffectProc(AuraEffect aurEff, ProcEventInfo eventInfo) { PreventDefaultAction(); GetTarget().CastSpell(GetTarget(), SpellIds.LavaSurge, true); }
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo) { PreventDefaultAction(); eventInfo.GetActor().CastSpell((Unit)null, SpellIds.ManaSurge, true); }
void OnRemove(AuraEffect aurEff, AuraEffectHandleModes mode) { GetTarget().RemoveAurasDueToSpell(SpellIds.Paralysis); }
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo) { PreventDefaultAction(); GetTarget().CastSpell(GetTarget(), SpellIds.MisdirectionProc, true, null, aurEff); }
void HandleEffectProc(AuraEffect aurEff, ProcEventInfo eventInfo) { PreventDefaultAction(); GetTarget().CastSpell(GetTarget(), SpellIds.LockAndLoad, true, null, aurEff); }
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo) { PreventDefaultAction(); eventInfo.GetActionTarget().CastSpell((Unit)null, SpellIds.RunicReturn, true); }
void CalculateAmount(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated) { amount = (int)GetUnitOwner().CountPctFromMaxHealth(amount); }
void CalculateAmount(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated) { amount = MathFunctions.CalculatePct(maxHealth, absorbPct); }
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo) { PreventDefaultAction(); GetTarget().CastSpell(eventInfo.GetProcTarget(), SpellIds.NecrosisEffect, true); }
bool Create(uint areaTriggerCreatePropertiesId, Unit caster, Unit target, SpellInfo spell, Position pos, int duration, SpellCastVisualField spellVisual, ObjectGuid castId, AuraEffect aurEff) { _targetGuid = target ? target.GetGUID() : ObjectGuid.Empty; _aurEff = aurEff; SetMap(caster.GetMap()); Relocate(pos); if (!IsPositionValid()) { Log.outError(LogFilter.AreaTrigger, $"AreaTrigger (areaTriggerCreatePropertiesId: {areaTriggerCreatePropertiesId}) not created. Invalid coordinates (X: {GetPositionX()} Y: {GetPositionY()})"); return(false); } _areaTriggerCreateProperties = Global.AreaTriggerDataStorage.GetAreaTriggerCreateProperties(areaTriggerCreatePropertiesId); if (_areaTriggerCreateProperties == null) { Log.outError(LogFilter.AreaTrigger, $"AreaTrigger (areaTriggerCreatePropertiesId {areaTriggerCreatePropertiesId}) not created. Invalid areatrigger create properties id ({areaTriggerCreatePropertiesId})"); return(false); } _areaTriggerTemplate = _areaTriggerCreateProperties.Template; _Create(ObjectGuid.Create(HighGuid.AreaTrigger, GetMapId(), GetTemplate() != null ? GetTemplate().Id.Id : 0, caster.GetMap().GenerateLowGuid(HighGuid.AreaTrigger))); if (GetTemplate() != null) { SetEntry(GetTemplate().Id.Id); } SetDuration(duration); SetObjectScale(1.0f); _shape = GetCreateProperties().Shape; _maxSearchRadius = GetCreateProperties().GetMaxSearchRadius(); var areaTriggerData = m_values.ModifyValue(m_areaTriggerData); SetUpdateFieldValue(areaTriggerData.ModifyValue(m_areaTriggerData.Caster), caster.GetGUID()); SetUpdateFieldValue(areaTriggerData.ModifyValue(m_areaTriggerData.CreatingEffectGUID), castId); SetUpdateFieldValue(areaTriggerData.ModifyValue(m_areaTriggerData.SpellID), spell.Id); SetUpdateFieldValue(areaTriggerData.ModifyValue(m_areaTriggerData.SpellForVisuals), spell.Id); SpellCastVisualField spellCastVisual = areaTriggerData.ModifyValue(m_areaTriggerData.SpellVisual); SetUpdateFieldValue(ref spellCastVisual.SpellXSpellVisualID, spellVisual.SpellXSpellVisualID); SetUpdateFieldValue(ref spellCastVisual.ScriptVisualID, spellVisual.ScriptVisualID); SetUpdateFieldValue(areaTriggerData.ModifyValue(m_areaTriggerData.TimeToTargetScale), GetCreateProperties().TimeToTargetScale != 0 ? GetCreateProperties().TimeToTargetScale : m_areaTriggerData.Duration); SetUpdateFieldValue(areaTriggerData.ModifyValue(m_areaTriggerData.BoundsRadius2D), GetMaxSearchRadius()); SetUpdateFieldValue(areaTriggerData.ModifyValue(m_areaTriggerData.DecalPropertiesID), GetCreateProperties().DecalPropertiesId); ScaleCurve extraScaleCurve = areaTriggerData.ModifyValue(m_areaTriggerData.ExtraScaleCurve); if (GetCreateProperties().ExtraScale.Structured.StartTimeOffset != 0) { SetUpdateFieldValue(extraScaleCurve.ModifyValue(extraScaleCurve.StartTimeOffset), GetCreateProperties().ExtraScale.Structured.StartTimeOffset); } if (GetCreateProperties().ExtraScale.Structured.X != 0 || GetCreateProperties().ExtraScale.Structured.Y != 0) { Vector2 point = new(GetCreateProperties().ExtraScale.Structured.X, GetCreateProperties().ExtraScale.Structured.Y); SetUpdateFieldValue(ref extraScaleCurve.ModifyValue(extraScaleCurve.Points, 0), point); } if (GetCreateProperties().ExtraScale.Structured.Z != 0 || GetCreateProperties().ExtraScale.Structured.W != 0) { Vector2 point = new(GetCreateProperties().ExtraScale.Structured.Z, GetCreateProperties().ExtraScale.Structured.W); SetUpdateFieldValue(ref extraScaleCurve.ModifyValue(extraScaleCurve.Points, 1), point); } unsafe { if (GetCreateProperties().ExtraScale.Raw.Data[5] != 0) { SetUpdateFieldValue(extraScaleCurve.ModifyValue(extraScaleCurve.ParameterCurve), GetCreateProperties().ExtraScale.Raw.Data[5]); } if (GetCreateProperties().ExtraScale.Structured.OverrideActive != 0) { SetUpdateFieldValue(extraScaleCurve.ModifyValue(extraScaleCurve.OverrideActive), GetCreateProperties().ExtraScale.Structured.OverrideActive != 0); } } VisualAnim visualAnim = areaTriggerData.ModifyValue(m_areaTriggerData.VisualAnim); SetUpdateFieldValue(visualAnim.ModifyValue(visualAnim.AnimationDataID), GetCreateProperties().AnimId); SetUpdateFieldValue(visualAnim.ModifyValue(visualAnim.AnimKitID), GetCreateProperties().AnimKitId); if (GetTemplate() != null && GetTemplate().HasFlag(AreaTriggerFlags.Unk3)) { SetUpdateFieldValue(visualAnim.ModifyValue(visualAnim.Field_C), true); } PhasingHandler.InheritPhaseShift(this, caster); if (target && GetTemplate() != null && GetTemplate().HasFlag(AreaTriggerFlags.HasAttached)) { m_movementInfo.transport.guid = target.GetGUID(); } UpdateShape(); uint timeToTarget = GetCreateProperties().TimeToTarget != 0 ? GetCreateProperties().TimeToTarget : m_areaTriggerData.Duration; if (GetCreateProperties().OrbitInfo.HasValue) { AreaTriggerOrbitInfo orbit = GetCreateProperties().OrbitInfo.Value; if (target && GetTemplate() != null && GetTemplate().HasFlag(AreaTriggerFlags.HasAttached)) { orbit.PathTarget.Set(target.GetGUID()); } else { orbit.Center.Set(new Vector3(pos.posX, pos.posY, pos.posZ)); } InitOrbit(orbit, timeToTarget); } else if (GetCreateProperties().HasSplines()) { InitSplineOffsets(GetCreateProperties().SplinePoints, timeToTarget); } // movement on transport of areatriggers on unit is handled by themself Transport transport = m_movementInfo.transport.guid.IsEmpty() ? caster.GetTransport() : null; if (transport) { float x, y, z, o; pos.GetPosition(out x, out y, out z, out o); transport.CalculatePassengerOffset(ref x, ref y, ref z, ref o); m_movementInfo.transport.pos.Relocate(x, y, z, o); // This object must be added to transport before adding to map for the client to properly display it transport.AddPassenger(this); } AI_Initialize(); // Relocate areatriggers with circular movement again if (HasOrbit()) { Relocate(CalculateOrbitPosition()); } if (!GetMap().AddToMap(this)) { // Returning false will cause the object to be deleted - remove from transport if (transport) { transport.RemovePassenger(this); } return(false); } caster._RegisterAreaTrigger(this); _ai.OnCreate(); return(true); }
public static AreaTrigger CreateAreaTrigger(uint areaTriggerCreatePropertiesId, Unit caster, Unit target, SpellInfo spell, Position pos, int duration, SpellCastVisualField spellVisual, ObjectGuid castId = default, AuraEffect aurEff = null) { AreaTrigger at = new(); if (!at.Create(areaTriggerCreatePropertiesId, caster, target, spell, pos, duration, spellVisual, castId, aurEff)) { return(null); } return(at); }
void OnRemove(AuraEffect aurEff, AuraEffectHandleModes mode) { GetTarget().GetThreatManager().UnregisterRedirectThreat(SpellIds.Misdirection); }
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo) { PreventDefaultAction(); GetTarget().GetSpellHistory().ModifyCooldown(SpellIds.Exhilaration, -TimeSpan.FromSeconds(aurEff.GetAmount())); GetTarget().GetSpellHistory().ModifyCooldown(SpellIds.ExhilarationPet, -TimeSpan.FromSeconds(aurEff.GetAmount())); }
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo) { PreventDefaultAction(); GetTarget().CastSpell(_procTarget, SpellIds.FocusMagicProc, true, null, aurEff); }
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo) { PreventDefaultAction(); GetTarget().CastSpell(GetTarget(), SpellIds.ImprovedMendPet, true, null, aurEff); }
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo) { }
void OnRemove(AuraEffect aurEff, AuraEffectHandleModes mode) { GetTarget().ResetRedirectThreat(); }
void HandleEffectProc(AuraEffect aurEff, ProcEventInfo eventInfo) { GetTarget().GetSpellHistory().ResetCooldown(SpellIds.AvengersShield, true); }
void SuppressWarning(AuraEffect aurEff, ProcEventInfo procInfo) { PreventDefaultAction(); }
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo) { PreventDefaultAction(); GetTarget().CastSpell(GetTarget(), SpellIds.ItemHealingTrance, true, null, aurEff); }
void AfterRemove(AuraEffect aurEff, AuraEffectHandleModes mode) { GetTarget().RemoveVehicleKit(); }
void HandleEffectApply(AuraEffect aurEff, AuraEffectHandleModes mode) { GetTarget().CastSpell(GetTarget(), SpellIds.AuraMasteryImmune, true); }
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo) { PreventDefaultAction(); GetTarget().CastSpell(GetTarget(), SpellIds.EarthShieldHeal, true, null, aurEff, GetCasterGUID()); }
void HandleEffectRemove(AuraEffect aurEff, AuraEffectHandleModes mode) { GetTarget().RemoveOwnedAura(SpellIds.AuraMasteryImmune, GetCasterGUID()); }
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo) { PreventDefaultAction(); GetTarget().CastSpell(GetTarget(), SpellIds.ItemLightningShieldDamage, true, null, aurEff); }
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo) { GetTarget().CastSpell(eventInfo.GetActor(), SpellIds.CracklingJadeLightningKnockback, TriggerCastFlags.FullMask); GetTarget().CastSpell(GetTarget(), SpellIds.CracklingJadeLightningKnockbackCd, TriggerCastFlags.FullMask); }
void HandleEffectProc(AuraEffect aurEff, ProcEventInfo eventInfo) { PreventDefaultAction(); GetTarget().CastSpell(eventInfo.GetProcTarget(), SpellIds.RetaliationDamage, true, null, aurEff); }
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo) { _damagePerSecond[0] += eventInfo.GetDamageInfo().GetDamage(); }