WoW:API GetSkillLineInfo: Difference between revisions

m
Move page script moved page API GetSkillLineInfo to WoW:API GetSkillLineInfo without leaving a redirect
No edit summary
m (Move page script moved page API GetSkillLineInfo to WoW:API GetSkillLineInfo without leaving a redirect)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<center>'''GetSkillLineInfo''' ''-Documentation by Chevalric-''</center>
{{wowapi}} __NOTOC__
 


Returns the name and other information which is associated with the specific skill or skill header in the game.
Returns the name and other information which is associated with the specific skill or skill header in the game.


  GetSkillLineInfo(skillLine);
  skillName, isHeader, isExpanded, skillRank, numTempPoints, skillModifier,
  skillMaxRank, isAbandonable, stepCost, rankCost, minLevel, skillCostType,
  skillDescription = GetSkillLineInfo(skillIndex)
 
== Parameters ==
=== Arguments ===
:(skillIndex)


----
:;skillIndex : Integer - The row of the skill display to request information from.
;''Arguments''
=== Returns ===
:skillName, isHeader, isExpanded, skillRank, numTempPoints, skillModifier, skillMaxRank, isAbandonable, stepCost, rankCost, minLevel, skillCostType, skillDescription


:(Number skillLine)
:;skillName : String - The name of the skill/header
:;isHeader : Flag - 1 if row is header, nil otherwise.
:;isExpanded: Flag - 1 if row is expanded, nil otherwise.
:;skillRank : Integer - The current rank for the current skill
:;numTempPoints : Integer - Temporary points for the current skill
:;skillModifier : Integer - Skill modifier value for the current skill
:;skillMaxRank : Integer - The maximum rank for the current skill
:;isAbandonable : Flag - 1 if skill can be unlearned, nil otherwise.
:;stepCost : Flag - 1 if skill can be learned, nil otherwise.
:;rankCost : Flag - 1 if skill can be trained, nil otherwise.
:;minLevel : Integer - Minimum level required to learn this skill
:;skillCostType : Integer - Unknown, seems to be related to primary and secondary skills
:;skillDescription : String - Skill Description Text, localised


:;skillLine : The linenumber for the skill or skill header


----
== Example ==
;''Returns''
for skillIndex = 1, GetNumSkillLines() do
  local skillName, isHeader, isExpanded, skillRank, numTempPoints, skillModifier,
    skillMaxRank, isAbandonable, stepCost, rankCost, minLevel, skillCostType,
    skillDescription = GetSkillLineInfo(skillIndex)
  if not isHeader then
      print(string.format("Skill: %s - %s", skillName, skillRank))
  end
end


:;skillName(String) : The name of the skill/header
====Result====
:;isHeader(Boolean) : True if this skillLine is a header
:Prints each skills's name and rank.
:;isExpanded(Boolean) : True if the skillLine is expanded
Two-Handed Mace - 229
:;skillRank(Number) : The current rank for the current skill
Cooking - 278
:;numTempPoints(Number) : Temporary points for the current skill
Staves - 150
:;skillModifier(Number) : Skill modifier value for the current skill
Leatherworking - 300
:;skillMaxRank(Number) : The maximum rank for the current skill
:;isAbandonable(Boolean) : True if the skill can be unlearned
:;stepCost(Boolean) : True if skill can be learned
:;rankCost(Boolean) : True if skill can be trained up
:;minLevel(Number) : Minimum level required to learn this skill
:;skillCostType(Number) : Unknown, seems to be related to primary and secondary skills
:;skillDescription(String) : Skill Description Text, localised
----
;''Example''


local skillTitle = GetSkillLineInfo(1);


;''Result''
====Another Example====
"Armor"


;''Example from SkillFrame.lua''
:Lets say you only want a specific return value, and you do not want to waste a lot of variables or characters to get it. What you can do is assign all the returns values to an array, and then select the element of the array that corresponds with the return value you want. For example if you wanted only the skillRank of riding(if you have all the secondary skills) you can use the following code:


  local skillName, header, isExpanded, skillRank, numTempPoints, skillModifier, skillMaxRank, isAbandonable, stepCost, rankCost, minLevel, skillCostType, skillDescription = GetSkillLineInfo(skillIndex);
  /script array = {GetSkillLineInfo(12)}
/script DEFAULT_CHAT_FRAME:AddMessage(array[4])


----
Where:
;''Description''
*12 is the skillIndex of Riding.
*4 is the index of the skillRank in the array


: Returns the string which is associated with the specific Skill Line in the game. Also returns other information about a given skill such as its current rank, its maximum rank, if it's a header and if so, if it's collapsed.


----
:For more information on this method try the Lua website:[http://www.lua.org/pil/5.1.html]
{{Template:WoW API}}
[[Category:World of Warcraft API]]
Anonymous user