Quantcast

split stats into separate stats.lua

Silversage of Eitrigg [10-03-11 - 04:41]
split stats into separate stats.lua
Filename
GearStatsRegistry.lua
stats.lua
diff --git a/GearStatsRegistry.lua b/GearStatsRegistry.lua
new file mode 100644
index 0000000..75d12cb
--- /dev/null
+++ b/GearStatsRegistry.lua
@@ -0,0 +1,29 @@
+local registeredClasses = {}
+
+namespace("sage.gear").StatsRegistrar = {
+  setClass = function(self, className)
+    self.class = className
+    return self
+  end,
+  setColor = function(self, t)
+    self.color = t
+    return self
+  end,
+  stats = function(self, t)
+    self.statsTable = t
+    return self
+  end,
+  registerAs = function(self, name)
+    if self.class and self.color and self.statsTable then
+      registeredClasses[name] = {class=self.class, color=self.color,
+          stats=self.statsTable}
+    end
+    self.class = nil
+  end
+}
+
+namespace("sage.gear").AllStats = function(callback)
+  for spec,data in pairs(registeredClasses) do
+    callback(spec, data.class, data.stats, data.color)
+  end
+end
\ No newline at end of file
diff --git a/stats.lua b/stats.lua
new file mode 100644
index 0000000..b04f634
--- /dev/null
+++ b/stats.lua
@@ -0,0 +1,215 @@
+--[[
+
+HOW TO EDIT THIS FILE:
+
+1. Use a text editor, not a word processor.
+2. Look at the examples below to find the patterns.
+3. To adjust the specs for one spec, just edit between the
+   ":stats({" and the closing "})".
+4. The only value that matter in the stats are:
+     Agility, Intellect, Spirit, Stamina, Strength,
+     Crit, CritRanged, Dodge, Expertise, Haste, Hit,
+     Mastery, Parry, Resilience, AP, DPS, SP, Armor,
+     FireResist, FrostResist,
+     RedSocket, BlueSocket, YellowSocket, PrismaticSocket
+5. If you don't assign values to socket coefficients, values
+   will be estimated for you.
+6. To control the color of the tooltip, set r.ed, g.reen, and
+   b.lue values between 0.0 and 1.0.
+7. You can register as many names as you want.
+  ]]
+
+local StatsRegistrar = namespace("sage.gear").StatsRegistrar
+local function forClass(className)
+  return setmetatable({}, {__index=StatsRegistrar})
+      :setClass(className)
+end
+
+--DK
+forClass("DEATHKNIGHT")
+  :setColor({r=1.0, g=0.2, b=0.4})
+  :stats({MeleeDPS=500, Mastery=100, Stamina=100, Agility=69, Dodge=50,
+      Parry=43, Expertise=38, Strength=31, Armor=18, Haste=16, Hit=16,
+      AdditionalArmor=11})
+  :registerAs("Blood DK")
+
+forClass("DEATHKNIGHT")
+  :setColor({r=0.2, g=0.4, b=1.0})
+  :stats({Strength=100, MeleeDPS=100, Hit=43, Expertise=41, Haste=37,
+      Mastery=35, AP=32, Crit=26})
+  :registerAs("Frost DK")
+
+forClass("DEATHKNIGHT")
+  :setColor({r=0.6, g=0.6, b=0.6})
+  :stats({Strength=100, MeleeDPS=100, Hit=43, Expertise=41, Haste=37,
+      Mastery=35, AP=32, Crit=26})
+  :registerAs("Unholy DK")
+
+--Druid
+forClass("DRUID")
+  :setColor({r=0.3, g=0.3, b=1.0})
+  :stats({Hit=100, Master=100, SP=66, Haste=54, Crit=43,
+      Intellect=22, Spirit=22})
+  :registerAs("Moonkin")
+
+forClass("DRUID")
+  :setColor({r=1.0, g=1.0, b=0.5})
+  :stats({DPS=151, Agility=100, Strength=78, AP=37, Mastery=35, Haste=32,
+      Expertise=29, Hit=28, Crit=28})
+  :registerAs("Kitty")
+
+forClass("DRUID")
+  :setColor({r=1.0, g=0.4, b=0.4})
+  :stats({Agility=100, Dodge=88, Armor=71, Mastery=48, Expertise=30, Crit=28,
+      Hit=15, Stamina=13, AP=12, Haste=4})
+  :registerAs("Bear")
+
+forClass("DRUID")
+  :setColor({r=0.3, g=1.0, b=0.3})
+  :stats({SP=100, Mastery=100, Haste=57, Intellect=51, Spirit=32, Crit=11})
+  :registerAs("Tree")
+
+-- Hunter
+forClass("HUNTER")
+  :setColor({r=0.7, g=0.3, b=1.0})
+  :stats({RangedDPS=213, Hit=100, Mastery=100, Agility=58, Crit=40,
+      Intellect=37, Haste=21})
+  :registerAs("BM Hunter")
+
+forClass("HUNTER")
+  :setColor({r=1.0, g=0.7, b=0.3})
+  :stats({RangedDPS=379, Hit=100, Mastery=100, Agility=74, Crit=57,
+      Intellect=39, Haste=24})
+  :registerAs("MM Hunter")
+
+forClass("HUNTER")
+  :setColor({r=0.3, g=1.0, b=0.7})
+  :stats({RangedDPS=100, Agility=100, Hit=80, Crit=60, Haste=40, Mastery=20})
+  :registerAs("SV Hunter")
+
+-- Mage
+forClass("MAGE")
+  :setColor({r=1.0, g=1.0, b=1.0})
+  :stats({Hit=100, Mastery=100, Haste=54, SP=49, Crit=37, Intellect=34,
+      Spirit=14})
+  :registerAs("Arcane Mage")
+
+forClass("MAGE")
+  :setColor({r=1.0, g=0.8, b=0.4})
+  :stats({Hit=100, Mastery=100, Haste=53, SP=46, Crit=43, Intellect=13})
+  :registerAs("Fire Mage")
+
+forClass("MAGE")
+  :setColor({r=0.7, g=0.7, b=1.0})
+  :stats({Hit=100, Mastery=100, Haste=42, SP=39, Crit=19, Intellect=6})
+  :registerAs("Frost Mage")
+
+-- Paladin
+forClass("PALADIN")
+  :setColor({r=0.3, g=1.0, b=0.3})
+  :stats({Intellect=100, Mastery=100, SP=58, Crit=46, Haste=35})
+  :registerAs("Holy Paladin")
+
+forClass("PALADIN")
+  :setColor({r=1.0, g=0.4, b=0.4})
+  :stats({Parry=100, Dodge=100, Mastery=81, Stamina=49, Strength=28,
+      Expertise=8, Hit=4})
+  :registerAs("Prot Paladin")
+
+forClass("PALADIN")
+  :setColor({r=1.0, g=1.0, b=0.5})
+  :stats({MeleeDPS=470, Mastery=100, Hit=100, Strength=80, Expertise=66,
+      Crit=40, Agility=32, Haste=30, SP=9})
+  :registerAs("Ret Paladin")
+
+--Priest
+forClass("PRIEST")
+  :setColor({r=0.5, g=0.5, b=1.0})
+  :stats({Intellect=100, Spirit=80, SP=19, Crit=11, Haste=10, Mastery=6})
+  :registerAs("Disc Priest")
+
+forClass("PRIEST")
+  :setColor({r=0.3, g=1.0, b=0.3})
+  :stats({Intellect=100, Spirit=95, Haste=85, Mastery=80, Crit=30})
+  :registerAs("Holy Priest")
+
+forClass("PRIEST")
+  :setColor({r=0.5, g=0.5, b=0.5})
+  :stats({Intellect=100, SP=79, Haste=50, Crit=40, Mastery=38, Spirit=37,
+      Hit=37})
+  :registerAs("Shadow Priest")
+
+--Rogue
+forClass("ROGUE")
+  :setColor({r=0.8, g=1.0, b=0.5})
+  :stats({MeleeDPS=100, Agility=100, Hit=67, Mastery=50, Haste=46,
+      Expertise=42, Crit=35})
+  :registerAs("Assassin")
+
+forClass("ROGUE")
+  :setColor({r=1.0, g=0.8, b=0.5})
+  :stats({MeleeDPS=100, Agility=100, Hit=70, Expertise=59, Haste=56, Crit=35,
+      Mastery=33})
+  :registerAs("Combat Rogue")
+
+forClass("ROGUE")
+  :setColor({r=1.0, g=1.0, b=0.3})
+  :stats({MeleeDPS=100, Agility=100, Hit=40, Haste=37, Expertise=33, Crit=31,
+      Mastery=20})
+  :registerAs("Subtlety")
+
+--Shaman
+forClass("SHAMAN")
+  :setColor({r=0.5, g=0.5, b=1.0})
+  :stats({Mastery=100, Hit=100, SP=60, Haste=56, Crit=40, Intellect=11})
+  :registerAs("Ele Shaman")
+
+forClass("SHAMAN")
+  :setColor({r=1.0, g=1.0, b=0.5})
+  :stats({MeleeDPS=124, Agility=100, Hit=60, Expertise=48, Mastery=44,
+      Strength=42, AP=40, Intellect=36, SP=36, Crit=28, Haste=16})
+  :registerAs("Enh Shaman")
+
+forClass("SHAMAN")
+  :setColor({r=0.3, g=1.0, b=0.3})
+  :stats({Intellect=100, SP=83, Spriti=75, Haste=67, Crit=58, Mastery=42,
+      Stamina=8})
+  :registerAs("Resto Shaman")
+
+--Warlock
+forClass("WARLOCK")
+  :setColor({r=1.0, g=0.2, b=1.0})
+  :stats({Hit=100, Master=100, SP=72, Haste=61, Crit=38, Spirit=34,
+      Intellect=15})
+  :registerAs("Aff Warlock")
+
+forClass("WARLOCK")
+  :setColor({r=0.8, g=0.2, b=1.0})
+  :stats({Hit=100, Master=100, Haste=50, SP=45, Crit=31, Spirit=29,
+      Intellect=13})
+  :registerAs("Dem Warlock")
+
+forClass("WARLOCK")
+  :setColor({r=1.0, g=0.6, b=0.0})
+  :stats({Mastery=100, Hit=100, SP=47, Haste=46, Spirit=26, Crit=16,
+      Intellect=13})
+  :registerAs("Destro Warlock")
+
+-- Warrior
+forClass("WARRIOR")
+  :setColor({r=0.8, g=0.8, b=1.0})
+  :stats({Mastery=100, Strength=100, Hit=90, Expertise=85, Crit=80, Agility=65,
+      Haste=50, Armor=1})
+  :registerAs("Arms Warrior")
+
+forClass("WARRIOR")
+  :setColor({r=0.8, g=0.8, b=0.2})
+  :stats({Mastery=100, Expertise=100, Strength=82, Crit=66, Agility=53, Hit=48,
+      Haste=36, Armor=5})
+  :registerAs("Fury Warrior")
+
+forClass("WARRIOR")
+  :setColor({r=1.0, g=0.4, b=0.4})
+  :stats({Stamina=100, Mastery=100, Dodge=90, Parry=67, Agility=67, Strength=48,
+      Expertise=19, Hit=10, Crit=7, Armor=6, Haste=1})
+  :registerAs("Prot Warrior")