internal void RemoveOwnedAura(Aura aura, AuraRemoveMode removeMode) { ownedAuras.Remove(aura); ownedAurasById.Delete(aura.AuraInfo.Id, aura); Logging.LogAura($"Removed owned aura {aura.AuraInfo.name} for target: {unit.Name} with mode: {removeMode}"); }
private void RemoveAuraWithApplication(AuraApplication application, AuraRemoveMode mode) { if (auraApplicationSet.Contains(application)) { UnapplyAuraApplication(application, mode); if (application.Aura.Owner == unit) { application.Aura.Remove(mode); } } }
internal void RemoveAuraWithSpellInfo(SpellInfo spellInfo, AuraRemoveMode mode) { if (auraApplicationsBySpellInfoId.TryGetValue(spellInfo.Id, out List <AuraApplication> spellApplications)) { tempAuraApplications.AddRange(spellApplications); foreach (AuraApplication auraApplicationToRemove in tempAuraApplications) { RemoveAuraWithApplication(auraApplicationToRemove, mode); } tempAuraApplications.Clear(); } }
internal void Remove(AuraRemoveMode removeMode = AuraRemoveMode.Default) { Assert.IsFalse(IsRemoved, $"Aura {AuraInfo.Id} is removed twice!"); IsRemoved = true; Charges = 0; while (applications.Count > 0) { AuraApplication applicationToRemove = applications[0]; applicationToRemove.Target.Auras.UnapplyAuraApplication(applicationToRemove, removeMode); } Owner.Auras.RemoveOwnedAura(this, removeMode); }
void AfterRemove(AuraEffect aurEff, AuraEffectHandleModes mode) { AuraRemoveMode removeMode = GetTargetApplication().GetRemoveMode(); if (removeMode != AuraRemoveMode.EnemySpell && removeMode != AuraRemoveMode.Expire) { return; } Unit caster = GetCaster(); if (caster) { caster.CastSpell(GetTarget(), (uint)aurEff.GetAmount(), true, null, aurEff); } }
void OnRemove(AuraEffect aurEff, AuraEffectHandleModes mode) { if (!GetCaster()) { return; } AuraRemoveMode removeMode = GetTargetApplication().GetRemoveMode(); if (removeMode != AuraRemoveMode.Death || !IsExpired()) { return; } if (GetCaster().ToPlayer().IsHonorOrXPTarget(GetTarget())) { GetCaster().CastSpell(GetTarget(), SpellIds.BaneOfDoomEffect, true, null, aurEff); } }
internal void UnapplyAuraApplication(AuraApplication auraApplication, AuraRemoveMode removeMode) { auraApplicationsByAuraId.Delete(auraApplication.Aura.AuraInfo.Id, auraApplication); auraApplications.Remove(auraApplication); auraApplicationSet.Remove(auraApplication); HandleInterruptableAura(auraApplication, false); HandleStateContainingAura(auraApplication, false); HandleAuraEffects(auraApplication, false); auraApplication.Aura.UnregisterForTarget(unit, auraApplication); auraApplication.RemoveMode = removeMode; unit.VisibleAuras.HandleAuraApplication(auraApplication, false); for (int i = 0; i < auraApplication.Aura.AuraInfo.AuraScriptables.Count; i++) { auraApplication.Aura.AuraInfo.AuraScriptables[i].AuraApplicationRemoved(auraApplication); } Logging.LogAura($"Unapplied application for target: {unit.Name} for aura: {auraApplication.Aura.AuraInfo.name}"); }