ok so everything is working "kinda" the stat datatext i would like to dive in a little deeper and have it choose by player spec.
for instance a Pally has a heal spec, a DPS spec, and a tank spec so i would like the stats to adjust to this.
Heal = SP (not sure if classic doe SP or not)
DPS = AP
Tank = Armor
the following code gives me there spec numbers:
Lua Code:
local Warrior = {
ID = 1,
displayName = "Warrior",
name = "WARRIOR",
Arms = 71,
Fury = 72,
Prot = 73,
specs = {71, 72, 73}
}
local Paladin = {
ID = 2,
displayName = "Paladin",
name = "PALADIN",
Holy = 65,
Prot = 66,
Ret = 70,
specs = {65, 66, 70}
}
local Hunter = {
ID = 3,
displayName = "Hunter",
name = "HUNTER",
BM = 253,
MM = 254,
SV = 255,
specs = {253, 254, 255}
}
local Rogue = {
ID = 4,
displayName = "Rogue",
name = "ROGUE",
Assasin = 259,
Combat = 260,
Sub = 261,
specs = {259, 260, 261}
}
local Priest = {
ID = 5,
displayName = "Priest",
name = "PRIEST",
Disc = 256,
Holy = 257,
Shadow = 258,
specs = {256, 257, 258}
}
local DK = {
ID = 6,
displayName = "Death knight",
name = "DEATHKNIGHT",
Blood = 250,
Frost = 251,
Unholy = 252,
specs = {250, 251, 252}
}
local Shaman = {
ID = 7,
displayName = "Shaman",
name = "SHAMAN",
Ele = 262,
Enh = 263,
Resto = 264,
specs = {262, 263, 264}
}
local Mage = {
ID = 8,
displayName = "Mage",
name = "MAGE",
Arcane = 62,
Fire = 63,
Frost = 64,
specs = {62, 63, 64}
}
local Warlock = {
ID = 9,
displayName = "Warlock",
name = "WARLOCK",
Affl = 265,
Demo = 266,
Destro = 267,
specs = {265, 266, 267}
}
local Monk = {
ID = 10,
displayName = "Monk",
name = "MONK",
BRM = 268,
WW = 269,
MW = 270,
specs = {268, 269, 270}
}
local Druid = {
ID = 11,
displayName = "Druid",
name = "DRUID",
Balance = 102,
Feral = 103,
Guardian = 104,
Resto = 105,
specs = {102, 103, 104, 105}
}
local DH = {
ID = 12,
displayName = "Demon hunter",
name = "DEMONHUNTER",
Havoc = 577,
Veng = 581,
specs = {577, 581}
}
Here is the function to get the spec number:
Lua Code:
playerClass = select(1, GetSpecializationInfo(specIndex))
How would i group them together to use them in:
Lua Code:
if playerStat == 1 then
if playerClass == 66 or 73 or 104 then
local Total_Dodge = GetDodgeChance()
local Total_Parry = GetParryChance()
local Total_Block = GetBlockChance()
GameTooltip:AddLine(STAT_CATEGORY_DEFENSE)
GameTooltip:AddDoubleLine(DODGE_CHANCE, format("%.2f%%", Total_Dodge),1,1,1)
GameTooltip:AddDoubleLine(PARRY_CHANCE, format("%.2f%%", Total_Parry),1,1,1)
GameTooltip:AddDoubleLine(BLOCK_CHANCE, format("%.2f%%", Total_Block),1,1,1)
elseif playerClass == 70 or 71 or 72 then
local Melee_Crit = GetCritChance("player")
local Total_Melee_Haste = GetMeleeHaste("player")
local mainSpeed = UnitAttackSpeed("player");
local MH = mainSpeed
GameTooltip:AddLine(STAT_CATEGORY_MELEE)
GameTooltip:AddDoubleLine(STAT_CRITICAL_STRIKE, format("%.2f%%", Melee_Crit), 1, 1, 1)
--GameTooltip:AddDoubleLine(STAT_HASTE, format("%.2f%%", Total_Melee_Haste), 1, 1, 1)
GameTooltip:AddDoubleLine(STAT_ATTACK_SPEED, format("%.2f".." (sec)", MH), 1, 1, 1)
end
so when i do the print to chat to see what i get (on my ret pally) I get
Lua Code:
playerStat 1 3
playerClass 70 3
so if we referance the top table we can see that playerClass 70 is a Ret Pally which should give me a stat for AP but it currently is just giving me playerStat 1 which is the tank spec for Armor.
I have attached the whole Datapanel.lua file if you need to see the whole thing.
thanks for any help with this.