WoW:API GetTalentInfo: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
m (Move page script moved page API GetTalentInfo to API GetTalentInfo without leaving a redirect)
 
(3 intermediate revisions by 3 users not shown)
Line 2: Line 2:
Returns information about a specified talent in a specified tab.  
Returns information about a specified talent in a specified tab.  


  nameTalent, iconPath, tier, column, currentRank, maxRank, isExceptional, meetsPrereq = GetTalentInfo(tabIndex, talentIndex);
  name, iconPath, tier, column, currentRank, maxRank, isExceptional, meetsPrereq = GetTalentInfo(tabIndex, talentIndex [, inspect]);
 
----
;''Arguments''


== Arguments ==
(tabIndex, talentIndex [, inspect])
:;tabIndex : Integer - Specifies which tab the talent is in.
:;tabIndex : Integer - Specifies which tab the talent is in.


:;talentIndex : Integer - Specifies which talent in the given tab.
:;talentIndex : Integer - Specifies which talent in the given tab.
::: '''Note:''' The talentIndex is counted left-to-right, top-to-bottom. Meaning that the left-most talent in the top row is number 1, followed by the one immediately to its right being number 2. If there are no more talents to the right then it continues from the left-most talent on the next row.


'''Note:''' The talentIndex is counted left-to-right, top-to-bottom. Meaning that the left-most talent in the top row is number 1, followed by the one immediately to its right being number 2. If there are no more talents to the right then it continues from the left-most talent on the next row.
:;inspect : [[Boolean]] - If true returns the information for the inspected unit instead of  the player. New with 2.3.


----
== Returns ==
;''Returns''
name, iconPath, tier, column, currentRank, maxRank, isExceptional, meetsPrereq


:;nameTalent : String - The name of the talent in that tab.
:;name : String - The name of the talent in that tab, or nil if there is no talent with this tab/index combination.
:;iconPath : String - The path to the icon of the talent.
:;iconPath : String - The path to the icon of the talent, or nil if there is no talent with this tab/index combination.
:;tier : Integer - The vertical grid position of the talent icon in its talent pane tab.
:;tier : Integer - The vertical grid position of the talent icon in its talent pane tab, or 1 if there is no talent with this tab/index combination.
:;column : Integer - The horizontal grid position of the talent icon in its talent pane tab.
:;column : Integer - The horizontal grid position of the talent icon in its talent pane tab, or 1 if there is no talent with this tab/index combination.
:;currentRank : Integer - The current rank (currently assigned talent points) of the talent.
:;currentRank : Integer - The current rank (currently assigned talent points) of the talent, or 0 (zero) if there is no talent with this tab/index combination.
:;maxRank : Integer - The maximum rank (maximum number of talent points) of the talent.
:;maxRank : Integer - The maximum rank (maximum number of talent points) of the talent, or 0 (zero) if there is no talent with this tab/index combination.
:;isExceptional -  
:;isExceptional -  
:;meetsPrereq -
:;meetsPrereq : Whether the talent's prerequisites are met.
:;previewRank : The rank of this talent in preview mode. If it is not previewed, previewRank == currentRank.
:;meetsPreviewPrereq : Whether the talent's prerequisites in preview mode are met.


----
== Example ==
;''Example''


  local numTabs = GetNumTalentTabs();
  local numTabs = GetNumTalentTabs();
Line 38: Line 39:
  end
  end


;''Results'' : Displays the tab name then the talents name and current/maximum ranks for each talent in each tab.
=== Result ===
Displays the tab name then the talents name and current/maximum ranks for each talent in each tab.
 
== Also See ==
* [[API_GetNumTalents|GetNumTalents]]
* [[API_GetNumTalentTabs|GetNumTalentTabs]]

Latest revision as of 04:46, 15 August 2023

WoW API < GetTalentInfo

Returns information about a specified talent in a specified tab.

name, iconPath, tier, column, currentRank, maxRank, isExceptional, meetsPrereq = GetTalentInfo(tabIndex, talentIndex [, inspect]);

Arguments[edit]

(tabIndex, talentIndex [, inspect])

tabIndex
Integer - Specifies which tab the talent is in.
talentIndex
Integer - Specifies which talent in the given tab.
Note: The talentIndex is counted left-to-right, top-to-bottom. Meaning that the left-most talent in the top row is number 1, followed by the one immediately to its right being number 2. If there are no more talents to the right then it continues from the left-most talent on the next row.
inspect
Boolean - If true returns the information for the inspected unit instead of the player. New with 2.3.

Returns[edit]

name, iconPath, tier, column, currentRank, maxRank, isExceptional, meetsPrereq

name
String - The name of the talent in that tab, or nil if there is no talent with this tab/index combination.
iconPath
String - The path to the icon of the talent, or nil if there is no talent with this tab/index combination.
tier
Integer - The vertical grid position of the talent icon in its talent pane tab, or 1 if there is no talent with this tab/index combination.
column
Integer - The horizontal grid position of the talent icon in its talent pane tab, or 1 if there is no talent with this tab/index combination.
currentRank
Integer - The current rank (currently assigned talent points) of the talent, or 0 (zero) if there is no talent with this tab/index combination.
maxRank
Integer - The maximum rank (maximum number of talent points) of the talent, or 0 (zero) if there is no talent with this tab/index combination.
isExceptional -
meetsPrereq
Whether the talent's prerequisites are met.
previewRank
The rank of this talent in preview mode. If it is not previewed, previewRank == currentRank.
meetsPreviewPrereq
Whether the talent's prerequisites in preview mode are met.

Example[edit]

local numTabs = GetNumTalentTabs();
for t=1, numTabs do
    DEFAULT_CHAT_FRAME:AddMessage(GetTalentTabInfo(t)..":");
    local numTalents = GetNumTalents(t);
    for i=1, numTalents do
        nameTalent, icon, tier, column, currRank, maxRank= GetTalentInfo(t,i);
        DEFAULT_CHAT_FRAME:AddMessage("- "..nameTalent..": "..currRank.."/"..maxRank);
    end
end

Result[edit]

Displays the tab name then the talents name and current/maximum ranks for each talent in each tab.

Also See[edit]