• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Does the HB API support raid icons?

    Discussion in 'Archives' started by WileE91, Mar 31, 2011.

    1. WileE91

      WileE91 Member

      Joined:
      Jan 15, 2010
      Messages:
      145
      Likes Received:
      1
      Trophy Points:
      18
      Does the HB API support raid icons?
      I mean reading them, not setting them.
      Didnt find anything spot on by skimming through the object browser for the Honorbuddy.exe assembly reference in VS.
       
    2. CodenameG

      CodenameG New Member

      Joined:
      Jan 15, 2010
      Messages:
      38,369
      Likes Received:
      231
      Trophy Points:
      0
      i dont think it does. but you can certainly add them yourself via Lua.
       
    3. CodenameG

      CodenameG New Member

      Joined:
      Jan 15, 2010
      Messages:
      38,369
      Likes Received:
      231
      Trophy Points:
      0
      ok so heres what you do. you run a search for all units, and pass check it against this lua statement.
      GetRaidTargetIndex - World of Warcraft Programming: A Guide and Reference for Creating WoW Addons
      Code:
        <code>index</code> <code>=</code> <code>GetRaidTargetIndex("unit")</code> <code>or</code> <code>GetRaidTargetIndex("name")</code>
       
       	   Arguments:
         
      [LIST]
      [*]<code>unit</code>  - A unit to query (<code>string</code>, [URL="http://wowprogramming.com/docs/api_types#unitID"]unitID[/URL])
      [*]<code>name</code>  - The name of a unit to query; only valid for <code>player</code>, <code>pet</code>, and party/raid members (<code>string</code>)
      [/LIST]
          	   Returns:
         
      [LIST]
      [*]<code>index</code>  - Index of a target marker (<code>number</code>)
      [LIST]
      [*]<code>1</code> - Star
      [*]<code>2</code> - Circle
      [*]<code>3</code> - Diamond
      [*]<code>4</code> - Triangle
      [*]<code>5</code> - Moon
      [*]<code>6</code> - Square
      [*]<code>7</code> - Cross
      [*]<code>8</code> - Skull
      [*]<code>nil</code> - No marker
      [/LIST]
      [/LIST]
      
      if the unit returns null, then dont add it to the list, else add it to a list.
      then you have all the marked units in one nice list, that you can then sort by. and find the icon index. and there you go.

      docs/api/CanBeRaidTarget - World of Warcraft Programming: A Guide and Reference for Creating WoW Addons


      hope that helps.
       
    4. Fraak

      Fraak New Member

      Joined:
      Mar 24, 2011
      Messages:
      32
      Likes Received:
      1
      Trophy Points:
      0
      Code:
      public enum RaidTargetIcon
      {
          None = 0,
          Star = 1,
          Circle = 2,
          Diamond = 3,
          Triangle = 4,
          Moon = 5,
          Square = 6,
          Cross = 7,
          Skull = 8,
      }
      
      public static class RaidTargetExtension
      {
          public static void SetRaidTarget(this WoWUnit unit, RaidTargetIcon icon)
          {
              WoWUnit currentTarget = StyxWoW.Me.CurrentTarget;
              unit.Target();
              Lua.DoString("SetRaidTarget(\"target\", {0});", (int)icon);
              currentTarget.Target();
          }
      
          public static RaidTargetIcon GetRaidTarget(this WoWUnit unit)
          {
              WoWUnit currentTarget = StyxWoW.Me.CurrentTarget;
              unit.Target();
              int icon = Lua.GetReturnVal<int>("return GetRaidTargetIndex(\"target\");", 0);
              currentTarget.Target();
      
              if (icon > 8 || icon < 0)
                  return RaidTargetIcon.None;
      
              return (RaidTargetIcon)icon;
          }
      }
      
      Dont know if you still want it but wrote some code for it.
       

    Share This Page