What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Does the HB API support raid icons?

WileE91

Member
Joined
Jan 15, 2010
Messages
145
Reaction score
1
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.
 
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.
i dont think it does. but you can certainly add them yourself via Lua.
 
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.
 
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.
 
Back
Top