add new malediction option, refactor more stuff

This commit is contained in:
pepopo978
2026-02-26 12:56:02 -08:00
parent 29e7359ada
commit afd74e167e
6 changed files with 39 additions and 75 deletions
+15 -13
View File
@@ -534,29 +534,31 @@ function curses:GetCurseData(spellName, guid)
return nil
end
function curses:HasCurse(lowercaseSpellNameNoRank, targetGuid, minRemaining)
function curses:HasCurse(lowercaseSpellNameNoRank, targetGuid, minRemaining, malediction)
if not minRemaining then
minRemaining = 0 -- default to 0
end
if malediction == nil then
malediction = 1 -- default to enabled
end
-- handle faerie fire special case
if curses.isDruid and string.find(lowercaseSpellNameNoRank, L["faerie fire"]) then
-- remove (feral) or (bear) from spell name
lowercaseSpellNameNoRank = L["faerie fire"]
end
-- handle malediction for warlocks
if curses.isWarlock and
lowercaseSpellNameNoRank == L["curse of recklessness"] or
lowercaseSpellNameNoRank == L["curse of the elements"] or
lowercaseSpellNameNoRank == L["curse of shadow"] then
-- check if they have malediction
local _, _, _, _, malediction = GetTalentInfo(1, 17)
if malediction > 0 then
lowercaseSpellNameNoRank = L["curse of agony"] -- check for curse of agony instead
end
end
-- handle malediction for warlocks
if curses.isWarlock and malediction ~= 0 and (
lowercaseSpellNameNoRank == L["curse of recklessness"] or
lowercaseSpellNameNoRank == L["curse of the elements"] or
lowercaseSpellNameNoRank == L["curse of shadow"]) then
local _, _, _, _, hasMalediction = GetTalentInfo(1, 17)
if hasMalediction > 0 then
lowercaseSpellNameNoRank = L["curse of agony"]
end
end
if curses.guids[targetGuid] and curses.guids[targetGuid][lowercaseSpellNameNoRank] then
local remaining = Cursive.curses:TimeRemaining(curses.guids[targetGuid][lowercaseSpellNameNoRank])