Magentix
if (OP.statement == false) postCount++;
- Reaction score
- 107
Short library with only one function: IsUnitDummy()
Just implement it into your map, change the config and whenever
you need to damage units in an AoE with a custom spell,
use isUnitDummy() to check if the unit is a dummy caster, missle or whatever...
Just implement it into your map, change the config and whenever
you need to damage units in an AoE with a custom spell,
use isUnitDummy() to check if the unit is a dummy caster, missle or whatever...
JASS:
// *******************************************************
// *******************************************************
// ** **
// ** IsUnitDummy() By Magentix **
// ** **
// *******************************************************
// *******************************************************
// ** **
// ** Allows you to easily check if a unit is **
// ** a dummy caster, missile or effect unit. **
// ** **
// ** Common use would be in custom spells **
// ** when validating which units to damage **
// ** **
// ** Configure the dummies below: **
// ** **
//! textmacro SetDummyCheckerData
set DUMMY_AMOUNT = 3
set DUMMY_ID[0] = 039;n000039;
set DUMMY_ID[1] = 039;n001039;
set DUMMY_ID[2] = 039;n002039;
// etc.
//! endtextmacro
// ** **
// ** Don't change anything past this point. **
// ** Credit isn't required, but would be appreciated. **
// ** **
// *******************************************************
// *******************************************************
library DummyChecker initializer Init
globals
private integer array DUMMY_ID
private integer DUMMY_AMOUNT
endglobals
function IsUnitDummy takes unit u returns boolean
local integer i = 0
local integer UnitID = GetUnitTypeId(u)
loop
exitwhen i > DUMMY_AMOUNT
if UnitID == DUMMY_ID<i> then
return true
endif
set i = i + 1
endloop
return false
endfunction
private function Init takes nothing returns nothing
//! runtextmacro SetDummyCheckerData()
endfunction
endlibrary
</i>