//===========================================================================
// Trigger: TimeStop
// Script Author: Darky27
// Info: Stops the time for 15 Seconds
// only caster can move freely
//===========================================================================
function Trig_Time_Stop_Conditions takes nothing returns boolean
return ( GetUnitTypeId(GetSummonedUnit()) == 'nrdr' )
endfunction
function Trig_Time_Stop_Actions takes nothing returns nothing
local effect TimeStop
local unit target
local group targets = GetUnitsInRectAll(GetPlayableMapRect())
local unit array units
local integer num = 1
local integer i = 1
call RemoveUnit( GetSummonedUnit() )
call SetTimeOfDayScalePercentBJ( 0.00 )
call GroupRemoveUnitSimple( GetSummoningUnit() , targets )
call AddSpecialEffectTargetUnitBJ( "overhead", GetSummoningUnit(), "Abilities\\Spells\\Items\\AIta\\CrystalBallCaster.mdl" )
set TimeStop = GetLastCreatedEffectBJ()
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 3.00, "ReplaceableTextures\\CameraMasks\\DreamFilter_Mask.blp", 100.00, 100.00, 50.00, 10.00 )
call PanCameraToTimedLocForPlayer( Player(0), GetUnitLoc(GetSummoningUnit()), 0.50 )
call TriggerSleepAction( 0.50 )
call SetCameraTargetControllerNoZForPlayer( Player(0), GetSummoningUnit(), 0, 0, false )
loop
set units[num] = GroupPickRandomUnit(targets)
exitwhen units[num] == null
call PauseUnitBJ( true, units[num] )
call SetUnitTimeScalePercent( units[num], 0.00 )
call GroupRemoveUnitSimple( units[num], targets )
set num = num + 1
endloop
call TriggerSleepAction( 15.00 )
loop
exitwhen i > (num - 1)
call SetUnitTimeScalePercent( units[i], 100.00 )
call PauseUnitBJ( false, units[i] )
set i = i + 1
endloop
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 3.00, "ReplaceableTextures\\CameraMasks\\DreamFilter_Mask.blp", 100.00, 100.00, 50.00, 10.00 )
call DestroyEffectBJ( TimeStop )
call ResetToGameCameraForPlayer( Player(0), 0 )
call SetTimeOfDayScalePercentBJ( 100.00 )
endfunction
//===========================================================================
function InitTrig_Time_Stop takes nothing returns nothing
set gg_trg_Time_Stop = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Time_Stop, Player(0), EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddCondition( gg_trg_Time_Stop, Condition( function Trig_Time_Stop_Conditions ) )
call TriggerAddAction( gg_trg_Time_Stop, function Trig_Time_Stop_Actions )
endfunction