/// <summary> /// Apply the given action on all Spells with the given ids /// </summary> /// <param name="action"></param> public static void Apply(this Action <Spell> action, params SpellLineId[] ids) { foreach (var lineId in ids) { var line = SpellLines.GetLine(lineId); Apply(action, line); } }
public void Add(params SpellLineId[] ids) { foreach (var id in ids) { var line = SpellLines.GetLine(id); Add(line); } }
/// <summary> /// Apply the given action on all Spells with the given ids /// </summary> /// <param name="action"></param> public static void Apply(this SpellLineId id, Action <Spell> action) { var line = SpellLines.GetLine(id); if (line == null) { throw new Exception("Invalid SpellLineId: " + id); } Apply(action, line); }
/// <summary> /// Adds a set of spells to the explicite relationship set of this effect, which is used to determine whether /// a certain Spell and this effect have some kind of influence on one another (for procs, talent modifiers etc). /// Only adds the spells, will not work on the spells' trigger spells. /// </summary> /// <param name="abilities"></param> public void AddAffectingSpells(params SpellLineId[] abilities) { if (AffectSpellSet == null) { AffectSpellSet = new HashSet <Spell>(); } foreach (var ability in abilities) { AffectSpellSet.AddRange(SpellLines.GetLine(ability)); } }
/// <summary> /// Apply the given action on all Spells with the given ids /// </summary> /// <param name="action"></param> public static void Apply(Action <Spell> action, SpellLineId id, params SpellId[] ids) { var line = SpellLines.GetLine(id); if (line == null) { throw new Exception("Invalid SpellLineId: " + id); } Apply(action, line); Apply(action, (IEnumerable <SpellId>)ids); }
/// <summary> /// Add Spells which, when casted by others on the owner of this Aura, can cause it to trigger it's procs /// Don't add damage spells (they will generate a Proc event anyway). /// </summary> public void AddTargetProcSpells(params SpellLineId[] spellSetIds) { var list = new List <Spell>(spellSetIds.Length * 6); foreach (var id in spellSetIds) { var line = SpellLines.GetLine(id); list.AddRange(line); } AddTargetProcSpells(list.ToArray()); }
/// <summary> /// Adds a set of spells to this Effect's AffectMask, which is used to determine whether /// a certain Spell and this effect have some kind of influence on one another (for procs, talent modifiers etc). /// Usually the mask also contains any spell that is triggered by the original spell. /// /// If you get a warning that the wrong set is affected, use AddAffectingSpells instead. /// </summary> public void AddToAffectMask(params SpellLineId[] abilities) { var newMask = new uint[SpellConstants.SpellClassMaskSize]; // build new mask from abilities if (abilities.Length != 1) { foreach (var ability in abilities) { var spell = SpellLines.GetLine(ability).FirstRank; for (int i = 0; i < SpellConstants.SpellClassMaskSize; i++) { newMask[i] |= spell.SpellClassMask[i]; } } } else { SpellLines.GetLine(abilities[0]).FirstRank.SpellClassMask.CopyTo(newMask, 0); } // verification var affectedLines = SpellHandler.GetAffectedSpellLines(Spell.ClassId, newMask); if (affectedLines.Count != abilities.Length) { LogManager.GetCurrentClassLogger().Warn("[SPELL Inconsistency for {0}] " + "Invalid affect mask affects a different set than the one intended: {1} (intended: {2}) - " + "You might want to use AddAffectingSpells instead!", Spell, affectedLines.ToString(", "), abilities.ToString(", ")); } for (int i = 0; i < SpellConstants.SpellClassMaskSize; i++) { AffectMask[i] |= newMask[i]; } }