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.
- Maintain a raid wide table of talents, automatically updated on roster changes, notifying you on talent receipts.
- Provide easy access to talent queries (spec weight, spec name, specific talent presence).
- Monitor talent changes in players, and notify of changes (respec, talent swap, update after out of sight, level up).
- Monitor player roles, and notify of changes (melee, tank, healer, caster).
- 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])
GetUnitTalentSpec(unitid[, group])
- Returns: Dominant Tree, spent1, spent2, spent3
It 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])
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)
GetUnitRole(unit)
- Returns one of: "melee", "caster", "healer", "tank"
GetGUIDRole(guid)
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.
Note: 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.
GetTalentCount()
- Returns: Talent info got, Talent info missing
GetTalentMissingNames()
- Returns: Comma delimited list of player names we're missing talents for
GetClassTalentInfo(class, talentName)
- 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)
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])
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])
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.
GetActiveTalentGroup(unit)
- Returns: Active talent group for unit.
GetNumTalentGroups(unit)
- Returns: Number of talent groups for unit.
GetNumTalentTabs(unit)
- Returns: Number of talent tabs.
GetTalentTabInfo(unit, tab[, group])
- Returns: Tree Name, Tree Icon, Points Spent, Tree Background
GetNumTalents(unit, tab)
- Returns: Number of talents for specified tree
GetTalentInfo(unit, tab, index[, group])
- Returns: Talent Name, Icon, Tier, Column, Points Spent, Max Rank
Note that preview return values are not given unless called with "player".
GetUnspentTalentPoints(unit[, group])
- Returns: Number of un-spent talent points for the unit
Events
These events are fired when any group member's talents change for any reason. You don't need to worry about querying the default API for them, just watch these events and update from the library.
LibGroupTalents_Update(guid, unit)
LibGroupTalents_Update(guid, unit, newSpec, n1, n2, n3 [, oldSpec, o1, o2, o3])
- Received updated talents. If it's a respec, or old set is known, it passes the old info also in last four args.
This is not sent if new talent scan is same as previous.
LibGroupTalents_UpdateComplete(guid1, guid2[, ...])
- Sent when there are no more pending talent reads due and passes all GUIDs that were updated since last time this event was fired.
LibGroupTalents_Add(guid, unit, name, realm)
- Unit added to talent roster.
Talents not necessarily available yet, but this is the mod's chance to feed talents using SetStorageString
LibGroupTalents_Remove(guid, name, realm)
- Unit removed from talent roster.
This is your last chance to store talents if required using GetUnitStorageString.
LibGroupTalents_RoleChange(guid, unit, newrole, oldrole)
- Roles are: "melee", "caster", "healer", "tank"
------------------------------------------------------------------------
r51 | Zeksie | 2010-01-30 12:49:36 +0000 (Sat, 30 Jan 2010) | 1 line
Changed paths:
M /trunk/LibGroupTalents-1.0.lua
M /trunk/LibGroupTalents-1.0.toc
Changed licence to MIT.
------------------------------------------------------------------------
Installation Guide
- Exit "World of Warcraft" completely
- Download the mod you want to install
- Make a folder on your desktop called "My Mods"
- Save the .zip/.rar files to this folder.
- If, when you try to download the file, it automatically "opens" it... you need to RIGHT click on the link and "save as..." or "Save Target As".
- Extract the file - commonly known as 'unzipping'
Do this ONE FILE AT A TIME!
- Windows
- Windows XP has a built in ZIP extractor. Double click on the file to open it, inside should be the file or folders needed. Copy these outside to the "My Mods" folder.
- WinRAR: Right click the file, select "Extract Here"
- WinZip: You MUST make sure the option to "Use Folder Names" is CHECKED or it will just extract the files and not make the proper folders how the Authors designed
- Mac Users
- StuffitExpander: Double click the archive to extract it to a folder in the current directory.
- Verify your WoW Installation Path
That is where you are running WoW from and THAT is where you need to install your mods.
- Move to the Addon folder
- Open your World of Warcraft folder. (default is C:\Program Files\World of Warcraft\)
- Go into the "Interface" folder.
- Go into the "AddOns" folder.
- In a new window, open the "My Mods" folder.
- The "My Mods" folder should have the "Addonname" folder in it.
- Move the "Addonname" folder into the "AddOns" folder
- Start World of Warcraft
- Make sure AddOns are installed
- Log in
- At the Character Select screen, look in lower left corner for the "addons" button.
- If button is there: make sure all the mods you installed are listed and make sure "load out of date addons" is checked.
- If the button is NOT there: means you did not install the addons properly. Look at the above screenshots. Try repeating the steps or getting someone who knows more about computers than you do to help.
Translations
When you download a mod, please be sure that the mod is compatible with your translation of wow. Some mods only work on the US versions, while some only work on some of the various European versions. These variations are called "Localizations".
TOC Numbers (Out of Date Mods)
When Blizzard patches WoW, they change the Interface number. This means that all mods will be "out of date" unless or until the author releases a new version for that interface. Some people go into the .toc files and update the numbers themselves, but this is STRONGLY advised against as it will cause problems locating possible incompatibilities addons. When you log into WoW after a patch, you DO NOT have to delete your interface directory. All you have to do is simply tell WoW to ignore the interface numbers and load all the mods anyway. All you have to do is, while at the "character select" screen, look in the lower left corner and click on the "addons" button. A window will pop up listing all your installed mods.
If you look in the upper left corner of that window there should be a box that says "Load Out of Date AddOns". You want to CHECK this box. Now simply go into WoW normally and all your mods should load. As of the 1.9 patch, you will have to do this after EVERY patch/update that Blizzard posts! If you encounter any problems with a mod after a patch, please be sure to let the author of the mod know so they can fix it.
See also: About "Out Of Date AddOns"
Mac Support
WoW addons are not platformed based. As such, they can be used on either Mac or PC. You can extract both .zip and .rar files on a Mac using StuffitExpander.
Directory Structure
World of Warcraft
|_ Interface
|_AddOns
|_*AddonName*
|_ *AddonName*.toc
|_ *AddonName*.xml
|_ *AddonName*.lua
|_ (possibly others as well)...