/trunk
-- DirtyGear |
-- Author: Dirtygurl |
-- License: GNU GPL v3, 29 June 2007 (see LICENSE.txt) |
local DirtyGear = {} |
DirtyGear.Version = GetAddOnMetadata("DirtyGear", "Version") |
INVTYPE_WRIST = false |
} |
DirtyGear.DBIndex = "default" |
DirtyGear.DB = |
{ |
["default"] = {}, |
["Death Knight-Blood"] = |
[1] = |
{ |
Class = "Death Knight", |
Spec = "Blood", |
Type = "DPS", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Death Knight-Frost"] = |
}, --Death Knight - Blood (DPS) |
[2] = |
{ |
Class = "Death Knight", |
Spec = "Frost", |
Type = "DPS", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Death Knight-Frost-Tank"] = |
}, --Death Knight - Frost (DPS) |
[3] = |
{ |
Class = "Death Knight", |
Spec = "Frost", |
Type = "Tank", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Death Knight-Unholy"] = |
}, --Death Knight - Frost (Tanking) |
[4] = |
{ |
Class = "Death Knight", |
Spec = "Unholy", |
Type = "DPS", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Druid-Balance-Heal"] = |
}, --Death Knight - Unholy (DPS) |
[5] = |
{ |
Class = "Druid", |
Spec = "Balance", |
Type = "Heal", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Druid-Feral"] = |
}, --Druid - Balance (DPS) |
[6] = |
{ |
Class = "Druid", |
Spec = "Feral", |
Type = "DPS", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Druid-Feral-Tank"] = |
}, --Druid - Feral (DPS) |
[7] = |
{ |
Class = "Druid", |
Spec = "Feral", |
Type = "Tank", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Druid-Restoration-Heal"] = |
}, --Druid - Feral (Tanking) |
[8] = |
{ |
Class = "Druid", |
Spec = "Restoration", |
Type = "Heal", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Hunter-Beast Mastery"] = |
}, --Druid - Restoration (Healing) |
[9] = |
{ |
Class = "Hunter", |
Spec = "Beast Mastery", |
Type = "DPS", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
}, |
Gems = |
{ |
Red = { 39999 }, |
Yellow = { 40014 }, |
Blue = {}, |
Orange = { 40053, 40052 }, |
Purple = { 40030 }, |
Green = { 40029 }, |
Prismatic = {}, |
Meta = { 41398 }, |
RedYellowBlue = { 42702 }, |
JewelCraft = { 36766, 42156 } |
} |
}, |
["Hunter-Marksmanship"] = |
{ |
Class = "Hunter", |
Spec = "Marksmanship", |
Type = "DPS", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
INVTYPE_HAND = {}, |
INVTYPE_HEAD = {}, |
INVTYPE_LEGS = {}, |
INVTYPE_WEAPONMAINHAND = {}, |
INVTYPE_RANGED = {}, |
INVTYPE_WEAPONOFFHAND = {}, |
INVTYPE_WEAPON = {}, |
INVTYPE_SHIELD = {}, |
INVTYPE_2HWEAPON = {}, |
INVTYPE_RANGEDRIGHT = {}, |
INVTYPE_SHOULDER = {}, |
INVTYPE_WRIST = {} |
}, |
Gems = |
{ |
Red = { 39999, 39997 }, |
Yellow = { 40014 }, |
Blue = {}, |
Orange = { 40053, 40044, 40052, 40043 }, |
Purple = { 40030, 40029, 40024, 40023 }, |
Green = { 40100, 40088, 40096, 40086 }, |
Prismatic = {}, |
Meta = { 41398 }, |
RedYellowBlue = { 42702 }, |
JewelCraft = { 36766, 42156 } |
} |
}, |
["Hunter-Survial"] = |
{ |
Class = "Hunter", |
Spec = "Survival", |
Type = "DPS", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = { 60663 }, |
INVTYPE_CHEST = { 60692, 44623 }, |
INVTYPE_FEET = { 60763, 44589, 60623 }, |
INVTYPE_HAND = { 60668, 44488, 44529 }, |
INVTYPE_HEAD = { 59954, 35452 }, |
INVTYPE_LEGS = { 60581, 60582 }, |
INVTYPE_WEAPONMAINHAND = { 59619, 60707, 44633, 27968 }, |
INVTYPE_RANGED = { 61468, 55076, 55135 }, -- bows |
INVTYPE_WEAPONOFFHAND = { 59619, 60707, 44633, 27968 }, |
INVTYPE_WEAPON = { 59619, 60707, 44633, 27968 }, |
INVTYPE_2HWEAPON = { 60691 }, |
INVTYPE_RANGEDRIGHT = { 61468, 55076, 55135 }, -- wands, guns, crossbows |
INVTYPE_SHOULDER = { 59934, 59929 }, |
INVTYPE_WRIST = { 44575 } |
}, |
Gems = |
{ |
Red = { 39997 }, |
Yellow = { 40014 }, |
Blue = {}, |
Orange = { 40044, 40043 }, |
Purple = { 40023 }, |
Green = { 40088, 40086 }, |
Prismatic = {}, |
Meta = { 41398 }, |
RedYellowBlue = { 42702 }, |
JewelCraft = { 42143, 42156 } |
} |
}, |
["Mage-Arcane"] = |
{ |
Class = "Mage", |
Spec = "Arcane", |
Type = "DPS", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
INVTYPE_HAND = {}, |
INVTYPE_HEAD = {}, |
INVTYPE_LEGS = {}, |
INVTYPE_WEAPONMAINHAND = {}, |
INVTYPE_RANGED = {}, |
INVTYPE_WEAPONOFFHAND = {}, |
INVTYPE_WEAPON = {}, |
INVTYPE_SHIELD = {}, |
INVTYPE_2HWEAPON = {}, |
INVTYPE_RANGEDRIGHT = {}, |
INVTYPE_SHOULDER = {}, |
INVTYPE_WRIST = {} |
}, |
Gems = |
{ |
Red = {}, |
Yellow = {}, |
Blue = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Mage-Fire"] = |
}, --Hunter - Beast Mastery |
[10] = |
{ |
Class = "Mage", |
Spec = "Fire", |
Type = "DPS", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Mage-Frost"] = |
}, --Hunter - Marksmanship |
[11] = |
{ |
Class = "Mage", |
Spec = "Frost", |
Type = "DPS", |
Class = "Hunter", |
Spec = "Survival", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
INVTYPE_HAND = {}, |
INVTYPE_HEAD = {}, |
INVTYPE_LEGS = {}, |
INVTYPE_WEAPONMAINHAND = {}, |
INVTYPE_RANGED = {}, |
INVTYPE_WEAPONOFFHAND = {}, |
INVTYPE_WEAPON = {}, |
INVTYPE_SHIELD = {}, |
INVTYPE_2HWEAPON = {}, |
INVTYPE_RANGEDRIGHT = {}, |
INVTYPE_SHOULDER = {}, |
INVTYPE_WRIST = {} |
INVTYPE_HEAD = { 59954, 35452 }, |
INVTYPE_SHOULDER = { 59934, 59929 }, |
INVTYPE_CLOAK = { 60663 } |
}, |
Gems = |
{ |
Red = { 40111, 39996, 41432 }, |
Yellow = { 40125, 40014 }, |
Red = { 39997 }, |
Yellow = { 40014 }, |
Blue = {}, |
Orange = { 40143, 40038 }, |
Purple = { 40129, 40022 }, |
Green = {}, |
Orange = { 40044, 40043 }, |
Purple = { 40023 }, |
Green = { 40088, 40086 }, |
Prismatic = {}, |
Meta = { 41398, 41285 }, |
Meta = { 41398 }, |
RedYellowBlue = { 42702 }, |
JewelCraft = { 42142, 42156 } |
JewelCraft = { 42143, 42156 } |
} |
}, |
["Paladin-Holy"] = |
[12] = |
{ |
Class = "Paladin", |
Spec = "Holy", |
Type = "Heal", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
Purple = {}, |
Green = {}, |
Prismatic = {}, |
Meta = { 41401, 41376, 41333, 41389 }, |
Meta = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Paladin-Protection"] = |
}, --Mage - Arcane |
[13] = |
{ |
Class = "Paladin", |
Spec = "Protection", |
Type = "Tank", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
Purple = {}, |
Green = {}, |
Prismatic = {}, |
Meta = { 41380, 41396, 41377 }, |
RedYellowBlue = { 42702 }, |
Meta = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Paladin-Retribution"] = |
}, --Mage - Fire |
[14] = |
{ |
Class = "Paladin", |
Spec = "Retribution", |
Type = "DPS", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Priest-Discipline"] = |
}, --Mage - Frost |
[15] = |
{ |
Class = "Priest", |
Spec = "Discipline", |
Type = "Heal", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Priest-Holy"] = |
}, --Paladin - Holy (Healing) |
[16] = |
{ |
Class = "Priest", |
Spec = "Holy", |
Type = "Heal", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Priest-Shadow"] = |
}, --Paladin - Protection (Tanking) |
[17] = |
{ |
Class = "Priest", |
Spec = "Shadow", |
Type = "DPS", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Rogue-Assassination"] = |
}, --Paladin - Retribution (DPS) |
[18] = |
{ |
Class = "Rogue", |
Spec = "Assassination", |
Type = "DPS", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Rogue-Combat"] = |
}, --Priest - Discipline (Healing) |
[19] = |
{ |
Class = "Rogue", |
Spec = "Combat", |
Type = "DPS", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Rogue-Subtlety"] = |
}, --Priest - Holy (Healing) |
[20] = |
{ |
Class = "Rogue", |
Spec = "Subtlety", |
Type = "DPS", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Shaman-Elemental"] = |
}, --Priest - Shadow (DPS) |
[21] = |
{ |
Class = "Shaman", |
Spec = "Elemental", |
Type = "DPS", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Shaman-Enhancement"] = |
}, --Rogue |
[22] = |
{ |
Class = "Shaman", |
Spec = "Enhancement", |
Type = "DPS", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Shaman-Restoration"] = |
}, --Shaman - Elemental (DPS) |
[23] = |
{ |
Class = "Shaman", |
Spec = "Restoration", |
Type = "Heal", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Warlock-Affliction"] = |
}, --Shaman - Enhancement (DPS) |
[24] = |
{ |
Class = "Warlock", |
Spec = "Affliction", |
Type = "DPS", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Warlock-Demonology"] = |
}, --Shaman - Restoration (Healing) |
[25] = |
{ |
Class = "Warlock", |
Spec = "Demonology", |
Type = "DPS", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Warlock-Destruction"] = |
}, --Warlock - Affliction |
[26] = |
{ |
Class = "Warlock", |
Spec = "Destruction", |
Type = "DPS", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Warrior-Arms"] = |
}, --Warlock - Demonology |
[27] = |
{ |
Class = "Warrior", |
Spec = "Arms", |
Type = "DPS", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Warrior-Fury"] = |
}, --Warlock - Destruction |
[28] = |
{ |
Class = "Warrior", |
Spec = "Fury", |
Type = "DPS", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
}, |
["Warrior-Protection"] = |
}, --Warrior - Fury (DPS) |
[29] = |
{ |
Class = "Warrior", |
Spec = "Protection", |
Type = "Tank", |
Class = "", |
Spec = "", |
Enchants = |
{ |
INVTYPE_WAIST = { 55655 }, |
INVTYPE_CLOAK = {}, |
INVTYPE_CHEST = {}, |
INVTYPE_FEET = {}, |
RedYellowBlue = {}, |
JewelCraft = {} |
} |
} |
} --Warrior - Protection (Tanking) |
} |
local LibQTip = LibStub("LibQTip-1.0") |
function DirtyGear.GetDBIndex() |
local spent, points = 0, {} |
for i = 1, 3 do |
points[i] = select(3, GetTalentTabInfo(i)) |
if i == 1 or points[i] > points[spent] then |
spent = i |
end |
end |
if points[spent] == 0 then |
return "default" |
end |
local class, spec = UnitClass("player"), select(1, GetTalentTabInfo(spent)) |
if class == "Druid" and GetSpellInfo(GetSpellInfo(16931)) then |
return class.."-"..spec.."-Tank" |
elseif class == "Death Knight" and GetSpellInfo(GetSpellInfo(55129)) then |
return class.."-"..spec.."-Tank" |
end |
return class.."-"..spec |
end |
function DirtyGear.Print(msg) |
if DEFAULT_CHAT_FRAME and msg then |
DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00[DirtyGear]|r "..msg, 1, 1, 1) |
JewelCraft = false |
} |
if not DirtyGear.Tip then |
--DirtyGear.Tip = LibQTip:Acquire("DirtyGearTip") |
DirtyGear.Tip = CreateFrame("GameTooltip", "DirtyGearTip"..id, nil, "GameTooltipTemplate") |
DirtyGear.Tip:SetOwner(UIParent, "ANCHOR_NONE") |
DirtyGear.Tip:SetHyperlink(link) |
total = total + 1 |
end |
end |
--LibQTip:Release(DirtyGear.Tip) |
DirtyGear.Tip:ClearLines() |
DirtyGear.Tip:Hide() |
DirtyGear.Tip = nil |
-- Enchants |
--]] |
DirtyGear.Enchantable.INVTYPE_FINGER = GetSpellInfo(GetSpellInfo(28029)) |
DirtyGear.Enchantable.INVTYPE_RANGEDRIGHT = iType ~= "Wands" and iType ~= "Thrown" |
DirtyGear.Enchantable.INVTYPE_THROWN = iType ~= "Wands" and iType ~= "Thrown" |
if DirtyGear.Enchantable[iEquipLoc] and iLink:match("item:%d+:0") then |
DirtyGear.EquipmentTip:AddHeader("Missing Enchant") |
end |
local DirtyGearDB = DirtyGear.DB[DirtyGear.DBIndex] |
local DirtyGearDB = DirtyGear.DB[11] |
if DirtyGear.Enchantable[iEquipLoc] and DirtyGearDB.Enchants and DirtyGearDB.Enchants[iEquipLoc] then |
DirtyGear.EquipmentTip:AddHeader("Available Enchants") |
for i, value in pairs(DirtyGearDB.Enchants[iEquipLoc]) do |
end |
function DirtyGear.GameTooltip_OnTooltipCleared(self, ...) |
if DirtyGear.EquipmentTip then |
LibQTip:Release(DirtyGear.EquipmentTip) |
DirtyGear.EquipmentTip = nil |
end |
LibQTip:Release(DirtyGear.EquipmentTip) |
DirtyGear.EquipmentTip = nil |
GameTooltip:Hide() |
if DirtyGear.GameTooltip_OnTooltipCleared_Orig then |
return DirtyGear.GameTooltip_OnTooltipCleared_Orig(self, ...) |
function DirtyGear.OnVariablesLoaded() |
DirtyGear.Print("OnEvent:VARIABLES_LOADED") |
DirtyGear.DBIndex = DirtyGear.GetDBIndex() |
if not DirtyGear.DB[DirtyGear.DBIndex] then |
DirtyGear.DBIndex = "default" |
end |
DirtyGear.Hookers() |
end |