생략된게 좀 있어서 그런지 온전히 가져오지를 못하겠네요.
이 방식에 대해 토론하는 게시글입니다.
그 코드의 전문이 이렇습니다.
function()
-- Set the current time to throttle the amount of iterations
local theTime = GetTime()
-- Set the range to check
local range = 8
-- Set the minimum number of units required to activate
local minUnits = 3
-- Only continue if our last check was atleast 0.25s ago, or we havent checked yet.
if not aura_env.last or aura_env.last < theTime - 0.25 then
-- Set the last check time to now.
aura_env.last = theTime
-- Reset the counter
local counter = 0
-- Iterate the maximum number of nameplates that can be on screen
for i = 1, 40 do
-- Create the UnitID for each nameplate
local unit = "nameplate"..i
-- Check if the unit exists in memory, they are not friendly, and are within range.
if UnitExists(unit) and not UnitIsFriend("player", unit) and WeakAuras.CheckRange(unit, range, "<=") then
-- If we get here, it was all true, so Increment counter
counter = counter + 1
-- If our counter is the min units to activate, we break because we dont care about any further units.
if counter >= minUnits then break end
end
end
-- Set the aura variable for use outside of this object (Not necessary for this but its not a performance loss)
aura_env.targets = counter
end
-- If the number of units at least our minimum number of units, we return true and activate the aura
return aura_env.targets >= minUnits
end
굉장히 친절하게 중간에 주석까지 넣어줘서 만들어줬는데요.
문제는 이 코드만 가지고는 제가 위크오라를 만들 수가 없더라구요.