Code:
public string PrimarySpecName
{
get
{
int tree = PrimarySpecTree;
if (tree == 0) return string.Empty;
lstring res = DoString(string.Format(@"(function()
local _,_,_,spec = GetTalentTabInfo({0})
return spec
end)()", tree));
if (res.HasValues) return res.Values[0];
return string.Empty;
}
}
public int PrimarySpecTree
{
get
{
lstring res = DoString(@"(function()
local _,_,tree1 = GetTalentTabInfo(1)
local _,_,tree2 = GetTalentTabInfo(2)
local _,_,tree3 = GetTalentTabInfo(3)
return tree1,tree2,tree3
end)()");
int tree1 = res.As<int>(0);
int tree2 = res.As<int>(1);
int tree3 = res.As<int>(2);
if (tree1 > tree2 && tree1 > tree3) return 1;
if (tree2 > tree1 && tree2 > tree3) return 2;
if (tree3 > tree1 && tree3 > tree2) return 3;
return 0;
}
}