add GetCurseData function
This commit is contained in:
+3
-3
@@ -1,10 +1,10 @@
|
||||
## Interface: 11200
|
||||
## Title: [|CFF33AAFFSUPERWOW|R] Cursive 1.2.1
|
||||
## Title-zhCN: [|CFF33AAFFSUPERWOW|R] Cursive 1.2.1
|
||||
## Title: [|CFF33AAFFSUPERWOW|R] Cursive 1.3.0
|
||||
## Title-zhCN: [|CFF33AAFFSUPERWOW|R] Cursive 1.3.0
|
||||
## Author: Pepopo
|
||||
## Notes: Uses SuperWoW GUIDs to show units in combat and track curses
|
||||
## Notes-zhCN: 使用SuperWoW的GUID功能来显示战斗中的单位并监视诅咒等
|
||||
## Version: 1.2.1
|
||||
## Version: 1.3.0
|
||||
## SavedVariablesPerCharacter: CursiveDB
|
||||
## X-Embeds: Ace2, FuBarPlugin-2.0, CompostLib, DewDropLib, TabletLib
|
||||
|
||||
|
||||
@@ -135,6 +135,18 @@ Shared debuffs applied by other players will appear greyed out on targets.
|
||||
|
||||
Currently only Faerie Fire is supported as I felt it warranted special handling. It works by looking for other players casting faerie fire and then checking if the mob has the debuff, so if someone refreshes faerie fire and gets resisted it will incorrectly restart the timer. However, it should still correctly remove faerie fire if it falls off that target. I didn't want to impact performance to handle this edge case.
|
||||
|
||||
## Accessing curse data in other addons
|
||||
|
||||
Cursive data can be accessed in other addons
|
||||
|
||||
You can get raw curse data using
|
||||
`Cursive.curses:GetCurseData(spellName, guid)`
|
||||
|
||||
Here's an example that gets the time left on Corruption on the current target:
|
||||
```
|
||||
/run _, guid = UnitExists("target"); local data = Cursive.curses:GetCurseData("Corruption", guid); print(Cursive.curses:TimeRemaining(data))
|
||||
```
|
||||
|
||||
## Important info
|
||||
|
||||
If you have my latest nampower, it will use the SpellInRange function from that to provide improved range checking.
|
||||
|
||||
+11
@@ -438,6 +438,17 @@ function curses:HasAnyCurse(guid)
|
||||
return nil
|
||||
end
|
||||
|
||||
function curses:GetCurseData(spellName, guid)
|
||||
-- convert to lowercase and remove rank
|
||||
local lowercaseSpellNameNoRank = Cursive.utils.GetLowercaseSpellNameNoRank(spellName)
|
||||
|
||||
if curses.guids[guid] and curses.guids[guid][lowercaseSpellNameNoRank] then
|
||||
return curses.guids[guid][lowercaseSpellNameNoRank]
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
function curses:HasCurse(lowercaseSpellNameNoRank, targetGuid, minRemaining)
|
||||
if not minRemaining then
|
||||
minRemaining = 0 -- default to 0
|
||||
|
||||
Reference in New Issue
Block a user