/// <summary> /// Returns the first visible Aura with the given SpellId /// </summary> /// <param name="id"></param> /// <returns></returns> public Aura this[SpellLineId id] { get { var line = SpellLines.GetLine(id); if (line != null) { return(this[line]); } return(null); } }
/// <summary> /// Defines a set of Auras that are mutually exclusive /// </summary> public static uint AddAuraGroup(params SpellLineId[] auraLines) { var uid = GetNextAuraUID(); foreach (var lineId in auraLines) { var line = SpellLines.GetLine(lineId); line.AuraUID = uid; foreach (var spell in line) { spell.AuraUID = uid; } } return(uid); }
/// <summary> /// Defines a set of Auras that are mutually exclusive /// </summary> public static uint AddAuraGroup(SpellId auraId, params SpellLineId[] auraLines) { var uid = GetNextAuraUID(); var singleSpell = SpellHandler.Get(auraId); singleSpell.AuraUID = uid; foreach (var lineId in auraLines) { var line = SpellLines.GetLine(lineId); line.AuraUID = uid; foreach (var spell in line) { spell.AuraUID = uid; } } return(uid); }
/// <summary> /// Defines a set of Auras that are mutually exclusive /// </summary> public static uint AddAuraGroup(SpellLineId auraLine, params SpellId[] auras) { var uid = GetNextAuraUID(); var line = SpellLines.GetLine(auraLine); line.AuraUID = uid; foreach (var spell in line) { spell.AuraUID = uid; } foreach (var id in auras) { var spell = SpellHandler.Get(id); if (spell == null) { throw new ArgumentException("Invalid SpellId: " + id); } spell.AuraUID = uid; } return(uid); }
public override void Process(CmdTrigger <RealmServerCmdArgs> trigger) { var mod = trigger.Text.NextModifiers(); var target = trigger.Args.Target; if (target == null) { return; } if (mod.Length > 0 && !(mod.Length == 1 && mod.Contains("r"))) { if (mod.Contains("c")) { // add all class abilities ClassId clss; if (trigger.Text.HasNext) { clss = trigger.Text.NextEnum(ClassId.End); if (clss == ClassId.End) { trigger.Reply(RealmLangKey.InvalidClass); return; } } else { clss = target.Class; } var count = 0; var lines = SpellLines.GetLines(clss); foreach (var line in lines) { if (line.HighestRank.Talent == null) { AddSpell(target, line.HighestRank, mod.Contains("r")); count++; } } if (count > 0) { trigger.Reply(RealmLangKey.CmdSpellAddResponseSpells, count); } } if (mod.Contains("t")) { // add all talents int count = 0; var lines = SpellLines.GetLines(target.Class); foreach (var line in lines) { if (line.HighestRank.Talent != null) { AddSpell(target, line.HighestRank, mod.Contains("r")); count++; } } trigger.Reply(RealmLangKey.CmdSpellAddResponseTalents, count); } } else { // add list of spells var spells = SpellGetCommand.RetrieveSpells(trigger); if (spells.Length == 0) { trigger.Reply(RealmLangKey.CmdSpellNotExists); } else { foreach (var spell in spells) { AddSpell(target, spell, mod.Contains("r")); trigger.Reply(RealmLangKey.CmdSpellAddResponseSpell, spell); } } } }
public override void Process(CmdTrigger <RealmServerCmdArgs> trigger) { string str = trigger.Text.NextModifiers(); Unit target = trigger.Args.Target; if (target == null) { return; } if (str.Length > 0 && (str.Length != 1 || !str.Contains("r"))) { if (str.Contains("c")) { ClassId clss; if (trigger.Text.HasNext) { clss = trigger.Text.NextEnum(ClassId.End); if (clss == ClassId.End) { trigger.Reply(RealmLangKey.InvalidClass); return; } } else { clss = target.Class; } int num = 0; foreach (SpellLine line in SpellLines.GetLines(clss)) { if (line.HighestRank.Talent == null) { AddSpell(target, line.HighestRank, str.Contains("r")); ++num; } } if (num > 0) { trigger.Reply(RealmLangKey.CmdSpellAddResponseSpells, (object)num); } } if (!str.Contains("t")) { return; } int num1 = 0; foreach (SpellLine line in SpellLines.GetLines(target.Class)) { if (line.HighestRank.Talent != null) { AddSpell(target, line.HighestRank, str.Contains("r")); ++num1; } } trigger.Reply(RealmLangKey.CmdSpellAddResponseTalents, (object)num1); } else { Spell[] spellArray = SpellGetCommand.RetrieveSpells(trigger); if (spellArray.Length == 0) { trigger.Reply(RealmLangKey.CmdSpellNotExists); } else { foreach (Spell spell in spellArray) { AddSpell(target, spell, str.Contains("r")); trigger.Reply(RealmLangKey.CmdSpellAddResponseSpell, (object)spell); } } } }