• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Detection of Buffs

    Discussion in 'Archives' started by HB8407M50, Nov 16, 2011.

    1. HB8407M50

      HB8407M50 New Member

      Joined:
      May 24, 2011
      Messages:
      21
      Likes Received:
      0
      Trophy Points:
      0
      Hi

      Im trying to figure out why im not able to detect buffs on my character. The Following always returns false. Shouldnt this work?

      Code:
                  if (Me.ActiveAuras.ContainsKey("Seal of Insight")) { Logging.Write("01: got seal of insight"); } else { Logging.Write("01: fail"); }
      
       
    2. Stormchasing

      Stormchasing Community Developer

      Joined:
      Jan 15, 2011
      Messages:
      4,029
      Likes Received:
      48
      Trophy Points:
      48
    3. ZenLulz

      ZenLulz Community Developer

      Joined:
      Aug 17, 2011
      Messages:
      583
      Likes Received:
      98
      Trophy Points:
      28
      Personnally, I prefer to use the spell id when I want to check or cast something.

      For example, I use an enumation for all my auras :
      PHP:
      /// <summary>
      /// All my auras.
      /// </summary>
      public enum Auras
      {
          
      SealOfInsight 20165
      }
      And after I use my own method to check auras on WoWUnit :
      PHP:
      /// <summary>
      /// Check if the specified unit has the specified aura.
      /// </summary>
      /// <param name="unit">Specified unit.</param>
      /// <param name="auraID">Specified aura.</param>
      public static bool hasAura(WoWUnit unitAuras auraID)
      {
          if(
      unit.Auras.Values.Count(=> a.SpellId == (int)auraID) > 0)
              return 
      true;
          else 
              return 
      false;
      }
      Finally you just have to call :
      PHP:
      if(hasAura(MeAuras.SealOfInsight)) { ...Look awesome... } else { ...or not... }
       
    4. HB8407M50

      HB8407M50 New Member

      Joined:
      May 24, 2011
      Messages:
      21
      Likes Received:
      0
      Trophy Points:
      0
      I have solved this, now ContainsKey method is working for me.
      This thread can be closed.
       

    Share This Page