Originally Posted by SDPhantom
Here's a drycoded example of how I can see this working. Without access to unique mob IDs, this can run into problems of false triggering.
Lua Code:
local TargetTimeout=5000; local function OnTimeout() if DoesUnitExist("reticleover") and GetUnitReaction("reticleover")==UNIT_REACTION_HOSTILE and ArePlayerWeaponsSheathed() then TogglePlayerWield(); end EVENT_MANAGER:UnregisterForUpdate("AutoDraw"); end EVENT_MANAGER:RegisterForEvent("AutoDraw",EVENT_RETICLE_TARGET_CHANGED,function() EVENT_MANAGER[(DoesUnitExist("reticleover") and GetUnitReaction("reticleover")==UNIT_REACTION_HOSTILE) and "RegisterForUpdate" or "UnregisterForUpdate"](EVENT_MANAGER,"AutoDraw",TargetTimeout,OnTimeout); end);
|
Sorry for not getting back to you sooner, thank you very much! I'll be honest, I don't really care too much about false positives in this, because drawing my weapon is never really much of an inconvenience (that I know of, anyway), compared to not drawing it when [s]I'm stupid[/s] I forget, so don't get that first light attack, and then screw up the flow of weaving for a few more.