Its ment to create a unit for every alive unit in the area and cast banish on them.
Extra Info: A00S = a modified blizzard spell to show AoE
h00F = my summy unit, all ready has banish (spell costs 0 mana 2 cast)
JASS:
function Trig_choatic_banish_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A00S'
endfunction
function Trig_choatic_banish_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit u2
local location l = GetSpellTargetLoc()
local group g = CreateGroup()
local integer i = GetUnitAbilityLevel(u,'A00S')
set g = GetUnitsInRangeOfLocAll(50+i*50, l)
loop
set u = FirstOfGroup(g)
exitwhen u == null
if(IsUnitAliveBJ(u) == true) then
set u2 = CreateUnitAtLoc(Player(PLAYER_NEUTRAL_AGGRESSIVE),'h00F',l,0)
call IssueTargetOrderBJ( u2, "banish", u )
call UnitApplyTimedLife(u2,'BTLF', 15)
endif
call GroupRemoveUnit(g,u)
endloop
call RemoveLocation(l)
call DestroyGroup(g)
set u = null
set u2 = null
endfunction
//===========================================================================
function InitTrig_choatic_banish takes nothing returns nothing
set gg_trg_choatic_banish = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_choatic_banish, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_choatic_banish, Condition( function Trig_choatic_banish_Conditions ) )
call TriggerAddAction( gg_trg_choatic_banish, function Trig_choatic_banish_Actions )
endfunction
Extra Info: A00S = a modified blizzard spell to show AoE
h00F = my summy unit, all ready has banish (spell costs 0 mana 2 cast)