Quantcast
How do I get the spec info from the talent tree - WoWInterface
Thread Tools Display Modes
02-24-15, 03:22 AM   #1
gmarco
A Frostmaul Preserver
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 290
How do I get the spec info from the talent tree

Hi all,

I use this thread because I have a problem "talents related" :-) and so I try to ask here for some help.

I am trying to figure how to have the spec informations from the talent tree...
I like to find something like this: 2,1,3,1,1,3,2

I have read on my book and googling a lot but it seems to me that a lot of functions are not yet documented and not related to find something like it.

I can find everything of the talent selected but what I am not able to get is its position in the tier row.

code like:

Lua Code:
  1. isFree, talent = GetTalentRowSelectionInfo(1)
  2. print (GetTalentInfoByID(talent))

give me back a lot but not what I am looking for :-)

Thanks for any suggestions/tips/hints :-)
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote
02-24-15, 04:02 AM   #2
Mazzop
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 74
for gmarco

Code:
local specid = GetActiveSpecGroup()
local maxtalenttier = GetMaxTalentTier()
local talenttree = {}
for i=1, maxtalenttier do
for j=1, 3 do
if select(4, GetTalentInfo(i,j,specid)) == true then
talenttree[i] = j
end
end
end

print(table.concat(talenttree))
  Reply With Quote
02-26-15, 12:43 PM   #3
gmarco
A Frostmaul Preserver
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 290
Hi Mazzop,
this is exactly what I need ... :-)

Thanks !!!
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote
02-26-15, 12:51 PM   #4
gmarco
A Frostmaul Preserver
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 290
I have adapted the code in this way:

Lua Code:
  1. local PRISPEC = {}
  2. local SECSPEC = {}
  3.  
  4. --- blabla ...
  5.  
  6.  
  7.     for i=1, GetMaxTalentTier()  do
  8.        for j=1, 3 do
  9.             if select(4, GetTalentInfo(i,j,1)) == true then
  10.                 ptalenttree[i] = j
  11.             end
  12.          
  13.             if select(4, GetTalentInfo(i,j,2)) == true then
  14.                 stalenttree[i] = j
  15.             end
  16.        end
  17.     end
  18.  
  19.     PRISPEC["tree"] = table.concat(ptalenttree,"-")
  20.     SECSPEC["tree"] = table.concat(stalenttree,"-")


Now I'd like ask another thing ...

Is possible to rewrite these 2 lines in a more lua style to have the array populated by the GetSpecializationInfo(primarySpec) directly ?


Lua Code:
  1. local id, name, description, icon, background, role = GetSpecializationInfo(primarySpec)
  2. PRISPEC = { id = id, name = name, description = description, icon = icon , background = background, role = role }

Thanks.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote
02-26-15, 12:56 PM   #5
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Not by name, as they have no reference to anything like that, but you can do this:
Code:
PRISPEC = {GetSpecializationInfo(primarySpec)}
__________________
Grab your sword and fight the Horde!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » How do I get the spec info from the talent tree

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off