Skip to content

Commit

Permalink
Add SoD weapon skill runes
Browse files Browse the repository at this point in the history
  • Loading branch information
raethkcj committed Jun 29, 2024
1 parent 0e3c8ad commit cfea685
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 118 deletions.
35 changes: 13 additions & 22 deletions RatingBuster.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@ RatingBuster.date = ("$Date: 2008-07-22 15:35:19 +0800 (星期二, 22 七月 200
-----------
local cache = {}
setmetatable(cache, {__mode = "kv"}) -- weak table to enable garbage collection
local function clearCache()
for k in pairs(cache) do
cache[k] = nil
end
end

function RatingBuster:ToggleDebugging()
wipe(cache)
end

---------------------
-- Local Variables --
Expand Down Expand Up @@ -81,7 +72,7 @@ end
local function setOption(info, value, dataType)
dataType = dataType or "profile"
db[dataType][info[#info]] = value
clearCache()
RatingBuster:ClearCache()
end
local function getGem(info)
return db.profile[info[#info]].gemLink
Expand Down Expand Up @@ -112,7 +103,7 @@ local function setGem(info, value)
gemText = gemText:sub(11)
end
db.profile[info[#info]].gemText = gemText
clearCache()
RatingBuster:ClearCache()
local socket = "EMPTY_SOCKET_" .. info[#info]:sub(7):upper()
if not debugstack():find("AceConsole") then
RatingBuster:Print(L["%s is now set to %s"]:format(_G[socket], link))
Expand All @@ -128,7 +119,7 @@ end
local function setColor(info, r, g, b)
local color = db.global[info[#info]]
color:SetRGB(r, g, b)
clearCache()
RatingBuster:ClearCache()
end

ColorPickerFrame:SetMovable(true)
Expand Down Expand Up @@ -163,8 +154,8 @@ local options = {
name = "Debug",
desc = "Toggle debugging",
func = function()
RatingBuster:ToggleDebugging()
StatLogic:ToggleDebugging()
RatingBuster:ClearCache()
StatLogic:ClearCache()
end,
dialogHidden = true,
},
Expand Down Expand Up @@ -1101,7 +1092,7 @@ local options = {
set = function(info, v)
local db = RatingBuster.db:GetNamespace("AlwaysBuffed")
db.profile[info[#info]] = v
clearCache()
RatingBuster:ClearCache()
StatLogic:InvalidateEvent("UNIT_AURA", "player")
end,
args = {
Expand Down Expand Up @@ -1685,7 +1676,7 @@ PLAYER_LOGIN - Most information about the game world should now be available to
}
--]]
-- OnInitialize(name) called at ADDON_LOADED
function RatingBuster:RefreshConfig()
function RatingBuster:ClearCache()
wipe(cache)
end

Expand All @@ -1696,9 +1687,9 @@ end

function RatingBuster:InitializeDatabase()
RatingBuster.db = LibStub("AceDB-3.0"):New("RatingBusterDB", defaults, class)
RatingBuster.db.RegisterCallback(RatingBuster, "OnProfileChanged", "RefreshConfig")
RatingBuster.db.RegisterCallback(RatingBuster, "OnProfileCopied", "RefreshConfig")
RatingBuster.db.RegisterCallback(RatingBuster, "OnProfileReset", "RefreshConfig")
RatingBuster.db.RegisterCallback(RatingBuster, "OnProfileChanged", "ClearCache")
RatingBuster.db.RegisterCallback(RatingBuster, "OnProfileCopied", "ClearCache")
RatingBuster.db.RegisterCallback(RatingBuster, "OnProfileReset", "ClearCache")
db = RatingBuster.db

options.args.profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(RatingBuster.db)
Expand Down Expand Up @@ -1750,7 +1741,7 @@ function RatingBuster:OnEnable()
-- for setting a new level
self:RegisterEvent("PLAYER_LEVEL_UP")
-- Events that require cache clearing
self:RegisterEvent("CHARACTER_POINTS_CHANGED", clearCache) -- talent point changed
self:RegisterEvent("CHARACTER_POINTS_CHANGED", RatingBuster.ClearCache) -- talent point changed
self:RegisterBucketEvent("UNIT_AURA", 1) -- fire at most once every 1 second
end

Expand All @@ -1762,14 +1753,14 @@ end
-- arg1 = New player level
function RatingBuster:PLAYER_LEVEL_UP(_, newlevel)
playerLevel = newlevel
clearCache()
RatingBuster:ClearCache()
end

-- event = UNIT_AURA
-- arg1 = List of UnitIDs in the AceBucket interval
function RatingBuster:UNIT_AURA(units)
if units.player then
clearCache()
RatingBuster:ClearCache()
end
end

Expand Down
62 changes: 31 additions & 31 deletions libs/StatLogic/Cata_Logic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2466,35 +2466,35 @@ StatLogic.StatModTable["ALL"] = {
{
["value"] = 0.1,
["aura"] = 53646,
["group"] = addon.BuffGroup.SpellPower,
["group"] = addon.ExclusiveGroup.SpellPower,
},
-- Shaman: Totemic Wrath - Buff: 77747
-- 4.0.1: Spell Power increased by 10%.
{
["value"] = 0.1,
["aura"] = 77747,
["group"] = addon.BuffGroup.SpellPower,
["group"] = addon.ExclusiveGroup.SpellPower,
},
-- Shaman: Flametongue Totem - Buff: 52109
-- 4.0.1: Spell Power increased by 6%.
{
["value"] = 0.06,
["aura"] = 52109,
["group"] = addon.BuffGroup.SpellPower,
["group"] = addon.ExclusiveGroup.SpellPower,
},
-- Mage: Arcane Brilliance - Buff: 79058
-- 4.0.1: Spell Power increased by 6%.
{
["value"] = 0.06,
["aura"] = 79058,
["group"] = addon.BuffGroup.SpellPower,
["group"] = addon.ExclusiveGroup.SpellPower,
},
-- Mage: Dalaran Brilliance - Buff: 61316
-- 4.0.1: Spell Power increased by 6%.
{
["value"] = 0.06,
["aura"] = 61316,
["group"] = addon.BuffGroup.SpellPower,
["group"] = addon.ExclusiveGroup.SpellPower,
},
},
["MOD_HEALING"] = {
Expand All @@ -2503,35 +2503,35 @@ StatLogic.StatModTable["ALL"] = {
{
["value"] = 0.1,
["aura"] = 53646,
["group"] = addon.BuffGroup.SpellPower,
["group"] = addon.ExclusiveGroup.SpellPower,
},
-- Shaman: Totemic Wrath - Buff: 77747
-- 4.0.1: Spell Power increased by 10%.
{
["value"] = 0.1,
["aura"] = 77747,
["group"] = addon.BuffGroup.SpellPower,
["group"] = addon.ExclusiveGroup.SpellPower,
},
-- Shaman: Flametongue Totem - Buff: 52109
-- 4.0.1: Spell Power increased by 6%.
{
["value"] = 0.06,
["aura"] = 52109,
["group"] = addon.BuffGroup.SpellPower,
["group"] = addon.ExclusiveGroup.SpellPower,
},
-- Mage: Arcane Brilliance - Buff: 79058
-- 4.0.1: Spell Power increased by 6%.
{
["value"] = 0.06,
["aura"] = 79058,
["group"] = addon.BuffGroup.SpellPower,
["group"] = addon.ExclusiveGroup.SpellPower,
},
-- Mage: Dalaran Brilliance - Buff: 61316
-- 4.0.1: Spell Power increased by 6%.
{
["value"] = 0.06,
["aura"] = 61316,
["group"] = addon.BuffGroup.SpellPower,
["group"] = addon.ExclusiveGroup.SpellPower,
},
},
["MOD_ARMOR"] = {
Expand All @@ -2554,7 +2554,7 @@ StatLogic.StatModTable["ALL"] = {
{
["value"] = 0.1,
["aura"] = 19506,
["group"] = addon.BuffGroup.AttackPower,
["group"] = addon.ExclusiveGroup.AttackPower,
},
-- Death Knight: Abomination's Might - Buff: 55972
-- 4.0.1: Attack power increased by 5/10%.
Expand All @@ -2563,7 +2563,7 @@ StatLogic.StatModTable["ALL"] = {
0.05, 0.1,
},
["aura"] = 55972,
["group"] = addon.BuffGroup.AttackPower,
["group"] = addon.ExclusiveGroup.AttackPower,
},
-- Shaman: Unleashed Rage - Buff: 30809
-- 4.0.1: Melee attack power increased by 4/7/10%.
Expand All @@ -2572,14 +2572,14 @@ StatLogic.StatModTable["ALL"] = {
0.04, 0.07, 0.1,
},
["aura"] = 30809,
["group"] = addon.BuffGroup.AttackPower,
["group"] = addon.ExclusiveGroup.AttackPower,
},
-- Paladin: Blessing of Might - Buff: 19740
-- 4.0.1: Increasing attack power by 10%.
{
["value"] = 0.1,
["aura"] = 19740,
["group"] = addon.BuffGroup.AttackPower,
["group"] = addon.ExclusiveGroup.AttackPower,
},
},
["MOD_MANA"] = {
Expand Down Expand Up @@ -2614,28 +2614,28 @@ StatLogic.StatModTable["ALL"] = {
{
["value"] = 0.05,
["aura"] = 20217,
["group"] = addon.BuffGroup.AllStats,
["group"] = addon.ExclusiveGroup.AllStats,
},
-- Druid: Mark of the Wild - Buff: 79061
-- 4.0.1: Strength, Agility, Stamina, and Intellect increased by 5%.
{
["value"] = 0.05,
["aura"] = 79061,
["group"] = addon.BuffGroup.AllStats,
["group"] = addon.ExclusiveGroup.AllStats,
},
-- Hunter: Embrace of the Shale Spider - Buff: 90363
-- 4.0.1: Strength, Agility, Stamina, and Intellect increased by 5%.
{
["value"] = 0.05,
["aura"] = 90363,
["group"] = addon.BuffGroup.AllStats,
["group"] = addon.ExclusiveGroup.AllStats,
},
-- Leatherworking: Blessing of Forgotten Kings - Buff: 69378
-- 4.0.1: Strength, Agility, Stamina, and Intellect increased by 4%.
{
["value"] = 0.04,
["aura"] = 69378,
["group"] = addon.BuffGroup.AllStats,
["group"] = addon.ExclusiveGroup.AllStats,
},
},
["MOD_AGI"] = {
Expand All @@ -2644,28 +2644,28 @@ StatLogic.StatModTable["ALL"] = {
{
["value"] = 0.05,
["aura"] = 20217,
["group"] = addon.BuffGroup.AllStats,
["group"] = addon.ExclusiveGroup.AllStats,
},
-- Druid: Mark of the Wild - Buff: 79061
-- 4.0.1: Strength, Agility, Stamina, and Intellect increased by 5%.
{
["value"] = 0.05,
["aura"] = 79061,
["group"] = addon.BuffGroup.AllStats,
["group"] = addon.ExclusiveGroup.AllStats,
},
-- Hunter: Embrace of the Shale Spider - Buff: 90363
-- 4.0.1: Strength, Agility, Stamina, and Intellect increased by 5%.
{
["value"] = 0.05,
["aura"] = 90363,
["group"] = addon.BuffGroup.AllStats,
["group"] = addon.ExclusiveGroup.AllStats,
},
-- Leatherworking: Blessing of Forgotten Kings - Buff: 69378
-- 4.0.1: Strength, Agility, Stamina, and Intellect increased by 4%.
{
["value"] = 0.04,
["aura"] = 69378,
["group"] = addon.BuffGroup.AllStats,
["group"] = addon.ExclusiveGroup.AllStats,
},
},
["MOD_STA"] = {
Expand All @@ -2674,28 +2674,28 @@ StatLogic.StatModTable["ALL"] = {
{
["value"] = 0.05,
["aura"] = 20217,
["group"] = addon.BuffGroup.AllStats,
["group"] = addon.ExclusiveGroup.AllStats,
},
-- Druid: Mark of the Wild - Buff: 79061
-- 4.0.1: Strength, Agility, Stamina, and Intellect increased by 5%.
{
["value"] = 0.05,
["aura"] = 79061,
["group"] = addon.BuffGroup.AllStats,
["group"] = addon.ExclusiveGroup.AllStats,
},
-- Hunter: Embrace of the Shale Spider - Buff: 90363
-- 4.0.1: Strength, Agility, Stamina, and Intellect increased by 5%.
{
["value"] = 0.05,
["aura"] = 90363,
["group"] = addon.BuffGroup.AllStats,
["group"] = addon.ExclusiveGroup.AllStats,
},
-- Leatherworking: Blessing of Forgotten Kings - Buff: 69378
-- 4.0.1: Strength, Agility, Stamina, and Intellect increased by 4%.
{
["value"] = 0.04,
["aura"] = 69378,
["group"] = addon.BuffGroup.AllStats,
["group"] = addon.ExclusiveGroup.AllStats,
},
},
["MOD_INT"] = {
Expand All @@ -2704,28 +2704,28 @@ StatLogic.StatModTable["ALL"] = {
{
["value"] = 0.05,
["aura"] = 20217,
["group"] = addon.BuffGroup.AllStats,
["group"] = addon.ExclusiveGroup.AllStats,
},
-- Druid: Mark of the Wild - Buff: 79061
-- 4.0.1: Strength, Agility, Stamina, and Intellect increased by 5%.
{
["value"] = 0.05,
["aura"] = 79061,
["group"] = addon.BuffGroup.AllStats,
["group"] = addon.ExclusiveGroup.AllStats,
},
-- Hunter: Embrace of the Shale Spider - Buff: 90363
-- 4.0.1: Strength, Agility, Stamina, and Intellect increased by 5%.
{
["value"] = 0.05,
["aura"] = 90363,
["group"] = addon.BuffGroup.AllStats,
["group"] = addon.ExclusiveGroup.AllStats,
},
-- Leatherworking: Blessing of Forgotten Kings - Buff: 69378
-- 4.0.1: Strength, Agility, Stamina, and Intellect increased by 4%.
{
["value"] = 0.04,
["aura"] = 69378,
["group"] = addon.BuffGroup.AllStats,
["group"] = addon.ExclusiveGroup.AllStats,
},
},
["MOD_SPI"] = {
Expand Down Expand Up @@ -2896,7 +2896,7 @@ function StatLogic:GetDodgePerAgi()
-- Talents that modify Agi will not add to posBuff, so we need to calculate baseAgi
-- But Agi from Kings etc. will add to posBuff, so we subtract those if present
for _, case in ipairs(StatLogic.StatModTable["ALL"]["MOD_AGI"]) do
if case.group == addon.BuffGroup.AllStats then
if case.group == addon.ExclusiveGroup.AllStats then
if StatLogic:GetAuraInfo(case.aura) then
modAgi = modAgi - case.value
end
Expand Down
Loading

0 comments on commit cfea685

Please sign in to comment.