Name | Type | is_array | initial_value |
buybutton | dialog | No | |
I | integer | No | |
KoboldQuest | quest | No | |
MainQuest | quest | No | |
Rain | weathereffect | No | |
Thunders | sound | Yes | |
trigtimer | timer | No |
//TESH.scrollpos=0
//TESH.alwaysfold=0
function InitTrig_Init takes nothing returns nothing
local group g = CreateGroup()
local unit u
call SetGameSpeed(MAP_SPEED_FASTEST)
call SetMapFlag(MAP_LOCK_SPEED, true)
call SetPlayerState(Player(12), PLAYER_STATE_NO_CREEP_SLEEP, 0)
set u = FirstOfGroup(g)
call SetFloatGameState(GAME_STATE_TIME_OF_DAY, 24.)
call SetTimeOfDayScale(0.)
set udg_Rain = AddWeatherEffect(bj_mapInitialPlayableArea, 'RLhr')
call SetSkyModel( "Environment\\Sky\\FoggedSky\\FoggedSky.mdl" )
call SetTerrainFogEx(0, 0.00, 3500.00, 0.00, 0.00, 0.00, 0.1)
call StartSound(gg_snd_Rain_hard)
call StopMusic(false)
call PlayMusic(gg_snd_PursuitTheme)
call SetMusicVolume(100)
loop
exitwhen u == null
call UnitWakeUp(u)
call GroupRemoveUnit(g, u)
set u = FirstOfGroup(g)
endloop
call DestroyGroup(g)
set g = null
endfunction
//TESH.scrollpos=12
//TESH.alwaysfold=0
function TS__check takes nothing returns boolean
if GetRandomInt(1, 30-udg_I) == 1 then
set udg_I = 0
return true
endif
set udg_I = udg_I + 1
return false
endfunction
function TS__Thunder takes nothing returns nothing
// I've noticed that 8 of these functions are BJ's, but the code would be really long without them =P
call AbortCinematicFadeBJ()
call CinematicFadeCommonBJ(100, 100, 100, 0.1 * 0.5, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100, 0)
call ContinueCinematicFadeAfterBJ(0.1 * 0.5, 100, 100, 100, 0, "ReplaceableTextures\\CameraMasks\\White_mask.blp")
call FinishCinematicFadeAfterBJ(0.1)
call TriggerSleepAction(0.12)
call StartSound(udg_Thunders[GetRandomInt(0, 4)])
call AbortCinematicFadeBJ()
call CinematicFadeCommonBJ(100, 100, 100, 0.2 * 0.5, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100, 0)
call ContinueCinematicFadeAfterBJ(0.2 * 0.5, 100, 100, 100, 0, "ReplaceableTextures\\CameraMasks\\White_mask.blp")
call FinishCinematicFadeAfterBJ(0.2)
endfunction
function InitTrig_Lightning takes nothing returns nothing
local integer i = 0
set gg_trg_Lightning = CreateTrigger()
call TriggerRegisterTimerEvent(gg_trg_Lightning, 1., true)
call TriggerAddCondition(gg_trg_Lightning, Filter(function TS__check))
call TriggerAddAction(gg_trg_Lightning, function TS__Thunder)
set udg_Thunders[0] = gg_snd_Thunder1
set udg_Thunders[1] = gg_snd_Thunder2
set udg_Thunders[2] = gg_snd_Thunder3
set udg_Thunders[3] = gg_snd_Thunder4
set udg_Thunders[4] = gg_snd_Thunder5
set udg_Thunders[5] = gg_snd_Thunder6
loop
exitwhen i == 4
call SetSoundVolume(udg_Thunders[i], 999)
set i = i + 1
endloop
endfunction