From 6a4a9fb641635543da31c179364ce4e985b416b6 Mon Sep 17 00:00:00 2001 From: gwetchen Date: Sat, 14 Jun 2025 21:28:57 +0200 Subject: [PATCH] [ add ] option to track other player's faerie fire (#35) * [ add ] option to track other player's faerie fire * [ fix ] typo --- Localization.lua | 2 ++ curses.lua | 25 ++++++++++++++++++++++++- settings.lua | 14 ++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/Localization.lua b/Localization.lua index 228c484..eb92470 100644 --- a/Localization.lua +++ b/Localization.lua @@ -98,6 +98,8 @@ L:RegisterTranslations("enUS", function() ["Not ignored"] = true, ["Ignored Mobs List (Enter to save)"] = true, ["Comma separated list of strings to ignore if found in the unit name"] = true, + ["Shared Faerie Fire"] = true, + ["This will show other player's Faerie Fires as well as your own"] = true, -- spells ["Rank"] = true, diff --git a/curses.lua b/curses.lua index 56d6426..e7172ba 100644 --- a/curses.lua +++ b/curses.lua @@ -165,12 +165,35 @@ Cursive:RegisterEvent("SPELLCAST_CHANNEL_STOP", StopChanneling); Cursive:RegisterEvent("SPELLCAST_INTERRUPTED", StopChanneling); Cursive:RegisterEvent("SPELLCAST_FAILED", StopChanneling); + +local FaerieFire = { + [770] = true, --r1 + [778] = true, --r2 + [9749] = true, --r3 + [9907] = true, --r4 + + [16855] = true, --bear r1 + [17387] = true, --bear r2 + [17388] = true, --bear r3 + [17389] = true, --bear r4 + + [16857] = true, --cat r1 + [17390] = true, --cat r2 + [17391] = true, --cat r3 + [17392] = true, --cat r4 +} + Cursive:RegisterEvent("UNIT_CASTEVENT", function(casterGuid, targetGuid, event, spellID, castDuration) -- immolate will fire both start and cast if event == "CAST" then local _, guid = UnitExists("player") if casterGuid ~= guid then - return + if Cursive.db.profile.sharedFaerieFire and FaerieFire[spellID] then + lastGuid = targetGuid + Cursive:ScheduleEvent("addCurse" .. targetGuid .. curses.trackedCurseIds[spellID].name, curses.ApplyCurse, 0.2, self, spellID, targetGuid, GetTime()) + else + return + end end -- store pending cast diff --git a/settings.lua b/settings.lua index 7ab6df2..4af37c0 100644 --- a/settings.lua +++ b/settings.lua @@ -19,6 +19,7 @@ Cursive:RegisterDefaults("profile", { showraidicons = true, showhealthbar = true, showunitname = true, + sharedFaerieFire = false, alwaysshowcurrenttarget = true, @@ -560,6 +561,19 @@ Cursive.cmdtable = { end end, }, + ["sharedFaerieFire"] = { + type = "toggle", + name = L["Shared Faerie Fire"], + desc = L["This will show other player's Faerie Fires as well as your own"], + order = 10, + get = function() + return Cursive.db.profile.sharedFaerieFire + end, + set = function(v) + Cursive.db.profile.sharedFaerieFire = v + Cursive.UpdateFramesFromConfig() + end, + }, } }