@@ -6,13 +6,14 @@ local playerLevel = UnitLevel("player")
66local enemyLevel = playerLevel + 3
77
88--- @param refName string
9- --- @return number | string
9+ --- @return number | nil
1010function Data .GetStatInfo (refName )
1111 local dataFunction = dataFunctionRefs [refName ];
1212 if dataFunction then
1313 return dataFunction ()
1414 else
1515 ECS :Print (" Invalid data refName: " .. refName )
16+ return nil
1617 end
1718end
1819
@@ -21,41 +22,11 @@ dataFunctionRefs = {
2122 -- Melee
2223 [" MeleeAttackPower" ] = function () return Data :GetMeleeAttackPower () end ,
2324 [" MeleeCritChance" ] = function () return Data :MeleeCrit () end ,
24- [" Expertise" ] = function ()
25- if ECS .IsWotlk then
26- return Data :GetExpertise ()
27- else
28- return 0
29- end
30- end ,
31- [" ExpertiseRating" ] = function ()
32- if ECS .IsWotlk then
33- return Data :GetExpertiseRating ()
34- else
35- return 0
36- end
37- end ,
38- [" MeleeArmorPenetration" ] = function ()
39- if ECS .IsWotlk then
40- return Data :GetArmorPenetration ()
41- else
42- return 0
43- end
44- end ,
45- [" MeleeArmorPenetrationRating" ] = function ()
46- if ECS .IsWotlk then
47- return Data :GetArmorPenetrationRating ()
48- else
49- return 0
50- end
51- end ,
52- [" MeleeHitRating" ] = function ()
53- if ECS .IsWotlk then
54- return Data :MeleeHitRating ()
55- else
56- return 0
57- end
58- end ,
25+ [" Expertise" ] = function () return ECS .IsClassic and 0 or Data :GetExpertise () end ,
26+ [" ExpertiseRating" ] = function () return ECS .IsClassic and 0 or Data :GetExpertiseRating () end ,
27+ [" MeleeArmorPenetration" ] = function () return Data :GetArmorPenetration () end ,
28+ [" MeleeArmorPenetrationRating" ] = function () return ECS .IsClassic and 0 or Data :GetArmorPenetrationRating () end ,
29+ [" MeleeHitRating" ] = function () return ECS .IsClassic and 0 or Data :MeleeHitRating () end ,
5930 [" MeleeHitBonus" ] = function () return Data :MeleeHitBonus () end ,
6031 [" MeleeHitSameLevel" ] = function () return Data :MeleeHitMissChanceSameLevel () end ,
6132 [" MeleeHitBossLevel" ] = function () return Data :MeleeHitMissChanceBossLevel () end ,
@@ -66,63 +37,21 @@ dataFunctionRefs = {
6637 [" GlanceDamageSameLevel" ] = function () return Data :GlanceDamageSameLevel () end ,
6738 [" GlanceDamageBossLevel" ] = function () return Data :GlanceDamageBossLevel () end ,
6839
69- [" MeleeHasteRating" ] = function ()
70- if ECS .IsWotlk then
71- return Data :GetMeleeHasteRating ()
72- else
73- return 0
74- end
75- end ,
76- [" MeleeHasteBonus" ] = function ()
77- if ECS .IsWotlk then
78- return Data :GetMeleeHasteBonus ()
79- else
80- return 0
81- end
82- end ,
40+ [" MeleeHasteRating" ] = function () return ECS .IsClassic and 0 or Data :GetMeleeHasteRating () end ,
41+ [" MeleeHasteBonus" ] = function () return Data :GetMeleeHasteBonus () end ,
8342 [" MeleeAttackSpeedMainHand" ] = function () return Data :GetMeleeAttackSpeedMainHand () end ,
8443 [" MeleeAttackSpeedOffHand" ] = function () return Data :GetMeleeAttackSpeedOffHand () end ,
8544 -- Ranged
8645 [" RangeAttackpower" ] = function () return Data :GetRangeAttackPower () end ,
8746 [" RangedCritChance" ] = function () return Data :RangedCrit () end ,
88- [" RangedHitRating" ] = function ()
89- if ECS .IsWotlk then
90- return Data :RangeHitRating ()
91- else
92- return 0
93- end
94- end ,
47+ [" RangedHitRating" ] = function () return ECS .IsClassic and 0 or Data :RangeHitRating () end ,
9548 [" RangedHitBonus" ] = function () return Data :RangeHitBonus () end ,
9649 [" RangedHitSameLevel" ] = function () return Data :RangeMissChanceSameLevel () end ,
97- [" RangedArmorPenetration" ] = function ()
98- if ECS .IsWotlk then
99- return Data :GetArmorPenetration ()
100- else
101- return 0
102- end
103- end ,
104- [" RangedArmorPenetrationRating" ] = function ()
105- if ECS .IsWotlk then
106- return Data :GetArmorPenetrationRating ()
107- else
108- return 0
109- end
110- end ,
50+ [" RangedArmorPenetration" ] = function () return Data :GetArmorPenetration () end ,
51+ [" RangedArmorPenetrationRating" ] = function () return ECS .IsClassic and 0 or Data :GetArmorPenetrationRating () end ,
11152 [" RangedHitBossLevel" ] = function () return Data .RangeMissChanceBossLevel () end ,
112- [" RangedHasteRating" ] = function ()
113- if ECS .IsWotlk then
114- return Data :GetRangedHasteRating ()
115- else
116- return 0
117- end
118- end ,
119- [" RangedHasteBonus" ] = function ()
120- if ECS .IsWotlk then
121- return Data :GetRangedHasteBonus ()
122- else
123- return 0
124- end
125- end ,
53+ [" RangedHasteRating" ] = function () return ECS .IsClassic and 0 or Data :GetRangedHasteRating () end ,
54+ [" RangedHasteBonus" ] = function () return Data :GetRangedHasteBonus () end ,
12655 [" RangedAttackSpeed" ] = function () return Data :GetRangedAttackSpeed () end ,
12756 -- Defense
12857 [" Armor" ] = function () return Data :GetArmorValue () end ,
@@ -131,51 +60,21 @@ dataFunctionRefs = {
13160 [" SpellCritReduction" ] = function () return Data :GetSpellCritReduction () end ,
13261 [" Avoidance" ] = function () return Data :GetAvoidance (playerLevel ) end ,
13362 [" AvoidanceBoss" ] = function () return Data :GetAvoidance (enemyLevel ) end ,
134- [" DefenseRating" ] = function ()
135- if ECS .IsWotlk then
136- return Data :GetDefenseRating ()
137- else
138- return 0
139- end
140- end ,
63+ [" DefenseRating" ] = function () return ECS .IsClassic and 0 or Data :GetDefenseRating () end ,
14164 [" DefenseValue" ] = function () return Data :GetDefenseValue () end ,
14265 [" DodgeChance" ] = function () return Data :GetDodgeChance () end ,
14366 [" ParryChance" ] = function () return Data :GetParryChance () end ,
14467 [" BlockChance" ] = function () return Data :GetBlockChance () end ,
14568 [" BlockValue" ] = function () return Data :GetBlockValue () end ,
146- [" ResilienceValue" ] = function ()
147- if ECS .IsWotlk then
148- return Data :GetResilienceRating ()
149- else
150- return 0
151- end
152- end ,
69+ [" ResilienceValue" ] = function () return ECS .IsClassic and 0 or Data :GetResilienceRating () end ,
15370 -- Spell
154- [" SpellHitRating" ] = function ()
155- if ECS .IsWotlk then
156- return Data :SpellHitRating ()
157- else
158- return 0
159- end
160- end ,
71+ [" SpellHitRating" ] = function () return ECS .IsClassic and 0 or Data :SpellHitRating () end ,
16172 [" SpellHitBonus" ] = function () return Data .SpellHitBonus (Data .HOLY_SCHOOL ) end ,
16273 [" SpellHitSameLevel" ] = function () return Data :SpellMissChanceSameLevel (Data .HOLY_SCHOOL ) end ,
16374 [" SpellHitBossLevel" ] = function () return Data :SpellMissChanceBossLevel (Data .HOLY_SCHOOL ) end ,
16475 [" SpellCritChance" ] = function () return Data :GetSpellCrit (Data .HOLY_SCHOOL ) end ,
165- [" SpellHasteRating" ] = function ()
166- if ECS .IsWotlk then
167- return Data :GetSpellHasteRating ()
168- else
169- return 0
170- end
171- end ,
172- [" SpellHasteBonus" ] = function ()
173- if ECS .IsWotlk then
174- return Data :GetSpellHasteBonus ()
175- else
176- return " 0 %"
177- end
178- end ,
76+ [" SpellHasteRating" ] = function () return ECS .IsClassic and 0 or Data :GetSpellHasteRating () end ,
77+ [" SpellHasteBonus" ] = function () return Data :GetSpellHasteBonus () end ,
17978 [" SpellPenetration" ] = function () return Data :GetSpellPenetration () end ,
18079 -- MP5
18180 [" MP5Items" ] = function () return Data :GetMP5FromItems () end ,
0 commit comments