|Go to Page...|
||Thread Tools||Display Modes|
|02-19-13, 08:17 PM||#29|
In your example, while Jixx is still casting Resurrection, endTime refers to the time his cast bar will hit full and the spell will actually be cast. After Jixx has cast Resurrection and Phanx has an accept/cancel dialog box on her screen, endTime refers to the time that dialog box will disappear and Phanx will no longer be able to accept the resurrection.
if LibResInfo:UnitHasIncomingRes(unit) then -- don't bother, someone else's res will get to them first else -- they still need a res end
Here is the basic process:
function lib:UnitHasIncomingRes(unit) if the unit can click "accept" to take a res that was already cast, then: return "PENDING", time the res will stop being available elseif *one* res spell is being cast on the unit, then return "CASTING", time the spell will finish casting, info about the unit casting the spell elseif *more than one* res spell is being cast on the unit, then determine which spell will finish casting first, and return "CASTING", time *that* spell will finish casting, info about the unit casting *that* spell end end
Also, UnitHasIncomingRes and UnitIsCastingRes are different functions that provide information about different things.
UnitHasIncomingRes tells you about the res the specified unit will be able to take first. If they already have a res waiting to be accepted, then it tells you about that res. If they don't have a res waiting to be accepted, then it tells you about the first res spell that will finish casting on them.
UnitIsCastingRes tells you about the res spell being cast by the specified unit, even if the target of that spell already has a res ready to accept and 20 other people are already casting res spells on the same target.
Read the documenation and stop over-thinking it. It works exactly the way the documentation says it works. You don't need to blindly print the callback args and try to figure out what they mean on your own, because they mean exactly what the documentation says they mean.
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addon • Turn any code into an addon • More addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
|WoWInterface » AddOns, Compilations, Macros » Released AddOns » LibResInfo - resurrection info without comms|