Пример #1
0
        /// <summary>
        /// Defines a set of Auras that are mutually exclusive
        /// </summary>
        public static uint AddAuraGroup(SpellLineId auraLine, SpellLineId auraLine2, params SpellId[] auras)
        {
            var uid  = GetNextAuraUID();
            var line = auraLine.GetLine();

            line.AuraUID = uid;
            foreach (var spell in line)
            {
                spell.AuraUID = uid;
            }
            line         = auraLine2.GetLine();
            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);
        }
Пример #2
0
        /// <summary>Defines a set of Auras that are mutually exclusive</summary>
        public static uint AddAuraGroup(SpellLineId auraLine, SpellLineId auraLine2, params SpellId[] auras)
        {
            uint      nextAuraUid = GetNextAuraUID();
            SpellLine line1       = auraLine.GetLine();

            line1.AuraUID = nextAuraUid;
            foreach (Spell spell in line1)
            {
                spell.AuraUID = nextAuraUid;
            }
            SpellLine line2 = auraLine2.GetLine();

            line2.AuraUID = nextAuraUid;
            foreach (Spell spell in line2)
            {
                spell.AuraUID = nextAuraUid;
            }
            foreach (SpellId aura in auras)
            {
                Spell spell = SpellHandler.Get(aura);
                if (spell == null)
                {
                    throw new ArgumentException("Invalid SpellId: " + aura);
                }
                spell.AuraUID = nextAuraUid;
            }

            return(nextAuraUid);
        }
Пример #3
0
        /// <summary>Returns the first visible Aura with the given SpellId</summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool Contains(SpellLineId id)
        {
            SpellLine line = id.GetLine();

            if (line != null)
            {
                return(this[line] != null);
            }
            return(false);
        }
Пример #4
0
 /// <summary>Returns the first visible Aura with the given SpellId</summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public Aura this[SpellLineId id]
 {
     get
     {
         SpellLine line = id.GetLine();
         if (line != null)
         {
             return(this[line]);
         }
         return((Aura)null);
     }
 }
Пример #5
0
        public void ClearCooldown(SpellLineId id, bool alsoClearCategory = true)
        {
            var line = id.GetLine();

            if (line != null)
            {
                foreach (var spell in line)
                {
                    ClearCooldown(spell, alsoClearCategory);
                }
            }
        }
Пример #6
0
 public Aura this[SpellLineId id, bool positive]
 {
     get
     {
         SpellLine line = id.GetLine();
         if (line != null)
         {
             return(this[line, positive]);
         }
         return(null);
     }
 }
Пример #7
0
        public void ClearCooldown(SpellLineId id, bool alsoClearCategory = true)
        {
            SpellLine line = id.GetLine();

            if (line == null)
            {
                return;
            }
            foreach (Spell cooldownSpell in line)
            {
                this.ClearCooldown(cooldownSpell, alsoClearCategory);
            }
        }
Пример #8
0
 /// <summary>
 /// Gets the highest rank of the line that this SpellCollection contains
 /// </summary>
 public Spell GetHighestRankOf(SpellLineId lineId)
 {
     return(this.GetHighestRankOf(lineId.GetLine()));
 }
Пример #9
0
		/// <summary>
		/// Defines a set of Auras that are mutually exclusive
		/// </summary>
		public static uint AddAuraGroup(SpellLineId auraLine, SpellLineId auraLine2, params SpellId[] auras)
		{
			var uid = GetNextAuraUID();
			var line = auraLine.GetLine();
			line.AuraUID = uid;
			foreach (var spell in line)
			{
				spell.AuraUID = uid;
			}
			line = auraLine2.GetLine();
			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;
		}