/
if total >= 1 then |
updating = ES2timer:GetScript("OnUpdate") |
if updating and not next(ES2messages) then |
debugprint(2,"Timer stopped",1,0,0) |
debugprint(3,"Timer stopped",1,0,0) |
ES2timer:SetScript("OnUpdate",nil) |
EnemyScanner2:Clear() |
end |
local function GetStats(unit) |
-- Unit exists, Unit is a player, and Unit is enemy to you. |
if UnitExists(unit) and UnitIsPlayer(unit) and UnitIsEnemy("player",unit) and (not UnitIsPVPSanctuary("player") or debug.EnemyScanner2) then |
if UnitExists(unit) and UnitIsPlayer(unit) and UnitIsEnemy("player",unit) and (not UnitIsPVPSanctuary("player") or (debug and debug.EnemyScanner2)) then |
local guidsource = UnitGUID(unit) |
local level = UnitLevel(unit) |
local name = UnitName(unit) |
-- Reaction: COMBATLOG_OBJECT_REACTION_HOSTILE 0x00000040 |
-- Controller affiliation: COMBATLOG_OBJECT_AFFILIATION_OUTSIDER 0X00000008 |
-- PLAYER controlled by PLAYER which is REACTION HOSTILE and is OUTSIDER (not in raid or party with you). |
if bit.band(sourceflags,HOSTILEUNITFLAG) == HOSTILEUNITFLAG and (not UnitIsPVPSanctuary("player") or debug.EnemyScanner2) then |
if bit.band(sourceflags,HOSTILEUNITFLAG) == HOSTILEUNITFLAG and (not UnitIsPVPSanctuary("player") or (debug and debug.EnemyScanner2)) then |
-- GUID is missing, exit. |
if guidsource == '' then |