- Joined
- Mar 10, 2009
- Messages
- 5,016
I can't find any buff detector(aura buff) levels here, so I made this one...
Intead of making many buff ID's in the object editor, you could use this...
CREDITS:
- Bribe (for the IMaxBJ info and modular mode)
Intead of making many buff ID's in the object editor, you could use this...
JASS:
/*
===Aura Level Detection v1.2 by Mckill2009
WHAT IS THIS:
- Intead of making many buff ID's in the object editor, you could use this
PARAMETER EXPLANATION and API:
- forUnit (unit) = the unit who has the buff
- auraID (integer) = the BASE unit(spellID) who gives the buff or has the spell
- buffID (integer) = the buff that will be detected
- aoe (real) = if your aura has 900 aoe, this should be 900 as well
- alliedAura (boolean) = checks if it's an aura by ally or enemy
local integer level = GetAuraLevel(forUnit, auraID, buffID, aoe, alliedAura)
CREDITS:
- Bribe (for the IMaxBJ info and modular mode)
*/
library AuraLevel
function GetAuraLevel takes unit forUnit, integer auraID, integer buffID, real aoe, boolean alliedAura returns integer
local unit first
local player owner = GetOwningPlayer(forUnit)
local integer level = 0
if GetUnitAbilityLevel(forUnit, buffID) > 0 then
call GroupEnumUnitsInRange(bj_lastCreatedGroup, GetUnitX(forUnit), GetUnitY(forUnit), aoe, null)
loop
set first = FirstOfGroup(bj_lastCreatedGroup)
exitwhen first == null
if not IsUnitType(first, UNIT_TYPE_DEAD) and IsUnitAlly(first, owner) == alliedAura then
set level = IMaxBJ(level, GetUnitAbilityLevel(first, auraID))
endif
call GroupRemoveUnit(bj_lastCreatedGroup, first)
endloop
endif
set owner = null
return level
endfunction
endlibrary
CREDITS:
- Bribe (for the IMaxBJ info and modular mode)
Attachments
Last edited: