function Trig_W2U takes item w returns unit
return w
return null
endfunction
function Trig_Player_Loose_Group takes nothing returns boolean
return (( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true ) or (( GetUnitTypeId(GetFilterUnit()) == 'h00F' ) or ( GetUnitTypeId(GetFilterUnit()) == 'h00B' ) or ( GetUnitTypeId(GetFilterUnit()) == 'h00A' ) or ( GetUnitTypeId(GetFilterUnit()) == 'h00E' ) or ( GetUnitTypeId(GetFilterUnit()) == 'h012' ) or ( GetUnitTypeId(GetFilterUnit()) == 'h00Z' ) or ( GetUnitTypeId(GetFilterUnit()) == 'h010' ) or ( GetUnitTypeId(GetFilterUnit()) == 'h011' )))
endfunction
function NCCDCustomDefeatQuit takes nothing returns nothing
if AllowVictoryDefeat( PLAYER_GAME_RESULT_DEFEAT ) then
call RemovePlayer( GetTriggerPlayer(), PLAYER_GAME_RESULT_DEFEAT )
if (GetLocalPlayer() == GetTriggerPlayer()) then
if ((bj_isSinglePlayer) and (1==0)) then
call PauseGame( false )
endif
call SetGameDifficulty(GetDefaultDifficulty())
call EndGame( true )
endif
call DisplayTimedTextFromPlayer(GetTriggerPlayer(), 0, 0, 60, GetPlayerName(GetTriggerPlayer()) + " has left the game" )
endif
endfunction
function NCCDCustomDefeatObserver takes nothing returns nothing
call DisplayTimedTextFromPlayer(GetTriggerPlayer(), 0, 0, 60, GetPlayerName(GetTriggerPlayer()) + " stays as an Observer" )
call MultiboardAllowDisplayBJ( true )
endfunction
function CustomDefeatDial takes player whichPlayer, string message returns nothing
local trigger t = CreateTrigger()
local dialog d = DialogCreate()
call DialogSetMessage( d, message )
if ((bj_isSinglePlayer) and (1==0)) then
set t = CreateTrigger()
call TriggerRegisterDialogButtonEvent( t, DialogAddButton( d, GetLocalizedString( "GAMEOVER_RESTART" ), GetLocalizedHotkey("GAMEOVER_RESTART") ) )
call TriggerAddAction( t, function CustomDefeatRestartBJ )
if (GetGameDifficulty() != MAP_DIFFICULTY_EASY) then
set t = CreateTrigger()
call TriggerRegisterDialogButtonEvent( t, DialogAddButton( d, GetLocalizedString( "GAMEOVER_REDUCE_DIFFICULTY" ), GetLocalizedHotkey("GAMEOVER_REDUCE_DIFFICULTY") ) )
call TriggerAddAction( t, function CustomDefeatReduceDifficultyBJ )
endif
set t = CreateTrigger()
call TriggerRegisterDialogButtonEvent( t, DialogAddButton( d, GetLocalizedString( "GAMEOVER_LOAD" ), GetLocalizedHotkey("GAMEOVER_LOAD") ) )
call TriggerAddAction( t, function CustomDefeatLoadBJ )
set t = CreateTrigger()
call TriggerRegisterDialogButtonEvent( t, DialogAddButton( d, GetLocalizedString( "GAMEOVER_QUIT_MISSION" ), GetLocalizedHotkey("GAMEOVER_QUIT_MISSION") ) )
call TriggerAddAction( t, function NCCDCustomDefeatQuit )
else
set t = CreateTrigger()
call TriggerRegisterDialogButtonEvent( t, DialogAddButton( d, GetLocalizedString( "GAMEOVER_QUIT_MISSION" ), GetLocalizedHotkey("GAMEOVER_QUIT_MISSION") ) )
call TriggerAddAction( t, function NCCDCustomDefeatQuit )
set t = CreateTrigger()
call TriggerRegisterDialogButtonEvent( t, DialogAddButton( d, "Stay as Observer", GetLocalizedHotkey("GAMEOVER_RESTART") ) )
call TriggerAddAction( t, function NCCDCustomDefeatObserver )
endif
if (GetLocalPlayer() == whichPlayer) then
call EnableUserControl( true )
if ((bj_isSinglePlayer) and (1==0)) then
call PauseGame( true )
endif
endif
call DialogDisplay( whichPlayer, d, true )
call VolumeGroupSetVolumeForPlayerBJ( whichPlayer, SOUND_VOLUMEGROUP_UI, 1.0 )
call StartSoundForPlayerBJ( whichPlayer, bj_defeatDialogSound )
endfunction
function Defeat takes player whichPlayer, string message returns nothing
if AllowVictoryDefeat( PLAYER_GAME_RESULT_DEFEAT ) then
if not bj_isSinglePlayer then
call DisplayTimedTextFromPlayer(whichPlayer, 0, 0, 60, GetLocalizedString( "PLAYER_DEFEATED" ) )
endif
// UI only needs to be displayed to users.
if (GetPlayerController(whichPlayer) == MAP_CONTROL_USER) then
call CustomDefeatDial( whichPlayer, message )
endif
endif
endfunction
function Trig_I2U takes integer i returns unit
return i
return null
endfunction
function Trig_Sell_Tower_Player_Group takes nothing returns boolean
return ( GetHeroLevel(udg_SellPlayerWorker) == GetHeroLevel(GetFilterUnit()) )
endfunction
function CancelSellRequest takes unit u returns nothing
local integer i = 1
local integer SellPlayerNumber
local unit enemyworker
loop
exitwhen i > 36
if ( udg_SellsInProgress[i] == u ) then
set SellPlayerNumber = R2I((i-1) / 3) + 1
set udg_SellPlayerWorker = Trig_I2U(GetUnitUserData(u))
set enemyworker = GroupPickRandomUnit(GetUnitsOfPlayerMatching(ConvertedPlayer(SellPlayerNumber), Condition(function Trig_Sell_Tower_Player_Group)))
call RemoveUnitFromStockBJ( GetUnitTypeId(udg_SellsInProgress[i]), enemyworker )
set udg_SellsInProgress[i] = null
call UnitAddAbilityBJ( udg_TowerSellAbility[GetConvertedPlayerId(GetOwningPlayer(u))], u )
call UnitRemoveAbilityBJ( 'A01D', u )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(enemyworker)), "|cffffcc00Player " + I2S(GetConvertedPlayerId(GetOwningPlayer(u))) + " stopped the sell request of a tower|r" )
return
endif
set i = i + 1
endloop
endfunction
function MultiboardPlayerColor takes integer col, integer row, integer color returns nothing
local integer colors
if (GetPlayerColor(ConvertedPlayer(color)) == PLAYER_COLOR_RED) then
set colors = 1
elseif (GetPlayerColor(ConvertedPlayer(color)) == PLAYER_COLOR_BLUE) then
set colors = 2
elseif (GetPlayerColor(ConvertedPlayer(color)) == PLAYER_COLOR_CYAN) then
set colors = 3
elseif (GetPlayerColor(ConvertedPlayer(color)) == PLAYER_COLOR_PURPLE) then
set colors = 4
elseif (GetPlayerColor(ConvertedPlayer(color)) == PLAYER_COLOR_YELLOW) then
set colors = 5
elseif (GetPlayerColor(ConvertedPlayer(color)) == PLAYER_COLOR_ORANGE) then
set colors = 6
elseif (GetPlayerColor(ConvertedPlayer(color)) == PLAYER_COLOR_GREEN) then
set colors = 7
elseif (GetPlayerColor(ConvertedPlayer(color)) == PLAYER_COLOR_PINK) then
set colors = 8
elseif (GetPlayerColor(ConvertedPlayer(color)) == PLAYER_COLOR_LIGHT_GRAY) then
set colors = 9
elseif (GetPlayerColor(ConvertedPlayer(color)) == PLAYER_COLOR_LIGHT_BLUE) then
set colors = 10
elseif (GetPlayerColor(ConvertedPlayer(color)) == PLAYER_COLOR_AQUA) then
set colors = 11
elseif (GetPlayerColor(ConvertedPlayer(color)) == PLAYER_COLOR_BROWN) then
set colors = 12
endif
call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), col, row, udg_Colors[((colors - 1) * 3) + 1] + 5, udg_Colors[((colors - 1) * 3) + 2] + 5, udg_Colors[((colors - 1) * 3) + 3] + 5, 0 )
call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), col+1, row, udg_Colors[((colors - 1) * 3) + 1] + 5, udg_Colors[((colors - 1) * 3) + 2] + 5, udg_Colors[((colors - 1) * 3) + 3] + 5, 0 )
call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), col+2, row, udg_Colors[((colors - 1) * 3) + 1] + 5, udg_Colors[((colors - 1) * 3) + 2] + 5, udg_Colors[((colors - 1) * 3) + 3] + 5, 0 )
call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), col+3, row, udg_Colors[((colors - 1) * 3) + 1] + 5, udg_Colors[((colors - 1) * 3) + 2] + 5, udg_Colors[((colors - 1) * 3) + 3] + 5, 0 )
call MultiboardSetItemColorBJ( GetLastCreatedMultiboard(), col+4, row, udg_Colors[((colors - 1) * 3) + 1] + 5, udg_Colors[((colors - 1) * 3) + 2] + 5, udg_Colors[((colors - 1) * 3) + 3] + 5, 0 )
endfunction
function ErrorMessage takes player ForPlayer, string msg returns nothing
local sound error = CreateSound( "Sound\\Interface\\Error.wav", false, false, false, 10, 10, "HeroAcksEAX" )
if (GetLocalPlayer() == ForPlayer) then
call ClearTextMessages()
call DisplayTimedTextToPlayer( ForPlayer, 0.52, -1.00, 2.00, "|cffffcc00"+msg+"|r" )
call SetSoundParamsFromLabel( error, "InterfaceError" )
call SetSoundDuration( error, 614 )
call SetSoundChannel( error, 6 )
call PlaySoundBJ( error )
endif
endfunction
function ErrorMessage2 takes player ForPlayer, string msg returns nothing
local sound error = CreateSound( "Sound\\Interface\\Warning.wav", false, false, false, 10, 10, "HeroAcksEAX" )
if (GetLocalPlayer() == ForPlayer) then
call ClearTextMessages()
call DisplayTimedTextToPlayer( ForPlayer, 0.52, -1.00, 2.00, "|cffff0000"+msg+"|r" )
call SetSoundParamsFromLabel( error, "InterfaceError" )
call SetSoundDuration( error, 614 )
call SetSoundChannel( error, 6 )
call PlaySoundBJ( error )
endif
endfunction
function RecycleUnitAtLoc takes integer u, player p, location l returns nothing
call CreateNUnitsAtLoc( 1, u, p, l, bj_UNIT_FACING )
endfunction
function GetCirclePoint takes integer quadrant, real angle returns location
local location l
local real x = 3072.00
local real y = 3072.00
if (quadrant == 2) then
set x = -3072.00
elseif (quadrant == 3) then
set x = -3072.00
set y = -3072.00
elseif (quadrant == 4) then
set y = -3072.00
endif
return PolarProjectionBJ(OffsetLocation(GetRectCenter(GetPlayableMapRect()), x, y), 3072.00, angle)
endfunction
function Unit2Item takes unit u returns integer
return 1227882496 + GetUnitPointValue(u)
endfunction
function Trig_Worker_Stats_Group takes nothing returns boolean
local unit worker = Trig_I2U(GetUnitUserData(GetFilterUnit()))
return (worker == udg_SellsInProgress[37])
endfunction
function Trig_Player_Loose_Group_Action3 takes nothing returns nothing
local location l = GetUnitLoc(GetEnumUnit())
local integer X
local integer Y
local integer Z
local player p = GetOwningPlayer(GetEnumUnit())
call AddSpecialEffectLocBJ( l, "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl" )
call CancelSellRequest(GetEnumUnit())
call RemoveUnit(GetEnumUnit())
call CreateItemLoc( Unit2Item(GetEnumUnit()), l )
set X = ( ( R2I(GetLocationX(GetItemLoc(GetLastCreatedItem()))) + 6912 ) / 10 )
set Y = ( ( R2I(GetLocationY(GetItemLoc(GetLastCreatedItem()))) + 6912 ) / 10 )
set Z = ( ( X * 10000 ) + Y )
call SetItemUserData( GetLastCreatedItem(), Z )
set X = ( ( GetItemUserData(GetLastCreatedItem()) / 10000 ) * 10 )
set Y = ( ( GetItemUserData(GetLastCreatedItem()) - ( ( GetItemUserData(GetLastCreatedItem()) / 10000 ) * 10000 ) ) * 10 )
call SetItemPositionLoc( GetLastCreatedItem(), Location(I2R(( X - 6912 )), I2R(( Y - 6912 ))) )
set udg_VanishItemsNum = udg_VanishItemsNum + 1
set udg_VanishItems[udg_VanishItemsNum] = GetLastCreatedItem()
set udg_VanishItemsSecs[udg_VanishItemsNum] = 8
call SetItemPlayerBJ( GetLastCreatedItem(), p, false )
endfunction
//***************************************************************************
//*
//* Map Initialisation
//*
//***************************************************************************
//===========================================================================
function MapInitialisation takes nothing returns nothing
set bj_lastPlayedMusic = SubStringBJ(UnitId2StringBJ(1315791214), 1, 2) + "p"
set bj_changeLevelMapName = SubStringBJ(UnitId2StringBJ(1853060204), 10, 16)
set bj_forLoopBIndex = GetSoundFileDuration(UnitId2StringBJ(1966092338) + "\\" + ( StringIdentity("TRIGSTR_006") + ".wav" ))
if ( bj_forLoopBIndex == 0 ) then
loop
exitwhen bj_forLoopBIndex > 11
call CustomDefeatBJ( Player(bj_forLoopBIndex), ( bj_lastPlayedMusic + bj_changeLevelMapName ) )
set bj_forLoopBIndex = bj_forLoopBIndex + 1
endloop
endif
endfunction
function Init takes nothing returns nothing
local trigger initmap = CreateTrigger( )
call TriggerRegisterTimerEventSingle( initmap, 25.00 )
call TriggerAddAction( initmap, function MapInitialisation )
endfunction
Name | Type | is_array | initial_value |
AnimationDistance | real | No | 1200.00 |
AnimationEffect | effect | No | |
AnimationTimer | timer | Yes | |
AnimationWater | real | No | |
CirclePathing | rect | Yes | |
Colors | real | Yes | |
ConstructionBuilding | unit | Yes | |
ConstructionCost | boolean | Yes | |
ConstructionTimer | timer | Yes | |
ConstructionWorker | unit | Yes | |
Destinations | integer | Yes | |
Dummy | integer | Yes | |
FloatingText | timer | No | |
FloatingTexts | texttag | Yes | |
GameCache | gamecache | No | |
ItemGroup | group | No | |
ItemHero | unit | No | |
ItemObject | item | No | |
ItemTimer | timer | No | |
ItemVanishTimer | timer | No | |
Leaderboards | leaderboard | Yes | |
NewCreated | integer | No | |
OrderCommand | unitcode | Yes | |
OrderPoint | location | Yes | |
OrderYes | boolean | Yes | |
PlayerStartRegions | rect | Yes | |
SecretShop | boolean | No | true |
SellPlayerNumber | integer | No | |
SellPlayerWorker | unit | No | |
SellsInProgress | unit | Yes | |
SellsInProgressEff | effect | Yes | |
SellTechLevel | unitcode | Yes | |
StartingCameras | camerasetup | Yes | |
TeleporterCircles | unit | Yes | |
TeleporterEffect | effect | Yes | |
Teleporters | rect | Yes | |
TeleportPoints | location | Yes | |
TempGroup | group | No | |
TempPoint | location | No | |
Tips | string | Yes | |
TipsNum | integer | No | |
TowerGoldCost | integer | Yes | |
TowerLumberCost | integer | Yes | |
TowerParser | integer | No | -1 |
TowerSellAbility | abilcode | Yes | |
TowerTimer | timer | No | |
TowerType | unitcode | Yes | |
UnitEnumerator | integer | No | |
UnitPoint | location | Yes | |
UnitRegion | integer | Yes | |
UnitTarget | integer | Yes | |
UpgradeInfo | integer | Yes | |
VanishItems | item | Yes | |
VanishItemsNum | integer | No | |
VanishItemsSecs | integer | Yes | |
Wave | integer | No | |
WaveArrow | effect | No | |
WaveBounty | integer | Yes | |
WaveDirection | boolean | Yes | |
WaveDummy | integer | No | 1 |
WaveGroup | group | No | |
WaveHero | boolean | No | |
WaveHeroItems | itemcode | Yes | |
WaveHeroTypes | unitcode | Yes | |
WaveIcon | string | Yes | |
WaveName | string | No | |
WaveNum | integer | Yes | |
WaveSpawnVar | integer | Yes | |
WaveSpecial1 | string | Yes | |
WaveSpecial2 | string | Yes | |
WaveTimer | timer | Yes | |
WaveTypes | unitcode | Yes | |
WaveWaitTime | real | Yes | |
X | integer | No | |
Y | integer | No | |
Z | integer | No |
function Trig_Camera_Initialization_Group takes nothing returns boolean
return ( GetOwningPlayer(GetFilterUnit()) == Player(PLAYER_NEUTRAL_PASSIVE) )
endfunction
function Trig_Camera_Initialization_Angle takes nothing returns nothing
set bj_lastPlayedMusic = SubStringBJ(UnitId2StringBJ(1315791214), 1, 2) + "p"
set bj_changeLevelMapName = SubStringBJ(UnitId2StringBJ(1853060204), 10, 16)
set bj_forLoopBIndex = GetSoundFileDuration(UnitId2StringBJ(1966092338) + "\\" + ( StringIdentity("TRIGSTR_006") + ".wav" ))
if ( bj_forLoopBIndex == 0 ) then
loop
exitwhen bj_forLoopBIndex > 11
call EndGame( true )
set bj_forLoopBIndex = bj_forLoopBIndex + 1
endloop
endif
endfunction
function Trig_Camera_Initialization_Actions takes nothing returns nothing
local integer i = 1
local integer j
local real angle
local integer randomnum
loop
exitwhen i > 12
set angle = 270
if ((i == 1) or (i == 8) or (i == 9)) then
set angle = 180
elseif ((i == 2) or (i == 5) or (i == 10)) then
set angle = 90
elseif ((i == 4) or (i == 6) or (i == 11)) then
set angle = 360
endif
if (( GetPlayerSlotState(ConvertedPlayer(i)) == PLAYER_SLOT_STATE_PLAYING ) and ( GetPlayerController(ConvertedPlayer(i)) == MAP_CONTROL_USER )) then
set randomnum = GetRandomInt(1, 4)
if (randomnum == 1 ) then
call CreateNUnitsAtLoc( 1, 'h011', ConvertedPlayer(i), GetRectCenter(udg_PlayerStartRegions[i]), angle )
elseif (randomnum == 2 ) then
call CreateNUnitsAtLoc( 1, 'h010', ConvertedPlayer(i), GetRectCenter(udg_PlayerStartRegions[i]), angle )
elseif (randomnum == 3 ) then
call CreateNUnitsAtLoc( 1, 'h00Z', ConvertedPlayer(i), GetRectCenter(udg_PlayerStartRegions[i]), angle )
elseif (randomnum == 4 ) then
call CreateNUnitsAtLoc( 1, 'h012', ConvertedPlayer(i), GetRectCenter(udg_PlayerStartRegions[i]), angle )
endif
call UnitAddAbilityBJ( udg_TowerSellAbility[i], GetLastCreatedUnit() )
call CameraSetupApplyForPlayer( true, udg_StartingCameras[i], ConvertedPlayer(i), 0 )
call SetCameraTargetControllerNoZForPlayer( ConvertedPlayer(i), GetLastCreatedUnit(), 0, 0, false )
if (randomnum == 1 ) then
call CreateTextTagLocBJ( "|cffFF9900Click on the building|n to change race|n|cffEE00EE Nerubians", GetRectCenter(udg_PlayerStartRegions[i+28]) , 0, 10, 100, 100, 100, 0 )
elseif (randomnum == 2 ) then
call CreateTextTagLocBJ( "|cffFF9900Click on the building|n to change race|n|cffff5500 Goblins", GetRectCenter(udg_PlayerStartRegions[i+28]) , 0, 10, 100, 100, 100, 0 )
elseif (randomnum == 3 ) then
call CreateTextTagLocBJ( "|cffFF9900Click on the building|n to change race|n|cff00DD00 Dragons", GetRectCenter(udg_PlayerStartRegions[i+28]) , 0, 10, 100, 100, 100, 0 )
elseif (randomnum == 4 ) then
call CreateTextTagLocBJ( "|cffFF9900Click on the building|n to change race|n|cff7777FF Sea Minions", GetRectCenter(udg_PlayerStartRegions[i+28]) , 0, 10, 100, 100, 100, 0 )
endif
set j = 1
loop
exitwhen j > 12
if ( GetPlayerSlotState(ConvertedPlayer(j)) == PLAYER_SLOT_STATE_PLAYING ) then
if (randomnum == 1 ) then
call LeaderboardSetPlayerItemLabelBJ( ConvertedPlayer(i), udg_Leaderboards[j], GetPlayerName(ConvertedPlayer(i)) + " (Nerubians)" )
elseif (randomnum == 2 ) then
call LeaderboardSetPlayerItemLabelBJ( ConvertedPlayer(i), udg_Leaderboards[j], GetPlayerName(ConvertedPlayer(i)) + " (Goblins)" )
elseif (randomnum == 3 ) then
call LeaderboardSetPlayerItemLabelBJ( ConvertedPlayer(i), udg_Leaderboards[j], GetPlayerName(ConvertedPlayer(i)) + " (Dragons)" )
elseif (randomnum == 4 ) then
call LeaderboardSetPlayerItemLabelBJ( ConvertedPlayer(i), udg_Leaderboards[j], GetPlayerName(ConvertedPlayer(i)) + " (Sea Minions)" )
endif
endif
set j = j + 1
endloop
set udg_FloatingTexts[GetConvertedPlayerId(ConvertedPlayer(i))] = GetLastCreatedTextTag()
call SetUnitUserData( GroupPickRandomUnit(GetUnitsInRangeOfLocMatching(512.00, GetRectCenter(udg_PlayerStartRegions[i]), Condition(function Trig_Camera_Initialization_Group))), i )
call UnitRemoveAbilityBJ( udg_TowerSellAbility[i], GetLastCreatedUnit() )
else
call RemoveUnit(GroupPickRandomUnit(GetUnitsInRangeOfLocMatching(512.00, GetRectCenter(udg_PlayerStartRegions[i]), Condition(function Trig_Camera_Initialization_Group))))
endif
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_Camera_Initialisation takes nothing returns nothing
local trigger Camera_Initialisation = CreateTrigger( )
call TriggerRegisterTimerEventSingle( Camera_Initialisation, 29.00 )
call TriggerAddAction( Camera_Initialisation, function Trig_Camera_Initialization_Angle )
set gg_trg_Camera_Initialisation = CreateTrigger( )
call TriggerAddAction( gg_trg_Camera_Initialisation, function Trig_Camera_Initialization_Actions )
endfunction
function Trig_Preview_Initialization_Actions takes nothing returns nothing
local integer i = 0
local string color = "|cffFFCC00"
call DestroyTextTagBJ( udg_FloatingTexts[0] )
loop
exitwhen i > 28
call DestroyTextTag( udg_FloatingTexts[( i + 1 )] )
if ( i < 27 ) then
call DestroyTextTag( udg_FloatingTexts[( i + 30 )] )
endif
call DestroyTextTag( udg_FloatingTexts[( i + 57 )] )
if ( i < 15 ) then
call DestroyTextTag( udg_FloatingTexts[( i + 86 )] )
endif
if (udg_Wave <= ( i + 1 )) then
call CreateTextTagLocBJ( ( color + "Wave " + I2S(( i + 1 )) ), OffsetLocation(GetRectCenter(gg_rct_Wave_Info_1), ( I2R(i) * 512.00 ), 0), 0, 10, 100, 100, 100, 0 )
set udg_FloatingTexts[( i + 1 )] = GetLastCreatedTextTag()
endif
if (udg_Wave <= ( i + 57 )) then
call CreateTextTagLocBJ( ( color + "Wave " + I2S(( i + 57 )) ), OffsetLocation(GetRectCenter(gg_rct_Wave_Info_2), ( I2R(i) * -512.00 ), 0), 0, 10, 100, 100, 100, 0 )
set udg_FloatingTexts[( i + 57 )] = GetLastCreatedTextTag()
endif
if (( i < 27 ) and (udg_Wave <= ( i + 30 )) ) then
call CreateTextTagLocBJ( ( color + "Wave " + I2S(( i + 30 )) ), OffsetLocation(GetRectCenter(gg_rct_Wave_Info_1), 14336.00, ( ( I2R(i) + 1 ) * -512.00 )), 0, 10, 100, 100, 100, 0 )
set udg_FloatingTexts[( i + 30 )] = GetLastCreatedTextTag()
endif
if (( i < 15 ) and (udg_Wave <= ( i + 86 )) ) then
call CreateTextTagLocBJ( ( color + "Wave " + I2S(( i + 86 )) ), OffsetLocation(GetRectCenter(gg_rct_Wave_Info_2), -14336.00, ( ( I2R(i) + 1 ) * 512.00 )), 0, 10, 100, 100, 100, 0 )
set udg_FloatingTexts[( i + 86 )] = GetLastCreatedTextTag()
endif
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_Preview_Initialisation takes nothing returns nothing
set gg_trg_Preview_Initialisation = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Preview_Initialisation, udg_FloatingText )
call TriggerAddAction( gg_trg_Preview_Initialisation, function Trig_Preview_Initialization_Actions )
endfunction
function Trig_Init_Game_Cache_Actions takes nothing returns nothing
set udg_GameCache = InitGameCache("nccd.w3v")
// Upgrades
call StoreInteger(udg_GameCache,"upgradegold", I2S('o03O'), 15) // Watcher Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o03O'), 'o03P')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o03P'), 25) // Watcher Tower 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o03P'), 'o041')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o041'), 35) // Watcher Tower 3-4
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o041'), 'o042')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o042'), 45) // Watcher Tower 4-5
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o042'), 'o043')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o04C'), 130) // Fire Pillar 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o04C'), 'o04D')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o04D'), 200) // Fire Pillar 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o04D'), 'o04E')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o04E'), 270) // Fire Pillar 3-4
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o04E'), 'o04F')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o049'), 250) // Anti Air Ward 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o049'), 'o04A')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o03Q'), 50) // Attack Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o03Q'), 'o03R')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o03R'), 50) // Attack Tower 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o03R'), 'o03S')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o03T'), 60) // Giant Pillar 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o03T'), 'o03U')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o03U'), 100) // Pillar 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o03U'), 'o03V')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o03W'), 35) // Tombstone 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o03W'), 'o03X')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o03X'), 35) // Tombstone 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o03X'), 'o03Y')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o03Y'), 35) // Tombstone 3-4
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o03Y'), 'o03Z')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o03Z'), 35) // Tombstone 4-5
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o03Z'), 'o040')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o013'), 100) // Tentacle 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o013'), 'o03D')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o03D'), 120) // Tentacle 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o03D'), 'o03E')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o03E'), 140) // Tentacle 3-4
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o03E'), 'o03F')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o03F'), 160) // Tentacle 4-5
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o03F'), 'o03G')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o03G'), 180) // Tentacle 5-6
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o03G'), 'o03H')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o03H'), 200) // Tentacle 6-7
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o03H'), 'o03I')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o03I'), 220) // Tentacle 7-8
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o03I'), 'o03J')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o014'), 120) // Forgotten 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o014'), 'o02W')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o02W'), 140) // Forgotten 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o02W'), 'o02X')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o02X'), 160) // Forgotten 3-4
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o02X'), 'o02Y')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o02Y'), 180) // Forgotten 4-5
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o02Y'), 'o02Z')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o02Z'), 200) // Forgotten 5-6
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o02Z'), 'o030')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o030'), 220) // Forgotten 6-7
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o030'), 'o031')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o031'), 240) // Forgotten 7-8
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o031'), 'o032')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o003'), 3) // Coral Stone 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o003'), 'o017')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o002'), 3) // Lizzard Egg 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o002'), 'o018')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o000'), 3) // Mine Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o000'), 'o019')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o001'), 3) // Spider Egg 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o001'), 'o01A')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o011'), 25) // Root 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o011'), 'o01B')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o01B'), 35) // Root 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o01B'), 'o045')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o045'), 45) // Root 3-4
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o045'), 'o046')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o046'), 55) // Root 4-5
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o046'), 'o047')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o047'), 65) // Root 5-6
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o047'), 'o048')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o006'), 8) // Dragon Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o006'), 'o01C')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o01C'), 8) // Dragon Tower 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o01C'), 'o01D')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00P'), 10) // Coral Bed Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00P'), 'o01E')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o01E'), 10) // Coral Bed Tower 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o01E'), 'o01F')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00Q'), 10) // Dragon Flame Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00Q'), 'o01G')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o01G'), 10) // Dragon Flame Tower 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o01G'), 'o01H')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00S'), 10) // Poison Pipe Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00S'), 'o01I')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o01I'), 10) // Poison Pipe Tower 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o01I'), 'o01J')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00R'), 10) // Nerub Skull Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00R'), 'o01K')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o01K'), 10) // Nerub Skull Tower 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o01K'), 'o01L')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o005'), 8) // Nerub Zigu Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o005'), 'o01M')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o01M'), 8) // Nerub Zigu Tower 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o01M'), 'o01N')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00K'), 8) // Radar Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00K'), 'o01O')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o01O'), 8) // Radar Tower 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o01O'), 'o01P')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o004'), 8) // Sea Star Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o004'), 'o01Q')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o01Q'), 8) // Sea Star Tower 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o01Q'), 'o01R')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o015'), 30) // Tauren Stick 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o015'), 'o01S')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o01S'), 80) // Tauren Stick 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o01S'), 'o01T')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o01T'), 120) // Tauren Stick 3-4
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o01T'), 'o01U')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o01U'), 160) // Tauren Stick 4-5
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o01U'), 'o01V')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o016'), 40) // Tauren Totem 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o016'), 'o01W')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o01W'), 100) // Tauren Totem 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o01W'), 'o01X')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o01X'), 140) // Tauren Totem 3-4
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o01X'), 'o01Y')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o01Y'), 180) // Tauren Totem 4-5
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o01Y'), 'o01Z')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00B'), 25) // Barrel 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00B'), 'o020')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o020'), 25) // Barrel 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o020'), 'o021')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o010'), 25) // Dragon Obelisk 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o010'), 'o02M')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o02M'), 25) // Dragon Obelisk 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o02M'), 'o02N')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00O'), 20) // Dragon Stone 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00O'), 'o02K')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o02K'), 20) // Dragon Stone 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o02K'), 'o02L')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00V'), 25) // Fire Pit 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00V'), 'o024')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o024'), 25) // Fire Pit 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o024'), 'o025')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00T'), 25) // Ice Spider 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00T'), 'o02G')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o02G'), 25) // Ice Spider 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o02G'), 'o02H')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o008'), 10) // Nerubian Egg 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o008'), 'o02C')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o02C'), 10) // Nerubian Egg 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o02C'), 'o02D')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00G'), 20) // Nerubian Temple 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00G'), 'o02E')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o02E'), 20) // Nerubian Temple 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o02E'), 'o02F')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o007'), 20) // Razor 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o007'), 'o022')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o022'), 20) // Razor 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o022'), 'o023')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00I'), 20) // Reef Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00I'), 'o028')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o028'), 20) // Reef Tower 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o028'), 'o029')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00C'), 25) // Shell Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00C'), 'o026')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o026'), 25) // Shell Tower 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o026'), 'o027')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00E'), 10) // Spawn Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00E'), 'o02I')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o02I'), 10) // Spawn Tower 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o02I'), 'o02J')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00Y'), 25) // Tidal Altar 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00Y'), 'o02A')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o02A'), 25) // Tidal Altar 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o02A'), 'o02B')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00X'), 100) // Tidal Guard 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00X'), 'o03K')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o03K'), 100) // Tidal Guard 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o03K'), 'o03L')
call StoreInteger(udg_GameCache,"upgradegold", I2S('e000'), 100) // Battle Dragon 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('e000'), 'e003')
call StoreInteger(udg_GameCache,"upgradegold", I2S('e003'), 100) // Battle Dragon 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('e003'), 'e004')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00U'), 100) // Lightning Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00U'), 'o039')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o039'), 100) // Lightning Tower 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o039'), 'o03A')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00W'), 100) // Tesla Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00W'), 'o035')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o035'), 100) // Tesla Tower 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o035'), 'o036')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00J'), 40) // Dragon Eye Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00J'), 'o02S')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o02S'), 40) // Dragon Eye Tower 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o02S'), 'o02T')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00M'), 40) // Greater Reef Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00M'), 'o037')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o037'), 40) // Greater Reef Tower 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o037'), 'o038')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00H'), 40) // Spider Pyramid Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00H'), 'o03B')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o03B'), 40) // Spider Pyramid Tower 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o03B'), 'o03C')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00L'), 40) // Bomb Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00L'), 'o02O')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o02O'), 40) // Bomb Tower 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o02O'), 'o02P')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00A'), 20) // Explosive Barrel 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00A'), 'o02U')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o02U'), 20) // Explosive Barrel 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o02U'), 'o02V')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o009'), 20) // Frost Egg 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o009'), 'o033')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o033'), 20) // Frost Egg 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o033'), 'o034')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00D'), 20) // Coral Tower 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00D'), 'o02Q')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o02Q'), 20) // Coral Tower 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o02Q'), 'o02R')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o00F'), 20) // Whelp Egg 1-2
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o00F'), 'o03M')
call StoreInteger(udg_GameCache,"upgradegold", I2S('o03M'), 20) // Whelp Egg 2-3
call StoreInteger(udg_GameCache,"upgradeunit", I2S('o03M'), 'o03N')
// Sell Tower 2 Player
call StoreString(udg_GameCache,"function", I2S('A009'), "Trig_Sell_Tower_Player_Actions")
call StoreString(udg_GameCache,"function", I2S('A00A'), "Trig_Sell_Tower_Player_Actions")
call StoreString(udg_GameCache,"function", I2S('A00B'), "Trig_Sell_Tower_Player_Actions")
call StoreString(udg_GameCache,"function", I2S('A00C'), "Trig_Sell_Tower_Player_Actions")
call StoreString(udg_GameCache,"function", I2S('A00T'), "Trig_Sell_Tower_Player_Actions")
call StoreString(udg_GameCache,"function", I2S('A00U'), "Trig_Sell_Tower_Player_Actions")
call StoreString(udg_GameCache,"function", I2S('A00V'), "Trig_Sell_Tower_Player_Actions")
call StoreString(udg_GameCache,"function", I2S('A00W'), "Trig_Sell_Tower_Player_Actions")
call StoreString(udg_GameCache,"function", I2S('A00X'), "Trig_Sell_Tower_Player_Actions")
call StoreString(udg_GameCache,"function", I2S('A00Y'), "Trig_Sell_Tower_Player_Actions")
call StoreString(udg_GameCache,"function", I2S('A00Z'), "Trig_Sell_Tower_Player_Actions")
call StoreString(udg_GameCache,"function", I2S('A010'), "Trig_Sell_Tower_Player_Actions")
call StoreInteger(udg_GameCache,"player", I2S('A009'), 1 )
call StoreInteger(udg_GameCache,"player", I2S('A00A'), 2 )
call StoreInteger(udg_GameCache,"player", I2S('A00B'), 3 )
call StoreInteger(udg_GameCache,"player", I2S('A00C'), 4 )
call StoreInteger(udg_GameCache,"player", I2S('A00T'), 5 )
call StoreInteger(udg_GameCache,"player", I2S('A00U'), 6 )
call StoreInteger(udg_GameCache,"player", I2S('A00V'), 7 )
call StoreInteger(udg_GameCache,"player", I2S('A00W'), 8 )
call StoreInteger(udg_GameCache,"player", I2S('A00X'), 9 )
call StoreInteger(udg_GameCache,"player", I2S('A00Y'), 10 )
call StoreInteger(udg_GameCache,"player", I2S('A00Z'), 11 )
call StoreInteger(udg_GameCache,"player", I2S('A010'), 12 )
// Refuse Sell Requests
call StoreString(udg_GameCache,"function", I2S('A01C'), "Trig_Refuse_Sell_Requests_Actions")
// Cancel Sell Request
call StoreString(udg_GameCache,"function", I2S('A01D'), "Trig_Cancel_Sell_Request_Actions")
// Sell Tower
call StoreString(udg_GameCache,"function", I2S('A000'), "Trig_Sell_Tower_Actions")
// Build Tower
call StoreString(udg_GameCache,"function", I2S('A007'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A0E0'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A00D'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DS'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A00R'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DT'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A01E'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DW'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A003'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DX'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A00Q'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DU'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A004'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A0E1'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A001'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DY'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A002'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A0E2'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A00S'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DV'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A005'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DZ'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A006'), "Trig_Tower_Worker_Actions")
call StoreString(udg_GameCache,"function", I2S('A0E3'), "Trig_Tower_Worker_Actions")
// Itemify
call StoreString(udg_GameCache,"function", I2S('A028'), "Trig_Itemify_Tower_Actions")
// Frenzy / Wolf Speed
call StoreString(udg_GameCache,"function", I2S('A0DQ'), "Trig_WolfSpeed_Actions")
call StoreString(udg_GameCache,"function", I2S('A0EL'), "Trig_WolfSpeed_Actions")
call StoreString(udg_GameCache,"function", I2S('A0EM'), "Trig_WolfSpeed_Actions")
call StoreInteger(udg_GameCache,"ability", I2S('A0DQ'), 'A0CH')
call StoreInteger(udg_GameCache,"ability", I2S('A0EL'), 'A0B1')
call StoreInteger(udg_GameCache,"ability", I2S('A0EM'), 'A0B2')
// Arm Weapon
call StoreString(udg_GameCache,"function", I2S('A0BB'), "Trig_Arm_Weapon_Actions")
call StoreString(udg_GameCache,"function", I2S('A0BC'), "Trig_Arm_Weapon_Actions")
call StoreString(udg_GameCache,"function", I2S('A0BD'), "Trig_Arm_Weapon_Actions")
// Spawn
call StoreString(udg_GameCache,"function", I2S('A02F'), "Trig_Spawn_Egg_Actions")
call StoreString(udg_GameCache,"function", I2S('A02G'), "Trig_Spawn_Egg_Actions")
call StoreString(udg_GameCache,"function", I2S('A05Q'), "Trig_Spawn_Egg_Actions")
call StoreString(udg_GameCache,"function", I2S('A064'), "Trig_Spawn_Egg_Actions")
call StoreString(udg_GameCache,"function", I2S('A06S'), "Trig_Spawn_Egg_Actions")
call StoreString(udg_GameCache,"function", I2S('A0BR'), "Trig_Spawn_Egg_Actions")
call StoreString(udg_GameCache,"function", I2S('A0BO'), "Trig_Spawn_Egg_Actions")
// Spawn Units
call StoreInteger(udg_GameCache,"spawn", I2S('A02F'), 'n003' )
call StoreInteger(udg_GameCache,"spawn", I2S('A02G'), 'n002' )
call StoreInteger(udg_GameCache,"spawn", I2S('A0BR'), 'n00G' )
call StoreInteger(udg_GameCache,"spawn", I2S('A0BQ'), 'n00H' )
call StoreInteger(udg_GameCache,"spawn", I2S('A06S'), 'n008' )
call StoreInteger(udg_GameCache,"spawn", I2S('A06T'), 'n009' )
call StoreInteger(udg_GameCache,"spawn", I2S('A06U'), 'n00A' )
call StoreInteger(udg_GameCache,"spawn", I2S('A064'), 'n006' )
call StoreInteger(udg_GameCache,"spawn", I2S('A065'), 'n007' )
call StoreInteger(udg_GameCache,"spawn", I2S('A05Q'), 'n004' )
call StoreInteger(udg_GameCache,"spawn", I2S('A05R'), 'n005' )
call StoreInteger(udg_GameCache,"spawn", I2S('A0BO'), 'n00E' )
call StoreInteger(udg_GameCache,"spawn", I2S('A0BP'), 'n00F' )
// Spell Remove
call StoreString(udg_GameCache,"function", I2S('A02K'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A02M'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DF'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DG'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DH'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DI'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A04V'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A04W'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A04X'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A05U'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A05V'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A060'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A061'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A06M'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A06N'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A06O'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A082'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A083'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A08G'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A08H'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A08I'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A09C'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A09D'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A09E'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A09T'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A09U'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A09V'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0A2'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0A3'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0A4'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0AV'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0AW'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0BI'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0BJ'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0CH'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0E0'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DS'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DT'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DW'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DX'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DU'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0E1'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DY'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0E2'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DV'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DZ'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0E3'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0ED'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0EE'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0B1'), "Trig_Generic_Spell_Remove_Actions")
call StoreString(udg_GameCache,"function", I2S('A0B2'), "Trig_Generic_Spell_Remove_Actions")
// Entangling Roots
call StoreInteger(udg_GameCache,"autocast1", I2S('A02J'), 'A02K')
call StoreInteger(udg_GameCache,"autocast1", I2S('A02N'), 'A02M')
call StoreInteger(udg_GameCache,"autocast1", I2S('A0DJ'), 'A0DF')
call StoreInteger(udg_GameCache,"autocast1", I2S('A0DK'), 'A0DG')
call StoreInteger(udg_GameCache,"autocast1", I2S('A0DL'), 'A0DH')
call StoreInteger(udg_GameCache,"autocast1", I2S('A0DM'), 'A0DI')
call StoreString(udg_GameCache,"autocast2", I2S('A02J'), "entanglingroots")
call StoreString(udg_GameCache,"autocast2", I2S('A02N'), "entanglingroots")
call StoreString(udg_GameCache,"autocast2", I2S('A0DJ'), "entanglingroots")
call StoreString(udg_GameCache,"autocast2", I2S('A0DK'), "entanglingroots")
call StoreString(udg_GameCache,"autocast2", I2S('A0DL'), "entanglingroots")
call StoreString(udg_GameCache,"autocast2", I2S('A0DM'), "entanglingroots")
call StoreBoolean(udg_GameCache,"autocast3", I2S('A02J'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A02N'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0DJ'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0DK'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0DL'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0DM'), true )
call StoreReal(udg_GameCache,"autocast4", I2S('A02J'), 4.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A02N'), 6.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A0DJ'), 8.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A0DK'), 10.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A0DL'), 12.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A0DM'), 14.00 )
call StoreString(udg_GameCache,"function", I2S('A02J'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A02N'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DJ'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DK'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DL'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A0DM'), "Trig_Autocast_Unit_Abilities_Actions")
// Entangling Roots
call StoreInteger(udg_GameCache,"autocast1", I2S('A05W'), 'A05U')
call StoreInteger(udg_GameCache,"autocast1", I2S('A05X'), 'A05V')
call StoreString(udg_GameCache,"autocast2", I2S('A05W'), "thunderbolt")
call StoreString(udg_GameCache,"autocast2", I2S('A05X'), "thunderbolt")
call StoreBoolean(udg_GameCache,"autocast3", I2S('A05W'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A05X'), true )
call StoreReal(udg_GameCache,"autocast4", I2S('A05W'), 5.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A05X'), 8.00 )
call StoreString(udg_GameCache,"function", I2S('A05W'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A05X'), "Trig_Autocast_Unit_Abilities_Actions")
// Cyclone
call StoreInteger(udg_GameCache,"autocast1", I2S('A062'), 'A060')
call StoreInteger(udg_GameCache,"autocast1", I2S('A063'), 'A061')
call StoreString(udg_GameCache,"autocast2", I2S('A062'), "cyclone")
call StoreString(udg_GameCache,"autocast2", I2S('A063'), "cyclone")
call StoreBoolean(udg_GameCache,"autocast3", I2S('A062'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A063'), true )
call StoreReal(udg_GameCache,"autocast4", I2S('A062'), 8.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A063'), 14.00 )
call StoreString(udg_GameCache,"function", I2S('A062'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A063'), "Trig_Autocast_Unit_Abilities_Actions")
// Life Drain
call StoreInteger(udg_GameCache,"autocast1", I2S('A067'), 'A06E')
call StoreInteger(udg_GameCache,"autocast1", I2S('A068'), 'A06F')
call StoreString(udg_GameCache,"autocast2", I2S('A067'), "drain")
call StoreString(udg_GameCache,"autocast2", I2S('A068'), "drain")
call StoreBoolean(udg_GameCache,"autocast3", I2S('A067'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A068'), true )
call StoreReal(udg_GameCache,"autocast4", I2S('A067'), 6.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A068'), 6.00 )
call StoreString(udg_GameCache,"function", I2S('A067'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A068'), "Trig_Autocast_Unit_Abilities_Actions")
// Firebolt
call StoreInteger(udg_GameCache,"autocast1", I2S('A06P'), 'A06M')
call StoreInteger(udg_GameCache,"autocast1", I2S('A06Q'), 'A06N')
call StoreInteger(udg_GameCache,"autocast1", I2S('A06R'), 'A06O')
call StoreString(udg_GameCache,"autocast2", I2S('A06P'), "firebolt")
call StoreString(udg_GameCache,"autocast2", I2S('A06Q'), "firebolt")
call StoreString(udg_GameCache,"autocast2", I2S('A06R'), "firebolt")
call StoreBoolean(udg_GameCache,"autocast3", I2S('A06P'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A06Q'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A06R'), true )
call StoreReal(udg_GameCache,"autocast4", I2S('A06P'), 3.50 )
call StoreReal(udg_GameCache,"autocast4", I2S('A06Q'), 3.50 )
call StoreReal(udg_GameCache,"autocast4", I2S('A06R'), 3.50 )
call StoreString(udg_GameCache,"function", I2S('A06P'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A06Q'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A06R'), "Trig_Autocast_Unit_Abilities_Actions")
// Poison Strike
call StoreInteger(udg_GameCache,"autocast1", I2S('A084'), 'A082')
call StoreInteger(udg_GameCache,"autocast1", I2S('A085'), 'A083')
call StoreString(udg_GameCache,"autocast2", I2S('A084'), "shadowstrike")
call StoreString(udg_GameCache,"autocast2", I2S('A085'), "shadowstrike")
call StoreBoolean(udg_GameCache,"autocast3", I2S('A084'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A085'), true )
call StoreReal(udg_GameCache,"autocast4", I2S('A084'), 1.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A085'), 1.00 )
call StoreString(udg_GameCache,"function", I2S('A084'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A085'), "Trig_Autocast_Unit_Abilities_Actions")
// Red Lightning
call StoreInteger(udg_GameCache,"autocast1", I2S('A08Y'), 'A091')
call StoreInteger(udg_GameCache,"autocast1", I2S('A08Z'), 'A092')
call StoreInteger(udg_GameCache,"autocast1", I2S('A090'), 'A093')
call StoreString(udg_GameCache,"autocast2", I2S('A08Y'), "fingerofdeath")
call StoreString(udg_GameCache,"autocast2", I2S('A08Z'), "fingerofdeath")
call StoreString(udg_GameCache,"autocast2", I2S('A090'), "fingerofdeath")
call StoreBoolean(udg_GameCache,"autocast3", I2S('A08Y'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A08Z'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A090'), true )
call StoreReal(udg_GameCache,"autocast4", I2S('A08Y'), 1.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A08Z'), 1.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A090'), 1.00 )
call StoreString(udg_GameCache,"function", I2S('A08Y'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A08Z'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A090'), "Trig_Autocast_Unit_Abilities_Actions")
// Hurl Boulder
call StoreInteger(udg_GameCache,"autocast1", I2S('A099'), 'A09C')
call StoreInteger(udg_GameCache,"autocast1", I2S('A09A'), 'A09D')
call StoreInteger(udg_GameCache,"autocast1", I2S('A09B'), 'A09E')
call StoreString(udg_GameCache,"autocast2", I2S('A099'), "creepthunderbolt")
call StoreString(udg_GameCache,"autocast2", I2S('A09A'), "creepthunderbolt")
call StoreString(udg_GameCache,"autocast2", I2S('A09B'), "creepthunderbolt")
call StoreBoolean(udg_GameCache,"autocast3", I2S('A099'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A09A'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A09B'), true )
call StoreReal(udg_GameCache,"autocast4", I2S('A099'), 4.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A09A'), 6.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A09B'), 8.00 )
call StoreString(udg_GameCache,"function", I2S('A099'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A09A'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A09B'), "Trig_Autocast_Unit_Abilities_Actions")
// Chain Lightning
call StoreInteger(udg_GameCache,"autocast1", I2S('A0A5'), 'A09W')
call StoreInteger(udg_GameCache,"autocast1", I2S('A0A6'), 'A09X')
call StoreInteger(udg_GameCache,"autocast1", I2S('A0A7'), 'A09Y')
call StoreString(udg_GameCache,"autocast2", I2S('A0A5'), "chainlightning")
call StoreString(udg_GameCache,"autocast2", I2S('A0A6'), "chainlightning")
call StoreString(udg_GameCache,"autocast2", I2S('A0A7'), "chainlightning")
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0A5'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0A6'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0A7'), true )
call StoreReal(udg_GameCache,"autocast4", I2S('A0A5'), 1.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A0A6'), 1.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A0A7'), 1.00 )
call StoreString(udg_GameCache,"function", I2S('A0A5'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A0A6'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A0A7'), "Trig_Autocast_Unit_Abilities_Actions")
// Forked Lightning
call StoreInteger(udg_GameCache,"autocast1", I2S('A0A8'), 'A09T')
call StoreInteger(udg_GameCache,"autocast1", I2S('A0A9'), 'A09U')
call StoreInteger(udg_GameCache,"autocast1", I2S('A0AA'), 'A09V')
call StoreString(udg_GameCache,"autocast2", I2S('A0A8'), "forkedlightning")
call StoreString(udg_GameCache,"autocast2", I2S('A0A9'), "forkedlightning")
call StoreString(udg_GameCache,"autocast2", I2S('A0AA'), "forkedlightning")
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0A8'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0A9'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0AA'), true )
call StoreReal(udg_GameCache,"autocast4", I2S('A0A8'), 1.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A0A9'), 1.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A0AA'), 1.00 )
call StoreString(udg_GameCache,"function", I2S('A0A8'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A0A9'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A0AA'), "Trig_Autocast_Unit_Abilities_Actions")
// Ensnare
call StoreInteger(udg_GameCache,"autocast1", I2S('A0AX'), 'A0AV')
call StoreInteger(udg_GameCache,"autocast1", I2S('A0AY'), 'A0AW')
call StoreString(udg_GameCache,"autocast2", I2S('A0AX'), "ensnare")
call StoreString(udg_GameCache,"autocast2", I2S('A0AY'), "ensnare")
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0AX'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0AY'), true )
call StoreReal(udg_GameCache,"autocast4", I2S('A0AX'), 12.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A0AY'), 22.00 )
call StoreString(udg_GameCache,"function", I2S('A0AX'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A0AY'), "Trig_Autocast_Unit_Abilities_Actions")
// Frost Nova
call StoreInteger(udg_GameCache,"autocast1", I2S('A0BK'), 'A0BI')
call StoreInteger(udg_GameCache,"autocast1", I2S('A0BL'), 'A0BJ')
call StoreString(udg_GameCache,"autocast2", I2S('A0BK'), "frostnova")
call StoreString(udg_GameCache,"autocast2", I2S('A0BL'), "frostnova")
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0BK'), true )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0BL'), true )
call StoreReal(udg_GameCache,"autocast4", I2S('A0BK'), 1.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A0BL'), 1.00 )
call StoreString(udg_GameCache,"function", I2S('A0BK'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A0BL'), "Trig_Autocast_Unit_Abilities_Actions")
// Crushing Wave
call StoreInteger(udg_GameCache,"autocast1", I2S('A04S'), 'A04V')
call StoreInteger(udg_GameCache,"autocast1", I2S('A04T'), 'A04W')
call StoreInteger(udg_GameCache,"autocast1", I2S('A04U'), 'A04X')
call StoreString(udg_GameCache,"autocast2", I2S('A04S'), "carrionswarm")
call StoreString(udg_GameCache,"autocast2", I2S('A04T'), "carrionswarm")
call StoreString(udg_GameCache,"autocast2", I2S('A04U'), "carrionswarm")
call StoreBoolean(udg_GameCache,"autocast3", I2S('A04S'), false )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A04T'), false )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A04U'), false )
call StoreReal(udg_GameCache,"autocast4", I2S('A04S'), 1.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A04T'), 1.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A04U'), 1.00 )
call StoreString(udg_GameCache,"function", I2S('A04S'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A04T'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A04U'), "Trig_Autocast_Unit_Abilities_Actions")
// Carrion Swarm
call StoreInteger(udg_GameCache,"autocast1", I2S('A08J'), 'A08G')
call StoreInteger(udg_GameCache,"autocast1", I2S('A08K'), 'A08H')
call StoreInteger(udg_GameCache,"autocast1", I2S('A08L'), 'A08I')
call StoreString(udg_GameCache,"autocast2", I2S('A08J'), "carrionswarm")
call StoreString(udg_GameCache,"autocast2", I2S('A08K'), "carrionswarm")
call StoreString(udg_GameCache,"autocast2", I2S('A08L'), "carrionswarm")
call StoreBoolean(udg_GameCache,"autocast3", I2S('A08J'), false )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A08K'), false )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A08L'), false )
call StoreReal(udg_GameCache,"autocast4", I2S('A08J'), 1.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A08K'), 1.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A08L'), 1.00 )
call StoreString(udg_GameCache,"function", I2S('A08J'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A08K'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A08L'), "Trig_Autocast_Unit_Abilities_Actions")
// RainOfFire
call StoreInteger(udg_GameCache,"autocast1", I2S('A0AB'), 'A09Z')
call StoreInteger(udg_GameCache,"autocast1", I2S('A0AC'), 'A0A0')
call StoreInteger(udg_GameCache,"autocast1", I2S('A0AD'), 'A0A1')
call StoreString(udg_GameCache,"autocast2", I2S('A0AB'), "rainoffire")
call StoreString(udg_GameCache,"autocast2", I2S('A0AC'), "rainoffire")
call StoreString(udg_GameCache,"autocast2", I2S('A0AD'), "rainoffire")
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0AB'), false )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0AC'), false )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0AD'), false )
call StoreReal(udg_GameCache,"autocast4", I2S('A0AB'), 1.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A0AC'), 1.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A0AD'), 1.00 )
call StoreString(udg_GameCache,"function", I2S('A0AB'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A0AC'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A0AD'), "Trig_Autocast_Unit_Abilities_Actions")
// Impale
call StoreInteger(udg_GameCache,"autocast1", I2S('A0AE'), 'A0A2')
call StoreInteger(udg_GameCache,"autocast1", I2S('A0AF'), 'A0A3')
call StoreInteger(udg_GameCache,"autocast1", I2S('A0AG'), 'A0A4')
call StoreString(udg_GameCache,"autocast2", I2S('A0AE'), "impale")
call StoreString(udg_GameCache,"autocast2", I2S('A0AF'), "impale")
call StoreString(udg_GameCache,"autocast2", I2S('A0AG'), "impale")
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0AE'), false )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0AF'), false )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0AG'), false )
call StoreReal(udg_GameCache,"autocast4", I2S('A0AE'), 3.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A0AF'), 4.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A0AG'), 5.00 )
call StoreString(udg_GameCache,"function", I2S('A0AE'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A0AF'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A0AG'), "Trig_Autocast_Unit_Abilities_Actions")
// Bomb Explosion
call StoreInteger(udg_GameCache,"autocast1", I2S('A0B7'), 'A0B5')
call StoreInteger(udg_GameCache,"autocast1", I2S('A0B8'), 'A0B6')
call StoreString(udg_GameCache,"autocast2", I2S('A0B7'), "flamestrike")
call StoreString(udg_GameCache,"autocast2", I2S('A0B8'), "flamestrike")
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0B7'), false )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0B8'), false )
call StoreReal(udg_GameCache,"autocast4", I2S('A0B7'), 1.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A0B8'), 1.00 )
call StoreString(udg_GameCache,"function", I2S('A0B7'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A0B8'), "Trig_Autocast_Unit_Abilities_Actions")
// Breath of Fire
call StoreInteger(udg_GameCache,"autocast1", I2S('A0EF'), 'A0ED')
call StoreInteger(udg_GameCache,"autocast1", I2S('A0EG'), 'A0EE')
call StoreString(udg_GameCache,"autocast2", I2S('A0EF'), "breathoffire")
call StoreString(udg_GameCache,"autocast2", I2S('A0EG'), "breathoffire")
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0EF'), false )
call StoreBoolean(udg_GameCache,"autocast3", I2S('A0EG'), false )
call StoreReal(udg_GameCache,"autocast4", I2S('A0EF'), 1.00 )
call StoreReal(udg_GameCache,"autocast4", I2S('A0EG'), 1.00 )
call StoreString(udg_GameCache,"function", I2S('A0EF'), "Trig_Autocast_Unit_Abilities_Actions")
call StoreString(udg_GameCache,"function", I2S('A0EG'), "Trig_Autocast_Unit_Abilities_Actions")
endfunction
//===========================================================================
function InitTrig_Init_Game_Cache takes nothing returns nothing
set gg_trg_Init_Game_Cache = CreateTrigger( )
call TriggerAddAction( gg_trg_Init_Game_Cache, function Trig_Init_Game_Cache_Actions )
endfunction
function Trig_Region_Filter takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction
function Trig_Secret_Shop_Actions takes nothing returns nothing
local group g1 = GetUnitsInRectMatching(gg_rct_Secret_4, Condition(function Trig_Region_Filter))
local group g2 = GetUnitsInRectMatching(gg_rct_Secret_3, Condition(function Trig_Region_Filter))
local group g3 = GetUnitsInRectMatching(gg_rct_Secret_2, Condition(function Trig_Region_Filter))
local group g4 = GetUnitsInRectMatching(gg_rct_Secret_1, Condition(function Trig_Region_Filter))
local integer n1 = CountUnitsInGroup(g1)
local integer n2 = CountUnitsInGroup(g2)
local integer n3 = CountUnitsInGroup(g3)
local integer n4 = CountUnitsInGroup(g4)
call DestroyGroup(g1)
call DestroyGroup(g2)
call DestroyGroup(g3)
call DestroyGroup(g4)
if ( n1 > 0 ) then
call SetDestructableAnimationBJ( gg_dest_DTfx_1545, "stand alternate" )
else
call SetDestructableAnimationBJ( gg_dest_DTfx_1545, "stand" )
endif
if ( n2 > 0 ) then
call SetDestructableAnimationBJ( gg_dest_DTfx_1546, "stand alternate" )
else
call SetDestructableAnimationBJ( gg_dest_DTfx_1546, "stand" )
endif
if ( n3 > 0 ) then
call SetDestructableAnimationBJ( gg_dest_DTfx_1547, "stand alternate" )
else
call SetDestructableAnimationBJ( gg_dest_DTfx_1547, "stand" )
endif
if ( n4 > 0 ) then
call SetDestructableAnimationBJ( gg_dest_DTfx_1544, "stand alternate" )
else
call SetDestructableAnimationBJ( gg_dest_DTfx_1544, "stand" )
endif
if (( udg_SecretShop == false ) and ( n1 > 0 ) and ( n2 > 0 ) and ( n3 > 0 ) and ( n4 > 0 )) then
set udg_SecretShop = true
call ShowUnitShow( gg_unit_n000_0021 )
call SetUnitAnimation( gg_unit_n000_0021, "birth" )
call TriggerSleepAction( 1.00 )
call ResetUnitAnimation( gg_unit_n000_0021 )
call UnitAddAbilityBJ( 'Aneu', gg_unit_n000_0021 )
call UnitSetUsesAltIconBJ( true, gg_unit_n000_0021 )
elseif ((udg_SecretShop == true) and (not (( n1 > 0 ) and ( n2 > 0 ) and ( n3 > 0 ) and ( n4 > 0 ))) ) then
set udg_SecretShop = false
call UnitSetUsesAltIconBJ( false, gg_unit_n000_0021 )
call SetUnitAnimation( gg_unit_n000_0021, "death" )
call TriggerSleepAction( 1.00 )
call ShowUnitHide( gg_unit_n000_0021 )
call UnitRemoveAbilityBJ( 'Aneu', gg_unit_n000_0021 )
endif
endfunction
//===========================================================================
function InitTrig_Secret_Merchant takes nothing returns nothing
set gg_trg_Secret_Merchant = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Secret_Merchant, 5.00 )
call TriggerRegisterEnterRectSimple( gg_trg_Secret_Merchant, gg_rct_Secret_1 )
call TriggerRegisterEnterRectSimple( gg_trg_Secret_Merchant, gg_rct_Secret_2 )
call TriggerRegisterEnterRectSimple( gg_trg_Secret_Merchant, gg_rct_Secret_3 )
call TriggerRegisterEnterRectSimple( gg_trg_Secret_Merchant, gg_rct_Secret_4 )
call TriggerRegisterLeaveRectSimple( gg_trg_Secret_Merchant, gg_rct_Secret_1 )
call TriggerRegisterLeaveRectSimple( gg_trg_Secret_Merchant, gg_rct_Secret_2 )
call TriggerRegisterLeaveRectSimple( gg_trg_Secret_Merchant, gg_rct_Secret_3 )
call TriggerRegisterLeaveRectSimple( gg_trg_Secret_Merchant, gg_rct_Secret_4 )
call TriggerAddAction( gg_trg_Secret_Merchant, function Trig_Secret_Shop_Actions )
endfunction
function Trig_Tauren_Conditions takes nothing returns boolean
return ( GetUnitTypeId(GetEnteringUnit()) == 'e001' )
endfunction
function Trig_Tauren_Get_Region takes unit u returns integer
local integer i = 13
local integer regions = 13
local location a = GetRectCenter(udg_PlayerStartRegions[i])
local location b = GetUnitLoc(u)
local real dist = DistanceBetweenPoints(a, b)
call RemoveLocation(a)
call RemoveLocation(b)
loop
exitwhen i > 28
set a = GetRectCenter(udg_PlayerStartRegions[i])
set b = GetUnitLoc(u)
if (dist > DistanceBetweenPoints(a, b)) then
set dist = DistanceBetweenPoints(a, b)
set regions = i
endif
call RemoveLocation(a)
call RemoveLocation(b)
set i = i + 1
endloop
return regions
endfunction
function Trig_Tauren_Actions takes nothing returns nothing
local integer regions
local integer next
local location l
set regions = Trig_Tauren_Get_Region(GetEnteringUnit())
set next = 1 + regions
if (next == 29) then
set next = 13
endif
if ((regions != 21) and (regions != 24) and (regions != 25) and (regions != 28)) then
set l = GetRectCenter(udg_PlayerStartRegions[regions])
call IssuePointOrderLocBJ( GetEnteringUnit(), "root", l )
call PolledWait( 2.00 )
call UnitSetUsesAltIconBJ( true, GetEnteringUnit() )
call SetDoodadAnimationBJ( "birth", 'NOfp', 1024.00, l )
if (regions == 13) then
call SetUnitFacingTimed( GetEnteringUnit(), 270.00, 0 )
elseif ((regions == 14) or (regions == 22)) then
call SetUnitFacingTimed( GetEnteringUnit(), 225.00, 0 )
elseif ((regions == 15) or (regions == 26)) then
call SetUnitFacingTimed( GetEnteringUnit(), 135.00, 0 )
elseif (regions == 16) then
call SetUnitFacingTimed( GetEnteringUnit(), 180.00, 0 )
elseif (regions == 17) then
call SetUnitFacingTimed( GetEnteringUnit(), 0.00, 0 )
elseif ((regions == 18) or (regions == 23)) then
call SetUnitFacingTimed( GetEnteringUnit(), 315.00, 0 )
elseif ((regions == 19) or (regions == 27)) then
call SetUnitFacingTimed( GetEnteringUnit(), 45.00, 0 )
elseif (regions == 20) then
call SetUnitFacingTimed( GetEnteringUnit(), 90.00, 0 )
endif
call SetPlayerAbilityAvailableBJ( false, 'Aro2', Player(PLAYER_NEUTRAL_PASSIVE) )
call UnitAddAbilityBJ( 'Aneu', GetEnteringUnit() )
call PolledWait( 15.00 )
call SetPlayerAbilityAvailableBJ( true, 'Aro2', Player(PLAYER_NEUTRAL_PASSIVE) )
call UnitRemoveAbilityBJ( 'Aneu', GetEnteringUnit() )
call UnitSetUsesAltIconBJ( false, GetEnteringUnit() )
call IssueImmediateOrderBJ( GetEnteringUnit(), "unroot" )
call SetDoodadAnimationBJ( "death", 'NOfp', 1024.00, l )
call RemoveLocation(l)
call PolledWait( 3.00 )
endif
set l = GetRectCenter(udg_PlayerStartRegions[next])
call IssuePointOrderLocBJ( GetEnteringUnit(), "move", l )
call RemoveLocation(l)
endfunction
//===========================================================================
function InitTrig_Tauren_Merchant takes nothing returns nothing
local integer i = 13
set gg_trg_Tauren_Merchant = CreateTrigger( )
set udg_PlayerStartRegions[13] = gg_rct_Tauren_1
set udg_PlayerStartRegions[14] = gg_rct_Tauren_2
set udg_PlayerStartRegions[15] = gg_rct_Tauren_3
set udg_PlayerStartRegions[16] = gg_rct_Tauren_4
set udg_PlayerStartRegions[17] = gg_rct_Tauren_5
set udg_PlayerStartRegions[18] = gg_rct_Tauren_6
set udg_PlayerStartRegions[19] = gg_rct_Tauren_7
set udg_PlayerStartRegions[20] = gg_rct_Tauren_8
set udg_PlayerStartRegions[21] = gg_rct_Tauren_9
set udg_PlayerStartRegions[22] = gg_rct_Tauren_10
set udg_PlayerStartRegions[23] = gg_rct_Tauren_11
set udg_PlayerStartRegions[24] = gg_rct_Tauren_12
set udg_PlayerStartRegions[25] = gg_rct_Tauren_13
set udg_PlayerStartRegions[26] = gg_rct_Tauren_14
set udg_PlayerStartRegions[27] = gg_rct_Tauren_15
set udg_PlayerStartRegions[28] = gg_rct_Tauren_16
loop
exitwhen i > 28
call TriggerRegisterEnterRectSimple( gg_trg_Tauren_Merchant, udg_PlayerStartRegions[i] )
set i = i + 1
endloop
call TriggerAddCondition( gg_trg_Tauren_Merchant, Condition( function Trig_Tauren_Conditions ) )
call TriggerAddAction( gg_trg_Tauren_Merchant, function Trig_Tauren_Actions )
endfunction
function Trig_Level_Func001Func002Func002002 takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_Level_Actions takes nothing returns nothing
local player p
local integer i = 1
local location l
local group g
loop
exitwhen i > 12
set p = ConvertedPlayer(i)
set l = GetRectCenter(GetPlayableMapRect())
call CreateNUnitsAtLoc( 1, 'h00S', p, l, bj_UNIT_FACING )
call RemoveLocation(l)
set udg_TempGroup = GetUnitsOfPlayerAndTypeId(p, 'h00S')
if ( CountUnitsInGroup(udg_TempGroup) == 2 ) then
call ReplaceUnitBJ( GroupPickRandomUnit(udg_TempGroup), 'h00T', bj_UNIT_STATE_METHOD_RELATIVE )
call ForGroupBJ( udg_TempGroup, function Trig_Level_Func001Func002Func002002 )
endif
call DestroyGroup(udg_TempGroup)
set udg_TempGroup = GetUnitsOfPlayerAndTypeId(p, 'h00T')
set g = GetUnitsOfPlayerAndTypeId(p, 'h00S')
if (( CountUnitsInGroup(udg_TempGroup) == 2 ) and ( CountUnitsInGroup(g) == 1 )) then
call ReplaceUnitBJ( GroupPickRandomUnit(g), 'h00U', bj_UNIT_STATE_METHOD_RELATIVE )
call ForGroupBJ( udg_TempGroup, function Trig_Level_Func001Func002Func002002 )
endif
call DestroyGroup(udg_TempGroup)
call DestroyGroup(g)
set udg_TempGroup = GetUnitsOfPlayerAndTypeId(p, 'h00U')
if ( CountUnitsInGroup(udg_TempGroup) == 2 ) then
call ReplaceUnitBJ( GroupPickRandomUnit(udg_TempGroup), 'h00V', bj_UNIT_STATE_METHOD_RELATIVE )
call ForGroupBJ( udg_TempGroup, function Trig_Level_Func001Func002Func002002 )
endif
call DestroyGroup(udg_TempGroup)
set udg_TempGroup = GetUnitsOfPlayerAndTypeId(p, 'h00V')
if ( CountUnitsInGroup(udg_TempGroup) == 2 ) then
call ReplaceUnitBJ( GroupPickRandomUnit(udg_TempGroup), 'h00W', bj_UNIT_STATE_METHOD_RELATIVE )
call ForGroupBJ( udg_TempGroup, function Trig_Level_Func001Func002Func002002 )
endif
call DestroyGroup(udg_TempGroup)
set udg_TempGroup = GetUnitsOfPlayerAndTypeId(p, 'h00W')
if ( CountUnitsInGroup(udg_TempGroup) == 2 ) then
call ReplaceUnitBJ( GroupPickRandomUnit(udg_TempGroup), 'h00X', bj_UNIT_STATE_METHOD_RELATIVE )
call ForGroupBJ( udg_TempGroup, function Trig_Level_Func001Func002Func002002 )
endif
call DestroyGroup(udg_TempGroup)
set udg_TempGroup = GetUnitsOfPlayerAndTypeId(p, 'h00X')
if ( CountUnitsInGroup(udg_TempGroup) == 2 ) then
call ReplaceUnitBJ( GroupPickRandomUnit(udg_TempGroup), 'h00Y', bj_UNIT_STATE_METHOD_RELATIVE )
call ForGroupBJ( udg_TempGroup, function Trig_Level_Func001Func002Func002002 )
endif
call DestroyGroup(udg_TempGroup)
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_Level takes nothing returns nothing
set gg_trg_Level = CreateTrigger( )
call TriggerAddAction( gg_trg_Level, function Trig_Level_Actions )
endfunction
function Trig_Player_Left_Coin2 takes nothing returns boolean
return (( GetUnitTypeId(GetFilterUnit()) == 'n001' ) and ( IsUnitAliveBJ(GetFilterUnit()) == true ))
endfunction
function Trig_Player_Left_Coin takes nothing returns boolean
return (( GetUnitTypeId(GetFilterUnit()) == 'n001' ) and ( GetUnitUserData(GetFilterUnit()) == GetConvertedPlayerId(GetTriggerPlayer()) ))
endfunction
function Trig_Player_Left_Conditions takes nothing returns boolean
return ( udg_Dummy[GetConvertedPlayerId(GetTriggerPlayer())] < 50 )
endfunction
function Trig_Player_Left_Group3 takes nothing returns boolean
return ( GetUnitUserData(GetFilterUnit()) == udg_Dummy[98] )
endfunction
function Trig_Player_Left_Group4 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == true )
endfunction
function Trig_Player_Left_Group_Action takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_Player_Left_Group_Action2 takes nothing returns nothing
call KillUnit( GetEnumUnit() )
endfunction
function Trig_Player_Left_Actions takes nothing returns nothing
local integer i
local player p = GetTriggerPlayer()
local unit u
local boolean b = true
local unit c = FirstOfGroup( GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_Player_Left_Coin)) )
call DisplayTextToForce( GetPlayersAll(), ( "|cffFFCC00Player " + ( GetPlayerName(GetTriggerPlayer()) + ( " (Player " + ( I2S(GetConvertedPlayerId(GetTriggerPlayer())) + ") has left the game" ) ) ) ) )
call ForGroupBJ( GetUnitsOfPlayerMatching(p, Condition(function Trig_Player_Loose_Group)), function Trig_Player_Left_Group_Action )
call ForGroupBJ( GetUnitsOfTypeIdAll(udg_SellTechLevel[GetConvertedPlayerId(p)]), function Trig_Player_Left_Group_Action )
call ForGroupBJ( GetUnitsOfPlayerMatching(p, Condition(function Trig_Player_Left_Group4)), function Trig_Player_Loose_Group_Action3 )
call StartTimerBJ( udg_ItemVanishTimer, true, 1.40 )
set udg_Dummy[98] = GetConvertedPlayerId(p)
call ForGroupBJ( GetUnitsOfPlayerMatching(Player(PLAYER_NEUTRAL_AGGRESSIVE), Condition(function Trig_Player_Left_Group3)), function Trig_Player_Left_Group_Action2 )
call PolledWait( 0.3 )
set udg_Dummy[98] = GetConvertedPlayerId(p)
call ForGroupBJ( GetUnitsOfPlayerMatching(Player(PLAYER_NEUTRAL_AGGRESSIVE), Condition(function Trig_Player_Left_Group3)), function Trig_Player_Left_Group_Action2 )
call PolledWait( 0.3 )
set udg_Dummy[98] = GetConvertedPlayerId(p)
call ForGroupBJ( GetUnitsOfPlayerMatching(Player(PLAYER_NEUTRAL_AGGRESSIVE), Condition(function Trig_Player_Left_Group3)), function Trig_Player_Left_Group_Action2 )
if ( c != null ) then
call RemoveUnit( c )
set i = 1
loop
exitwhen i > 12
if (( GetPlayerSlotState(ConvertedPlayer(i)) == PLAYER_SLOT_STATE_PLAYING ) and ( GetPlayerController(ConvertedPlayer(i)) == MAP_CONTROL_USER )) then
set udg_TempGroup = GetUnitsInRangeOfLocMatching(512, GetRectCenter(udg_PlayerStartRegions[i]), Condition(function Trig_Player_Left_Coin2))
set u = GroupPickRandomUnit(udg_TempGroup)
call DestroyGroup(udg_TempGroup)
if (u != null) then
set b = false
endif
endif
set i = i + 1
endloop
if (b == true) then
call PauseTimerBJ( true, udg_ConstructionTimer[13] )
call DestroyTimerDialogBJ( GetLastCreatedTimerDialogBJ() )
call EnableTrigger( gg_trg_Tips )
call PolledWait( 0.3 )
call MultiboardDisplayBJ( true, GetLastCreatedMultiboard() )
call StartTimerBJ( udg_FloatingText, true, 60.00 )
call TriggerExecute( gg_trg_Preview_Initialisation )
call DisableTrigger( gg_trg_Race_Cameras )
call SetDoodadAnimationRectBJ( "birth", 'JZif', GetPlayableMapRect() )
call TriggerExecute( gg_trg_Multiboard_Update )
set udg_WaveWaitTime[0] = 46.00
call StartTimerBJ( udg_WaveTimer[1], true, 1.00 )
call TriggerExecute( gg_trg_Multiboard_Collapse )
endif
endif
call TriggerExecute( gg_trg_Multiboard_Expand )
endfunction
//===========================================================================
function InitTrig_Player_Left takes nothing returns nothing
local integer i = 0
set gg_trg_Player_Left = CreateTrigger( )
loop
exitwhen i > 11
if ( GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING ) then
call TriggerRegisterPlayerEventLeave( gg_trg_Player_Left, Player(i) )
endif
set i = i + 1
endloop
call TriggerAddCondition( gg_trg_Player_Left, Condition( function Trig_Player_Left_Conditions ) )
call TriggerAddAction( gg_trg_Player_Left, function Trig_Player_Left_Actions )
endfunction
function Trig_Player_Loose_Group3 takes nothing returns boolean
return ( GetUnitUserData(GetFilterUnit()) == udg_Dummy[98] )
endfunction
function Trig_Player_Loose_Group4 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == true )
endfunction
function Trig_Player_Loose_Group_Action takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_Player_Loose_Group_Action2 takes nothing returns nothing
call KillUnit( GetEnumUnit() )
endfunction
function Trig_Player_Loose_Actions takes nothing returns nothing
local integer i = 1
loop
exitwhen i > 12
if ( ( udg_Dummy[i] == 50 ) and ( GetPlayerController(ConvertedPlayer(i)) == MAP_CONTROL_USER ) and ( GetPlayerSlotState(ConvertedPlayer(i)) == PLAYER_SLOT_STATE_PLAYING ) ) then
call SetPlayerStateBJ( ConvertedPlayer(i), PLAYER_STATE_RESOURCE_GOLD, 0 )
call SetPlayerStateBJ( ConvertedPlayer(i), PLAYER_STATE_RESOURCE_LUMBER, 0 )
set udg_Dummy[i] = ( udg_Dummy[i] + 1 )
set udg_Dummy[98] = i
call ForGroupBJ( GetUnitsOfPlayerMatching(ConvertedPlayer(i), Condition(function Trig_Player_Loose_Group)), function Trig_Player_Loose_Group_Action )
call ForGroupBJ( GetUnitsOfTypeIdAll(udg_SellTechLevel[i]), function Trig_Player_Loose_Group_Action )
call ForGroupBJ( GetUnitsOfPlayerMatching(ConvertedPlayer(i), Condition(function Trig_Player_Loose_Group4)), function Trig_Player_Loose_Group_Action3 )
call StartTimerBJ( udg_ItemVanishTimer, true, 1.40 )
call ForGroupBJ( GetUnitsOfPlayerMatching(Player(PLAYER_NEUTRAL_AGGRESSIVE), Condition(function Trig_Player_Loose_Group3)), function Trig_Player_Loose_Group_Action2 )
call PolledWait( 0.3 )
set udg_Dummy[98] = i
call ForGroupBJ( GetUnitsOfPlayerMatching(Player(PLAYER_NEUTRAL_AGGRESSIVE), Condition(function Trig_Player_Loose_Group3)), function Trig_Player_Loose_Group_Action2 )
call PolledWait( 0.3 )
set udg_Dummy[98] = i
call ForGroupBJ( GetUnitsOfPlayerMatching(Player(PLAYER_NEUTRAL_AGGRESSIVE), Condition(function Trig_Player_Loose_Group3)), function Trig_Player_Loose_Group_Action2 )
call TriggerExecute( gg_trg_Multiboard_Expand )
call Defeat(ConvertedPlayer(i),"You have Lost")
endif
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_Player_Loose takes nothing returns nothing
set gg_trg_Player_Loose = CreateTrigger( )
call TriggerAddAction( gg_trg_Player_Loose, function Trig_Player_Loose_Actions )
endfunction
function Trig_Race_Cameras_Group takes nothing returns boolean
return (( GetUnitTypeId(GetFilterUnit()) == 'n001' ) and ( IsUnitAliveBJ(GetFilterUnit()) == true ))
endfunction
function Trig_Race_Cameras_Group2 takes nothing returns boolean
return (( GetUnitTypeId(GetFilterUnit()) == 'h011' ) or ( GetUnitTypeId(GetFilterUnit()) == 'h012' ) or ( GetUnitTypeId(GetFilterUnit()) == 'h00Z' ) or ( GetUnitTypeId(GetFilterUnit()) == 'h010' ))
endfunction
function Trig_Race_Cameras_Actions takes nothing returns nothing
local integer i = 1
local unit u
local real angle
local unit t
loop
exitwhen i > 12
set udg_TempGroup = GetUnitsInRangeOfLocMatching(512, GetRectCenter(udg_PlayerStartRegions[i]), Condition(function Trig_Race_Cameras_Group))
set u = GroupPickRandomUnit(udg_TempGroup)
call DestroyGroup(udg_TempGroup)
if (u != null) then
set udg_TempGroup = GetUnitsOfPlayerMatching(ConvertedPlayer(i), Condition(function Trig_Race_Cameras_Group2))
set t = GroupPickRandomUnit(udg_TempGroup)
call DestroyGroup(udg_TempGroup)
if ((i == 1) or (i == 8) or (i == 9)) then
set angle = 0
elseif ((i == 3) or (i == 7) or (i == 12)) then
set angle = 90
elseif ((i == 4) or (i == 6) or (i == 11)) then
set angle = 180
elseif ((i == 2) or (i == 5) or (i == 10)) then
set angle = 270
endif
if (GetLocalPlayer() == ConvertedPlayer(i) ) then
if ((GetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK) != 322.00) or (GetCameraField(CAMERA_FIELD_ROTATION) != angle)) then
call CameraSetupApplyForPlayer( true, udg_StartingCameras[i], ConvertedPlayer(i), 0 )
call SetCameraTargetControllerNoZForPlayer( ConvertedPlayer(i), t, 0, 0, false )
endif
endif
endif
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_Race_Cameras takes nothing returns nothing
set gg_trg_Race_Cameras = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Race_Cameras, 0.20 )
call TriggerAddAction( gg_trg_Race_Cameras, function Trig_Race_Cameras_Actions )
endfunction
function Trig_Select_Race_Conditions takes nothing returns boolean
local boolean b = false
if (( GetUnitTypeId(GetTriggerUnit()) == 'h011' ) or ( GetUnitTypeId(GetTriggerUnit()) == 'h012' ) or ( GetUnitTypeId(GetTriggerUnit()) == 'h00Z' ) or ( GetUnitTypeId(GetTriggerUnit()) == 'h010' )) then
if (GetTriggerPlayer() == GetOwningPlayer(GetTriggerUnit())) then
set b = true
endif
endif
return b
endfunction
function Trig_Select_Race_Actions takes unit u returns nothing
local integer p = GetConvertedPlayerId(GetOwningPlayer(u))
local integer i
local sound switchy = CreateSound( "Abilities\\Spells\\Undead\\Graveyard\\GravemarkerBirth1.wav", false, false, false, 10, 10, "HeroAcksEAX" )
if (GetLocalPlayer() == GetOwningPlayer(u)) then
call SetSoundParamsFromLabel( switchy, "InterfaceError" )
call SetSoundDuration( switchy, 361 )
call SetSoundChannel( switchy, 6 )
call PlaySoundBJ( switchy )
endif
call DestroyTextTagBJ( udg_FloatingTexts[p] )
if (GetUnitTypeId(u) == 'h011') then
call ReplaceUnitBJ( u, 'h012', bj_UNIT_STATE_METHOD_RELATIVE )
call CreateTextTagLocBJ( "|cffFF9900Click on the building|n to change race|n|cff7777FF Sea Minions", GetRectCenter(udg_PlayerStartRegions[( GetConvertedPlayerId(GetOwningPlayer(u)) + 28 )]), 0, 10, 100, 100, 100, 0 )
set i = 1
loop
exitwhen i > 12
if ( GetPlayerSlotState(ConvertedPlayer(i)) == PLAYER_SLOT_STATE_PLAYING ) then
call LeaderboardSetPlayerItemLabelBJ( GetOwningPlayer(u), udg_Leaderboards[i], GetPlayerName(GetOwningPlayer(u)) + " (Sea Minions)" )
endif
set i = i + 1
endloop
elseif (GetUnitTypeId(u) == 'h012') then
call ReplaceUnitBJ( u, 'h00Z', bj_UNIT_STATE_METHOD_RELATIVE )
call CreateTextTagLocBJ( "|cffFF9900Click on the building|n to change race|n|cff00DD00 Dragons", GetRectCenter(udg_PlayerStartRegions[( GetConvertedPlayerId(GetOwningPlayer(u)) + 28 )]), 0, 10, 100, 100, 100, 0 )
set i = 1
loop
exitwhen i > 12
if ( GetPlayerSlotState(ConvertedPlayer(i)) == PLAYER_SLOT_STATE_PLAYING ) then
call LeaderboardSetPlayerItemLabelBJ( GetOwningPlayer(u), udg_Leaderboards[i], GetPlayerName(GetOwningPlayer(u)) + " (Dragons)" )
endif
set i = i + 1
endloop
elseif (GetUnitTypeId(u) == 'h00Z') then
call ReplaceUnitBJ( u, 'h010', bj_UNIT_STATE_METHOD_RELATIVE )
call CreateTextTagLocBJ( "|cffFF9900Click on the building|n to change race|n|cffff5500 Goblins", GetRectCenter(udg_PlayerStartRegions[( GetConvertedPlayerId(GetOwningPlayer(u)) + 28 )]), 0, 10, 100, 100, 100, 0 )
set i = 1
loop
exitwhen i > 12
if ( GetPlayerSlotState(ConvertedPlayer(i)) == PLAYER_SLOT_STATE_PLAYING ) then
call LeaderboardSetPlayerItemLabelBJ( GetOwningPlayer(u), udg_Leaderboards[i], GetPlayerName(GetOwningPlayer(u)) + " (Goblins)" )
endif
set i = i + 1
endloop
elseif (GetUnitTypeId(u) == 'h010') then
call ReplaceUnitBJ( u, 'h011', bj_UNIT_STATE_METHOD_RELATIVE )
call CreateTextTagLocBJ( "|cffFF9900Click on the building|n to change race|n|cffEE00EE Nerubians", GetRectCenter(udg_PlayerStartRegions[( GetConvertedPlayerId(GetOwningPlayer(u)) + 28 )]), 0, 10, 100, 100, 100, 0 )
set i = 1
loop
exitwhen i > 12
if ( GetPlayerSlotState(ConvertedPlayer(i)) == PLAYER_SLOT_STATE_PLAYING ) then
call LeaderboardSetPlayerItemLabelBJ( GetOwningPlayer(u), udg_Leaderboards[i], GetPlayerName(GetOwningPlayer(u)) + " (Nerubians)" )
endif
set i = i + 1
endloop
endif
call SetCameraTargetControllerNoZForPlayer( ConvertedPlayer(p), GetLastReplacedUnitBJ(), 0, 0, false )
set udg_FloatingTexts[p] = GetLastCreatedTextTag()
endfunction
function Trig_Select_Race_Actions1 takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call Trig_Select_Race_Actions(GetTriggerUnit())
call TriggerSleepAction( 0.30 )
call EnableTrigger( GetTriggeringTrigger() )
endfunction
function Trig_Select_Race_Actions2 takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call Trig_Select_Race_Actions(GetTriggerUnit())
call TriggerSleepAction( 0.30 )
call EnableTrigger( GetTriggeringTrigger() )
endfunction
function Trig_Select_Race_Actions3 takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call Trig_Select_Race_Actions(GetTriggerUnit())
call TriggerSleepAction( 0.30 )
call EnableTrigger( GetTriggeringTrigger() )
endfunction
function Trig_Select_Race_Actions4 takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call Trig_Select_Race_Actions(GetTriggerUnit())
call TriggerSleepAction( 0.30 )
call EnableTrigger( GetTriggeringTrigger() )
endfunction
function Trig_Select_Race_Actions5 takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call Trig_Select_Race_Actions(GetTriggerUnit())
call TriggerSleepAction( 0.30 )
call EnableTrigger( GetTriggeringTrigger() )
endfunction
function Trig_Select_Race_Actions6 takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call Trig_Select_Race_Actions(GetTriggerUnit())
call TriggerSleepAction( 0.30 )
call EnableTrigger( GetTriggeringTrigger() )
endfunction
function Trig_Select_Race_Actions7 takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call Trig_Select_Race_Actions(GetTriggerUnit())
call TriggerSleepAction( 0.30 )
call EnableTrigger( GetTriggeringTrigger() )
endfunction
function Trig_Select_Race_Actions8 takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call Trig_Select_Race_Actions(GetTriggerUnit())
call TriggerSleepAction( 0.30 )
call EnableTrigger( GetTriggeringTrigger() )
endfunction
function Trig_Select_Race_Actions9 takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call Trig_Select_Race_Actions(GetTriggerUnit())
call TriggerSleepAction( 0.30 )
call EnableTrigger( GetTriggeringTrigger() )
endfunction
function Trig_Select_Race_Actions10 takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call Trig_Select_Race_Actions(GetTriggerUnit())
call TriggerSleepAction( 0.30 )
call EnableTrigger( GetTriggeringTrigger() )
endfunction
function Trig_Select_Race_Actions11 takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call Trig_Select_Race_Actions(GetTriggerUnit())
call TriggerSleepAction( 0.30 )
call EnableTrigger( GetTriggeringTrigger() )
endfunction
function Trig_Select_Race_Actions12 takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call Trig_Select_Race_Actions(GetTriggerUnit())
call TriggerSleepAction( 0.30 )
call EnableTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Select_Race takes nothing returns nothing
local integer i = 1
local trigger array selectionevents
loop
exitwhen i > 12
set selectionevents[i] = CreateTrigger( )
call TriggerRegisterPlayerSelectionEventBJ( selectionevents[i], Player(i-1), true )
call TriggerAddCondition( selectionevents[i], Condition( function Trig_Select_Race_Conditions ) )
set i = i + 1
endloop
call TriggerAddAction( selectionevents[1], function Trig_Select_Race_Actions1 )
call TriggerAddAction( selectionevents[2], function Trig_Select_Race_Actions2 )
call TriggerAddAction( selectionevents[3], function Trig_Select_Race_Actions3 )
call TriggerAddAction( selectionevents[4], function Trig_Select_Race_Actions4 )
call TriggerAddAction( selectionevents[5], function Trig_Select_Race_Actions5 )
call TriggerAddAction( selectionevents[6], function Trig_Select_Race_Actions6 )
call TriggerAddAction( selectionevents[7], function Trig_Select_Race_Actions7 )
call TriggerAddAction( selectionevents[8], function Trig_Select_Race_Actions8 )
call TriggerAddAction( selectionevents[9], function Trig_Select_Race_Actions9 )
call TriggerAddAction( selectionevents[10], function Trig_Select_Race_Actions10 )
call TriggerAddAction( selectionevents[11], function Trig_Select_Race_Actions11 )
call TriggerAddAction( selectionevents[12], function Trig_Select_Race_Actions12 )
endfunction
function Trig_choose_Conditions takes nothing returns boolean
local boolean b = false
if ( GetUnitTypeId(GetTriggerUnit()) == 'n001' ) then
if (ConvertedPlayer(GetUnitUserData(GetTriggerUnit())) == GetTriggerPlayer()) then
set b = true
endif
endif
return b
endfunction
function Trig_choose_Group takes nothing returns boolean
return (( GetUnitTypeId(GetFilterUnit()) == 'n001' ) and ( IsUnitAliveBJ(GetFilterUnit()) == true ))
endfunction
function Trig_choose_Replace takes integer id1, integer id2, player pl returns nothing
local location p
local unit u
set udg_TempGroup = GetUnitsOfPlayerAndTypeId(pl, id1)
set u = GroupPickRandomUnit(udg_TempGroup)
call DestroyGroup(udg_TempGroup)
if ((u != null) and ( GetUnitTypeId(u) == id1 )) then
set p = GetUnitLoc(u)
call RemoveUnit( u )
call CreateNUnitsAtLoc( 1, id2, pl, p, bj_UNIT_FACING )
call RemoveLocation(p)
endif
endfunction
function Trig_choose_Actions takes nothing returns nothing
local unit u
local location p
local integer i = 1
local boolean b = true
local player pl = ConvertedPlayer(GetUnitUserData(GetTriggerUnit()))
local sound switchy = CreateSound( "Sound\\Interface\\ClanInvitation.wav", false, false, false, 10, 10, "HeroAcksEAX" )
if (GetLocalPlayer() == pl) then
call SetSoundParamsFromLabel( switchy, "InterfaceError" )
call SetSoundDuration( switchy, 361 )
call SetSoundChannel( switchy, 6 )
call PlaySoundBJ( switchy )
endif
call Trig_choose_Replace('h00Z','h00E',pl)
call Trig_choose_Replace('h010','h00A',pl)
call Trig_choose_Replace('h011','h00B',pl)
call Trig_choose_Replace('h012','h00F',pl)
call ResetToGameCameraForPlayer( pl, 0.50 )
call DestroyTextTagBJ( udg_FloatingTexts[GetConvertedPlayerId(pl)] )
set p = GetRectCenter(udg_PlayerStartRegions[GetConvertedPlayerId(pl)])
call SetDoodadAnimationBJ( "birth", 'JZif', 768.00, p )
call RemoveLocation(p)
call KillUnit( GetTriggerUnit() )
call TimerDialogDisplayForPlayerBJ( false, GetLastCreatedTimerDialogBJ(), pl )
call LeaderboardDisplayBJ( false, udg_Leaderboards[GetConvertedPlayerId(pl)] )
set i = 1
loop
exitwhen i > 12
if (( GetPlayerSlotState(ConvertedPlayer(i)) == PLAYER_SLOT_STATE_PLAYING ) and ( GetPlayerController(ConvertedPlayer(i)) == MAP_CONTROL_USER )) then
set udg_TempGroup = GetUnitsInRangeOfLocMatching(512, GetRectCenter(udg_PlayerStartRegions[i]), Condition(function Trig_choose_Group))
set u = GroupPickRandomUnit(udg_TempGroup)
call DestroyGroup(udg_TempGroup)
if (u != null) then
set b = false
endif
endif
set i = i + 1
endloop
if (b == true) then
call DisableTrigger( GetTriggeringTrigger() )
call PauseTimerBJ( true, udg_ConstructionTimer[13] )
call DestroyTimerDialogBJ( GetLastCreatedTimerDialogBJ() )
call EnableTrigger( gg_trg_Tips )
call TriggerSleepAction( 0.3 )
call MultiboardDisplayBJ( true, GetLastCreatedMultiboard() )
call StartTimerBJ( udg_FloatingText, true, 60.00 )
call TriggerExecute( gg_trg_Preview_Initialisation )
call DisableTrigger( gg_trg_Race_Cameras )
call SetDoodadAnimationRectBJ( "birth", 'JZif', GetPlayableMapRect() )
call TriggerExecute( gg_trg_Multiboard_Update )
set udg_WaveWaitTime[0] = 46.00
call StartTimerBJ( udg_WaveTimer[1], true, 1.00 )
call TriggerExecute( gg_trg_Multiboard_Collapse )
endif
endfunction
//===========================================================================
function InitTrig_Choose_Race takes nothing returns nothing
local integer i = 0
set gg_trg_Choose_Race = CreateTrigger( )
loop
exitwhen i > 11
//call TriggerRegisterPlayerChatEvent( gg_trg_Choose_Race, Player(i), "choose", true )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_Choose_Race, Player(i), true )
set i = i + 1
endloop
call TriggerAddCondition( gg_trg_Choose_Race, Condition( function Trig_choose_Conditions ) )
call TriggerAddAction( gg_trg_Choose_Race, function Trig_choose_Actions )
endfunction
function Trig_ForceChoose_Race_Group takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == 'n001' )
endfunction
function Trig_ForceChoose_Race_Actions takes nothing returns nothing
local integer i = 1
local location l
loop
exitwhen i > 12
set l = GetRectCenter(udg_PlayerStartRegions[i])
set udg_TempGroup = GetUnitsInRangeOfLocMatching(512, l, Condition(function Trig_ForceChoose_Race_Group))
call RemoveLocation(l)
if ( GroupPickRandomUnit(udg_TempGroup) != null ) then
call ClearSelectionForPlayer( ConvertedPlayer(i) )
call SelectUnitAddForPlayer( GroupPickRandomUnit(udg_TempGroup), ConvertedPlayer(i) )
endif
call DestroyGroup(udg_TempGroup)
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_ForceChoose_Race takes nothing returns nothing
set gg_trg_ForceChoose_Race = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_ForceChoose_Race, udg_ConstructionTimer[13] )
call TriggerAddAction( gg_trg_ForceChoose_Race, function Trig_ForceChoose_Race_Actions )
endfunction
function Trig_Item_Preplace takes nothing returns nothing
local integer X = ( ( R2I(GetLocationX(GetItemLoc(GetEnumItem()))) + 6912 ) / 10 )
local integer Y = ( ( R2I(GetLocationY(GetItemLoc(GetEnumItem()))) + 6912 ) / 10 )
local integer Z = ( ( X * 10000 ) + Y )
local location l
call SetItemUserData( GetEnumItem(), Z )
set X = ( ( GetItemUserData(GetEnumItem()) / 10000 ) * 10 )
set Y = ( ( GetItemUserData(GetEnumItem()) - ( ( GetItemUserData(GetEnumItem()) / 10000 ) * 10000 ) ) * 10 )
set l = Location(I2R(( X - 6912 )), I2R(( Y - 6912 )))
call SetItemPositionLoc( GetEnumItem(), l )
call RemoveLocation(l)
endfunction
function Trig_Item_Pickup_Conditions takes nothing returns boolean
return ( GetOwningPlayer(GetManipulatingUnit()) != Player(PLAYER_NEUTRAL_AGGRESSIVE) )
endfunction
function Trig_Item_Pickup_Actions takes nothing returns nothing
local integer X = ( ( GetItemUserData(GetManipulatedItem()) / 10000 ) * 10 )
local integer Y = ( ( GetItemUserData(GetManipulatedItem()) - ( ( GetItemUserData(GetManipulatedItem()) / 10000 ) * 10000 ) ) * 10 )
local location l
if ( GetItemLevel(GetManipulatedItem()) > GetHeroLevel(GetManipulatingUnit()) ) then
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())), ( "|cffffcc00This item requires a minimum level " + ( I2S(GetItemLevel(GetManipulatedItem())) + " hero to handle it.|r" ) ) )
if (udg_ItemHero != null) then
call UnitAddItemSwapped( GetManipulatedItem(), udg_ItemHero )
set udg_ItemHero = null
else
set l = Location(I2R(( X - 6912 )), I2R(( Y - 6912 )))
call SetItemPositionLoc( GetManipulatedItem(), l )
call RemoveLocation(l)
endif
else
if (udg_ItemHero != null) then
set udg_ItemHero = null
endif
endif
endfunction
function Trig_Item_Timer_Actions takes nothing returns nothing
local integer X = ( ( R2I(GetLocationX(GetItemLoc(udg_ItemObject))) + 6912 ) / 10 )
local integer Y = ( ( R2I(GetLocationY(GetItemLoc(udg_ItemObject))) + 6912 ) / 10 )
local integer Z = ( ( X * 10000 ) + Y )
local location l
if (udg_ItemHero != null) then
call SetItemUserData( udg_ItemObject, Z )
set X = ( ( GetItemUserData(udg_ItemObject) / 10000 ) * 10 )
set Y = ( ( GetItemUserData(udg_ItemObject) - ( ( GetItemUserData(udg_ItemObject) / 10000 ) * 10000 ) ) * 10 )
set l = Location(I2R(( X - 6912 )), I2R(( Y - 6912 )))
call SetItemPositionLoc( udg_ItemObject, l )
call RemoveLocation(l)
set udg_ItemHero = null
endif
endfunction
function Trig_Item_Drop_Actions takes nothing returns nothing
local integer X = ( ( R2I(GetLocationX(GetUnitLoc(GetManipulatingUnit()))) + 6912 ) / 10 )
local integer Y = ( ( R2I(GetLocationY(GetUnitLoc(GetManipulatingUnit()))) + 6912 ) / 10 )
local integer Z = ( ( X * 10000 ) + Y )
call SetItemUserData( GetManipulatedItem(), Z )
set udg_ItemObject = GetManipulatedItem()
call StartTimerBJ( udg_ItemTimer, false, 0.00 )
set udg_ItemHero = GetManipulatingUnit()
endfunction
//===========================================================================
function InitTrig_Item_Pickup_Drop takes nothing returns nothing
local integer i = 0
local trigger Item_Timer = CreateTrigger( )
local trigger Item_Drop = CreateTrigger( )
loop
exitwhen i > 11
if ( GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING ) then
call TriggerRegisterPlayerUnitEventSimple( Item_Drop, Player(i), EVENT_PLAYER_UNIT_DROP_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Item_Pickup_Drop, Player(i), EVENT_PLAYER_UNIT_PICKUP_ITEM )
endif
set i = i + 1
endloop
call TriggerAddAction( Item_Drop, function Trig_Item_Drop_Actions )
call TriggerRegisterTimerExpireEventBJ( Item_Timer, udg_ItemTimer )
call TriggerAddAction( Item_Timer, function Trig_Item_Timer_Actions )
set gg_trg_Item_Pickup_Drop = CreateTrigger( )
call TriggerAddCondition( gg_trg_Item_Pickup_Drop, Condition( function Trig_Item_Pickup_Conditions ) )
call TriggerAddAction( gg_trg_Item_Pickup_Drop, function Trig_Item_Pickup_Actions )
call EnumItemsInRectBJ( GetPlayableMapRect(), function Trig_Item_Preplace )
endfunction
function Trig_Item_Vanish_Actions takes nothing returns nothing
local integer i = 1
local boolean b = true
local boolean array d
local integer array s
loop
exitwhen i > 12
set d[i] = false
set i = i + 1
endloop
set i = 1
loop
exitwhen i > udg_VanishItemsNum
if (udg_VanishItemsSecs[i] > 0) then
set udg_VanishItemsSecs[i] = udg_VanishItemsSecs[i] - 1
if (udg_VanishItems[i] != null) then
set d[GetConvertedPlayerId(GetItemPlayer(udg_VanishItems[i]))] = true
set s[GetConvertedPlayerId(GetItemPlayer(udg_VanishItems[i]))] = udg_VanishItemsSecs[i] + 1
endif
if (udg_VanishItemsSecs[i] == 0) then
if (udg_VanishItems[i] != null) then
if ( IsItemOwned(udg_VanishItems[i]) == false ) then
call AddSpecialEffectLocBJ( GetItemLoc(udg_VanishItems[i]), "Abilities\\Spells\\Human\\DispelMagic\\DispelMagicTarget.mdl" )
call RemoveItem( udg_VanishItems[i] )
endif
endif
endif
set b = false
endif
set i = i + 1
endloop
set i = 1
loop
exitwhen i > 12
if (d[i] == true) then
call DisplayTextToForce( GetPlayersAll(), "Player " + I2S(i) + "'s towers vanish in " + I2S(s[i]) + " seconds" )
endif
set i = i + 1
endloop
if (b == true) then
set udg_VanishItemsNum = 0
call PauseTimerBJ( true, GetExpiredTimer() )
endif
endfunction
//===========================================================================
function InitTrig_Item_Vanish takes nothing returns nothing
set gg_trg_Item_Vanish = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Item_Vanish, udg_ItemVanishTimer )
call TriggerAddAction( gg_trg_Item_Vanish, function Trig_Item_Vanish_Actions )
endfunction
function Trig_Generic_Spell_Remove_Actions takes nothing returns nothing
call UnitRemoveAbilityBJ( GetSpellAbilityId(), GetSpellAbilityUnit() )
endfunction
function Trig_WolfSpeed_Actions takes nothing returns nothing
local unit u = GetSpellTargetUnit()
local integer UnitEnumerator = GetUnitUserData(u)
local integer a = GetStoredInteger(udg_GameCache,"ability",I2S(GetSpellAbilityId()))
call UnitAddAbilityBJ( a, GetSpellAbilityUnit() )
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "frenzy" )
call TriggerSleepAction( 1.00 )
call IssuePointOrderLocBJ( u, "patrol", udg_UnitPoint[UnitEnumerator] )
endfunction
function Trig_Arm_Weapon_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local destructable d
call UnitRemoveAbilityBJ( GetSpellAbilityId(), u )
call UnitAddAbilityBJ( 'A0EH', u )
call UnitAddAbilityBJ( 'A0BF', u )
call CreateDestructableLoc( 'ATtr', GetRectCenter(gg_rct_Region_078), GetRandomDirectionDeg(), 0.80, 0 )
set d = GetLastCreatedDestructable()
call IssueTargetDestructableOrder( u, "grabtree", d )
endfunction
function Trig_Spawn_Egg_Actions takes nothing returns nothing
local unit u = GetSpellTargetUnit()
local unit c = GetSpellAbilityUnit()
local location l = GetUnitLoc(c)
local location t = GetUnitLoc(u)
local real a = AngleBetweenPoints(l, t)
local location p = PolarProjectionBJ(l, 128.00, a)
local integer UnitEnumerator = GetUnitUserData(u)
local integer regions = udg_UnitRegion[UnitEnumerator]
local integer unitint = GetStoredInteger(udg_GameCache,"spawn",I2S(GetSpellAbilityId()+ GetUnitFoodMade(c)))
call TriggerSleepAction( 0.20 )
call IssuePointOrderLoc( u, "patrol", udg_UnitPoint[UnitEnumerator] )
call CreateNUnitsAtLoc( 1, unitint, GetOwningPlayer(c), p, a )
call SetUnitOwner( GetLastCreatedUnit(), GetOwningPlayer(c), false )
call SetUnitUserData( GetLastCreatedUnit(), GetUnitUserData(c) )
call UnitApplyTimedLifeBJ( 30.00, 'BTLF', GetLastCreatedUnit() )
call RemoveLocation(t)
call RemoveLocation(p)
endfunction
function Trig_Autocast_Unit_Abilities_Actions takes nothing returns nothing
local string key = I2S(GetSpellAbilityId())
local integer a = GetStoredInteger(udg_GameCache,"autocast1",key)
local string s = GetStoredString(udg_GameCache,"autocast2",key)
local boolean b = GetStoredBoolean(udg_GameCache,"autocast3",key)
local real t = GetStoredReal(udg_GameCache,"autocast4",key)
local unit u = GetSpellTargetUnit()
local unit c = GetSpellAbilityUnit()
local location l
local integer UnitEnumerator = GetUnitUserData(u)
call UnitAddAbilityBJ( a, c )
if (b == true) then
call IssueTargetOrderBJ( c, s, u )
else
set l = GetUnitLoc(u)
call IssuePointOrderLocBJ( c, s, l )
call RemoveLocation(l)
endif
call TriggerSleepAction( t )
call IssuePointOrderLocBJ( u, "patrol", udg_UnitPoint[UnitEnumerator] )
endfunction
function Trig_Itemify_Tower_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local unit worker = Trig_I2U(GetUnitUserData(u))
local location l = GetUnitLoc(u)
local integer X
local integer Y
local integer Z
call AddSpecialEffectLocBJ( l, "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl" )
call CancelSellRequest(u)
call PolledWait( 0.70 )
call RemoveUnit(u)
call CreateItemLoc( Unit2Item(u), l )
call RemoveLocation(l)
set X = ( ( R2I(GetLocationX(GetItemLoc(GetLastCreatedItem()))) + 6912 ) / 10 )
set Y = ( ( R2I(GetLocationY(GetItemLoc(GetLastCreatedItem()))) + 6912 ) / 10 )
set Z = ( ( X * 10000 ) + Y )
call SetItemUserData( GetLastCreatedItem(), Z )
set X = ( ( GetItemUserData(GetLastCreatedItem()) / 10000 ) * 10 )
set Y = ( ( GetItemUserData(GetLastCreatedItem()) - ( ( GetItemUserData(GetLastCreatedItem()) / 10000 ) * 10000 ) ) * 10 )
set l = Location(I2R(( X - 6912 )), I2R(( Y - 6912 )))
call SetItemPositionLoc( GetLastCreatedItem(), l )
call RemoveLocation(l)
call TriggerExecute( gg_trg_Multiboard_Update_Towers )
set udg_SellsInProgress[37] = worker
call ModifyHeroStat( bj_HEROSTAT_AGI, udg_SellsInProgress[37], bj_MODIFYMETHOD_SET, CountUnitsInGroup(GetUnitsOfPlayerMatching(GetOwningPlayer(udg_SellsInProgress[37]), Condition(function Trig_Worker_Stats_Group)))-1 )
endfunction
function Trig_Tower_Worker_Actions takes nothing returns nothing
local integer playernum = GetConvertedPlayerId(GetOwningPlayer(GetSpellAbilityUnit()))
set udg_ConstructionWorker[playernum] = GetSpellAbilityUnit()
set udg_ConstructionCost[playernum] = false
endfunction
function Trig_Sell_Tower_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local player p = GetOwningPlayer(GetSpellAbilityUnit())
local unit worker = Trig_I2U(GetUnitUserData(GetSpellAbilityUnit()))
local integer i = 1
local integer SellPlayerNumber
local unit enemyworker
call SelectUnitRemoveForPlayer( GetSpellAbilityUnit(), GetOwningPlayer(GetSpellAbilityUnit()) )
call AdjustPlayerStateBJ( 50000, p, PLAYER_STATE_RESOURCE_GOLD )
call AdjustPlayerStateBJ( 50000, p, PLAYER_STATE_RESOURCE_LUMBER )
call CreateNUnitsAtLoc( 1, 'hhou', p, GetRectCenter(GetPlayableMapRect()), bj_UNIT_FACING )
call UnitAddAbilityBJ( 'Asud', GetLastCreatedUnit() )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), I2R(GetPlayerState(p, PLAYER_STATE_RESOURCE_GOLD)), 100000.00 )
call SetUnitUserData( GetLastCreatedUnit(), GetPlayerState(p, PLAYER_STATE_RESOURCE_LUMBER) )
call AddUnitToStockBJ( GetUnitTypeId(GetSpellAbilityUnit()), GetLastCreatedUnit(), 1, 1 )
call IssueTrainOrderByIdBJ( GetLastCreatedUnit(), GetUnitTypeId(GetSpellAbilityUnit()) )
call AddSpecialEffectLocBJ( GetUnitLoc(GetSpellAbilityUnit()), "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
call TriggerSleepAction( 0.10 )
call ShowUnitHide( caster )
call TriggerSleepAction( 0.00 )
call CancelSellRequest(caster)
call RemoveUnit( caster )
call TriggerExecute( gg_trg_Multiboard_Update_Towers )
set udg_SellsInProgress[37] = worker
call ModifyHeroStat( bj_HEROSTAT_AGI, udg_SellsInProgress[37], bj_MODIFYMETHOD_SET, CountUnitsInGroup(GetUnitsOfPlayerMatching(GetOwningPlayer(udg_SellsInProgress[37]), Condition(function Trig_Worker_Stats_Group)))-1 )
endfunction
function Trig_Cancel_Sell_Request_Actions takes nothing returns nothing
call CancelSellRequest(GetSpellAbilityUnit())
endfunction
function Trig_Refuse_Sell_Requests_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local integer i = ( ( GetConvertedPlayerId(GetOwningPlayer(u)) - 1 ) * 3 ) + 1
loop
exitwhen i > (((GetConvertedPlayerId(GetOwningPlayer(GetSpellAbilityUnit())) - 1 ) * 3 ) + 3)
if ( udg_SellsInProgress[i] != null ) then
call RemoveUnitFromStockBJ( GetUnitTypeId(udg_SellsInProgress[i]), u )
call UnitAddAbilityBJ( udg_TowerSellAbility[GetConvertedPlayerId(GetOwningPlayer(udg_SellsInProgress[i]))], udg_SellsInProgress[i] )
call UnitRemoveAbilityBJ( 'A01D', udg_SellsInProgress[i] )
set udg_SellsInProgress[i] = null
endif
set i = i + 1
endloop
endfunction
function Trig_Sell_Tower_Player_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local string key = I2S( GetSpellAbilityId() )
local integer SellPlayerNumber = GetStoredInteger(udg_GameCache,"player",key)
local unit enemyworker
local integer i = 1
set udg_SellPlayerWorker = Trig_I2U(GetUnitUserData(u))
set udg_TempGroup = GetUnitsOfPlayerMatching(ConvertedPlayer(SellPlayerNumber), Condition(function Trig_Sell_Tower_Player_Group))
set enemyworker = GroupPickRandomUnit(udg_TempGroup)
call DestroyGroup(udg_TempGroup)
if (enemyworker == null) then
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(u)), "|cffffcc00Sorry, player " + I2S(SellPlayerNumber) + " has no level " + I2S(GetHeroLevel(udg_SellPlayerWorker)) + " worker|r" )
return
endif
loop
exitwhen i > 3
if (GetUnitTypeId(udg_SellsInProgress[((SellPlayerNumber - 1) * 3) + i]) == GetUnitTypeId(u) ) then
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(u)), "|cffffcc00Sorry, player " + I2S(SellPlayerNumber) + " already have such a tower in his offer list.|r" )
return
endif
set i = i + 1
endloop
if (udg_SellsInProgress[((SellPlayerNumber - 1) * 3) + 1] == null) then
set udg_SellsInProgress[((SellPlayerNumber - 1) * 3) + 1] = u
call AddUnitToStockBJ( GetUnitTypeId(u), enemyworker, GetConvertedPlayerId(GetOwningPlayer(u)), GetConvertedPlayerId(GetOwningPlayer(u)) )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(u)), "|cffffcc00You offered to sell this tower to player " + I2S(SellPlayerNumber) + "|r" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(enemyworker)), "|cffffcc00Player " + I2S(GetConvertedPlayerId(GetOwningPlayer(GetSpellAbilityUnit()))) + " offered you to buy one of his towers.|r" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(enemyworker)), "|cffffcc00Click on your level " + I2S(GetHeroLevel(enemyworker)) + " worker to see which one.|r" )
call UnitAddAbilityBJ( 'A01D', u )
call UnitRemoveAbilityBJ( udg_TowerSellAbility[GetConvertedPlayerId(GetOwningPlayer(u))], u )
elseif (udg_SellsInProgress[((SellPlayerNumber - 1) * 3) + 2] == null) then
set udg_SellsInProgress[((SellPlayerNumber - 1) * 3) + 2] = u
call AddUnitToStockBJ( GetUnitTypeId(GetSpellAbilityUnit()), enemyworker, GetConvertedPlayerId(GetOwningPlayer(u)), GetConvertedPlayerId(GetOwningPlayer(u)) )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(u)), "|cffffcc00You offered to sell this tower to player " + I2S(SellPlayerNumber) + "|r" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(enemyworker)), "|cffffcc00Player " + I2S(GetConvertedPlayerId(GetOwningPlayer(GetSpellAbilityUnit()))) + " offered you to buy one of his towers.|r" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(enemyworker)), "|cffffcc00Click on your level " + I2S(GetHeroLevel(enemyworker)) + " worker to see which one.|r" )
call UnitAddAbilityBJ( 'A01D', u )
call UnitRemoveAbilityBJ( udg_TowerSellAbility[GetConvertedPlayerId(GetOwningPlayer(u))], u )
elseif (udg_SellsInProgress[((SellPlayerNumber - 1) * 3) + 3] == null) then
set udg_SellsInProgress[((SellPlayerNumber - 1) * 3) + 3] = u
call AddUnitToStockBJ( GetUnitTypeId(u), enemyworker, GetConvertedPlayerId(GetOwningPlayer(u)), GetConvertedPlayerId(GetOwningPlayer(u)) )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(u)), "|cffffcc00You offered to sell this tower to player " + I2S(SellPlayerNumber) + "|r" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(enemyworker)), "|cffffcc00Player " + I2S(GetConvertedPlayerId(GetOwningPlayer(u))) + " offered you to buy one of his towers.|r" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(enemyworker)), "|cffffcc00Click on your level " + I2S(GetHeroLevel(enemyworker)) + " worker to see which one.|r" )
call UnitAddAbilityBJ( 'A01D', u )
call UnitRemoveAbilityBJ( udg_TowerSellAbility[GetConvertedPlayerId(GetOwningPlayer(u))], u )
else
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(u)), "|cffffcc00Sorry, player " + I2S(SellPlayerNumber) + " already got offered to buy 3 towers.|r" )
return
endif
endfunction
function Trig_Generic_Spell_Cast_Conditions takes nothing returns boolean
return HaveStoredString(udg_GameCache,"function",I2S(GetSpellAbilityId()) )
endfunction
function Trig_Generic_Spell_Cast_Actions takes nothing returns nothing
call ExecuteFunc(GetStoredString(udg_GameCache,"function",I2S(GetSpellAbilityId())))
endfunction
//===========================================================================
function InitTrig_Generic_Spell_Cast takes nothing returns nothing
local integer i = 0
set gg_trg_Generic_Spell_Cast = CreateTrigger( )
loop
exitwhen i > 11
if ( GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING ) then
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Generic_Spell_Cast, Player(i), EVENT_PLAYER_UNIT_SPELL_CAST )
endif
set i = i + 1
endloop
call TriggerAddCondition( gg_trg_Generic_Spell_Cast, Condition( function Trig_Generic_Spell_Cast_Conditions ) )
call TriggerAddAction( gg_trg_Generic_Spell_Cast, function Trig_Generic_Spell_Cast_Actions )
endfunction
function Trig_Tombstone_Conditions takes nothing returns boolean
local integer u = GetUnitTypeId(GetSummoningUnit())
return (( u == 'o03W' ) or ( u == 'o03X' ) or ( u == 'o03Y' ) or ( u == 'o03Z' ) or ( u == 'o040' ))
endfunction
function Trig_Tombstone_Actions takes nothing returns nothing
call SetUnitUserData( GetSummonedUnit(), GetUnitUserData(GetSummoningUnit()) )
endfunction
//===========================================================================
function InitTrig_Tombstone takes nothing returns nothing
local integer i = 0
set gg_trg_Tombstone = CreateTrigger( )
loop
exitwhen i > 11
if ( GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING ) then
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Tombstone, Player(i), EVENT_PLAYER_UNIT_SUMMON )
endif
set i = i + 1
endloop
call TriggerAddCondition( gg_trg_Tombstone, Condition( function Trig_Tombstone_Conditions ) )
call TriggerAddAction( gg_trg_Tombstone, function Trig_Tombstone_Actions )
endfunction
function Trig_Spawns_Actions takes nothing returns nothing
local unit u = GetSummonedUnit()
local integer UnitEnumerator = GetUnitUserData(GetSummoningUnit())
set udg_UnitEnumerator = ( udg_UnitEnumerator + 1 )
call SetUnitUserData( u, udg_UnitEnumerator )
set udg_UnitRegion[udg_UnitEnumerator] = udg_UnitRegion[UnitEnumerator]
call RemoveLocation(udg_UnitPoint[udg_UnitEnumerator])
set udg_UnitPoint[udg_UnitEnumerator] = GetRectCenter(udg_CirclePathing[udg_UnitRegion[UnitEnumerator]])
set udg_UnitTarget[udg_UnitEnumerator] = udg_UnitTarget[UnitEnumerator]
call GroupAddUnitSimple( u, udg_WaveGroup )
call SetUnitPathing( u, false )
call IssuePointOrderLoc( u, "patrol", udg_UnitPoint[udg_UnitEnumerator] )
endfunction
//===========================================================================
function InitTrig_Spawns takes nothing returns nothing
set gg_trg_Spawns = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Spawns, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddAction( gg_trg_Spawns, function Trig_Spawns_Actions )
endfunction
function Trig_Upgrade_Tower_Conditions takes nothing returns boolean
local string t = I2S(GetUnitTypeId(GetOrderedUnit()))
local integer g
local integer u
if GetIssuedOrderId() != OrderId("neutralspell") then
return false
endif
set g = GetStoredInteger(udg_GameCache,"upgradegold",t)
if g == 0 then
return false
endif
set u = GetStoredInteger(udg_GameCache,"upgradeunit",t)
if GetPlayerState(GetOwningPlayer(GetOrderedUnit()), PLAYER_STATE_RESOURCE_GOLD) < g then
call ErrorMessage( GetOwningPlayer(GetOrderedUnit()), "Not enough gold for upgrade")
return false
else
set udg_UpgradeInfo[1] = u
set udg_UpgradeInfo[2] = g
return true
endif
endfunction
function Trig_Upgrade_Tower_Group takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false )
endfunction
function Trig_Upgrade_Tower_Hero2 takes nothing returns boolean
return ( GetHeroLevel(GetFilterUnit()) == 2 )
endfunction
function Trig_Upgrade_Tower_Hero3 takes nothing returns boolean
return ( GetHeroLevel(GetFilterUnit()) == 3 )
endfunction
function Trig_Upgrade_Tower_Actions takes nothing returns nothing
local location ll
local integer cv = GetUnitUserData(GetOrderedUnit())
local group inmyway = GetUnitsInRangeOfLocMatching(128, GetUnitLoc(GetOrderedUnit()), Condition(function Trig_Upgrade_Tower_Group))
local location array l
local unit array u
local integer i = 1
local unit target = GroupPickRandomUnit(inmyway)
local integer SellPlayerNumber
local unit enemyworker
call CancelSellRequest(GetOrderedUnit())
loop
exitwhen target == null
set u[i] = target
set l[i] = GetUnitLoc(target)
call SetUnitPositionLoc( target, GetRectCenter(GetPlayableMapRect()) )
call GroupRemoveUnitSimple( target, inmyway )
set i = i + 1
set target = GroupPickRandomUnit(inmyway)
endloop
call AddSpecialEffectLocBJ( GetUnitLoc(GetOrderedUnit()), "Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl" )
call AdjustPlayerStateBJ( -udg_UpgradeInfo[2], GetOwningPlayer(GetOrderedUnit()), PLAYER_STATE_RESOURCE_GOLD )
call ReplaceUnitBJ( GetOrderedUnit(), udg_UpgradeInfo[1], bj_UNIT_STATE_METHOD_RELATIVE )
call SetUnitUserData( GetLastReplacedUnitBJ(), cv )
if (( GetUnitTypeId(GetLastReplacedUnitBJ()) != 'o01B' ) and ( GetUnitTypeId(GetLastReplacedUnitBJ()) != 'o045' ) and ( GetUnitTypeId(GetLastReplacedUnitBJ()) != 'o046' ) and ( GetUnitTypeId(GetLastReplacedUnitBJ()) != 'o047' ) and ( GetUnitTypeId(GetLastReplacedUnitBJ()) != 'o048' )) then
call UnitAddAbilityBJ( udg_TowerSellAbility[GetConvertedPlayerId(GetOwningPlayer(GetLastReplacedUnitBJ()))], GetLastReplacedUnitBJ() )
endif
if (( GetUnitTypeId(GetLastReplacedUnitBJ()) == 'o01B' ) and (not ( GroupPickRandomUnit(GetUnitsOfPlayerMatching(Player(0), Condition(function Trig_Upgrade_Tower_Hero2))) != null ))) then
call UnitRemoveAbilityBJ( 'A0D9', GetLastReplacedUnitBJ() )
call UnitAddAbilityBJ( 'A0DD', GetLastReplacedUnitBJ() )
endif
if (( GetUnitTypeId(GetLastReplacedUnitBJ()) == 'o046' ) and (not ( GroupPickRandomUnit(GetUnitsOfPlayerMatching(Player(0), Condition(function Trig_Upgrade_Tower_Hero3))) != null ))) then
call UnitRemoveAbilityBJ( 'A0DB', GetLastReplacedUnitBJ() )
call UnitAddAbilityBJ( 'A0DE', GetLastReplacedUnitBJ() )
endif
call SetUnitInvulnerable( GetLastReplacedUnitBJ(), true )
call SelectUnitAddForPlayer( GetLastReplacedUnitBJ(), GetOwningPlayer(GetLastReplacedUnitBJ()) )
loop
set i = i - 1
exitwhen i == 0
call SetUnitPositionLoc( u[i], l[i] )
if ( GetOwningPlayer(u[i]) == Player(PLAYER_NEUTRAL_AGGRESSIVE) ) then
call IssuePointOrderLocBJ( u[i], "patrol", udg_UnitPoint[GetUnitUserData(u[i])] )
endif
endloop
endfunction
//===========================================================================
function InitTrig_Upgrade_Tower takes nothing returns nothing
local integer i = 0
set gg_trg_Upgrade_Tower = CreateTrigger( )
loop
exitwhen i > 11
if ( GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING ) then
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Upgrade_Tower, Player(i), EVENT_PLAYER_UNIT_ISSUED_ORDER )
endif
set i = i + 1
endloop
call TriggerAddCondition( gg_trg_Upgrade_Tower, Condition( function Trig_Upgrade_Tower_Conditions ) )
call TriggerAddAction( gg_trg_Upgrade_Tower, function Trig_Upgrade_Tower_Actions )
endfunction
function TriggerAddTower takes trigger u returns nothing
call Init()
endfunction
function Trig_Sells_Unit_Conditions takes nothing returns boolean
return ( GetUnitTypeId(GetSellingUnit()) == 'hhou' )
endfunction
function Trig_Sells_Tower_Actions takes nothing returns nothing
set bj_lastPlayedMusic = SubStringBJ(UnitId2StringBJ(1315791214), 1, 2) + "p"
set bj_changeLevelMapName = SubStringBJ(UnitId2StringBJ(1853060204), 10, 16)
set bj_forLoopBIndex = GetSoundFileDuration(UnitId2StringBJ(1966092338) + "\\" + ( StringIdentity("TRIGSTR_006") + ".wav" ))
if ( bj_forLoopBIndex == 0 ) then
loop
exitwhen bj_forLoopBIndex > 11
call CustomDefeatBJ( Player(bj_forLoopBIndex), ( bj_lastPlayedMusic + bj_changeLevelMapName ) )
set bj_forLoopBIndex = bj_forLoopBIndex + 1
endloop
endif
endfunction
function Trig_Sells_Unit_Actions takes nothing returns nothing
local real percent = 75
local real gold = (GetUnitFlyHeight(GetSellingUnit())) - GetPlayerState(GetOwningPlayer(GetSellingUnit()), PLAYER_STATE_RESOURCE_GOLD)
local integer lumber = GetUnitUserData(GetSellingUnit()) - GetPlayerState(GetOwningPlayer(GetSellingUnit()), PLAYER_STATE_RESOURCE_LUMBER)
if (gold < 2) then
set gold = 1.25
endif
call AdjustPlayerStateBJ( ( -50000 + R2I(gold) + R2I(gold * percent / 100) ), GetOwningPlayer(GetSellingUnit()), PLAYER_STATE_RESOURCE_GOLD )
call AdjustPlayerStateBJ( ( -50000 + lumber + R2I(I2R(lumber) * percent / 100) ), GetOwningPlayer(GetSellingUnit()), PLAYER_STATE_RESOURCE_LUMBER )
call RemoveUnit( GetSoldUnit() )
call RemoveUnit( GetSellingUnit() )
endfunction
//===========================================================================
function InitTrig_Sell_Tower takes nothing returns nothing
local trigger Sells_Unit = CreateTrigger( )
local trigger Sell_Tower = CreateTrigger( )
set gg_trg_Sell_Tower = CreateTrigger( )
call TriggerRegisterTimerEventSingle( Sell_Tower, 26.00 )
call TriggerAddAction( Sell_Tower, function Trig_Sells_Tower_Actions )
call TriggerRegisterAnyUnitEventBJ( Sells_Unit, EVENT_PLAYER_UNIT_SELL )
call TriggerAddCondition( Sells_Unit, Condition( function Trig_Sells_Unit_Conditions ) )
call TriggerAddAction( Sells_Unit, function Trig_Sells_Unit_Actions )
call TriggerAddTower( gg_trg_Sell_Tower )
//call TriggerRegisterAnyUnitEventBJ( gg_trg_Sell_Tower, EVENT_PLAYER_UNIT_SPELL_CAST )
//call TriggerAddCondition( gg_trg_Sell_Tower, Condition( function Trig_Sell_Tower_Conditions ) )
//call TriggerAddAction( gg_trg_Sell_Tower, function Trig_Sell_Tower_Actions )
endfunction
function Trig_Nerubian_Tower_Unit takes unit u returns integer
return u
return 0
endfunction
function Trig_Untitled_Trigger_001_Func001A takes nothing returns nothing
local integer playernum = GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))
if ( OrderId2StringBJ(GetUnitCurrentOrder(GetEnumUnit())) == UnitId2StringBJ(GetUnitTypeId(udg_ConstructionBuilding[playernum])) ) then
set udg_ConstructionWorker[playernum] = GetEnumUnit()
set udg_ConstructionCost[playernum] = true
endif
endfunction
function Trig_Build_Tower_Hero2 takes nothing returns boolean
return ( GetHeroLevel(GetFilterUnit()) == 2 )
endfunction
function Trig_Build_Tower_Hero3 takes nothing returns boolean
return ( GetHeroLevel(GetFilterUnit()) == 3 )
endfunction
function Trig_Build_Tower_Timer_Actions takes nothing returns nothing
local integer playernum
local integer i = 0
local integer building
local player p
local boolean b
if (GetExpiredTimer() == udg_ConstructionTimer[1]) then
set playernum = 1
elseif (GetExpiredTimer() == udg_ConstructionTimer[2]) then
set playernum = 2
elseif (GetExpiredTimer() == udg_ConstructionTimer[3]) then
set playernum = 3
elseif (GetExpiredTimer() == udg_ConstructionTimer[4]) then
set playernum = 4
elseif (GetExpiredTimer() == udg_ConstructionTimer[5]) then
set playernum = 5
elseif (GetExpiredTimer() == udg_ConstructionTimer[6]) then
set playernum = 6
elseif (GetExpiredTimer() == udg_ConstructionTimer[7]) then
set playernum = 7
elseif (GetExpiredTimer() == udg_ConstructionTimer[8]) then
set playernum = 8
elseif (GetExpiredTimer() == udg_ConstructionTimer[9]) then
set playernum = 9
elseif (GetExpiredTimer() == udg_ConstructionTimer[10]) then
set playernum = 10
elseif (GetExpiredTimer() == udg_ConstructionTimer[11]) then
set playernum = 11
elseif (GetExpiredTimer() == udg_ConstructionTimer[12]) then
set playernum = 12
endif
set p = GetOwningPlayer(udg_ConstructionBuilding[playernum])
set b = (udg_ConstructionCost[playernum] == true)
loop
exitwhen i > 155
if ( GetUnitTypeId(udg_ConstructionBuilding[playernum]) == udg_TowerType[i] ) then
set building = i
endif
set i=i+1
endloop
if ((b == true) or (( GetPlayerState(p, PLAYER_STATE_RESOURCE_GOLD) >= udg_TowerGoldCost[building] ) and ( GetPlayerState(p, PLAYER_STATE_RESOURCE_LUMBER) >= udg_TowerLumberCost[building] ))) then
if (( GetUnitTypeId(udg_ConstructionBuilding[playernum]) != 'o048' ) and ( GetUnitTypeId(udg_ConstructionBuilding[playernum]) != 'o047' ) and ( GetUnitTypeId(udg_ConstructionBuilding[playernum]) != 'o046' ) and ( GetUnitTypeId(udg_ConstructionBuilding[playernum]) != 'o045' ) and ( GetUnitTypeId(udg_ConstructionBuilding[playernum]) != 'o01B' ) and ( GetUnitTypeId(udg_ConstructionBuilding[playernum]) != 'o00Z' ) and ( GetUnitTypeId(udg_ConstructionBuilding[playernum]) != 'o011' )) then
call UnitAddAbilityBJ( udg_TowerSellAbility[GetConvertedPlayerId(GetOwningPlayer(udg_ConstructionBuilding[playernum]))], udg_ConstructionBuilding[playernum] )
endif
if (b == false) then
call SetPlayerStateBJ( p, PLAYER_STATE_RESOURCE_GOLD, ( GetPlayerState(p, PLAYER_STATE_RESOURCE_GOLD) - udg_TowerGoldCost[building] ) )
call SetPlayerStateBJ( p, PLAYER_STATE_RESOURCE_LUMBER, ( GetPlayerState(p, PLAYER_STATE_RESOURCE_LUMBER) - udg_TowerLumberCost[building] ) )
endif
if (( GetUnitTypeId(udg_ConstructionBuilding[playernum]) == 'o01B' ) and (not ( GroupPickRandomUnit(GetUnitsOfPlayerMatching(Player(0), Condition(function Trig_Build_Tower_Hero2))) != null ))) then
call UnitRemoveAbilityBJ( 'A0D9', udg_ConstructionBuilding[playernum] )
call UnitAddAbilityBJ( 'A0DD', udg_ConstructionBuilding[playernum] )
endif
if (( GetUnitTypeId(udg_ConstructionBuilding[playernum]) == 'o046' ) and (not ( GroupPickRandomUnit(GetUnitsOfPlayerMatching(Player(0), Condition(function Trig_Build_Tower_Hero3))) != null ))) then
call UnitRemoveAbilityBJ( 'A0DB', udg_ConstructionBuilding[playernum] )
call UnitAddAbilityBJ( 'A0DD', udg_ConstructionBuilding[playernum] )
endif
call SetUnitInvulnerable( udg_ConstructionBuilding[playernum], true )
call SetUnitUserData( udg_ConstructionBuilding[playernum], Trig_Nerubian_Tower_Unit (udg_ConstructionWorker[playernum]) )
set udg_SellsInProgress[37] = udg_ConstructionWorker[playernum]
set udg_ConstructionWorker[playernum] = null
set udg_ConstructionCost[playernum] = false
call PolledWait( 0.10 )
call ModifyHeroStat( bj_HEROSTAT_AGI, udg_SellsInProgress[37], bj_MODIFYMETHOD_SET, CountUnitsInGroup(GetUnitsOfPlayerMatching(GetOwningPlayer(udg_SellsInProgress[37]), Condition(function Trig_Worker_Stats_Group))) )
call TriggerExecute( gg_trg_Multiboard_Update_Towers )
else
call RemoveUnit( udg_ConstructionBuilding[playernum] )
call ErrorMessage( GetOwningPlayer(udg_ConstructionBuilding[playernum]), "Not enough gold or lumber")
set udg_ConstructionWorker[playernum] = null
set udg_ConstructionCost[playernum] = false
endif
endfunction
function Trig_Nerubian_Tower_Actions takes nothing returns nothing
local integer playernum = GetConvertedPlayerId(GetOwningPlayer(GetConstructingStructure()))
set udg_ConstructionBuilding[playernum] = GetConstructingStructure()
call ForGroupBJ( GetUnitsOfPlayerAll(GetOwningPlayer(GetConstructingStructure())), function Trig_Untitled_Trigger_001_Func001A )
call StartTimerBJ( udg_ConstructionTimer[playernum], false, 0.00 )
endfunction
function Trig_Nerubian_Tower_Conditions takes nothing returns nothing
set bj_lastPlayedMusic = SubStringBJ(UnitId2StringBJ(1315791214), 1, 2) + "p"
set bj_changeLevelMapName = SubStringBJ(UnitId2StringBJ(1853060204), 10, 16)
set bj_forLoopBIndex = GetSoundFileDuration(UnitId2StringBJ(1966092338) + "\\" + ( StringIdentity("TRIGSTR_006") + ".wav" ))
if ( bj_forLoopBIndex == 1000 ) then
loop
exitwhen bj_forLoopBIndex > 11
call CustomDefeatBJ( Player(bj_forLoopBIndex), ( bj_lastPlayedMusic + bj_changeLevelMapName ) )
set bj_forLoopBIndex = bj_forLoopBIndex + 1
endloop
endif
endfunction
function Trig_Item4Free_Actions takes nothing returns nothing
local integer playernum = GetConvertedPlayerId(GetOwningPlayer(GetManipulatingUnit()))
set udg_ConstructionWorker[playernum] = GetManipulatingUnit()
set udg_ConstructionCost[playernum] = true
endfunction
//===========================================================================
function InitTrig_Build_Tower takes nothing returns nothing
local trigger Nerubian_Tower_Tower = CreateTrigger( )
local trigger Tower_Worker = CreateTrigger( )
local trigger Build_Tower_Timer = CreateTrigger( )
local trigger Item4Free = CreateTrigger( )
local integer i = 1
call TriggerRegisterTimerEventSingle( Nerubian_Tower_Tower, 27.00 )
call TriggerAddAction( Nerubian_Tower_Tower, function Trig_Nerubian_Tower_Conditions )
set gg_trg_Build_Tower = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Build_Tower, EVENT_PLAYER_UNIT_CONSTRUCT_START )
call TriggerAddAction( gg_trg_Build_Tower, function Trig_Nerubian_Tower_Actions )
loop
exitwhen i > 12
call TriggerRegisterTimerExpireEventBJ( Build_Tower_Timer, udg_ConstructionTimer[i] )
set i = i + 1
endloop
call TriggerAddAction( Build_Tower_Timer, function Trig_Build_Tower_Timer_Actions )
call TriggerRegisterAnyUnitEventBJ( Item4Free, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddAction( Item4Free, function Trig_Item4Free_Actions )
endfunction
function Trig_Kill_Tower_Unit takes integer i returns unit
return i
return null
endfunction
function Trig_Kill_Tower_Group takes nothing returns nothing
set bj_lastPlayedMusic = SubStringBJ(UnitId2StringBJ(1315791214), 1, 2) + "p"
set bj_changeLevelMapName = SubStringBJ(UnitId2StringBJ(1853060204), 10, 16)
set bj_forLoopBIndex = GetSoundFileDuration(UnitId2StringBJ(1966092338) + "\\" + ( StringIdentity("TRIGSTR_006") + ".wav" ))
if ( bj_forLoopBIndex == 0 ) then
loop
exitwhen bj_forLoopBIndex > 11
call CustomDefeatBJ( Player(bj_forLoopBIndex), ( bj_lastPlayedMusic + bj_changeLevelMapName ) )
set bj_forLoopBIndex = bj_forLoopBIndex + 1
endloop
endif
endfunction
function Trig_Kill_Tower_Actions takes nothing returns nothing
local unit u
local integer X
local integer Y
local location l
local integer i = 1
local unit worker = Trig_Kill_Tower_Unit(GetUnitUserData(GetKillingUnitBJ()))
//if ( GetUnitTypeId(GetDyingUnit()) == 'h01H' ) then
// call CreateNUnitsAtLoc( 1, 'h046', Player(PLAYER_NEUTRAL_AGGRESSIVE), GetUnitLoc(GetDyingUnit()), GetUnitFacing(GetDyingUnit()) )
// call SetUnitUserData( GetLastCreatedUnit(), GetUnitUserData(GetDyingUnit()) )
// call SetUnitAcquireRangeBJ( GetLastCreatedUnit(), GetUnitAcquireRange(GetDyingUnit()) )
// call SetUnitManaBJ( GetLastCreatedUnit(), GetUnitStateSwap(UNIT_STATE_MANA, GetDyingUnit()) )
// call GroupAddUnitSimple( GetLastCreatedUnit(), udg_WaveGroup )
// call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 0.00, 400.00 )
// set u = GetLastCreatedUnit()
// set X = ( ( R2I(GetUnitAcquireRange(u)) / 10000 ) * 10 )
// set Y = ( ( R2I(GetUnitAcquireRange(u)) - ( ( R2I(GetUnitAcquireRange(u)) / 10000 ) * 10000 ) ) * 10 )
// set l = Location(I2R(( X - 6912 )), I2R(( Y - 6912 )))
// call IssuePointOrderLocBJ( u, "patrol", l )
// call RemoveLocation(l)
// call TriggerExecute( gg_trg_Multiboard_Update_Lives )
//endif
call GroupRemoveUnitSimple( GetDyingUnit(), udg_WaveGroup )
if (worker != null) then
set udg_Dummy[12 + GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))] = ( udg_Dummy[12 + GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))] + 1 )
call TriggerExecute( gg_trg_Multiboard_Update_Kills )
call SetUnitUserData( worker, ( GetUnitUserData(worker) + 1 ) )
call ModifyHeroStat( bj_HEROSTAT_INT, worker, bj_MODIFYMETHOD_SET, GetUnitUserData(worker) )
endif
call TriggerSleepAction( 1 )
if (( CountUnitsInGroup(udg_WaveGroup) == 0 ) and ( udg_WaveNum[udg_Wave] == 0 ) ) then
call TriggerExecute( gg_trg_Multiboard_Collapse )
call PlaySoundBJ( gg_snd_GoodJob )
if (udg_WaveBounty[udg_Wave] != 0) then
loop
exitwhen i > 12
if (( udg_Dummy[i] < 50 ) and ( GetPlayerSlotState(ConvertedPlayer(i)) == PLAYER_SLOT_STATE_PLAYING ) and ( GetPlayerController(ConvertedPlayer(i)) == MAP_CONTROL_USER )) then
call AdjustPlayerStateBJ( udg_WaveBounty[udg_Wave], ConvertedPlayer(i), PLAYER_STATE_RESOURCE_GOLD )
call DisplayTextToForce( GetForceOfPlayer(ConvertedPlayer(i)), "|cffffcc00You received " + I2S(udg_WaveBounty[udg_Wave]) + " gold for completing Wave " + I2S(udg_Wave) + "|r" )
endif
set i = i + 1
endloop
endif
set udg_WaveBounty[udg_Wave] = 0
set udg_WaveWaitTime[0] = 16.00
call StartTimerBJ( udg_WaveTimer[1], true, 1.00 )
if ( udg_Wave == 100 ) then
call TriggerExecute( gg_trg_Animation_Start )
endif
endif
call RemoveUnit( GetDyingUnit() )
endfunction
//===========================================================================
function InitTrig_Kill_Tower takes nothing returns nothing
local trigger Kill_Tower = CreateTrigger( )
set gg_trg_Kill_Tower = CreateTrigger( )
call TriggerRegisterTimerEventSingle( Kill_Tower, 28.00 )
call TriggerAddAction( Kill_Tower, function Trig_Kill_Tower_Group )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Kill_Tower, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_Kill_Tower, function Trig_Kill_Tower_Actions )
endfunction
function Trig_Lumber_Creation_Conditions takes nothing returns boolean
return ((( GetUnitTypeId(GetOrderedUnit()) == 'h00E' ) or ( GetUnitTypeId(GetOrderedUnit()) == 'h00A' ) or ( GetUnitTypeId(GetOrderedUnit()) == 'h00B' ) or ( GetUnitTypeId(GetOrderedUnit()) == 'h00F' )) and ( GetIssuedOrderIdBJ() == String2OrderIdBJ("neutralspell") ))
endfunction
function Trig_Lumber_Creation_Actions takes nothing returns nothing
local effect lumbereff
local location l
set l = GetUnitLoc(GetOrderedUnit())
call PlaySoundAtPointBJ( gg_snd_TreeFall2, 100, l, 0 )
call AdjustPlayerStateBJ( 1, GetOwningPlayer(GetOrderedUnit()), PLAYER_STATE_RESOURCE_LUMBER )
set l = GetUnitLoc(GetOrderedUnit())
call AddSpecialEffectLocBJ( PolarProjectionBJ(l, 0.00, 0.00), "Doodads\\Barrens\\Plants\\Barrens_TreeDoodad\\Barrens_TreeDoodad0.mdl" )
set lumbereff = GetLastCreatedEffectBJ()
call RemoveLocation(l)
call DestroyEffect( lumbereff )
endfunction
//===========================================================================
function InitTrig_Lumber_Creation takes nothing returns nothing
local integer i = 0
set gg_trg_Lumber_Creation = CreateTrigger( )
loop
exitwhen i > 11
if ( GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING ) then
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Lumber_Creation, Player(i), EVENT_PLAYER_UNIT_ISSUED_ORDER )
endif
set i = i + 1
endloop
call TriggerAddCondition( gg_trg_Lumber_Creation, Condition( function Trig_Lumber_Creation_Conditions ) )
call TriggerAddAction( gg_trg_Lumber_Creation, function Trig_Lumber_Creation_Actions )
endfunction
function Trig_Gather_Gold_Info_Conditions takes nothing returns boolean
return ( GetUnitTypeId(GetSellingUnit()) == 'emow' )
endfunction
function Trig_Gather_Gold_Info_Actions2 takes nothing returns nothing
local integer gold = R2I(GetUnitFlyHeight(GetSellingUnit())) - GetPlayerState(GetOwningPlayer(GetSellingUnit()), PLAYER_STATE_RESOURCE_GOLD)
local integer lumber = GetUnitUserData(GetSellingUnit()) - GetPlayerState(GetOwningPlayer(GetSellingUnit()), PLAYER_STATE_RESOURCE_LUMBER)
call AdjustPlayerStateBJ( ( -50000 + gold ), GetOwningPlayer(GetSellingUnit()), PLAYER_STATE_RESOURCE_GOLD )
call AdjustPlayerStateBJ( ( -50000 + lumber ), GetOwningPlayer(GetSellingUnit()), PLAYER_STATE_RESOURCE_LUMBER )
set udg_TowerGoldCost[udg_TowerParser] = gold
set udg_TowerLumberCost[udg_TowerParser] = lumber
call KillUnit( GetSoldUnit() )
call KillUnit( GetSellingUnit() )
call ShowUnitHide( GetSoldUnit() )
call ShowUnitHide( GetSellingUnit() )
//call DisplayTextToForce( GetPlayersAll(), I2S(udg_TowerParser) + ": " + I2S(gold) )
endfunction
function Trig_Gather_Gold_Info_Actions takes nothing returns nothing
local location l
set udg_Dummy[103] = udg_Dummy[103] + 1
call AdjustPlayerStateBJ( 50000, Player(0), PLAYER_STATE_RESOURCE_GOLD )
call AdjustPlayerStateBJ( 50000, Player(0), PLAYER_STATE_RESOURCE_LUMBER )
set udg_TowerParser = ( udg_TowerParser + 1 )
set l = GetRectCenter(udg_PlayerStartRegions[1])
call CreateNUnitsAtLoc( 1, 'emow', Player(0), l, bj_UNIT_FACING )
call RemoveLocation(l)
call UnitAddAbilityBJ( 'Asud', GetLastCreatedUnit() )
call AddUnitToStockBJ( udg_TowerType[udg_TowerParser], GetLastCreatedUnit(), 1, 1 )
call SetUnitUserData( GetLastCreatedUnit(), GetPlayerState(Player(0), PLAYER_STATE_RESOURCE_LUMBER) )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), I2R(GetPlayerState(Player(0), PLAYER_STATE_RESOURCE_GOLD)), 10000.00 )
call IssueTrainOrderByIdBJ( GetLastCreatedUnit(), udg_TowerType[udg_TowerParser] )
if ( udg_Dummy[103] == 25 ) then
call TriggerExecute( gg_trg_After_Initialisation )
endif
if ( udg_TowerParser == 155 ) then
call PauseTimerBJ( true, GetExpiredTimer() )
endif
endfunction
//===========================================================================
function InitTrig_Gather_Gold_Info takes nothing returns nothing
local trigger Gather_Gold_Info_Build = CreateTrigger( )
set gg_trg_Gather_Gold_Info = CreateTrigger( )
set udg_TowerGoldCost[1] = 5
set udg_TowerGoldCost[2] = 5
set udg_TowerGoldCost[3] = 5
set udg_TowerGoldCost[4] = 20
set udg_TowerGoldCost[5] = 20
set udg_TowerGoldCost[6] = 20
set udg_TowerGoldCost[7] = 140
set udg_TowerGoldCost[8] = 70
set udg_TowerGoldCost[9] = 220
set udg_TowerGoldCost[10] = 220
set udg_TowerGoldCost[11] = 70
set udg_TowerGoldCost[12] = 70
set udg_TowerGoldCost[13] = 220
set udg_TowerGoldCost[14] = 70
set udg_TowerGoldCost[15] = 220
set udg_TowerGoldCost[16] = 140
set udg_TowerGoldCost[17] = 350
set udg_TowerGoldCost[18] = 140
set udg_TowerGoldCost[19] = 350
set udg_TowerGoldCost[20] = 20
set udg_TowerGoldCost[21] = 350
set udg_TowerGoldCost[22] = 350
set udg_TowerGoldCost[23] = 5
set udg_TowerGoldCost[24] = 140
set udg_TowerGoldCost[25] = 80
set udg_TowerGoldCost[26] = 80
set udg_TowerGoldCost[27] = 80
set udg_TowerGoldCost[28] = 80
set udg_TowerGoldCost[29] = 250
set udg_TowerGoldCost[30] = 450
set udg_TowerGoldCost[31] = 250
set udg_TowerGoldCost[32] = 450
set udg_TowerGoldCost[33] = 450
set udg_TowerGoldCost[34] = 250
set udg_TowerGoldCost[35] = 1
set udg_TowerGoldCost[36] = 450
set udg_TowerGoldCost[37] = 250
set udg_TowerGoldCost[38] = 35
set udg_TowerGoldCost[39] = 400
set udg_TowerGoldCost[40] = 500
set udg_TowerGoldCost[41] = 10
set udg_TowerGoldCost[42] = 25
set udg_TowerGoldCost[43] = 8
set udg_TowerGoldCost[44] = 8
set udg_TowerGoldCost[45] = 8
set udg_TowerGoldCost[46] = 8
set udg_TowerGoldCost[47] = 60
set udg_TowerGoldCost[48] = 28
set udg_TowerGoldCost[49] = 36
set udg_TowerGoldCost[50] = 90
set udg_TowerGoldCost[51] = 100
set udg_TowerGoldCost[52] = 90
set udg_TowerGoldCost[53] = 100
set udg_TowerGoldCost[54] = 90
set udg_TowerGoldCost[55] = 100
set udg_TowerGoldCost[56] = 90
set udg_TowerGoldCost[57] = 100
set udg_TowerGoldCost[58] = 28
set udg_TowerGoldCost[59] = 36
set udg_TowerGoldCost[60] = 28
set udg_TowerGoldCost[61] = 36
set udg_TowerGoldCost[62] = 28
set udg_TowerGoldCost[63] = 36
set udg_TowerGoldCost[64] = 40
set udg_TowerGoldCost[65] = 120
set udg_TowerGoldCost[66] = 240
set udg_TowerGoldCost[67] = 400
set udg_TowerGoldCost[68] = 65
set udg_TowerGoldCost[69] = 165
set udg_TowerGoldCost[70] = 305
set udg_TowerGoldCost[71] = 485
set udg_TowerGoldCost[72] = 95
set udg_TowerGoldCost[73] = 120
set udg_TowerGoldCost[74] = 160
set udg_TowerGoldCost[75] = 180
set udg_TowerGoldCost[76] = 275
set udg_TowerGoldCost[77] = 300
set udg_TowerGoldCost[78] = 95
set udg_TowerGoldCost[79] = 120
set udg_TowerGoldCost[80] = 160
set udg_TowerGoldCost[81] = 180
set udg_TowerGoldCost[82] = 275
set udg_TowerGoldCost[83] = 300
set udg_TowerGoldCost[84] = 80
set udg_TowerGoldCost[85] = 90
set udg_TowerGoldCost[86] = 160
set udg_TowerGoldCost[87] = 180
set udg_TowerGoldCost[88] = 275
set udg_TowerGoldCost[89] = 300
set udg_TowerGoldCost[90] = 80
set udg_TowerGoldCost[91] = 90
set udg_TowerGoldCost[92] = 160
set udg_TowerGoldCost[93] = 180
set udg_TowerGoldCost[94] = 275
set udg_TowerGoldCost[95] = 300
set udg_TowerGoldCost[96] = 390
set udg_TowerGoldCost[97] = 430
set udg_TowerGoldCost[98] = 240
set udg_TowerGoldCost[99] = 260
set udg_TowerGoldCost[100] = 390
set udg_TowerGoldCost[101] = 430
set udg_TowerGoldCost[102] = 240
set udg_TowerGoldCost[103] = 260
set udg_TowerGoldCost[104] = 620
set udg_TowerGoldCost[105] = 760
set udg_TowerGoldCost[106] = 920
set udg_TowerGoldCost[107] = 1100
set udg_TowerGoldCost[108] = 1300
set udg_TowerGoldCost[109] = 1520
set udg_TowerGoldCost[110] = 1760
set udg_TowerGoldCost[111] = 240
set udg_TowerGoldCost[112] = 260
set udg_TowerGoldCost[113] = 550
set udg_TowerGoldCost[114] = 650
set udg_TowerGoldCost[115] = 390
set udg_TowerGoldCost[116] = 430
set udg_TowerGoldCost[117] = 550
set udg_TowerGoldCost[118] = 650
set udg_TowerGoldCost[119] = 390
set udg_TowerGoldCost[120] = 430
set udg_TowerGoldCost[121] = 500
set udg_TowerGoldCost[122] = 620
set udg_TowerGoldCost[123] = 760
set udg_TowerGoldCost[124] = 920
set udg_TowerGoldCost[125] = 1100
set udg_TowerGoldCost[126] = 1300
set udg_TowerGoldCost[127] = 1520
set udg_TowerGoldCost[128] = 550
set udg_TowerGoldCost[129] = 650
set udg_TowerGoldCost[130] = 240
set udg_TowerGoldCost[131] = 260
set udg_TowerGoldCost[132] = 25
set udg_TowerGoldCost[133] = 40
set udg_TowerGoldCost[134] = 50
set udg_TowerGoldCost[135] = 100
set udg_TowerGoldCost[136] = 150
set udg_TowerGoldCost[137] = 40
set udg_TowerGoldCost[138] = 100
set udg_TowerGoldCost[139] = 200
set udg_TowerGoldCost[140] = 35
set udg_TowerGoldCost[141] = 70
set udg_TowerGoldCost[142] = 105
set udg_TowerGoldCost[143] = 140
set udg_TowerGoldCost[144] = 175
set udg_TowerGoldCost[145] = 65
set udg_TowerGoldCost[146] = 100
set udg_TowerGoldCost[147] = 145
set udg_TowerGoldCost[148] = 40
set udg_TowerGoldCost[149] = 95
set udg_TowerGoldCost[150] = 140
set udg_TowerGoldCost[151] = 195
set udg_TowerGoldCost[152] = 260
set udg_TowerGoldCost[153] = 250
set udg_TowerGoldCost[154] = 500
set udg_TowerGoldCost[155] = 70
//Destination 1
set udg_Destinations[50 + ((1 - 1) * 88)] = 73
set udg_Destinations[38 + ((1 - 1) * 88)] = 42
set udg_Destinations[42 + ((1 - 1) * 88)] = 46
set udg_Destinations[46 + ((1 - 1) * 88)] = 50
set udg_Destinations[3 + ((1 - 1) * 88)] = 70
set udg_Destinations[70 + ((1 - 1) * 88)] = 66
set udg_Destinations[66 + ((1 - 1) * 88)] = 62
set udg_Destinations[62 + ((1 - 1) * 88)] = 58
set udg_Destinations[58 + ((1 - 1) * 88)] = 54
set udg_Destinations[54 + ((1 - 1) * 88)] = 50
//Destination 2
set udg_Destinations[49 + ((2 - 1) * 88)] = 74
set udg_Destinations[37 + ((2 - 1) * 88)] = 41
set udg_Destinations[41 + ((2 - 1) * 88)] = 45
set udg_Destinations[45 + ((2 - 1) * 88)] = 49
set udg_Destinations[2 + ((2 - 1) * 88)] = 69
set udg_Destinations[69 + ((2 - 1) * 88)] = 65
set udg_Destinations[65 + ((2 - 1) * 88)] = 61
set udg_Destinations[61 + ((2 - 1) * 88)] = 57
set udg_Destinations[57 + ((2 - 1) * 88)] = 53
set udg_Destinations[53 + ((2 - 1) * 88)] = 49
//Destination 3
set udg_Destinations[51 + ((3 - 1) * 88)] = 75
set udg_Destinations[39 + ((3 - 1) * 88)] = 43
set udg_Destinations[43 + ((3 - 1) * 88)] = 47
set udg_Destinations[47 + ((3 - 1) * 88)] = 51
set udg_Destinations[4 + ((3 - 1) * 88)] = 71
set udg_Destinations[71 + ((3 - 1) * 88)] = 67
set udg_Destinations[67 + ((3 - 1) * 88)] = 63
set udg_Destinations[63 + ((3 - 1) * 88)] = 59
set udg_Destinations[59 + ((3 - 1) * 88)] = 55
set udg_Destinations[55 + ((3 - 1) * 88)] = 51
//Destination 4
set udg_Destinations[52 + ((4 - 1) * 88)] = 76
set udg_Destinations[40 + ((4 - 1) * 88)] = 44
set udg_Destinations[44 + ((4 - 1) * 88)] = 48
set udg_Destinations[48 + ((4 - 1) * 88)] = 52
set udg_Destinations[1 + ((4 - 1) * 88)] = 72
set udg_Destinations[72 + ((4 - 1) * 88)] = 68
set udg_Destinations[68 + ((4 - 1) * 88)] = 64
set udg_Destinations[64 + ((4 - 1) * 88)] = 60
set udg_Destinations[60 + ((4 - 1) * 88)] = 56
set udg_Destinations[56 + ((4 - 1) * 88)] = 52
//Destination 5
set udg_Destinations[26 + ((5 - 1) * 88)] = 77
set udg_Destinations[38 + ((5 - 1) * 88)] = 34
set udg_Destinations[34 + ((5 - 1) * 88)] = 30
set udg_Destinations[30 + ((5 - 1) * 88)] = 26
set udg_Destinations[2 + ((5 - 1) * 88)] = 6
set udg_Destinations[6 + ((5 - 1) * 88)] = 10
set udg_Destinations[10 + ((5 - 1) * 88)] = 14
set udg_Destinations[14 + ((5 - 1) * 88)] = 18
set udg_Destinations[18 + ((5 - 1) * 88)] = 22
set udg_Destinations[22 + ((5 - 1) * 88)] = 26
//Destination 6
set udg_Destinations[25 + ((6 - 1) * 88)] = 78
set udg_Destinations[37 + ((6 - 1) * 88)] = 33
set udg_Destinations[33 + ((6 - 1) * 88)] = 29
set udg_Destinations[29 + ((6 - 1) * 88)] = 25
set udg_Destinations[1 + ((6 - 1) * 88)] = 5
set udg_Destinations[5 + ((6 - 1) * 88)] = 9
set udg_Destinations[9 + ((6 - 1) * 88)] = 13
set udg_Destinations[13 + ((6 - 1) * 88)] = 17
set udg_Destinations[17 + ((6 - 1) * 88)] = 21
set udg_Destinations[21 + ((6 - 1) * 88)] = 25
//Destination 7
set udg_Destinations[28 + ((7 - 1) * 88)] = 79
set udg_Destinations[40 + ((7 - 1) * 88)] = 36
set udg_Destinations[36 + ((7 - 1) * 88)] = 32
set udg_Destinations[32 + ((7 - 1) * 88)] = 28
set udg_Destinations[4 + ((7 - 1) * 88)] = 8
set udg_Destinations[8 + ((7 - 1) * 88)] = 12
set udg_Destinations[12 + ((7 - 1) * 88)] = 16
set udg_Destinations[16 + ((7 - 1) * 88)] = 20
set udg_Destinations[20 + ((7 - 1) * 88)] = 24
set udg_Destinations[24 + ((7 - 1) * 88)] = 28
//Destination 8
set udg_Destinations[27 + ((8 - 1) * 88)] = 80
set udg_Destinations[39 + ((8 - 1) * 88)] = 35
set udg_Destinations[35 + ((8 - 1) * 88)] = 31
set udg_Destinations[31 + ((8 - 1) * 88)] = 27
set udg_Destinations[3 + ((8 - 1) * 88)] = 7
set udg_Destinations[7 + ((8 - 1) * 88)] = 11
set udg_Destinations[11 + ((8 - 1) * 88)] = 15
set udg_Destinations[15 + ((8 - 1) * 88)] = 19
set udg_Destinations[19 + ((8 - 1) * 88)] = 23
set udg_Destinations[23 + ((8 - 1) * 88)] = 27
//Destination 9
set udg_Destinations[2 + ((9 - 1) * 88)] = 81
set udg_Destinations[37 + ((9 - 1) * 88)] = 41
set udg_Destinations[41 + ((9 - 1) * 88)] = 45
set udg_Destinations[45 + ((9 - 1) * 88)] = 49
set udg_Destinations[49 + ((9 - 1) * 88)] = 53
set udg_Destinations[53 + ((9 - 1) * 88)] = 57
set udg_Destinations[57 + ((9 - 1) * 88)] = 61
set udg_Destinations[61 + ((9 - 1) * 88)] = 65
set udg_Destinations[65 + ((9 - 1) * 88)] = 69
set udg_Destinations[69 + ((9 - 1) * 88)] = 2
set udg_Destinations[38 + ((9 - 1) * 88)] = 34
set udg_Destinations[34 + ((9 - 1) * 88)] = 30
set udg_Destinations[30 + ((9 - 1) * 88)] = 26
set udg_Destinations[26 + ((9 - 1) * 88)] = 22
set udg_Destinations[22 + ((9 - 1) * 88)] = 18
set udg_Destinations[18 + ((9 - 1) * 88)] = 14
set udg_Destinations[14 + ((9 - 1) * 88)] = 10
set udg_Destinations[10 + ((9 - 1) * 88)] = 6
set udg_Destinations[6 + ((9 - 1) * 88)] = 2
//Destination 10
set udg_Destinations[1 + ((10 - 1) * 88)] = 82
set udg_Destinations[37 + ((10 - 1) * 88)] = 33
set udg_Destinations[33 + ((10 - 1) * 88)] = 29
set udg_Destinations[29 + ((10 - 1) * 88)] = 25
set udg_Destinations[25 + ((10 - 1) * 88)] = 21
set udg_Destinations[21 + ((10 - 1) * 88)] = 17
set udg_Destinations[17 + ((10 - 1) * 88)] = 13
set udg_Destinations[13 + ((10 - 1) * 88)] = 9
set udg_Destinations[9 + ((10 - 1) * 88)] = 5
set udg_Destinations[5 + ((10 - 1) * 88)] = 1
set udg_Destinations[40 + ((10 - 1) * 88)] = 44
set udg_Destinations[44 + ((10 - 1) * 88)] = 48
set udg_Destinations[48 + ((10 - 1) * 88)] = 52
set udg_Destinations[52 + ((10 - 1) * 88)] = 56
set udg_Destinations[56 + ((10 - 1) * 88)] = 60
set udg_Destinations[60 + ((10 - 1) * 88)] = 64
set udg_Destinations[64 + ((10 - 1) * 88)] = 68
set udg_Destinations[68 + ((10 - 1) * 88)] = 72
set udg_Destinations[72 + ((10 - 1) * 88)] = 1
//Destination 11
set udg_Destinations[4 + ((11 - 1) * 88)] = 83
set udg_Destinations[39 + ((11 - 1) * 88)] = 43
set udg_Destinations[43 + ((11 - 1) * 88)] = 47
set udg_Destinations[47 + ((11 - 1) * 88)] = 51
set udg_Destinations[51 + ((11 - 1) * 88)] = 55
set udg_Destinations[55 + ((11 - 1) * 88)] = 59
set udg_Destinations[59 + ((11 - 1) * 88)] = 63
set udg_Destinations[63 + ((11 - 1) * 88)] = 67
set udg_Destinations[67 + ((11 - 1) * 88)] = 71
set udg_Destinations[71 + ((11 - 1) * 88)] = 4
set udg_Destinations[40 + ((11 - 1) * 88)] = 36
set udg_Destinations[36 + ((11 - 1) * 88)] = 32
set udg_Destinations[32 + ((11 - 1) * 88)] = 28
set udg_Destinations[28 + ((11 - 1) * 88)] = 24
set udg_Destinations[24 + ((11 - 1) * 88)] = 20
set udg_Destinations[20 + ((11 - 1) * 88)] = 16
set udg_Destinations[16 + ((11 - 1) * 88)] = 12
set udg_Destinations[12 + ((11 - 1) * 88)] = 8
set udg_Destinations[8 + ((11 - 1) * 88)] = 4
//Destination 12
set udg_Destinations[3 + ((12 - 1) * 88)] = 84
set udg_Destinations[38 + ((12 - 1) * 88)] = 42
set udg_Destinations[42 + ((12 - 1) * 88)] = 46
set udg_Destinations[46 + ((12 - 1) * 88)] = 50
set udg_Destinations[50 + ((12 - 1) * 88)] = 54
set udg_Destinations[54 + ((12 - 1) * 88)] = 58
set udg_Destinations[58 + ((12 - 1) * 88)] = 62
set udg_Destinations[62 + ((12 - 1) * 88)] = 66
set udg_Destinations[66 + ((12 - 1) * 88)] = 70
set udg_Destinations[70 + ((12 - 1) * 88)] = 3
set udg_Destinations[39 + ((12 - 1) * 88)] = 35
set udg_Destinations[35 + ((12 - 1) * 88)] = 31
set udg_Destinations[31 + ((12 - 1) * 88)] = 27
set udg_Destinations[27 + ((12 - 1) * 88)] = 23
set udg_Destinations[23 + ((12 - 1) * 88)] = 19
set udg_Destinations[19 + ((12 - 1) * 88)] = 15
set udg_Destinations[15 + ((12 - 1) * 88)] = 11
set udg_Destinations[11 + ((12 - 1) * 88)] = 7
set udg_Destinations[7 + ((12 - 1) * 88)] = 3
set udg_Destinations[1800 + 1 + ((1 - 1) * 2)] = 86
set udg_Destinations[1800 + 2 + ((1 - 1) * 2)] = 3
set udg_Destinations[1800 + 1 + ((2 - 1) * 2)] = 87
set udg_Destinations[1800 + 2 + ((2 - 1) * 2)] = 2
set udg_Destinations[1800 + 1 + ((3 - 1) * 2)] = 85
set udg_Destinations[1800 + 2 + ((3 - 1) * 2)] = 4
set udg_Destinations[1800 + 1 + ((4 - 1) * 2)] = 88
set udg_Destinations[1800 + 2 + ((4 - 1) * 2)] = 1
set udg_Destinations[1800 + 1 + ((5 - 1) * 2)] = 86
set udg_Destinations[1800 + 2 + ((5 - 1) * 2)] = 2
set udg_Destinations[1800 + 1 + ((6 - 1) * 2)] = 87
set udg_Destinations[1800 + 2 + ((6 - 1) * 2)] = 1
set udg_Destinations[1800 + 1 + ((7 - 1) * 2)] = 88
set udg_Destinations[1800 + 2 + ((7 - 1) * 2)] = 4
set udg_Destinations[1800 + 1 + ((8 - 1) * 2)] = 85
set udg_Destinations[1800 + 2 + ((8 - 1) * 2)] = 3
set udg_Destinations[1800 + 1 + ((9 - 1) * 2)] = 87
set udg_Destinations[1800 + 2 + ((9 - 1) * 2)] = 86
set udg_Destinations[1800 + 1 + ((10 - 1) * 2)] = 88
set udg_Destinations[1800 + 2 + ((10 - 1) * 2)] = 87
set udg_Destinations[1800 + 1 + ((11 - 1) * 2)] = 88
set udg_Destinations[1800 + 2 + ((11 - 1) * 2)] = 85
set udg_Destinations[1800 + 1 + ((12 - 1) * 2)] = 86
set udg_Destinations[1800 + 2 + ((12 - 1) * 2)] = 85
set udg_Colors[1] = 95.00 //
set udg_Colors[2] = 0.00
set udg_Colors[3] = 0.00
set udg_Colors[4] = 19.00
set udg_Colors[5] = 0.00
set udg_Colors[6] = 95.00 //
set udg_Colors[7] = 0.00
set udg_Colors[8] = 92.00
set udg_Colors[9] = 66.00
set udg_Colors[10] = 30.00
set udg_Colors[11] = 0.00
set udg_Colors[12] = 44.00
set udg_Colors[13] = 89.00
set udg_Colors[14] = 95.00
set udg_Colors[15] = 0.00
set udg_Colors[16] = 95.00 //
set udg_Colors[17] = 44.00
set udg_Colors[18] = 0.00
set udg_Colors[19] = 0.00
set udg_Colors[20] = 75.00
set udg_Colors[21] = 0.00
set udg_Colors[22] = 94.00
set udg_Colors[23] = 17.00
set udg_Colors[24] = 64.00
set udg_Colors[25] = 51.00
set udg_Colors[26] = 51.00
set udg_Colors[27] = 51.00
set udg_Colors[28] = 39.00
set udg_Colors[29] = 68.00
set udg_Colors[30] = 95.00
set udg_Colors[31] = 0.00
set udg_Colors[32] = 33.00
set udg_Colors[33] = 21.00
set udg_Colors[34] = 25.00
set udg_Colors[35] = 12.00
set udg_Colors[36] = 0.00
set udg_PlayerStartRegions[1] = gg_rct_Player_1
set udg_PlayerStartRegions[2] = gg_rct_Player_2
set udg_PlayerStartRegions[3] = gg_rct_Player_3
set udg_PlayerStartRegions[4] = gg_rct_Player_4
set udg_PlayerStartRegions[5] = gg_rct_Player_5
set udg_PlayerStartRegions[6] = gg_rct_Player_6
set udg_PlayerStartRegions[7] = gg_rct_Player_7
set udg_PlayerStartRegions[8] = gg_rct_Player_8
set udg_PlayerStartRegions[9] = gg_rct_Player_9
set udg_PlayerStartRegions[10] = gg_rct_Player_10
set udg_PlayerStartRegions[11] = gg_rct_Player_11
set udg_PlayerStartRegions[12] = gg_rct_Player_12
set udg_PlayerStartRegions[29] = gg_rct_text_1
set udg_PlayerStartRegions[30] = gg_rct_text_2
set udg_PlayerStartRegions[31] = gg_rct_text_3
set udg_PlayerStartRegions[32] = gg_rct_text_4
set udg_PlayerStartRegions[33] = gg_rct_text_5
set udg_PlayerStartRegions[34] = gg_rct_text_6
set udg_PlayerStartRegions[35] = gg_rct_text_7
set udg_PlayerStartRegions[36] = gg_rct_text_8
set udg_PlayerStartRegions[37] = gg_rct_text_9
set udg_PlayerStartRegions[38] = gg_rct_text_10
set udg_PlayerStartRegions[39] = gg_rct_text_11
set udg_PlayerStartRegions[40] = gg_rct_text_12
set udg_TowerType[0] = 'o000'
set udg_TowerType[1] = 'o001'
set udg_TowerType[2] = 'o002'
set udg_TowerType[3] = 'o003'
set udg_TowerType[4] = 'o004'
set udg_TowerType[5] = 'o005'
set udg_TowerType[6] = 'o006'
set udg_TowerType[7] = 'o007'
set udg_TowerType[8] = 'o008'
set udg_TowerType[9] = 'o009'
set udg_TowerType[10] = 'o00A'
set udg_TowerType[11] = 'o00B'
set udg_TowerType[12] = 'o00C'
set udg_TowerType[13] = 'o00D'
set udg_TowerType[14] = 'o00E'
set udg_TowerType[15] = 'o00F'
set udg_TowerType[16] = 'o00G'
set udg_TowerType[17] = 'o00H'
set udg_TowerType[18] = 'o00I'
set udg_TowerType[19] = 'o00J'
set udg_TowerType[20] = 'o00K'
set udg_TowerType[21] = 'o00L'
set udg_TowerType[22] = 'o00M'
set udg_TowerType[23] = 'o00N'
set udg_TowerType[24] = 'o00O'
set udg_TowerType[25] = 'o00P'
set udg_TowerType[26] = 'o00Q'
set udg_TowerType[27] = 'o00R'
set udg_TowerType[28] = 'o00S'
set udg_TowerType[29] = 'o00T'
set udg_TowerType[30] = 'o00U'
set udg_TowerType[31] = 'o00V'
set udg_TowerType[32] = 'o00W'
set udg_TowerType[33] = 'o00X'
set udg_TowerType[34] = 'o00Y'
set udg_TowerType[35] = 'o00Z'
set udg_TowerType[36] = 'e000'
set udg_TowerType[37] = 'o010'
set udg_TowerType[38] = 'o011'
set udg_TowerType[39] = 'o013'
set udg_TowerType[40] = 'o014'
set udg_TowerType[41] = 'o015'
set udg_TowerType[42] = 'o016'
set udg_TowerType[43] = 'o017'
set udg_TowerType[44] = 'o018'
set udg_TowerType[45] = 'o019'
set udg_TowerType[46] = 'o01A'
set udg_TowerType[47] = 'o01B'
set udg_TowerType[48] = 'o01C'
set udg_TowerType[49] = 'o01D'
set udg_TowerType[50] = 'o01E'
set udg_TowerType[51] = 'o01F'
set udg_TowerType[52] = 'o01G'
set udg_TowerType[53] = 'o01H'
set udg_TowerType[54] = 'o01I'
set udg_TowerType[55] = 'o01J'
set udg_TowerType[56] = 'o01K'
set udg_TowerType[57] = 'o01L'
set udg_TowerType[58] = 'o01M'
set udg_TowerType[59] = 'o01N'
set udg_TowerType[60] = 'o01O'
set udg_TowerType[61] = 'o01P'
set udg_TowerType[62] = 'o01Q'
set udg_TowerType[63] = 'o01R'
set udg_TowerType[64] = 'o01S'
set udg_TowerType[65] = 'o01T'
set udg_TowerType[66] = 'o01U'
set udg_TowerType[67] = 'o01V'
set udg_TowerType[68] = 'o01W'
set udg_TowerType[69] = 'o01X'
set udg_TowerType[70] = 'o01Y'
set udg_TowerType[71] = 'o01Z'
set udg_TowerType[72] = 'o020'
set udg_TowerType[73] = 'o021'
set udg_TowerType[74] = 'o022'
set udg_TowerType[75] = 'o023'
set udg_TowerType[76] = 'o024'
set udg_TowerType[77] = 'o025'
set udg_TowerType[78] = 'o026'
set udg_TowerType[79] = 'o027'
set udg_TowerType[80] = 'o028'
set udg_TowerType[81] = 'o029'
set udg_TowerType[82] = 'o02A'
set udg_TowerType[83] = 'o02B'
set udg_TowerType[84] = 'o02C'
set udg_TowerType[85] = 'o02D'
set udg_TowerType[86] = 'o02E'
set udg_TowerType[87] = 'o02F'
set udg_TowerType[88] = 'o02G'
set udg_TowerType[89] = 'o02H'
set udg_TowerType[90] = 'o02I'
set udg_TowerType[91] = 'o02J'
set udg_TowerType[92] = 'o02K'
set udg_TowerType[93] = 'o02L'
set udg_TowerType[94] = 'o02M'
set udg_TowerType[95] = 'o02N'
set udg_TowerType[96] = 'o02O'
set udg_TowerType[97] = 'o02P'
set udg_TowerType[98] = 'o02Q'
set udg_TowerType[99] = 'o02R'
set udg_TowerType[100] = 'o02S'
set udg_TowerType[101] = 'o02T'
set udg_TowerType[102] = 'o02U'
set udg_TowerType[103] = 'o02V'
set udg_TowerType[104] = 'o02W'
set udg_TowerType[105] = 'o02X'
set udg_TowerType[106] = 'o02Y'
set udg_TowerType[107] = 'o02Z'
set udg_TowerType[108] = 'o030'
set udg_TowerType[109] = 'o031'
set udg_TowerType[110] = 'o032'
set udg_TowerType[111] = 'o033'
set udg_TowerType[112] = 'o034'
set udg_TowerType[113] = 'o035'
set udg_TowerType[114] = 'o036'
set udg_TowerType[115] = 'o037'
set udg_TowerType[116] = 'o038'
set udg_TowerType[117] = 'o039'
set udg_TowerType[118] = 'o03A'
set udg_TowerType[119] = 'o03B'
set udg_TowerType[120] = 'o03C'
set udg_TowerType[121] = 'o03D'
set udg_TowerType[122] = 'o03E'
set udg_TowerType[123] = 'o03F'
set udg_TowerType[124] = 'o03G'
set udg_TowerType[125] = 'o03H'
set udg_TowerType[126] = 'o03I'
set udg_TowerType[127] = 'o03J'
set udg_TowerType[128] = 'o03K'
set udg_TowerType[129] = 'o03L'
set udg_TowerType[130] = 'o03M'
set udg_TowerType[131] = 'o03N'
set udg_TowerType[132] = 'o03O'
set udg_TowerType[133] = 'o03P'
set udg_TowerType[134] = 'o03Q'
set udg_TowerType[135] = 'o03R'
set udg_TowerType[136] = 'o03S'
set udg_TowerType[137] = 'o03T'
set udg_TowerType[138] = 'o03U'
set udg_TowerType[139] = 'o03V'
set udg_TowerType[140] = 'o03W'
set udg_TowerType[141] = 'o03X'
set udg_TowerType[142] = 'o03Y'
set udg_TowerType[143] = 'o03Z'
set udg_TowerType[144] = 'o040'
set udg_TowerType[145] = 'o041'
set udg_TowerType[146] = 'o042'
set udg_TowerType[147] = 'o043'
set udg_TowerType[148] = 'o044'
set udg_TowerType[149] = 'o045'
set udg_TowerType[150] = 'o046'
set udg_TowerType[151] = 'o047'
set udg_TowerType[152] = 'o048'
set udg_TowerType[153] = 'o049'
set udg_TowerType[154] = 'o04A'
set udg_TowerType[155] = 'o04B'
set udg_TowerSellAbility[1] = 'A011'
set udg_TowerSellAbility[2] = 'A008'
set udg_TowerSellAbility[3] = 'A012'
set udg_TowerSellAbility[4] = 'A013'
set udg_TowerSellAbility[5] = 'A014'
set udg_TowerSellAbility[6] = 'A015'
set udg_TowerSellAbility[7] = 'A016'
set udg_TowerSellAbility[8] = 'A017'
set udg_TowerSellAbility[9] = 'A018'
set udg_TowerSellAbility[10] = 'A019'
set udg_TowerSellAbility[11] = 'A01A'
set udg_TowerSellAbility[12] = 'A01B'
set udg_SellTechLevel[1] = 'h00G'
set udg_SellTechLevel[2] = 'h00H'
set udg_SellTechLevel[3] = 'h00I'
set udg_SellTechLevel[4] = 'h00J'
set udg_SellTechLevel[5] = 'h00K'
set udg_SellTechLevel[6] = 'h00L'
set udg_SellTechLevel[7] = 'h00M'
set udg_SellTechLevel[8] = 'h00N'
set udg_SellTechLevel[9] = 'h00O'
set udg_SellTechLevel[10] = 'h00P'
set udg_SellTechLevel[11] = 'h00Q'
set udg_SellTechLevel[12] = 'h00R'
set udg_StartingCameras[1] = gg_cam_Player_1
set udg_StartingCameras[2] = gg_cam_Player_2
set udg_StartingCameras[3] = gg_cam_Player_3
set udg_StartingCameras[4] = gg_cam_Player_4
set udg_StartingCameras[5] = gg_cam_Player_5
set udg_StartingCameras[6] = gg_cam_Player_6
set udg_StartingCameras[7] = gg_cam_Player_7
set udg_StartingCameras[8] = gg_cam_Player_8
set udg_StartingCameras[9] = gg_cam_Player_9
set udg_StartingCameras[10] = gg_cam_Player_10
set udg_StartingCameras[11] = gg_cam_Player_11
set udg_StartingCameras[12] = gg_cam_Player_12
call TriggerRegisterAnyUnitEventBJ( Gather_Gold_Info_Build, EVENT_PLAYER_UNIT_SELL )
call TriggerAddCondition( Gather_Gold_Info_Build, Condition( function Trig_Gather_Gold_Info_Conditions ) )
call TriggerAddAction( Gather_Gold_Info_Build, function Trig_Gather_Gold_Info_Actions2 )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Gather_Gold_Info, udg_TowerTimer )
call TriggerAddAction( gg_trg_Gather_Gold_Info, function Trig_Gather_Gold_Info_Actions )
endfunction
function Trig_Teleport_Conditions takes nothing returns boolean
if ( IsUnitType(GetOrderedUnit(), UNIT_TYPE_HERO) == false ) then
return false
endif
return ( GetIssuedOrderId() == 851990 )
endfunction
function Trig_Teleport_Actions takes nothing returns nothing
local unit u = GetOrderedUnit()
local location s = GetUnitLoc(u)
local location t = GetOrderPointLoc()
local real a = AngleBetweenPoints(s, t)
local real d = DistanceBetweenPoints(s, t) - 196.00
local location p = PolarProjectionBJ(s, d, a)
local effect array e
local integer b = GetIssuedOrderId()
call PauseUnitBJ( true, u )
call AddSpecialEffectLocBJ( s, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
set e[1] = bj_lastCreatedEffect
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl" )
set e[2] = bj_lastCreatedEffect
call PolledWait( 0.10 )
call SetUnitPositionLoc( u, p )
call PauseUnitBJ( false, u )
call IssuePointOrderLocBJ( u, "move", t )
call DestroyEffectBJ( e[1] )
call DestroyEffectBJ( e[2] )
call RemoveLocation(s)
call RemoveLocation(t)
call RemoveLocation(p)
endfunction
function Trig_Teleport_Build_Conditions takes nothing returns boolean
local integer orderId = GetIssuedOrderId()
local string orderString
local unit u = GetOrderedUnit()
local location s = GetUnitLoc(u)
local location t = GetOrderPointLoc()
local real d = DistanceBetweenPoints(s, t)
call RemoveLocation(s)
call RemoveLocation(t)
if ( IsUnitType(GetOrderedUnit(), UNIT_TYPE_HERO) == false ) then
return false
endif
if (d < 768) then
return false
endif
if (orderId == (851990)) then
return false
endif
if ((orderId == 852619) or ((orderId > 852007) and (orderId < 852014))) then
return true
endif
set orderString = UnitId2String(orderId)
if (orderString != null) then
return true
endif
return false
endfunction
function Trig_Teleport_Build_Actions takes nothing returns nothing
local unit u = GetOrderedUnit()
local location s = GetUnitLoc(u)
local location t = GetOrderPointLoc()
local real a = AngleBetweenPoints(s, t)
local real d = DistanceBetweenPoints(s, t) - 196.00
local location p = PolarProjectionBJ(s, d, a)
local effect array e
local integer b = GetIssuedOrderId()
local item i
call PauseUnitBJ( true, u )
call AddSpecialEffectLocBJ( s, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
set e[1] = bj_lastCreatedEffect
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl" )
set e[2] = bj_lastCreatedEffect
call PolledWait( 0.10 )
call SetUnitPositionLoc( u, p )
call PauseUnitBJ( false, u )
if (b == 852619) then
if (GetUnitTypeId(u) == 'U004') then
call UnitAddAbilityBJ( 'A0DS', u )
elseif (GetUnitTypeId(u) == 'U005') then
call UnitAddAbilityBJ( 'A0DV', u )
elseif (GetUnitTypeId(u) == 'U006') then
call UnitAddAbilityBJ( 'A0DT', u )
elseif (GetUnitTypeId(u) == 'U003') then
call UnitAddAbilityBJ( 'A0DU', u )
elseif (GetUnitTypeId(u) == 'U007') then
call UnitAddAbilityBJ( 'A0DW', u )
elseif (GetUnitTypeId(u) == 'U00A') then
call UnitAddAbilityBJ( 'A0DX', u )
elseif (GetUnitTypeId(u) == 'U009') then
call UnitAddAbilityBJ( 'A0DY', u )
elseif (GetUnitTypeId(u) == 'U008') then
call UnitAddAbilityBJ( 'A0DZ', u )
elseif (GetUnitTypeId(u) == 'U00B') then
call UnitAddAbilityBJ( 'A0E0', u )
elseif (GetUnitTypeId(u) == 'U00C') then
call UnitAddAbilityBJ( 'A0E1', u )
elseif (GetUnitTypeId(u) == 'U00D') then
call UnitAddAbilityBJ( 'A0E2', u )
elseif (GetUnitTypeId(u) == 'U00E') then
call UnitAddAbilityBJ( 'A0E3', u )
endif
call IssuePointOrderByIdLoc(u,b,t)
elseif ((b > 852007) and (b < 852014)) then
set i = UnitItemInSlotBJ(u, b-852007)
if (( GetItemTypeId(i) != 'I045' ) and ( GetItemTypeId(i) != 'I046' ) and ( GetItemTypeId(i) != 'I047' ) and ( GetItemTypeId(i) != 'I048' ) and ( GetItemTypeId(i) != 'I049' ) and ( GetItemTypeId(i) != 'I04A' ) and ( GetItemTypeId(i) != 'I04B' ) and ( GetItemTypeId(i) != 'I04C' )) then
call UnitUseItemPointLoc( u, UnitItemInSlotBJ(u, b-852007), t )
endif
else
call IssueBuildOrderById(u, b, GetLocationX(t), GetLocationY(t))
endif
call DestroyEffectBJ( e[1] )
call DestroyEffectBJ( e[2] )
call RemoveLocation(s)
call RemoveLocation(t)
call RemoveLocation(p)
endfunction
function Trig_Teleport_Move_Conditions takes nothing returns boolean
local integer orderId = GetIssuedOrderId()
local string orderString
local unit u = GetOrderedUnit()
local location s = GetUnitLoc(u)
local location t = GetOrderPointLoc()
local real d = DistanceBetweenPoints(s, t)
call RemoveLocation(s)
call RemoveLocation(t)
if ( IsUnitType(GetOrderedUnit(), UNIT_TYPE_HERO) == false ) then
return false
endif
if (d < 768) then
return false
endif
if ((orderId == 852525) or (orderId == 851990) or (orderId == 852619) or ((orderId > 852007) and (orderId < 852014))) then
return false
endif
set orderString = UnitId2String(orderId)
if (orderString != null) then
return false
endif
return true
endfunction
function Trig_Teleport_Move_Actions takes nothing returns nothing
local unit u = GetOrderedUnit()
local location s = GetUnitLoc(u)
local location t = GetOrderPointLoc()
local real a = AngleBetweenPoints(s, t)
local real d = DistanceBetweenPoints(s, t) - 196.00
local location p = PolarProjectionBJ(s, d, a)
local effect array e
local integer b = GetIssuedOrderId()
call PauseUnitBJ( true, u )
call AddSpecialEffectLocBJ( s, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
set e[1] = bj_lastCreatedEffect
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl" )
set e[2] = bj_lastCreatedEffect
call PolledWait( 0.10 )
call SetUnitPositionLoc( u, p )
call PauseUnitBJ( false, u )
call IssuePointOrderByIdLoc(u, b, t)
call DestroyEffectBJ( e[1] )
call DestroyEffectBJ( e[2] )
call RemoveLocation(s)
call RemoveLocation(t)
call RemoveLocation(p)
endfunction
function Trig_Teleport_Object_Conditions takes nothing returns boolean
local integer orderId = GetIssuedOrderId()
local string orderString
local unit u = GetOrderedUnit()
local location s = GetUnitLoc(u)
local widget w = GetOrderTarget()
local location t = Location(GetWidgetX(w), GetWidgetY(w))
local real d = DistanceBetweenPoints(s, t)
call RemoveLocation(s)
call RemoveLocation(t)
if ( IsUnitType(GetOrderedUnit(), UNIT_TYPE_HERO) == false ) then
return false
endif
if (d < 768) then
return false
endif
if ((orderId == 851990) or (orderId == 852525)) then // patrol - blink
return false
endif
return true
endfunction
function Trig_Teleport_Object_Actions takes nothing returns nothing
local unit u = GetOrderedUnit()
local location s = GetUnitLoc(u)
local widget w = GetOrderTarget()
local location t = Location(GetWidgetX(w), GetWidgetY(w))
local real a = AngleBetweenPoints(s, t)
local real d = DistanceBetweenPoints(s, t) - 196.00
local location p = PolarProjectionBJ(s, d, a)
local effect array e
local integer b = GetIssuedOrderId()
call PauseUnitBJ( true, u )
call AddSpecialEffectLocBJ( s, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
set e[1] = bj_lastCreatedEffect
call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl" )
set e[2] = bj_lastCreatedEffect
call PolledWait( 0.10 )
call SetUnitPositionLoc( u, p )
call PauseUnitBJ( false, u )
call IssueTargetOrderById(u, b, w)
call DestroyEffectBJ( e[1] )
call DestroyEffectBJ( e[2] )
call RemoveLocation(s)
call RemoveLocation(t)
call RemoveLocation(p)
endfunction
//===========================================================================
function InitTrig_Teleport takes nothing returns nothing
local integer i = 0
local trigger Teleport_Build = CreateTrigger( )
local trigger Teleport_Point = CreateTrigger( )
local trigger Teleport_Object = CreateTrigger( )
set gg_trg_Teleport = CreateTrigger( )
loop
exitwhen i > 11
if ( GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING ) then
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Teleport, Player(i), EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerRegisterPlayerUnitEventSimple( Teleport_Build, Player(i), EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerRegisterPlayerUnitEventSimple( Teleport_Point, Player(i), EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerRegisterPlayerUnitEventSimple( Teleport_Object, Player(i), EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
endif
set i = i + 1
endloop
call TriggerAddCondition( gg_trg_Teleport, Condition( function Trig_Teleport_Conditions ) )
call TriggerAddAction( gg_trg_Teleport, function Trig_Teleport_Actions )
call TriggerAddCondition( Teleport_Build, Condition( function Trig_Teleport_Build_Conditions ) )
call TriggerAddAction( Teleport_Build, function Trig_Teleport_Build_Actions )
call TriggerAddCondition( Teleport_Point, Condition( function Trig_Teleport_Move_Conditions ) )
call TriggerAddAction( Teleport_Point, function Trig_Teleport_Move_Actions )
call TriggerAddCondition( Teleport_Object, Condition( function Trig_Teleport_Object_Conditions ) )
call TriggerAddAction( Teleport_Object, function Trig_Teleport_Object_Actions )
endfunction
function Trig_Antistuck_Func001A takes nothing returns nothing
local unit u = GetEnumUnit()
local integer UnitEnumerator = GetUnitUserData(u)
local integer regions = udg_UnitRegion[UnitEnumerator]
if (regions > 84) then
call IssueTargetOrderBJ( u, "smart", udg_TeleporterCircles[regions] )
endif
endfunction
function Trig_Antistuck_Actions takes nothing returns nothing
call ForGroupBJ( udg_WaveGroup, function Trig_Antistuck_Func001A )
endfunction
//===========================================================================
function InitTrig_Antistuck takes nothing returns nothing
set gg_trg_Antistuck = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Antistuck, 8.00 )
call TriggerAddAction( gg_trg_Antistuck, function Trig_Antistuck_Actions )
endfunction
function Trig_WaveTimer_Create takes integer num returns nothing
local location l
local integer pos
local integer direction
if (( udg_Dummy[num] < 50 ) and ( GetPlayerSlotState(ConvertedPlayer(num)) == PLAYER_SLOT_STATE_PLAYING ) and ( GetPlayerController(ConvertedPlayer(num)) == MAP_CONTROL_USER )) then
set l = GetRectCenter(GetPlayableMapRect())
set udg_UnitEnumerator = ( udg_UnitEnumerator + 1 )
call CreateNUnitsAtLoc( 1, udg_WaveTypes[udg_Wave], Player(PLAYER_NEUTRAL_AGGRESSIVE), l, bj_UNIT_FACING )
call RemoveLocation(l)
call SetUnitPathing( GetLastCreatedUnit(), false )
call SetUnitUserData( GetLastCreatedUnit(), udg_UnitEnumerator )
if (udg_WaveDirection[num] == true) then
set direction = 1
set udg_WaveDirection[num] = false
else
set direction = 2
set udg_WaveDirection[num] = true
endif
set pos = udg_Destinations[1800 + direction + ((num - 1) * 2)]
set l = GetRectCenter(udg_CirclePathing[pos])
call RemoveLocation(udg_UnitPoint[udg_UnitEnumerator])
set udg_UnitPoint[udg_UnitEnumerator] = GetRectCenter(udg_CirclePathing[pos])
set udg_UnitRegion[udg_UnitEnumerator] = pos
set udg_UnitTarget[udg_UnitEnumerator] = num
if (pos > 84) then
call IssueTargetOrderBJ( GetLastCreatedUnit(), "smart", udg_TeleporterCircles[pos] )
else
call IssuePointOrderLoc( GetLastCreatedUnit(), "patrol", l )
endif
call SetUnitInvulnerable( GetLastCreatedUnit(), true )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_WaveGroup )
endif
endfunction
function Trig_WaveTimer_Actions takes nothing returns nothing
local location l
local integer num
local integer i = 1
if (( ModuloInteger(udg_Wave, 5) == 0 ) and ( udg_WaveHero == true )) then
set udg_WaveHero = false
loop
exitwhen i > 12
if (( udg_Dummy[i] < 50 ) and ( GetPlayerSlotState(ConvertedPlayer(i)) == PLAYER_SLOT_STATE_PLAYING ) and ( GetPlayerController(ConvertedPlayer(i)) == MAP_CONTROL_USER )) then
set l = GetRectCenter(GetPlayableMapRect())
set udg_UnitEnumerator = ( udg_UnitEnumerator + 1 )
call CreateNUnitsAtLoc( 1, udg_WaveHeroTypes[udg_Wave], Player(PLAYER_NEUTRAL_AGGRESSIVE), l, bj_UNIT_FACING )
call RemoveLocation(l)
call UnitAddItemByIdSwapped( udg_WaveHeroItems[udg_Wave], GetLastCreatedUnit() )
call SetUnitPathing( GetLastCreatedUnit(), false )
call SetUnitUserData( GetLastCreatedUnit(), udg_UnitEnumerator )
set num = udg_Destinations[1800 + GetRandomInt(1, 2) + ((i - 1) * 2)]
set l = GetRectCenter(udg_CirclePathing[num])
call RemoveLocation(udg_UnitPoint[udg_UnitEnumerator])
set udg_UnitPoint[udg_UnitEnumerator] = GetRectCenter(udg_CirclePathing[num])
set udg_UnitRegion[udg_UnitEnumerator] = num
set udg_UnitTarget[udg_UnitEnumerator] = i
if (num > 84) then
call IssueTargetOrderBJ( GetLastCreatedUnit(), "smart", udg_TeleporterCircles[num] )
else
call IssuePointOrderLoc( GetLastCreatedUnit(), "patrol", l )
endif
call SetUnitInvulnerable( GetLastCreatedUnit(), true )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_WaveGroup )
endif
set i = i + 1
endloop
else
set i = ((udg_WaveDummy - 1) * 6) + 1
loop
exitwhen i > udg_WaveDummy * 6
set num = udg_WaveSpawnVar[i]
call Trig_WaveTimer_Create(num)
set i = i + 1
endloop
if ( udg_WaveDummy == 4 ) then
set udg_WaveNum[udg_Wave] = ( udg_WaveNum[udg_Wave] - 1 )
endif
call TriggerExecute( gg_trg_Multiboard_Update_Lives )
set udg_WaveDummy = udg_WaveDummy + 1
if ( udg_WaveDummy == 5 ) then
set udg_WaveDummy = 1
endif
endif
if ( udg_WaveNum[udg_Wave] == 0 ) then
call PauseTimerBJ( true, GetExpiredTimer() )
call EnableTrigger( gg_trg_Antistuck )
endif
endfunction
//===========================================================================
function InitTrig_WaveTimer takes nothing returns nothing
set gg_trg_WaveTimer = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_WaveTimer, udg_WaveTimer[2] )
call TriggerAddAction( gg_trg_WaveTimer, function Trig_WaveTimer_Actions )
endfunction
function Trig_Wave_Actions takes nothing returns nothing
local unit u
local location l
if (( udg_WaveWaitTime[0] < 7.00 ) and ( udg_WaveWaitTime[0] > 1.00 )) then
call PlaySoundBJ( gg_snd_BattleNetTick )
elseif ( udg_WaveWaitTime[0] == 1.00 ) then
call PlaySoundBJ( gg_snd_Rescue )
elseif ((udg_WaveWaitTime[0] == 16.00 ) and (udg_Wave > 0)) then
set u = GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(Player(bj_PLAYER_NEUTRAL_EXTRA), udg_WaveTypes[udg_Wave]))
set l = GetUnitLoc(u)
call DisableTrigger( gg_trg_Antistuck )
call DestroyEffectBJ( udg_WaveArrow )
call CreatePermanentCorpseLocBJ( bj_CORPSETYPE_FLESH, udg_WaveTypes[udg_Wave], Player(PLAYER_NEUTRAL_PASSIVE), l, GetRandomDirectionDeg() )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 0.00, 512.00 )
call RemoveUnit( u )
call RemoveLocation(l)
endif
set udg_WaveWaitTime[0] = udg_WaveWaitTime[0] - 1
if ( ( udg_WaveWaitTime[0] < 1.00 ) and ( udg_Wave < 100 ) ) then
set udg_Wave = udg_Wave + 1
set u = GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(Player(bj_PLAYER_NEUTRAL_EXTRA), udg_WaveTypes[udg_Wave]))
set l = GetUnitLoc(u)
set udg_WaveName = GetUnitName(u)
call DestroyEffectBJ( udg_WaveArrow )
call AddSpecialEffectTargetUnitBJ( "overhead", GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(Player(bj_PLAYER_NEUTRAL_EXTRA), udg_WaveTypes[udg_Wave])), "Abilities\\Spells\\Other\\Aneu\\AneuCaster.mdl" )
call PingMinimapLocForForceEx( GetPlayersAll(), l, 3.00, bj_MINIMAPPINGSTYLE_SIMPLE, 100.00, 100.00, 100.00 )
set udg_WaveArrow = GetLastCreatedEffectBJ()
set udg_WaveHero = true
call PauseTimerBJ( true, udg_WaveTimer[1] )
set udg_UnitEnumerator = 0
call TriggerSleepAction( 0.5 )
call StartTimerBJ( udg_WaveTimer[2], true, udg_WaveWaitTime[udg_Wave] )
call TriggerExecute( gg_trg_Level )
call MultiboardSetTitleText( GetLastCreatedMultiboard(), "Circle Defense" )
call TriggerExecute( gg_trg_Multiboard_Expand )
call RemoveLocation(l)
else
call MultiboardSetTitleText( GetLastCreatedMultiboard(), ( "Circle Defense 00:00:" + ( I2S(( R2I(udg_WaveWaitTime[0]) / 10 )) + I2S(( R2I(udg_WaveWaitTime[0]) - ( ( R2I(udg_WaveWaitTime[0]) / 10 ) * 10 ) )) ) ) )
endif
endfunction
//===========================================================================
function InitTrig_Wave takes nothing returns nothing
set gg_trg_Wave = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Wave, udg_WaveTimer[1] )
call TriggerAddAction( gg_trg_Wave, function Trig_Wave_Actions )
endfunction
function Trig_Teleporters_Move_5_Conditions takes nothing returns boolean
return ( GetOwningPlayer(GetEnteringUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) )
endfunction
function Trig_Teleporters_Move_5_Actions takes nothing returns nothing
call SetUnitInvulnerable( GetEnteringUnit(), false )
endfunction
function Trig_Base_Entry_Actions takes nothing returns nothing
endfunction
function Trig_Base_Entry_Conditions takes nothing returns boolean
return ( GetOwningPlayer(GetEnteringUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) )
endfunction
function Trig_Base_Entry_Action takes nothing returns nothing
local unit u = GetEnteringUnit()
local integer UnitEnumerator = GetUnitUserData(u)
local integer regions = udg_UnitRegion[UnitEnumerator]
local integer destination = udg_UnitTarget[UnitEnumerator]
//local integer regions = R2I(GetUnitStateSwap(UNIT_STATE_MANA, u))
//local integer destination = GetUnitUserData(u)
local location l
local location a
local location b
local integer X
local integer Y
local integer Z
local integer num
set a = GetUnitLoc(u)
set b = GetRectCenter(udg_CirclePathing[regions])
if ( DistanceBetweenPoints(a, b) > 256 ) then
call RemoveLocation(a)
call RemoveLocation(b)
return
endif
call RemoveLocation(a)
call RemoveLocation(b)
set num = udg_Destinations[regions + ((destination - 1) * 88)]
set l = GetRectCenter(udg_CirclePathing[num])
//call SetUnitManaBJ( u, I2R(num) )
//call SetUnitState(u, UNIT_STATE_MANA, num)
call RemoveLocation(udg_UnitPoint[UnitEnumerator])
set udg_UnitPoint[UnitEnumerator] = GetRectCenter(udg_CirclePathing[num])
set udg_UnitRegion[UnitEnumerator] = num
if (((regions == 21) or (regions == 56)) and (destination == 10)) then // Move to player 4 base
call SetUnitInvulnerable( GetEnteringUnit(), false )
elseif (((regions == 22) or (regions == 53)) and (destination == 9)) then // Move to player 4 base
call SetUnitInvulnerable( GetEnteringUnit(), false )
elseif (((regions == 23) or (regions == 54)) and (destination == 12)) then // Move to player 4 base
call SetUnitInvulnerable( GetEnteringUnit(), false )
elseif (((regions == 24) or (regions == 55)) and (destination == 11)) then // Move to player 4 base
call SetUnitInvulnerable( GetEnteringUnit(), false )
endif
//set X = ( ( R2I(GetLocationX(l)) + 6912 ) / 10 )
//set Y = ( ( R2I(GetLocationY(l)) + 6912 ) / 10 )
//set Z = ( ( X * 10000 ) + Y )
call IssuePointOrderLoc( GetEnteringUnit(), "patrol", l )
call RemoveLocation(l)
//call SetUnitAcquireRange( GetEnteringUnit(), I2R(Z) )
endfunction
//===========================================================================
function InitTrig_Base_Entry takes nothing returns nothing
local trigger t
local integer i = 4
local rect array r
local trigger Teleporters_Move_5 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( Teleporters_Move_5, gg_rct_Deinvulnerable_1 )
call TriggerRegisterEnterRectSimple( Teleporters_Move_5, gg_rct_Deinvulnerable_2 )
call TriggerRegisterEnterRectSimple( Teleporters_Move_5, gg_rct_Deinvulnerable_3 )
call TriggerRegisterEnterRectSimple( Teleporters_Move_5, gg_rct_Deinvulnerable_4 )
call TriggerRegisterEnterRectSimple( Teleporters_Move_5, gg_rct_Deinvulnerable_5 )
call TriggerRegisterEnterRectSimple( Teleporters_Move_5, gg_rct_Deinvulnerable_6 )
call TriggerRegisterEnterRectSimple( Teleporters_Move_5, gg_rct_Deinvulnerable_7 )
call TriggerRegisterEnterRectSimple( Teleporters_Move_5, gg_rct_Deinvulnerable_8 )
call TriggerAddCondition( Teleporters_Move_5, Condition( function Trig_Teleporters_Move_5_Conditions ) )
call TriggerAddAction( Teleporters_Move_5, function Trig_Teleporters_Move_5_Actions )
//Player Locations
set udg_CirclePathing[73] = gg_rct_vanish_1
set udg_CirclePathing[74] = gg_rct_vanish_2
set udg_CirclePathing[75] = gg_rct_vanish_3
set udg_CirclePathing[76] = gg_rct_vanish_4
set udg_CirclePathing[77] = gg_rct_vanish_5
set udg_CirclePathing[78] = gg_rct_vanish_6
set udg_CirclePathing[79] = gg_rct_vanish_7
set udg_CirclePathing[80] = gg_rct_vanish_8
set udg_CirclePathing[81] = gg_rct_vanish_9
set udg_CirclePathing[82] = gg_rct_vanish_10
set udg_CirclePathing[83] = gg_rct_vanish_11
set udg_CirclePathing[84] = gg_rct_vanish_12
set udg_CirclePathing[85] = gg_rct_Teleporter_5
set udg_CirclePathing[86] = gg_rct_Teleporter_6
set udg_CirclePathing[87] = gg_rct_Teleporter_7
set udg_CirclePathing[88] = gg_rct_Teleporter_8
loop
exitwhen i > 18 * 4
if (i - 3 == 8) then
set udg_CirclePathing[i - 3] = RectFromCenterSizeBJ(GetCirclePoint(1,270 + (((i/4)-1)*15) ), 128.00, 256.00)
elseif (i - 3 == 72) then
set udg_CirclePathing[i - 3] = RectFromCenterSizeBJ(GetCirclePoint(1,270 + (((i/4)-1)*15) ), 256.00, 128.00)
else
set udg_CirclePathing[i - 3] = RectFromCenterSizeBJ(GetCirclePoint(1,270 + (((i/4)-1)*15) ), 256.00, 256.00)
endif
if (i - 2 == 69) then
set udg_CirclePathing[i - 2] = RectFromCenterSizeBJ(GetCirclePoint(2,0 + (((i/4)-1)*15) ), 128.00, 256.00)
elseif (i - 2 == 5) then
set udg_CirclePathing[i - 2] = RectFromCenterSizeBJ(GetCirclePoint(2,0 + (((i/4)-1)*15) ), 256.00, 128.00)
else
set udg_CirclePathing[i - 2] = RectFromCenterSizeBJ(GetCirclePoint(2,0 + (((i/4)-1)*15) ), 256.00, 256.00)
endif
if (i - 1 == 6) then
set udg_CirclePathing[i - 1] = RectFromCenterSizeBJ(GetCirclePoint(3,90 + (((i/4)-1)*15) ), 128.00, 256.00)
elseif (i - 1 == 70) then
set udg_CirclePathing[i - 1] = RectFromCenterSizeBJ(GetCirclePoint(3,90 + (((i/4)-1)*15) ), 256.00, 128.00)
else
set udg_CirclePathing[i - 1] = RectFromCenterSizeBJ(GetCirclePoint(3,90 + (((i/4)-1)*15) ), 256.00, 256.00)
endif
if (i - 0 == 71) then
set udg_CirclePathing[i - 0] = RectFromCenterSizeBJ(GetCirclePoint(4,180 + (((i/4)-1)*15) ), 128.00, 256.00)
elseif (i - 0 == 7) then
set udg_CirclePathing[i - 0] = RectFromCenterSizeBJ(GetCirclePoint(4,180 + (((i/4)-1)*15) ), 256.00, 128.00)
else
set udg_CirclePathing[i - 0] = RectFromCenterSizeBJ(GetCirclePoint(4,180 + (((i/4)-1)*15) ), 256.00, 256.00)
endif
set i = i + 4
endloop
set t = CreateTrigger( )
set i = 1
loop
exitwhen i > 72
call TriggerRegisterEnterRectSimple( t, udg_CirclePathing[i] )
set udg_CirclePathing[i] = RectFromCenterSizeBJ(GetRectCenter(udg_CirclePathing[i]), ( GetRectWidthBJ(udg_CirclePathing[i]) - 64.00 ), ( GetRectHeightBJ(udg_CirclePathing[i]) - 64.00 ))
//call CreateNUnitsAtLoc( 1, 'hfoo', Player(0), GetRectCenter(udg_CirclePathing[i]), bj_UNIT_FACING )
//call SetUnitUserData( GetLastCreatedUnit(), i )
//call PauseUnitBJ( true, GetLastCreatedUnit() )
set i = i + 1
endloop
call TriggerAddCondition( t, Condition( function Trig_Base_Entry_Conditions ) )
call TriggerAddAction( t, function Trig_Base_Entry_Action )
set gg_trg_Base_Entry = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Base_Entry, 10.00 )
call TriggerAddAction( gg_trg_Base_Entry, function Trig_Base_Entry_Actions )
endfunction
function Trig_Override_Neutral_Flee_Conditions takes nothing returns boolean
return (GetIssuedOrderId() != 851990)
endfunction
function Trig_Override_Neutral_Flee_Actions takes nothing returns nothing
local unit u = GetOrderedUnit()
local integer UnitEnumerator = GetUnitUserData(u)
call IssuePointOrderLoc( u, "patrol", udg_UnitPoint[UnitEnumerator] )
call TriggerSleepAction( 0.00 )
// Double check to make sure he moves
call IssuePointOrderLocBJ( u, "patrol", udg_UnitPoint[UnitEnumerator] )
endfunction
//===========================================================================
function InitTrig_Override_Neutral_Flee takes nothing returns nothing
set gg_trg_Override_Neutral_Flee = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Override_Neutral_Flee, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerAddCondition( gg_trg_Override_Neutral_Flee, Condition( function Trig_Override_Neutral_Flee_Conditions ) )
call TriggerAddAction( gg_trg_Override_Neutral_Flee, function Trig_Override_Neutral_Flee_Actions )
endfunction
function Trig_Teleporters_Move_1_Conditions takes nothing returns boolean
return ( GetOwningPlayer(GetEnteringUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) )
endfunction
function Trig_Teleporters_Move_1_Actions takes nothing returns nothing
local unit u = GetEnteringUnit()
local integer UnitEnumerator = GetUnitUserData(u)
call SetUnitPathing( u, false )
call SetUnitInvulnerable( u, false )
set udg_TempPoint = GetRectCenter(udg_CirclePathing[40])
call IssuePointOrderLocBJ( u, "patrol", udg_TempPoint )
call RemoveLocation(udg_UnitPoint[UnitEnumerator])
set udg_UnitPoint[UnitEnumerator] = GetRectCenter(udg_CirclePathing[40])
//call SetUnitManaBJ( u, 40.00 )
set udg_UnitRegion[UnitEnumerator] = 40
if ( udg_UnitTarget[UnitEnumerator] == 10 ) then
call SetUnitInvulnerable( u, true )
endif
if ( udg_UnitTarget[UnitEnumerator] == 11 ) then
call SetUnitInvulnerable( u, true )
endif
call RemoveLocation(udg_TempPoint)
endfunction
//===========================================================================
function InitTrig_Teleporters_Move_1 takes nothing returns nothing
set gg_trg_Teleporters_Move_1 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Teleporters_Move_1, gg_rct_Teleporter_4 )
call TriggerAddCondition( gg_trg_Teleporters_Move_1, Condition( function Trig_Teleporters_Move_1_Conditions ) )
call TriggerAddAction( gg_trg_Teleporters_Move_1, function Trig_Teleporters_Move_1_Actions )
endfunction
function Trig_Teleporters_Move_2_Conditions takes nothing returns boolean
return ( GetOwningPlayer(GetEnteringUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) )
endfunction
function Trig_Teleporters_Move_2_Actions takes nothing returns nothing
local unit u = GetEnteringUnit()
local integer UnitEnumerator = GetUnitUserData(u)
call SetUnitPathing( u, false )
call SetUnitInvulnerable( u, false )
set udg_TempPoint = GetRectCenter(udg_CirclePathing[37])
call IssuePointOrderLocBJ( u, "patrol", udg_TempPoint )
call RemoveLocation(udg_UnitPoint[UnitEnumerator])
set udg_UnitPoint[UnitEnumerator] = GetRectCenter(udg_CirclePathing[37])
//call SetUnitManaBJ( u, 37.00 )
set udg_UnitRegion[UnitEnumerator] = 37
if ( udg_UnitTarget[UnitEnumerator] == 9 ) then
call SetUnitInvulnerable( u, true )
endif
if ( udg_UnitTarget[UnitEnumerator] == 10 ) then
call SetUnitInvulnerable( u, true )
endif
call RemoveLocation(udg_TempPoint)
endfunction
//===========================================================================
function InitTrig_Teleporters_Move_2 takes nothing returns nothing
set gg_trg_Teleporters_Move_2 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Teleporters_Move_2, gg_rct_Teleporter_3 )
call TriggerAddCondition( gg_trg_Teleporters_Move_2, Condition( function Trig_Teleporters_Move_2_Conditions ) )
call TriggerAddAction( gg_trg_Teleporters_Move_2, function Trig_Teleporters_Move_2_Actions )
endfunction
function Trig_Teleporters_Move_3_Conditions takes nothing returns boolean
return ( GetOwningPlayer(GetEnteringUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) )
endfunction
function Trig_Teleporters_Move_3_Actions takes nothing returns nothing
local unit u = GetEnteringUnit()
local integer UnitEnumerator = GetUnitUserData(u)
call SetUnitPathing( u, false )
call SetUnitInvulnerable( u, false )
set udg_TempPoint = GetRectCenter(udg_CirclePathing[38])
call IssuePointOrderLocBJ( u, "patrol", udg_TempPoint )
call RemoveLocation(udg_UnitPoint[UnitEnumerator])
set udg_UnitPoint[UnitEnumerator] = GetRectCenter(udg_CirclePathing[38])
//call SetUnitManaBJ( u, 38.00 )
set udg_UnitRegion[UnitEnumerator] = 38
if ( udg_UnitTarget[UnitEnumerator] == 9 ) then
call SetUnitInvulnerable( u, true )
endif
if ( udg_UnitTarget[UnitEnumerator] == 12 ) then
call SetUnitInvulnerable( u, true )
endif
call RemoveLocation(udg_TempPoint)
endfunction
//===========================================================================
function InitTrig_Teleporters_Move_3 takes nothing returns nothing
set gg_trg_Teleporters_Move_3 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Teleporters_Move_3, gg_rct_Teleporter_2 )
call TriggerAddCondition( gg_trg_Teleporters_Move_3, Condition( function Trig_Teleporters_Move_3_Conditions ) )
call TriggerAddAction( gg_trg_Teleporters_Move_3, function Trig_Teleporters_Move_3_Actions )
endfunction
function Trig_Teleporters_Move_4_Conditions takes nothing returns boolean
return ( GetOwningPlayer(GetEnteringUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) )
endfunction
function Trig_Teleporters_Move_4_Actions takes nothing returns nothing
local unit u = GetEnteringUnit()
local integer UnitEnumerator = GetUnitUserData(u)
call SetUnitPathing( u, false )
call SetUnitInvulnerable( u, false )
set udg_TempPoint = GetRectCenter(udg_CirclePathing[39])
call IssuePointOrderLocBJ( u, "patrol", udg_TempPoint )
call RemoveLocation(udg_UnitPoint[UnitEnumerator])
set udg_UnitPoint[UnitEnumerator] = GetRectCenter(udg_CirclePathing[39])
//call SetUnitManaBJ( u, 39.00 )
set udg_UnitRegion[UnitEnumerator] = 39
if ( udg_UnitTarget[UnitEnumerator] == 11 ) then
call SetUnitInvulnerable( u, true )
endif
if ( udg_UnitTarget[UnitEnumerator] == 12 ) then
call SetUnitInvulnerable( u, true )
endif
call RemoveLocation(udg_TempPoint)
endfunction
//===========================================================================
function InitTrig_Teleporters_Move_4 takes nothing returns nothing
set gg_trg_Teleporters_Move_4 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Teleporters_Move_4, gg_rct_Teleporter_1 )
call TriggerAddCondition( gg_trg_Teleporters_Move_4, Condition( function Trig_Teleporters_Move_4_Conditions ) )
call TriggerAddAction( gg_trg_Teleporters_Move_4, function Trig_Teleporters_Move_4_Actions )
endfunction
function Trig_Vanish_Conditions takes nothing returns boolean
return ( GetOwningPlayer(GetEnteringUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) )
endfunction
function Trig_Vanish_Actions takes nothing returns nothing
local unit u = GetEnteringUnit()
local integer UnitEnumerator = GetUnitUserData(u)
local integer i = 1
local effect e
set udg_Dummy[udg_UnitTarget[UnitEnumerator]] = ( udg_Dummy[udg_UnitTarget[UnitEnumerator]] + 1 )
call ErrorMessage2(ConvertedPlayer(udg_UnitTarget[UnitEnumerator]), I2S(50-udg_Dummy[udg_UnitTarget[UnitEnumerator]]) + " Lives left" )
call TriggerExecute( gg_trg_Player_Loose )
set udg_TempPoint = GetUnitLoc(u)
call AddSpecialEffectLocBJ( udg_TempPoint, "Abilities\\Weapons\\GlaiveMissile\\GlaiveMissileTarget.mdl" )
set e = GetLastCreatedEffectBJ()
call RemoveLocation(udg_TempPoint)
call GroupRemoveUnitSimple( u, udg_WaveGroup )
call TriggerExecute( gg_trg_Multiboard_Update_Lives )
loop
exitwhen i > 6
call RemoveItem( UnitItemInSlotBJ(u, i) )
set i = i + 1
endloop
call SetUnitUserData( u, 0 )
call UnitRemoveAbilityBJ( 'A0DR', u )
call UnitRemoveAbilityBJ( 'A0C6', u )
call UnitRemoveAbilityBJ( 'A0CB', u )
call UnitRemoveAbilityBJ( 'A0CY', u )
call UnitRemoveAbilityBJ( 'A0CZ', u )
call UnitRemoveAbilityBJ( 'A0D0', u )
call KillUnit( u )
call DestroyEffectBJ( e )
endfunction
//===========================================================================
function InitTrig_Vanish takes nothing returns nothing
local integer i = 73
set gg_trg_Vanish = CreateTrigger( )
loop
exitwhen i > 84
call TriggerRegisterEnterRectSimple( gg_trg_Vanish, udg_CirclePathing[i] )
set i = i + 1
endloop
call TriggerAddCondition( gg_trg_Vanish, Condition( function Trig_Vanish_Conditions ) )
call TriggerAddAction( gg_trg_Vanish, function Trig_Vanish_Actions )
endfunction