LibGroupTalents-1.0

Whether this project is out of date or its author marked it as abandoned, this project is no longer maintained.

If you wish to take this project over, please report it and state your intentions.

A high level interface to the standard talent API. All of the default Blizzard talent functions are mapped onto equivelant library functions which accept a unit ID. Plus many convenience functions are provided to allow collection of much of the commonly needed information.

The library takes care of all of the talent querying, roster changes and so forth. It simply notifies you when someone's talents have changed. You can directly query a talent by name, or get a quick and easy summary of their spec.

LibGroupTalents-1.0 is intended to do the following basic functions usually handled at the mod level.

Communicate directly with itself to other users to update talents and glyphs via addon channel when possible.

Note that the LibTalentQuery-1.0 dependancy must be included before LibGroupTalents-1.0 in any lib.xml or mod side TOC declarations.

You might wander why two libraries are needed to handle talents? LibTalentQuery-1.0 has it's place; It deals exclusively with queueing and processing inspect requests, and this may still be an easier solution for some. LibGroupTalents-1.0 handles the higher level caching of talents so that re-querying on-demand is not required, and deals with comparing specs on updates from the queue and providing easy access to often needed information.

Functions

UnitHasTalent(unit, talentName[, group])

Returns: Points spent in talent or nil

GUIDHasTalent(guid, talentName[, group])

As UnitHasTalent

GetUnitTalentSpec(unitid[, group])

Returns: Returns: Specialization Tree, spent1, spent2, spent3, non-localized name of specialization treeIt is possible that dominant tree will return a number in cases where talent specs have been received by comms and you have not yet encountered a player of the same class to inspect the talent names and tree names from.

GetGUIDTalentSpec(guid[, group])

As GetUnitTalentSpec

GetUnitTalents(unit, refresh)

Returns: Raw talent information in form of table of 3 strings of points spent. The refresh arg will force a re-query of the unit's talents.

GetGUIDTalents(guid, refresh)

As GetUnitTalents

GetUnitRole(unit)

Returns one of: "melee", "caster", "healer", "tank"

GetGUIDRole(guid)

As GetUnitRole.

RefreshTalentsByUnit(unit)

Force a refresh of talents for the specific unit.

RefreshTalentsByGUID(guid)

Force a refresh of talents for the specific player GUID.

GetTreeNames(class)

Returns: The three talent tree names for that class, then the three non-localized tree namesNote: These return values are only valid after a player of that class has been seen by this library.

GetTreeIcons(class)

Returns: The three talent tree icons for that class.Note: These return values are only valid after a player of that class has been seen by this library.

Returns: Max Rank, Icon, Tab, Tier, Column, Tree Index.Note: These return values are only valid after a player of that class has been seen by this library.

GetUnitStorageString(unit)

Returns: An encoded data string containing talent information for the player which can be stored by mods to set in later sessions using SetStorageString().

This string is encoded and double checked on receipt. It has a CRC combining the WoW build number so any saved sets from old versions of WoW are automatically invalid.

GetGUIDStorageString(guid)

As GetUnitStorageString.

SetStorageString(talentString)

Returns: true on success (applicable). Any second return value indicates the data was invalid and should not be kept.

GetUnitGlyphs(unit[, group])

Returns: Up to 6 spell IDs for the currently assigned Glyphs (Note: For the moment, we can only see the glyphs of players running LibGroupTalents-1.0).

GetGUIDGlyphs(guid[, group])

As GetUnitGlyphs

UnitHasGlyph(unit, glyph [, group])

Returns: true if the player has the glyph associated with spellID or spellName (Note: For the moment, we can only see the glyphs of players running LibGroupTalents-1.0).

GUIDHasGlyph(unit, glyph[, group])

As UnitHasGlyph

PurgeAndRescanTalents()

Wipe current roster of all talents and rescan from start

Convenience Functions

Similar to Blizzard API functions, but callable with a unit ID. Talent data is read in quite quickly once you see raid members (approximately 3 per second assuming you don't have a mod that's thrashing the NotifyInspect queue), and it's trivial to then access these familiar functions.

Would it possible that GetUnitTalentSpec consistently returns the same kind of value for dominant tree ? Having to deal with either a number or a localized tree name is pretty awkward. To keep compatibility, you could add a fourth return value: