Merge pull request #12 from pepopo978/variable-duration

Variable duration
This commit is contained in:
pepopo978
2024-11-20 13:47:41 -08:00
committed by GitHub
4 changed files with 67 additions and 65 deletions
+1 -1
View File
@@ -167,7 +167,7 @@ L:RegisterTranslations("zhCN", function()
["Same as HIGHEST_HP_RAID_MARK but with RAID_MARK_SQUARE mark prio."] = "与HIGHEST_HP_RAID_MARK相同,但是RAID_MARK_SQUARE标记优先.",
["Same as HIGHEST_HP_RAID_MARK but with INVERSE_RAID_MARK mark prio."] = "与HIGHEST_HP_RAID_MARK相同,但是INVERSE_RAID_MARK标记优先.",
["|cffffcc00Cursive:|cffffaaaa Couldn't find a target to curse."] = "|cffffcc00Cursive:|cffffaaaa 找不到要诅咒的目标.",
["curse_duration_format"] = ".*持续([%d.]+)秒.", -- no idea if this is right
["curse_duration_format"] = ".*持续([%d.]+)秒.", -- no idea if this is right
-- curses
["(.+) fades from (.+)"] = "(.+)效果从(.+)身上消失",
+24 -18
View File
@@ -76,25 +76,23 @@ function curses:LoadCurses()
end
end
function curses:GetCurseDuration(curseSpellID)
if playerClassName == "WARLOCK" and curses.trackedCurseIds[curseSpellID].rapid_deterioration then
-- scan spellbook for duration in case they have haste talent
local nameRank = curses.trackedCurseIds[curseSpellID].name .. "Rank " .. curses.trackedCurseIds[curseSpellID].rank
local spellSlot = curses.trackedCurseNameRanksToSpellSlots[nameRank]
function curses:ScanTooltipForDuration(curseSpellID)
-- scan spellbook for duration in case they have haste talent
local nameRank = curses.trackedCurseIds[curseSpellID].name .. "Rank " .. curses.trackedCurseIds[curseSpellID].rank
local spellSlot = curses.trackedCurseNameRanksToSpellSlots[nameRank]
if spellSlot then
Cursive.core.tooltipScan:SetOwner(Cursive.core.tooltipScan, "ANCHOR_NONE")
Cursive.core.tooltipScan:ClearLines()
Cursive.core.tooltipScan:SetSpell(spellSlot, BOOKTYPE_SPELL)
local numLines = Cursive.core.tooltipScan:NumLines()
if numLines and numLines > 0 then
-- get the last line
local text = getglobal("CursiveTooltipScan" .. "TextLeft" .. numLines):GetText()
if text then
local _, _, duration = string.find(text, L["curse_duration_format"])
if duration then
return tonumber(duration)
end
if spellSlot then
Cursive.core.tooltipScan:SetOwner(Cursive.core.tooltipScan, "ANCHOR_NONE")
Cursive.core.tooltipScan:ClearLines()
Cursive.core.tooltipScan:SetSpell(spellSlot, BOOKTYPE_SPELL)
local numLines = Cursive.core.tooltipScan:NumLines()
if numLines and numLines > 0 then
-- get the last line
local text = getglobal("CursiveTooltipScan" .. "TextLeft" .. numLines):GetText()
if text then
local _, _, duration = string.find(text, L["curse_duration_format"])
if duration then
return tonumber(duration)
end
end
end
@@ -103,6 +101,14 @@ function curses:GetCurseDuration(curseSpellID)
return curses.trackedCurseIds[curseSpellID].duration
end
function curses:GetCurseDuration(curseSpellID)
if curses.trackedCurseIds[curseSpellID].variable_duration then
return curses:ScanTooltipForDuration(curseSpellID)
end
return curses.trackedCurseIds[curseSpellID].duration
end
function curses:ScanGuidForCurse(guid, curseSpellID)
for i = 1, 16 do
local _, _, _, spellID = UnitDebuff(guid, i)
+25 -29
View File
@@ -31,34 +31,34 @@ function getDruidSpells()
[18657] = { name = L["Hibernate"], rank = 2, duration = 30 },
[18658] = { name = L["Hibernate"], rank = 3, duration = 40 },
[5570] = { name = L["Insect Swarm"], rank = 1, duration = 12 },
[24974] = { name = L["Insect Swarm"], rank = 2, duration = 12 },
[24975] = { name = L["Insect Swarm"], rank = 3, duration = 12 },
[24976] = { name = L["Insect Swarm"], rank = 4, duration = 12 },
[24977] = { name = L["Insect Swarm"], rank = 5, duration = 12 },
[5570] = { name = L["Insect Swarm"], rank = 1, duration = 12, variable_duration = true },
[24974] = { name = L["Insect Swarm"], rank = 2, duration = 12, variable_duration = true },
[24975] = { name = L["Insect Swarm"], rank = 3, duration = 12, variable_duration = true },
[24976] = { name = L["Insect Swarm"], rank = 4, duration = 12, variable_duration = true },
[24977] = { name = L["Insect Swarm"], rank = 5, duration = 12, variable_duration = true },
[8921] = { name = L["Moonfire"], rank = 1, duration = 9 },
[8924] = { name = L["Moonfire"], rank = 2, duration = 12 },
[8925] = { name = L["Moonfire"], rank = 3, duration = 12 },
[8926] = { name = L["Moonfire"], rank = 4, duration = 12 },
[8927] = { name = L["Moonfire"], rank = 5, duration = 12 },
[8928] = { name = L["Moonfire"], rank = 6, duration = 12 },
[8929] = { name = L["Moonfire"], rank = 7, duration = 12 },
[9833] = { name = L["Moonfire"], rank = 8, duration = 12 },
[9834] = { name = L["Moonfire"], rank = 9, duration = 12 },
[9835] = { name = L["Moonfire"], rank = 10, duration = 12 },
[8921] = { name = L["Moonfire"], rank = 1, duration = 9, variable_duration = true },
[8924] = { name = L["Moonfire"], rank = 2, duration = 12, variable_duration = true },
[8925] = { name = L["Moonfire"], rank = 3, duration = 12, variable_duration = true },
[8926] = { name = L["Moonfire"], rank = 4, duration = 12, variable_duration = true },
[8927] = { name = L["Moonfire"], rank = 5, duration = 12, variable_duration = true },
[8928] = { name = L["Moonfire"], rank = 6, duration = 12, variable_duration = true },
[8929] = { name = L["Moonfire"], rank = 7, duration = 12, variable_duration = true },
[9833] = { name = L["Moonfire"], rank = 8, duration = 12, variable_duration = true },
[9834] = { name = L["Moonfire"], rank = 9, duration = 12, variable_duration = true },
[9835] = { name = L["Moonfire"], rank = 10, duration = 12, variable_duration = true },
[1822] = { name = L["Rake"], rank = 1, duration = 9 },
[1823] = { name = L["Rake"], rank = 2, duration = 9 },
[1824] = { name = L["Rake"], rank = 3, duration = 9 },
[9904] = { name = L["Rake"], rank = 4, duration = 9 },
[1822] = { name = L["Rake"], rank = 1, duration = 9, variable_duration = true },
[1823] = { name = L["Rake"], rank = 2, duration = 9, variable_duration = true },
[1824] = { name = L["Rake"], rank = 3, duration = 9, variable_duration = true },
[9904] = { name = L["Rake"], rank = 4, duration = 9, variable_duration = true },
[1079] = { name = L["Rip"], rank = 1, duration = 12 },
[9492] = { name = L["Rip"], rank = 2, duration = 12 },
[9493] = { name = L["Rip"], rank = 3, duration = 12 },
[9752] = { name = L["Rip"], rank = 4, duration = 12 },
[9894] = { name = L["Rip"], rank = 5, duration = 12 },
[9896] = { name = L["Rip"], rank = 6, duration = 12 },
[1079] = { name = L["Rip"], rank = 1, duration = 12, variable_duration = true },
[9492] = { name = L["Rip"], rank = 2, duration = 12, variable_duration = true },
[9493] = { name = L["Rip"], rank = 3, duration = 12, variable_duration = true },
[9752] = { name = L["Rip"], rank = 4, duration = 12, variable_duration = true },
[9894] = { name = L["Rip"], rank = 5, duration = 12, variable_duration = true },
[9896] = { name = L["Rip"], rank = 6, duration = 12, variable_duration = true },
[2908] = { name = L["Soothe Animal"], rank = 1, duration = 15 },
[8955] = { name = L["Soothe Animal"], rank = 2, duration = 15 },
@@ -68,10 +68,6 @@ function getDruidSpells()
[6798] = { name = L["Bash"], rank = 2, duration = 3 },
[8983] = { name = L["Bash"], rank = 3, duration = 4 },
[22570] = { name = L["Maim"], rank = 1, duration = 5 },
[49802] = { name = L["Maim"], rank = 2, duration = 5 },
[49803] = { name = L["Maim"], rank = 3, duration = 5 },
[99] = { name = L["Demoralizing Roar"], rank = 1, duration = 30 },
[1735] = { name = L["Demoralizing Roar"], rank = 2, duration = 30 },
[9490] = { name = L["Demoralizing Roar"], rank = 3, duration = 30 },
+17 -17
View File
@@ -1,20 +1,20 @@
local L = AceLibrary("AceLocale-2.2"):new("Cursive")
function getWarlockSpells()
return {
[172] = { name = L["Corruption"], rank = 1, duration = 12, rapid_deterioration = true },
[6222] = { name = L["Corruption"], rank = 2, duration = 15, rapid_deterioration = true },
[6223] = { name = L["Corruption"], rank = 3, duration = 18, rapid_deterioration = true },
[7648] = { name = L["Corruption"], rank = 4, duration = 18, rapid_deterioration = true },
[11671] = { name = L["Corruption"], rank = 5, duration = 18, rapid_deterioration = true },
[11672] = { name = L["Corruption"], rank = 6, duration = 18, rapid_deterioration = true },
[25311] = { name = L["Corruption"], rank = 7, duration = 18, rapid_deterioration = true },
[172] = { name = L["Corruption"], rank = 1, duration = 12, variable_duration = true },
[6222] = { name = L["Corruption"], rank = 2, duration = 15, variable_duration = true },
[6223] = { name = L["Corruption"], rank = 3, duration = 18, variable_duration = true },
[7648] = { name = L["Corruption"], rank = 4, duration = 18, variable_duration = true },
[11671] = { name = L["Corruption"], rank = 5, duration = 18, variable_duration = true },
[11672] = { name = L["Corruption"], rank = 6, duration = 18, variable_duration = true },
[25311] = { name = L["Corruption"], rank = 7, duration = 18, variable_duration = true },
[980] = { name = L["Curse of Agony"], rank = 1, duration = 24, rapid_deterioration = true },
[1014] = { name = L["Curse of Agony"], rank = 2, duration = 24, rapid_deterioration = true },
[6217] = { name = L["Curse of Agony"], rank = 3, duration = 24, rapid_deterioration = true },
[11711] = { name = L["Curse of Agony"], rank = 4, duration = 24, rapid_deterioration = true },
[11712] = { name = L["Curse of Agony"], rank = 5, duration = 24, rapid_deterioration = true },
[11713] = { name = L["Curse of Agony"], rank = 6, duration = 24, rapid_deterioration = true },
[980] = { name = L["Curse of Agony"], rank = 1, duration = 24, variable_duration = true },
[1014] = { name = L["Curse of Agony"], rank = 2, duration = 24, variable_duration = true },
[6217] = { name = L["Curse of Agony"], rank = 3, duration = 24, variable_duration = true },
[11711] = { name = L["Curse of Agony"], rank = 4, duration = 24, variable_duration = true },
[11712] = { name = L["Curse of Agony"], rank = 5, duration = 24, variable_duration = true },
[11713] = { name = L["Curse of Agony"], rank = 6, duration = 24, variable_duration = true },
[603] = { name = L["Curse of Doom"], rank = 1, duration = 60 },
@@ -58,10 +58,10 @@ function getWarlockSpells()
[710] = { name = L["Banish"], rank = 1, duration = 20 },
[18647] = { name = L["Banish"], rank = 2, duration = 30 },
[18265] = { name = L["Siphon Life"], rank = 1, duration = 30, rapid_deterioration = true },
[18879] = { name = L["Siphon Life"], rank = 2, duration = 30, rapid_deterioration = true },
[18880] = { name = L["Siphon Life"], rank = 3, duration = 30, rapid_deterioration = true },
[18881] = { name = L["Siphon Life"], rank = 4, duration = 30, rapid_deterioration = true },
[18265] = { name = L["Siphon Life"], rank = 1, duration = 30, variable_duration = true },
[18879] = { name = L["Siphon Life"], rank = 2, duration = 30, variable_duration = true },
[18880] = { name = L["Siphon Life"], rank = 3, duration = 30, variable_duration = true },
[18881] = { name = L["Siphon Life"], rank = 4, duration = 30, variable_duration = true },
[5782] = { name = L["Fear"], rank = 1, duration = 10 },
[6213] = { name = L["Fear"], rank = 2, duration = 15 },