function Trig_Mass_Sleep_Conditions takes nothing returns boolean
return GetSpellAbilityId()==’A000’
endfunction
function Trig_Mass_Sleep takes nothing returns nothing
local group g
local unit u
local unit cast
local unit dumb
local location p
set cast = GetTriggerUnit()
set p = GetSpellTargetLoc()
set g = GetUnitsInRangeOfLocAll([insert whatever AoE you want here], p)
set u = FirstOfGroup(g)
loop
exitwhen u==null
set u = FirstOfGroup(g)
if IsUnitEnemy(u, GetOwningPlayer(cast))==true then
call GroupRemoveUnit(g,u)
set dumb = CreateUnitAtLoc(GetOwningPlayer(cast), ‘h000’, GetUnitLoc(u), 0.00)
call IssueTargetOrderBJ(dumb, “sleep”, u)
call UnitApplyTimedLifeBJ (1.50, ‘BTLF’, dumb)
set dumb = null
endif
endloop
set g = null
set u = null
set cast = null
set p = null
endfunction
function Init_Trig_Mass_sleep takes nothing returns nothing
local trigger t
set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function Trig_Mass_Sleep_Conditions))
call TriggerAddAction(t, function Trig_Mass_Sleep)
endfunction