// ***************** FLOAT TEXT MESSAGE *****************
function Trig_FloatText takes string s returns nothing
local texttag text = null
local force f = GetPlayersAll()
local location p = GetRectCenter(gg_rct_float_text)
set p = OffsetLocation(p, 0, -64.00 * udg_text_float_count)
set udg_text_float_count = udg_text_float_count + 1
call CreateTextTagLocBJ( s, p, 0, 6, 100.00, 100.00, 100.00, 0 )
set text = GetLastCreatedTextTag()
call SetTextTagPermanentBJ( text, false )
call SetTextTagLifespanBJ( text, 3.00 )
call SetTextTagVelocityBJ( text, 64, 90 )
call ShowTextTagForceBJ( true, text, f )
call RemoveLocation(p)
call DestroyForce(f)
endfunction
// ***************** ERROR MESSAGE *****************
function Trig_ErrorMessage takes player p, string s returns nothing
set s="\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffff6666"+s+"|r"
if (GetLocalPlayer() == p) then
call ClearTextMessages()
call DisplayTimedTextToPlayer( p, 0.52, 0.96, 2.00, s )
call StartSound( udg_sound_error )
endif
endfunction
// ***************** HINT MESSAGE *****************
function Trig_HintMessage takes player p, string s returns nothing
set s="\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cf66ff666"+s+"|r"
if (GetLocalPlayer() == p) then
call ClearTextMessages()
call DisplayTimedTextToPlayer( p, 0.52, 0.96, 2.00, s )
call StartSound( udg_sound_hint )
endif
endfunction
// ***************** CHECK FOR TYPE INDESTRUCTIBLE BLOCK *****************
function Trig_UnitIsBlockI takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == 'n00J' )
endfunction
// ***************** CHECK FOR HERO *****************
function Trig_UnitIsHero takes nothing returns boolean
return ( IsUnitInGroup(GetFilterUnit(), udg_gameplay_all_heroes) == true )
endfunction
// ***************** REMOVE PICKED UNIT *****************
function Trig_RemovePickedUnit takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
// ***************** KILL PICKED UNIT *****************
function Trig_KillPickedUnit takes nothing returns nothing
call KillUnit( GetEnumUnit() )
endfunction
// ***************** CHECK FOR CLASS ANCIENT *****************
function Trig_UnitIsAncient takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_ANCIENT) == true )
endfunction
// ***************** CHECK FOR BLOCK EXPLOSION *****************
function Trig_BlockExplosion takes nothing returns boolean
local unit u = GetFilterUnit()
local integer ut = GetUnitTypeId(u)
if ( IsUnitType(u, UNIT_TYPE_ANCIENT)) then
return true
else
if ( ut == 'h011') then
return true
endif
endif
return false
endfunction
// ***************** CHECKS FOR NON-GHOST HERO ALIVE *****************
function Trig_HeroAlive takes integer id returns boolean
if( IsUnitAliveBJ(udg_gameplay_hero[id])) then
if( udg_gameplay_hero_ghost[id] == false) then
return true
endif
endif
return false
endfunction
// ***************** STOP PICKED UNIT *****************
function Trig_StopPickedUnit takes nothing returns nothing
call IssueImmediateOrderBJ( GetEnumUnit(), "stop" )
endfunction
// ***************** PAUSE PICKED UNIT *****************
function Trig_PausePickedUnit takes nothing returns nothing
call PauseUnitBJ( true, GetEnumUnit() )
endfunction
// ***************** CHECK FOR TYPE DESTRUCTIBLE BLOCK *****************
function Trig_UnitIsBlockD takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == 'n00C' )
endfunction
// ***************** CHECK FOR ANY PATH BLOCKERS *****************
function Trig_CheckObstructed takes nothing returns boolean
local unit u = GetFilterUnit()
if ( GetUnitTypeId(u) == 'n00K' ) then
return true
endif
if ( GetUnitTypeId(u) == 'n00J' ) then
return true
endif
if ( GetUnitTypeId(u) == 'n00C' ) then
return true
endif
if ( GetUnitTypeId(u) == 'h011' ) then
return true
endif
return false
endfunction
// ***************** CHECK FOR ANY PATH BLOCKERS EXCLUDING POWERUPS *****************
function Trig_CheckObstructed2 takes nothing returns boolean
local unit u = GetFilterUnit()
if ( GetUnitTypeId(u) == 'n00K' ) then
return true
endif
if ( GetUnitTypeId(u) == 'n00J' ) then
return true
endif
if ( GetUnitTypeId(u) == 'n00C' ) then
return true
endif
return false
endfunction
// ***************** CHECK FOR ANY PATH BLOCKERS INCLUDING MOVING OBJECTS *****************
function Trig_CheckObstructed3 takes nothing returns boolean
local unit u = GetFilterUnit()
if ( GetUnitTypeId(u) == 'n00K' ) then
return true
endif
if ( GetUnitTypeId(u) == 'n00J' ) then
return true
endif
if ( GetUnitTypeId(u) == 'n00C' ) then
return true
endif
if ( GetUnitTypeId(u) == 'h011' ) then
return true
endif
if ( GetUnitTypeId(u) == 'h00W' ) then
return true
endif
if ( IsUnitInGroup(u, udg_gameplay_all_heroes) == true) then
return true
endif
return false
endfunction
// ***************** CHECK FOR POWERUP PLACEMENT *****************
function Trig_PowerupPlacement takes nothing returns boolean
local unit u = GetFilterUnit()
if ( GetUnitTypeId(u) == 'n00C' ) then
return true
endif
if ( GetUnitTypeId(u) == 'n00K' ) then
return true
endif
if ( GetUnitTypeId(u) == 'h011' ) then
return true
endif
if ( GetUnitTypeId(u) == 'n00J' ) then
return true
endif
return false
endfunction
// ***************** CHECK FOR BLOCK *****************
function Trig_UnitIsBlock takes nothing returns boolean
local unit u = GetFilterUnit()
if ( GetUnitTypeId(u) == 'n00C' ) then
return true
endif
if ( GetUnitTypeId(u) == 'n00J' ) then
return true
endif
return false
endfunction
Name | Type | is_array | initial_value |
arena_block_d | unit | Yes | |
arena_block_i | unit | Yes | |
arena_blocker_d | unit | Yes | |
arena_blocker_i | unit | Yes | |
arena_blocktype_d | unitcode | Yes | |
arena_blocktype_i | unitcode | Yes | |
arena_environment | trigger | Yes | |
arena_id | integer | No | |
arena_round_count | integer | No | 1 |
arena_round_timer | timer | No | |
arena_round_timer_cd | timer | No | |
arena_round_timerwindow | timerdialog | No | |
arena_suddendeath | trigger | Yes | |
arena_suddendeath_timer | timer | No | |
arena_terraintype | terraintype | Yes | |
gameplay_all_heroes | group | No | |
gameplay_all_players | force | No | |
gameplay_all_units | group | No | |
gameplay_bomb | unit | Yes | |
gameplay_bomb_blocker | unit | Yes | |
gameplay_bomb_capacity | integer | Yes | |
gameplay_bomb_count | integer | Yes | |
gameplay_game_on | boolean | No | false |
gameplay_grid_playable | rect | Yes | |
gameplay_grid_unplayable | rect | Yes | |
gameplay_hero | unit | Yes | |
gameplay_hero_ghost | boolean | Yes | false |
gameplay_hero_poolvalid | boolean | Yes | true |
gameplay_hero_valid | boolean | Yes | true |
gameplay_illuminator_count | integer | Yes | |
gameplay_invisibility_cd | boolean | Yes | false |
gameplay_phoenixegg | unit | Yes | |
gameplay_phoenixegg_blocker | unit | Yes | |
gameplay_phoenixegg_count | integer | Yes | |
gameplay_power | integer | Yes | |
gameplay_powerup | unit | Yes | |
gameplay_powerup_1_amount | integer | Yes | 0 |
gameplay_powerup_2_amount | integer | Yes | 0 |
gameplay_powerup_3_amount | integer | Yes | 0 |
gameplay_sheep | unit | Yes | |
gameplay_sheep_count | integer | Yes | |
gameplay_sheep_id | integer | Yes | 0 |
gameplay_skull_hero | unit | No | |
gameplay_skull_id | integer | No | |
gameplay_skull_player_id | integer | No | |
gameplay_soulprison_count | integer | Yes | |
gameplay_sound_announce | sound | No | |
gameplay_speed | integer | Yes | 350 |
gameplay_teleport_cd | boolean | Yes | false |
gameplay_timeup | boolean | No | false |
gameplay_triggermine_count | integer | Yes | |
player_bomb_capacity | integer | Yes | 1 |
player_death_count | integer | Yes | 0 |
player_draw_count | integer | Yes | 0 |
player_gameplay_lifespan | real | Yes | 3.00 |
player_herotype | unitcode | Yes | h000 |
player_illuminator_capacity | integer | Yes | 0 |
player_invisibility_level | integer | Yes | 0 |
player_kill_count | integer | Yes | 0 |
player_killchain_count | integer | Yes | 0 |
player_name | string | Yes | |
player_phoenixegg_capacity | integer | Yes | 0 |
player_power | integer | Yes | 2 |
player_sheep_capacity | integer | Yes | 0 |
player_soulprison_capacity | integer | Yes | 0 |
player_speed | integer | Yes | 350 |
player_teleport_level | integer | Yes | 0 |
player_throw_level | integer | Yes | 0 |
player_triggermine_capacity | integer | Yes | 0 |
player_win_count | integer | Yes | 0 |
scoreboard_multiboard | multiboard | No | |
scoreboard_temp_force | force | No | |
setting_bounty | real | No | 1.00 |
setting_chaosmode | boolean | No | false |
setting_ghostmode | boolean | No | false |
setting_pattern | boolean | No | false |
setting_powerups | boolean | No | true |
setting_round_count | integer | No | 3 |
setting_round_time | real | No | 180.00 |
setting_shopping | boolean | No | true |
setting_suddendeath | boolean | No | true |
skullswap_index | integer | No | 0 |
skullswap_indexed_unit | unit | Yes | |
sound_error | sound | No | |
sound_hint | sound | No | |
text_float_count | integer | No | 0 |
function Trig_initialization_Actions takes nothing returns nothing
local integer i = 1
local location p = GetRectCenter(gg_rct_grid_playable_066)
local rect r = RectFromCenterSizeBJ(p, 0.00, 0.00)
local unit u = null
// ***************** ARENA SPECIFIC VARIABLES *****************
set udg_arena_environment[0] = gg_trg_environment_blackrock
set udg_arena_environment[1] = gg_trg_environment_northrend
set udg_arena_environment[2] = gg_trg_environment_stranglethorn
set udg_arena_environment[3] = gg_trg_environment_lordaeron
set udg_arena_environment[4] = gg_trg_environment_durotar
set udg_arena_suddendeath[0] = gg_trg_sudden_death_blackrock
set udg_arena_suddendeath[1] = gg_trg_sudden_death_northrend
set udg_arena_suddendeath[2] = gg_trg_sudden_death_stranglethorn
set udg_arena_suddendeath[3] = gg_trg_sudden_death_lordaeron
set udg_arena_suddendeath[4] = gg_trg_sudden_death_durotar
set udg_arena_blocktype_d[0] = 'n002'
set udg_arena_blocktype_d[1] = 'n006'
set udg_arena_blocktype_d[2] = 'n009'
set udg_arena_blocktype_d[3] = 'n00A'
set udg_arena_blocktype_d[4] = 'n00N'
set udg_arena_blocktype_i[0] = 'n001'
set udg_arena_blocktype_i[1] = 'n007'
set udg_arena_blocktype_i[2] = 'n008'
set udg_arena_blocktype_i[3] = 'n00B'
set udg_arena_blocktype_i[4] = 'n00O'
set udg_arena_terraintype[0] = 'Dgrs'
set udg_arena_terraintype[1] = 'Isnw'
set udg_arena_terraintype[2] = 'Zdrg'
set udg_arena_terraintype[3] = 'Ywmb'
set udg_arena_terraintype[4] = 'Zsan'
// ***************** COLOR CODED PLAYERNAMES *****************
set udg_player_name[1] = ( "|cccff0000" + ( GetPlayerName(Player(0)) + "|r" ) )
set udg_player_name[2] = ( "|ccc0000ff" + ( GetPlayerName(Player(1)) + "|r" ) )
set udg_player_name[3] = ( "|ccc00ffff" + ( GetPlayerName(Player(2)) + "|r" ) )
set udg_player_name[4] = ( "|cccff00ff" + ( GetPlayerName(Player(3)) + "|r" ) )
set udg_player_name[5] = ( "|cccffff00" + ( GetPlayerName(Player(4)) + "|r" ) )
// ***************** GRID *****************
set udg_gameplay_grid_playable[0] = gg_rct_grid_playable_000
set udg_gameplay_grid_playable[1] = gg_rct_grid_playable_001
set udg_gameplay_grid_playable[2] = gg_rct_grid_playable_002
set udg_gameplay_grid_playable[3] = gg_rct_grid_playable_003
set udg_gameplay_grid_playable[4] = gg_rct_grid_playable_004
set udg_gameplay_grid_playable[5] = gg_rct_grid_playable_005
set udg_gameplay_grid_playable[6] = gg_rct_grid_playable_006
set udg_gameplay_grid_playable[7] = gg_rct_grid_playable_007
set udg_gameplay_grid_playable[8] = gg_rct_grid_playable_008
set udg_gameplay_grid_playable[9] = gg_rct_grid_playable_009
set udg_gameplay_grid_playable[10] = gg_rct_grid_playable_010
set udg_gameplay_grid_playable[11] = gg_rct_grid_playable_011
set udg_gameplay_grid_playable[12] = gg_rct_grid_playable_012
set udg_gameplay_grid_playable[13] = gg_rct_grid_playable_013
set udg_gameplay_grid_playable[14] = gg_rct_grid_playable_014
set udg_gameplay_grid_playable[15] = gg_rct_grid_playable_015
set udg_gameplay_grid_playable[16] = gg_rct_grid_playable_016
set udg_gameplay_grid_playable[17] = gg_rct_grid_playable_017
set udg_gameplay_grid_playable[18] = gg_rct_grid_playable_018
set udg_gameplay_grid_playable[19] = gg_rct_grid_playable_019
set udg_gameplay_grid_playable[20] = gg_rct_grid_playable_020
set udg_gameplay_grid_playable[21] = gg_rct_grid_playable_021
set udg_gameplay_grid_playable[22] = gg_rct_grid_playable_022
set udg_gameplay_grid_playable[23] = gg_rct_grid_playable_023
set udg_gameplay_grid_playable[24] = gg_rct_grid_playable_024
set udg_gameplay_grid_playable[25] = gg_rct_grid_playable_025
set udg_gameplay_grid_playable[26] = gg_rct_grid_playable_026
set udg_gameplay_grid_playable[27] = gg_rct_grid_playable_027
set udg_gameplay_grid_playable[28] = gg_rct_grid_playable_028
set udg_gameplay_grid_playable[29] = gg_rct_grid_playable_029
set udg_gameplay_grid_playable[30] = gg_rct_grid_playable_030
set udg_gameplay_grid_playable[31] = gg_rct_grid_playable_031
set udg_gameplay_grid_playable[32] = gg_rct_grid_playable_032
set udg_gameplay_grid_playable[33] = gg_rct_grid_playable_033
set udg_gameplay_grid_playable[34] = gg_rct_grid_playable_034
set udg_gameplay_grid_playable[35] = gg_rct_grid_playable_035
set udg_gameplay_grid_playable[36] = gg_rct_grid_playable_036
set udg_gameplay_grid_playable[37] = gg_rct_grid_playable_037
set udg_gameplay_grid_playable[38] = gg_rct_grid_playable_038
set udg_gameplay_grid_playable[39] = gg_rct_grid_playable_039
set udg_gameplay_grid_playable[40] = gg_rct_grid_playable_040
set udg_gameplay_grid_playable[41] = gg_rct_grid_playable_041
set udg_gameplay_grid_playable[42] = gg_rct_grid_playable_042
set udg_gameplay_grid_playable[43] = gg_rct_grid_playable_043
set udg_gameplay_grid_playable[44] = gg_rct_grid_playable_044
set udg_gameplay_grid_playable[45] = gg_rct_grid_playable_045
set udg_gameplay_grid_playable[46] = gg_rct_grid_playable_046
set udg_gameplay_grid_playable[47] = gg_rct_grid_playable_047
set udg_gameplay_grid_playable[48] = gg_rct_grid_playable_048
set udg_gameplay_grid_playable[49] = gg_rct_grid_playable_049
set udg_gameplay_grid_playable[50] = gg_rct_grid_playable_050
set udg_gameplay_grid_playable[51] = gg_rct_grid_playable_051
set udg_gameplay_grid_playable[52] = gg_rct_grid_playable_052
set udg_gameplay_grid_playable[53] = gg_rct_grid_playable_053
set udg_gameplay_grid_playable[54] = gg_rct_grid_playable_054
set udg_gameplay_grid_playable[55] = gg_rct_grid_playable_055
set udg_gameplay_grid_playable[56] = gg_rct_grid_playable_056
set udg_gameplay_grid_playable[57] = gg_rct_grid_playable_057
set udg_gameplay_grid_playable[58] = gg_rct_grid_playable_058
set udg_gameplay_grid_playable[59] = gg_rct_grid_playable_059
set udg_gameplay_grid_playable[60] = gg_rct_grid_playable_060
set udg_gameplay_grid_playable[61] = gg_rct_grid_playable_061
set udg_gameplay_grid_playable[62] = gg_rct_grid_playable_062
set udg_gameplay_grid_playable[63] = gg_rct_grid_playable_063
set udg_gameplay_grid_playable[64] = gg_rct_grid_playable_064
set udg_gameplay_grid_playable[65] = gg_rct_grid_playable_065
set udg_gameplay_grid_playable[66] = gg_rct_grid_playable_066
set udg_gameplay_grid_playable[67] = gg_rct_grid_playable_067
set udg_gameplay_grid_playable[68] = gg_rct_grid_playable_068
set udg_gameplay_grid_playable[69] = gg_rct_grid_playable_069
set udg_gameplay_grid_playable[70] = gg_rct_grid_playable_070
set udg_gameplay_grid_playable[71] = gg_rct_grid_playable_071
set udg_gameplay_grid_playable[72] = gg_rct_grid_playable_072
set udg_gameplay_grid_playable[73] = gg_rct_grid_playable_073
set udg_gameplay_grid_playable[74] = gg_rct_grid_playable_074
set udg_gameplay_grid_playable[75] = gg_rct_grid_playable_075
set udg_gameplay_grid_playable[76] = gg_rct_grid_playable_076
set udg_gameplay_grid_playable[77] = gg_rct_grid_playable_077
set udg_gameplay_grid_playable[78] = gg_rct_grid_playable_078
set udg_gameplay_grid_playable[79] = gg_rct_grid_playable_079
set udg_gameplay_grid_playable[80] = gg_rct_grid_playable_080
set udg_gameplay_grid_playable[81] = gg_rct_grid_playable_081
set udg_gameplay_grid_playable[82] = gg_rct_grid_playable_082
set udg_gameplay_grid_playable[83] = gg_rct_grid_playable_083
set udg_gameplay_grid_playable[84] = gg_rct_grid_playable_084
set udg_gameplay_grid_playable[85] = gg_rct_grid_playable_085
set udg_gameplay_grid_playable[86] = gg_rct_grid_playable_086
set udg_gameplay_grid_playable[87] = gg_rct_grid_playable_087
set udg_gameplay_grid_playable[88] = gg_rct_grid_playable_088
set udg_gameplay_grid_playable[89] = gg_rct_grid_playable_089
set udg_gameplay_grid_playable[90] = gg_rct_grid_playable_090
set udg_gameplay_grid_playable[91] = gg_rct_grid_playable_091
set udg_gameplay_grid_playable[92] = gg_rct_grid_playable_092
set udg_gameplay_grid_playable[93] = gg_rct_grid_playable_093
set udg_gameplay_grid_playable[94] = gg_rct_grid_playable_094
set udg_gameplay_grid_playable[95] = gg_rct_grid_playable_095
set udg_gameplay_grid_playable[96] = gg_rct_grid_playable_096
set udg_gameplay_grid_playable[97] = gg_rct_grid_playable_097
set udg_gameplay_grid_playable[98] = gg_rct_grid_playable_098
set udg_gameplay_grid_playable[99] = gg_rct_grid_playable_099
set udg_gameplay_grid_playable[100] = gg_rct_grid_playable_100
set udg_gameplay_grid_playable[101] = gg_rct_grid_playable_101
set udg_gameplay_grid_playable[102] = gg_rct_grid_playable_102
set udg_gameplay_grid_playable[103] = gg_rct_grid_playable_103
set udg_gameplay_grid_playable[104] = gg_rct_grid_playable_104
set udg_gameplay_grid_playable[105] = gg_rct_grid_playable_105
set udg_gameplay_grid_playable[106] = gg_rct_grid_playable_106
set udg_gameplay_grid_playable[107] = gg_rct_grid_playable_107
set udg_gameplay_grid_playable[108] = gg_rct_grid_playable_108
set udg_gameplay_grid_playable[109] = gg_rct_grid_playable_109
set udg_gameplay_grid_playable[110] = gg_rct_grid_playable_110
set udg_gameplay_grid_playable[111] = gg_rct_grid_playable_111
set udg_gameplay_grid_playable[112] = gg_rct_grid_playable_112
set udg_gameplay_grid_playable[113] = gg_rct_grid_playable_113
set udg_gameplay_grid_playable[114] = gg_rct_grid_playable_114
set udg_gameplay_grid_playable[115] = gg_rct_grid_playable_115
set udg_gameplay_grid_playable[116] = gg_rct_grid_playable_116
set udg_gameplay_grid_playable[117] = gg_rct_grid_playable_117
set udg_gameplay_grid_playable[118] = gg_rct_grid_playable_118
set udg_gameplay_grid_playable[119] = gg_rct_grid_playable_119
set udg_gameplay_grid_playable[120] = gg_rct_grid_playable_120
set udg_gameplay_grid_playable[121] = gg_rct_grid_playable_121
set udg_gameplay_grid_playable[122] = gg_rct_grid_playable_122
set udg_gameplay_grid_playable[123] = gg_rct_grid_playable_123
set udg_gameplay_grid_playable[124] = gg_rct_grid_playable_124
set udg_gameplay_grid_playable[125] = gg_rct_grid_playable_125
set udg_gameplay_grid_playable[126] = gg_rct_grid_playable_126
set udg_gameplay_grid_playable[127] = gg_rct_grid_playable_127
set udg_gameplay_grid_playable[128] = gg_rct_grid_playable_128
set udg_gameplay_grid_playable[129] = gg_rct_grid_playable_129
set udg_gameplay_grid_playable[130] = gg_rct_grid_playable_130
set udg_gameplay_grid_playable[131] = gg_rct_grid_playable_131
set udg_gameplay_grid_playable[132] = gg_rct_grid_playable_132
set udg_gameplay_grid_unplayable[0] = gg_rct_grid_unplayable_000
set udg_gameplay_grid_unplayable[1] = gg_rct_grid_unplayable_001
set udg_gameplay_grid_unplayable[2] = gg_rct_grid_unplayable_002
set udg_gameplay_grid_unplayable[3] = gg_rct_grid_unplayable_003
set udg_gameplay_grid_unplayable[4] = gg_rct_grid_unplayable_004
set udg_gameplay_grid_unplayable[5] = gg_rct_grid_unplayable_005
set udg_gameplay_grid_unplayable[6] = gg_rct_grid_unplayable_006
set udg_gameplay_grid_unplayable[7] = gg_rct_grid_unplayable_007
set udg_gameplay_grid_unplayable[8] = gg_rct_grid_unplayable_008
set udg_gameplay_grid_unplayable[9] = gg_rct_grid_unplayable_009
set udg_gameplay_grid_unplayable[10] = gg_rct_grid_unplayable_010
set udg_gameplay_grid_unplayable[11] = gg_rct_grid_unplayable_011
set udg_gameplay_grid_unplayable[12] = gg_rct_grid_unplayable_012
set udg_gameplay_grid_unplayable[13] = gg_rct_grid_unplayable_013
set udg_gameplay_grid_unplayable[14] = gg_rct_grid_unplayable_014
set udg_gameplay_grid_unplayable[15] = gg_rct_grid_unplayable_015
set udg_gameplay_grid_unplayable[16] = gg_rct_grid_unplayable_016
set udg_gameplay_grid_unplayable[17] = gg_rct_grid_unplayable_017
set udg_gameplay_grid_unplayable[18] = gg_rct_grid_unplayable_018
set udg_gameplay_grid_unplayable[19] = gg_rct_grid_unplayable_019
set udg_gameplay_grid_unplayable[20] = gg_rct_grid_unplayable_020
set udg_gameplay_grid_unplayable[21] = gg_rct_grid_unplayable_021
set udg_gameplay_grid_unplayable[22] = gg_rct_grid_unplayable_022
set udg_gameplay_grid_unplayable[23] = gg_rct_grid_unplayable_023
set udg_gameplay_grid_unplayable[24] = gg_rct_grid_unplayable_024
set udg_gameplay_grid_unplayable[25] = gg_rct_grid_unplayable_025
set udg_gameplay_grid_unplayable[26] = gg_rct_grid_unplayable_026
set udg_gameplay_grid_unplayable[27] = gg_rct_grid_unplayable_027
set udg_gameplay_grid_unplayable[28] = gg_rct_grid_unplayable_028
set udg_gameplay_grid_unplayable[29] = gg_rct_grid_unplayable_029
set udg_gameplay_grid_unplayable[30] = gg_rct_grid_unplayable_030
set udg_gameplay_grid_unplayable[31] = gg_rct_grid_unplayable_031
set udg_gameplay_grid_unplayable[32] = gg_rct_grid_unplayable_032
set udg_gameplay_grid_unplayable[33] = gg_rct_grid_unplayable_033
set udg_gameplay_grid_unplayable[34] = gg_rct_grid_unplayable_034
set udg_gameplay_grid_unplayable[35] = gg_rct_grid_unplayable_035
set udg_gameplay_grid_unplayable[36] = gg_rct_grid_unplayable_036
set udg_gameplay_grid_unplayable[37] = gg_rct_grid_unplayable_037
set udg_gameplay_grid_unplayable[38] = gg_rct_grid_unplayable_038
set udg_gameplay_grid_unplayable[39] = gg_rct_grid_unplayable_039
set udg_gameplay_grid_unplayable[40] = gg_rct_grid_unplayable_040
set udg_gameplay_grid_unplayable[41] = gg_rct_grid_unplayable_041
set udg_gameplay_grid_unplayable[42] = gg_rct_grid_unplayable_042
set udg_gameplay_grid_unplayable[43] = gg_rct_grid_unplayable_043
set udg_gameplay_grid_unplayable[44] = gg_rct_grid_unplayable_044
set udg_gameplay_grid_unplayable[45] = gg_rct_grid_unplayable_045
set udg_gameplay_grid_unplayable[46] = gg_rct_grid_unplayable_046
set udg_gameplay_grid_unplayable[47] = gg_rct_grid_unplayable_047
set udg_gameplay_grid_unplayable[48] = gg_rct_grid_unplayable_048
set udg_gameplay_grid_unplayable[49] = gg_rct_grid_unplayable_049
set udg_gameplay_grid_unplayable[50] = gg_rct_grid_unplayable_050
set udg_gameplay_grid_unplayable[51] = gg_rct_grid_unplayable_051
set udg_gameplay_grid_unplayable[52] = gg_rct_grid_unplayable_052
set udg_gameplay_grid_unplayable[53] = gg_rct_grid_unplayable_053
set udg_gameplay_grid_unplayable[54] = gg_rct_grid_unplayable_054
set udg_gameplay_grid_unplayable[55] = gg_rct_grid_unplayable_055
set udg_gameplay_grid_unplayable[56] = gg_rct_grid_unplayable_056
set udg_gameplay_grid_unplayable[57] = gg_rct_grid_unplayable_057
set udg_gameplay_grid_unplayable[58] = gg_rct_grid_unplayable_058
set udg_gameplay_grid_unplayable[59] = gg_rct_grid_unplayable_059
set udg_gameplay_grid_unplayable[60] = gg_rct_grid_unplayable_060
set udg_gameplay_grid_unplayable[61] = gg_rct_grid_unplayable_061
set udg_gameplay_grid_unplayable[62] = gg_rct_grid_unplayable_062
set udg_gameplay_grid_unplayable[63] = gg_rct_grid_unplayable_063
set udg_gameplay_grid_unplayable[64] = gg_rct_grid_unplayable_064
set udg_gameplay_grid_unplayable[65] = gg_rct_grid_unplayable_065
set udg_gameplay_grid_unplayable[66] = gg_rct_grid_unplayable_066
set udg_gameplay_grid_unplayable[67] = gg_rct_grid_unplayable_067
set udg_gameplay_grid_unplayable[68] = gg_rct_grid_unplayable_068
set udg_gameplay_grid_unplayable[69] = gg_rct_grid_unplayable_069
set udg_gameplay_grid_unplayable[70] = gg_rct_grid_unplayable_070
set udg_gameplay_grid_unplayable[71] = gg_rct_grid_unplayable_071
set udg_gameplay_grid_unplayable[72] = gg_rct_grid_unplayable_072
set udg_gameplay_grid_unplayable[73] = gg_rct_grid_unplayable_073
set udg_gameplay_grid_unplayable[74] = gg_rct_grid_unplayable_074
set udg_gameplay_grid_unplayable[75] = gg_rct_grid_unplayable_075
set udg_gameplay_grid_unplayable[76] = gg_rct_grid_unplayable_076
set udg_gameplay_grid_unplayable[77] = gg_rct_grid_unplayable_077
set udg_gameplay_grid_unplayable[78] = gg_rct_grid_unplayable_078
set udg_gameplay_grid_unplayable[79] = gg_rct_grid_unplayable_079
set udg_gameplay_grid_unplayable[80] = gg_rct_grid_unplayable_080
set udg_gameplay_grid_unplayable[81] = gg_rct_grid_unplayable_081
set udg_gameplay_grid_unplayable[82] = gg_rct_grid_unplayable_082
set udg_gameplay_grid_unplayable[83] = gg_rct_grid_unplayable_083
set udg_gameplay_grid_unplayable[84] = gg_rct_grid_unplayable_084
set udg_gameplay_grid_unplayable[85] = gg_rct_grid_unplayable_085
set udg_gameplay_grid_unplayable[86] = gg_rct_grid_unplayable_086
set udg_gameplay_grid_unplayable[87] = gg_rct_grid_unplayable_087
set udg_gameplay_grid_unplayable[88] = gg_rct_grid_unplayable_088
set udg_gameplay_grid_unplayable[89] = gg_rct_grid_unplayable_089
set udg_gameplay_grid_unplayable[90] = gg_rct_grid_unplayable_090
set udg_gameplay_grid_unplayable[91] = gg_rct_grid_unplayable_091
// ***************** PRELOAD *****************
call Preload("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl")
call Preload("Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl")
call Preload("Objects\\Spawnmodels\\Undead\\UDeathSmall\\UDeathSmall.mdl")
call Preload("Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl")
call Preload("Objects\\Spawnmodels\\Human\\HCancelDeath\\HCancelDeath.mdl")
call Preload("Objects\\Spawnmodels\\Orc\\OrcSmallDeathExplode\\OrcSmallDeathExplode.mdl")
call Preload("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
call Preload("Abilities\\Spells\\Undead\\DarkRitual\\DarkRitualTarget.mdl")
call Preload("Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl")
call Preload("Abilities\\Spells\\Undead\\RaiseSkeletonWarrior\\RaiseSkeleton.mdl")
call Preload("Abilities\\Spells\\Other\\Levelup\\LevelupCaster.mdl")
call Preload("Abilities\\Spells\\Other\\Transmute\\PileofGold.mdl")
call Preload("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl")
call Preload("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTo.mdl")
call Preload("Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.mdl")
call Preload("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl")
call Preload("Abilities\\Spells\\Orc\\FeralSpirit\\feralspirittarget.mdl")
call Preload("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl")
call Preload("ReplaceableTextures\\CameraMasks\\HazeFilter_mask.blp")
call Preload("Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl")
call Preload("Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl")
call Preload("Abilities\\Spells\\Human\\Polymorph\\PolyMorphTarget.mdl")
call Preload("Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl")
call CreateNUnitsAtLoc( 1, 'h016', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call UnitAddAbilityBJ( 'A000', u )
call UnitAddAbilityBJ( 'A00G', u )
call UnitAddAbilityBJ( 'A009', u )
call UnitAddAbilityBJ( 'A007', u )
call UnitAddAbilityBJ( 'A002', u )
call UnitAddAbilityBJ( 'A005', u )
call UnitAddAbilityBJ( 'A00F', u )
call UnitAddAbilityBJ( 'A006', u )
call UnitAddAbilityBJ( 'A004', u )
call UnitAddAbilityBJ( 'A00A', u )
call UnitAddAbilityBJ( 'A00B', u )
call UnitAddAbilityBJ( 'A003', u )
call UnitAddAbilityBJ( 'A008', u )
call UnitAddAbilityBJ( 'A00C', u )
call UnitAddAbilityBJ( 'A001', u )
call UnitAddAbilityBJ( 'A00E', u )
call UnitAddAbilityBJ( 'A00D', u )
// ***************** FORCE *****************
loop
exitwhen i > 5
if ( GetPlayerSlotState(Player(i - 1)) == PLAYER_SLOT_STATE_PLAYING ) then
call SetPlayerStateBJ( Player(i - 1), PLAYER_STATE_RESOURCE_FOOD_USED, 100 )
call SetPlayerStateBJ( Player(i - 1), PLAYER_STATE_RESOURCE_FOOD_CAP, 100 )
call SetPlayerStateBJ( Player(i - 1), PLAYER_STATE_RESOURCE_GOLD, 500 )
call ForceAddPlayerSimple(Player(i - 1), udg_gameplay_all_players )
endif
set i = i + 1
endloop
call DisplayTimedTextToForce( udg_gameplay_all_players, 17,"Map made by |cccff6666jnZane|r (|[email protected]|r)|r")
call DisplayTimedTextToForce( udg_gameplay_all_players, 17," - type |ccc66ff66-commands|r for a list of available commands")
call DisplayTimedTextToForce( udg_gameplay_all_players, 17," ")
// ***************** SOUNDS *****************
set udg_sound_error = gg_snd_error
set udg_sound_hint = gg_snd_hint
// ***************** CAMERA BOUNDS *****************
call SetCameraBoundsToRectForPlayerBJ( Player(0), r )
call SetCameraBoundsToRectForPlayerBJ( Player(1), r )
call SetCameraBoundsToRectForPlayerBJ( Player(2), r )
call SetCameraBoundsToRectForPlayerBJ( Player(3), r )
call SetCameraBoundsToRectForPlayerBJ( Player(4), r )
// ***************** ENVIRONMENT *****************
call FogEnableOff( )
call FogMaskEnableOff( )
call SetTimeOfDay( 12 )
call UseTimeOfDayBJ( false )
// ***************** CREATE MARKET *****************
call ConditionalTriggerExecute( gg_trg_create_market )
call TriggerSleepAction(0.10)
call RemoveUnit(u)
call RemoveLocation(p)
call RemoveRect(r)
call DestroyTrigger(GetTriggeringTrigger())
endfunction
//===========================================================================
function InitTrig_initializations takes nothing returns nothing
set gg_trg_initializations = CreateTrigger( )
call TriggerAddAction( gg_trg_initializations, function Trig_initialization_Actions )
endfunction
function Trig_create_scoreboard_Actions takes nothing returns nothing
call CreateMultiboardBJ( 5, 1, "Scoreboard" )
set udg_scoreboard_multiboard = GetLastCreatedMultiboard()
call MultiboardSetItemStyleBJ( udg_scoreboard_multiboard, 1, 1, false, false )
call MultiboardSetItemStyleBJ( udg_scoreboard_multiboard, 2, 1, false, true )
call MultiboardSetItemStyleBJ( udg_scoreboard_multiboard, 3, 1, false, true )
call MultiboardSetItemStyleBJ( udg_scoreboard_multiboard, 4, 1, false, true )
call MultiboardSetItemStyleBJ( udg_scoreboard_multiboard, 5, 1, false, true )
call MultiboardSetItemWidthBJ( udg_scoreboard_multiboard, 1, 1, 6.30 )
call MultiboardSetItemWidthBJ( udg_scoreboard_multiboard, 2, 1, 2.00 )
call MultiboardSetItemWidthBJ( udg_scoreboard_multiboard, 3, 1, 2.00 )
call MultiboardSetItemWidthBJ( udg_scoreboard_multiboard, 4, 1, 2.00 )
call MultiboardSetItemWidthBJ( udg_scoreboard_multiboard, 5, 1, 2.00 )
call MultiboardSetItemIconBJ( udg_scoreboard_multiboard, 2, 1, "ReplaceableTextures\\CommandButtons\\BTNWin.tga" )
call MultiboardSetItemIconBJ( udg_scoreboard_multiboard, 3, 1, "ReplaceableTextures\\CommandButtons\\BTNDraw.tga" )
call MultiboardSetItemIconBJ( udg_scoreboard_multiboard, 4, 1, "ReplaceableTextures\\CommandButtons\\BTNKill.tga" )
call MultiboardSetItemIconBJ( udg_scoreboard_multiboard, 5, 1, "ReplaceableTextures\\CommandButtons\\BTNDeath.tga" )
call MultiboardAllowDisplayBJ( true )
call ConditionalTriggerExecute( gg_trg_adjust_scoreboard )
call DestroyTrigger(GetTriggeringTrigger())
endfunction
//===========================================================================
function InitTrig_create_scoreboard takes nothing returns nothing
set gg_trg_create_scoreboard = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_create_scoreboard, 0.10 )
call TriggerAddAction( gg_trg_create_scoreboard, function Trig_create_scoreboard_Actions )
endfunction
function Trig_periodic_actions_Actions takes nothing returns nothing
// ***************** CAMERA *****************
call CameraSetupApplyForPlayer( true, gg_cam_game_camera, Player(0), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_game_camera, Player(1), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_game_camera, Player(2), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_game_camera, Player(3), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_game_camera, Player(4), 0 )
// ***************** BOMB PATH BLOCKING *****************
if(udg_gameplay_game_on == true) then
call ConditionalTriggerExecute( gg_trg_bomb_path_blocking )
endif
endfunction
//===========================================================================
function InitTrig_periodic_actions takes nothing returns nothing
set gg_trg_periodic_actions = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_periodic_actions, 0.10 )
call TriggerAddAction( gg_trg_periodic_actions, function Trig_periodic_actions_Actions )
endfunction
function Trig_player_leave_Actions takes nothing returns nothing
local integer id = GetConvertedPlayerId(GetTriggerPlayer())
call ForceRemovePlayerSimple( Player(id - 1), udg_gameplay_all_players )
if(IsUnitAliveBJ(udg_gameplay_hero[id]) ) then
call GroupRemoveUnitSimple( udg_gameplay_hero[id], udg_gameplay_all_heroes )
call RemoveUnit(udg_gameplay_hero[id])
if(udg_gameplay_game_on == true) then
// ***************** END ROUND? *****************
call ConditionalTriggerExecute( gg_trg_round_end )
endif
endif
// ***************** ADJUST SCOREBOARD *****************
call ConditionalTriggerExecute( gg_trg_adjust_scoreboard )
endfunction
//===========================================================================
function InitTrig_player_leave takes nothing returns nothing
set gg_trg_player_leave = CreateTrigger( )
call TriggerRegisterPlayerEventLeave( gg_trg_player_leave, Player(0) )
call TriggerRegisterPlayerEventLeave( gg_trg_player_leave, Player(1) )
call TriggerRegisterPlayerEventLeave( gg_trg_player_leave, Player(2) )
call TriggerRegisterPlayerEventLeave( gg_trg_player_leave, Player(3) )
call TriggerRegisterPlayerEventLeave( gg_trg_player_leave, Player(4) )
call TriggerAddAction( gg_trg_player_leave, function Trig_player_leave_Actions )
endfunction
// ***************** ADD PICKED PLAYER TO FORCE *****************
function Trig_AddPickedToForce takes nothing returns nothing
call ForceAddPlayerSimple( GetEnumPlayer(), udg_scoreboard_temp_force )
endfunction
function Trig_adjust_scoreboard_Actions takes nothing returns nothing
local integer i = 1
local integer ip = 1
local integer ic = 0
call ForForce( udg_gameplay_all_players, function Trig_AddPickedToForce )
set ic = CountPlayersInForceBJ(udg_scoreboard_temp_force)
call MultiboardSetRowCount( udg_scoreboard_multiboard, ic + 1)
loop
exitwhen i > ic
loop
exitwhen( IsPlayerInForce(Player(ip - 1), udg_scoreboard_temp_force) == true )
set ip = ip + 1
endloop
call MultiboardSetItemValueBJ( udg_scoreboard_multiboard, 1, i + 1, SubStringBJ(udg_player_name[ip],1,21) )
call MultiboardSetItemStyleBJ( udg_scoreboard_multiboard, 1, i + 1, true, false )
call MultiboardSetItemWidthBJ( udg_scoreboard_multiboard, 1, i + 1, 6.30 )
call MultiboardSetItemValueBJ( udg_scoreboard_multiboard, 2, i + 1, I2S(udg_player_win_count[ip] ))
call MultiboardSetItemStyleBJ( udg_scoreboard_multiboard, 2, i + 1, true, false )
call MultiboardSetItemWidthBJ( udg_scoreboard_multiboard, 2, i + 1, 2.00 )
call MultiboardSetItemValueBJ( udg_scoreboard_multiboard, 3, i + 1, I2S(udg_player_draw_count[ip] ))
call MultiboardSetItemStyleBJ( udg_scoreboard_multiboard, 3, i + 1, true, false )
call MultiboardSetItemWidthBJ( udg_scoreboard_multiboard, 3, i + 1, 2.00 )
call MultiboardSetItemValueBJ( udg_scoreboard_multiboard, 4, i + 1, I2S(udg_player_kill_count[ip] ))
call MultiboardSetItemStyleBJ( udg_scoreboard_multiboard, 4, i + 1, true, false )
call MultiboardSetItemWidthBJ( udg_scoreboard_multiboard, 4, i + 1, 2.00 )
call MultiboardSetItemValueBJ( udg_scoreboard_multiboard, 5, i + 1, I2S(udg_player_death_count[ip] ))
call MultiboardSetItemStyleBJ( udg_scoreboard_multiboard, 5, i + 1, true, false )
call MultiboardSetItemWidthBJ( udg_scoreboard_multiboard, 5, i + 1, 2.00 )
call ForceRemovePlayerSimple( Player(ip - 1), udg_scoreboard_temp_force )
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_adjust_scoreboard takes nothing returns nothing
set gg_trg_adjust_scoreboard = CreateTrigger( )
call TriggerAddAction( gg_trg_adjust_scoreboard, function Trig_adjust_scoreboard_Actions )
endfunction
function Trig_create_market_Actions takes nothing returns nothing
local location p = GetRectCenter(udg_gameplay_grid_playable[66])
local integer i = 0
local integer d = 0
local integer ivb = 0
local integer ivn = 0
local integer ivs = 0
local integer ivl = 0
local integer ivd = 0
local boolean b = false
local group g = null
local string vote = null
local string arena = null
local unit u = null
call SetTerrainTypeBJ( p, 'Ysqd', -1, 8, 1 )
// ***************** CREATE BLOCKS *****************
loop
exitwhen(i > 3)
if(i == 1) then
set d = 10
else
if(i == 2) then
set d = 120
else
if(i == 3) then
set d = 130
endif
endif
endif
set p = GetRectCenter(udg_gameplay_grid_playable[0 + d])
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_d[i], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set p = GetRectCenter(udg_gameplay_grid_playable[1 + d])
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_i[i], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set p = GetRectCenter(udg_gameplay_grid_playable[2 + d])
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_d[i], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
if(i == 1) then
set d = 6
else
if(i == 2) then
set d = 100
else
if(i == 3) then
set d = 106
endif
endif
endif
set p = GetRectCenter(udg_gameplay_grid_playable[13 + d])
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_i[i], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
if(i == 1) then
set d = 12
else
if(i == 2) then
set d = 80
else
if(i == 3) then
set d = 92
endif
endif
endif
set p = GetRectCenter(udg_gameplay_grid_playable[20 + d])
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_d[i], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
// ***************** CREATE VOTE POINTS *****************
if(i == 1) then
set d = 8
else
if(i == 2) then
set d = 80
else
if(i == 3) then
set d = 88
endif
endif
endif
set p = GetRectCenter(udg_gameplay_grid_playable[22 + d])
call CreateNUnitsAtLoc( 1, 'h00C', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetTerrainTypeBJ( p, udg_arena_terraintype[i], -1, 2, 1 )
if(i == 1) then
set d = 5
else
if(i == 2) then
set d = 50
else
if(i == 3) then
set d = 55
endif
endif
endif
set p = GetRectCenter(udg_gameplay_grid_unplayable[18 + d])
call SetTerrainTypeBJ( p, udg_arena_terraintype[i], -1, 2, 1 )
set i = i + 1
endloop
// ***************** CREATE BLOCKS *****************
set i = 0
loop
exitwhen i > 1
set p = GetRectCenter(udg_gameplay_grid_playable[125 + i * 2])
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_d[4], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set i = i + 1
endloop
set p = GetRectCenter(udg_gameplay_grid_playable[126])
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_i[4], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
// ***************** CREATE VOTE POINTS *****************
set p = GetRectCenter(udg_gameplay_grid_playable[106])
call CreateNUnitsAtLoc( 1, 'h00C', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set p = GetRectCenter(udg_gameplay_grid_playable[106])
call SetTerrainTypeBJ( p, udg_arena_terraintype[4], -1, 2, 1 )
set p = GetRectCenter(udg_gameplay_grid_playable[116])
call SetTerrainTypeBJ( p, udg_arena_terraintype[4], -1, 2, 1 )
// ***************** CREATE SHOPS *****************
if(udg_setting_shopping == true) then
set p = GetRectCenter(udg_gameplay_grid_playable[26])
call CreateNUnitsAtLoc( 1, 'n00D', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set p = GetRectCenter(udg_gameplay_grid_playable[70])
call CreateNUnitsAtLoc( 1, 'n00E', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set p = GetRectCenter(udg_gameplay_grid_playable[62])
call CreateNUnitsAtLoc( 1, 'n00M', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
endif
// ***************** SPAWN HEROES *****************
set p = GetRectCenter(udg_gameplay_grid_playable[66])
set i = 1
loop
exitwhen i > 5
if ( IsPlayerInForce(Player(i - 1), udg_gameplay_all_players) == true ) then
call CreateNUnitsAtLoc( 1, udg_player_herotype[i], Player(i - 1), p, bj_UNIT_FACING )
set udg_gameplay_hero[i] = GetLastCreatedUnit()
call GroupAddUnitSimple( udg_gameplay_hero[i], udg_gameplay_all_heroes )
call UnitRemoveAbilityBJ( 'A005', udg_gameplay_hero[i] )
call ClearSelectionForPlayer( Player(i - 1) )
call SelectUnitForPlayerSingle( udg_gameplay_hero[i], Player(i - 1) )
call SetUnitInvulnerable( udg_gameplay_hero[i], true )
endif
set i = i + 1
endloop
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 5.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call PlayMusicExBJ( gg_snd_bgmmarket, 0, 3.00 )
call TriggerSleepAction(3.00)
call PlaySoundBJ( gg_snd_hint )
call DisplayTimedTextToForce( udg_gameplay_all_players, 10,"You have |ccc66ff6630 seconds|r for shopping and voting")
call DisplayTimedTextToForce( udg_gameplay_all_players, 10," - type |ccc66ff66-info|r to show information about your purchased upgrades")
call DisplayTimedTextToForce( udg_gameplay_all_players, 10," - vote by standing in one of the |ccc66ff66voting circles|r (unity vote skips market)")
call DisplayTimedTextToForce( udg_gameplay_all_players, 10," ")
// ***************** CHECK FOR VOTE *****************
set i = 0
loop
if(i == 24) then
if(CountUnitsInGroup(udg_gameplay_all_heroes) > 1)then
set i = CountUnitsInGroup(udg_gameplay_all_heroes) / 2 + 1
if(i <= ivb) then
set udg_arena_id = 0
set vote = " (by majority vote)"
exitwhen(1==1)
else
if(i <= ivn) then
set udg_arena_id = 1
set vote = " (by majority vote)"
exitwhen(1==1)
else
if(i <= ivs) then
set udg_arena_id = 2
set vote = " (by majority vote)"
exitwhen(1==1)
else
if(i <= ivl) then
set udg_arena_id = 3
set vote = " (by majority vote)"
exitwhen(1==1)
else
if(i <= ivd) then
set udg_arena_id = 4
set vote = " (by majority vote)"
exitwhen(1==1)
endif
endif
endif
endif
endif
endif
set udg_arena_id = GetRandomInt(0,4)
set vote = " (random)"
exitwhen(1==1)
endif
exitwhen(i > 26)
call TriggerSleepAction(1.00)
set g = GetUnitsInRectMatching(gg_rct_vote_blackrock, Condition(function Trig_UnitIsHero))
set ivb = CountUnitsInGroup(g)
if(ivb == CountUnitsInGroup(udg_gameplay_all_heroes)) then
set udg_arena_id = 0
set vote = " (by unity vote)"
exitwhen(1==1)
endif
set g = GetUnitsInRectMatching(gg_rct_vote_northrend, Condition(function Trig_UnitIsHero))
set ivn = CountUnitsInGroup(g)
if(ivn == CountUnitsInGroup(udg_gameplay_all_heroes)) then
set udg_arena_id = 1
set vote = " (by unity vote)"
exitwhen(1==1)
endif
set g = GetUnitsInRectMatching(gg_rct_vote_stranglethorn, Condition(function Trig_UnitIsHero))
set ivs = CountUnitsInGroup(g)
if(ivs == CountUnitsInGroup(udg_gameplay_all_heroes)) then
set udg_arena_id = 2
set vote = " (by unity vote)"
exitwhen(1==1)
endif
set g = GetUnitsInRectMatching(gg_rct_vote_lordaeron, Condition(function Trig_UnitIsHero))
set ivl = CountUnitsInGroup(g)
if(ivl == CountUnitsInGroup(udg_gameplay_all_heroes)) then
set udg_arena_id = 3
set vote = " (by unity vote)"
exitwhen(1==1)
endif
set g = GetUnitsInRectMatching(gg_rct_vote_tanaris, Condition(function Trig_UnitIsHero))
set ivd = CountUnitsInGroup(g)
if(ivd == CountUnitsInGroup(udg_gameplay_all_heroes)) then
set udg_arena_id = 4
set vote = " (by unity vote)"
exitwhen(1==1)
endif
set i = i + 1
endloop
if(udg_arena_id == 0) then
set arena = "|cccff6666Blackrock|r"
else
if(udg_arena_id == 1) then
set arena = "|ccc6666ffNorthrend|r"
else
if(udg_arena_id == 2) then
set arena = "|ccc66ff66Stranglethorn|r"
else
if(udg_arena_id == 3) then
set arena = "|ccc666666Lordaeron|r"
else
set arena = "|cccffff66Durotar|r"
endif
endif
endif
endif
call ClearTextMessages()
call PlaySoundBJ( gg_snd_hint )
call DisplayTimedTextToForce( udg_gameplay_all_players, 5,"Arena: " + arena + vote)
// ***************** START NEW ROUND *****************
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 3.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction(3.00)
// ***************** CLEAR MAP *****************
call ConditionalTriggerExecute( gg_trg_clear_map )
call TriggerSleepAction(0.10)
// ***************** CREATE ARENA *****************
call ConditionalTriggerExecute( gg_trg_create_arena )
call RemoveLocation(p)
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_create_market takes nothing returns nothing
set gg_trg_create_market = CreateTrigger( )
call TriggerAddAction( gg_trg_create_market, function Trig_create_market_Actions )
endfunction
function Trig_create_arena_Actions takes nothing returns nothing
local integer i = 0
local integer d = 0
local location p = GetRectCenter(udg_gameplay_grid_playable[66])
local unit u = null
// ***************** CREATE BLOCKS *****************
call SetTerrainTypeBJ( p, udg_arena_terraintype[udg_arena_id], -1, 8, 1 )
loop
exitwhen i > 91
set p = GetRectCenter(udg_gameplay_grid_unplayable[i])
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_i[udg_arena_id], Player(11), p, bj_UNIT_FACING )
set udg_arena_block_i[i] = GetLastCreatedUnit()
set i = i + 1
endloop
set i = 0
loop
exitwhen i > 132
set p = GetRectCenter(udg_gameplay_grid_playable[i])
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_d[udg_arena_id], Player(11), p, bj_UNIT_FACING )
set udg_arena_block_d[i] = GetLastCreatedUnit()
set i = i + 1
endloop
set i = 0
loop
exitwhen i > 91
set p = GetRectCenter(udg_gameplay_grid_unplayable[i])
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set udg_arena_blocker_i[i] = GetLastCreatedUnit()
set i = i + 1
endloop
set i = 0
loop
exitwhen i > 132
set p = GetRectCenter(udg_gameplay_grid_playable[i])
call CreateNUnitsAtLoc( 1, 'n00C', Player(11), p, bj_UNIT_FACING )
set udg_arena_blocker_d[i] = GetLastCreatedUnit()
call SetUnitUserData( udg_arena_blocker_d[i], i )
set i = i + 1
endloop
if (udg_arena_id == 0) then
call RemoveUnit(udg_arena_block_i[18])
set p = GetRectCenter(udg_gameplay_grid_unplayable[18])
call CreateNUnitsAtLoc( 1, 'n003', Player(11), p, bj_UNIT_FACING )
set udg_arena_block_i[18] = GetLastCreatedUnit()
call RemoveUnit(udg_arena_block_i[23])
set p = GetRectCenter(udg_gameplay_grid_unplayable[23])
call CreateNUnitsAtLoc( 1, 'n003', Player(11), p, bj_UNIT_FACING )
set udg_arena_block_i[23] = GetLastCreatedUnit()
call RemoveUnit(udg_arena_block_i[68])
set p = GetRectCenter(udg_gameplay_grid_unplayable[68])
call CreateNUnitsAtLoc( 1, 'n003', Player(11), p, bj_UNIT_FACING )
set udg_arena_block_i[68] = GetLastCreatedUnit()
call RemoveUnit(udg_arena_block_i[73])
set p = GetRectCenter(udg_gameplay_grid_unplayable[73])
call CreateNUnitsAtLoc( 1, 'n003', Player(11), p, bj_UNIT_FACING )
set udg_arena_block_i[73] = GetLastCreatedUnit()
endif
// ***************** CREATE SPAWN *****************
set i = 1
set d = 0
loop
exitwhen i > 5
if ( IsPlayerInForce(Player(i - 1), udg_gameplay_all_players) == true ) then
if(d == 0) then
call RemoveUnit(udg_arena_block_d[0])
call RemoveUnit(udg_arena_block_d[1])
call RemoveUnit(udg_arena_block_d[13])
call RemoveUnit(udg_arena_blocker_d[0])
call RemoveUnit(udg_arena_blocker_d[1])
call RemoveUnit(udg_arena_blocker_d[13])
set p = GetRectCenter(udg_gameplay_grid_playable[0])
else
if(d == 1) then
call RemoveUnit(udg_arena_block_d[131])
call RemoveUnit(udg_arena_block_d[132])
call RemoveUnit(udg_arena_block_d[119])
call RemoveUnit(udg_arena_blocker_d[131])
call RemoveUnit(udg_arena_blocker_d[132])
call RemoveUnit(udg_arena_blocker_d[119])
set p = GetRectCenter(udg_gameplay_grid_playable[132])
else
if(d == 2) then
call RemoveUnit(udg_arena_block_d[121])
call RemoveUnit(udg_arena_block_d[120])
call RemoveUnit(udg_arena_block_d[113])
call RemoveUnit(udg_arena_blocker_d[121])
call RemoveUnit(udg_arena_blocker_d[120])
call RemoveUnit(udg_arena_blocker_d[113])
set p = GetRectCenter(udg_gameplay_grid_playable[120])
else
if(d == 3) then
call RemoveUnit(udg_arena_block_d[11])
call RemoveUnit(udg_arena_block_d[12])
call RemoveUnit(udg_arena_block_d[19])
call RemoveUnit(udg_arena_blocker_d[11])
call RemoveUnit(udg_arena_blocker_d[12])
call RemoveUnit(udg_arena_blocker_d[19])
set p = GetRectCenter(udg_gameplay_grid_playable[12])
else
call RemoveUnit(udg_arena_block_d[56])
call RemoveUnit(udg_arena_block_d[65])
call RemoveUnit(udg_arena_block_d[66])
call RemoveUnit(udg_arena_block_d[67])
call RemoveUnit(udg_arena_block_d[76])
call RemoveUnit(udg_arena_blocker_d[56])
call RemoveUnit(udg_arena_blocker_d[65])
call RemoveUnit(udg_arena_blocker_d[66])
call RemoveUnit(udg_arena_blocker_d[67])
call RemoveUnit(udg_arena_blocker_d[76])
set p = GetRectCenter(udg_gameplay_grid_playable[66])
endif
endif
endif
endif
call SetPlayerStateBJ( Player(i - 1), PLAYER_STATE_RESOURCE_LUMBER, ( GetPlayerState(Player(i - 1), PLAYER_STATE_RESOURCE_LUMBER) + 1 ) )
call CreateNUnitsAtLoc( 1, udg_player_herotype[i], Player(i - 1), p, bj_UNIT_FACING )
set udg_gameplay_hero[i] = GetLastCreatedUnit()
call GroupAddUnitSimple( udg_gameplay_hero[i], udg_gameplay_all_heroes )
call ClearSelectionForPlayer( Player(i - 1) )
call SelectUnitForPlayerSingle( udg_gameplay_hero[i], Player(i - 1) )
call PauseUnitBJ( true, udg_gameplay_hero[i] )
call SetUnitInvulnerable( udg_gameplay_hero[i], true )
// ***************** SET VARIABLES *****************
set udg_gameplay_hero_ghost[i] = false
set udg_gameplay_bomb_count[i] = 0
set udg_gameplay_soulprison_count[i] = 0
set udg_gameplay_illuminator_count[i] = 0
set udg_gameplay_phoenixegg_count[i] = 0
set udg_gameplay_triggermine_count[i] = 0
set udg_gameplay_sheep_count[i] = 0
set udg_gameplay_powerup_1_amount[i] = 0
set udg_gameplay_powerup_2_amount[i] = 0
set udg_gameplay_powerup_3_amount[i] = 0
set udg_gameplay_bomb_capacity[i] = udg_player_bomb_capacity[i]
set udg_gameplay_power[i] = udg_player_power[i]
set udg_gameplay_speed[i] = udg_player_speed[i]
call SetUnitMoveSpeed( udg_gameplay_hero[i], udg_gameplay_speed[i] )
set d = d + 1
endif
set i = i + 1
endloop
// ***************** PATTERN GENERATION *****************
if(udg_setting_pattern == true) then
set i = 0
loop
exitwhen i > 14
set d = GetRandomInt(0,132)
if(IsUnitAliveBJ(udg_arena_blocker_d[d]) == true) then
call RemoveUnit(udg_arena_blocker_d[d])
call RemoveUnit(udg_arena_block_d[d])
endif
set i = i + 1
endloop
endif
// ***************** PLACE POWERUPS *****************
if(udg_setting_powerups == true) then
set i = 0
loop
exitwhen i > 5
set u = udg_arena_blocker_d[GetRandomInt(0,132)]
if(IsUnitAliveBJ(u) == true) then
if(GetUnitStateSwap(UNIT_STATE_MANA, u) == 0.00)then
call SetUnitManaBJ( u, 1.00 )
set i = i + 1
endif
endif
endloop
set i = 0
loop
exitwhen i > 5
set u = udg_arena_blocker_d[GetRandomInt(0,132)]
if(IsUnitAliveBJ(u) == true) then
if(GetUnitStateSwap(UNIT_STATE_MANA, u) == 0.00)then
call SetUnitManaBJ( u, 2.00 )
set i = i + 1
endif
endif
endloop
set i = 0
loop
exitwhen i > 3
set u = udg_arena_blocker_d[GetRandomInt(0,132)]
if(IsUnitAliveBJ(u) == true) then
if(GetUnitStateSwap(UNIT_STATE_MANA, u) == 0.00)then
call SetUnitManaBJ( u, 3.00 )
set i = i + 1
endif
endif
endloop
set i = 0
loop
exitwhen i > 1
set u = udg_arena_blocker_d[GetRandomInt(0,132)]
if(IsUnitAliveBJ(u) == true) then
if(GetUnitStateSwap(UNIT_STATE_MANA, u) == 0.00)then
call SetUnitManaBJ( u, 4.00 )
set i = i + 1
endif
endif
endloop
set i = 0
loop
exitwhen i > 0
set u = udg_arena_blocker_d[GetRandomInt(0,132)]
if(IsUnitAliveBJ(u) == true) then
if(GetUnitStateSwap(UNIT_STATE_MANA, u) == 0.00)then
call SetUnitManaBJ( u, 5.00 )
set i = i + 1
endif
endif
endloop
endif
// ***************** COUNTDOWN *****************
set i = 0
loop
exitwhen i > 132
call SetUnitInvulnerable( udg_arena_blocker_d[i], true )
set i = i + 1
endloop
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 3.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call PlayMusicExBJ( gg_snd_bgm, 0, 3.00 )
call TriggerSleepAction( 1.00 )
set i = 0
loop
exitwhen( i > 2)
call PlaySoundBJ( gg_snd_beep )
call TriggerSleepAction( 1.00 )
set i = i + 1
endloop
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUTIN, 1.50, "ReplaceableTextures\\fight.tga", 0, 100.00, 0, 0 )
call PlaySoundBJ( gg_snd_start )
set i = 0
loop
exitwhen i > 132
call SetUnitInvulnerable( udg_arena_blocker_d[i], false )
set i = i + 1
endloop
set i = 1
loop
exitwhen i > 5
if ( IsPlayerInForce(Player(i - 1), udg_gameplay_all_players) == true ) then
call SetUnitInvulnerable( udg_gameplay_hero[i], false )
call PauseUnitBJ( false, udg_gameplay_hero[i] )
endif
set i = i + 1
endloop
call TriggerSleepAction(0.01)
set i = 1
loop
exitwhen i > 5
if ( IsPlayerInForce(Player(i - 1), udg_gameplay_all_players) == true ) then
call ClearSelectionForPlayer( Player(i - 1) )
call SelectUnitForPlayerSingle( udg_gameplay_hero[i], Player(i - 1) )
call ForceUIKeyBJ( Player(i - 1), "t" )
endif
set i = i + 1
endloop
// ***************** START ROUND *****************
set udg_gameplay_game_on = true
set udg_text_float_count = 0
call StartTimerBJ( udg_arena_round_timer_cd, false, udg_setting_round_time - 3)
call StartTimerBJ( udg_arena_round_timer, false, udg_setting_round_time)
call CreateTimerDialogBJ( udg_arena_round_timer, "Time Remaining:" )
set udg_arena_round_timerwindow = GetLastCreatedTimerDialogBJ()
if(udg_setting_suddendeath == true) then
call StartTimerBJ( udg_arena_suddendeath_timer, false, ( udg_setting_round_time - 60.00 ) )
endif
// ***************** START ENVIRONMENT *****************
if(udg_setting_chaosmode == false) then
call ConditionalTriggerExecute( udg_arena_environment[udg_arena_id] )
else
call ConditionalTriggerExecute( udg_arena_environment[GetRandomInt(0,4)] )
endif
call RemoveLocation(p)
endfunction
//===========================================================================
function InitTrig_create_arena takes nothing returns nothing
set gg_trg_create_arena = CreateTrigger( )
call TriggerAddAction( gg_trg_create_arena, function Trig_create_arena_Actions )
endfunction
function Trig_clear_map_Actions takes nothing returns nothing
local location p = GetRectCenter(udg_gameplay_grid_playable[66])
local integer i = 1
call SetTerrainTypeBJ( p, 'Oaby', -1, 8, 1 )
call ForGroupBJ( udg_gameplay_all_units, function Trig_RemovePickedUnit )
call GroupClear( udg_gameplay_all_units )
loop
exitwhen i > 5
call RemoveUnit(udg_gameplay_hero[i] )
set i = i + 1
endloop
set i = 0
if(IsUnitAliveBJ(udg_arena_block_i[i]) == false) then
call RemoveLocation(p)
return
endif
loop
exitwhen i > 91
call RemoveUnit(udg_arena_block_i[i] )
call RemoveUnit(udg_arena_blocker_i[i] )
set i = i + 1
endloop
set i = 0
loop
exitwhen i > 132
call RemoveUnit(udg_arena_block_d[i] )
call RemoveUnit(udg_arena_blocker_d[i] )
set i = i + 1
endloop
call RemoveLocation(p)
endfunction
//===========================================================================
function InitTrig_clear_map takes nothing returns nothing
set gg_trg_clear_map = CreateTrigger( )
call TriggerAddAction( gg_trg_clear_map, function Trig_clear_map_Actions )
endfunction
function Trig_commands_Actions takes nothing returns nothing
local player p = GetTriggerPlayer()
local force f = GetForceOfPlayer(p)
local integer id = GetConvertedPlayerId(p)
local integer i = 0
local string s = GetEventPlayerChatString()
// ***************** -COMMANDS *****************
if( SubStringBJ(s, 2, 9) == "commands") then
if (GetLocalPlayer() == p) then
call ClearTextMessages()
call PlaySoundBJ( gg_snd_hint )
endif
call DisplayTimedTextToForce( f, 10,"|ccc66ff66-info|r (shows information about purchased power ups)")
call DisplayTimedTextToForce( f, 10,"|ccc66ff66-rtime|r |ccc66ffffx|r (changes the time per round to |ccc66ffffx|r seconds (90-300)) [|cccff6666*|r]")
call DisplayTimedTextToForce( f, 10,"|ccc66ff66-rcount|r |ccc66ffffx|r (changes the rounds per arena to |ccc66ffffx|r (1-5)) [|cccff6666*|r]")
call DisplayTimedTextToForce( f, 10,"|ccc66ff66-pups|r (enables/disables powerups) [|cccff6666*|r]")
call DisplayTimedTextToForce( f, 10,"|ccc66ff66-ghost|r (enables/disables ghost mode) [|cccff6666*|r]")
call DisplayTimedTextToForce( f, 10,"|ccc66ff66-sd|r (enables/disables sudden death) [|cccff6666*|r]")
call DisplayTimedTextToForce( f, 10,"|ccc66ff66-pattern|r (enables/disables random pattern generation) [|cccff6666*|r]")
call DisplayTimedTextToForce( f, 10,"|ccc66ff66-chaos|r (enables/disables chaos mode) [|cccff6666*|r]")
call DisplayTimedTextToForce( f, 10,"|ccc66ff66-bounty|r (switches between half,normal and double bounty) [|cccff6666*|r]")
call DisplayTimedTextToForce( f, 10,"|ccc66ff66-shops|r (enables/disables shops) [|cccff6666*|r]")
call DisplayTimedTextToForce( f, 10,"|ccc66ff66-party|r (every player gets 10000 coins) [|cccff6666*|r]")
call DisplayTimedTextToForce( f, 10,"[|cccff6666*|r] = host only")
else
// ***************** -INFO *****************
if( SubStringBJ(s, 2, 5) == "info") then
if (GetLocalPlayer() == p) then
call ClearTextMessages()
call PlaySoundBJ( gg_snd_hint )
endif
call DisplayTimedTextToForce( f, 10,"Capacity: |ccc66ff66" + I2S(udg_player_bomb_capacity[id]) + "|r (Max: |cccff666612|r)")
call DisplayTimedTextToForce( f, 10,"Power: |ccc66ff66" + I2S(udg_player_power[id]) + "|r (Max: |cccff666612|r)")
call DisplayTimedTextToForce( f, 10,"Lifespan: |ccc66ff66" + SubStringBJ(R2S(udg_player_gameplay_lifespan[id]), 1, 4) + "|r (Max: |cccff66667.00|r, Min: |cccff66661.00|r)")
call DisplayTimedTextToForce( f, 10,"Speed: |ccc66ff66" + I2S(udg_player_speed[id]) + "|r (Max: |cccff6666525|r)")
call DisplayTimedTextToForce( f, 10,"Phoenix Egg: |ccc66ff66" + I2S(udg_player_phoenixegg_capacity[id]) + "|r (Max: |cccff66661|r)")
call DisplayTimedTextToForce( f, 10,"Soul Prison: |ccc66ff66" + I2S(udg_player_soulprison_capacity[id]) + "|r (Max: |cccff66661|r)")
call DisplayTimedTextToForce( f, 10,"Illuminator: |ccc66ff66" + I2S(udg_player_illuminator_capacity[id]) + "|r (Max: |cccff66661|r)")
call DisplayTimedTextToForce( f, 10,"Trigger Mine: |ccc66ff66" + I2S(udg_player_triggermine_capacity[id]) + "|r (Max: |cccff66663|r)")
call DisplayTimedTextToForce( f, 10,"Suicide Sheep: |ccc66ff66" + I2S(udg_player_sheep_capacity[id]) + "|r (Max: |cccff66663|r)")
call DisplayTimedTextToForce( f, 10,"Teleport: |ccc66ff66" + I2S(udg_player_teleport_level[id]) + "|r (Max: |cccff66665|r)")
call DisplayTimedTextToForce( f, 10,"Throw Bombs: |ccc66ff66" + I2S(udg_player_throw_level[id]) + "|r (Max: |cccff66665|r)")
call DisplayTimedTextToForce( f, 10,"Invisibility: |ccc66ff66" + I2S(udg_player_invisibility_level[id]) + "|r (Max: |cccff66665|r)")
else
if ( p == Player(0) ) then
// ***************** -RTIME *****************
if( SubStringBJ(s, 2, 6) == "rtime") then
call ClearTextMessages()
call PlaySoundBJ( gg_snd_setting )
set i = S2I(SubStringBJ(s,7,StringLength(s)))
if ( i >= 90) then
if ( i <= 300) then
set udg_setting_round_time = i
call DisplayTimedTextToForce( udg_gameplay_all_players, 3,"Round time: |ccc66ff66" + I2S(i) + " seconds|r" )
else
call DisplayTimedTextToForce( f, 3,"Round time unchanged: |cccff6666invalid input|r (90 - 300)" )
endif
else
call DisplayTimedTextToForce( f, 3,"Round time unchanged: |cccff6666invalid input|r (90 - 300)" )
endif
else
// ***************** -RCOUNT *****************
if( SubStringBJ(s, 2, 7) == "rcount") then
call ClearTextMessages()
call PlaySoundBJ( gg_snd_setting )
set i = S2I(SubStringBJ(s,8,StringLength(s)))
if ( i >= 1) then
if ( i <= 5) then
set udg_setting_round_count = i
call DisplayTimedTextToForce( udg_gameplay_all_players, 3,"Rounds per arena: |ccc66ff66" + I2S(i) + " rounds|r" )
else
call DisplayTimedTextToForce( f, 3,"Rounds per arena unchanged: |cccff6666invalid input|r (1 - 5)" )
endif
else
call DisplayTimedTextToForce( f, 3,"Rounds per arena unchanged: |cccff6666invalid input|r (1 - 5)" )
endif
else
// ***************** -SD *****************
if( SubStringBJ(s, 2, 3) == "sd") then
call ClearTextMessages()
call PlaySoundBJ( gg_snd_setting )
if ( udg_setting_suddendeath == false) then
set udg_setting_suddendeath = true
call DisplayTimedTextToForce( f, 3,"Sudden Death: |ccc66ff66ON|r" )
else
set udg_setting_suddendeath = false
call DisplayTimedTextToForce( f, 3,"Sudden Death: |cccff6666OFF|r" )
endif
else
// ***************** -BOUNTY *****************
if( SubStringBJ(s, 2, 7) == "bounty") then
call ClearTextMessages()
call PlaySoundBJ( gg_snd_setting )
if ( udg_setting_bounty == 0.50 ) then
set udg_setting_bounty = 1.00
loop
exitwhen i > 4
call SetPlayerStateBJ( Player(i), PLAYER_STATE_RESOURCE_FOOD_USED, 100 )
set i = i + 1
endloop
else
if ( udg_setting_bounty == 1.00 ) then
set udg_setting_bounty = 2.00
loop
exitwhen i > 4
call SetPlayerStateBJ( Player(i), PLAYER_STATE_RESOURCE_FOOD_USED, 200 )
set i = i + 1
endloop
else
set udg_setting_bounty = 0.50
loop
exitwhen i > 4
call SetPlayerStateBJ( Player(i), PLAYER_STATE_RESOURCE_FOOD_USED, 50 )
set i = i + 1
endloop
endif
endif
else
// ***************** -PATTERN *****************
if( SubStringBJ(s, 2, 8) == "pattern") then
call ClearTextMessages()
call PlaySoundBJ( gg_snd_setting )
if ( udg_setting_pattern == false ) then
set udg_setting_pattern = true
call DisplayTimedTextToForce( udg_gameplay_all_players, 3,"Random patterns: |ccc66ff66ON|r" )
else
set udg_setting_pattern = false
call DisplayTimedTextToForce( udg_gameplay_all_players, 3,"Random patterns: |cccff6666OFF|r" )
endif
else
// ***************** -PARTY *****************
if( SubStringBJ(s, 2, 6) == "party") then
call ClearTextMessages()
call PlaySoundBJ( gg_snd_setting )
set i = 0
loop
exitwhen i > 4
call SetPlayerStateBJ( Player(i), PLAYER_STATE_RESOURCE_GOLD, ( GetPlayerState(Player(i), PLAYER_STATE_RESOURCE_GOLD) + 10000 ) )
set i = i + 1
endloop
call DisplayTimedTextToForce( udg_gameplay_all_players, 3,"Party: every player gets |ccc66ff6610000 coins|r" )
else
// ***************** -CHAOS *****************
if( SubStringBJ(s, 2, 6) == "chaos") then
call ClearTextMessages()
call PlaySoundBJ( gg_snd_setting )
if ( udg_setting_chaosmode == false ) then
set udg_setting_chaosmode = true
call DisplayTimedTextToForce( udg_gameplay_all_players, 3,"Chaos mode: |ccc66ff66ON|r" )
else
set udg_setting_chaosmode = false
call DisplayTimedTextToForce( udg_gameplay_all_players, 3,"Chaos mode: |cccff6666OFF|r" )
endif
else
// ***************** -shops *****************
if( SubStringBJ(s, 2, 6) == "shops") then
call ClearTextMessages()
call PlaySoundBJ( gg_snd_setting )
if ( udg_setting_shopping == false ) then
set udg_setting_shopping = true
call DisplayTimedTextToForce( udg_gameplay_all_players, 3,"Shops: |ccc66ff66ON|r" )
else
set udg_setting_shopping = false
call DisplayTimedTextToForce( udg_gameplay_all_players, 3,"Shops: |cccff6666OFF|r" )
endif
else
// ***************** -pups *****************
if( SubStringBJ(s, 2, 5) == "pups") then
call ClearTextMessages()
call PlaySoundBJ( gg_snd_setting )
if ( udg_setting_powerups == false ) then
set udg_setting_powerups = true
call DisplayTimedTextToForce( udg_gameplay_all_players, 3,"Powerups: |ccc66ff66ON|r" )
else
set udg_setting_powerups = false
call DisplayTimedTextToForce( udg_gameplay_all_players, 3,"Powerups: |cccff6666OFF|r" )
endif
else
// ***************** -ghost *****************
if( SubStringBJ(s, 2, 6) == "ghost") then
call ClearTextMessages()
call PlaySoundBJ( gg_snd_setting )
if ( udg_setting_ghostmode == false ) then
set udg_setting_ghostmode = true
call DisplayTimedTextToForce( udg_gameplay_all_players, 3,"Ghost mode: |ccc66ff66ON|r" )
else
set udg_setting_ghostmode = false
call DisplayTimedTextToForce( udg_gameplay_all_players, 3,"Ghost mode: |cccff6666OFF|r" )
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
call DestroyForce(f)
endfunction
//===========================================================================
function InitTrig_commands takes nothing returns nothing
set gg_trg_commands = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_commands, Player(0), "-", false )
call TriggerRegisterPlayerChatEvent( gg_trg_commands, Player(1), "-", false )
call TriggerRegisterPlayerChatEvent( gg_trg_commands, Player(2), "-", false )
call TriggerRegisterPlayerChatEvent( gg_trg_commands, Player(3), "-", false )
call TriggerRegisterPlayerChatEvent( gg_trg_commands, Player(4), "-", false )
call TriggerAddAction( gg_trg_commands, function Trig_commands_Actions )
endfunction
// ***************** REGULAR EXPLOSION CONDITIONS *****************
function Trig_RegularExplosionConditions takes nothing returns boolean
local unit u = GetTriggerUnit()
local integer ut = GetUnitTypeId(u)
if ( ut == 'n000' ) then
return true
else
if ( ut == 'n00L' ) then
return true
else
if ( ut == 'n00H' ) then
return true
else
if ( ut == 'h00V' ) then
return true
else
if ( ut == 'n00I' ) then
return true
else
if ( ut == 'n00P' ) then
return true
endif
endif
endif
endif
endif
endif
return false
endfunction
// ***************** SQUARE EXPLOSION CONDITIONS *****************
function Trig_SquareExplosionConditions takes nothing returns boolean
local unit u = GetTriggerUnit()
local integer ut = GetUnitTypeId(u)
if ( ut == 'n00G' ) then
return true
else
if ( ut == 'h009' ) then
return true
endif
endif
return false
endfunction
//===========================================================================
// ***************** PLACES POWERUP *****************
function Trig_PlacePowerup takes integer i,integer ut,location p,real mana, real life returns nothing
local unit u = null
call CreateNUnitsAtLoc( 1, ut, Player(11), p, bj_UNIT_FACING )
set udg_gameplay_powerup[i] = GetLastCreatedUnit()
call GroupAddUnitSimple( udg_gameplay_powerup[i], udg_gameplay_all_units )
call CreateNUnitsAtLoc( 1, 'h011', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call SetUnitUserData( u, i )
call SetUnitManaBJ(u, mana)
call SetUnitLifeBJ( u, life )
call GroupAddUnitSimple( u, udg_gameplay_all_units )
endfunction
function Trig_unit_death_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit uk = GetKillingUnit()
local integer id = GetConvertedPlayerId(GetOwningPlayer(u))
local integer idk = GetConvertedPlayerId(GetOwningPlayer(uk))
local integer ut = GetUnitTypeId(u)
local integer i = 0
local integer d = 0
local integer imax = 0
local integer igrid = 0
local real x = 0.00
local real y = 0.00
local location p = GetUnitLoc(u)
local location poff = null
local location array pgrid
local rect r = null
local group g = null
local string s = udg_player_name[id]
local string sk = udg_player_name[idk]
local string eff = null
// ***************** REGULAR EXPLOSION *****************
if( Trig_RegularExplosionConditions() == true) then
// ***************** SET VARIABLES *****************
if(ut != 'h00V') then
else
set i = 0
loop
exitwhen(RectContainsUnit(udg_gameplay_grid_playable[i], u))
set i = i + 1
endloop
set p = GetRectCenter(udg_gameplay_grid_playable[i])
endif
if(ut == 'n00L') then
set eff = "Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl"
else
if(ut == 'h00V') then
set eff = "Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl"
else
if(ut == 'n00I') then
set eff = "Objects\\Spawnmodels\\Undead\\UDeathSmall\\UDeathSmall.mdl"
else
if(ut == 'n00P') then
set eff = "Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl"
else
set eff = "Objects\\Spawnmodels\\Human\\HCancelDeath\\HCancelDeath.mdl"
endif
endif
endif
endif
if ( ut != 'n00I') then
set imax = udg_gameplay_power[id]
else
set imax = udg_gameplay_power[id] / 2
endif
if ( udg_gameplay_hero[id] == udg_gameplay_skull_hero ) then
if( udg_gameplay_skull_id == 3 ) then
set imax = 1
endif
endif
// ***************** CENTRAL EXPLOSION *****************
if(ut == 'h00V') then
call AddSpecialEffectLocBJ( p, "Objects\\Spawnmodels\\Orc\\OrcSmallDeathExplode\\OrcSmallDeathExplode.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
call AddSpecialEffectLocBJ( p, eff )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( u, 0, 64.00, p, 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
if(ut == 'n00I') then
call PlaySoundAtPointBJ( gg_snd_soulprison, 100, p, 0.00 )
endif
// ***************** EXPAND EXPLOSION *****************
set d = 0
loop
exitwhen d > 3
if(d == 0) then
set x = 128.00
set y = 0.00
else
if(d == 1) then
set x = -128.00
set y = 0.00
else
if(d == 2) then
set x = 0.00
set y = 128.00
else
set x = 0.00
set y = -128.00
endif
endif
endif
set i = 1
loop
exitwhen i > imax
set poff = OffsetLocation(p, x * i, y * i)
set r = RectFromCenterSizeBJ(poff, 128.00, 128.00)
set g = GetUnitsInRectMatching(r, Condition(function Trig_BlockExplosion))
if ( IsUnitGroupEmptyBJ(g) ) then
if ( ut == 'h00V') then
call AddSpecialEffectLocBJ( poff, "Objects\\Spawnmodels\\Orc\\OrcSmallDeathExplode\\OrcSmallDeathExplode.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
call AddSpecialEffectLocBJ( poff, eff )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( u, 0, 64.00, poff, 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
else
set g = GetUnitsInRectMatching(r, Condition(function Trig_UnitIsBlockI))
if ( IsUnitGroupEmptyBJ(g) ) then
if( ut == 'h00V' ) then
call AddSpecialEffectLocBJ( poff, "Objects\\Spawnmodels\\Orc\\OrcSmallDeathExplode\\OrcSmallDeathExplode.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
call AddSpecialEffectLocBJ( poff, eff )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( u, 0, 64.00, poff, 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
if(ut != 'n00I') then
exitwhen(1==1)
endif
else
exitwhen(1==1)
endif
endif
set i = i + 1
endloop
set d = d + 1
endloop
// ***************** ADJUST GLOBALS *****************
if( ut == 'n000' ) then
set udg_gameplay_bomb_count[id] = udg_gameplay_bomb_count[id] - 1
else
if( ut == 'n00L' ) then
call RemoveUnit(udg_gameplay_bomb_blocker[GetUnitUserData(u)])
call RemoveUnit(udg_gameplay_phoenixegg_blocker[id])
set udg_gameplay_phoenixegg_count[id] = udg_gameplay_phoenixegg_count[id] - 1
else
if( ut == 'h00V' ) then
set udg_gameplay_sheep_count[id] = udg_gameplay_sheep_count[id] - 1
else
if( GetUnitTypeId(u) == 'h00V' ) then
set udg_gameplay_sheep_count[id] = udg_gameplay_sheep_count[id] - 1
else
if( ut == 'n00I') then
set udg_gameplay_soulprison_count[id] = udg_gameplay_soulprison_count[id] - 1
else
set udg_gameplay_triggermine_count[id] = udg_gameplay_triggermine_count[id] - 1
endif
endif
endif
endif
endif
call RemoveUnit(u)
// ***************** SQUARE EXPLOSION *****************
else
if( Trig_SquareExplosionConditions() == true) then
// ***************** SET VARIABLES *****************
if(ut == 'n00G') then
set eff = "Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl"
if(udg_gameplay_power[id] <= 4) then
set imax = 2
else
if(udg_gameplay_power[id] <= 8) then
set imax = 4
else
set imax = 6
endif
endif
if ( udg_gameplay_hero[id] == udg_gameplay_skull_hero ) then
if( udg_gameplay_skull_id == 3 ) then
set imax = 2
endif
endif
else
set eff = "Abilities\\Spells\\Undead\\DarkRitual\\DarkRitualTarget.mdl"
set imax = 4
set i = 0
loop
exitwhen RectContainsLoc(udg_gameplay_grid_playable[i], p)
set i = i + 1
endloop
set p = GetRectCenter(udg_gameplay_grid_playable[i])
endif
set p = OffsetLocation(p, -128.00 * imax / 2, -128.00 * imax / 2)
set i = 0
set d = 0
set igrid = 0
loop
exitwhen i > imax
loop
exitwhen d > imax
set pgrid[igrid] = OffsetLocation(p, 128.00 * i, 128.00 * d )
set igrid = igrid + 1
set d = d + 1
endloop
set d = 0
set i = i + 1
endloop
// ***************** EXPLOSION *****************
set i = 0
loop
exitwhen(i > igrid)
call AddSpecialEffectLocBJ( pgrid[i], eff )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( u, 0, 64.00, pgrid[i], 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
call RemoveLocation(pgrid[i])
set i = i + 1
endloop
// ***************** ADJUST GLOBALS *****************
set udg_gameplay_illuminator_count[id] = udg_gameplay_illuminator_count[id] - 1
call RemoveUnit(u)
// ***************** EXPLOSION CHAIN *****************
else
if ( IsUnitType(u, UNIT_TYPE_UNDEAD) == true ) then
set i = GetUnitUserData(u)
if( ut != 'h00W' ) then
if(IsUnitAliveBJ(udg_gameplay_bomb[i])) then
call KillUnit(udg_gameplay_bomb[i])
endif
else
if(IsUnitAliveBJ(udg_gameplay_sheep[i])) then
call KillUnit(udg_gameplay_sheep[i])
endif
endif
call RemoveUnit(u)
// ***************** BLOCK DEATH *****************
else
if ( ut == 'n00C' ) then
set i = GetUnitUserData(u)
call CreateNUnitsAtLoc( 1, 'n004', Player(11), p, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 0.25, 'BTLF', GetLastCreatedUnit() )
if(IsPlayerInForce(GetOwningPlayer(uk), udg_gameplay_all_players)) then
call SetPlayerStateBJ( Player(idk - 1), PLAYER_STATE_RESOURCE_GOLD, R2I(GetPlayerState(Player(idk - 1), PLAYER_STATE_RESOURCE_GOLD) + 5.00 * udg_setting_bounty) )
endif
call RemoveUnit(udg_arena_block_d[i])
call RemoveUnit(u)
if(GetUnitStateSwap(UNIT_STATE_MANA, u) != 0.00)then
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
if(GetUnitStateSwap(UNIT_STATE_MANA, u) == 1.00)then
call TriggerSleepAction(0.25)
call Trig_PlacePowerup(i,'h00Z',p,1.00,5.00)
else
if(GetUnitStateSwap(UNIT_STATE_MANA, u) == 2.00)then
call TriggerSleepAction(0.25)
call Trig_PlacePowerup(i,'h00A',p,2.00,5.00)
else
if(GetUnitStateSwap(UNIT_STATE_MANA, u) == 3.00)then
call TriggerSleepAction(0.25)
call Trig_PlacePowerup(i,'h010',p,3.00,5.00)
else
if(GetUnitStateSwap(UNIT_STATE_MANA, u) == 4.00)then
call TriggerSleepAction(0.25)
call Trig_PlacePowerup(i,'h00Y',p,4.00,5.00)
else
call TriggerSleepAction(0.25)
call Trig_PlacePowerup(i,'h00X',p,5.00,100.00)
endif
endif
endif
endif
endif
// ***************** HERO DEATH *****************
else
if ( IsUnitInGroup(u, udg_gameplay_all_heroes) == true ) then
call PlaySoundBJ( gg_snd_kill )
set poff = p
call GroupRemoveUnitSimple( u, udg_gameplay_all_heroes )
set ut = GetUnitTypeId(uk)
set udg_player_death_count[id] = udg_player_death_count[id] + 1
if (idk != 12) then
if (idk != id) then
call Trig_FloatText( sk + " |cccffffffkilled|r " + s + " |cccffff66+" + I2S(R2I(250.00 * udg_setting_bounty)) + " coins|r" )
call SetPlayerStateBJ( Player(idk - 1), PLAYER_STATE_RESOURCE_GOLD, R2I(GetPlayerState(Player(idk - 1), PLAYER_STATE_RESOURCE_GOLD) + 250.00 * udg_setting_bounty) )
set udg_player_kill_count[idk] = udg_player_kill_count[idk] + 1
set udg_player_killchain_count[idk] = udg_player_killchain_count[idk] + 1
else
call Trig_FloatText( s + " |cccffffffblew himself up|r")
endif
else
if( ut == 'h001') then
call Trig_FloatText( s + " |cccffffffgot incinerated|r")
else
if( ut == 'h007') then
call Trig_FloatText( s + " |cccfffffffroze to death|r")
else
if( ut == 'h009') then
call Trig_FloatText( s + " |cccffffffis allergic to trees|r")
else
if( ut == 'h016') then
call Trig_FloatText( s + " |cccffffffmet a giant lizard|r")
else
call Trig_FloatText( s + " |cccffffffgot squashed|r")
endif
endif
endif
endif
endif
// ***************** ADJUST SCOREBOARD *****************
call ConditionalTriggerExecute( gg_trg_adjust_scoreboard )
// ***************** END ROUND? *****************
call ConditionalTriggerExecute( gg_trg_round_end )
// ***************** KILL CHAIN *****************
call TriggerSleepAction(0.10)
if(udg_player_killchain_count[idk] > 1) then
if(udg_player_killchain_count[idk] > 2) then
if(udg_player_killchain_count[idk] > 3) then
call Trig_FloatText( "|cccff66ccMulti kill|r |cccffff66+" + I2S(R2I(1000.00 * udg_setting_bounty)) + " coins|r")
call SetPlayerStateBJ( Player(idk - 1), PLAYER_STATE_RESOURCE_GOLD, R2I(GetPlayerState(Player(idk - 1), PLAYER_STATE_RESOURCE_GOLD) + 1000 * udg_setting_bounty) )
else
call Trig_FloatText( "|cccff66ccTriple kill|r |cccffff66+" + I2S(R2I(500.00 * udg_setting_bounty)) + " coins|r")
call SetPlayerStateBJ( Player(idk - 1), PLAYER_STATE_RESOURCE_GOLD, R2I(GetPlayerState(Player(idk - 1), PLAYER_STATE_RESOURCE_GOLD) + 500 * udg_setting_bounty) )
endif
else
call Trig_FloatText( "|cccff66ccDouble kill|r |cccffff66+" + I2S(R2I(250.00 * udg_setting_bounty)) + " coins|r")
call SetPlayerStateBJ( Player(idk - 1), PLAYER_STATE_RESOURCE_GOLD, R2I(GetPlayerState(Player(idk - 1), PLAYER_STATE_RESOURCE_GOLD) + 250 * udg_setting_bounty) )
endif
endif
set udg_player_killchain_count[idk] = 0
call TriggerSleepAction(1.40)
if(udg_gameplay_powerup_1_amount[id] > 0) then
set i = 1
loop
exitwhen i > udg_gameplay_powerup_1_amount[id] + 1 / 2
set d = GetRandomInt(0,132)
set p = GetRectCenter(udg_gameplay_grid_playable[d])
set r = RectFromCenterSizeBJ(p, 128, 128)
set g = GetUnitsInRectMatching(r, Condition(function Trig_PowerupPlacement))
if(IsUnitGroupEmptyBJ(g)) then
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call Trig_PlacePowerup(d,'h00Z',p,1.00,5.00)
set i = i + 1
endif
endloop
endif
if(udg_gameplay_powerup_2_amount[id] > 0) then
set i = 1
loop
exitwhen i > udg_gameplay_powerup_2_amount[id] + 1 / 2
set d = GetRandomInt(0,132)
set p = GetRectCenter(udg_gameplay_grid_playable[d])
set r = RectFromCenterSizeBJ(p, 128, 128)
set g = GetUnitsInRectMatching(r, Condition(function Trig_PowerupPlacement))
if(IsUnitGroupEmptyBJ(g)) then
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call Trig_PlacePowerup(d,'h00A',p,2.00,5.00)
set i = i + 1
endif
endloop
endif
if(udg_gameplay_powerup_3_amount[id] > 0) then
set i = 1
loop
exitwhen i > udg_gameplay_powerup_3_amount[id] + 1 / 2
set d = GetRandomInt(0,132)
set p = GetRectCenter(udg_gameplay_grid_playable[d])
set r = RectFromCenterSizeBJ(p, 128, 128)
set g = GetUnitsInRectMatching(r, Condition(function Trig_PowerupPlacement))
if(IsUnitGroupEmptyBJ(g)) then
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call Trig_PlacePowerup(d,'h010',p,3.00,5.00)
set i = i + 1
endif
endloop
endif
// ***************** GHOST MODE *****************
if(udg_setting_ghostmode == true) then
call TriggerSleepAction(1.40)
if(udg_gameplay_game_on == true) then
set udg_gameplay_hero_ghost[id] = true
call CreateNUnitsAtLoc( 1, 'h017', Player(id - 1), poff, GetUnitFacing(u) )
set udg_gameplay_hero[id] = GetLastCreatedUnit()
call SetUnitVertexColorBJ( udg_gameplay_hero[id], 100, 100, 100, 30.00 )
call AddSpecialEffectTargetUnitBJ( "origin", udg_gameplay_hero[id], "Abilities\\Spells\\Undead\\RaiseSkeletonWarrior\\RaiseSkeleton.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call SelectUnitForPlayerSingle( udg_gameplay_hero[id], Player(id - 1) )
endif
endif
// ***************** REMOVE DUMMYS *****************
else
if (IsUnitType(u, UNIT_TYPE_MECHANICAL) == true ) then
call RemoveUnit(u)
else
// ***************** POWERUPS *****************
if(ut == 'h011') then
set i = GetUnitUserData(u)
set x = GetUnitStateSwap(UNIT_STATE_MANA, u)
call CreateNUnitsAtLoc( 1, 'n004', Player(11), p, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 0.25, 'BTLF', GetLastCreatedUnit() )
call RemoveUnit(udg_gameplay_powerup[i])
call RemoveUnit(u)
if(IsUnitInGroup(uk, udg_gameplay_all_heroes)) then
if(uk == udg_gameplay_skull_hero) then
call SetUnitVertexColorBJ( udg_gameplay_skull_hero, 100.00, 100.00, 100.00, 0 )
call SetUnitMoveSpeed( udg_gameplay_skull_hero, udg_gameplay_speed[udg_gameplay_skull_player_id] )
set udg_gameplay_skull_hero = null
loop
set d = GetRandomInt(0,132)
set p = GetRectCenter(udg_gameplay_grid_playable[d])
set r = RectFromCenterSizeBJ(p, 128, 128)
set g = GetUnitsInRectMatching(r, Condition(function Trig_PowerupPlacement))
exitwhen IsUnitGroupEmptyBJ(g)
endloop
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call Trig_PlacePowerup(d,'h00X',p,5.00,100.00)
endif
if( x != 0.00) then
if( x == 1.00) then
call AddSpecialEffectTargetUnitBJ( "origin", udg_gameplay_hero[idk], "Abilities\\Spells\\Other\\Levelup\\LevelupCaster.mdl" )
set udg_gameplay_powerup_1_amount[idk] = udg_gameplay_powerup_1_amount[idk] + 1
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
if (udg_gameplay_bomb_capacity[idk] < 12) then
set udg_gameplay_bomb_capacity[idk] = udg_gameplay_bomb_capacity[idk] + 1
endif
call Trig_HintMessage(Player(idk-1), "Boost|r: Capacity (|ccc66ff66" + I2S(udg_gameplay_bomb_capacity[idk]) + "|r)" )
else
if( x == 2.00) then
call AddSpecialEffectTargetUnitBJ( "origin", udg_gameplay_hero[idk], "Abilities\\Spells\\Other\\Levelup\\LevelupCaster.mdl" )
set udg_gameplay_powerup_2_amount[idk] = udg_gameplay_powerup_2_amount[idk] + 1
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
if (udg_gameplay_power[idk] < 12) then
set udg_gameplay_power[idk] = udg_gameplay_power[idk] + 1
endif
call Trig_HintMessage(Player(idk-1), "Boost|r: Power (|ccc66ff66" + I2S(udg_gameplay_power[idk]) + "|r)" )
else
if( x == 3.00) then
call AddSpecialEffectTargetUnitBJ( "origin", udg_gameplay_hero[idk], "Abilities\\Spells\\Other\\Levelup\\LevelupCaster.mdl" )
set udg_gameplay_powerup_3_amount[idk] = udg_gameplay_powerup_3_amount[idk] + 1
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
if (udg_gameplay_speed[idk] < 525) then
set udg_gameplay_speed[idk] = udg_gameplay_speed[idk] + 25
endif
if(uk != udg_gameplay_skull_hero) then
if(udg_gameplay_skull_id != 2) then
call SetUnitMoveSpeed( udg_gameplay_hero[idk], udg_gameplay_speed[idk] )
endif
endif
call Trig_HintMessage(Player(idk-1), "Boost|r: Speed (|ccc66ff66" + I2S(udg_gameplay_speed[idk]) + "|r)" )
else
if( x == 4.00) then
call AddSpecialEffectTargetUnitBJ( "origin", udg_gameplay_hero[idk], "Abilities\\Spells\\Other\\Transmute\\PileofGold.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call SetPlayerStateBJ( Player(idk - 1), PLAYER_STATE_RESOURCE_GOLD, R2I(GetPlayerState(Player(idk - 1), PLAYER_STATE_RESOURCE_GOLD) + 100 * udg_setting_bounty) )
call Trig_HintMessage(Player(idk-1), "|cccffff66+" + I2S(R2I(100.00 * udg_setting_bounty)) + " coins|r" )
else
call AddSpecialEffectTargetUnitBJ( "origin", udg_gameplay_hero[idk], "Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
set udg_gameplay_skull_hero = uk
set udg_gameplay_skull_player_id = idk
set udg_gameplay_skull_id = GetRandomInt(0,5)
if(udg_gameplay_skull_id == 0) then
call ConditionalTriggerExecute( gg_trg_skull_teleport )
else
call ConditionalTriggerExecute( gg_trg_skull_periodic )
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
call RemoveLocation(p)
call RemoveLocation(poff)
call RemoveRect(r)
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_unit_death takes nothing returns nothing
set gg_trg_unit_death = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_unit_death, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_unit_death, function Trig_unit_death_Actions )
endfunction
// ***************** REGULAR PLACEMENT CONDITIONS *****************
function Trig_RegularPlacementConditions takes nothing returns boolean
local string s = OrderId2StringBJ(GetIssuedOrderIdBJ())
local unit u = GetTriggerUnit()
local integer id = GetConvertedPlayerId(GetOwningPlayer(u))
if ( udg_gameplay_game_on == true ) then
if( IsUnitAliveBJ(u) ) then
if( udg_gameplay_hero_valid[id] == true ) then
if ( s == "berserk" ) then
return true
else
if ( s == "immolation" ) then
return true
else
if ( s == "unimmolation" ) then
return true
else
if ( s == "windwalk" ) then
return true
else
if ( s == "manashieldon" ) then
return true
else
if ( s == "divineshield" ) then
return true
endif
endif
endif
endif
endif
endif
endif
endif
endif
return false
endfunction
// ***************** SHEEP PLACEMENT CONDITIONS *****************
function Trig_SheepPlacementConditions takes nothing returns boolean
local string s = OrderId2StringBJ(GetIssuedOrderIdBJ())
local unit u = GetTriggerUnit()
local integer id = GetConvertedPlayerId(GetOwningPlayer(u))
if( udg_gameplay_game_on == true ) then
if( IsUnitAliveBJ(u) ) then
if( udg_gameplay_hero_valid[id] == true ) then
if ( s == "defend" ) then
return true
else
if ( s == "undefend" ) then
return true
endif
endif
endif
endif
endif
return false
endfunction
//===========================================================================
// ***************** PLACE BOMBS *****************
function Trig_PlaceBomb takes integer ut,integer id,integer i,real d,location p returns nothing
local unit ueff = null
call CreateNUnitsAtLoc( 1, 'h00S', Player(id - 1), p, bj_UNIT_FACING )
set ueff = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', ueff )
call PlaySoundAtPointBJ( gg_snd_poof, 100, p, 0.00 )
if(udg_gameplay_hero_ghost[id] == false) then
call CreateNUnitsAtLoc( 1, 'n00K', Player(id - 1), p, bj_UNIT_FACING )
set udg_gameplay_bomb_blocker[i] = GetLastCreatedUnit()
call GroupAddUnitSimple( udg_gameplay_bomb_blocker[i], udg_gameplay_all_units )
call SetUnitUserData(udg_gameplay_bomb_blocker[i], i)
if(ut == 'n00L') then
call SetUnitInvulnerable( udg_gameplay_bomb_blocker[i], true )
call CreateNUnitsAtLoc( 1, 'n004', Player(id - 1), p, bj_UNIT_FACING )
set udg_gameplay_phoenixegg_blocker[id] = GetLastCreatedUnit()
call GroupAddUnitSimple( udg_gameplay_phoenixegg_blocker[id], udg_gameplay_all_units )
call SetUnitInvulnerable( udg_gameplay_phoenixegg_blocker[id], true )
endif
endif
call CreateNUnitsAtLoc( 1, ut, Player(id - 1), p, bj_UNIT_FACING )
set udg_gameplay_bomb[i] = GetLastCreatedUnit()
call GroupAddUnitSimple( udg_gameplay_bomb[i], udg_gameplay_all_units )
if(udg_gameplay_hero_ghost[id] == false) then
call SetUnitUserData(udg_gameplay_bomb[i], i)
else
call SetUnitVertexColorBJ( udg_gameplay_bomb[i], 100, 100, 100, 30.00 )
endif
if ( ut != 'n00H' ) then
call UnitApplyTimedLifeBJ( udg_player_gameplay_lifespan[id] * d, 'BTLF', udg_gameplay_bomb[i] )
endif
endfunction
function Trig_unit_order_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit ueff = null
local integer i = 0
local integer id = GetConvertedPlayerId(GetOwningPlayer(u))
local integer icount = 0
local integer icapacity = 0
local integer ut = 0
local location p = GetUnitLoc(u)
local location poff = GetSpellTargetLoc()
local real d = 1.00
local real x = 0.00
local real y = 0.00
local real facing = GetUnitFacing(u)
local string s = OrderId2StringBJ(GetIssuedOrderIdBJ())
local group g = null
local rect r = null
local effect eff = null
local boolean b = false
// ***************** REGULAR PLACEMENT *****************
if( Trig_RegularPlacementConditions() == true ) then
// ***************** SET VARIABLES *****************
if( s == "berserk" ) then
set icount = udg_gameplay_bomb_count[id]
if(udg_gameplay_hero_ghost[id] == false) then
set icapacity = udg_gameplay_bomb_capacity[id]
set ut = 'n000'
else
set icapacity = 1
set ut = 'n00P'
endif
else
if( s == "manashieldon" ) then
set icount = udg_gameplay_illuminator_count[id]
set icapacity = udg_player_illuminator_capacity[id]
set ut = 'n00G'
else
if( s == "windwalk" ) then
set icount = udg_gameplay_soulprison_count[id]
set icapacity = udg_player_soulprison_capacity[id]
set ut = 'n00I'
else
if( s == "divineshield" ) then
set icount = udg_gameplay_triggermine_count[id]
set icapacity = udg_player_triggermine_capacity[id]
set ut = 'n00H'
else
set icount = udg_gameplay_phoenixegg_count[id]
set icapacity = udg_player_phoenixegg_capacity[id]
set d = 1.50
set ut = 'n00L'
endif
endif
endif
endif
if ( u == udg_gameplay_skull_hero ) then
if( udg_gameplay_skull_id == 4 ) then
set d = 0.50
else
if(udg_gameplay_skull_id == 5) then
set icapacity = 0
endif
endif
endif
// ***************** PLACE BOMB *****************
if ( icount < icapacity ) then
loop
exitwhen RectContainsLoc(udg_gameplay_grid_playable[i], p) == true
set i = i + 1
endloop
set p = GetRectCenter(udg_gameplay_grid_playable[i])
if ( IsUnitAliveBJ(udg_gameplay_bomb_blocker[i]) == false ) then
call Trig_PlaceBomb(ut,id,i,d,p)
if(ut == 'n000') then
set udg_gameplay_bomb_count[id] = udg_gameplay_bomb_count[id] + 1
else
if(ut == 'n00G') then
set udg_gameplay_illuminator_count[id] = udg_gameplay_illuminator_count[id] + 1
else
if(ut == 'n00I') then
set udg_gameplay_soulprison_count[id] = udg_gameplay_soulprison_count[id] + 1
else
if(ut == 'n00L') then
set udg_gameplay_phoenixegg_count[id] = udg_gameplay_phoenixegg_count[id] + 1
set udg_gameplay_phoenixegg[id] = udg_gameplay_bomb[i]
else
set udg_gameplay_triggermine_count[id] = udg_gameplay_triggermine_count[id] + 1
endif
endif
endif
endif
endif
else
call Trig_ErrorMessage(Player(id-1), "Error|r: not available")
endif
else
// ***************** SHEEP PLACEMENT *****************
if( Trig_SheepPlacementConditions() == true ) then
// ***************** SET VARIABLES *****************
set icapacity = udg_player_sheep_capacity[id]
if ( u == udg_gameplay_skull_hero ) then
if( udg_gameplay_skull_id == 4 ) then
set d = 0.50
else
if(udg_gameplay_skull_id == 5) then
set icapacity = 0
endif
endif
endif
if(udg_gameplay_sheep_count[id] < icapacity) then
loop
exitwhen(RectContainsLoc(udg_gameplay_grid_playable[i], p))
set i = i + 1
endloop
set p = GetRectCenter(udg_gameplay_grid_playable[i])
loop
if(facing >= 45.00) then
if(facing <= 135.00) then
set y = 128.00
set x = 0.00
exitwhen 1 == 1
endif
endif
if(facing >= 135.00) then
if(facing <= 225.00) then
set y = 0.00
set x = -128.00
exitwhen 1 == 1
endif
endif
if(facing >= 225.00) then
if(facing <= 315.00) then
set y = -128.00
set x = 0.00
exitwhen 1 == 1
endif
endif
set y = 0.00
set x = 128.00
exitwhen 1 == 1
endloop
set p = OffsetLocation(p, x, y)
set r = RectFromCenterSizeBJ(p, 64.00, 64.00)
set g = GetUnitsInRectMatching(r, Condition(function Trig_CheckObstructed))
// ***************** PLACE SHEEP *****************
if(IsUnitGroupEmptyBJ(g)) then
call CreateNUnitsAtLoc( 1, 'h00S', Player(id - 1), p, bj_UNIT_FACING )
set ueff = GetLastCreatedUnit()
call GroupAddUnitSimple( ueff, udg_gameplay_all_units )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', ueff )
call PlaySoundAtPointBJ( gg_snd_sheep, 100, p, 0.00 )
call CreateNUnitsAtLoc( 1, 'h00V', Player(id - 1), p, facing )
set udg_gameplay_sheep[id * 10 + udg_gameplay_sheep_id[id]] = GetLastCreatedUnit()
call GroupAddUnitSimple( udg_gameplay_sheep[id * 10 + udg_gameplay_sheep_id[id]], udg_gameplay_all_units )
call UnitApplyTimedLifeBJ( udg_player_gameplay_lifespan[id] * d, 'BTLF', udg_gameplay_sheep[id * 10 + udg_gameplay_sheep_id[id]] )
call CreateNUnitsAtLoc( 1, 'h00W', Player(id - 1), p, facing )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitUserData(u, id * 10 + udg_gameplay_sheep_id[id])
set udg_gameplay_sheep_count[id] = udg_gameplay_sheep_count[id] + 1
set ueff = udg_gameplay_sheep[id * 10 + udg_gameplay_sheep_id[id]]
if(udg_gameplay_sheep_id[id] < 10) then
set udg_gameplay_sheep_id[id] = udg_gameplay_sheep_id[id] + 1
else
set udg_gameplay_sheep_id[id] = 0
endif
// ***************** MOVE SHEEP *****************
call IssuePointOrderLocBJ( ueff, "move", p )
call IssuePointOrderLocBJ( u, "move", p )
loop
set p = OffsetLocation(p, x, y)
set r = RectFromCenterSizeBJ(p, 64.00, 64.00)
set g = GetUnitsInRectMatching(r, Condition( function Trig_CheckObstructed) )
if(IsUnitGroupEmptyBJ(g)) then
call IssuePointOrderLocBJ( ueff, "move", p )
call IssuePointOrderLocBJ( u, "move", p )
else
set p = OffsetLocation(p, -x, -y)
endif
call TriggerSleepAction(0.42)
endloop
else
call Trig_ErrorMessage(Player(id-1), "Error|r: location obstructed")
endif
else
call Trig_ErrorMessage(Player(id-1), "Error|r: not available")
endif
else
// ***************** TELEPORT *****************
if(GetSpellAbilityId() == 'A00A') then
if(udg_player_teleport_level[id] > 0) then
if(udg_gameplay_teleport_cd[id] == false) then
set poff = GetSpellTargetLoc()
loop
exitwhen i > 132
exitwhen RectContainsLoc(udg_gameplay_grid_playable[i], poff)
set i = i + 1
endloop
if(i < 133) then
set poff = GetRectCenter(udg_gameplay_grid_playable[i])
set r = RectFromCenterSizeBJ(poff, 64.00, 64.00)
set g = GetUnitsInRectMatching(r, Condition(function Trig_CheckObstructed2))
if(IsUnitGroupEmptyBJ(g)) then
set udg_gameplay_teleport_cd[id] = true
set udg_gameplay_hero_valid[id] = false
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectLocBJ( poff, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTo.mdl" )
set eff = GetLastCreatedEffectBJ()
call SetUnitInvulnerable( udg_gameplay_hero[id], true )
call PauseUnitBJ( true, udg_gameplay_hero[id] )
call SetUnitVertexColorBJ( u, 100, 100, 100, 100.00 )
call TriggerSleepAction(1.00)
call DestroyEffectBJ( eff )
if(udg_gameplay_game_on == true) then
call SetUnitInvulnerable( udg_gameplay_hero[id], false )
call PauseUnitBJ( false, udg_gameplay_hero[id] )
endif
call SetUnitVertexColorBJ( u, 100, 100, 100, 0.00 )
call AddSpecialEffectLocBJ( poff, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call SetUnitPositionLoc( u, poff )
set udg_gameplay_hero_valid[id] = true
set i = 1
loop
if(IsUnitAliveBJ(u) == false) then
set b = true
exitwhen 1 == 1
endif
exitwhen i > 22 - (udg_player_teleport_level[id] * 3)
call TriggerSleepAction(1.00)
set i = i + 1
endloop
set udg_gameplay_teleport_cd[id] = false
if(b == false) then
call Trig_HintMessage(Player(id-1), "Ready|r: Teleport")
endif
else
call Trig_ErrorMessage(Player(id-1), "Error|r: location obstructed")
endif
else
call Trig_ErrorMessage(Player(id-1), "Error|r: invalid location")
endif
else
call Trig_ErrorMessage(Player(id-1), "Error|r: cooldown")
endif
else
call Trig_ErrorMessage(Player(id-1), "Error|r: not available")
endif
else
// ***************** THROW BOMBS *****************
if(GetSpellAbilityId() == 'A00B') then
if(udg_player_throw_level[id] > 0) then
// ***************** SET VARIABLES *****************
set ut = 'n000'
set icount = 1
set icapacity = udg_gameplay_bomb_capacity[id]
if ( u == udg_gameplay_skull_hero ) then
if( udg_gameplay_skull_id == 4 ) then
set d = 0.50
else
if(udg_gameplay_skull_id == 5) then
set icapacity = 0
endif
endif
endif
if(udg_gameplay_bomb_count[id] < icapacity) then
loop
exitwhen(RectContainsLoc(udg_gameplay_grid_playable[i], p))
set i = i + 1
endloop
set p = GetRectCenter(udg_gameplay_grid_playable[i])
loop
if(facing >= 45.00) then
if(facing <= 135.00) then
set y = 128.00
set x = 0.00
exitwhen 1 == 1
endif
endif
if(facing >= 135.00) then
if(facing <= 225.00) then
set y = 0.00
set x = -128.00
exitwhen 1 == 1
endif
endif
if(facing >= 225.00) then
if(facing <= 315.00) then
set y = -128.00
set x = 0.00
exitwhen 1 == 1
endif
endif
set y = 0.00
set x = 128.00
exitwhen 1 == 1
endloop
set p = OffsetLocation(p, x, y)
set i = 0
loop
exitwhen i > 132
exitwhen(RectContainsLoc(udg_gameplay_grid_playable[i], p))
set i = i + 1
endloop
if(i < 133) then
set r = RectFromCenterSizeBJ(p, 64.00, 64.00)
set g = GetUnitsInRectMatching(r, Condition(function Trig_CheckObstructed3))
if( IsUnitGroupEmptyBJ(g) == false ) then
call Trig_ErrorMessage(Player(id-1), "Error|r: location obstructed")
else
// ***************** PLACE BOMBS *****************
loop
call Trig_PlaceBomb(ut,id,i,d,p)
set udg_gameplay_bomb_count[id] = udg_gameplay_bomb_count[id] + 1
set icount = icount + 1
exitwhen icount > udg_player_throw_level[id] * 2
exitwhen udg_gameplay_bomb_count[id] == icapacity
set p = OffsetLocation(p, x, y)
set i = 0
loop
exitwhen(RectContainsLoc(udg_gameplay_grid_playable[i], p))
set i = i + 1
endloop
set r = RectFromCenterSizeBJ(p, 64.00, 64.00)
set g = GetUnitsInRectMatching(r, Condition(function Trig_CheckObstructed3))
exitwhen IsUnitGroupEmptyBJ(g) == false
endloop
endif
else
call Trig_ErrorMessage(Player(id-1), "Error|r: invalid location")
endif
else
call Trig_ErrorMessage(Player(id-1), "Error|r: not available")
endif
else
call Trig_ErrorMessage(Player(id-1), "Error|r: not available")
endif
else
// ***************** INVISIBILITY *****************
if(GetSpellAbilityId() == 'A007') then
if(udg_player_invisibility_level[id] > 0) then
if(udg_gameplay_invisibility_cd[id] == false) then
call UnitAddAbilityBJ( 'A00C', u )
set udg_gameplay_invisibility_cd[id] = true
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
loop
if(IsUnitAliveBJ(u) == false) then
exitwhen 1 == 1
set b = true
endif
exitwhen i > 3 * udg_player_invisibility_level[id]
call TriggerSleepAction(1.00)
set i = i + 1
endloop
if( b == false) then
call UnitRemoveAbilityBJ( 'A00C', u )
set i = 1
loop
if(IsUnitAliveBJ(u) == false) then
set b = true
exitwhen 1 == 1
endif
exitwhen i > 20 - (3 * udg_player_invisibility_level[id])
call TriggerSleepAction(1.00)
set i = i + 1
endloop
if(b == false) then
call Trig_HintMessage(Player(id-1), "Ready|r: Invisibility")
endif
endif
set udg_gameplay_invisibility_cd[id] = false
else
call Trig_ErrorMessage(Player(id-1), "Error|r: cooldown")
endif
else
call Trig_ErrorMessage(Player(id-1), "Error|r: not available")
endif
endif
endif
endif
endif
endif
call RemoveLocation(p)
call RemoveLocation(poff)
call RemoveRect(r)
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_unit_order takes nothing returns nothing
set gg_trg_unit_order = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_unit_order, EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerRegisterAnyUnitEventBJ( gg_trg_unit_order, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddAction( gg_trg_unit_order, function Trig_unit_order_Actions )
endfunction
function Trig_trigger_mine_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer ut = GetUnitTypeId(u)
local integer idown = GetConvertedPlayerId(GetOwningPlayer(u))
local integer idsel = GetConvertedPlayerId(GetTriggerPlayer())
// ***************** TRIGGER MINE *****************
if(Trig_HeroAlive(idsel) == true) then
if ( ut == 'n00H' ) then
if(idown == idsel) then
call KillUnit(u)
call SelectUnitForPlayerSingle( udg_gameplay_hero[idsel], Player(idsel - 1) )
call TriggerSleepAction(0.01)
call ForceUIKeyBJ( Player(idsel - 1), "t" )
endif
endif
endif
endfunction
//===========================================================================
function InitTrig_unit_selection takes nothing returns nothing
set gg_trg_unit_selection = CreateTrigger( )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_unit_selection, Player(0), true )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_unit_selection, Player(1), true )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_unit_selection, Player(2), true )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_unit_selection, Player(3), true )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_unit_selection, Player(4), true )
call TriggerAddAction( gg_trg_unit_selection, function Trig_trigger_mine_Actions )
endfunction
// ***************** CHECK FOR BLOCKABLE *****************
function Trig_IsBlockable takes nothing returns boolean
if ( GetUnitTypeId(GetFilterUnit()) != 'n004' ) then
if ( GetUnitTypeId(GetFilterUnit()) != 'n00K' ) then
if ( GetUnitTypeId(GetFilterUnit()) != 'n00H' ) then
if ( GetUnitTypeId(GetFilterUnit()) != 'h00S' ) then
return true
endif
endif
endif
endif
return false
endfunction
//===========================================================================
// ***************** CHECK FOR TYPE BOMB BLOCKER WITH 1 MANA *****************
function Trig_UnitIsBombBlockerPathable takes nothing returns boolean
if ( GetUnitTypeId(GetFilterUnit()) == 'n00K' ) then
if ( GetUnitStateSwap(UNIT_STATE_MANA, GetFilterUnit()) == 1.00 ) then
return true
endif
endif
return false
endfunction
function Trig_BombPathing takes nothing returns nothing
local unit u = GetEnumUnit()
local location p = GetUnitLoc(u)
local rect r = RectFromCenterSizeBJ(p, 192.00, 192.00)
local group g = GetUnitsInRectMatching(r, Condition(function Trig_IsBlockable))
if ( IsUnitGroupEmptyBJ(g) == true ) then
call CreateNUnitsAtLoc( 1, 'n00F', Player(11), p, bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_gameplay_all_units )
call SetUnitManaBJ( u, 0.00 )
endif
call DestroyGroup(g)
call RemoveRect(r)
call RemoveLocation(p)
endfunction
function Trig_bomb_path_blocking_Actions takes nothing returns nothing
local group g = GetUnitsInRectMatching(gg_rct_grid, Condition(function Trig_UnitIsBombBlockerPathable))
call ForGroupBJ( g, function Trig_BombPathing )
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_bomb_path_blocking takes nothing returns nothing
set gg_trg_bomb_path_blocking = CreateTrigger( )
call TriggerAddAction( gg_trg_bomb_path_blocking, function Trig_bomb_path_blocking_Actions )
endfunction
function Trig_round_end_Actions takes nothing returns nothing
local integer i = 0
if ( CountUnitsInGroup(udg_gameplay_all_heroes) <= 1 ) then
if(udg_gameplay_game_on == true) then
set udg_gameplay_game_on = false
call PauseTimerBJ( true, udg_arena_suddendeath_timer )
call PauseTimerBJ( true, udg_arena_round_timer )
call PauseTimerBJ( true, udg_arena_round_timer_cd )
call TriggerSleepAction(0.10)
loop
exitwhen(i > 132)
if(IsUnitAliveBJ(udg_arena_blocker_d[i])) then
call SetUnitInvulnerable( udg_arena_blocker_d[i], true )
endif
set i = i + 1
endloop
set i = 1
loop
exitwhen(i > 5)
if(IsUnitAliveBJ(udg_gameplay_hero[i])) then
call SetUnitInvulnerable( udg_gameplay_hero[i], true )
call PauseUnitBJ( true, udg_gameplay_hero[i] )
endif
set i = i + 1
endloop
call ForGroupBJ( udg_gameplay_all_units, function Trig_StopPickedUnit )
call ForGroupBJ( udg_gameplay_all_units, function Trig_PausePickedUnit )
call TriggerSleepAction(0.10)
// ***************** WINNER? *****************
if(CountUnitsInGroup(udg_gameplay_all_heroes) == 1 ) then
if(Trig_HeroAlive(1) == true) then
set i = 1
else
if(Trig_HeroAlive(2) == true) then
set i = 2
else
if(Trig_HeroAlive(3) == true) then
set i = 3
else
if(Trig_HeroAlive(4) == true) then
set i = 4
else
set i = 5
endif
endif
endif
endif
call Trig_FloatText( udg_player_name[i] + " |cccffffffwon this round|r |cccffff66+" + I2S(R2I(500.00 * udg_setting_bounty)) + " coins|r")
call SetPlayerStateBJ( Player(i - 1), PLAYER_STATE_RESOURCE_GOLD, R2I(GetPlayerState(Player(i - 1), PLAYER_STATE_RESOURCE_GOLD) + 500 * udg_setting_bounty) )
set udg_player_win_count[i] = udg_player_win_count[i] + 1
call StopSoundBJ( udg_gameplay_sound_announce, false )
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUTIN, 1.50, "ReplaceableTextures\\winner.tga", 0, 100.00, 0, 0 )
call PlaySoundBJ( gg_snd_win )
set udg_gameplay_sound_announce = GetLastPlayedSound()
// ***************** ADJUST SCOREBOARD *****************
call ConditionalTriggerExecute( gg_trg_adjust_scoreboard )
// ***************** DRAW *****************
else
call StopSoundBJ( udg_gameplay_sound_announce, false )
if(udg_gameplay_timeup == false) then
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUTIN, 1.50, "ReplaceableTextures\\draw-fade.tga", 100.00, 0, 0, 0 )
call PlaySoundBJ( gg_snd_draw )
else
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUTIN, 1.50, "ReplaceableTextures\\timeup.tga", 100.00, 0, 0, 0 )
call PlaySoundBJ( gg_snd_timeup )
set udg_gameplay_timeup = false
endif
set udg_gameplay_sound_announce = GetLastPlayedSound()
endif
call TriggerSleepAction(1.50)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 3.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call TriggerSleepAction( 3.00 )
call DestroyTimerDialogBJ( udg_arena_round_timerwindow )
// ***************** CLEAR MAP *****************
call ConditionalTriggerExecute( gg_trg_clear_map )
// ***************** ARENA OR MARKET? *****************
if( udg_arena_round_count < udg_setting_round_count) then
set udg_arena_round_count = udg_arena_round_count + 1
// ***************** CREATE ARENA *****************
call ConditionalTriggerExecute( gg_trg_create_arena )
else
set udg_arena_round_count = 1
// ***************** CREATE MARKET *****************
call ConditionalTriggerExecute( gg_trg_create_market )
endif
endif
endif
endfunction
//===========================================================================
function InitTrig_round_end takes nothing returns nothing
set gg_trg_round_end = CreateTrigger( )
call TriggerAddAction( gg_trg_round_end, function Trig_round_end_Actions )
endfunction
function Trig_time_up_Actions takes nothing returns nothing
local integer i = 0
loop
exitwhen i > 2
call StopSoundBJ( udg_gameplay_sound_announce, false )
call PlaySoundBJ( gg_snd_beep )
set udg_gameplay_sound_announce = GetLastPlayedSound()
call TriggerSleepAction(1.00)
if(udg_gameplay_game_on == false) then
return
endif
if(i == 2) then
call DestroyTimerDialogBJ( udg_arena_round_timerwindow )
endif
set i = i + 1
endloop
set i = 1
loop
exitwhen( i > 5 )
if(IsUnitAliveBJ(udg_gameplay_hero[i]) == true) then
set udg_player_draw_count[i] = udg_player_draw_count[i] + 1
endif
set i = i + 1
endloop
call GroupClear( udg_gameplay_all_heroes )
set udg_gameplay_timeup = true
// ***************** ADJUST SCOREBOARD *****************
call ConditionalTriggerExecute( gg_trg_adjust_scoreboard )
// ***************** END ROUND *****************
call TriggerExecute( gg_trg_round_end )
endfunction
//===========================================================================
function InitTrig_time_up takes nothing returns nothing
set gg_trg_time_up = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_time_up, udg_arena_round_timer_cd )
call TriggerAddAction( gg_trg_time_up, function Trig_time_up_Actions )
endfunction
function Trig_sudden_death_start_Actions takes nothing returns nothing
call StopSoundBJ( udg_gameplay_sound_announce, false )
call PlaySoundBJ( gg_snd_suddendeath )
set udg_gameplay_sound_announce = GetLastPlayedSound()
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUTIN, 1.50, "ReplaceableTextures\\showdown.tga", 100.00, 0, 0, 0 )
call TimerDialogSetTitleColorBJ( udg_arena_round_timerwindow, 100, 20.00, 20, 0 )
call TimerDialogSetTimeColorBJ( udg_arena_round_timerwindow, 100, 20.00, 20, 0 )
if(udg_setting_chaosmode == false) then
call ConditionalTriggerExecute( udg_arena_suddendeath[udg_arena_id] )
else
call ConditionalTriggerExecute( udg_arena_suddendeath[GetRandomInt(0,4)] )
endif
endfunction
//===========================================================================
function InitTrig_sudden_death_start takes nothing returns nothing
set gg_trg_sudden_death_start = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_sudden_death_start, udg_arena_suddendeath_timer )
call TriggerAddAction( gg_trg_sudden_death_start, function Trig_sudden_death_start_Actions )
endfunction
function Trig_environment_blackrock_Actions takes nothing returns nothing
local location pne = GetRectCenter(udg_gameplay_grid_unplayable[23])
local location pnw = GetRectCenter(udg_gameplay_grid_unplayable[18])
local location pse = GetRectCenter(udg_gameplay_grid_unplayable[73])
local location psw = GetRectCenter(udg_gameplay_grid_unplayable[68])
local location pnet = null
local location pnwt = null
local location pset = null
local location pswt = null
local unit une = null
local unit unw = null
local unit use = null
local unit usw = null
local unit u = null
local rect r = null
local group g = null
// ***************** CREATE DUMMYS *****************
call CreateNUnitsAtLoc( 1, 'h001', Player(11), pne, bj_UNIT_FACING )
set une = GetLastCreatedUnit()
call GroupAddUnitSimple( une, udg_gameplay_all_units )
call CreateNUnitsAtLoc( 1, 'h001', Player(11), pnw, bj_UNIT_FACING )
set unw = GetLastCreatedUnit()
call GroupAddUnitSimple( unw, udg_gameplay_all_units )
call CreateNUnitsAtLoc( 1, 'h001', Player(11), pse, bj_UNIT_FACING )
set use = GetLastCreatedUnit()
call GroupAddUnitSimple( use, udg_gameplay_all_units )
call CreateNUnitsAtLoc( 1, 'h001', Player(11), psw, bj_UNIT_FACING )
set usw = GetLastCreatedUnit()
call GroupAddUnitSimple( usw, udg_gameplay_all_units )
// ***************** FIND LOCATIONS AND ATTACK *****************
loop
call TriggerSleepAction(1.00)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(1.00)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(1.00)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(1.00)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(1.00)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(1.00)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(1.00)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(1.00)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(1.00)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(1.00)
exitwhen(udg_gameplay_game_on == false)
loop
set pnet = OffsetLocation(pne, GetRandomInt(0, 4) * -128.00, (GetRandomInt(0, 4) + 1 ) * -128.00 )
set r = RectFromCenterSizeBJ(pnet, 128.00, 128.00)
set g = GetUnitsInRectMatching(r, Condition(function Trig_UnitIsBlockI))
exitwhen(IsUnitGroupEmptyBJ(g) == true )
endloop
call CreateNUnitsAtLoc( 1, 'h002', Player(11), pnet, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call UnitApplyTimedLifeBJ( ( DistanceBetweenPoints(pne, pnet) / 100.00 ), 'BTLF', u )
call IssuePointOrderLocBJ( une, "attackground", pnet )
loop
set pnwt = OffsetLocation(pnw, GetRandomInt(0, 4) * 128.00, (GetRandomInt(0, 4) + 1 ) * -128.00 )
set r = RectFromCenterSizeBJ(pnwt, 128.00, 128.00)
set g = GetUnitsInRectMatching(r, Condition(function Trig_UnitIsBlockI))
exitwhen(IsUnitGroupEmptyBJ(g) == true )
endloop
call CreateNUnitsAtLoc( 1, 'h002', Player(11), pnwt, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call UnitApplyTimedLifeBJ( ( DistanceBetweenPoints(pnw, pnwt) / 100.00 ), 'BTLF', u )
call IssuePointOrderLocBJ( unw, "attackground", pnwt )
loop
set pset = OffsetLocation(pse, GetRandomInt(0, 4) * -128.00, (GetRandomInt(0, 4) + 1 ) * 128.00 )
set r = RectFromCenterSizeBJ(pset, 128.00, 128.00)
set g = GetUnitsInRectMatching(r, Condition(function Trig_UnitIsBlockI))
exitwhen(IsUnitGroupEmptyBJ(g) == true )
endloop
call CreateNUnitsAtLoc( 1, 'h002', Player(11), pset, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call UnitApplyTimedLifeBJ( ( DistanceBetweenPoints(pse, pset) / 100.00 ), 'BTLF', u )
call IssuePointOrderLocBJ( use, "attackground", pset )
loop
set pswt = OffsetLocation(psw, GetRandomInt(0, 4) * 128.00, (GetRandomInt(0, 4) + 1 ) * 128.00 )
set r = RectFromCenterSizeBJ(pswt, 128.00, 128.00)
set g = GetUnitsInRectMatching(r, Condition(function Trig_UnitIsBlockI))
exitwhen(IsUnitGroupEmptyBJ(g) == true )
endloop
call CreateNUnitsAtLoc( 1, 'h002', Player(11), pswt, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call UnitApplyTimedLifeBJ( ( DistanceBetweenPoints(psw, pswt) / 200.00 ), 'BTLF', u )
call IssuePointOrderLocBJ( usw, "attackground", pswt )
// ***************** STOP ATTACK *****************
call TriggerSleepAction(1.00)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(1.00)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(1.00)
exitwhen(udg_gameplay_game_on == false)
call IssueImmediateOrderBJ( une, "stop" )
call IssueImmediateOrderBJ( unw, "stop" )
call IssueImmediateOrderBJ( use, "stop" )
call IssueImmediateOrderBJ( usw, "stop" )
endloop
call RemoveLocation(pne)
call RemoveLocation(pnw)
call RemoveLocation(pse)
call RemoveLocation(psw)
call RemoveLocation(pnet)
call RemoveLocation(pnwt)
call RemoveLocation(pset)
call RemoveLocation(pswt)
call RemoveRect(r)
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_environment_blackrock takes nothing returns nothing
set gg_trg_environment_blackrock = CreateTrigger( )
call TriggerAddAction( gg_trg_environment_blackrock, function Trig_environment_blackrock_Actions )
endfunction
function Trig_environment_northrend_Actions takes nothing returns nothing
local integer i = GetRandomInt(0,132)
local integer d = 0
local integer ioff = 0
local location p = GetRectCenter(udg_gameplay_grid_playable[i])
local location poff = null
local unit wisp = null
local unit u = null
local effect ef = null
loop
exitwhen(d > 29)
call TriggerSleepAction(1.00)
if(udg_gameplay_game_on == false) then
call RemoveLocation(p)
return
endif
set d = d + 1
endloop
// ***************** SPAWN WISP *****************
call CreateNUnitsAtLoc( 1, 'h006', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', u )
set d = 0
loop
exitwhen(d > 2)
call TriggerSleepAction(1.00)
if(udg_gameplay_game_on == false) then
call RemoveLocation(p)
return
endif
set d = d + 1
endloop
call PlaySoundBJ( gg_snd_wisp )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl" )
set ef = GetLastCreatedEffectBJ()
call TriggerSleepAction(0.50)
call DestroyEffectBJ(ef)
if(udg_gameplay_game_on == false) then
call RemoveLocation(p)
return
endif
call CreateNUnitsAtLoc( 1, 'h007', Player(11), p, bj_UNIT_FACING )
set wisp = GetLastCreatedUnit()
call GroupAddUnitSimple( wisp, udg_gameplay_all_units )
// ***************** FIRST MOVE *****************
loop
set ioff = GetRandomInt(0,132)
exitwhen(ioff != i)
endloop
set poff = GetRectCenter(udg_gameplay_grid_playable[ioff])
call IssuePointOrderLocBJ( wisp, "move", poff )
call CreateNUnitsAtLoc( 1, 'h006', Player(11), poff, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call UnitApplyTimedLifeBJ( ( DistanceBetweenPoints(p, poff) / 150.00 ), 'BTLF', u )
set d = 0
loop
exitwhen(d > 8)
call TriggerSleepAction((DistanceBetweenPoints(p, poff) / 150.00)/9)
if(udg_gameplay_game_on == false) then
call RemoveLocation(p)
call RemoveLocation(poff)
return
endif
set d = d + 1
endloop
// ***************** MOVE WISP *****************
loop
set p = poff
set i = ioff
loop
set ioff = GetRandomInt(0,132)
exitwhen(ioff != i)
endloop
set poff = GetRectCenter(udg_gameplay_grid_playable[ioff])
call IssuePointOrderLocBJ( wisp, "move", poff )
call CreateNUnitsAtLoc( 1, 'h006', Player(11), poff, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call UnitApplyTimedLifeBJ( ( DistanceBetweenPoints(p, poff) / 150.00 ), 'BTLF', u )
call TriggerSleepAction((DistanceBetweenPoints(p, poff) / 150.00)/9)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction((DistanceBetweenPoints(p, poff) / 150.00)/9)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction((DistanceBetweenPoints(p, poff) / 150.00)/9)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction((DistanceBetweenPoints(p, poff) / 150.00)/9)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction((DistanceBetweenPoints(p, poff) / 150.00)/9)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction((DistanceBetweenPoints(p, poff) / 150.00)/9)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction((DistanceBetweenPoints(p, poff) / 150.00)/9)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction((DistanceBetweenPoints(p, poff) / 150.00)/9)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction((DistanceBetweenPoints(p, poff) / 150.00)/9)
exitwhen(udg_gameplay_game_on == false)
endloop
call RemoveLocation(p)
call RemoveLocation(poff)
endfunction
//===========================================================================
function InitTrig_environment_northrend takes nothing returns nothing
set gg_trg_environment_northrend = CreateTrigger( )
call TriggerAddAction( gg_trg_environment_northrend, function Trig_environment_northrend_Actions )
endfunction
function Trig_environment_stranglethorn_Actions takes nothing returns nothing
local unit u
local integer i = 0
local integer array tree
local location p = null
local weathereffect rain = null
local weathereffect fog = null
loop
exitwhen(i>11)
call TriggerSleepAction(1.00)
if(udg_gameplay_game_on == false) then
return
endif
set i = i + 1
endloop
// ***************** APPLY WEATHER *****************
call AddWeatherEffectSaveLast( GetPlayableMapRect(), 'RAhr' )
set rain = GetLastCreatedWeatherEffect()
call EnableWeatherEffect( rain, true )
call AddWeatherEffectSaveLast( GetPlayableMapRect(), 'FDwh' )
set fog = GetLastCreatedWeatherEffect()
call EnableWeatherEffect( fog, true )
set i = 0
loop
exitwhen(i > 2)
call TriggerSleepAction(1.00)
if(udg_gameplay_game_on == false) then
call RemoveWeatherEffectBJ( rain )
call RemoveWeatherEffectBJ( fog )
return
endif
set i = i + 1
endloop
// ***************** GROW TREES *****************
set tree[0] = 8 + ((GetRandomInt(1, 6) * 10) + GetRandomInt(0, 5))
loop
set tree[1] = 8 + ((GetRandomInt(1, 6) * 10) + GetRandomInt(0, 5))
exitwhen(tree[1] != tree[0])
endloop
loop
set tree[2] = 8 + ((GetRandomInt(1, 6) * 10) + GetRandomInt(0, 5))
if( tree[2] != tree[0]) then
if( tree[2] != tree[1]) then
exitwhen(1==1)
endif
endif
endloop
loop
set tree[3] = 8 + ((GetRandomInt(1, 6) * 10) + GetRandomInt(0, 5))
if( tree[3] != tree[0]) then
if( tree[3] != tree[1]) then
if( tree[3] != tree[2]) then
exitwhen(1==1)
endif
endif
endif
endloop
loop
set tree[4] = 8 + ((GetRandomInt(1, 6) * 10) + GetRandomInt(0, 5))
if( tree[4] != tree[0]) then
if( tree[4] != tree[1]) then
if( tree[4] != tree[2]) then
if( tree[4] != tree[3]) then
exitwhen(1==1)
endif
endif
endif
endif
endloop
call PlaySoundBJ( gg_snd_grow )
set i = 0
loop
exitwhen(i > 4)
set p = GetRectCenter(udg_gameplay_grid_unplayable[tree[i]])
call CreateNUnitsAtLoc( 1, 'h005', Player(11), p, GetRandomReal(0, 360) )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitAnimation( u, "birth" )
call SetUnitTimeScalePercent( u, 3000.00 )
set i = i + 1
endloop
// ***************** WAIT FOR ROUND END *****************
loop
call TriggerSleepAction(1.00)
exitwhen(udg_gameplay_game_on==false)
endloop
call RemoveLocation(p)
call RemoveWeatherEffectBJ( rain )
call RemoveWeatherEffectBJ( fog )
endfunction
//===========================================================================
function InitTrig_environment_stranglethorn takes nothing returns nothing
set gg_trg_environment_stranglethorn = CreateTrigger( )
call TriggerAddAction( gg_trg_environment_stranglethorn, function Trig_environment_stranglethorn_Actions )
endfunction
function Trig_environment_lordaeron_Actions takes nothing returns nothing
// ***************** PLACEHOLDER *****************
endfunction
//===========================================================================
function InitTrig_environment_lordaeron takes nothing returns nothing
set gg_trg_environment_lordaeron = CreateTrigger( )
call TriggerAddAction( gg_trg_environment_lordaeron, function Trig_environment_lordaeron_Actions )
endfunction
function Trig_environment_tanaris_Actions takes nothing returns nothing
local location p = GetRectCenter(gg_rct_tanaris_whirlpool_01)
local unit u = null
call CreateNUnitsAtLoc( 1, 'h015', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitAnimation( u, "birth" )
set p = GetRectCenter(gg_rct_tanaris_whirlpool_02)
call CreateNUnitsAtLoc( 1, 'h015', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitAnimation( u, "birth" )
set p = GetRectCenter(gg_rct_tanaris_whirlpool_03)
call CreateNUnitsAtLoc( 1, 'h015', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitAnimation( u, "birth" )
set p = GetRectCenter(gg_rct_tanaris_whirlpool_04)
call CreateNUnitsAtLoc( 1, 'h015', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitAnimation( u, "birth" )
call EnableTrigger( gg_trg_environment_durotar_whirlpool )
call TriggerSleepAction(0.50)
call KillUnit(udg_arena_blocker_d[110])
call KillUnit(udg_arena_blocker_d[102])
call KillUnit(udg_arena_blocker_d[22])
call KillUnit(udg_arena_blocker_d[30])
loop
exitwhen udg_gameplay_game_on == false
call TriggerSleepAction(1.00)
endloop
call DisableTrigger( gg_trg_environment_durotar_whirlpool )
call RemoveLocation(p)
endfunction
//===========================================================================
function InitTrig_environment_durotar takes nothing returns nothing
set gg_trg_environment_durotar = CreateTrigger( )
call TriggerAddAction( gg_trg_environment_durotar, function Trig_environment_tanaris_Actions )
endfunction
function Trig_environment_tanaris_whirlpool_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit dummy = null
local integer id = GetConvertedPlayerId(GetOwningPlayer(u))
local integer random = 0
local location array p
call TriggerSleepAction(0.05)
if(IsUnitInGroup(u, udg_gameplay_all_heroes)) then
if(udg_gameplay_hero_poolvalid[id] == true) then
loop
set p[3] = GetUnitLoc(u)
if(RectContainsUnit(udg_gameplay_grid_playable[110], u) ) then
set p[0] = GetRectCenter(gg_rct_tanaris_whirlpool_02)
set p[1] = GetRectCenter(gg_rct_tanaris_whirlpool_03)
set p[2] = GetRectCenter(gg_rct_tanaris_whirlpool_04)
else
if(RectContainsUnit(udg_gameplay_grid_playable[102], u) ) then
set p[0] = GetRectCenter(gg_rct_tanaris_whirlpool_01)
set p[1] = GetRectCenter(gg_rct_tanaris_whirlpool_03)
set p[2] = GetRectCenter(gg_rct_tanaris_whirlpool_04)
else
if(RectContainsUnit(udg_gameplay_grid_playable[22], u) ) then
set p[0] = GetRectCenter(gg_rct_tanaris_whirlpool_01)
set p[1] = GetRectCenter(gg_rct_tanaris_whirlpool_02)
set p[2] = GetRectCenter(gg_rct_tanaris_whirlpool_04)
else
set p[0] = GetRectCenter(gg_rct_tanaris_whirlpool_01)
set p[1] = GetRectCenter(gg_rct_tanaris_whirlpool_02)
set p[2] = GetRectCenter(gg_rct_tanaris_whirlpool_03)
endif
endif
endif
set udg_gameplay_hero_valid[id] = false
set udg_gameplay_hero_poolvalid[id] = false
call SetUnitInvulnerable( udg_gameplay_hero[id], true )
call PauseUnitBJ( true, udg_gameplay_hero[id] )
call CreateNUnitsAtLoc( 1, 'h016', Player(11), p[3], bj_UNIT_FACING )
set dummy = GetLastCreatedUnit()
call GroupAddUnitSimple( dummy, udg_gameplay_all_units )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', dummy )
call UnitAddAbilityBJ( 'A00D', dummy )
call IssueTargetOrderBJ( dummy, "cyclone", u )
call TriggerSleepAction(1.40)
set random = GetRandomInt(0,2)
call UnitRemoveBuffBJ( 'Bcyc', u )
call UnitRemoveBuffBJ( 'Bcy2', u )
call SetUnitPositionLoc( u, p[random])
call AddSpecialEffectLocBJ( p[random], "Abilities\\Spells\\Orc\\FeralSpirit\\feralspirittarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
if(udg_gameplay_game_on == true) then
call SetUnitInvulnerable( udg_gameplay_hero[id], false )
call PauseUnitBJ( false, udg_gameplay_hero[id] )
endif
call SelectUnitForPlayerSingle( udg_gameplay_hero[id], Player(id - 1) )
call ForceUIKeyBJ( Player(id - 1), "t" )
set udg_gameplay_hero_valid[id] = true
call TriggerSleepAction(5.00)
set udg_gameplay_hero_poolvalid[id] = true
if(RectContainsUnit(gg_rct_tanaris_whirlpool_01, u) == false) then
if(RectContainsUnit(gg_rct_tanaris_whirlpool_02, u) == false) then
if(RectContainsUnit(gg_rct_tanaris_whirlpool_03, u) == false) then
exitwhen RectContainsUnit(gg_rct_tanaris_whirlpool_04, u) == false
endif
endif
endif
endloop
endif
endif
call RemoveLocation(p[0])
call RemoveLocation(p[1])
call RemoveLocation(p[2])
call RemoveLocation(p[3])
endfunction
//===========================================================================
function InitTrig_environment_durotar_whirlpool takes nothing returns nothing
set gg_trg_environment_durotar_whirlpool = CreateTrigger( )
call DisableTrigger( gg_trg_environment_durotar_whirlpool )
call TriggerRegisterEnterRectSimple( gg_trg_environment_durotar_whirlpool, gg_rct_tanaris_whirlpool_01 )
call TriggerRegisterEnterRectSimple( gg_trg_environment_durotar_whirlpool, gg_rct_tanaris_whirlpool_02 )
call TriggerRegisterEnterRectSimple( gg_trg_environment_durotar_whirlpool, gg_rct_tanaris_whirlpool_03 )
call TriggerRegisterEnterRectSimple( gg_trg_environment_durotar_whirlpool, gg_rct_tanaris_whirlpool_04 )
call TriggerAddAction( gg_trg_environment_durotar_whirlpool, function Trig_environment_tanaris_whirlpool_Actions )
endfunction
function Trig_sudden_death_blackrock_Actions takes nothing returns nothing
local location p = GetRectCenter(udg_gameplay_grid_playable[66])
local location poff = null
local unit u = null
local unit udummy = null
// ***************** SPAWN VULCAN *****************
call CreateNUnitsAtLoc( 1, 'h003', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', u )
call TriggerSleepAction(1.00)
if(udg_gameplay_game_on == false) then
call RemoveLocation(p)
return
endif
call TriggerSleepAction(1.00)
if(udg_gameplay_game_on == false) then
call RemoveLocation(p)
return
endif
call TriggerSleepAction(1.00)
if(udg_gameplay_game_on == true) then
call PlaySoundBJ( gg_snd_quake )
call CreateNUnitsAtLoc( 1, 'n005', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitAnimation( u, "birth" )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
set p = GetRectCenter(udg_gameplay_grid_playable[65])
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set p = GetRectCenter(udg_gameplay_grid_playable[66])
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set p = GetRectCenter(udg_gameplay_grid_playable[67])
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set p = GetRectCenter(udg_gameplay_grid_playable[56])
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set p = GetRectCenter(udg_gameplay_grid_playable[76])
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set p = GetRectCenter(udg_gameplay_grid_playable[66])
call CreateNUnitsAtLoc( 1, 'h001', Player(11), p, bj_UNIT_FACING )
set udummy = GetLastCreatedUnit()
call GroupAddUnitSimple( udummy, udg_gameplay_all_units )
call UnitDamagePointLoc( udummy, 0, 160.00, p, 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
// ***************** ATTACK TARGET LOCATION *****************
loop
exitwhen(udg_gameplay_game_on == false)
set poff = GetRectCenter(udg_gameplay_grid_playable[GetRandomInt(0,132)])
call CreateNUnitsAtLoc( 1, 'h002', Player(11), poff, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call UnitApplyTimedLifeBJ( ( DistanceBetweenPoints(p, poff) / 200.00 ), 'BTLF', u )
call IssuePointOrderLocBJ( udummy, "attackground", poff )
call TriggerSleepAction( 1.00)
endloop
call RemoveLocation(poff)
endif
call RemoveLocation(p)
endfunction
//===========================================================================
function InitTrig_sudden_death_blackrock takes nothing returns nothing
set gg_trg_sudden_death_blackrock = CreateTrigger( )
call TriggerAddAction( gg_trg_sudden_death_blackrock, function Trig_sudden_death_blackrock_Actions )
endfunction
function Trig_sudden_death_northrend_Actions takes nothing returns nothing
local integer i = 0
local integer d = 0
local group g = null
local location array p
local rect r = null
local weathereffect we = null
local unit u = null
local boolean array b
// ***************** APPLY WEATHER *****************
call PlaySoundBJ( gg_snd_frost )
call AddWeatherEffectSaveLast( GetPlayableMapRect(), 'SNbs' )
set we = GetLastCreatedWeatherEffect()
call EnableWeatherEffect( we, true )
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 5.00, "ReplaceableTextures\\CameraMasks\\HazeFilter_mask.blp", 30.00, 30.00, 80.00, 0 )
// ***************** FREEZE TARGET PATTERN *****************
loop
exitwhen(udg_gameplay_game_on == false)
loop
set i = GetRandomInt(0,132)
set g = GetUnitsInRectMatching(udg_gameplay_grid_playable[i], Condition(function Trig_UnitIsBlockD))
exitwhen( IsUnitGroupEmptyBJ(g) == true)
call TriggerSleepAction(0.01)
endloop
if(udg_gameplay_game_on == false) then
exitwhen(1==1)
endif
set p[0] = GetRectCenter(udg_gameplay_grid_playable[i])
set p[1] = OffsetLocation(p[0], 0, 128.00)
set p[2] = OffsetLocation(p[0], 0, -128.00)
set p[3] = OffsetLocation(p[0], 128.00, 0)
set p[4] = OffsetLocation(p[0], -128.00, 0)
set p[5] = OffsetLocation(p[0], -128.00, 128.00)
set p[6] = OffsetLocation(p[0], 128.00, 128.00)
set p[7] = OffsetLocation(p[0], 128.00, -128)
set p[8] = OffsetLocation(p[0], -128.00, -128)
set i = 0
loop
exitwhen(i>8)
set r = RectFromCenterSizeBJ(p[i], 128.00, 128.00)
set g = GetUnitsInRectMatching(r, Condition(function Trig_UnitIsBlock))
if(IsUnitGroupEmptyBJ(g) == true) then
call CreateNUnitsAtLoc( 1, 'h004', Player(11), p[i], bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', u )
set b[i] = true
else
set b[i] = false
endif
set i = i + 1
endloop
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
if( udg_gameplay_game_on == true) then
set i = 0
loop
exitwhen(i>8)
if(b[i] == true) then
set d = 0
loop
exitwhen (RectContainsLoc(udg_gameplay_grid_playable[d], p[i]) == true)
set d = d + 1
endloop
call AddSpecialEffectLocBJ( p[i], "Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call CreateNUnitsAtLoc( 1, 'n006', Player(11), p[i], bj_UNIT_FACING )
set udg_arena_block_d[d] = GetLastCreatedUnit()
call SetUnitAnimation( udg_arena_block_d[d], "birth" )
call CreateNUnitsAtLoc( 1, 'n00C', Player(11), p[i], bj_UNIT_FACING )
set udg_arena_blocker_d[d] = GetLastCreatedUnit()
call SetUnitUserData( udg_arena_blocker_d[d], d )
endif
set i = i + 1
endloop
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(0.10)
exitwhen(udg_gameplay_game_on == false)
endif
call RemoveLocation(p[0])
call RemoveLocation(p[1])
call RemoveLocation(p[2])
call RemoveLocation(p[3])
call RemoveLocation(p[4])
call RemoveLocation(p[5])
call RemoveLocation(p[6])
call RemoveLocation(p[7])
call RemoveLocation(p[8])
endloop
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 0.00, "ReplaceableTextures\\CameraMasks\\HazeFilter_mask.blp", 30.00, 30.00, 80.00, 0 )
call RemoveWeatherEffectBJ( we )
call RemoveRect(r)
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_sudden_death_northrend takes nothing returns nothing
set gg_trg_sudden_death_northrend = CreateTrigger( )
call TriggerAddAction( gg_trg_sudden_death_northrend, function Trig_sudden_death_northrend_Actions )
endfunction
// ***************** CHECK FOR TYPE CORRUPTED TREANT *****************
function Trig_UnitIsTreant takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == 'h009' )
endfunction
// ***************** CHECK FOR TYPE TREE VISION BLOCKER *****************
function Trig_UnitIsTree takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == 'h005' )
endfunction
// ***************** CHANGE PICKED UNITS ANIMATION SPEED *****************
function Trig_ChangePickedUnitAnimationSpeed takes nothing returns nothing
call SetUnitTimeScalePercent( GetEnumUnit(), 100.00 )
endfunction
// ***************** MOVE PICKED UNIT *****************
function Trig_MovePickedUnit takes nothing returns nothing
local location p = GetRectCenter(udg_gameplay_grid_playable[GetRandomInt(0,132)])
call IssuePointOrderLocBJ( GetEnumUnit(), "move", p )
call RemoveLocation(p)
endfunction
function Trig_sudden_death_stranglethorn_Actions takes nothing returns nothing
local integer i = 0
local location p = GetRectCenter(udg_gameplay_grid_playable[66])
local unit u = null
local group g = GetUnitsOfPlayerMatching(Player(11), Condition(function Trig_UnitIsTree))
// ***************** APPLY WEATHER *****************
call SetTimeOfDay( 0 )
call SetTerrainTypeBJ( p, 'Cvin', -1, 7, 1 )
// ***************** CHANGE MAP *****************
loop
exitwhen(i > 132)
if(IsUnitAliveBJ(udg_arena_blocker_d[i])) then
call KillUnit(udg_arena_blocker_d[i])
endif
set i = i + 1
endloop
call ForGroupBJ( g, function Trig_KillPickedUnit )
call ForGroupBJ( g, function Trig_ChangePickedUnitAnimationSpeed )
set i = 0
loop
exitwhen(i>91)
call SetUnitVertexColorBJ( udg_arena_block_i[i], 100.00, 40.00, 100, 0 )
set i = i + 1
endloop
// ***************** SPAWN ROOT *****************
call CreateNUnitsAtLoc( 1, 'h008', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitAnimation( u, "birth" )
call TriggerSleepAction(1.00)
if( udg_gameplay_game_on == false) then
call RemoveLocation(p)
call DestroyGroup(g)
call SetTimeOfDay( 12 )
return
endif
call TriggerSleepAction(0.50)
if( udg_gameplay_game_on == false) then
call RemoveLocation(p)
call DestroyGroup(g)
call SetTimeOfDay( 12 )
return
endif
// ***************** SPAWN FIRST TREANTS *****************
set i = 0
loop
exitwhen(i>4)
call TriggerSleepAction(0.50)
exitwhen(udg_gameplay_game_on == false)
set p = GetRectCenter(udg_gameplay_grid_playable[66])
call CreateNUnitsAtLoc( 1, 'h009', Player(11), p, GetRandomReal(0, 360) )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
set p = GetRectCenter(udg_gameplay_grid_playable[GetRandomInt(0,132)])
call IssuePointOrderLocBJ( u, "move", p )
set i = i + 1
endloop
set g = GetUnitsOfPlayerMatching(Player(11), Condition(function Trig_UnitIsTreant))
set p = GetRectCenter(udg_gameplay_grid_playable[66])
// ***************** SPAWN TREANTS *****************
if( udg_gameplay_game_on == true) then
loop
call TriggerSleepAction(CountUnitsInGroup(g) * 0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(CountUnitsInGroup(g) * 0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(CountUnitsInGroup(g) * 0.10)
exitwhen(udg_gameplay_game_on == false)
call TriggerSleepAction(CountUnitsInGroup(g) * 0.10)
exitwhen(udg_gameplay_game_on == false)
call CreateNUnitsAtLoc( 1, 'h009', Player(11), p, GetRandomReal(0, 360) )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
set g = GetUnitsOfPlayerMatching(Player(11), Condition(function Trig_UnitIsTreant))
call ForGroupBJ( g, function Trig_MovePickedUnit )
endloop
endif
call RemoveLocation(p)
call DestroyGroup(g)
call SetTimeOfDay( 12 )
endfunction
//===========================================================================
function InitTrig_sudden_death_stranglethorn takes nothing returns nothing
set gg_trg_sudden_death_stranglethorn = CreateTrigger( )
call TriggerAddAction( gg_trg_sudden_death_stranglethorn, function Trig_sudden_death_stranglethorn_Actions )
endfunction
function Trig_sudden_death_lordaeron_Actions takes nothing returns nothing
local integer i = 0
local location p = GetRectCenter(udg_gameplay_grid_playable[66])
local boolean b = true
local unit u = null
local unit castere = null
local unit casterw = null
local integer d = 0
// ***************** SPAWN SORCERESS *****************
set p = OffsetLocation(p, 1280.00, 0)
call CreateNUnitsAtLoc( 1, 'h00B', Player(11), p, 160.00 )
set castere = GetLastCreatedUnit()
call GroupAddUnitSimple( castere, udg_gameplay_all_units )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
set p = OffsetLocation(p, -2560.00, 0)
call CreateNUnitsAtLoc( 1, 'h00B', Player(11), p, 60.00 )
set casterw = GetLastCreatedUnit()
call GroupAddUnitSimple( casterw, udg_gameplay_all_units )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call TriggerSleepAction(1.00)
if(udg_gameplay_game_on==false) then
call RemoveLocation(p)
return
endif
call SetUnitAnimation( casterw, "spell" )
call SetUnitAnimation( castere, "spell" )
call AddSpecialEffectTargetUnitBJ( "weapon", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "weapon", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
// ***************** FIRST SQUARE *****************
loop
exitwhen(i>12)
set p = GetRectCenter(udg_gameplay_grid_playable[i])
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_i[udg_arena_id], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitVertexColorBJ( u, 100, 100, 100, 50.00 )
set d = d + 1
if (d == 5) then
set d = 0
call SetUnitAnimation( casterw, "spell" )
call SetUnitAnimation( castere, "spell" )
call AddSpecialEffectTargetUnitBJ( "weapon", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "weapon", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
call SetUnitFacingToFaceLocTimed( casterw, p, 0.50 )
call SetUnitFacingToFaceLocTimed( castere, p, 0.50 )
call TriggerSleepAction(0.30)
if(udg_gameplay_game_on==false) then
call RemoveLocation(p)
return
endif
if(IsUnitAliveBJ(udg_arena_blocker_d[i])) then
call RemoveUnit(udg_arena_blocker_d[i])
endif
call SetUnitVertexColorBJ( u, 100, 100, 100, 0.00 )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( u, 0, 64.00, p, 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set i = i + 1
endloop
set i = 19
loop
exitwhen(i>119)
set p = GetRectCenter(udg_gameplay_grid_playable[i])
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_i[udg_arena_id], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitVertexColorBJ( u, 100, 100, 100, 50.00 )
set d = d + 1
if (d == 5) then
set d = 0
call SetUnitAnimation( casterw, "spell" )
call SetUnitAnimation( castere, "spell" )
call AddSpecialEffectTargetUnitBJ( "weapon", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "weapon", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
call SetUnitFacingToFaceLocTimed( casterw, p, 0.50 )
call SetUnitFacingToFaceLocTimed( castere, p, 0.50 )
call TriggerSleepAction(0.30)
if(udg_gameplay_game_on==false) then
call RemoveLocation(p)
return
endif
if(IsUnitAliveBJ(udg_arena_blocker_d[i])) then
call RemoveUnit(udg_arena_blocker_d[i])
endif
call SetUnitVertexColorBJ( u, 100, 100, 100, 0.00 )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( u, 0, 64.00, p, 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
if( b == true) then
set i = i + 13
set b = false
else
set i = i + 7
set b = true
endif
endloop
set i = 132
loop
exitwhen(i<120)
set p = GetRectCenter(udg_gameplay_grid_playable[i])
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_i[udg_arena_id], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitVertexColorBJ( u, 100, 100, 100, 50.00 )
set d = d + 1
if (d == 5) then
set d = 0
call SetUnitAnimation( casterw, "spell" )
call SetUnitAnimation( castere, "spell" )
call AddSpecialEffectTargetUnitBJ( "weapon", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "weapon", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
call SetUnitFacingToFaceLocTimed( casterw, p, 0.50 )
call SetUnitFacingToFaceLocTimed( castere, p, 0.50 )
call TriggerSleepAction(0.30)
if(udg_gameplay_game_on==false) then
call RemoveLocation(p)
return
endif
if(IsUnitAliveBJ(udg_arena_blocker_d[i])) then
call RemoveUnit(udg_arena_blocker_d[i])
endif
call SetUnitVertexColorBJ( u, 100, 100, 100, 0.00 )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( u, 0, 64.00, p, 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set i = i - 1
endloop
set i = 113
set b = true
loop
exitwhen(i<13)
set p = GetRectCenter(udg_gameplay_grid_playable[i])
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_i[udg_arena_id], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitVertexColorBJ( u, 100, 100, 100, 50.00 )
set d = d + 1
if (d == 5) then
set d = 0
call SetUnitAnimation( casterw, "spell" )
call SetUnitAnimation( castere, "spell" )
call AddSpecialEffectTargetUnitBJ( "weapon", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "weapon", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
call SetUnitFacingToFaceLocTimed( casterw, p, 0.50 )
call SetUnitFacingToFaceLocTimed( castere, p, 0.50 )
call TriggerSleepAction(0.30)
if(udg_gameplay_game_on==false) then
call RemoveLocation(p)
return
endif
if(IsUnitAliveBJ(udg_arena_blocker_d[i])) then
call RemoveUnit(udg_arena_blocker_d[i])
endif
call SetUnitVertexColorBJ( u, 100, 100, 100, 0.00 )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( u, 0, 64.00, p, 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
if( b == true) then
set i = i - 13
set b = false
else
set i = i - 7
set b = true
endif
endloop
// ***************** SECOND SQUARE *****************
set i = 14
loop
exitwhen(i>18)
set p = GetRectCenter(udg_gameplay_grid_playable[i])
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_i[udg_arena_id], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitVertexColorBJ( u, 100, 100, 100, 50.00 )
set d = d + 1
if (d == 5) then
set d = 0
call SetUnitAnimation( casterw, "spell" )
call SetUnitAnimation( castere, "spell" )
call AddSpecialEffectTargetUnitBJ( "weapon", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "weapon", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
call SetUnitFacingToFaceLocTimed( casterw, p, 0.50 )
call SetUnitFacingToFaceLocTimed( castere, p, 0.50 )
call TriggerSleepAction(0.30)
if(udg_gameplay_game_on==false) then
call RemoveLocation(p)
return
endif
if(IsUnitAliveBJ(udg_arena_blocker_d[i])) then
call RemoveUnit(udg_arena_blocker_d[i])
endif
call SetUnitVertexColorBJ( u, 100, 100, 100, 0.00 )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( u, 0, 64.00, p, 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set i = i + 1
endloop
set i = 31
loop
exitwhen(i>111)
set p = GetRectCenter(udg_gameplay_grid_playable[i])
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_i[udg_arena_id], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitVertexColorBJ( u, 100, 100, 100, 50.00 )
set d = d + 1
if (d == 5) then
set d = 0
call SetUnitAnimation( casterw, "spell" )
call SetUnitAnimation( castere, "spell" )
call AddSpecialEffectTargetUnitBJ( "weapon", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "weapon", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
call SetUnitFacingToFaceLocTimed( casterw, p, 0.50 )
call SetUnitFacingToFaceLocTimed( castere, p, 0.50 )
call TriggerSleepAction(0.30)
if(udg_gameplay_game_on==false) then
call RemoveLocation(p)
return
endif
if(IsUnitAliveBJ(udg_arena_blocker_d[i])) then
call RemoveUnit(udg_arena_blocker_d[i])
endif
call SetUnitVertexColorBJ( u, 100, 100, 100, 0.00 )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( u, 0, 64.00, p, 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set i = i + 20
endloop
set i = 118
loop
exitwhen(i<114)
set p = GetRectCenter(udg_gameplay_grid_playable[i])
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_i[udg_arena_id], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitVertexColorBJ( u, 100, 100, 100, 50.00 )
set d = d + 1
if (d == 5) then
set d = 0
call SetUnitAnimation( casterw, "spell" )
call SetUnitAnimation( castere, "spell" )
call AddSpecialEffectTargetUnitBJ( "weapon", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "weapon", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
call SetUnitFacingToFaceLocTimed( casterw, p, 0.50 )
call SetUnitFacingToFaceLocTimed( castere, p, 0.50 )
call TriggerSleepAction(0.30)
if(udg_gameplay_game_on==false) then
call RemoveLocation(p)
return
endif
if(IsUnitAliveBJ(udg_arena_blocker_d[i])) then
call RemoveUnit(udg_arena_blocker_d[i])
endif
call SetUnitVertexColorBJ( u, 100, 100, 100, 0.00 )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( u, 0, 64.00, p, 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set i = i - 1
endloop
set i = 101
loop
exitwhen(i<21)
set p = GetRectCenter(udg_gameplay_grid_playable[i])
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_i[udg_arena_id], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitVertexColorBJ( u, 100, 100, 100, 50.00 )
set d = d + 1
if (d == 5) then
set d = 0
call SetUnitAnimation( casterw, "spell" )
call SetUnitAnimation( castere, "spell" )
call AddSpecialEffectTargetUnitBJ( "weapon", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "weapon", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
call SetUnitFacingToFaceLocTimed( casterw, p, 0.50 )
call SetUnitFacingToFaceLocTimed( castere, p, 0.50 )
call TriggerSleepAction(0.30)
if(udg_gameplay_game_on==false) then
call RemoveLocation(p)
return
endif
if(IsUnitAliveBJ(udg_arena_blocker_d[i])) then
call RemoveUnit(udg_arena_blocker_d[i])
endif
call SetUnitVertexColorBJ( u, 100, 100, 100, 0.00 )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( u, 0, 64.00, p, 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set i = i - 20
endloop
// ***************** THIRD SQUARE *****************
set i = 22
loop
exitwhen(i>30)
set p = GetRectCenter(udg_gameplay_grid_playable[i])
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_i[udg_arena_id], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitVertexColorBJ( u, 100, 100, 100, 50.00 )
set d = d + 1
if (d == 5) then
set d = 0
call SetUnitAnimation( casterw, "spell" )
call SetUnitAnimation( castere, "spell" )
call AddSpecialEffectTargetUnitBJ( "weapon", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "weapon", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
call SetUnitFacingToFaceLocTimed( casterw, p, 0.50 )
call SetUnitFacingToFaceLocTimed( castere, p, 0.50 )
call TriggerSleepAction(0.30)
if(udg_gameplay_game_on==false) then
call RemoveLocation(p)
return
endif
if(IsUnitAliveBJ(udg_arena_blocker_d[i])) then
call RemoveUnit(udg_arena_blocker_d[i])
endif
call SetUnitVertexColorBJ( u, 100, 100, 100, 0.00 )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( u, 0, 64.00, p, 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set i = i + 1
endloop
set i = 38
set b = true
loop
exitwhen(i>98)
set p = GetRectCenter(udg_gameplay_grid_playable[i])
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_i[udg_arena_id], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitVertexColorBJ( u, 100, 100, 100, 50.00 )
set d = d + 1
if (d == 5) then
set d = 0
call SetUnitAnimation( casterw, "spell" )
call SetUnitAnimation( castere, "spell" )
call AddSpecialEffectTargetUnitBJ( "weapon", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "weapon", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
call SetUnitFacingToFaceLocTimed( casterw, p, 0.50 )
call SetUnitFacingToFaceLocTimed( castere, p, 0.50 )
call TriggerSleepAction(0.30)
if(udg_gameplay_game_on==false) then
call RemoveLocation(p)
return
endif
if(IsUnitAliveBJ(udg_arena_blocker_d[i])) then
call RemoveUnit(udg_arena_blocker_d[i])
endif
call SetUnitVertexColorBJ( u, 100, 100, 100, 0.00 )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( u, 0, 64.00, p, 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
if( b == true) then
set i = i + 12
set b = false
else
set i = i + 8
set b = true
endif
endloop
set i = 110
loop
exitwhen(i<102)
set p = GetRectCenter(udg_gameplay_grid_playable[i])
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_i[udg_arena_id], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitVertexColorBJ( u, 100, 100, 100, 50.00 )
set d = d + 1
if (d == 5) then
set d = 0
call SetUnitAnimation( casterw, "spell" )
call SetUnitAnimation( castere, "spell" )
call AddSpecialEffectTargetUnitBJ( "weapon", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "weapon", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
call SetUnitFacingToFaceLocTimed( casterw, p, 0.50 )
call SetUnitFacingToFaceLocTimed( castere, p, 0.50 )
call TriggerSleepAction(0.30)
if(udg_gameplay_game_on==false) then
call RemoveLocation(p)
return
endif
if(IsUnitAliveBJ(udg_arena_blocker_d[i])) then
call RemoveUnit(udg_arena_blocker_d[i])
endif
call SetUnitVertexColorBJ( u, 100, 100, 100, 0.00 )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( u, 0, 64.00, p, 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set i = i - 1
endloop
set i = 94
set b = true
loop
exitwhen(i<34)
set p = GetRectCenter(udg_gameplay_grid_playable[i])
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_i[udg_arena_id], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitVertexColorBJ( u, 100, 100, 100, 50.00 )
set d = d + 1
if (d == 5) then
set d = 0
call SetUnitAnimation( casterw, "spell" )
call SetUnitAnimation( castere, "spell" )
call AddSpecialEffectTargetUnitBJ( "weapon", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "weapon", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
call SetUnitFacingToFaceLocTimed( casterw, p, 0.50 )
call SetUnitFacingToFaceLocTimed( castere, p, 0.50 )
call TriggerSleepAction(0.30)
if(udg_gameplay_game_on==false) then
call RemoveLocation(p)
return
endif
if(IsUnitAliveBJ(udg_arena_blocker_d[i])) then
call RemoveUnit(udg_arena_blocker_d[i])
endif
call SetUnitVertexColorBJ( u, 100, 100, 100, 0.00 )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( u, 0, 64.00, p, 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
if( b == true) then
set i = i - 12
set b = false
else
set i = i - 8
set b = true
endif
endloop
// ***************** FOURTH SQUARE *****************
set i = 35
loop
exitwhen(i>37)
set p = GetRectCenter(udg_gameplay_grid_playable[i])
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_i[udg_arena_id], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitVertexColorBJ( u, 100, 100, 100, 50.00 )
set d = d + 1
if (d == 5) then
set d = 0
set d = 0
call SetUnitAnimation( casterw, "spell" )
call SetUnitAnimation( castere, "spell" )
call AddSpecialEffectTargetUnitBJ( "weapon", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "weapon", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
call SetUnitFacingToFaceLocTimed( casterw, p, 0.50 )
call SetUnitFacingToFaceLocTimed( castere, p, 0.50 )
call TriggerSleepAction(0.30)
if(udg_gameplay_game_on==false) then
call RemoveLocation(p)
return
endif
if(IsUnitAliveBJ(udg_arena_blocker_d[i])) then
call RemoveUnit(udg_arena_blocker_d[i])
endif
call SetUnitVertexColorBJ( u, 100, 100, 100, 0.00 )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( u, 0, 64.00, p, 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set i = i + 1
endloop
set i = 49
loop
exitwhen(i>89)
set p = GetRectCenter(udg_gameplay_grid_playable[i])
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_i[udg_arena_id], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitVertexColorBJ( u, 100, 100, 100, 50.00 )
set d = d + 1
if (d == 5) then
set d = 0
call SetUnitAnimation( casterw, "spell" )
call SetUnitAnimation( castere, "spell" )
call AddSpecialEffectTargetUnitBJ( "weapon", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "weapon", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
call SetUnitFacingToFaceLocTimed( casterw, p, 0.50 )
call SetUnitFacingToFaceLocTimed( castere, p, 0.50 )
call TriggerSleepAction(0.30)
if(udg_gameplay_game_on==false) then
call RemoveLocation(p)
return
endif
if(IsUnitAliveBJ(udg_arena_blocker_d[i])) then
call RemoveUnit(udg_arena_blocker_d[i])
endif
call SetUnitVertexColorBJ( u, 100, 100, 100, 0.00 )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( u, 0, 64.00, p, 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set i = i + 20
endloop
set i = 97
loop
exitwhen(i<95)
set p = GetRectCenter(udg_gameplay_grid_playable[i])
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_i[udg_arena_id], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitVertexColorBJ( u, 100, 100, 100, 50.00 )
set d = d + 1
if (d == 5) then
set d = 0
call SetUnitAnimation( casterw, "spell" )
call SetUnitAnimation( castere, "spell" )
call AddSpecialEffectTargetUnitBJ( "weapon", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "weapon", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
call SetUnitFacingToFaceLocTimed( casterw, p, 0.50 )
call SetUnitFacingToFaceLocTimed( castere, p, 0.50 )
call TriggerSleepAction(0.30)
if(udg_gameplay_game_on==false) then
call RemoveLocation(p)
return
endif
if(IsUnitAliveBJ(udg_arena_blocker_d[i])) then
call RemoveUnit(udg_arena_blocker_d[i])
endif
call SetUnitVertexColorBJ( u, 100, 100, 100, 0.00 )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( u, 0, 64.00, p, 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set i = i - 1
endloop
set i = 83
loop
exitwhen(i<43)
set p = GetRectCenter(udg_gameplay_grid_playable[i])
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call CreateNUnitsAtLoc( 1, udg_arena_blocktype_i[udg_arena_id], Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call SetUnitVertexColorBJ( u, 100, 100, 100, 50.00 )
set d = d + 1
if (d == 5) then
set d = 0
call SetUnitAnimation( casterw, "spell" )
call SetUnitAnimation( castere, "spell" )
call AddSpecialEffectTargetUnitBJ( "weapon", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", casterw, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "weapon", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectTargetUnitBJ( "right", castere, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
call SetUnitFacingToFaceLocTimed( casterw, p, 0.50 )
call SetUnitFacingToFaceLocTimed( castere, p, 0.50 )
call TriggerSleepAction(0.30)
if(udg_gameplay_game_on==false) then
call RemoveLocation(p)
return
endif
if(IsUnitAliveBJ(udg_arena_blocker_d[i])) then
call RemoveUnit(udg_arena_blocker_d[i])
endif
call SetUnitVertexColorBJ( u, 100, 100, 100, 0.00 )
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamagePointLoc( u, 0, 64.00, p, 5, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC )
call CreateNUnitsAtLoc( 1, 'n00J', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
set i = i - 20
endloop
// ***************** REMOVE SORCERESS *****************
call TriggerSleepAction(1.00)
if(udg_gameplay_game_on==false) then
call RemoveLocation(p)
return
endif
set p = GetRectCenter(udg_gameplay_grid_playable[66])
set p = OffsetLocation(p, 1280.00, 0)
call RemoveUnit(castere)
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
set p = OffsetLocation(p, -2560.00, 0)
call RemoveUnit(casterw)
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveLocation(p)
endfunction
//===========================================================================
function InitTrig_sudden_death_lordaeron takes nothing returns nothing
set gg_trg_sudden_death_lordaeron = CreateTrigger( )
call TriggerAddAction( gg_trg_sudden_death_lordaeron, function Trig_sudden_death_lordaeron_Actions )
endfunction
function Trig_sudden_death_durotar_Actions takes nothing returns nothing
local location p = GetRectCenter(udg_gameplay_grid_playable[67])
local unit u = null
call CreateNUnitsAtLoc( 1, 'h016', Player(11), p, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call GroupAddUnitSimple( u, udg_gameplay_all_units )
call UnitAddAbilityBJ( 'A00E', u )
set p = GetRectCenter(udg_gameplay_grid_playable[67])
call IssuePointOrderLocBJ( u, "stampede", p )
call RemoveLocation(p)
endfunction
//===========================================================================
function InitTrig_sudden_death_durotar takes nothing returns nothing
set gg_trg_sudden_death_durotar = CreateTrigger( )
call TriggerAddAction( gg_trg_sudden_death_durotar, function Trig_sudden_death_durotar_Actions )
endfunction
// ***************** CHECK FOR VALID SWAP HERO *****************
function Trig_UnitIsHeroS takes nothing returns boolean
local unit u = GetFilterUnit()
local integer id = GetConvertedPlayerId(GetOwningPlayer(u))
if (IsUnitInGroup(u, udg_gameplay_all_heroes)) then
if(u != udg_gameplay_skull_hero) then
if(udg_gameplay_hero_valid[id] == true) then
if(udg_gameplay_hero_ghost[id] == false) then
return true
endif
endif
endif
endif
return false
endfunction
// ***************** CHECK FOR CLOSE HEROES AND SKULL SWAP *****************
function Trig_SkullSwap takes unit u returns boolean
local location p = GetUnitLoc(u)
local rect r = RectFromCenterSizeBJ(p, 256.00, 256.00)
local group g = GetUnitsInRectMatching(r, Condition(function Trig_UnitIsHeroS))
local unit u = null
if(IsUnitGroupEmptyBJ(g) == false) then
set udg_skullswap_index = 0
call SetUnitVertexColorBJ( udg_gameplay_skull_hero, 100.00, 100.00, 100.00, 0 )
call SetUnitMoveSpeed( udg_gameplay_skull_hero, udg_gameplay_speed[udg_gameplay_skull_player_id] )
set udg_gameplay_skull_hero = GroupPickRandomUnit(g)
set udg_gameplay_skull_player_id = GetConvertedPlayerId(GetOwningPlayer(udg_gameplay_skull_hero))
call AddSpecialEffectTargetUnitBJ( "origin", udg_gameplay_skull_hero, "Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
if(udg_gameplay_skull_id == 2) then
call SetUnitMoveSpeed( udg_gameplay_skull_hero, 100 )
endif
call RemoveLocation(p)
call RemoveRect(r)
call DestroyGroup(g)
return true
endif
call RemoveLocation(p)
call RemoveRect(r)
call DestroyGroup(g)
return false
endfunction
// ***************** AUTO PLACE BOMBS *****************
function Trig_SkullPlaceBombs takes nothing returns nothing
if(udg_gameplay_bomb_count[udg_gameplay_skull_player_id] < udg_gameplay_bomb_capacity[udg_gameplay_skull_player_id]) then
call ClearSelectionForPlayer( Player(udg_gameplay_skull_player_id - 1) )
call SelectUnitForPlayerSingle( udg_gameplay_hero[udg_gameplay_skull_player_id], Player(udg_gameplay_skull_player_id - 1) )
call ForceUIKeyBJ( Player(udg_gameplay_skull_player_id - 1), "t" )
call TriggerSleepAction(0.05)
call ForceUIKeyBJ( Player(udg_gameplay_skull_player_id - 1), "q" )
endif
endfunction
function Trig_skull_slow_Actions takes nothing returns nothing
local boolean b = false
if(udg_gameplay_skull_id == 2) then
call SetUnitMoveSpeed( udg_gameplay_skull_hero, 100 )
endif
loop
exitwhen(IsUnitAliveBJ(udg_gameplay_skull_hero) == false)
if( b == false) then
if (Trig_SkullSwap(udg_gameplay_skull_hero) == true) then
set b = true
endif
else
set b = false
endif
if(udg_gameplay_skull_id == 1) then
call Trig_SkullPlaceBombs()
endif
if(udg_gameplay_hero_valid[udg_gameplay_skull_player_id] == true) then
call SetUnitVertexColorBJ( udg_gameplay_skull_hero, 30.00, 30.00, 30.00, 0 )
endif
call TriggerSleepAction(0.20)
exitwhen(IsUnitAliveBJ(udg_gameplay_skull_hero) == false)
if(b == false) then
if (Trig_SkullSwap(udg_gameplay_skull_hero) == true) then
set b = true
endif
else
set b = false
endif
if(udg_gameplay_hero_valid[udg_gameplay_skull_player_id] == true) then
call SetUnitVertexColorBJ( udg_gameplay_skull_hero, 100.00, 100.00, 100.00, 0 )
endif
call TriggerSleepAction(0.20)
endloop
endfunction
//===========================================================================
function InitTrig_skull_periodic takes nothing returns nothing
set gg_trg_skull_periodic = CreateTrigger( )
call TriggerAddAction( gg_trg_skull_periodic, function Trig_skull_slow_Actions )
endfunction
function Trig_skull_teleport_Actions takes nothing returns nothing
local integer i = 1
local integer d = 0
local integer x = 0
local boolean array b
local location array p
loop
exitwhen i > 5
if (Trig_HeroAlive(i)) then
set p[d] = GetUnitLoc(udg_gameplay_hero[i])
set b[d] = true
set d = d + 1
endif
set i = i + 1
endloop
set i = 1
loop
exitwhen i > 5
if(Trig_HeroAlive(i)) then
set x = GetRandomInt(0,d - 1)
if(b[x] == true) then
set b[x] = false
call SetUnitPositionLoc( udg_gameplay_hero[i], p[x] )
call AddSpecialEffectLocBJ( p[x], "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
set i = i + 1
endif
else
set i = i + 1
endif
endloop
set udg_gameplay_skull_hero = null
set i = 0
loop
exitwhen i > d - 1
call RemoveLocation(p[i])
endloop
endfunction
//===========================================================================
function InitTrig_skull_teleport takes nothing returns nothing
set gg_trg_skull_teleport = CreateTrigger( )
call TriggerAddAction( gg_trg_skull_teleport, function Trig_skull_teleport_Actions )
endfunction
// ***************** PURCHASE SUCCESFUL? *****************
function Trig_PurchaseOk takes boolean b, integer id, integer value returns nothing
if( b == true) then
call AddSpecialEffectTargetUnitBJ( "origin", udg_gameplay_hero[id], "Abilities\\Spells\\Other\\Levelup\\LevelupCaster.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
else
call TriggerSleepAction( 0.25 )
call SetPlayerStateBJ( Player(id - 1), PLAYER_STATE_RESOURCE_GOLD, ( GetPlayerState(Player(id - 1), PLAYER_STATE_RESOURCE_GOLD) + value ) )
endif
endfunction
function Trig_unit_sold_Actions takes nothing returns nothing
local unit usold = GetSoldUnit()
local unit ubuyer = GetBuyingUnit()
local integer utsell = GetUnitTypeId(GetTriggerUnit())
local integer ut = GetUnitTypeId(usold)
local integer id = GetConvertedPlayerId(GetOwningPlayer(ubuyer))
local boolean b = true
local location p = GetUnitLoc(ubuyer)
// ***************** EXPLOSIVES TRADER *****************
if ( utsell == 'n00D' ) then
// ***************** CAPACITY UPGRADE *****************
if(ut == 'h00M') then
if( udg_player_bomb_capacity[id] < 12) then
set udg_player_bomb_capacity[id] = udg_player_bomb_capacity[id] + 1
call Trig_HintMessage(Player(id-1), "Upgrade|r: Capacity (|ccc66ff66" + I2S(udg_player_bomb_capacity[id]) + "|r)" )
else
call Trig_ErrorMessage(Player(id-1), "Error|r: maximum reached")
set b = false
endif
else
// ***************** POWER UPGRADE *****************
if(ut == 'h00L') then
if( udg_player_power[id] < 12) then
set udg_player_power[id] = udg_player_power[id] + 1
call Trig_HintMessage(Player(id-1), "Upgrade|r: Power (|ccc66ff66" + I2S(udg_player_power[id]) + "|r)" )
else
call Trig_ErrorMessage(Player(id-1), "Error|r: maximum reached")
set b = false
endif
else
// ***************** INCREASE LIFESPAN *****************
if(ut == 'h00N') then
if( udg_player_gameplay_lifespan[id] < 7.00) then
set udg_player_gameplay_lifespan[id] = udg_player_gameplay_lifespan[id] + 0.25
call Trig_HintMessage(Player(id-1), "Increase|r: Lifespan (|ccc66ff66" + SubStringBJ(R2S(udg_player_gameplay_lifespan[id]), 1, 4) + "|r)")
else
call Trig_ErrorMessage(Player(id-1), "Error|r: maximum reached")
set b = false
endif
else
// ***************** DECREASE LIFESPAN *****************
if(ut == 'h00O') then
if( udg_player_gameplay_lifespan[id] > 1.00) then
set udg_player_gameplay_lifespan[id] = udg_player_gameplay_lifespan[id] - 0.25
call Trig_HintMessage(Player(id-1), "Decrease|r: Lifespan (|ccc66ff66" + SubStringBJ(R2S(udg_player_gameplay_lifespan[id]), 1, 4) + "|r)")
else
call Trig_ErrorMessage(Player(id-1), "Error|r: minimum reached")
set b = false
endif
else
// ***************** TRIGGER MINE *****************
if(ut == 'h00T') then
if( udg_player_triggermine_capacity[id] < 3) then
set udg_player_triggermine_capacity[id] = udg_player_triggermine_capacity[id] + 1
call Trig_HintMessage(Player(id-1), "Purchase|r: Trigger Mine (|ccc66ff66" + I2S(udg_player_triggermine_capacity[id]) + "|r)" )
else
call Trig_ErrorMessage(Player(id-1), "Error|r: maximum reached")
set b = false
endif
else
// ***************** ILLUMINATOR *****************
if(ut == 'h00P') then
if( udg_player_illuminator_capacity[id] < 1) then
set udg_player_illuminator_capacity[id] = udg_player_illuminator_capacity[id] + 1
call Trig_HintMessage(Player(id-1), "Purchase|r: Illuminator (|ccc66ff66" + I2S(udg_player_illuminator_capacity[id]) + "|r)" )
else
call Trig_ErrorMessage(Player(id-1), "Error|r: maximum reached")
set b = false
endif
else
// ***************** SOUL PRISON *****************
if(ut == 'h00Q') then
if( udg_player_soulprison_capacity[id] < 1) then
set udg_player_soulprison_capacity[id] = udg_player_soulprison_capacity[id] + 1
call Trig_HintMessage(Player(id-1), "Purchase|r: Soul Prison (|ccc66ff66" + I2S(udg_player_soulprison_capacity[id]) + "|r)" )
else
call Trig_ErrorMessage(Player(id-1), "Error|r: maximum reached")
set b = false
endif
else
// ***************** PHOENIX EGG *****************
if(ut == 'h00R') then
if( udg_player_phoenixegg_capacity[id] < 1) then
set udg_player_phoenixegg_capacity[id] = udg_player_phoenixegg_capacity[id] + 1
call Trig_HintMessage(Player(id-1), "Purchase|r: Phoenix Egg (|ccc66ff66" + I2S(udg_player_phoenixegg_capacity[id]) + "|r)" )
else
call Trig_ErrorMessage(Player(id-1), "Error|r: maximum reached")
set b = false
endif
else
// ***************** SUICIDE SHEEP *****************
if( udg_player_sheep_capacity[id] < 3) then
set udg_player_sheep_capacity[id] = udg_player_sheep_capacity[id] + 1
call Trig_HintMessage(Player(id-1), "Purchase|r: Suicide Sheep (|ccc66ff66" + I2S(udg_player_sheep_capacity[id]) + "|r)" )
else
call Trig_ErrorMessage(Player(id-1), "Error|r: maximum reached")
set b = false
endif
endif
endif
endif
endif
endif
endif
endif
endif
// ***************** PURCHASE SUCCESFUL? *****************
call Trig_PurchaseOk(b,id,GetUnitPointValue(usold))
else
if ( utsell == 'n00E' ) then
// ***************** TAVERN *****************
set udg_player_herotype[id] = GetUnitTypeId(usold)
call CreateNUnitsAtLoc( 1, udg_player_herotype[id], Player(id - 1), p, GetUnitFacing(ubuyer) )
set udg_gameplay_hero[id] = GetLastCreatedUnit()
call GroupAddUnitSimple( udg_gameplay_hero[id], udg_gameplay_all_heroes )
call AddSpecialEffectTargetUnitBJ( "origin", udg_gameplay_hero[id], "Abilities\\Spells\\Human\\ReviveHuman\\ReviveHuman.mdl" )
call UnitRemoveAbilityBJ( 'A005', udg_gameplay_hero[id] )
call ClearSelectionForPlayer( Player(id - 1) )
call SelectUnitForPlayerSingle( udg_gameplay_hero[id], Player(id - 1) )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( ubuyer )
else
// ***************** WORKSHOP *****************
// ***************** SPEED UPGRADE *****************
if(ut == 'h00K') then
if( udg_player_speed[id] < 525) then
set udg_player_speed[id] = udg_player_speed[id] + 25
call Trig_HintMessage(Player(id-1), "Upgrade|r: Speed (|ccc66ff66" + I2S(udg_player_speed[id]) + "|r)" )
else
call Trig_ErrorMessage(Player(id-1), "Error|r: maximum reached")
set b = false
endif
else
// ***************** TELEPORT *****************
if(ut == 'h012') then
if( udg_player_teleport_level[id] < 5) then
set udg_player_teleport_level[id] = udg_player_teleport_level[id] + 1
call Trig_HintMessage(Player(id-1), "Purchase|r: Teleport (|ccc66ff66level " + I2S(udg_player_teleport_level[id]) + "|r)" )
else
call Trig_ErrorMessage(Player(id-1), "Error|r: maximum reached")
set b = false
endif
else
// ***************** THROW *****************
if(ut == 'h013') then
if( udg_player_throw_level[id] < 5) then
set udg_player_throw_level[id] = udg_player_throw_level[id] + 1
call Trig_HintMessage(Player(id-1), "Purchase|r: Throw Bombs (|ccc66ff66level " + I2S(udg_player_throw_level[id]) + "|r)" )
else
call Trig_ErrorMessage(Player(id-1), "Error|r: maximum reached")
set b = false
endif
else
// ***************** INVISIBILITY *****************
if(ut == 'h014') then
if( udg_player_invisibility_level[id] < 5) then
set udg_player_invisibility_level[id] = udg_player_invisibility_level[id] + 1
call Trig_HintMessage(Player(id-1), "Purchase|r: Invisibility (|ccc66ff66level " + I2S(udg_player_invisibility_level[id]) + "|r)" )
else
call Trig_ErrorMessage(Player(id-1), "Error|r: maximum reached")
set b = false
endif
endif
endif
endif
endif
// ***************** PURCHASE SUCCESFUL? *****************
call Trig_PurchaseOk(b,id,GetUnitPointValue(usold))
endif
endif
call RemoveUnit(usold)
call RemoveLocation(p)
endfunction
//===========================================================================
function InitTrig_unit_sold takes nothing returns nothing
set gg_trg_unit_sold = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_unit_sold, EVENT_PLAYER_UNIT_SELL )
call TriggerAddAction( gg_trg_unit_sold, function Trig_unit_sold_Actions )
endfunction