globals
constant integer DUMMY = 'h003'
boolean AllReady = false
destructable TopGate = gg_dest_LTg1_0104
destructable BottomGate = gg_dest_LTg1_0099
endglobals
library MapSetup initializer onInit
private function Player_Conditions takes nothing returns boolean
return (GetPlayerSlotState(GetFilterPlayer()) == PLAYER_SLOT_STATE_PLAYING) and (GetPlayerController(GetFilterPlayer()) == MAP_CONTROL_USER)
endfunction
private function onInit takes nothing returns nothing
local integer i = 1
local real x = GetRectCenterX(gg_rct_WholeArena)
local real y = GetRectCenterY(gg_rct_WholeArena)
local force Force = CreateForce()
call ForceEnumPlayers(Force, Condition(function Player_Conditions))
set udg_Number_of_Players = CountPlayersInForceBJ(Force)
call DestroyForce(Force)
set Force = null
set udg_Gambler = gg_unit_n013_0006
set udg_Selector[1] = gg_unit_h00K_0008
set udg_Selector[2] = gg_unit_h00K_0010
set udg_Selector[3] = gg_unit_h00K_0011
set udg_Selector[4] = gg_unit_h00K_0012
set udg_Next_Level = gg_unit_h00N_0005
set udg_Cyclone_Spawn[1] = gg_rct_Cyclone1
set udg_Cyclone_Spawn[2] = gg_rct_Cyclone2
set udg_Cyclone_Spawn[3] = gg_rct_Cyclone3
set udg_Cyclone_Spawn[4] = gg_rct_Cyclone4
set udg_Cyclone_Spawn[5] = gg_rct_Cyclone5
set udg_Hero_Type[1] = 'E000'
set udg_Hero_Type[2] = 'H004'
set udg_Hero_Type[3] = 'H008'
set udg_Hero_Type[4] = 'H001'
set udg_Hero_Type[5] = 'H00G'
set udg_Hero_Type[6] = 'H006'
set udg_Hero_Type[7] = 'O003'
set udg_Hero_Type[8] = 'O004'
set udg_Hero_Type[9] = 'U006'
set udg_Normal_Creep_Type[1] = 'h009'
set udg_Normal_Creep_Type[2] = 'h00A'
set udg_Normal_Creep_Type[3] = 'h007'
set udg_Normal_Creep_Type[4] = 'h00D'
set udg_Normal_Creep_Type[5] = 'U007'
set udg_Normal_Creep_Type[6] = 'h00E'
set udg_Normal_Creep_Type[7] = 'h00F'
set udg_Normal_Creep_Type[8] = 'u004'
set udg_Normal_Creep_Type[9] = 'h00I'
set udg_Normal_Creep_Type[10] = 'U00A'
set udg_Normal_Creep_Type[11] = 'n007'
set udg_Normal_Creep_Type[12] = 'o000'
set udg_Normal_Creep_Type[13] = 'o001'
set udg_Normal_Creep_Type[14] = 'u005'
set udg_Normal_Creep_Type[15] = 'N00W'
set udg_Normal_Creep_Type[16] = 'n008'
set udg_Normal_Creep_Type[17] = 'n00A'
set udg_Normal_Creep_Type[18] = 'n00B'
set udg_Normal_Creep_Type[19] = 'n00C'
set udg_Normal_Creep_Type[20] = 'H00L'
set udg_Normal_Creep_Type[21] = 'n00D'
set udg_Normal_Creep_Type[22] = 'n00E'
set udg_Normal_Creep_Type[23] = 'n00F'
set udg_Normal_Creep_Type[24] = 'n00G'
set udg_Normal_Creep_Type[25] = 'U00B'
set udg_Special_Creep_Type[1] = 'h002'
set udg_Special_Creep_Type[2] = 'o002'
set udg_Special_Creep_Type[3] = 'h005'
set udg_Special_Creep_Type[4] = 'o005'
set udg_Special_Creep_Type[5] = 0
set udg_Special_Creep_Type[6] = 'h00B'
set udg_Special_Creep_Type[7] = 'n00H'
set udg_Special_Creep_Type[8] = 'u008'
set udg_Special_Creep_Type[9] = 'h00C'
set udg_Special_Creep_Type[10] = 0
set udg_Special_Creep_Type[11] = 'n00K'
set udg_Special_Creep_Type[12] = 'o006'
set udg_Special_Creep_Type[13] = 'n00L'
set udg_Special_Creep_Type[14] = 'u009'
set udg_Special_Creep_Type[15] = 0
set udg_Special_Creep_Type[16] = 'n00N'
set udg_Special_Creep_Type[17] = 'e001'
set udg_Special_Creep_Type[18] = 'n00M'
set udg_Special_Creep_Type[19] = 'n00O'
set udg_Special_Creep_Type[20] = 0
set udg_Special_Creep_Type[21] = 'n00P'
set udg_Special_Creep_Type[22] = 'n00Q'
set udg_Special_Creep_Type[23] = 'n00R'
set udg_Special_Creep_Type[24] = 'n00S'
set udg_Special_Creep_Type[25] = 0
set udg_Creep_Ability[1] = 'A00U'
set udg_Creep_Ability[2] = 'A013'
set udg_Creep_Ability[3] = 'A01C'
set udg_Creep_Ability[4] = 'A01K'
set udg_Creep_Ability[5] = 0
set udg_Creep_Ability[6] = 'A03J'
set udg_Creep_Ability[7] = 'A03K'
set udg_Creep_Ability[8] = 'A03O'
set udg_Creep_Ability[9] = 'A03P'
set udg_Creep_Ability[10] = 0
set udg_Creep_Ability[11] = 'A03Q'
set udg_Creep_Ability[12] = 'A03R'
set udg_Creep_Ability[13] = 'A03S'
set udg_Creep_Ability[14] = 'A03U'
set udg_Creep_Ability[15] = 0
set udg_Creep_Ability[16] = 'A03Z'
set udg_Creep_Ability[17] = 'A040'
set udg_Creep_Ability[18] = 'S002'
set udg_Creep_Ability[19] = 'A041'
set udg_Creep_Ability[20] = 0
set udg_Creep_Ability[21] = 'A042'
set udg_Creep_Ability[22] = 'A043'
set udg_Creep_Ability[23] = 'A044'
set udg_Creep_Ability[24] = 'A045'
set udg_Creep_Ability[25] = 0
set udg_Special_Ability[1] = "|cffffcc00Headshot|r. Gives a 12 percent per attack to deal 1.75x damage."
set udg_Special_Ability[2] = "|cffffcc00Rage|r. Increases attack speed by 25 percent for 10 seconds."
set udg_Special_Ability[3] = "|cffffcc00Slow|r. Decreases movement speed by 60 percent and attack speed by 20 percent for 10 seconds."
set udg_Special_Ability[4] = "|cffffcc00Bloodlust|r. Increases damage by 10 percent and armour by 3 for 10 seconds."
set udg_Special_Ability[5] = "|cffffcc00Breath of Frost; Frost Armour; Frost Pulse; Ice Aura.|r"
set udg_Special_Ability[6] = "|cffffcc00Smash|r. 15 percent chance per attack to deal 15 bonus damage and stun for 1 second,"
set udg_Special_Ability[7] = "|cffffcc00Faerie Fire|r. Causes the target's armour to be reduced by 3 for 5 seconds."
set udg_Special_Ability[8] = "|cffffcc00Essence of Blight|r. Heals nearby allied units by 10 hit points."
set udg_Special_Ability[9] = "|cffffcc00Blessing|r. Increases attack damage by 15 percent, armour by 5 and HP regen by 3."
set udg_Special_Ability[10] = "|cffffcc00Weakness Aura; Death Coil; Vampire Attack; Frighten.|r"
set udg_Special_Ability[11] = "|cffffcc00Slow Poison|r. Slows movement speed by 50 percent, attack speed by 20 percent and deals 5 damage per second for 5 seconds."
set udg_Special_Ability[12] = "|cffffcc00Voodoo Aura|r. Increases nearby allied units' hit point regeneration by 5HP/s."
set udg_Special_Ability[13] = "|cffffcc00Fireball|r. Throws a fireball, dealing 200 damage and stunning for 0.5 seconds."
set udg_Special_Ability[14] = "|cffffcc00Curse|r. Causes the target to miss on 20 percent of its attacks for 5 seconds."
set udg_Special_Ability[15] = "|cffffcc00Bash; Mighty Stomp; Battle Cry; Confusion.|r"
set udg_Special_Ability[16] = "|cffffcc00Tidal Wave|r. Sends out a giant wave, dealing 300 damage to enemies in a cone."
set udg_Special_Ability[17] = "|cffffcc00Tidal Eruption|r. Blasts a unit, dealing 250 damage and slows movement speed by 30 percent and attack speed by 25 percent. Lasts 5 seconds."
set udg_Special_Ability[18] = "|cffffcc00Endurance Aura|r. Increases attack speeds of nearby allies by 15 percent."
set udg_Special_Ability[19] = "|cffffcc00Pain Aura|r. Increases attack damage of nearby allies by 15 percent."
set udg_Special_Ability[20] = "|cffffcc00Incinerate; Flame Surge; Pillar of Flame; Dodge.|r"
set udg_Special_Ability[21] = "|cffffcc00Chilling Aura|r. Decreases the mana regeneration of nearby enemies by 100 percent."
set udg_Special_Ability[22] = "|cffffcc00Electric Shock|r. Deals 500 damage to the target hero."
set udg_Special_Ability[23] = "|cffffcc00Devotion Aura|r. Increases the armour of nearby allies by 10."
set udg_Special_Ability[24] = "|cffffcc00Heal|r. Restores 200 hit points."
set udg_Special_Ability[25] = "|cffffcc00Summon Demon; Ascendancy; Armegeddon; Flame Lash.|r"
set udg_Boss_Speech[1] = "|cffffcc00Lich:|r You should see the skeletons in |cffff0000my|r closet!"
set udg_Boss_Speech[2] = "|cffffcc00Death Knight:|r Don't touch me - I'm evil!"
set udg_Boss_Speech[3] = "|cffffcc00Warlock:|r You know what burns my ass? A flame about this high!"
set udg_Boss_Speech[4] = "|cffffcc00Cyclone Invoker:|r If you don't master your anger, your anger will master you...I should know."
set udg_Boss_Speech[5] = "|cffffcc00Archimonde:|r The Scourge will devour all!"
set udg_Boss_Ability[1] = 'A02L'
set udg_Boss_Ability[2] = 'A02M'
set udg_Boss_Ability[3] = 'A02R'
set udg_Boss_Ability[4] = 'S001'
set udg_Boss_Ability[5] = 'A03V'
set udg_Boss_Ability[6] = 'A03W'
set udg_Boss_Ability[7] = 'A03X'
set udg_Boss_Ability[8] = 'A03Y'
set udg_Boss_Ability[9] = 'A011'
set udg_Boss_Ability[10] = 'A04P'
set udg_Boss_Ability[11] = 'A04R'
set udg_Boss_Ability[12] = 'A04B'
set udg_Boss_Ability[13] = 'A04U'
set udg_Boss_Ability[14] = 'A04W'
set udg_Boss_Ability[15] = 'A04D'
set udg_Boss_Ability[16] = 'A050'
set udg_Boss_Ability[17] = 'A047'
set udg_Boss_Ability[18] = 'A048'
set udg_Boss_Ability[19] = 'A04N'
set udg_Boss_Ability[20] = 'A04O'
set udg_Level_Sound[1] = gg_snd_Level1
set udg_Level_Sound[2] = gg_snd_Level2
set udg_Level_Sound[3] = gg_snd_Level3
set udg_Level_Sound[4] = gg_snd_Level4
set udg_Level_Sound[5] = gg_snd_Level5BOSS
set udg_Level_Sound[6] = gg_snd_Level6
set udg_Level_Sound[7] = gg_snd_Level7
set udg_Level_Sound[8] = gg_snd_Level8
set udg_Level_Sound[9] = gg_snd_Level9
set udg_Level_Sound[10] = gg_snd_Level10BOSS
set udg_Level_Sound[11] = gg_snd_Level11
set udg_Level_Sound[12] = gg_snd_Level12
set udg_Level_Sound[13] = gg_snd_Level13
set udg_Level_Sound[14] = gg_snd_Level14
set udg_Level_Sound[15] = gg_snd_Level15BOSS
set udg_Level_Sound[16] = gg_snd_Level16
set udg_Level_Sound[17] = gg_snd_Level17
set udg_Level_Sound[18] = gg_snd_Level18
set udg_Level_Sound[19] = gg_snd_Level19
set udg_Level_Sound[20] = gg_snd_Level20BOSS
set udg_Level_Sound[21] = gg_snd_Level21
set udg_Level_Sound[22] = gg_snd_Level22
set udg_Level_Sound[23] = gg_snd_Level23
set udg_Level_Sound[24] = gg_snd_Level24
set udg_Level_Sound[25] = gg_snd_Level25BOSS
call SetPlayerState(Player(11), PLAYER_STATE_GIVES_BOUNTY, 1)
call SetPlayerName(Player(0), "|cffFF0202" + GetPlayerName(Player(0)) + "|r")
call SetPlayerName(Player(1), "|cff0041FF" + GetPlayerName(Player(1)) + "|r")
call SetPlayerName(Player(2), "|cff1BE5B8" + GetPlayerName(Player(2)) + "|r")
call SetPlayerName(Player(3), "|cff530080" + GetPlayerName(Player(3)) + "|r")
call SetPlayerName(Player(9), "|cff7DBEF1" + GetPlayerName(Player(9)) + "|r")
call SetPlayerName(Player(11), "|cff4D2903" + GetPlayerName(Player(11)) + "|r")
call SuspendTimeOfDay(true)
call SetFloatGameState(GAME_STATE_TIME_OF_DAY, 12.00)
call FogMaskEnable(false)
call FogModifierStart(bj_lastCreatedFogModifier)
loop
if (GetPlayerSlotState(Player(i - 1)) != PLAYER_SLOT_STATE_PLAYING) or (GetPlayerController(Player(i - 1)) == MAP_CONTROL_COMPUTER) then
call RemoveUnit(udg_Selector[i])
set udg_Selector[i] = null
endif
exitwhen i == 4
set i = i + 1
endloop
call CinematicFadeBJ(bj_CINEFADETYPE_FADEOUT, 0.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0)
if (IsPlayerInForce(GetLocalPlayer(), bj_FORCE_ALL_PLAYERS) == true) then
call FogModifierStart(bj_lastCreatedFogModifier)
call SetPlayerTechMaxAllowed(GetLocalPlayer(), 'HERO', 1)
call SetPlayerState(GetLocalPlayer(), PLAYER_STATE_RESOURCE_GOLD, (750 + ((4 - udg_Number_of_Players) * 150)))
call SetPlayerAlliance(Player(9), GetLocalPlayer(), ALLIANCE_SHARED_CONTROL, true)
call ClearTextMessages()
endif
call TriggerExecute(gg_trg_Level_Setup)
set udg_DifficultyDummy = CreateUnit(Player(11), DUMMY, x, y, 0)
call RemoveGuardPosition(udg_DifficultyDummy)
call UnitAddAbility(udg_DifficultyDummy, 'A04M')
call SetUnitAbilityLevel(udg_DifficultyDummy, 'A04M', udg_Number_of_Players)
call UnitAddAbility(udg_DifficultyDummy, 'A059')
call SetUnitAbilityLevel(udg_DifficultyDummy, 'A059', udg_Number_of_Players)
call GateState_Open(TopGate)
call SetDestructableInvulnerable(TopGate, true)
call SetDestructableInvulnerable(BottomGate, true)
endfunction
endlibrary