Name | Type | is_array | initial_value |
Position_Spells | location | Yes | |
random | integer | Yes | |
VarRegion | rect | Yes |
function Trig_Chronosphere_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A01H'
endfunction
function Chronosphere_Group takes nothing returns boolean
return ( GetFilterUnit() != GetTriggerUnit() )
endfunction
function Trig_Chronosphere_Actions takes nothing returns nothing
local integer i=GetUnitAbilityLevel(GetTriggerUnit(),'A01H')
local unit u
local unit v
local real r=1.5+(i*1.5)
local timer t=CreateTimer()
local location l=GetSpellTargetLoc()
local group g
set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()),'u002',GetLocationX(l),GetLocationY(l),bj_UNIT_FACING)
call TriggerSleepAction (0.3)
call UnitApplyTimedLife(u,'BTLF',r)
call SetUnitTimeScalePercent(u,0.00)
set g = GetUnitsInRangeOfLocMatching(425.00, l, Condition(function Chronosphere_Group))
call StartTimerBJ(t,false,r)
loop
exitwhen TimerGetRemaining(t)<=0.0
loop
set v = FirstOfGroup(g)
exitwhen v == null
call GroupRemoveUnit(g,v)
call PauseUnit(v,true)
call SetUnitTimeScalePercent(v,0.00)
endloop
if (TimerGetRemaining(t)<0.8) then
call TriggerSleepAction(0.1)
else
call TriggerSleepAction(0.3)
endif
call DestroyGroup(g)
set g = GetUnitsInRangeOfLocMatching(425.00, l, Condition(function Chronosphere_Group))
endloop
loop
set v = FirstOfGroup(g)
exitwhen v == null
call GroupRemoveUnit(g,v)
call PauseUnit(v,false)
call SetUnitTimeScalePercent(v,100.00)
endloop
call DestroyTimer(t)
set u = null
call RemoveLocation(l)
set l = null
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Chronosphere takes nothing returns nothing
set gg_trg_Chronosphere = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Chronosphere, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Chronosphere, Condition( function Trig_Chronosphere_Conditions ) )
call TriggerAddAction( gg_trg_Chronosphere, function Trig_Chronosphere_Actions )
endfunction