LibSpecRoster

This project is abandoned and its default file will likely not work with the most recent version of World of Warcraft. Whether this project is out of date or its author has marked it as abandoned, this project is no longer maintained.

LibSpecRoster is a very lightweight library to keep track of group (party/raid) specializations, roles, talents, and glyphs.

Blizzard made some nice changes with 5.0. All spec changes by group members trigger the PLAYER_SPECIALIZATION_CHANGED event, and group members can always be inspected, no matter where they are, as long as they are online.

This means that there is no longer any reason for complex libraries that watch group members' casts to see if they cast a spec change, and that invalidate their data if they go out of range or out of zone. This also means that it is not efficient to send spec changes over addon comm, since less data will be flying around if you DON'T do so.

The library makes an effort not to issue any unnecessary inspect requests. There is a small delay before requests are issued, and requests by other addons are tracked and not duplicated when possible. All relevant inspect data that comes in to the client is used to keep data up to date.


Library Methods:
lib.RegisterMessage(yourObject, "LSR_callbackMessageName", yourMethod)
lib.UnregisterMessage(yourObject, "LSR_callbackMessageName")
lib.UnregisterAllMessages(yourObject)
lib.getInspectData(guid) - returns specName, specID, class, role, blizzRole, talents, glyphs
lib:getSpecialization(guid) - returns specName, specID, class
lib:getRole(guid) - returns role, blizzRole
Callback Messages:
"LSR_SpecializationChanged" - params: eventName, guid, unit, specID, talents, glyphs
"LSR_RoleChanged" - params: eventName, guid, unit, role
"LSR_TalentUpdate" - params: eventName, guid, unit, specID, talents, glyphs
"LSR_GlyphUpdate" - params: eventName, guid, unit, specID, talents, glyphs
Method / Callback Details:

Roles are "tank" or "healer" or "melee" or "ranged".

Blizzard roles are "TANK" or "HEALER" or "DAMAGER".

Class is always the non-localized class name, i.e. the second return from UnitClass().

Talents are returned as a simple array of the form {[talentLine] = SpellID | false}, i.e. if no talent has been selected on a given line, the array holds a value of false for that line.

The glyph array has the form {[glyphSlot] = { spellID = SpellID, rank = 1 | 2} | false}. rank==1 is a minor glyph, rank==2 is a major glyph (as in Blizzard returns). Again, if a slot is empty, the entire entry for that slot is set to false.


Caveats:

There is currently no way to detect talent changes that do not involve changing spec. They do not trigger an event (except to that player), and there is no spellcast. Addon comm could be used for this, but unless all clients were running this library, the information would be partial and so, not reliable, which I find greatly limits its usefulness. So I kept it simple.

The talent and glyph update callbacks are triggered whenever inspect data comes in that shows a change, but, again, talent and glyph changes are not and cannot reasonably be tracked.

The library captures all relevant inspects, so, if your addon calls NotifyInspect() for a unit and there is a change, the update callbacks will trigger. Do be conservative with this, though.


Comments

  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes

About This Project

  • Project ID
    45345
  • Created
    Sep 29, 2012
  • Last Released File
    Nov 19, 2013
  • Total Downloads
    4,242
  • License

Categories

Members

Recent Files

WoW Retail