JASS:
library LaggHooker initializer Lagghooker_init
globals
private sound LSF
private real ESTSTUCKTIME = -1.0
private real D = 1.0
private integer RegF = 0
private integer RegF2 = 0
endglobals
function GetFreezeTime takes nothing returns real
if ESTSTUCKTIME > 0.0 then
return ESTSTUCKTIME
else
return 0.0
endif
endfunction
function TriggerRegisterFreeze takes trigger T returns event
return TriggerRegisterVariableEvent( T , SCOPE_PRIVATE + "D" , EQUAL , 3.0 )
endfunction
function TriggerRegisterAbsoluteGameFreeze takes trigger T returns event
return TriggerRegisterVariableEvent( T , SCOPE_PRIVATE + "D" , EQUAL , 4.0 )
endfunction
function TriggerRegisterFreezeEnd takes trigger T returns event
return TriggerRegisterVariableEvent( T , SCOPE_PRIVATE + "D" , EQUAL , 0.0 )
endfunction
function TriggerRegisterMinorLagg takes trigger T returns event
return TriggerRegisterVariableEvent( T , SCOPE_PRIVATE + "D" , EQUAL , 2.0 )
endfunction
function hookLagg takes nothing returns nothing
if not GetSoundIsPlaying( LSF ) then
set RegF2 = RegF2 + 1
if RegF2 > 3 then
if ESTSTUCKTIME == -1.0 then
set ESTSTUCKTIME = 0.02
set D = 3.0
set D = 1.0
else
if ESTSTUCKTIME < 10.0 then
set ESTSTUCKTIME = ESTSTUCKTIME + 0.08 + ESTSTUCKTIME / 40.0
else
set D = 4.0
set D = 1.0
endif
endif
endif
set RegF = 0
elseif ESTSTUCKTIME != -1.0 then
set RegF = RegF + 1
if RegF > 1 then
set D = 0.0
set D = 1.0
set ESTSTUCKTIME = -1.0
set RegF = 0
set RegF2 = 0
endif
else
if RegF2 > 1 then
set D = 2.0
set D = 1.0
endif
set RegF2 = 0
endif
call StopSound( LSF , false , false )
call StartSound( LSF )
endfunction
function Lagghooker_init takes nothing returns nothing
if GetExpiredTimer( ) == null then
call TimerStart( CreateTimer( ) , 0.0 , false , function Lagghooker_init )
set LSF = CreateSound( "Sound\\Music\\mp3Music\\Tension.mp3", false, false, false, 10, 10, "" )
call SetSoundDuration( LSF , 100 )
call SetSoundVolume( LSF , 0 )
else
call DestroyTimer( GetExpiredTimer( ) )
call TimerStart( CreateTimer( ) , 0.06 , true , function hookLagg )
call StartSound( LSF )
endif
endfunction
endlibrary
Reward ofc rep and shits.