function freeze takes nothing returns nothing
local group to_freeze = CreateGroup()
local group frozen = CreateGroup()
local location skill_position = GetSpellTargetLoc()
local unit freeze
call GroupEnumUnitsInRangeOfLoc(frozen,skill_position, 475.0, null) //The number (3rd in the parenthesis) is the spell's radius.
loop
set freeze = FirstOfGroup(to_freeze)
call PauseUnit(freeze,true)
call GroupRemoveUnit(to_freeze,freeze)
call GroupAddUnit(frozen,freeze)
exitwhen IsUnitGroupEmptyBJ(to_freeze) == true
endloop
set freeze = null
call TriggerSleepAction(5.00) //The number specifies the "wait" duration ,thus the freeze duration.
loop
set freeze = FirstOfGroup(frozen)
call PauseUnit(freeze,false)
call GroupRemoveUnit(frozen,freeze)
exitwhen IsUnitGroupEmptyBJ(frozen) == true
endloop
set freeze = null
endfunction
function condition takes nothing returns boolean
return GetSpellAbilityId() == 'A000' //You'll find the spell id by pressing ctrl+D while browsing its category in the Object Editor.
endfunction
function InitTrig_Freeze takes nothing returns nothing
set gg_trg_Freeze = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Freeze, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Freeze, Condition(function condition))
call TriggerAddAction(gg_trg_Freeze, function freeze)
endfunction