//TESH.scrollpos=6
//TESH.alwaysfold=0
function Wait takes real duration returns nothing
local real end = duration + TimerGetElapsed(udg_GameTimer)
loop
call TriggerSleepAction(duration)
set duration = end - TimerGetElapsed(udg_GameTimer)
exitwhen duration <= 0.00
endloop
endfunction
function CreateSkellies takes integer n returns nothing
local real minX = GetRectMinX(udg_MoveRegion)
local real maxX = GetRectMaxX(udg_MoveRegion)
local real minY = GetRectMinY(udg_MoveRegion)
local real maxY = GetRectMaxY(udg_MoveRegion)
loop
set n = n - 1
call CreateUnit(Player(11), 'uC23', GetRandomReal(minX, maxX), GetRandomReal(minY, maxY), bj_UNIT_FACING)
exitwhen n == 0
endloop
endfunction
function AddToFlameGroup takes nothing returns boolean
call GroupAddUnit(udg_FireDamage, GetFilterUnit())
return false
endfunction
Name | Type | is_array | initial_value |
CameraActive | boolean | No | |
CameraUnit | unit | No | |
CleanedItem | item | Yes | |
CurrentMonsters | integer | Yes | |
DeathVis | fogmodifier | No | |
EnableSpawners | boolean | Yes | |
FireDamage | group | No | |
FlameDamageTimer | timer | No | |
FlamePhase | integer | No | |
Frequencies | integer | Yes | |
GameTimer | timer | No | |
HeavenTimer | timer | No | |
HeavenTimerWindow | timerdialog | No | |
HELLTIME | timer | No | |
HellTimeWindow | timerdialog | No | |
InitialFrequencies | integer | Yes | |
iNumCircles | integer | No | 0 |
ItemCleanupFlag | boolean | No | |
ItemCleanupTimer | timer | No | |
ItemsToClean | integer | No | |
Kills | integer | Yes | |
LastCreatedUnitGroup | group | No | |
LocalPlayer | player | No | |
Loop | integervar | No | |
MaxMonsters | integer | Yes | |
MonsterPoint | location | No | |
MonsterSpawners | unit | Yes | |
MoonKeySFX | effect | No | |
MoveRegion | rect | No | |
NumSpawners | integer | No | |
Sappers1 | group | No | |
SappersDead | boolean | No | |
SpawnFXString | string | No | |
SpawnTypes | unitcode | Yes | |
SPIDERS | group | No | |
SunKeySFX | effect | No | |
TempInteger | integer | No | |
TempItem | item | No | |
TempItemType | itemcode | No | |
TempPlayer | player | No | |
TempPoint | location | No | |
TempPoint0 | location | No | |
TempReal | real | No | |
TempString | string | No | |
TempString0 | string | No | |
TempString1 | string | No | |
TempTank | unit | Yes | |
TempUnit | unit | No | |
TempUnitType | unitcode | No | |
TempX | real | No | |
TempY | real | No | |
TheLeaderBoard | leaderboard | No |
//TESH.scrollpos=0
//TESH.alwaysfold=0
function OnEnterSkills takes nothing returns nothing
local real x = GetRectCenterX(udg_MoveRegion)
local real y = GetRectCenterY(udg_MoveRegion)
local unit u = GetTriggerUnit()
local string s = "stand alternate"
local player p = GetOwningPlayer(u)
call DisplayTextToPlayer(p, 0.00, 0.00, udg_TempString + "\n" + udg_TempString0)
if p == udg_LocalPlayer then
call SetDoodadAnimation(x, y, 100.00, 'XOmr', true, s, false)
endif
loop
call Wait(0.20)
exitwhen not IsUnitInRangeXY(u, x, y, 32.00)
endloop
set s = "stand"
if p == udg_LocalPlayer then
call SetDoodadAnimation(x, y, 100.00, 'XOmr', true, s, false)
endif
set p = null
set u = null
endfunction
//===========================================================================
function InitTrig_Display_Text takes nothing returns nothing
set gg_trg_Display_Text = CreateTrigger()
call TriggerAddAction(gg_trg_Display_Text, function OnEnterSkills)
endfunction
//TESH.scrollpos=20
//TESH.alwaysfold=0
function InitPlayerActions takes player p, unit u returns nothing
call SetPlayerHandicapXP(p, 0.30)
// Dungeon Creatures
call SetPlayerAlliance(p, Player(11), ALLIANCE_PASSIVE, false)
// If a player is playing intialize the variable to that player's wisp, else remove that wisp
if GetPlayerSlotState(p) != PLAYER_SLOT_STATE_PLAYING then
call RemoveUnit(u)
else
call FogModifierStart(CreateFogModifierRect(p, FOG_OF_WAR_VISIBLE, gg_rct_MenuVisibility, true, false))
//The BJ function prevents player from allying with itself
call SetPlayerAllianceStateBJ(p, Player(0), bj_ALLIANCE_ALLIED_VISION)
call SetPlayerAllianceStateBJ(p, Player(1), bj_ALLIANCE_ALLIED_VISION)
call SetPlayerAllianceStateBJ(p, Player(5), bj_ALLIANCE_ALLIED_VISION)
call SetPlayerAllianceStateBJ(p, Player(6), bj_ALLIANCE_ALLIED_VISION)
if udg_LocalPlayer == p then
call SetCameraTargetController(u, 0, 0, false)
call SelectUnit(u, true)
set udg_CameraUnit = u
set udg_CameraActive = true
endif
endif
endfunction
function InitPlayers takes nothing returns nothing
call CameraSetupApplyForceDuration(gg_cam_CamStart1, true, 0)
call SetMapFlag(MAP_LOCK_ALLIANCE_CHANGES, true)
call SetMapFlag(MAP_LOCK_RESOURCE_TRADING, false)
call SetPlayerState(Player(11), PLAYER_STATE_GIVES_BOUNTY, 1)
//Setup interesting GUI Globals
call DestroyGroup(udg_LastCreatedUnitGroup) //GUI vars spawn a new unit group
set udg_LastCreatedUnitGroup = bj_lastCreatedGroup //is never destroyed nor set to a new var
set udg_LocalPlayer = GetLocalPlayer() //Less JASS needed in the future
// Player 1
call InitPlayerActions(Player(0), gg_unit_ewsp_0006)
// Player 2
call InitPlayerActions(Player(1), gg_unit_ewsp_0007)
// Player 6
call InitPlayerActions(Player(5), gg_unit_ewsp_0008)
// Player 7
call InitPlayerActions(Player(6), gg_unit_ewsp_0010)
endfunction
//===========================================================================
function InitTrig_Custom_Script_Init takes nothing returns nothing
call ExecuteFunc("InitPlayers") //no triggeractions needed here
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function LockCamera takes nothing returns nothing
if udg_CameraActive then
call CameraSetupApplyForceDuration(gg_cam_CamStart1, true, 1.00)
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, CameraSetupGetField(gg_cam_CamStart1, CAMERA_FIELD_TARGET_DISTANCE), 1.00)
call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK, CameraSetupGetField(gg_cam_CamStart1, CAMERA_FIELD_ANGLE_OF_ATTACK), 1.00)
call SetCameraField(CAMERA_FIELD_ROLL, CameraSetupGetField(gg_cam_CamStart1, CAMERA_FIELD_ROLL), 1.00)
call SetCameraField(CAMERA_FIELD_ROTATION, CameraSetupGetField(gg_cam_CamStart1, CAMERA_FIELD_ROTATION), 1.00)
call SetCameraTargetController(udg_CameraUnit, 0.00, 0.00, false)
endif
endfunction
//===========================================================================
function InitTrig_Camera_Setup takes nothing returns nothing
call TimerStart(CreateTimer(), 1.00, true, function LockCamera)
endfunction
//TESH.scrollpos=7
//TESH.alwaysfold=0
function MoveAllUnits takes nothing returns boolean
call SetUnitPosition(GetFilterUnit(), udg_TempX, udg_TempY)
return false
endfunction
function Trig_Move_All_Units_Actions takes nothing returns nothing
set udg_TempX = GetRectCenterX(udg_MoveRegion)
set udg_TempY = GetRectCenterY(udg_MoveRegion)
call GroupEnumUnitsOfPlayer(bj_lastCreatedGroup, Player(0), Filter(function MoveAllUnits))
call GroupEnumUnitsOfPlayer(bj_lastCreatedGroup, Player(1), Filter(function MoveAllUnits))
call GroupEnumUnitsOfPlayer(bj_lastCreatedGroup, Player(5), Filter(function MoveAllUnits))
call GroupEnumUnitsOfPlayer(bj_lastCreatedGroup, Player(6), Filter(function MoveAllUnits))
call ExecuteFunc("LockCamera")
endfunction
//===========================================================================
function InitTrig_Move_All_Units takes nothing returns nothing
set gg_trg_Move_All_Units = CreateTrigger()
call TriggerAddAction(gg_trg_Move_All_Units, function Trig_Move_All_Units_Actions)
endfunction