//TESH.scrollpos=56
//TESH.alwaysfold=0
//library AntiCPConfig initializer Init //requires
//****************************************************************************
//
// | Anti-CheatPack Configuration Functions by saw792 |
//
// Configuration Instructions:
//
// 1. Uncomment the 'requires' line above these instructions
// 2. Add in the name of every library in your map separated by ,
// NB: If you have no vJASS libraries in your map ignore these two steps
// 3. Enable this trigger
// 4. Save your map
// 5. Click 'Test Map' and write down the number that is displayed
// once the game starts (Handle Count: ...)
// 6. Exit the game
// 7. Disable this library
// 8. Keep this library within your map
// 9. Repeat these instruction every time you save a final version
//
//****************************************************************************
//private function T2I takes trigger t returns integer
// return GetHandleId( t )
//endfunction
//private function Init takes nothing returns nothing
// local trigger t = CreateTrigger()
// call BJDebugMsg("Handle Count: " + I2S(T2I(t) - 1048584))
// call DestroyTrigger(t)
// endfunction
//endlibrary
//===================================================================================================================\\
//===============================================GAME FUNCTIONS======================================================\\
//===================================================================================================================\\
// spawn 1 creep every 0.05 second, 45 creep = 2.25 seeconds
// after fully spawn, move creep & warp summon
function CreateCreepWavePeriod takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer max = udg_LevelWaveCount_Integer[udg_Level_Integer] // spawn qty for each wave
local integer n = 1 // spawn 1 each time
local integer uID = udg_Level_UnitType[udg_Level_Integer]
local location p
local rect r
//= Location(GetRandomReal(GetRectMinX(gg_rct_Creep_1), GetRectMaxX(gg_rct_Creep_1)), GetRandomReal(GetRectMinY(gg_rct_Creep_1), GetRectMaxY(gg_rct_Creep_1)))
if(udg_PeriodSpawnCount >= max) then
call PauseTimer(t)
set udg_PeriodSpawnCount = 0
// finish spawn
//call TriggerExecute( gg_trg_Unpause_Attackers )
//call TriggerExecute( gg_trg_Warp_Summons )
//call TriggerExecute( gg_trg_Spawn_Start_Move )
return
endif
if (udg_doSpawn1) then
// spawn unit at random point of spawn pad
set r = gg_rct_Creep_1 // spawn point 1
set p = Location(GetRandomReal(GetRectMinX(r), GetRectMaxX(r)), GetRandomReal(GetRectMinY(r), GetRectMaxY(r)))
set bj_lastCreatedUnit = CreateUnitAtLoc(Player(10), uID, p, bj_UNIT_FACING)
// add unit to group, order to attack
call SetUnitUserData( bj_lastCreatedUnit, 1 ) // set custom value to 1
call GroupAddUnit(udg_Creeps_UnitGroup, bj_lastCreatedUnit) // Creep Group 1
call GroupAddUnit(udg_CreepsLeft[1], bj_lastCreatedUnit) // 1 = west, 2 =east
call GroupAddUnit(udg_CreepSpawnPoint[1], bj_lastCreatedUnit) // spawn creep 1
call IssuePointOrderLoc( bj_lastCreatedUnit, "attack", udg_PathingPointArray[1] ) // pathing
//call UnitAddAbility(bj_lastCreatedUnit, 'A0BO' )
//call CreateNUnitsAtLoc( n, udg_Level_UnitType[udg_Level_Integer], Player(10), udg_Spawn1, bj_UNIT_FACING )
//call SetUnitMoveSpeed( GetLastCreatedUnit(), 0.00 )
endif
if (udg_doSpawn2) then
// spawn unit at random point of spawn pad
set r = gg_rct_Creep_2 // spawn point 2
set p = Location(GetRandomReal(GetRectMinX(r), GetRectMaxX(r)), GetRandomReal(GetRectMinY(r), GetRectMaxY(r)))
set bj_lastCreatedUnit = CreateUnitAtLoc(Player(10), uID, p, bj_UNIT_FACING)
// add unit to group, order to attack
call SetUnitUserData( bj_lastCreatedUnit, 2 ) // set custom value to 2
call GroupAddUnit(udg_Creeps_UnitGroup, bj_lastCreatedUnit) // Creep Group
call GroupAddUnit(udg_CreepsLeft[1], bj_lastCreatedUnit) // 1 = west, 2 =east
call GroupAddUnit(udg_CreepSpawnPoint[2], bj_lastCreatedUnit) // spawn creep 2
call IssuePointOrderLoc( bj_lastCreatedUnit, "attack", udg_PathingPointArray[2] ) // pathing 2
endif
if (udg_doSpawn3) then
// spawn unit at random point of spawn pad
set r = gg_rct_Creep_3 // spawn point 3
set p = Location(GetRandomReal(GetRectMinX(r), GetRectMaxX(r)), GetRandomReal(GetRectMinY(r), GetRectMaxY(r)))
set bj_lastCreatedUnit = CreateUnitAtLoc(Player(10), uID, p, bj_UNIT_FACING)
// add unit to group, order to attack
call SetUnitUserData( bj_lastCreatedUnit, 3 ) // set custom value to 3
call GroupAddUnit(udg_Creeps_UnitGroup, bj_lastCreatedUnit) // Creep Group
call GroupAddUnit(udg_CreepsLeft[1], bj_lastCreatedUnit) // 1 = west, 2 =east
call GroupAddUnit(udg_CreepSpawnPoint[3], bj_lastCreatedUnit) // spawn creep 3
call IssuePointOrderLoc( bj_lastCreatedUnit, "attack", udg_PathingPointArray[3] ) // pathing 3
endif
if (udg_doSpawn4) then
// spawn unit at random point of spawn pad
set r = gg_rct_Creep_4 // spawn point 4
set p = Location(GetRandomReal(GetRectMinX(r), GetRectMaxX(r)), GetRandomReal(GetRectMinY(r), GetRectMaxY(r)))
set bj_lastCreatedUnit = CreateUnitAtLoc(Player(10), uID, p, bj_UNIT_FACING)
// add unit to group, order to attack
call SetUnitUserData( bj_lastCreatedUnit, 4 ) // set custom value to 4
call GroupAddUnit(udg_Creeps_UnitGroup, bj_lastCreatedUnit) // Creep Group
call GroupAddUnit(udg_CreepsLeft[1], bj_lastCreatedUnit) // 1 = west, 2 =east
call GroupAddUnit(udg_CreepSpawnPoint[4], bj_lastCreatedUnit) // spawn creep 4
call IssuePointOrderLoc( bj_lastCreatedUnit, "attack", udg_PathingPointArray[4] ) // pathing 4
endif
if (udg_doSpawn5) then
// spawn unit at random point of spawn pad
set r = gg_rct_Creep_5 // spawn point 5
set p = Location(GetRandomReal(GetRectMinX(r), GetRectMaxX(r)), GetRandomReal(GetRectMinY(r), GetRectMaxY(r)))
set bj_lastCreatedUnit = CreateUnitAtLoc(Player(11), uID, p, bj_UNIT_FACING)
// add unit to group, order to attack
call SetUnitUserData( bj_lastCreatedUnit, 5 ) // set custom value to 5
call GroupAddUnit(udg_Creeps_UnitGroup, bj_lastCreatedUnit) // Creep Group
call GroupAddUnit(udg_CreepsLeft[2], bj_lastCreatedUnit) // 1 = west, 2 =east
call GroupAddUnit(udg_CreepSpawnPoint[5], bj_lastCreatedUnit) // spawn creep 5
call IssuePointOrderLoc( bj_lastCreatedUnit, "attack", udg_PathingPointArray[5] ) // pathing 5
endif
if (udg_doSpawn6) then
// spawn unit at random point of spawn pad
set r = gg_rct_Creep_6 // spawn point 6
set p = Location(GetRandomReal(GetRectMinX(r), GetRectMaxX(r)), GetRandomReal(GetRectMinY(r), GetRectMaxY(r)))
set bj_lastCreatedUnit = CreateUnitAtLoc(Player(11), uID, p, bj_UNIT_FACING)
// add unit to group, order to attack
call SetUnitUserData( bj_lastCreatedUnit, 6 ) // set custom value to 6
call GroupAddUnit(udg_Creeps_UnitGroup, bj_lastCreatedUnit) // Creep Group
call GroupAddUnit(udg_CreepsLeft[2], bj_lastCreatedUnit) // 1 = west, 2 =east
call GroupAddUnit(udg_CreepSpawnPoint[6], bj_lastCreatedUnit) // spawn creep 6
call IssuePointOrderLoc( bj_lastCreatedUnit, "attack", udg_PathingPointArray[6] ) // pathing 6
endif
if (udg_doSpawn7) then
// spawn unit at random point of spawn pad
set r = gg_rct_Creep_7 // spawn point 7
set p = Location(GetRandomReal(GetRectMinX(r), GetRectMaxX(r)), GetRandomReal(GetRectMinY(r), GetRectMaxY(r)))
set bj_lastCreatedUnit = CreateUnitAtLoc(Player(11), uID, p, bj_UNIT_FACING)
// add unit to group, order to attack
call SetUnitUserData( bj_lastCreatedUnit, 7 ) // set custom value to 7
call GroupAddUnit(udg_Creeps_UnitGroup, bj_lastCreatedUnit) // Creep Group
call GroupAddUnit(udg_CreepsLeft[2], bj_lastCreatedUnit) // 1 = west, 2 =east
call GroupAddUnit(udg_CreepSpawnPoint[7], bj_lastCreatedUnit) // spawn creep 7
call IssuePointOrderLoc( bj_lastCreatedUnit, "attack", udg_PathingPointArray[7] ) // pathing 7
endif
if (udg_doSpawn8) then
// spawn unit at random point of spawn pad
set r = gg_rct_Creep_8 // spawn point 8
set p = Location(GetRandomReal(GetRectMinX(r), GetRectMaxX(r)), GetRandomReal(GetRectMinY(r), GetRectMaxY(r)))
set bj_lastCreatedUnit = CreateUnitAtLoc(Player(11), uID, p, bj_UNIT_FACING)
// add unit to group, order to attack
call SetUnitUserData( bj_lastCreatedUnit, 8 ) // set custom value to 8
call GroupAddUnit(udg_Creeps_UnitGroup, bj_lastCreatedUnit) // Creep Group
call GroupAddUnit(udg_CreepsLeft[2], bj_lastCreatedUnit) // 1 = west, 2 =east
call GroupAddUnit(udg_CreepSpawnPoint[8], bj_lastCreatedUnit) // spawn creep 8
call IssuePointOrderLoc( bj_lastCreatedUnit, "attack", udg_PathingPointArray[8] ) // pathing 8
endif
// update udg_PeriodSpawnCount
set udg_PeriodSpawnCount = udg_PeriodSpawnCount + n
// clear leaked
set t=null
set p = null
call RemoveLocation(p)
endfunction
function CreateCreepWaveTimer takes nothing returns nothing
if(udg_Level_Integer == 31) then
call TimerStart(udg_PeriodSpawnTimer, 0.5, true, function CreateCreepWavePeriod)
else
call TimerStart(udg_PeriodSpawnTimer, 0.10, true, function CreateCreepWavePeriod)
endif
endfunction
// OLD spawn code, NOT USE
function CreateCreepWave takes nothing returns nothing
local integer n = udg_LevelWaveCount_Integer[udg_Level_Integer]
if (udg_doSpawn1) then
call CreateNUnitsAtLoc( n, udg_Level_UnitType[udg_Level_Integer], Player(10), udg_Spawn1, bj_UNIT_FACING )
endif
if (udg_doSpawn2) then
call CreateNUnitsAtLoc( n, udg_Level_UnitType[udg_Level_Integer], Player(10), udg_Spawn2, bj_UNIT_FACING )
endif
if (udg_doSpawn3) then
call CreateNUnitsAtLoc( n, udg_Level_UnitType[udg_Level_Integer], Player(10), udg_Spawn3, bj_UNIT_FACING )
endif
if (udg_doSpawn4) then
call CreateNUnitsAtLoc( n, udg_Level_UnitType[udg_Level_Integer], Player(10), udg_Spawn4, bj_UNIT_FACING )
endif
if (udg_doSpawn5) then
call CreateNUnitsAtLoc( n, udg_Level_UnitType[udg_Level_Integer], Player(11), udg_Spawn5, bj_UNIT_FACING )
endif
if (udg_doSpawn6) then
call CreateNUnitsAtLoc( n, udg_Level_UnitType[udg_Level_Integer], Player(11), udg_Spawn6, bj_UNIT_FACING )
endif
if (udg_doSpawn7) then
call CreateNUnitsAtLoc( n, udg_Level_UnitType[udg_Level_Integer], Player(11), udg_Spawn7, bj_UNIT_FACING )
endif
if (udg_doSpawn8) then
call CreateNUnitsAtLoc( n, udg_Level_UnitType[udg_Level_Integer], Player(11), udg_Spawn8, bj_UNIT_FACING )
endif
endfunction
function CreateCreepWaveBonus takes nothing returns nothing
local integer n = 5
if (udg_ModeX3 == true ) then
set n=15
endif
if (udg_doSpawn1) then
call CreateNUnitsAtLoc( n, udg_bonusUnitType, Player(10), udg_Spawn1, bj_UNIT_FACING )
endif
if (udg_doSpawn2) then
call CreateNUnitsAtLoc( n, udg_bonusUnitType, Player(10), udg_Spawn2, bj_UNIT_FACING )
endif
if (udg_doSpawn3) then
call CreateNUnitsAtLoc( n, udg_bonusUnitType, Player(10), udg_Spawn3, bj_UNIT_FACING )
endif
if (udg_doSpawn4) then
call CreateNUnitsAtLoc( n, udg_bonusUnitType, Player(10), udg_Spawn4, bj_UNIT_FACING )
endif
if (udg_doSpawn5) then
call CreateNUnitsAtLoc( n, udg_bonusUnitType, Player(11), udg_Spawn5, bj_UNIT_FACING )
endif
if (udg_doSpawn6) then
call CreateNUnitsAtLoc( n, udg_bonusUnitType, Player(11), udg_Spawn6, bj_UNIT_FACING )
endif
if (udg_doSpawn7) then
call CreateNUnitsAtLoc( n, udg_bonusUnitType, Player(11), udg_Spawn7, bj_UNIT_FACING )
endif
if (udg_doSpawn8) then
call CreateNUnitsAtLoc( n, udg_bonusUnitType, Player(11), udg_Spawn8, bj_UNIT_FACING )
endif
endfunction
//===================================================================================================================\\
//===========================================CONVENIENCE FUNCTIONS===================================================\\
//===================================================================================================================\\
//* Generate Integer Array from String in list format (,val,val,val,val,val,etc)
function getIntValueFromListIndex takes string listToCheck, integer indexToEvaluate returns integer
local string str = listToCheck
local integer startPosOfVal = 0
local integer endPosOfVal = 0
local integer valueAtThisIndex
local integer readerPos = 0
local integer end = StringLength(str)
local integer readerPos2 = 0
local integer spacesToSkip = indexToEvaluate-1
//call BJDebugMsg("Commas to skip = " + I2S(spacesToSkip))
//Index needs to check the multiple of delineators not just raw char spaces!!!
loop
exitwhen readerPos > end
if ( SubString(str, readerPos-1, readerPos) == "," ) then
if ( spacesToSkip <= 0 ) then
set startPosOfVal = readerPos
set readerPos2 = startPosOfVal + 1
loop
exitwhen readerPos2 > end
if ( SubString(str, readerPos2-1, readerPos2) == "," and endPosOfVal == 0 ) then
set endPosOfVal = readerPos2
endif
set readerPos2 = readerPos2 + 1
endloop
set valueAtThisIndex = S2I(SubString(str, startPosOfVal, endPosOfVal - 1))
return valueAtThisIndex
else
set spacesToSkip = spacesToSkip - 1
endif
endif
set readerPos = readerPos + 1
endloop
//-1 denotes an error
return -1
endfunction
//*Floating Text Above Unit For Player
function showUnitTextPlayer takes unit u, string s, real valRed, real valGreen, real valBlue, player pl returns nothing
local texttag t
local force f
local location p
if (u == null) then
return
endif
//creation
set p = GetUnitLoc(u)
set t = CreateTextTagLocBJ(s, p, 0, 10, valRed, valGreen, valBlue, 0)
set f = GetForceOfPlayer(pl)
//setup
call SetTextTagLifespanBJ(t, 3)
call SetTextTagPermanentBJ(t, false)
call SetTextTagFadepointBJ(t, 2)
call SetTextTagVelocityBJ(t, 40, 90)
call ShowTextTagForceBJ(false, t, GetPlayersAll() )
call ShowTextTagForceBJ(true, t, f)
//cleanup
set t = null
set f = null
set p = null
endfunction
//*Floating Text Above Unit For Player
function showUnitTextAll takes unit u, string s, real valRed, real valGreen, real valBlue, real size returns nothing
local texttag t
local force f
local location p
local location p2
if (u == null) then
return
endif
//creation
set p = GetUnitLoc(u)
set t = CreateTextTagLocBJ(s, p, 0, size, valRed, valGreen, valBlue, 0)
set f = GetPlayersAll()
//setup
call SetTextTagLifespanBJ(t, 2)
call SetTextTagPermanentBJ(t, false)
call SetTextTagFadepointBJ(t, 1)
call SetTextTagVelocityBJ(t, 40, 90)
call ShowTextTagForceBJ(false, t, GetPlayersAll() )
call ShowTextTagForceBJ(true, t, f)
//cleanup
call RemoveLocation(p)
set t = null
set f = null
set p = null
endfunction
function showUnitTextAllWithZ takes unit u, string s, real valRed, real valGreen, real valBlue, real size, real zOffset returns nothing
local texttag t
local force f
local location p
local location p2
if (u == null) then
return
endif
//creation
set p = GetUnitLoc(u)
set t = CreateTextTagLocBJ(s, p, zOffset, size, valRed, valGreen, valBlue, 0)
set f = GetPlayersAll()
//setup
call SetTextTagLifespanBJ(t, 2)
call SetTextTagPermanentBJ(t, false)
call SetTextTagFadepointBJ(t, 1)
call SetTextTagVelocityBJ(t, 40, 90)
call ShowTextTagForceBJ(false, t, GetPlayersAll() )
call ShowTextTagForceBJ(true, t, f)
//cleanup
set t = null
set f = null
set p = null
endfunction
function showUnitTextAlliesWithZ takes unit u, string s, real valRed, real valGreen, real valBlue, real size, real zOffset, player pl returns nothing
local texttag t
local force f2
local location p
local location p2
if (u == null) then
return
endif
//creation
set p = GetUnitLoc(u)
set t = CreateTextTagLocBJ(s, p, zOffset, size, valRed, valGreen, valBlue, 0)
set f2 = GetPlayersEnemies(pl)
//setup
call SetTextTagLifespanBJ(t, 2)
call SetTextTagPermanentBJ(t, false)
call SetTextTagFadepointBJ(t, 1)
call SetTextTagVelocityBJ(t, 40, 90)
call ShowTextTagForceBJ(true, t, GetPlayersAllies(pl) )
call ShowTextTagForceBJ(false, t, f2)
//cleanup
set t = null
set f2 = null
set p = null
set pl = null
endfunction
function showLocTextAllies takes location p, string s, real valRed, real valGreen, real valBlue, player pl returns texttag
local texttag t
local force f
local force f2
//creation
set t = CreateTextTagLocBJ(s, p, 0, 10, valRed, valGreen, valBlue, 0)
set f = GetForceOfPlayer(pl)
set f2 = GetPlayersEnemies(pl)
//setup
call SetTextTagPermanentBJ(t, true)
call ShowTextTagForceBJ(true, t, GetPlayersAllies(pl) )
call ShowTextTagForceBJ(false, t, f)
call ShowTextTagForceBJ(false, t, f2)
//cleanup
set f = null
set f2 = null
set p = null
set pl = null
//return
return t
endfunction
function formatListString takes string str returns string
local integer a = 1 //start on the first character to skip the initial comma
local integer b = StringLength(str)
local string formattedStr = ""
loop
exitwhen a > b
if (SubString(str, a, a+1) != "0" or SubString(str, a-1, a) != ",") then
if (SubString(str, a, a+1) == ",") then
set formattedStr = formattedStr + ", "
else
set formattedStr = formattedStr + SubString(str, a, a+1)
endif
endif
set a = a + 1
endloop
return formattedStr
endfunction
function getRandomIntExcept takes integer lowBound, integer highBound, integer exception returns integer
local integer r = exception
loop
exitwhen r != exception
set r = GetRandomInt(lowBound, highBound)
endloop
return r
endfunction
//======================================
// function below will make sure "orb" is working
// to use it, call Fight_Startd_Events()
//======================================
function Unpause_Fighters takes nothing returns nothing
local unit u = GetTriggerUnit()
//
if (IsUnitInGroup(u, udg_Unpause_Group) or udg_WarpReady == true) then
// 851983 = attack
call IssuePointOrderByIdLoc(u, 851983, udg_SpawnArr[GetUnitUserData(u)])
//call DisplayTimedTextToForce( GetPlayersAll(), 30, ( ( GetUnitName(u) + "'s unpause:: " ) + I2S(GetUnitUserData(u)) ) )
call GroupRemoveUnit(udg_Unpause_Group, u)
set udg_Unpause_Counter = udg_Unpause_Counter - 1
//call SetUnitMoveSpeed(u, GetUnitDefaultMoveSpeed(u))
// destroy trigger if group is empty
//if 0 == udg_Unpause_Counter then
// call DestroyTrigger(udg_Trig)
//endif
endif
set u = null
//call IssuePointOrderLoc(GetTriggerUnit(), "attack", udg_PathingPointArray[GetUnitUserData(GetTriggerUnit())])
endfunction
function Add_Events_Function takes nothing returns nothing
call TriggerRegisterUnitEvent(udg_Trig, GetEnumUnit(), EVENT_UNIT_ACQUIRED_TARGET)
call GroupAddUnit(udg_Unpause_Group, GetEnumUnit()) //copies the group to udg_Unpause_Group
set udg_Unpause_Counter = udg_Unpause_Counter + 1
endfunction
function Fight_Startd_Events takes nothing returns nothing
call DestroyTrigger(udg_Trig)
set udg_Trig = CreateTrigger()
set udg_Unpause_Counter = 0
call ForGroup(udg_Fighter_Group, function Add_Events_Function)
call TriggerAddAction(udg_Trig, function Unpause_Fighters )
endfunction
Name | Type | is_array | initial_value |
AdvanceBarrack | unit | Yes | |
AirList | string | No | |
AntiStuckGroup | group | No | |
ArenaPointArray | location | Yes | |
ATKChaosList | string | No | |
ATKMagicList | string | No | |
ATKNormalList | string | No | |
ATKPierceList | string | No | |
ATKSiegeList | string | No | |
BaseSpawn | location | Yes | |
Beta_Lag | boolean | Yes | |
Beta_Version | boolean | No | |
Board | leaderboard | No | |
bonusUnitType | unitcode | No | |
BossList | string | No | |
BuildAll | boolean | No | |
Builder_Unit | unit | Yes | |
BuilderEast | unit | Yes | |
BuilderHeal | boolean | Yes | |
BuilderType | unitcode | Yes | |
BuilderWest | unit | Yes | |
CatastropheGroup | group | No | |
Cheat_count | integer | No | |
Column1Icon | string | No | |
Column1Title | string | No | |
Column1Width | real | No | |
Column2Icon | string | No | |
Column2Title | string | No | |
Column2Width | real | No | |
command | string | No | |
ConstructingTowers | group | No | |
Cost_Farm | integer | No | |
Cost_King | integer | No | |
Cost_Other | integer | No | |
Cost_Upgrade | integer | No | |
Creeps_UnitGroup | group | No | |
CreepsLeft | group | Yes | |
CreepsLeftColor | string | No | |
CreepsLeftColor_String | string | No | |
CreepsLeftCount | integer | Yes | |
CreepSpawnMove | group | Yes | |
CreepSpawnPoint | group | Yes | |
CreepsPerWave | integer | No | |
DebugMode | boolean | No | |
DEFFortifiedList | string | No | |
DEFHeavyList | string | No | |
DEFLightList | string | No | |
DEFMediumList | string | No | |
DEFUnarmoredList | string | No | |
DialogCancel | button | No | |
DialogKick | dialog | No | |
DialogKickPlayer | integer | No | |
DialogNo | button | No | |
DialogNull | button | No | |
DialogPlayer | button | Yes | |
DialogVote | dialog | No | |
DialogYes | button | No | |
DoneSelectRaceDR | boolean | Yes | |
doSpawn1 | boolean | No | |
doSpawn2 | boolean | No | |
doSpawn3 | boolean | No | |
doSpawn4 | boolean | No | |
doSpawn5 | boolean | No | |
doSpawn6 | boolean | No | |
doSpawn7 | boolean | No | |
doSpawn8 | boolean | No | |
doWarp | boolean | Yes | |
DR_Timer | timer | No | |
DR_TimerWindow | timerdialog | No | |
DRSelected | unit | No | |
DRSubTxt | texttag | No | |
DRTxt | texttag | No | |
DRTxtCol | boolean | No | |
DummyBuildings | location | No | |
EndScoreboard | multiboard | No | |
EndScoresCategoryColor | string | No | |
endScoresRows | integer | No | |
EntangleUsed | boolean | Yes | |
EntrapUsed | boolean | Yes | |
Fighter_East | group | No | |
Fighter_Group | group | No | |
Fighter_Group_Player | group | Yes | |
Fighter_King_LEFT | group | No | |
Fighter_King_RIGHT | group | No | |
Fighter_West | group | No | |
FighterLeftCount | integer | Yes | |
FightersValue | integer | Yes | |
FightersValueSummon | integer | Yes | |
FightStart | boolean | No | |
GameEnded_Boolean | boolean | No | |
GameInit | boolean | No | |
GameMode_String | string | No | |
GameTimer | timer | No | |
GameTimer_Window | timerdialog | No | |
GoldFromIncome | integer | Yes | |
GoldFromKills | integer | Yes | |
Handicap1 | boolean | No | |
Handicap2 | boolean | No | |
Handicap3 | boolean | No | |
Handicap4 | boolean | No | |
HCL_Mode | boolean | No | false |
Hire_Group | group | No | |
i | integer | No | |
inBonusRound | boolean | No | |
Income_msg | boolean | No | true |
Income_String | string | No | |
IngamePlayers_forMultiboard | force | No | |
IngamePlayers_PlayerGroup | force | No | |
InRound | boolean | No | |
InRound_Completely | boolean | No | |
KillsColor | string | No | |
KillsColor_String | string | No | |
KingAbilities | abilcode | Yes | |
KingAttacking | boolean | No | |
KingPlayer | player | Yes | |
KingTimerL | integer | No | |
KingTimerR | integer | No | |
LAutocastOn | boolean | No | |
Leaked_Bount_Perc | real | Yes | 0.00 |
Leaks | integer | Yes | |
LeaksCaught | integer | Yes | |
LeaveTime | string | Yes | |
LeftOrRight | integer | No | |
LeftOrRight_2 | integer | No | |
LeftTeamAlive | boolean | No | |
Level_10 | boolean | No | |
Level_15 | boolean | No | |
Level_31_Timer | real | No | 60.00 |
Level_EndRoundGold | integer | Yes | |
Level_Income_Cap | integer | Yes | |
Level_Integer | integer | No | |
Level_TimeToPrepare | integer | Yes | |
Level_UnitType | unitcode | Yes | |
LevelArmor_String | string | Yes | |
LevelATKType_String | string | Yes | |
LevelAttack_String | string | Yes | |
LevelBounty_Integer | integer | Yes | |
LevelBountyList | string | No | |
LevelDEFType_String | string | Yes | |
LevelDescript_String | string | Yes | |
LevelWaveCount_Integer | integer | Yes | |
LevelWaveCountList | string | No | |
LKing | location | No | |
LKingAbilitiesLearned | integer | No | |
LKingLowHPCounter | integer | No | |
LKingSpawnPt | location | No | |
LMidCenter | location | No | |
LMidLeft | location | No | |
LMidRight | location | No | |
MapName_String | string | No | |
MapName_String_short | string | No | |
MapVersion_String | string | No | |
MaxLevel_Integer | integer | No | |
MendUsed | boolean | Yes | |
MindWarpUsed | boolean | Yes | |
Minutes | string | No | |
ModeAP | boolean | No | |
ModeAR | boolean | No | |
ModeCB | boolean | No | |
ModeFR | boolean | No | |
ModeGG | boolean | No | |
ModeHG | boolean | No | |
ModeHP | boolean | No | |
ModeLI | boolean | No | |
ModeMM | boolean | No | |
ModeNM | boolean | No | |
ModePrimary | boolean | No | |
ModeRD | boolean | No | |
ModeSD | boolean | No | |
ModeSM | boolean | No | |
ModeString | string | No | |
modeTxt | texttag | No | |
modeTxt2 | texttag | No | |
ModeX3 | boolean | No | |
mostIncome | player | No | |
mostKills | player | No | |
mostLeaked | player | No | |
mostLumber | player | No | |
mostSummons | player | No | |
mostValuePlayer | player | No | |
NewlyBuiltTowers | group | No | |
nextIncomeLevel | integer | No | |
noIncome | boolean | No | |
numArrayEndArtic | integer | No | |
numArrayEndBeast | integer | No | |
numArrayEndDemiHuman | integer | No | |
numArrayEndElement | integer | No | |
numArrayEndElf | integer | No | |
numArrayEndGhost | integer | No | |
numArrayEndGoblin | integer | No | |
numArrayEndHybrid | integer | No | |
numArrayEndMarine | integer | No | |
numArrayEndMech | integer | No | |
numArrayEndNature | integer | No | |
numArrayEndOrc | integer | No | |
numArrayEndPaladin | integer | No | |
numArrayEndShadow | integer | No | |
numArrayEndUndead | integer | No | |
NumberOfHours | integer | No | |
NumberOfMinutes | integer | No | |
NumberOfSeconds | integer | No | |
numberOfSummons | integer | Yes | |
numKingAbilities | integer | No | |
numRaces | integer | No | |
numTowers | integer | No | |
numWorkers | integer | Yes | |
onBonusLevel | boolean | No | |
PathingPointArray | location | Yes | |
PeriodSpawnCount | integer | No | |
PeriodSpawnTimer | timer | No | |
PickingPlayerRD | player | No | |
PlayerColor | string | Yes | |
PlayerColor_String | string | Yes | |
PlayerEast | integer | No | |
PlayerFoodUsedMax | integer | Yes | |
PlayerIncome | integer | Yes | |
PlayerKills_Integer | integer | Yes | |
PlayerRaceIcon | string | Yes | |
PlayerRaceTotal | string | Yes | |
PlayerTime | integer | Yes | |
PlayerTowersBuilt | integer | Yes | |
PlayerWest | integer | No | |
RaceArr | unitcode | Yes | |
RaceListFRandRD | unitcode | Yes | |
RangeList | string | No | |
RAutocastOn | boolean | No | |
RDPoint | location | No | |
RecommendValue | string | Yes | |
ResTextArr | texttag | Yes | |
RightTeamAlive | boolean | No | |
RIPGroup | group | No | |
RIPGroup_LUMBER | group | No | |
RIPGroup_Noob | group | No | |
RKing | location | No | |
RKingAbilitiesLearned | integer | No | |
RKingLowHPCounter | integer | No | |
RKingSpawnPt | location | No | |
RMidCenter | location | No | |
RMidLeft | location | No | |
RMidRight | location | No | |
Scoreboard | multiboard | No | |
ScoreboardRow | integer | Yes | |
ScoreboardTitle | string | No | |
SDRace1 | integer | Yes | |
SDRace2 | integer | Yes | |
Seconds | string | No | |
SeduceUsed | boolean | Yes | |
SellPercent | real | No | |
SinglePlayer | boolean | No | |
Spawn1 | location | No | |
Spawn2 | location | No | |
Spawn3 | location | No | |
Spawn4 | location | No | |
Spawn5 | location | No | |
Spawn6 | location | No | |
Spawn7 | location | No | |
Spawn8 | location | No | |
Spawn_Timer | timer | No | |
Spawn_Timer_Window | timerdialog | No | |
spawnall | boolean | No | |
SpawnArr | location | Yes | |
SpawnYCoord | real | No | |
SpecialEvent | boolean | No | false |
SphereUsed | boolean | Yes | |
StompGroup | group | No | |
SummonCounterL | integer | No | |
SummonCounterR | integer | No | |
Summons_UnitGroup | group | No | |
Temp_Ability | abilcode | No | |
Temp_Bool | boolean | No | |
Temp_Integer | integer | No | |
Temp_Integer2 | integer | No | |
Temp_Integer3 | integer | No | |
Temp_Integer4 | integer | No | |
Temp_Lumber | integer | No | |
Temp_Player | player | No | |
Temp_Player_Arr | player | Yes | |
Temp_Player_Arr2 | player | Yes | |
Temp_Point | location | No | |
Temp_Point2 | location | No | |
Temp_Point_Warp_A | location | No | |
Temp_Point_Warp_B | location | No | |
Temp_Real | real | No | |
Temp_Real2 | real | No | |
Temp_String | string | No | |
Temp_String2 | string | No | |
Temp_String3 | string | No | |
Temp_UG | group | No | |
Temp_UG2 | group | No | |
Temp_UG3 | group | No | |
Temp_UG_Arr | group | Yes | |
Temp_Unit | unit | No | |
Temp_Unit2 | unit | No | |
TempUT | unitcode | No | |
ThrowNetUsed | boolean | Yes | |
TimeElapsed | string | No | |
TotalChangedBuilder | integer | Yes | 0 |
TotalCheat | integer | No | 0 |
TotalCostUpgrade | integer | Yes | |
TotalGold | integer | Yes | 300 |
TotalKill | integer | No | 0 |
TotalLumber | integer | Yes | 100 |
TotalLumber_Spent | integer | Yes | 0 |
TotalScore | integer | Yes | 0 |
Tower_Group | group | No | |
Towers_Selected_UnitGroup | group | Yes | |
TowerSellAmount_Integer | integer | Yes | |
TowerTypeArr | unitcode | Yes | |
TowerUnitArr | unitcode | Yes | |
Trig | trigger | No | |
UnitQuote | string | Yes | |
UnitSet1 | unitcode | Yes | |
UnitSet2 | unitcode | Yes | |
UnitSet3 | unitcode | Yes | |
UnitSet4 | unitcode | Yes | |
UnitSet5 | unitcode | Yes | |
UnitSet6 | unitcode | Yes | |
UnitSetSize | integer | Yes | |
Unpause_Counter | integer | No | |
Unpause_Group | group | No | |
UpgradesBought | integer | Yes | |
UpgradingTowers | group | No | |
Visible_East | fogmodifier | Yes | |
Visible_Middle | fogmodifier | Yes | |
Visible_West | fogmodifier | Yes | |
Vote_EnablePlayer | boolean | Yes | true |
Vote_Start | boolean | No | false |
Vote_Starter | integer | No | |
Vote_Timer | timer | No | |
Vote_Timer_lock | timer | No | |
VoteCountNo | integer | No | |
VoteCountNull | integer | No | |
VoteCountYes | integer | No | |
W3MMD_Enable | boolean | No | false |
W3MMDTimer | timer | No | |
W3MMDTimer2 | timer | No | |
WarpGroup | group | Yes | |
WarpPoint | location | No | |
WarpReady | boolean | No | |
Winner_Bot | group | No | |
Winner_Top | group | No | |
WinningAlliance | player | No | |
WinningTeamStr | string | No | |
WispCost | integer | No |
//TESH.scrollpos=0
//TESH.alwaysfold=0
//====================
// ADDING A NEW RACE
//====================
I. Object Editor
================
1) brainstorm in notepad all of the buildings's names and models, ranged or melee (no other stats yet), and abilities.
2) create the race buildings and fighters, "barebones" only: model, icon, and ranged or melee. also, create the builder unit and add the buildings to him
3) determine all unit stats, using formulas. tweak as necessary.
4) fill in stats for buildings and fighters (attack type, armor type, range, cooldown, dmg, hp)
5) create abilities for fighters & add them
II. Scripting
==============
1) create variables:
integer numArrayEnd<RaceName>
string TowerSellAmountList<RaceName>
2) in "Setup Tower Types"
set numArrayEnd<RaceName> = Temp_Integer // at the end of the race in the setup tower types trigger
3) in "Setup Tower Properties"
set TowerSellAmountList<RaceName> = ,realCost1,realCost2,realCost3,realCost4...and so on
set numRaces
4) in "Generate Tower Properties"
add:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Integer A) Less than or equal to numArrayEnd<RaceName>
Then - Actions
Set Temp_String = TowerSellAmountList<RaceName>
Set Temp_Integer = numArrayEnd<RaceNameOfPrevious>
Custom script: set udg_TowerSellAmount_Integer[GetForLoopIndexA()] =getIntValueFromListIndex(udg_Temp_String, GetForLoopIndexA()-udg_Temp_Integer)
Else - Actions
to the bottom/innermost if-else clause
5) Adjust stuff for Randoming
In pick random builder
In ar
In sd
In race icon
III. Testing & Polish
==============
1) Test the race out! Especially abilities, which are the source of most bugs.
2) Polish fighters, by adjusting the following fields:
' scaling size
' projectile art
' projectile speed
' animation backswing
' attack sound
' defense sound
' custom icons, if any
' special effect attachments, if any
3) Test more.
Attachment Point Names:
overhead (floats over the unit's head, but doesn't sway with)
head (sways with the unit's animation)
chest (also good for wings)
origin (usually at the base of a unit's feet)
hand
foot
weapon (for heroes)
sprite (for buildings)
medium (for buildings)
large (for buildings)
Attachment Point Modifiers:
left
right
========
changeds from 3.1a -> 3.1b
- Fixed Mutant fake anti-cheat warning
- Fixed : -ar mode & type your own mode will work correctly.
- Remove -cb should disable change builder & change to Mercenary
- Mercenary's spell is disable after wave start
- Add glowing aura to Prophet, Artic, Mercenary
---------
3.1b ->
* Ascedent (elf) ability changed (it can attack and cast spell at same time)
* Wraith/Mercuricy descritpion is correct
* Forsaken One(Ghost) armor changed (light -> heavy)
*
//TESH.scrollpos=0
//TESH.alwaysfold=0
//=====================
// ATTACK / ARMOR TYPES
//=====================
This is just a text representation of attack/armor types. To edit the actual values, go to Advanced >> Game Constants and Advanced >> Game Interface.
........................................................
Attack/Armor Types
Light Medium Heavy Fort Net Total
Pierce 130% 90% 80% 70% -30%
Normal 90% 120% 90% 80% -20%
Magic 110% 80% 120% 70% -30%
Siege 90% 90% 90% 125% 5%
Net Total -20% +30% +10% +55% x
........................................................
All = 100% against unarmored
Net totals are not "equal" because there are not an equal amount of each armor type. For example, there are few fortified levels.
//TESH.scrollpos=0
//TESH.alwaysfold=0
v1.00
* First release
v1.10
* Revamped terrain & spawn locations such that each player gets his/her own spawn; however, it is still easy for two players to build together
* Many critical bug fixes (PVP should now work), and many minor bugs fixed
* Increased King's range slightly (to prevent enemy from abusing long-ranged attackers to attack the king directly)
* Summons now have a stock maximum of 5
* summons now spawn at random, instead of cyclic, spawnpoints
* summons no longer spawn at vacant spawnpoints, unless *all* spawnpoints are vacant. If that is the case, summons will spawn at random spawnpoints.
* Enhanced the "Sell" ability. Towers that are newly built will now refund 100% of total cost.
* Other assorted changes.
v1.11
* Players can no longer summon units after all of the normal attackers have died.
* Fixed King player's bounty sharing.
* Slightly increased time to prepare between levels.
* Starting gold increased to 100.
* Buffed all summons significantly.
* Leaver gold now splits among the team.
* Added the Gnoll Poison and Deadly Poison abilities to Gnoll Warrior and Gnoll Savage respectively.
* Minor terrain changes.
* Other assorted changes.
v1.12
* Fighters now do not move until they a target comes within a certain range. This "acquisition" range varies with each unit.
* Bug fixes & misc. enhancements.
v1.20
* New Income system implemented. Income is received every 3 levels. Summon units to increase your income.
* Summons now go to a "holding area" when purchased, instead of directly into play. At the start of each level, all summons in said "holding areas" will be spawned with the normal creeps.
* Summons can now be purchased at any time (instead of only during a level)
* Added a special effect to units warping back to the King
* Leaver's units are now properly removed
* Summons now have collision sizes
* Raised starting food cap to 15
* King upgrades' cost lowered from 100 to 70
* New loading screen
* Bug fixes
v1.21
* Bug Fixes
* Aura buffs now properly display when level is not in progress
* Units now warp to the grassy patch above the King, instead of the King, after a lane is completed
v1.22
* Improved antistuck system.
* Summons now have appropriate sound-sets.
* Starting peasants now automatically chop lumber
* If a player leaves, his spawn is now turned off.
* Builders can no longer build in other players' areas.
v1.23
* Fixed bugs
* Added a warning message for when a King drops below 10% of max hit points. Warning messages will display a maximum of one time every 5 minutes per King.
v1.24
* Fixed several gameplay bugs
* Added additional AntiStuck functionalities
* Increased area of King auras
* Buffed several King abilities
* Mech race nerfed overall
* Increased mana pools of Seer of Darkness and Fenix
* Increased movement speed of Bone Warrior and Gnoll Warrior
* Aqua Spirit & Oceanus now have normal attack types
* Modified collision sizes of various units
* Slightly buffed Overseer & Keeper of Souls aura lifesteal
* Every 4 levels, King now upgrades +2 armor and +12% attack speed
* When playing left side only or right side only, income is now disabled to ensure intended game difficulty
* Fixed Tree of Life & Yggdrasil healing abilities & added special effects & buff icons
* Fixed Tree of Knowledge AOE damage on death visual effect
* Tree of Life's AOE Heal on death now heals 150 hit points no matter how close the allied unit is, and its area of effect has been increased
* Nerfed Yggdrasil, Tree of Life, Tree of Knowledge overall
* Decreased all Nature fighters' movement speed slightly
* Bosses are now "Hero" type; many abilities have reduced effectiveness
v1.25
* Fixed some typos
* Disabled giving gold & lumber
* Increased Worker gold cost to 50
* Upgrades now cost 100 lumber, and upgrades have been rebalanced accordingly
* Increased King's base hit points to 5000
* Lowered King's base cooldown
* Increased King's base damage
* Increased King's damage upgrade
* Doubled the lumber cost of all summons
* Income is now gained every level
* Raised restock time of summons to 10 seconds
* Summons now only have a maximum stock of 2
v1.26
* Fixed some typos
* Updated Quest entries
* Improved missile arts of all summons
* Improved attack sounds & defense sounds of all summons
* Added attack & armor types in all summons' tooltips
* Thunderbird now has the Thunder Wave ability; however, its base damage has been nerfed
* Fixed Meliai damage
* Increased cost of Lumberjack Training
* Replaced King's Slow with a variation of Slow Poison
* Buffed Hades (Shadow ultimate tower)
* Added the "Frenzy" ability to Bone Warrior, allowing them to move faster and regenerate hit points.
* Ranger & Meliai are now more offense-based (higher attack, lower defense)
* Ent & Guardian are now more defense-based (lower attack, higher defense)
* Ents now cost 20 gold and received an overall buff
* Added a buff icon for Amplify Magic
* Buffed Amplify Magic
* Magic damage now deals 120% to Heavy armor (up from 110%)
* Buffed Fire Archer
* Added the "Mana Burst" ability to Disciple, which uses mana to deal bonus damage. Nerfed Disciple's base stats.
* Buffed Tree of Travel's Helping Hand but nerfed base stats
* Removed Antistuck cooldown
v1.27
* Added a hotkey for the AntiStuck ability
* Nerfed Tempest & Leviathan
* Enemies that leak to the King area (middle) now give no bounty. A debuff is added to said units to indicate this. Summons and Bosses still grant full bounty; however.
* Added the "Dismiss" ability to workers (removes it without giving any gold).
* Nerfed Fenix max mana but increased its mana regen
* Added a "Level 31" level exclusive to left vs. right games that will act as a tiebreaker. Level 31 repeats itself until one team is defeated. If playing one-side only, victory is still achieved after defeating level 30.
* Nerfed bosses
* Added -debug commands. To enable -debug commands, Player 1 must type -debug within the first 10 seconds of the game.
* Fixed Pyro's range
v1.28
* Website created: legiontd.com
* Fixed a number of bugs
* Fixed a few typos
* Fixed on obscure bug in which all creeps would be dead, but the next round would not start
* Leaving players are now indicated in the multiboard (grayed out name)
* Added a "-next" text command which displays attack/armor type of the next wave
* Nerfed King's immolation area and damage
* Aqua spirit damage nerfed
* Infernal nerfed
* Enhanced endgame features
v1.29
* Enhanced level system--the game should no longer get stuck.
* Rebalanced summons' movement speed--270 for melee, 250 for range. There are exceptions for certain units.
* All summons have +25% damage and +25% hit points
* Fighters no longer warp before clearing a lane if reaching the black tile (this is a bug-fix).
* Fighters no longer "twitch" when waiting to acquire a target
* Creeps starting with level 18 (Sludge Flinger) have additional defense
* A few misc. bug fixes
* Normal damage now deals 90% to Light armor
* Pierce damage now deals 70% to Fortified
* Siege damage now deals 90% to Light armor
* Thunder Wave affects now affects air units
* Nerfed Messiah's Amplify Magic
* Aqua Spirit and Oceanus bouncing attacks now deal 25% less damage per bounce
* Ents and Guardians now have Heavy armor (from Medium)
* Diabolic (Hades' summon) nerfed
* Nerfed Level 31 slightly
* Nerfed Mindwarp
* Nerfed Adept slightly
* Nerfed level 9 & level 11
* Nerfed Dragon Aspect
* Nerfed Gnoll Savage
* Nerfed Enchanted Poison on bosses
* Added a "txt" command icon to builders which displays text commands
v1.29b
* Fixed Auras lingering after units leave AOE of aura-bestowing units
* Fixed Messiah aura (remade)
* Fixed bug where Adepts & Protons would sometimes not attack at melee range
* Added a new ability to Skeletor: "Killing Spree" -- 13% chance to increase damage by 25% for 10 seconds with each attack. Does not stack with itself.
* Buffed Fire Archer's attack, but nerfed its hit points
* Nerfed Gateguard & Harbinger hit points slightly
* Nerfed Gnoll Savage poison slightly
* Nightcrawler damage buffed slightly
* Goliath's Natural Armor now has a minimum damage received of 5
* Nerfed Overseer & Keeper of Souls lifesteal auras
* Removed Worker's Dismiss ability
* Dark Mage no longer casts Mindwarp until enemies come within range
* Buffed Zeus slightly
* Minor game performance improvements
* Compressed loading screen to save some bytes
v1.30
Fixes
* Fixed all backswing animations of fighters
* Proton & Adept now give gold for kills
* Tree of Knowledge's Forbidden Fruit AOE damage now gives gold for kills
* Fixed Level 31 glitch
* Fixed a glitch with King's Command Aura
* Fixed a glitch with Fenix
* Fixed a glitch with Watcher
* Fixed a glitch with Violet's Wind Gust
* Fixed a glitch with Tree of Travel's Helping Hand
* Fixed a glitch with Infantry
* Newly upgraded towers no longer sell for 100%
Balances
* Reduced all collision sizes for fighters
* More expensive fighters now cost additional food
* Buffed Tree of Knowledge's Forbidden Fruit (%, dmg)
* Buffed Tree of Life's Water of Life (heal amt)
* Buffed Ranger & Meliai (dmg), but nerfed (hp)
* Buffed Meliai's Precision (multiplier)
* Buffed Leviathan (dmg) and Leviathan's Exploding Shell (dmg)
* Buffed Ogre Basher's Club Smash & Ogre Pulverizer's Knock Out (%)
* Buffed Ogre Basher & Ogre Pulverizer (hp), but nerfed (dmg)
* Buffed Carrion Spitter & Nightcrawler (dmg), but nerfed (hp)
* Buffed Seer of Darkness/Fenix's Energy Shield (hp per mana), and buffed Seer of Darkness/Fenix (max mana)
* Buffed Violet's Wind Gust (dps), but only affects air
* Buffed Messiah's Amplify Magic (%)
* Buffed Neotank & Doomsday Machine (aspd)
* Buffed Zeus (aspd)
* Nerfed Lord of Death & Hades (hp, dmg). Also nerfed Infernal slightly, and buffed Diabolic slightly.
* Nerfed Captain's Leadership & Admiral's Superiority (%)
* Nerfed King's War Stomp (stun, mana, cd), King's Shockwave (mana)
* Nerfed Gateguard & Harbinger (hp)
* Nerfed Greymane's Battle Cry (%)
* Nerfed Gnoll Poison & Deadly Poison (DoT no longer stacks)
* Nerfed Lord of Death (hp, dmg)
* Nerfed Level 31 (hp)
* Nerfed King (base dmg) slightly
* Removed King's Pulverize
* Proton & Adept now deal chaos damage instead of spell damage
* Farms now provide 8 food, but cost more
New
* Added a new game-mode system. Current game-modes are -ap (All Pick), -ar (All Random), and -ni (No Income). More game-modes to come in future versions.
* Added new abilities for many summons. Almost every summon now has something unique.
* Replaced Sea Dragon (summon) with Gargoyle
* Replaced Thunderbird's Thunder Wave with Aftershock: Shocks 1-2 nearby enemies for 30 damage with each attack
* Replaced Leviathan's Exploding Shell with Shrapnel: Bombs have a 40% chance of releasing shrapnel and dealing 50 damage to up to 3 nearby enemies.
* Replaced King's Slow Poison with King's Frost
* Added a new debug command "-clear" which clears a wave
* Added a new debug command "-repick" which repicks your builder
Other
* Removed top arch by the King (it got in the way sometimes)
* Hades' Diabolic now summons next to the caster
* Renamed Violet's Wind Gust to Blue Wind & changed projectile
v1.30b
Fixes:
* Fixed a critical glitch that would break the game at level 1
* Fixed a glitch with Sell
* Fixed a couple tooltips
* Fixed a couple projectile arts
* Fixed Level 20 (Maccabeus) & Level 21 (Grom'thar) armor
Balances
* Lowered End-Round gold for every level--beginning levels only decreased slightly, while later levels decreased more.
* Buffed Ranger's Vulture Eye (raised multiplier), but nerfed (%)
* Buffed Ent & Guardian (hp) slightly
* Buffed Messiah (now has Disciple's Mana Burst), but nerfed (hp)
* Buffed Proton & Adept (dmg)
* Nerfed Level 21 (Hippogryphs)
* Nerfed Yggdrasil's Sacred Blesing (hp healed)
* Nerfed King Attack upgrade (amount)
* Nerfed King's War Stomp (stun)
* Nerfed Hermit's Healing Aura (hp healed)
* Hades's Diabolic now conjures 2 Imps per corpse, but costs double the mana
* Shadow summons now spawn next to the summoner, rather than next to the spawn wave
* Buffed Level 20 (Dragon Turtle)
* Buffed Level 11 (Clockwerk Goblin) slightly
* Buffed Ballista, Chariot, Kraken (mspd)
* Buffed Kraken (now spell immune)
* Changed King's Cripple: lower cooldown, lower movement reduction, higher damage reduction
* King's base hit points and base damage now varies with number of players on a team as follows:
1 player team: 2600 hp, 31-41 dmg
2 player team: 3800 hp, 43-53 dmg
3 player team: 4600 hp, 51-61 dmg
4 player team: 5000 hp, 55-65 dmg
Other:
* Changed King Hit Points upgrade tooltip to be more accurate (500 hp per upgrade)
v1.31
Fixes
* Fixed a few tooltips
* Fixed a bug with King stat scaling
* Fixed a bug with -ar
* Fixed a bug with Seer of Darkness's & Fenix's Energy Shield
* Fixed minor bugs with Violet, Nightcrawler, Dark Mage
* Fighters who reach the middle area now warp to the King
* Fixed a bug where fighters in the King area would wander off
* Dark Mage no longer casts Mind Warp on units who already have the buff
* Fixed a bug occuring when the King is attacked before fighters warp back (the bug was that the fighters would not move back to defend the King)
Balances
* Buffed Skeletor's Killing Spree (%, duration)
* Shadow summons now have 3 armor (from 0), like other fighters
* Lowered Zeus' range, but increased its damage
* Yggdrasil's Sacred Blessing and Tree of Life's Water of Life now have an instant cast-time (so no DPS is lost while healing)
* Adept cost increased, and stats buffed proportionally
* Buffed Violet (hp, dmg)
* Buffed Peewee & Veteran (hp, dmg) slightly
* Buffed Guardian (hp, dmg) slightly
* Buffed Tree of Knowledge (hp)
* Buffed Seer of Darkness & Fenix (mana regen)
* Buffed Seer of Darkness (dmg, aspd)
* Buffed Gateguard (dmg) slightly
* Seer of Darkness & Fenix now have Medium armor
* Thunderbird's Aftershock now shocks only 1 enemy, but deals more damage.
* Buffed Lord of Death & Hades (dmg), but nerfed Lord of Death & Hades (mana regen)
* Buffed Hades' Diabolic's Imp (hp), but nerfed (hp regen)
* Nerfed Gnoll Warrior's Gnoll Poison (no longer deals dps)
* Nerfed Gnoll Savage's Deadly Poison (dps, aspd slow)
* Medusa's Enchanted Poison's aspd reduction no longer stacks (dot and mspd reduction still stack)
* Nerfed Sprite's Faerie Luck (%)
* Nerfed Warrior summon's Bash (bonus dmg)
* Nerfed Seer of Darkness & Fenix (max mana). Also, Energy Shield now only affects 80% of incoming damage.
* Warrior, Hermit, Commander, Furbolg, Frost Wolf, Dark Draenei, Shaman, and Pudge (summons) all give reduced income
* Decreased flying summons movement speed
* Nerfed Gargoyle summon (dmg)
* Succubus (Level 25) now have fast movement speed
* Nerfed enemy King when playing one-side
New
* Added a new race: Ghost
* Players can now control their King
* Players can toggle Autocast On/Off for their King
* Replaced Dark Draenei's Evasion with Swiftness Aura (+mspd to allies)
Other
* Increased End-Round Gold (now it is between that of 1.30 and 1.30b)
* Summons are now distributed evenly each round between occupied player lanes.
* Lane terrain widened by 1 space each edge--now you have more room to build.
* Computer "Attacker" players removed from pre-game lobby to allow a game to be hosted with Observers (up to 2)
* Improved King Autocast behavior
* Seer of Darkness & Fenix now reactivate Energy Shield when warped to the King
v1.31b
* Fixed major and minor bugs
* Players can no longer control the King (it was buggy). This feature may be added again in the future after more testing.
* Summoned unit distribution is now random (as before). The new summon distribution system will be added in the future after more testing.
v1.31c
Fixes
* Fixed a few gameplay bugs
* Fixed a bug with Antistuck
* Fixed a few tooltips
* Fixed a bug with Hell Raiser
* Fixed a bug with Tree of Knowledge's Forbidden Fruit
* fixed a bug with Gravekeeper's Despair Aura
Balances
* Buffed Gravekeeper's Despair Aura (area)
* Buffed Meridian's Catastrophe (lower cooldown, new effect - units who die with the Catastrophe buff explode, dealing AOE damage), but raised mana cost greatly
* Buffed Phantom's Silent Scream (dmg), but targets 1 less unit. Also, cooldown raised slightly. (overall nerf)
* Buffed Hell Raiser's Cacophony (dmg), but targets 1 less unit. (overall nerf)
* Buffed Lord of Death (hp) slightly & Infernal (dmg)
* Buffed Hades (hp, dmg) slightly
* Buffed Nightcrawler (hp) slightly
* Buffed Wraith (dmg, hp) slightly
* Nerfed Hippogryphs (L21) (hp, mspd)
* Nerfed Legion Lord (L31) (dmg)
* Nerfed Yggdrasil's Sacred Blessing and Tree of Life's Water of Life (area)
* Nerfed Warrior's Maul (%)
Other
* Improved autocasting of Greymane's Battle cry, Wraith's Disturb, and Mercurial's Traumatize
* Removed Sell hotkey
* Summons are now distributed equally (should be fixed now)
* Players can now control their King again (should be fixed now)
v1.31d
Fixes
* Fixed a bug occuring when using magic damage against spell-immune targets
* Fixed a bug occuring with Fortified armored fighters
* Fixed a bug with Spawn of Dragon's Circle Slash
* Fixed a bug with Kraken's Spell Immunity
* Fixed a bug with summoned units (Shadow race) lasting indefinitely.
* Fixed a bug where Hades' Diabolic would use mana without raising Imps
* Fixed attack type of Wyvern summon
* Fixed Gnoll Savage's (fighter) model size
* Canceling an upgrade no longer causes towers to lose transparency
* Fixed a few tooltips
Balances
* Buffed Spawn of Dragon's Circle Slash & Dragon Aspect's Whitefire (full/medium damage area)
* Buffed Adept (dmg, aspd), but nerfed (hp)
* Buffed Aqua Spirit & Oceanus (dmg)
* Buffed Nightcrawler (added the Sticky Webs ability; attacks slows air units)
* Buffed Zeus (range), but nerfed (dmg). Same as pre-1.31.
* Nerfed Phantom (hp, dmg) and Hell Raiser (hp, dmg)
* Nerfed Outcast & Forsaken One (hp)
* Nerfed Hades' Diabolo (Raise Imps mana cost)
* Nerfed Captain (dmg)
* Imps' Corpses can no longer be used to raise more Imps
* Shaman summon's Blood Rush now lasts 15 seconds on units, and 5 seconds on bosses (previously 10 seconds on all units)
New
* Added a new ending scoreboard to replace the end-game text messages. The new scoreboard is modeled after that in DotA: Allstars.
Other
* Improved AI of fighters, particularly when building in the middle
* Air enemies now spawn in a separated formation. Air enemies now do not separate themselves during battle. This should help with melee fighters' targeting. Unfortunately, this means air units will "clump" now.
* Improved some tooltips
* Added a buff icon for "Boss Unit"
* King now faces enemies upon engagement
* Improved Energy Shield & Ghost Essence autocasting
* Changed "Left Team" and "Right Team" to "West Alliance" and "East Alliance"
* Income is no longer given on level 31
* Changed the model for the East Alliance's King
v1.40
Fixes
* Fixed a few bugs with Shadow summon behavior
* Fixed bugs occuring when an entire team leaves the game or income is enabled in a single-team game
* Fixed a bug with King's Thorns Aura not working on certain air levels
* Fixed a bug with bosses attacking slower than they should
* Fixed a bug with the -abil command in -debug mode causing a fatal error
* Fixed an exploit with sell
* Fixed an exploit with farms
* Fixed an exploit with Antistuck
* Mistyping a game-mode no longer defaults to -ap
* Fixed some tooltips
Balances
Beast
* Gnoll Savage's Deadly Poison, Harpy's Envenom, and Medusa's Enchanted Poison no longer can deliver the killing blow.
* Nerfed Spawn of Dragon slightly (reduced cleave)
Shadow
* Buffed Carrion Spitter (dmg)
* Buffed Nightcrawler (dmg, hp)
* Nerfed Hades (Imps duration, Diabolic no longer regenerates mana)
Ghost
* Buffed Wraith (dmg)
* Buffed Mercurial (dmg, hp)
* BUffed Soul of Hero (dmg, hp)
* Buffed Soul of Villain (dmg, hp, Violate lasts longer on non-bosses)
* Nerfed Phantom (mana regen)
Mech
* Buffed Zeus (added the Lightning Strike ability; deals bonus damage to bosses)
* Buffed Pyro (hp, dmg)
* Buffed Tempest (dmg)
* Buffed Leviathan (dmg)
* Buffed Neotank (aspd)
* Buffed Doomsday Machine (dmg, hp, aspd)
Element
* Buffed Violet (Blue Wind now targets all units, but only 2 gusts per second instead of 3)
* BUffed Watcher (dmg) slightly
* Buffed Golem (dmg, hp) slightly
* Buffed Proton & Adept (mspd)
* Buffed Disciple (Mana Burst dmg)
* Buffed Messiah (Mana Burst dmg, aspd)
* Buffed Oceanus (hp) slightly
Nature
* Buffed Ent & Guardian (hp)
* Buffed Ranger (dmg)
* Buffed Meliai (dmg, hp, Precision deals more damage, but only affects air units)
* Buffed Goliath (increased Natural armor percent and damage reduction, added Reassurance ability: increases armor of nearby friendly units by 3. Very small area of effect.)
* Nerfed Yggdrasil and Tree of Life (Sacred Blessing and Water of Life now have max # targets)
Summons
* Buffed Shaman's Blood Rush (lasts longer on non-bosses)
Creeps
* Buffed Level 4, 8, 12, 16, 24 (hp/dmg)
* Buffed Level 9 (hp)
* Buffed Level 11 slightly (hp/dmg)
* Buffed Level 16-19 slightly (hp)
* Buffed Level 20 (added the Torrent ability; attacks bounce 1 time)
* Buffed Level 30 (added the Shockwave ability)
* Armor increase per level now starts at level 15 (from 18)
Other
* Removed Stop/Attack buttons from King (you can still target attacks with right-click). This is to prevent a certain exploit.
* Creeps/Summons are now separated upon creation.
New
* New terrain by LilBlueSmurf
* New map preview picture
* Added a new race: Demi-Human. Thanks to Zanam05 initial ideas.
* Added a new game-mode, -sm ("Short Mode"): Less time between rounds, all units move and attack 15% faster. King has 30% less hit points.
* Added a new game-mode, -mm ("Mastermind"): Restricted vision, limited scoreboard information.
* Added a new text command, -zoom: allows you to change the camera zoom between 50% (closest) and 450% (farthest). Example: -zoom 400.
* Added a new debug text command, -buildall: allows you to build in other players' areas (toggle on/off)
* Added a quest entry describing Game Modes.
* Added new debug commands -gold X, -lumber X, and -food. -debug text command no longer gives gold, lumber, or food.
* Added new functionality to -spawnall debug text command: can now be toggled on/off
Other (improvements, etc.)
* Faster loading time
* Renamed alliances to Dawn Legion and Twilight Legion
* Builders' Antistuck ability now cannot target enemy fighters. Also targets an area, so magic immune units can be antistucked if necessary.
* The "-start" command is now enabled for Single Team play (an addition to Single Player)
* Replaced "Enemies Alive" number with a bar display. Code by Ammorth.
* Re-enabled the "high scores" messages in addition to the ending scoreboard
* Renamed a few fields on the ending scoreboard to ensure they don't get cut-off on smaller resolutions
v1.40b
* Fixed a bug with spawns getting "stuck" behind terrain or in cliffs
* Fixed a bug with Tremor/Fissure not autocasting on netted units
* Fixed a bug with -repick
* Lowered collision sizes of various levels
v1.40c
* Reverted back to 1.31d style terrain & theming (1.40 custom terrain tiles caused Macs to crash)
* Reverted back to 1.31d spawn-creation (only air levels are "spread out")
* No longer uses fast-loading code (should fix some misc. bugs)
* Fixed a bug with Orange building in the middle
* Nerfed Dragon Turtle (hp, dmg)
* Improved Mend AI
* Buffed Zeus (aspd)
* Buffed Mutant (dmg) slightly
* Buffed Servant (dmg) & Slavemaster (hp, dmg)
* Buffed Minotaur (Tremor now deals 40 damage)
* Buffed Yggdrasil & Water of Life (heal # targets)
v1.41
Fixes
* Fixed a bug with Leviathan damage
* Fixed a bug with Goliath (Reassurance)
* Fixed a bug with Troll Champion (Adrenaline Rush)
* Fixed a bug with Medusa (Enchanted Poison)
* Fixed a bug with Oracle (Divination)
* Fixed an exploit with Mutant (Inject Steroids)
Balances
* Buffed Harpy, Medusa, and Gnoll Savage (Poison can now kill units and will always reward bounty for kills)
* Buffed Specter (dmg) slightly
* Buffed Slavemaster (Slave Trade now gives 2 gold per unit)
* Buffed Watcher (dmg) slightly
* Buffed Violet (Blue Wind now sends 3 gusts per second)
* Buffed Ranger (dmg)
* Buffed Meliai (Precision affects all units, but less bonus damage. Added Mark Target ability: each attack marks an enemy target, causing it to take 25% more damage from piercing attacks.)
* Nerfed Harpy (poison dmg) slightly
* Nerfed Medicine Man (Mend hp healed)
* Changed Minotaur & Bigfoot (melee range now, instead of 180. Buffed hp/dmg).
* Changed Dark Priest & Meridian (Haunting & Catastrophe much more damage, much shorter duration. Should fix the bug where DoT doesn't grant bounty)
* Changed Ogre Basher & Ogre Pulverizer (less collision size)
* Changed Servant (buffed hp, nerfed dmg)
* Changed Slavemaster (nerfed hp, buffed dmg)
* Changed Zeus (replaced Lightning Strike with Power Surge: deals 45 damage at the cost of 10 mana. Zeus regens 1 mana per attack (no natural regen))
* Changed Oracle (Divination now bounces to "nearby" units rather than adjacent ones)
* King Abilities are now no longer entirely random:
Level 4: Immolation, Shockwave, or War Stomp
Level 12: Cripple, Entangling Roots, or Frost Attack
Level 20: Command Aura, Devotion Aura, Endurance Aura, Thorns Aura, or Trueshot Aura
Level 28: Evasion, Bash, or Critical Strike
* King Upgrades remade. The more you purchase an upgrade, the greater the increase per level.
* King Upgrades now give +3 income each.
* King's Cripple and King's Frost now lasts longer on bosses
* Nerfed level 20 (dmg)
* Nerfed level 11 (hp)
New
* Added a new unit "Dwarven Engineer" as an upgrade between Goblin Scientist & Mutant
Other
* Improved AI for Mend, Tremor, Fissure, Seduce
* Improved AI for Mindwarp
* Improved enemy pathing in "middle" lanes
* Mastermind mode changed: players now receive vision of the enemy team's leaked units
* Reverted to 1.31d "Enemies Left" text
* Flipped trees/worker positioning for bottom players
* In -debug mode, when playing one side only, summons sent to the enemy team will also be sent to you
* Game Mode timer now always lasts 10 seconds, rather than automatically ending when a game mode is typed in
v1.41b
Fixes
* Fixed a bug with bottom players base areas
* Fixed a bug with Aqua Spirit (range)
* Fixed a bug with Goliath (Reassurance)
* Fixed a bug with Tree of Time (Chrono Trigger)
* Fixed a bug with Medicine Man (Mend not healing when 1 unit left)
* Fixed a bug with Level 29 not being correctly classified as a ranged level
* Fixed a bug with Level 30
* Fixed King Regeneration healing much more than intended
* Autocast on/off for King now has a cooldown
* Antistuck now has a cooldown
* Sharing units is disabled
* Fixed a few tooltips
Balances
* Air units no longer "stack"
* Changed Oracle (replaced Divination with Guardian Spirit: At beginning of level, creates guardian spirits above 4 adjacent units, causing them to take only 88% of all incoming damage. Lasts the entire level.
* Changed Tribesman & Alpha Male (Throw Net on air units pulls them into melee range)
* Buffed Skeletor, Fire Archer, and Dark Mage (all now have Frenzy: hp regen and fast movement speed)
* Buffed Nightcrawler slightly (aspd)
* Nerfed Harpy (Envenom dmg) and Medusa (Enchanted Poison dmg)
* Nerfed Gnoll Savage slightly (Deadly Poison dmg)
* Nerfed Spawn of Dragon (splash area)
* Buffed King's Shockwave (range)
* Nerfed King's Immolation (slightly less dmg, and no longer hits air)
* Hermit Healing Aura increased slightly, but no longer stacks
* Buffed Chariot & Ballista (dmg)
* You now receive end-of-round gold & income after completing level 30
Misc
* New command, -info #: displays level information about level #.
* New debug command, -restart: restarts the game (mostly). Player red only
* New debug command, -heal: heals both kings
v1.41c
Fixes
* Fixed King autocast on/off cooldown
* Fixed a bug with -ar when typed before -mm
* Fixed a bug with -mm replays
* Fixed a bug with -spawnall and -buildall commands
* Fixed a few tooltips
Game Balances
* Decreased AOE of summons' auras
* Summons now have 0 armor (from 3)
* Creeps & Summons that pass the middle building areas now receive a small armor bonus.
* End Round Gold decreased, but Kill Bounty increased to compensate: total gold received is the same as before.
Fighter Balances
* Buffed Troll Fighter (hp slightly)
* Buffed Troll Warlord (dmg, Adrenaline Rush higher % but only affects aspd)
* Buffed Dragon Aspect (dmg & hp slightly, better animation)
* Buffed Aqua Spirit (dmg)
* Buffed Oceanus (dmg slightly, aspd)
* Buffed Goblin Scientist (hp slightly)
* Buffed Tribesman (dmg & hp slightly)
* Buffed Servant (dmg)
* Buffed Slavemaster (hp slightly)
* Buffed Mutant (hp & dmg slightly, Inject Steroids now buffs hp)
* Nerfed Spawn of Dragon & Dragon Aspect (aoe dmg)
* Lowered various units' collision sizes
Other
* Many units hit points changed very slightly (less than 5 hp up or down) to sync up with Units page
* Added resource text to players' bases (visible to allies only)
* Changed icon of Mindwarp, Phase Out, Despair Aura, (old icons were already in use)
* Added a few more End Game stats: Gold From Kills, Fighters Value, and Leaks
* Added hotkeys for summons
* Added a new debug command, -income X: set your income to X. Changed current -income command to -toggleincome.
New
* Added a new game mode, -sd ("Single Draft"): each player receives 2 random races to choose from.
v1.41d
Fixes
* Fixed -debug text display
* Fixed a glitch with the end scoreboard
* Corrected bounties for level 7, 9, 14, 20, 29, and 30
Balances
* Buffed Skeletor (hp, Killing Spree automatically procs on killing blow). Now moves slower as well.
* Buffed Fire Archer (Flaming Arrows dmg)
* Buffed Dark Mage (Mindwarp no longer deals damage)
* Buffed Goblin Scientist (dmg). Also changed missile art.
* Buffed Goblin Engineer (lower dmg, but has small splash)
* Buffed Oceanus (bounce dmg)
* Buffed Specter, Wraith, & Mercurial (dmg slightly)
* Buffed Veteran (costs 10 less gold)
* Buffed Guardian (dmg & hp slightly, now has Entangle ability: immobilizes a target & deals 10 damage per second for 4 seconds)
* Tribesman & Alpha Male now have Medium armor (from Light)
* Medicine Man & Oracle now have Light armor (from Medium)
* Buffed Oracle (Guardian Spirit %)
* Buffed Medicine Man (dmg slightly)
* Nerfed Zeus (Power Surge dmg)
* Nerfed Ogre Basher (Club Smash %)
Other
* King control improved. Any order resets the timer now, in addition to changing owners.
* Added a text command, -king: Displays king's upgrade stats.
* Added two additional ending scoreboard stats: Upgrades Bought, Leaks Caught
v1.42
Fixes
* -debug command now displays only commands. Command descriptions are in F9 after typing -debug
* Fixed a few bugs with the ending scoreboard stats
* Fixed a bug with King's Shockwave autocast
* Fixed a bug with Tremor & Fissure not casting on netted units
* Fixed some tooltips
Fighter Balances
Mech
* Buffed Pyro (hp, dps). Now deals Chaos damage.
* Buffed Zeus (Power surge now deals 45 dmg, as in 1.41c)
* Buffed Admiral (dmg)
* Buffed Krogoth (dmg)
* Buffed Neotank & Doomsday Machine (hp)
Nature
* Buffed Ranger (aspd)
* Nerfed Sprite (hp slightly)
* Nerfed Thunderbird (Aftershock deals 40 dmg, down from 45)
* Nerfed Tree of Travel (hp slightly)
Ghost
* Buffed Apparition (dmg)
* Buffed Gravekeeper (dmg greatly, hp)
Demi-Human
* Buffed Slavemaster (hp)
* Buffed Mutant (range to 180)
* Buffed Bigfoot (Fissure aoe)
Shadow
* Buffed Overseer (hp slightly)
* Buffed Keeper of Souls (dmg, hp slightly)
* Buffed Doppelganger (evasion %)
* Lowered Hades collision size
Element
* Buffed Adept (hp)
* Buffed Seer of Darkness (dmg, aspd)
* Buffed Fenix (aspd)
Beast
* Buffed Gnoll Warrior & Gnoll Savage (poison duration on bosses)
* Nerfed Ogre Basher & Ogre Pulverizer (stun lasts much shorter on bosses)
* Nerfed Harpy & Medusa (poison duration on bosses)
* Nerfed Greymane (Battle Cry aoe to 400 from 500)
Other Balances
* Sell % changed to 50% (from 70%)
* Middle Area now only increases enemies' armor by 1 (instead of 3)
* Changed Level 20 (10% less dmg, but deals Chaos damage)
* Short Mode (-sm) now increases mana regeneration by 15% (in addition to +15% mspd/aspd)
* Slightly improved Mend AI
* Nerfed King's Cripple (duration on bosses from 7 to 5)
Other
* Changed "Middle" area to a darker grass to distinguish its boundaries
* -value is no longer debug only (now available as a normal command)
* Removed (8) from filename due to issues with Linux-based HostBots
Thanks to Saint9854, Desinity, and Jman5 for tons of help with this version!
v1.50
Fixes
* Fixed a bug with -restart (workers not being re-ordered)
* Fixed Level 20 attack type (in messages)
* Fixed a bug with Oracle (not recasting Guardian Spirit on Level 31)
* Fixed a bug with victory/defeat conditions on Level 31 in certain situations
* Fixed some tooltips & quest entries
* Fixed some inconsistencies with Unit Stats page
* Fixed some other small bugs
Fighter Balances
Mech
* Buffed Veteran (700 -> 725 hp)
* Buffed Pyro (94.2 -> 100 dps, lowered collision size)
* Buffed Captain (565 -> 585 hp)
* Buffed Zeus (Power surge, 45 -> 50 dmg)
* Changed Neotank & Doomsday Machine (aspd 1.05 -> 0.9, dmg lowered to keep same overall DPS as before)
Beast
* Buffed Gnoll Savage (370 -> 400 hp)
* Buffed Medusa (720 -> 820 hp, 52.4 -> 59.6 dps)
* Changed Medusa's Enchanted Poison (mspd no longer stacks, but 20% -> 35% slow)
Nature
* Nerfed Guardian (44 -> 41.5 dps)
Shadow
* Buffed Fire Archer (245 -> 275 hp, 27.3 -> 32.2 dps)
* Buffed Blood Thirst (7% -> 8% lifesteal)
* Buffed Sound of Madness (14% -> 16% lifesteal)
* Dark Mage's Mindwarp now prioritizes closer allies
Element
* Nerfed Aqua Spirit (210 -> 200 hp)
* Nerfed Oceanus (59.7 -> 57.3 dps)
* Buffed Adept (530 -> 560 hp)
* Buffed Disciple (630 -> 670 hp)
* Buffed Messiah (1015 -> 1085 hp)
* Changed Fenix (1810 -> 1700 hp, 190 -> 203 dps)
Ghost
* Buffed Wraith (46.9 -> 50.8 dps)
* Buffed Mercurial (100.2 -> 113.5 dps)
* Buffed Dark Priest (109.9 -> 135.2 dps)
* Buffed Meridian (175.5 -> 210.6 dps, Catastrophe AOE damage (70 -> 85))
* Buffed Apparition (112.5 -> 123.8 dps)
* Buffed Gravekeeper (162 -> 194.4 dps)
* Nerfed Outcast (1080 -> 1040 hp)
* Nerfed Soul of Hero, defense (865 -> 835 hp)
Demi-Human
* Buffed Tribesman (365 -> 385 hp)
* Buffed Alpha Male (855 -> 900 hp)
* Buffed Mistress (1495 -> 1580 hp, 145.4 -> 153.9 dps)
* Buffed Oracle (92.9 -> 98.3 dps)
Creeps/Summons
* Level 10 (now deals Chaos damage, but -10% dmg
* Buffed Level 21 (725 -> 755 hp)
* Buffed Level 25 (680 -> 715 hp, 75 -> 79.4 dps)
* Buffed Level 26 (1075 -> 1130 hp, 119.7 -> 125.7 dps)
* Buffed Level 27 (1135 -> 1190 hp, 126 -> 132.3 dps)
* Buffed Level 28 (2136 -> 2330 hp, 211.1 -> 220.7 dps)
* Buffed Level 29 (1360 -> 1400 hp)
* Level 31 is now Unarmored armor
* Nerfed Level 31 (6 -> 5 per round)
* Changed Warden (522 -> 325 mspd)
* Buffed Chariot (230 -> 270 mspd)
* Buffed Ballista (230 -> 270 mspd, 600 -> 700 range)
* No-Bounty Region extended: Units now get the No-Bounty flag as soon as they touch any of the black tile
Other Balances
* Income is no longer rewarded during level 31
* Players who leave during level 31 will still receive spawns in their lane for subsequent waves
* Widened teleport area above King
* Build time of Farms (14 sec -> 7 sec)
Other
* Game modes can now be typed in incrementally [ex: you can type -ap, then type -sm in a new line]
New
* Added a new primary game mode, -rd ("Random Draft"): Players take turns picking races from a fixed pool (size depends on # players playing). Teams alternate picking. The order of picking within each team is random.
* Added a new primary game mode, -fr ("Fixed Random"): Each player receives a race chosen at random. No two players will have the same race.
* Added a new secondary game mode, -hg ("Hourglass"): Leaked units (that is, units that reach the King) give bounty to the enemy King, which is split between the team at the end of the round.
* Added a new secondary game mode, -nm ("No Middle"): Enemies that reach the middle (Dark Grass) give no gold when killed.
* Added a new race: Hybrid
* Added a new race: Marine
* Added support for HostBot Command Library (HCL), so bots can now enter game-modes
* Added a new text command, -cls: clears the screen of text
* Added new debug commands:
-ike = make East King invulnerable
-ikw = make West King invulnerable
-pause or -p = pause Spawn Timer
-resume or -r = resume Spawn Timer
-heale = heal East King only
-healw = heal West King only
-cleare = clear East enemies only
-clearw = clear West enemies only
-spawn X = toggle spawn for lane X
-foodmax = set food to 200
Special thanks to empty_Syringe, Jman5, Desinity, Boreal, Neophilus, and Cakoluchiam for testing this version!
v1.50b
Fixes
* Improved HCL support. Now works if the bot enters the game-mode with or without a dash.
* Fixed an exploit
* Fixed bugs with -rd
* Fixed a bug with Sea Giant freezing up
* Fixed a bug with Hydra
* Fixed a bug with Mutant (Inject Steroids)
* Fixed bugs with Level 31
* Fixed max food
* Fixed lag issues
* Fixed Sky Dragon hotkey
* Fixed some tooltips & other small bugs
* Fixed a bug with Fury
Fighters
* Increased cost of some Hybrid towers:
Tier 3 (80 -> 85 gold)
Tier 5 (195 -> 205 gold)
Tier 6 (305 -> 315 gold)
* Nerfed Bottom Feeder (39.8 -> 38.0 dps)
* Nerfed King Claw (94.8 -> 91.9 dps)
* Nerfed Sea Giant (Tidal Wave 100 -> 90 dmg per target, 400 -> 360 max dmg)
* Renamed/rethemed Storm Cloud to Storm Geyser. Appears on the ground rather than in the air. Moves faster than before, but has the same effects otherwise.
* Changed Mutant (2050 -> 1800 hp, 189.9 -> 166.1 dps, 180 -> 400 range)
Other
* Income is now enabled by default, even if playing one-side only
* Income is no longer "increased" by summoning after the first wave of Level 31
v1.50c
Fixes
* Fixed some tooltips & hotkeys
* Sea Giant now does not "pause" to cast Tidal Wave--should fix any freezing.
* Fixed Pyro's damage (now correctly deals 100 dps)
* Fixed Swamprunner's Sell value
* HCL support removed, due to bugs.
* Removed Sea Giant's Tidal Wave ability, due to freezing. Buffed dmg to compensate.
Balances
* Buffed Slavemaster (Slave Trade, 1/2 gold -> 2/3 gold per servant/slavemaster)
* Buffed Ogre Basher (170 -> 175 hp)
* Buffed Ogre Pulverizer (610 -> 630 hp)
* Buffed Proton (1.30 -> 1.25 aspd)
* Buffed Adept (1.50 -> 1.45 aspd)
* Buffed Oracle (Guardian Spirit, 84% -> 77% dmg received)
* Buffed Swamprunner (260 -> 280 hp, 25 -> 27 dps)
* Nerfed Bottom Feeder (420 -> 400 hp, 38.0 -> 36.3 dps)
* Buffed Level 30 (15350 -> 17055 hp)
Other
* King control reworked: once a player gains control of his team's King, another player cannot take control until the first player deselects it. The 5 second minimum control time still applies.
//TESH.scrollpos=363
//TESH.alwaysfold=0
///////////////////////////////////////////////////////////////
/// The Map Meta Data Library
/// Version: v1.00
/// Last Modified: April 24, 2009
/// Author Chain: Strilanc, [insert next ...]
///////////////////////////////////////////////////////////////
/// This library is used to emit standardized meta data which replay parsers and bot hosts can use to record relevant
/// game statistics like "hero kills" which would otherwise be impossible to record automatically.
///
/// In particular, the flag function can be used to indicate if a leaver should be awarded a win or not. Replays
/// don't contain enough information to easily tell winners who leave from losers who leave. (for example: people
/// who leave while end-game stats are being shown)
///////////////////////////////////////////////////////////////
/// Interface:
/// void FlagPlayer(player, flag_constant)
/// void DefineValue(name, type_constant, goal_constant, suggest_constant)
/// void UpdateValueInt(name, player, operation_constant, value)
/// void UpdateValueReal(name, player, operation_constant, value)
/// void UpdateValueString(name, player, value)
/// void DefineEvent0(name, format)
/// void DefineEvent1(name, format, argName1)
/// void DefineEvent2(name, format, argName1, argName2)
/// void DefineEvent3(name, format, argName1, argName2, argName3)
/// void LogEvent0(name)
/// void LogEvent1(name, arg0)
/// void LogEvent2(name, arg0, arg1)
/// void LogEvent3(name, arg0, arg1, arg2)
/// void LogCustom(unique_identifier, data)
/// void RaiseGuard(reason)
///////////////////////////////////////////////////////////////
/// Notes:
/// - Errors are displayed using BJDebugMsg
/// - Don't try to update a value before defining it
/// - Parsers expect a very specific format, don't screw with the library's output.
/// - If you emit a bunch of data per second, you will cause bandwidth problems for dial-up users. Try to avoid
/// emitting lots of data all at once except at the start and end of games or rounds.
/// - An event's format string uses {#} to represent arguments
/// - Calling RaiseGuard will increase the number of senders for each message from 1 to 3. This increases
/// security but uses more network bandwidth. It is done automatically if tampering is detected.
///////////////////////////////////////////////////////////////
library MMD initializer init
globals
public constant integer GOAL_NONE = 101
public constant integer GOAL_HIGH = 102
public constant integer GOAL_LOW = 103
public constant integer TYPE_STRING = 101
public constant integer TYPE_REAL = 102
public constant integer TYPE_INT = 103
public constant integer OP_ADD = 101
public constant integer OP_SUB = 102
public constant integer OP_SET = 103
public constant integer SUGGEST_NONE = 101
public constant integer SUGGEST_TRACK = 102
public constant integer SUGGEST_LEADERBOARD = 103
public constant integer FLAG_DRAWER = 101
public constant integer FLAG_LOSER = 102
public constant integer FLAG_WINNER = 103
public constant integer FLAG_LEAVER = 104
public constant integer FLAG_PRACTICING = 105
endglobals
///////////////////////////////////////////////////////////////
/// Private variables and constants
///////////////////////////////////////////////////////////////
globals
private constant boolean SHOW_DEBUG_MESSAGES = true
private constant string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-+= \\!@#$%^&*()/?>.<,;:'\"{}[]|`~"
private constant integer num_chars = StringLength(chars)
private string array flags
private string array goals
private string array ops
private string array types
private string array suggestions
private boolean initialized = false
private gamecache gc = null
private constant string ESCAPED_CHARS = " \\"
private constant integer CURRENT_VERSION = 1
private constant integer MINIMUM_PARSER_VERSION = 1
private constant string FILENAME = "MMD.Dat"
private constant string M_KEY_VAL = "val:"
private constant string M_KEY_CHK = "chk:"
private constant integer NUM_SENDERS_NAIVE = 1
private constant integer NUM_SENDERS_SAFE = 3
private integer num_senders = NUM_SENDERS_NAIVE
private integer num_msg = 0
private timer clock = CreateTimer()
private string array q_msg
private real array q_time
private integer array q_index
private keyword QueueNode
private QueueNode q_head = 0
private QueueNode q_tail = 0
endglobals
///////////////////////////////////////////////////////////////
/// Private functions
///////////////////////////////////////////////////////////////
///Triggered when tampering is detected. Increases the number of safeguards against tampering.
public function RaiseGuard takes string reason returns nothing
debug if SHOW_DEBUG_MESSAGES then
debug call BJDebugMsg("MMD: Guard Raised! (" + reason + ")")
debug endif
set num_senders = NUM_SENDERS_SAFE //increase number of players voting on each message
endfunction
///Returns seconds elapsed in game time
private function time takes nothing returns real
return TimerGetElapsed(clock)
endfunction
///Initializes the char-to-int conversion
private function prepC2I takes nothing returns nothing
local integer i = 0
local string id
loop
exitwhen i >= num_chars
set id = SubString(chars, i, i+1)
if id == StringCase(id, true) then
set id = id + "U"
endif
call StoreInteger(gc, "c2i", id, i)
set i = i + 1
endloop
endfunction
///Converts a character to an integer
private function C2I takes string c returns integer
local integer i
local string id = c
if id == StringCase(id, true) then
set id = id + "U"
endif
set i = GetStoredInteger(gc, "c2i", id)
if (i < 0 or i >= num_chars or SubString(chars, i, i+1) != c) and HaveStoredInteger(gc, "c2i", id) then
//A cheater sent a fake sync to screw with the cached values
set i = 0
loop
exitwhen i >= num_chars //just a weird character
if c == SubString(chars, i, i+1) then //cheating!
call RaiseGuard("c2i poisoned")
call StoreInteger(gc, "c2i", id, i)
exitwhen true
endif
set i = i + 1
endloop
endif
return i
endfunction
///Computes a weak hash value, hopefully secure enough for our purposes
private function poor_hash takes string s, integer seed returns integer
local integer n = StringLength(s)
local integer m = n + seed
local integer i = 0
loop
exitwhen i >= n
set m = m * 41 + C2I(SubString(s, i, i+1))
set i = i + 1
endloop
return m
endfunction
///Stores previously sent messages for tamper detection purposes
private struct QueueNode
readonly real timeout
readonly string msg
readonly integer checksum
readonly string key
public QueueNode next = 0
public static method create takes integer id, string msg returns QueueNode
local QueueNode this = QueueNode.allocate()
set .timeout = time() + 7.0 + GetRandomReal(0, 2+0.1*GetPlayerId(GetLocalPlayer()))
set .msg = msg
set .checksum = poor_hash(.msg, id)
set .key = I2S(id)
return this
endmethod
private method onDestroy takes nothing returns nothing
call FlushStoredInteger(gc, M_KEY_VAL+.key, .msg)
call FlushStoredInteger(gc, M_KEY_CHK+.key, .key)
set .msg = null
set .key = null
set .next = 0
endmethod
public method send takes nothing returns nothing
call StoreInteger(gc, M_KEY_VAL+.key, .msg, .checksum)
call StoreInteger(gc, M_KEY_CHK+.key, .key, .checksum)
call SyncStoredInteger(gc, M_KEY_VAL+.key, .msg)
call SyncStoredInteger(gc, M_KEY_CHK+.key, .key)
endmethod
endstruct
///Returns true for a fixed size uniform random subset of players in the game
private function isEmitter takes nothing returns boolean
local integer i = 0
local integer n = 0
local integer r
local integer array picks
local boolean array pick_flags
loop
exitwhen i >= 12
if GetPlayerController(Player(i)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
if n < num_senders then //initializing picks
set picks[n] = i
set pick_flags[i] = true
else //maintain the invariant 'P(being picked) = c/n'
set r = GetRandomInt(0, n)
if r < num_senders then
set pick_flags[picks[r]] = false
set picks[r] = i
set pick_flags[i] = true
endif
endif
set n = n + 1
endif
set i = i + 1
endloop
return pick_flags[GetPlayerId(GetLocalPlayer())]
endfunction
///Places meta-data in the replay and in network traffic
private function emit takes string message returns nothing
local QueueNode q
if not initialized then
call BJDebugMsg("MMD Emit Error: Library not initialized yet.")
return
endif
//remember sent messages for tamper check
set q = QueueNode.create(num_msg, message)
if q_head == 0 then
set q_head = q
else
set q_tail.next = q
endif
set q_tail = q
//send new message
set num_msg = num_msg + 1
if isEmitter() then
call q.send()
endif
endfunction
///Performs tamper checks
private function tick takes nothing returns nothing
local QueueNode q
local integer i
//check previously sent messages for tampering
set q = q_head
loop
exitwhen q == 0 or q.timeout >= time()
if not HaveStoredInteger(gc, M_KEY_VAL+q.key, q.msg) then
call RaiseGuard("message skipping")
call q.send()
elseif not HaveStoredInteger(gc, M_KEY_CHK+q.key, q.key) then
call RaiseGuard("checksum skipping")
call q.send()
elseif GetStoredInteger(gc, M_KEY_VAL+q.key, q.msg) != q.checksum then
call RaiseGuard("message tampering")
call q.send()
elseif GetStoredInteger(gc, M_KEY_CHK+q.key, q.key) != q.checksum then
call RaiseGuard("checksum tampering")
call q.send()
endif
set q_head = q.next
call q.destroy()
set q = q_head
endloop
if q_head == 0 then
set q_tail = 0
endif
//check for future message tampering
set i = 0
loop
exitwhen not HaveStoredInteger(gc, M_KEY_CHK+I2S(num_msg), I2S(num_msg))
call RaiseGuard("message insertion")
call emit("Blank")
set i = i + 1
exitwhen i >= 10
endloop
endfunction
///Replaces control characters with escape sequences
private function pack takes string value returns string
local integer j
local integer i = 0
local string result = ""
local string c
loop //for each character in argument string
exitwhen i >= StringLength(value)
set c = SubString(value, i, i+1)
set j = 0
loop //for each character in escaped chars string
exitwhen j >= StringLength(ESCAPED_CHARS)
//escape control characters
if c == SubString(ESCAPED_CHARS, j, j+1) then
set c = "\\" + c
exitwhen true
endif
set j = j + 1
endloop
set result = result + c
set i = i + 1
endloop
return result
endfunction
///Updates the value of a defined variable for a given player
private function update_value takes string name, player p, string op, string value, integer val_type returns nothing
local integer id = GetPlayerId(p)
if p == null or id < 0 or id >= 12 then
call BJDebugMsg("MMD Set Error: Invalid player. Must be P1 to P12.")
elseif val_type != GetStoredInteger(gc, "types", name) then
call BJDebugMsg("MMD Set Error: Updated value of undefined variable or used value of incorrect type.")
elseif StringLength(op) == 0 then
call BJDebugMsg("MMD Set Error: Unrecognized operation type.")
elseif StringLength(name) > 50 then
call BJDebugMsg("MMD Set Error: Variable name is too long.")
elseif StringLength(name) == 0 then
call BJDebugMsg("MMD Set Error: Variable name is empty.")
else
call emit("VarP " + I2S(id) + " " + pack(name) + " " + op + " " + value)
endif
endfunction
///Defines an event's arguments and format
private function DefineEvent takes string name, integer num_args, string format, string arg_data returns nothing
if GetStoredInteger(gc, "events", name) != 0 then
call BJDebugMsg("MMD DefEvent Error: Event redefined.")
else
call StoreInteger(gc, "events", name, num_args+1)
call emit("DefEvent " + pack(name) + " " + I2S(num_args) + " " + arg_data + pack(format))
endif
endfunction
///Places an event in the meta-data
private function LogEvent takes string name, integer num_args, string data returns nothing
if GetStoredInteger(gc, "events", name) != num_args+1 then
call BJDebugMsg("MMD LogEvent Error: Event not defined or defined with different # of args.")
else
call emit("Event " + pack(name) + data)
endif
endfunction
///////////////////////////////////////////////////////////////
/// Public functions
///////////////////////////////////////////////////////////////
///Sets a player flag like "win_on_leave"
public function FlagPlayer takes player p, integer flag_type returns nothing
local string flag = flags[flag_type]
local integer id = GetPlayerId(p)
if p == null or id < 0 or id >= 12 then
call BJDebugMsg("MMD Flag Error: Invalid player. Must be P1 to P12.")
elseif StringLength(flag) == 0 then
call BJDebugMsg("MMD Flag Error: Unrecognized flag type.")
elseif GetPlayerController(Player(id)) == MAP_CONTROL_USER then
call emit("FlagP " + I2S(id) + " " + flag)
endif
endfunction
///Defines a variable to store things in
public function DefineValue takes string name, integer value_type, integer goal_type, integer suggestion_type returns nothing
local string goal = goals[goal_type]
local string vtype = types[value_type]
local string stype = suggestions[suggestion_type]
if goal == null then
call BJDebugMsg("MMD Def Error: Unrecognized goal type.")
elseif vtype == null then
call BJDebugMsg("MMD Def Error: Unrecognized value type.")
elseif stype == null then
call BJDebugMsg("Stats Def Error: Unrecognized suggestion type.")
elseif StringLength(name) > 32 then
call BJDebugMsg("MMD Def Error: Variable name is too long.")
elseif StringLength(name) == 0 then
call BJDebugMsg("MMD Def Error: Variable name is empty.")
elseif value_type == TYPE_STRING and goal_type != GOAL_NONE then
call BJDebugMsg("MMD Def Error: Strings must have goal type of none.")
elseif GetStoredInteger(gc, "types", name) != 0 then
call BJDebugMsg("MMD Def Error: Value redefined.")
else
call StoreInteger(gc, "types", name, value_type)
call emit("DefVarP " + pack(name) + " " + vtype + " " + goal + " " + stype)
endif
endfunction
///Updates the value of an integer variable
public function UpdateValueInt takes string name, player p, integer op, integer value returns nothing
call update_value(name, p, ops[op], I2S(value), TYPE_INT)
endfunction
///Updates the value of a real variable
public function UpdateValueReal takes string name, player p, integer op, real value returns nothing
call update_value(name, p, ops[op], R2S(value), TYPE_REAL)
endfunction
///Updates the value of a string variable
public function UpdateValueString takes string name, player p, string value returns nothing
local string q = "\""
call update_value(name, p, ops[OP_SET], q + pack(value) + q, TYPE_STRING)
endfunction
public function DefineEvent0 takes string name, string format returns nothing
call DefineEvent(name, 0, format, "")
endfunction
public function DefineEvent1 takes string name, string format, string argName0 returns nothing
call DefineEvent(name, 1, format, pack(argName0) + " ")
endfunction
public function DefineEvent2 takes string name, string format, string argName0, string argName1 returns nothing
call DefineEvent(name, 2, format, pack(argName0) + " " + pack(argName1) + " ")
endfunction
public function DefineEvent3 takes string name, string format, string argName0, string argName1, string argName2 returns nothing
call DefineEvent(name, 3, format, pack(argName0) + " " + pack(argName1) + " " + pack(argName2) + " ")
endfunction
public function LogEvent0 takes string name returns nothing
call LogEvent(name, 0, "")
endfunction
public function LogEvent1 takes string name, string arg0 returns nothing
call LogEvent(name, 1, " " + pack(arg0))
endfunction
public function LogEvent2 takes string name, string arg0, string arg1 returns nothing
call LogEvent(name, 2, " " + pack(arg0) + " " + pack(arg1))
endfunction
public function LogEvent3 takes string name, string arg0, string arg1, string arg2 returns nothing
call LogEvent(name, 3, " " + pack(arg0) + " " + pack(arg1) + " " + pack(arg2))
endfunction
///Emits meta-data which parsers will ignore unless they are customized to understand it
public function LogCustom takes string unique_identifier, string data returns nothing
call emit("custom " + pack(unique_identifier) + " " + pack(data))
endfunction
///////////////////////////////////////////////////////////////
/// Initialization
///////////////////////////////////////////////////////////////
///Emits initialization data
private function init2 takes nothing returns nothing
local integer i
local trigger t
set initialized = true
call emit("init version " + I2S(MINIMUM_PARSER_VERSION) + " " + I2S(CURRENT_VERSION))
set i = 0
loop
exitwhen i >= 12
if GetPlayerController(Player(i)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
call emit("init pid " + I2S(i) + " " + pack(GetPlayerName(Player(i))))
endif
set i = i + 1
endloop
set t = CreateTrigger()
call TriggerAddAction(t, function tick)
call TriggerRegisterTimerEvent(t, 0.37, true)
endfunction
///Places init2 on a timer, initializes game cache, and translates constants
private function init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEvent(t, 0, false)
call TriggerAddAction(t, function init2)
set goals[GOAL_NONE] = "none"
set goals[GOAL_HIGH] = "high"
set goals[GOAL_LOW] = "low"
set types[TYPE_INT] = "int"
set types[TYPE_REAL] = "real"
set types[TYPE_STRING] = "string"
set suggestions[SUGGEST_NONE] = "none"
set suggestions[SUGGEST_TRACK] = "track"
set suggestions[SUGGEST_LEADERBOARD] = "leaderboard"
set ops[OP_ADD] = "+="
set ops[OP_SUB] = "-="
set ops[OP_SET] = "="
set flags[FLAG_DRAWER] = "drawer"
set flags[FLAG_LOSER] = "loser"
set flags[FLAG_WINNER] = "winner"
set flags[FLAG_LEAVER] = "leaver"
set flags[FLAG_PRACTICING] = "practicing"
call FlushGameCache(InitGameCache(FILENAME))
set gc = InitGameCache(FILENAME)
call TimerStart(clock, 999999999, false, null)
call prepC2I()
endfunction
endlibrary
//TESH.scrollpos=87
//TESH.alwaysfold=0
//////////////////////////////////////////////////////////////
/// The Map Meta Data Library
/// Version: BETA
/// Last Modified: February 11, 2009
/// Author Chain: Strilanc, [insert next ...]
///////////////////////////////////////////////////////////////
/// This library is used to emit standardized meta data which replay parsers and bot hosts can use to record relevant
/// game statistics like "hero kills" which would otherwise be impossible to record automatically.
///
/// In particular, the flag function can be used to indicate if a leaver should be awarded a win or not. Replays
/// don't contain enough information to easily tell winners who leave from losers who leave. (for example: while
/// a final leaderboard is showing)
///////////////////////////////////////////////////////////////
/// Interface:
/// void FlagPlayer(player, flag_constant)
/// void DefineValue(name, type_constant, goal_constant, reduction_constant, priority)
/// void UpdateValueInt(name, player, operation_constant, value)
/// void UpdateValueReal(name, player, operation_constant, value)
/// void UpdateValueString(name, player, operation_constant, value)
///////////////////////////////////////////////////////////////
/// Notes:
/// - Errors are displayed using BJDebugMsg
/// - Don't try to update a value before defining it
/// - Parsers expect a very specific format, don't screw with the library's output.
/// - The goal and reduction constants are used for combining values from multiple games. For example,
/// use GOAL_HIGH and REDUCE_BEST to track the best round, or GOAL_HIGH and REDUCE_SUM to track total kills.
///////////////////////////////////////////////////////////////
library MMD initializer init
globals
public constant integer REDUCE_NONE = 1
public constant integer REDUCE_SUM = 2
public constant integer REDUCE_BEST = 4
public constant integer REDUCE_LAST = 8
public constant integer GOAL_NONE = 1
public constant integer GOAL_HIGH = 2
public constant integer GOAL_LOW = 3
public constant integer TYPE_STRING = 1
public constant integer TYPE_REAL = 2
public constant integer TYPE_INT = 3
public constant integer OP_ADD = 1
public constant integer OP_SUB = 2
public constant integer OP_SET = 3
public constant integer FLAG_DRAW_ON_LEAVE = 1
public constant integer FLAG_LOSE_ON_LEAVE = 2
public constant integer FLAG_WIN_ON_LEAVE = 3
endglobals
///////////////////////////////////////////////////////////////
/// Private variables and constants
///////////////////////////////////////////////////////////////
globals
private string array flags
private string array goals
private string array ops
private string array reduces
private string array types
private string array names
private boolean initialized = false
private gamecache gc = null
private string ESCAPED_CHARS = " \"\\"
private constant string FILENAME = "MapMetaData.vBETA"
private constant string MISSION_KEY_PREFIX = "msgid:"
private constant integer SUFFIX_VAL = 'meta'
private integer num_msg = 0
private player cp = Player(0)
endglobals
///////////////////////////////////////////////////////////////
/// Private functions
///////////////////////////////////////////////////////////////
///Returns one of the users playing the game
private function emitter takes nothing returns player
local integer i = GetPlayerId(cp)
loop
set cp = Player(i)
exitwhen GetPlayerController(cp) == MAP_CONTROL_USER and GetPlayerSlotState(cp) == PLAYER_SLOT_STATE_PLAYING
set i = i + 1
endloop
return cp
endfunction
///Places meta-data in the replay and in network traffic
private function emit takes string message returns nothing
local string id = MISSION_KEY_PREFIX + I2S(num_msg)
set num_msg = num_msg + 1
call StoreInteger(gc, id, message, SUFFIX_VAL)
if GetLocalPlayer() == emitter() then
call SyncStoredInteger(gc, id, message)
endif
call FlushStoredInteger(gc, id, message)
endfunction
///Replaces control characters with escape sequences
private function pack takes string value returns string
local integer j
local integer i = 0
local string result = ""
local string c
loop //for each character in argument string
exitwhen i >= StringLength(value)
set c = SubString(value, i, i+1)
set j = 0
loop //for each character in escaped chars string
exitwhen j >= StringLength(ESCAPED_CHARS)
//escape control characters
if c == SubString(ESCAPED_CHARS, j, j+1) then
set c = "\\" + c
exitwhen true
endif
set j = j + 1
endloop
set result = result + c
set i = i + 1
endloop
return result
endfunction
///Updates the value of a defined variable for a given player
private function update_value takes string name, player p, string op, string value, integer val_type returns nothing
local integer id = GetPlayerId(p)
if not initialized then
call BJDebugMsg("Stats Set Error: Library not initialized yet.")
elseif p == null or id < 0 or id >= 12 then
call BJDebugMsg("Stats Set Error: Invalid player. Must be P1 to P12.")
elseif val_type != GetStoredInteger(gc, "types", name) then
call BJDebugMsg("Stats Set Error: Updated value of undefined variable or used value of incorrect type.")
elseif StringLength(op) == 0 then
call BJDebugMsg("Stats Set Error: Unrecognized operation type.")
elseif StringLength(name) > 50 then
call BJDebugMsg("Stats Set Error: Variable name is too long.")
elseif StringLength(name) == 0 then
call BJDebugMsg("Stats Set Error: Variable name is empty.")
elseif StringLength(names[id]) != 0 then
call emit("set " + pack(name) + " " + names[id] + " " + pack(op) + " " + pack(value))
endif
endfunction
///////////////////////////////////////////////////////////////
/// Public functions
///////////////////////////////////////////////////////////////
///Sets a player flag like "win_on_leave"
public function FlagPlayer takes player p, integer flag_type returns nothing
local string flag = flags[flag_type]
local integer id = GetPlayerId(p)
if not initialized then
call BJDebugMsg("Stats Flag Error: Library not initialized yet.")
elseif p == null or id < 0 or id >= 12 then
call BJDebugMsg("Stats Flag Error: Invalid player. Must be P1 to P12.")
elseif StringLength(flag) == 0 then
call BJDebugMsg("Stats Flag Error: Unrecognized flag type.")
elseif StringLength(names[id]) != 0 then
call emit("flag " + names[id] + " " + flag)
endif
endfunction
///Defines a variable to store things in
public function DefineValue takes string name, integer value_type, integer goal_type, integer reduce_type, integer priority returns nothing
local string goal = goals[goal_type]
local string reduce = reduces[reduce_type]
local string vtype = types[value_type]
if not initialized then
call BJDebugMsg("Stats Def Error: Library not initialized yet.")
elseif goal == null then
call BJDebugMsg("Stats Def Error: Unrecognized goal type.")
elseif reduce == null then
call BJDebugMsg("Stats Def Error: Unrecognized reduction type.")
elseif goal_type == GOAL_NONE and reduce_type == REDUCE_BEST then
call BJDebugMsg("Stats Def Error: reduce best requires goal type to be specified.")
elseif vtype == null then
call BJDebugMsg("Stats Def Error: Unrecognized value type.")
elseif priority < 0 then
call BJDebugMsg("Stats Def Error: Negative priority.")
elseif StringLength(name) > 50 then
call BJDebugMsg("Stats Def Error: Variable name is too long.")
elseif StringLength(name) == 0 then
call BJDebugMsg("Stats Def Error: Variable name is empty.")
elseif value_type == TYPE_STRING and goal_type != GOAL_NONE then
call BJDebugMsg("Stats Def Error: Strings must have goal type of none.")
elseif value_type == TYPE_STRING and reduce_type != REDUCE_NONE and reduce_type != REDUCE_LAST then
call BJDebugMsg("Stats Def Error: Strings must have reduce type of none or last.")
elseif GetStoredInteger(gc, "types", name) != 0 then
call BJDebugMsg("Stats Def Error: Value redefined.")
else
call StoreInteger(gc, "types", name, value_type)
call emit("def " + pack(name) + " " + vtype + " " + goal + " " + reduce + " " + I2S(priority))
endif
endfunction
///Updates the value of an integer variable
public function UpdateValueInt takes string name, player p, integer op, integer value returns nothing
call update_value(name, p, ops[op], I2S(value), TYPE_INT)
endfunction
///Updates the value of a real variable
public function UpdateValueReal takes string name, player p, integer op, real value returns nothing
call update_value(name, p, ops[op], R2S(value), TYPE_REAL)
endfunction
///Updates the value of a string variable
public function UpdateValueString takes string name, player p, integer op, string value returns nothing
call update_value(name, p, ops[op], "\"" + value + "\"", TYPE_STRING)
endfunction
///////////////////////////////////////////////////////////////
/// Initialization
///////////////////////////////////////////////////////////////
///Stores original player names, initializes game cache, and translates constants
private function init takes nothing returns nothing
local integer i = 0
loop
exitwhen i >= 12
if GetPlayerController(Player(i)) == MAP_CONTROL_USER then
set names[i] = GetPlayerName(Player(i))
if StringLength(names[i]) > 15 then
call BJDebugMsg("Stats Init Error: Player name was too long. Do not modify names during map init.")
endif
set names[i] = pack(names[i])
endif
set i = i + 1
endloop
set goals[GOAL_NONE] = "none"
set goals[GOAL_HIGH] = "high"
set goals[GOAL_LOW] = "low"
set reduces[REDUCE_NONE] = "none"
set reduces[REDUCE_LAST] = "last"
set reduces[REDUCE_SUM] = "sum"
set reduces[REDUCE_BEST] = "best"
set types[TYPE_INT] = "int"
set types[TYPE_REAL] = "real"
set types[TYPE_STRING] = "string"
set ops[OP_ADD] = "+="
set ops[OP_SUB] = "-="
set ops[OP_SET] = "="
set flags[FLAG_WIN_ON_LEAVE] = "win_on_leave"
set flags[FLAG_LOSE_ON_LEAVE] = "lose_on_leave"
set flags[FLAG_DRAW_ON_LEAVE] = "draw_on_leave"
call FlushGameCache(InitGameCache(FILENAME))
set gc = InitGameCache(FILENAME)
set initialized = true
endfunction
endlibrary
//TESH.scrollpos=77
//TESH.alwaysfold=0
Well, assuming you have added the W3MMD library to your map already, you would have to call
Code:
void DefineValue(name, type_constant, goal_constant, suggest_constant)
So name would be "kills", type_constant would be TYPE_INT (in the library), goal_constant would be GOAL_HIGH, suggest_constant just put SUGGEST_NONE.
Then to record it at the end of the game call:
Code:
void UpdateValueInt(name, player, operation_constant, value)
So name would be "kills", player would be the player variable, operation_constant would be OP_SET, and value would be kills_pX.
====================
Warcraft 3 Map Meta Data Standard
Version 1.00
**Introduction**
This standard defines a common language which warcraft 3 maps can use to communicate meta data to replay parsers, hosting bots, and possibly other tools.
All strings are case-sensitive.
Parsers should keep in mind the case of a player's name may differ from game to game.
**Message Format**
- The sub-packets carrying messages in the game data have the format byte 0x6B, string filename, string mission_key, string key, dword value.
- The strings are all null-terminated, and dwords are little-endian.
- Messages can be identified by the surrounding pattern:
kMMD.Dat[null]val:[decimal-number][null][message contents][null][dword]"
- Checksum messages can be identified by the surrounding pattern:
kMMD.Dat[null]chk:[decimal-number][null][decimal-number][null][dword]"
- Message ids start at 0 and increase by 1 for each message. IDs become very important in cases where cheaters try to fake messages.
- Messages are composed of a sequence of arguments separated by non-escaped spaces.
- Escape sequences are '\ ' for ' ' (space), '\\' for '\' (backslash).
- The dword value in the message is a weak checksum for the message. The parser does not need to know how to generate the checksum, as it is mainly used by the wc3 client to detects forgeries.
- A message must be followed by a checksum message with the message contents replaced by the msg id.
- The purpose of the checksum message is to allow friendly clients to detect tampering, and ultimately is only required because of the limitations of wc3 JASS.
- An example of data containing a message with checksum:
...
kMMD.Dat[null]val:0[null]init version 0 0[null][0xFFFFFFFF]
...
kMMD.Dat[null]chk:0[null]0[null][0xFFFFFFFF]
...
**Message Protocol**
It is relatively easy for clients to fake messages from the map. Security is built into the protocol as follows:
- Each individual message is sent by one or more players chosen at random (by the wc3 clients).
- All friendly wc3 clients will check the sent message checksum at a random time between ~7s to ~11s later (in game time), and send the correct message if it differs from what they expected.
- After a checksum fail is detected by the clients, the number of players sending messages will increase to dilute the abilities of cheaters.
- The parser is free to award loses, deduct values from variables, erase stats, and generally screw with players caught cheating.
- If a player sends multiple different messages with the same id, that player is cheating.
- If a player sends a message with id N more than 12 game seconds after at least one message is received for each id from 0 to N, the message should be ignored. (The player is lagging or cheating)
- If a player sends two messages out of order, that player is cheating. Note that due to network delay this does not apply to two messages sent from two players. Apply reasonable limits for that situation.
- If players disagree on the message for an id, some of the players are probably cheating, but it is up to the parser to decide what exactly identifies a cheater in this situation.
- Possible strategies a parser can use to identify the 'correct' message in the event of disagreement [you already know someone is cheating, but you need to know what the real message is]:
- Don't trust the players already identified as cheaters
- Use a majority vote
- Just ignore the message (not that cheaters may take advantage of ignoring messages to cancel important messages like "the other team won")
- If no players contradict a multiple-message from one player, accept the last message sent before the check interval
- Just accept the new message [easy, but abusable]
- Pick one of the messages at random [almost as easy, slightly less abusable]
- Remember the goal is to make cheating hard without punishing real players
**Message Types**
- init
Description: Provides initialization data.
Arguments: Sub Message, [Sub Type Arguments ...]
- Sub Message: Defines the initialization data being provided. Allowed values are "pid", "version".
- pid [id name]:
- Provides the game's player id and the name of the player the ID is associated with.
- The id will be used to reference the player in other messages.
- version [minimum current]:
- Provides the minimum version of the standard the map is compatible with, and the version the map is using
- Must be the first value the map emits.
Example1: init pid 0 Strilanc
Example2: init version 1 1
- DefVarP
Description: Defines a player variable.
- Integer and real variables have initial value 0.
- Strings have initial value "" (the empty string).
Arguments: Name, Value Type, Goal Type, Suggestion
- Name: The variable's name. Should be non-empty and no more than 32 characters in length (escape sequences count as only 1 character).
- Value Type: The variable's type. Allowed types are "real", "int" and "string".
- Goal Type: Defines the sort order on the variable [better to have high or low values]. Allowed values are "high", "low", and "none".
- Suggestion: A suggestion for what the parser should do for tracking the value. Allowed values are "none", "track", "leaderboard".
Example1: DefVarP hero_kills int high leaderboard
Example2: DefVarP hero_deaths int low leaderboard
Example3: DefVarP gold_earned int high track
- VarP
Decription: Changes the value of a player variable.
Arguments: Variable PID, Name, Operation, Value
- Variable Name: The name of the variable to modify.
- PID: The PID of the player for which the variable will be modified.
- Operation: The operation to apply to the variable. Allowed values are "=", "+=", "-=". Only "=" is allowed for strings.
- Value: The value to use when applying the operation.
Example: VarP 0 kills += 1
- FlagP
Description: Sets a player flag.
Arguments: PID, Flag
- PID: The PID of the player to affect.
- Fla g: The flag to set. Allowed values are "winner", "loser", "drawer", "leaver", "practicing".
- Only the last winner/loser/drawer flag matters. A player does not receive 2 wins if 'winner' is sent twice.
- All flags still count if the player has already left the game.
- The 'leaver' flag is independent of the winner/loser/drawer flags, and is used to indicate a player left at a "non-appropriate" time.
- The 'practicing' flag disables all stat tracking for the player for the game. The effect on the player's stats should be as if the game had never been played.
- If winner/loser/drawer is not specified the parser is free to choose the game outcome. It can use other data to infer the outcome, default to a draw, ignore the game, etc.
Example1: FlagP 0 winner
Example2: FlagP 0 leaver
Example2: FlagP 1 practicing
- DefEvent
Description: Defines the display format and number of arguments to an event.
Arguments: name, #args, arguments, format
- name: The name of the event.
- #args: The number of arguments this event will have.
- format: The format string used for this event. {0} means first argument, {1} means 2nd, etc. Use {#:player} to convert PID args to player names.
- arguments: the names of each of the arguments. Special format: prefix with "pid:" to indicate argument is a player ID.
Example1: DefEvent winround 2 team round Team\ {0}\ wins\ round\ {1}.
Example2: DefEvent kill 2 pid:killer pid:victim {0}\ killed\ {1}
- Event
Description: Leaves an event in the log. Events are meant to represent things which can be combined and counted. Eg. 'X kills Y' naturally defines 'number of kills by X' and 'number of times Y killed'.
Arguments: name, args
- name: The name of an already-defined event.
- args: The arguments to use in the event's format string.
Example1: Event winround east 1
Example2: Event kill 0 5
- Blank
Description: A non-message used by clients to drown out cheaters preemptively sending messages.
Arguments: none
Example1: blank
Example2: blank
Example3: blank
Example4: blank
Example5: blank
Example35463: blank
- Custom
Description: A message whose contents are not defined by the standard. The parser should ignore these messages unless it understands what they mean.
Arguments: idstring, data...
- idstring: A hopefully unique string which should allow customized parsers to recognize formats they understand.
- data...: The remaining data for the custom message. May be composed of multiple words.
Example: Custom DotA_League_Format Ban 4
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_tester_Copy_Actions takes nothing returns nothing
local real r = R2SW(1,1,1
set udg_GameMode_String = SubStringBJ(udg_Temp_String, 2, 1)
set udg_Temp_String = "Positive Votes : " + I2SW(udg_VoteCountYes-udg_VoteCountNo, 1,1) + " (Require:" + R2SW( I2R(udg_Temp_Integer)*0.5, 1, 1) + ")"
endfunction
//===========================================================================
function InitTrig_tester_Copy takes nothing returns nothing
set gg_trg_tester_Copy = CreateTrigger( )
call DisableTrigger( gg_trg_tester_Copy )
call TriggerAddAction( gg_trg_tester_Copy, function Trig_tester_Copy_Actions )
endfunction
//TESH.scrollpos=12
//TESH.alwaysfold=0
///////////////////////////////////////////
/// HostBot Command Library
/// Last Modified: September 14, 2009
/// Authors: Strilanc,
/// v1.01
///////////////////////////////////////////
/// Reads a command string transparently encoded into player handicaps by hostbots.
/// Allows at most one character from "abcdefghijklmnopqrstuvwxyz0123456789 -=,." per player.
/// Empty slots don't count towards the player count, but computers do.
///////////////////////////////////////////
library HCL initializer init
globals
private string command = ""
endglobals
public function GetCommandString takes nothing returns string
return command
endfunction
private function init takes nothing returns nothing
local integer i
local integer j
local integer h
local integer v
local string chars = "abcdefghijklmnopqrstuvwxyz0123456789 -=,."
local integer array map
local boolean array blocked
//precompute mapping [have to avoid invalid and normal handicaps]
set blocked[0] = true
set blocked[50] = true
set blocked[60] = true
set blocked[70] = true
set blocked[80] = true
set blocked[90] = true
set blocked[100] = true
set i = 0
set j = 0
loop
if blocked[j] then
set j = j + 1
endif
exitwhen j >= 256
set map[j] = i
set i = i + 1
set j = j + 1
endloop
//Extract command string from player handicaps
set i = 0
loop
exitwhen i >= 12
set h = R2I(100*GetPlayerHandicap(Player(i)) + 0.5)
if not blocked[h] then
set h = map[h]
set v = h/6
set h = h-v*6
call SetPlayerHandicap(Player(i), 0.5 + h/10.0)
//set command = command + SubString(chars, v, v+1)
set udg_command = udg_command + SubString(chars, v, v+1)
endif
set i = i + 1
endloop
endfunction
endlibrary
//TESH.scrollpos=27
//TESH.alwaysfold=0
function Trig_HCL_Read_Command_Actions takes nothing returns nothing
local integer i
local integer j
local integer h
local integer v
local string chars = "abcdefghijklmnopqrstuvwxyz0123456789 -=,."
local integer array map
local boolean array blocked
//precompute mapping [have to avoid invalid and normal handicaps]
set blocked[0] = true
set blocked[50] = true
set blocked[60] = true
set blocked[70] = true
set blocked[80] = true
set blocked[90] = true
set blocked[100] = true
set i = 0
set j = 0
loop
if blocked[j] then
set j = j + 1
endif
exitwhen j >= 256
set map[j] = i
set i = i + 1
set j = j + 1
endloop
//Extract command string from player handicaps
set i = 0
loop
exitwhen i >= 12
set h = R2I(100*GetPlayerHandicap(Player(i)) + 0.5)
if not blocked[h] then
set h = map[h]
set v = h/6
set h = h-v*6
call SetPlayerHandicap(Player(i), 0.5 + h/10.0)
//set command = command + SubString(chars, v, v+1)
set udg_command = udg_command + SubString(chars, v, v+1)
endif
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_Read_HCL takes nothing returns nothing
set gg_trg_Read_HCL = CreateTrigger( )
call TriggerAddAction( gg_trg_Read_HCL, function Trig_HCL_Read_Command_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_W3MMD_Timer_Expired_Actions takes nothing returns nothing
if ( udg_W3MMD_Enable == true ) then
call TriggerExecute( gg_trg_W3MMD_UpdateValue )
endif
endfunction
//===========================================================================
function InitTrig_W3MMD_Timer_Expired takes nothing returns nothing
set gg_trg_W3MMD_Timer_Expired = CreateTrigger( )
call TriggerRegisterTimerExpireEvent( gg_trg_W3MMD_Timer_Expired, udg_W3MMDTimer )
call TriggerAddAction( gg_trg_W3MMD_Timer_Expired, function Trig_W3MMD_Timer_Expired_Actions )
endfunction
//TESH.scrollpos=176
//TESH.alwaysfold=0
///////////////////////////////////////////////////////////////
/// The Map Meta Data Library
/// Version: v1.00
/// Last Modified: April 24, 2009
/// Author Chain: Strilanc, [insert next ...]
///////////////////////////////////////////////////////////////
/// This library is used to emit standardized meta data which replay parsers and bot hosts can use to record relevant
/// game statistics like "hero kills" which would otherwise be impossible to record automatically.
///
/// In particular, the flag function can be used to indicate if a leaver should be awarded a win or not. Replays
/// don't contain enough information to easily tell winners who leave from losers who leave. (for example: people
/// who leave while end-game stats are being shown)
///////////////////////////////////////////////////////////////
/// Interface:
/// void FlagPlayer(player, flag_constant)
/// void DefineValue(name, type_constant, goal_constant, suggest_constant)
/// void UpdateValueInt(name, player, operation_constant, value)
/// void UpdateValueReal(name, player, operation_constant, value)
/// void UpdateValueString(name, player, value)
/// void DefineEvent0(name, format)
/// void DefineEvent1(name, format, argName1)
/// void DefineEvent2(name, format, argName1, argName2)
/// void DefineEvent3(name, format, argName1, argName2, argName3)
/// void LogEvent0(name)
/// void LogEvent1(name, arg0)
/// void LogEvent2(name, arg0, arg1)
/// void LogEvent3(name, arg0, arg1, arg2)
/// void LogCustom(unique_identifier, data)
/// void RaiseGuard(reason)
///////////////////////////////////////////////////////////////
/// Notes:
/// - Errors are displayed using BJDebugMsg
/// - Don't try to update a value before defining it
/// - Parsers expect a very specific format, don't screw with the library's output.
/// - If you emit a bunch of data per second, you will cause bandwidth problems for dial-up users. Try to avoid
/// emitting lots of data all at once except at the start and end of games or rounds.
/// - An event's format string uses {#} to represent arguments
/// - Calling RaiseGuard will increase the number of senders for each message from 1 to 3. This increases
/// security but uses more network bandwidth. It is done automatically if tampering is detected.
///////////////////////////////////////////////////////////////
library MMD initializer init
globals
public constant integer GOAL_NONE = 101
public constant integer GOAL_HIGH = 102
public constant integer GOAL_LOW = 103
public constant integer TYPE_STRING = 101
public constant integer TYPE_REAL = 102
public constant integer TYPE_INT = 103
public constant integer OP_ADD = 101
public constant integer OP_SUB = 102
public constant integer OP_SET = 103
public constant integer SUGGEST_NONE = 101
public constant integer SUGGEST_TRACK = 102
public constant integer SUGGEST_LEADERBOARD = 103
public constant integer FLAG_DRAWER = 101
public constant integer FLAG_LOSER = 102
public constant integer FLAG_WINNER = 103
public constant integer FLAG_LEAVER = 104
public constant integer FLAG_PRACTICING = 105
endglobals
///////////////////////////////////////////////////////////////
/// Private variables and constants
///////////////////////////////////////////////////////////////
globals
private constant boolean SHOW_DEBUG_MESSAGES = true
private constant string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-+= \\!@#$%^&*()/?>.<,;:'\"{}[]|`~"
private constant integer num_chars = StringLength(chars)
private string array flags
private string array goals
private string array ops
private string array types
private string array suggestions
private boolean initialized = false
private gamecache gc = null
private constant string ESCAPED_CHARS = " \\"
private constant integer CURRENT_VERSION = 1
private constant integer MINIMUM_PARSER_VERSION = 1
private constant integer SUFFIX_VAL = 'Hash'
private constant string FILENAME = "MMD.Dat"
private constant string M_KEY_VAL = "val:"
private constant string M_KEY_CHK = "chk:"
private constant integer NUM_SENDERS_NAIVE = 1
private constant integer NUM_SENDERS_SAFE = 1 // was 3
private integer num_senders = NUM_SENDERS_NAIVE
private integer num_msg = 0
private player cp = Player(0)
// private timer clock = CreateTimer()
//private string array q_msg
//private real array q_time
//private integer array q_index
//private keyword QueueNode
//private QueueNode q_head = 0
//private QueueNode q_tail = 0
endglobals
///////////////////////////////////////////////////////////////
/// Private functions
///////////////////////////////////////////////////////////////
///Initializes the char-to-int conversion
private function prepC2I takes nothing returns nothing
local integer i = 0
local string id
loop
exitwhen i >= num_chars
set id = SubString(chars, i, i+1)
if id == StringCase(id, true) then
set id = id + "U"
endif
call StoreInteger(gc, "c2i", id, i)
set i = i + 1
endloop
endfunction
///Converts a character to an integer
private function C2I takes string c returns integer
local integer i
local string id = c
if id == StringCase(id, true) then
set id = id + "U"
endif
set i = GetStoredInteger(gc, "c2i", id)
if (i < 0 or i >= num_chars or SubString(chars, i, i+1) != c) and HaveStoredInteger(gc, "c2i", id) then
//A cheater sent a fake sync to screw with the cached values
set i = 0
loop
exitwhen i >= num_chars //just a weird character
if c == SubString(chars, i, i+1) then //cheating!
//call RaiseGuard("c2i poisoned")
call StoreInteger(gc, "c2i", id, i)
exitwhen true
endif
set i = i + 1
endloop
endif
return i
endfunction
///Computes a weak hash value, hopefully secure enough for our purposes
private function poor_hash takes string s, integer seed returns integer
local integer n = StringLength(s)
local integer m = n + seed
local integer i = 0
loop
exitwhen i >= n
set m = m * 41 + C2I(SubString(s, i, i+1))
set i = i + 1
endloop
return m
endfunction
///Replaces control characters with escape sequences
public function pack takes string value returns string
local integer j
local integer i = 0
local string result = ""
local string c
loop //for each character in argument string
exitwhen i >= StringLength(value)
set c = SubString(value, i, i+1)
set j = 0
loop //for each character in escaped chars string
exitwhen j >= StringLength(ESCAPED_CHARS)
//escape control characters
if c == SubString(ESCAPED_CHARS, j, j+1) then
set c = "\\" + c
exitwhen true
endif
set j = j + 1
endloop
set result = result + c
set i = i + 1
endloop
return result
endfunction
///Returns one of the users playing the game
private function emitter takes nothing returns player
local integer i = GetPlayerId(cp)
loop
exitwhen i >= 10
if (GetPlayerController(cp) == MAP_CONTROL_USER and GetPlayerSlotState(cp) == PLAYER_SLOT_STATE_PLAYING ) then
set cp = Player(i)
endif
set i = i + 1
endloop
return cp
endfunction
///Returns one of the users playing the game
private function update_player takes nothing returns nothing
local boolean b = false
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 10
loop
exitwhen b == true
if ( IsPlayerInForce(Player(bj_forLoopAIndex-1), udg_IngamePlayers_PlayerGroup) == true ) then
set cp = Player(bj_forLoopAIndex - 1)
set b = true
else
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction
///Places meta-data in the replay and in network traffic
public function emit takes string message returns nothing
//send new message sequence
local string Seq = I2S(num_msg)
set num_msg = num_msg + 1
// store to local cache
call StoreInteger(gc, M_KEY_VAL+Seq, message, num_msg)
call StoreInteger(gc, M_KEY_CHK+Seq, Seq, num_msg)
//if(IsPlayerInForce(cp, udg_IngamePlayers_PlayerGroup)== false) then
// call update_player()
//endif
//if GetLocalPlayer() == cp then
call SyncStoredInteger(gc, M_KEY_VAL+Seq, message)
call SyncStoredInteger(gc, M_KEY_CHK+Seq, Seq)
//endif
// clear cache, wait for sync value
call FlushStoredInteger(gc, M_KEY_VAL+Seq, message)
call FlushStoredInteger(gc, M_KEY_CHK+Seq, Seq)
endfunction
///Updates the value of a defined variable for a given player
private function update_value takes string name, player p, string op, string value, integer val_type returns nothing
local integer id = GetPlayerId(p)
if p == null or id < 0 or id >= 12 then
call BJDebugMsg("MMD Set Error: Invalid player. Must be P1 to P12.")
elseif val_type != GetStoredInteger(gc, "types", name) then
call BJDebugMsg("MMD Set Error: Updated value of undefined variable or used value of incorrect type.")
elseif StringLength(op) == 0 then
call BJDebugMsg("MMD Set Error: Unrecognized operation type.")
elseif StringLength(name) > 50 then
call BJDebugMsg("MMD Set Error: Variable name is too long.")
elseif StringLength(name) == 0 then
call BJDebugMsg("MMD Set Error: Variable name is empty.")
else
call emit("VarP " + I2S(id) + " " + pack(name) + " " + op + " " + value)
endif
endfunction
///Defines an event's arguments and format
private function DefineEvent takes string name, integer num_args, string format, string arg_data returns nothing
if GetStoredInteger(gc, "events", name) != 0 then
call BJDebugMsg("MMD DefEvent Error: Event redefined.")
else
call StoreInteger(gc, "events", name, num_args+1)
call emit("DefEvent " + pack(name) + " " + I2S(num_args) + " " + arg_data + pack(format))
endif
endfunction
///Places an event in the meta-data
private function LogEvent takes string name, integer num_args, string data returns nothing
if GetStoredInteger(gc, "events", name) != num_args+1 then
call BJDebugMsg("MMD LogEvent Error: Event not defined or defined with different # of args.")
else
call emit("Event " + pack(name) + data)
endif
endfunction
///////////////////////////////////////////////////////////////
/// Public functions
///////////////////////////////////////////////////////////////
///Sets a player flag like "win_on_leave"
public function FlagPlayer takes player p, integer flag_type returns nothing
local string flag = flags[flag_type]
local integer id = GetPlayerId(p)
if p == null or id < 0 or id >= 12 then
call BJDebugMsg("MMD Flag Error: Invalid player. Must be P1 to P12.")
elseif StringLength(flag) == 0 then
call BJDebugMsg("MMD Flag Error: Unrecognized flag type.")
elseif GetPlayerController(Player(id)) == MAP_CONTROL_USER then
call emit("FlagP " + I2S(id) + " " + flag)
endif
endfunction
///Defines a variable to store things in
public function DefineValue takes string name, integer value_type, integer goal_type, integer suggestion_type returns nothing
local string goal = goals[goal_type]
local string vtype = types[value_type]
local string stype = suggestions[suggestion_type]
if goal == null then
call BJDebugMsg("MMD Def Error: Unrecognized goal type.")
elseif vtype == null then
call BJDebugMsg("MMD Def Error: Unrecognized value type.")
elseif stype == null then
call BJDebugMsg("Stats Def Error: Unrecognized suggestion type.")
elseif StringLength(name) > 32 then
call BJDebugMsg("MMD Def Error: Variable name is too long.")
elseif StringLength(name) == 0 then
call BJDebugMsg("MMD Def Error: Variable name is empty.")
elseif value_type == TYPE_STRING and goal_type != GOAL_NONE then
call BJDebugMsg("MMD Def Error: Strings must have goal type of none.")
elseif GetStoredInteger(gc, "types", name) != 0 then
call BJDebugMsg("MMD Def Error: Value redefined.")
else
call StoreInteger(gc, "types", name, value_type)
call emit("DefVarP " + pack(name) + " " + vtype + " " + goal + " " + stype)
endif
endfunction
///Updates the value of an integer variable
public function UpdateValueInt takes string name, player p, integer op, integer value returns nothing
call update_value(name, p, ops[op], I2S(value), TYPE_INT)
endfunction
///Updates the value of a real variable
public function UpdateValueReal takes string name, player p, integer op, real value returns nothing
call update_value(name, p, ops[op], R2S(value), TYPE_REAL)
endfunction
///Updates the value of a string variable
public function UpdateValueString takes string name, player p, string value returns nothing
local string q = "\""
call update_value(name, p, ops[OP_SET], q + pack(value) + q, TYPE_STRING)
endfunction
public function DefineEvent0 takes string name, string format returns nothing
call DefineEvent(name, 0, format, "")
endfunction
public function DefineEvent1 takes string name, string format, string argName0 returns nothing
call DefineEvent(name, 1, format, pack(argName0) + " ")
endfunction
public function DefineEvent2 takes string name, string format, string argName0, string argName1 returns nothing
call DefineEvent(name, 2, format, pack(argName0) + " " + pack(argName1) + " ")
endfunction
public function DefineEvent3 takes string name, string format, string argName0, string argName1, string argName2 returns nothing
call DefineEvent(name, 3, format, pack(argName0) + " " + pack(argName1) + " " + pack(argName2) + " ")
endfunction
public function LogEvent0 takes string name returns nothing
call LogEvent(name, 0, "")
endfunction
public function LogEvent1 takes string name, string arg0 returns nothing
call LogEvent(name, 1, " " + pack(arg0))
endfunction
public function LogEvent2 takes string name, string arg0, string arg1 returns nothing
call LogEvent(name, 2, " " + pack(arg0) + " " + pack(arg1))
endfunction
public function LogEvent3 takes string name, string arg0, string arg1, string arg2 returns nothing
call LogEvent(name, 3, " " + pack(arg0) + " " + pack(arg1) + " " + pack(arg2))
endfunction
///Emits meta-data which parsers will ignore unless they are customized to understand it
public function LogCustom takes string unique_identifier, string data returns nothing
call emit("custom " + pack(unique_identifier) + " " + pack(data))
endfunction
///////////////////////////////////////////////////////////////
/// Initialization
///////////////////////////////////////////////////////////////
///Emits initialization data
private function init2 takes nothing returns nothing
local integer i
local trigger t
set initialized = true
call emit("init version " + I2S(MINIMUM_PARSER_VERSION) + " " + I2S(CURRENT_VERSION))
set i = 0
loop
exitwhen i >= 12
if GetPlayerController(Player(i)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
call emit("init pid " + I2S(i) + " " + pack(GetPlayerName(Player(i))))
endif
set i = i + 1
endloop
// set t = CreateTrigger()
//call TriggerAddAction(t, function tick)
//call TriggerRegisterTimerEvent(t, 0.37, true)
endfunction
///Places init2 on a timer, initializes game cache, and translates constants
private function init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEvent(t, 0, false)
call TriggerAddAction(t, function init2)
set goals[GOAL_NONE] = "none"
set goals[GOAL_HIGH] = "high"
set goals[GOAL_LOW] = "low"
set types[TYPE_INT] = "int"
set types[TYPE_REAL] = "real"
set types[TYPE_STRING] = "string"
set suggestions[SUGGEST_NONE] = "none"
set suggestions[SUGGEST_TRACK] = "track"
set suggestions[SUGGEST_LEADERBOARD] = "leaderboard"
set ops[OP_ADD] = "+="
set ops[OP_SUB] = "-="
set ops[OP_SET] = "="
set flags[FLAG_DRAWER] = "drawer"
set flags[FLAG_LOSER] = "loser"
set flags[FLAG_WINNER] = "winner"
set flags[FLAG_LEAVER] = "leaver"
set flags[FLAG_PRACTICING] = "practicing"
call FlushGameCache(InitGameCache(FILENAME))
set gc = InitGameCache(FILENAME)
//call TimerStart(clock, 999999999, false, null)
//call prepC2I()
endfunction
endlibrary
//TESH.scrollpos=6
//TESH.alwaysfold=0
// this trigger will run when :
// - "Start Game" trigger
function Trig_W3MMD_SetupInitialValue_Function takes nothing returns nothing
// player name is constant, not need to update
//call MMD_UpdateValueString( "player_name", GetEnumPlayer(), GetPlayerName(GetEnumPlayer()) )
//call MMD_FlagPlayer(GetEnumPlayer(), 105 ) // FLAG_PRACTICING = 105
local string q = "\""
local string race_picker = "Race_Picker"
call MMD_emit("VarP " + I2S(GetPlayerId(GetEnumPlayer())) + " " + "name" + " " + "=" + " " +q+ GetPlayerName(GetEnumPlayer()) +q)
//call MMD_emit("FlagP " + I2S(GetPlayerId(GetEnumPlayer())) + " " + "practicing")
// record game mode
set udg_Temp_String = SubString( udg_ModeString, 1, 3)
call MMD_emit("VarP " + I2S(GetPlayerId(GetEnumPlayer())) + " " + "game_mode" + " " + "=" + " " +q+udg_Temp_String +q ) // record game mode
call MMD_emit("VarP " + I2S(GetPlayerId(GetEnumPlayer())) + " " + "race" + " " + "=" + " " +q+race_picker +q ) // race
call MMD_emit("VarP " + I2S(GetPlayerId(GetEnumPlayer())) + " " + "level" + " " + "=" + " " +"0" ) // level
call MMD_emit("VarP " + I2S(GetPlayerId(GetEnumPlayer())) + " " + "score" + " " + "=" + " " +"0" ) // score
call MMD_emit("VarP " + I2S(GetPlayerId(GetEnumPlayer())) + " " + "seconds" + " " + "=" + " " +"0" ) // score
endfunction
function Trig_W3MMD_DefineValue_Actions takes nothing returns nothing
if ( udg_W3MMD_Enable == false ) then
return
endif
// "int"+ "string"+
call MMD_emit("DefVarP " + "game_mode" + " " + "string"+ " " + "high"+ " " + "leaderboard") // race
call MMD_emit("DefVarP " + "name" + " " + "string"+ " " + "high"+ " " + "leaderboard") // name
call MMD_emit("DefVarP " + "value" + " " + "int"+ " " + "high"+ " " + "leaderboard") // value
call MMD_emit("DefVarP " + "income" + " " + "int"+ " " + "high"+ " " + "leaderboard") // income
call MMD_emit("DefVarP " + "score" + " " + "int"+ " " + "high"+ " " + "leaderboard") // score
call MMD_emit("DefVarP " + "level" + " " + "int"+ " " + "high"+ " " + "leaderboard") // level
call MMD_emit("DefVarP " + "seconds" + " " + "int"+ " " + "high"+ " " + "leaderboard") // game time
call MMD_emit("DefVarP " + "lumberjack" + " " + "int"+ " " + "high"+ " " + "leaderboard") // lumberjack
call MMD_emit("DefVarP " + "lumber_total" + " " + "int"+ " " + "high"+ " " + "leaderboard") // total lumber
call MMD_emit("DefVarP " + "gold_total" + " " + "int"+ " " + "high"+ " " + "leaderboard") // total gold
call MMD_emit("DefVarP " + "gold_income" + " " + "int"+ " " + "high"+ " " + "leaderboard") // total gold from income
call MMD_emit("DefVarP " + "race" + " " + "string"+ " " + "high"+ " " + "leaderboard") // race
call ForForce( udg_IngamePlayers_PlayerGroup, function Trig_W3MMD_SetupInitialValue_Function )
endfunction
//===========================================================================
function InitTrig_W3MMD_DefineValue takes nothing returns nothing
set gg_trg_W3MMD_DefineValue = CreateTrigger( )
call TriggerAddAction( gg_trg_W3MMD_DefineValue, function Trig_W3MMD_DefineValue_Actions )
endfunction
//TESH.scrollpos=4
//TESH.alwaysfold=0
// this trigger will run when :
// - wave end
function Trig_W3MMD_UpdateValue_Function takes nothing returns nothing
local player p = GetEnumPlayer()
local integer id = GetPlayerId(p) + 1
local string q = ""
local string qs = "\""
local string sid = I2S(GetPlayerId(p))
//OP_SET = 103 FLAG_PRACTICING = 105
// update flag
call MMD_emit("VarP " + sid + " " + "value" + " " + "=" + " " +I2S(udg_FightersValue[id]) ) // update value
call MMD_emit("VarP " + sid + " " + "income" + " " + "=" + " " + I2S( udg_PlayerIncome[id] )) // update income
call MMD_emit("VarP " + sid + " " + "level" + " " + "=" + " " +I2S( udg_Level_Integer )) // update level
call MMD_emit("VarP " + sid + " " + "gold_income" + " " + "=" + " " + I2S( udg_GoldFromIncome[id] ))
call MMD_emit("VarP " + sid + " " + "race" + " " + "=" + " " +qs+ udg_PlayerRaceTotal[id]+qs ) // update race
// update score
set udg_Temp_Integer = udg_TotalScore[id]/udg_Level_Integer - udg_Leaks[id]
call MMD_emit("VarP " + sid + " " + "score" + " " + "=" + " " +I2S( udg_Temp_Integer ) )
// update game time in seconds
set udg_Temp_Integer = ( udg_NumberOfHours*3600 + udg_NumberOfMinutes*60 + udg_NumberOfSeconds )
call MMD_emit("VarP " + sid + " " + "seconds" + " " + "=" + " " + I2S( udg_Temp_Integer ))
set udg_PlayerTime[id] = udg_Temp_Integer
// update wisp & lumberjack
set udg_Temp_Integer = ( GetPlayerTechCount(p, 'R003', true) + GetPlayerTechCount(p, 'R00H', true) )
set udg_Temp_String = ( I2S(udg_numWorkers[id]) + ( "/" + I2S(udg_Temp_Integer) ) )
call MMD_emit("VarP " + sid + " " + "lumberjack" + " " + "=" + " " + I2S( udg_Temp_Integer ))
call MMD_emit("VarP " + sid + " " + "gold_total" + " " + "=" + " " + I2S( GetPlayerState(p, PLAYER_STATE_GOLD_GATHERED) ))
call MMD_emit("VarP " + sid + " " + "lumber_total" + " " + "=" + " " + I2S( GetPlayerState(p, PLAYER_STATE_LUMBER_GATHERED) ))
set p = null
endfunction
function Trig_W3MMD_UpdateValue1_Actions takes nothing returns nothing
//call DisplayTextToPlayer(p, 0, 0, "Race="+udg_PlayerRaceTotal[id])
//call DisplayTimedTextToForce( bj_FORCE_ALL_PLAYERS, 15.00, "|cffFF0000WARNING(Beta Version):|r |c00fe890dW3MMD is updating.... please bug report if mass disconnect or server split in next 5 seconds |r " )
call ForForce( udg_IngamePlayers_PlayerGroup, function Trig_W3MMD_UpdateValue_Function )
endfunction
//===========================================================================
function InitTrig_W3MMD_UpdateValue takes nothing returns nothing
set gg_trg_W3MMD_UpdateValue = CreateTrigger( )
call TriggerAddAction( gg_trg_W3MMD_UpdateValue, function Trig_W3MMD_UpdateValue1_Actions )
endfunction
//TESH.scrollpos=30
//TESH.alwaysfold=0
// this trigger will run when :
// - game over "end score" trigger
function Trig_W3MMD_End_Game_Function takes nothing returns nothing
local player p = GetEnumPlayer()
local integer id = GetPlayerId(p) + 1
local string q = ""
local string qs = "\""
local string sid = I2S(GetPlayerId(p))
set udg_Temp_Integer = ( udg_NumberOfHours*3600 + udg_NumberOfMinutes*60 + udg_NumberOfSeconds )
// Update Player Flag
if ( IsPlayerInForce(GetEnumPlayer(), udg_IngamePlayers_PlayerGroup) == true ) then
if ( IsPlayerAlly(GetEnumPlayer(), udg_WinningAlliance) == true ) then
call MMD_emit("FlagP " + sid + " " + "winner") /// winner team
else
call MMD_emit("FlagP " + sid + " " + "loser") // loser team
endif
// update level
call MMD_emit("VarP " + sid + " " + "level" + " " + "=" + " " + I2S( udg_Level_Integer ))
// update game time in seconds
call MMD_emit("VarP " + sid + " " + "seconds" + " " + "=" + " " + I2S( udg_Temp_Integer ))
// update score
set udg_Temp_Integer = udg_TotalScore[id]/(udg_Level_Integer-1) - udg_Leaks[id]
call MMD_emit("VarP " + sid + " " + "score" + " " + "=" + " " +I2S( udg_Temp_Integer ) )
else
// flag loser or winner if leave 2 minutes ago
if ((udg_Temp_Integer - udg_PlayerTime[id] ) < 180 ) then
if ( IsPlayerAlly(GetEnumPlayer(), udg_WinningAlliance) == true ) then
call MMD_emit("FlagP " + sid + " " + "winner") /// winner team
else
call MMD_emit("FlagP " + sid + " " + "loser") // loser team
endif
else
// flag as leaver if leave more than 3 minutes ago
call MMD_emit("FlagP " + sid + " " + "leaver") // leaver team
endif
endif
call MMD_emit("VarP " + sid + " " + "value" + " " + "=" + " " + I2S(udg_FightersValue[id]) ) // update value
call MMD_emit("VarP " + sid + " " + "income" + " " + "=" + " " + I2S( udg_PlayerIncome[id] ) ) // update income
call MMD_emit("VarP " + sid + " " + "gold_income" + " " + "=" + " " + I2S( udg_GoldFromIncome[id] ))
// update wisp & lumberjack
set udg_Temp_Integer = ( GetPlayerTechCount(p, 'R003', true) + GetPlayerTechCount(p, 'R00H', true) )
set udg_Temp_String = ( I2S(udg_numWorkers[id]) + ( "/" + I2S(udg_Temp_Integer) ) )
call MMD_emit("VarP " + sid + " " + "lumberjack" + " " + "=" + " " + I2S( udg_Temp_Integer ))
call MMD_emit("VarP " + sid + " " + "gold_total" + " " + "=" + " " + I2S( GetPlayerState(p, PLAYER_STATE_GOLD_GATHERED) ) )
call MMD_emit("VarP " + sid + " " + "lumber_total" + " " + "=" + " " + I2S( GetPlayerState(p, PLAYER_STATE_LUMBER_GATHERED) ) )
set p = null
endfunction
function Trig_W3MMD_End_Game_Actions takes nothing returns nothing
if ( udg_W3MMD_Enable == true ) then
call ForForce( udg_IngamePlayers_forMultiboard, function Trig_W3MMD_End_Game_Function )
endif
endfunction
//===========================================================================
function InitTrig_W3MMD_End_Game takes nothing returns nothing
set gg_trg_W3MMD_End_Game = CreateTrigger( )
call TriggerAddAction( gg_trg_W3MMD_End_Game, function Trig_W3MMD_End_Game_Actions )
endfunction
//TESH.scrollpos=44
//TESH.alwaysfold=0
function Trig_Setup_Recommend_Value_Actions takes nothing returns nothing
// Helper Function
set udg_RecommendValue[1] = "250"
set udg_RecommendValue[2] = "350"
set udg_RecommendValue[3] = "500"
set udg_RecommendValue[4] = "650"
set udg_RecommendValue[5] = "800"
set udg_RecommendValue[6] = "1000"
set udg_RecommendValue[7] = "1200"
set udg_RecommendValue[8] = "1450"
set udg_RecommendValue[9] = "1600"
set udg_RecommendValue[10] = "1850"
set udg_RecommendValue[11] = "2050"
set udg_RecommendValue[12] = "2400"
set udg_RecommendValue[13] = "2700"
set udg_RecommendValue[14] = "3100"
set udg_RecommendValue[15] = "3500"
set udg_RecommendValue[16] = "4000"
set udg_RecommendValue[17] = "4500"
set udg_RecommendValue[18] = "5000"
set udg_RecommendValue[19] = "5500"
set udg_RecommendValue[20] = "6000"
set udg_RecommendValue[21] = "6500"
set udg_RecommendValue[22] = "7100"
set udg_RecommendValue[23] = "7700"
set udg_RecommendValue[24] = "8500"
set udg_RecommendValue[25] = "9500"
set udg_RecommendValue[26] = "10600"
set udg_RecommendValue[27] = "11800"
set udg_RecommendValue[28] = "13000"
set udg_RecommendValue[29] = "14000"
set udg_RecommendValue[30] = "15000"
set udg_RecommendValue[31] = "15000"
// set up bonus gold
set udg_Level_EndRoundGold[1] = 11
set udg_Level_EndRoundGold[2] = 12
set udg_Level_EndRoundGold[3] = 13
set udg_Level_EndRoundGold[4] = 14
set udg_Level_EndRoundGold[5] = 16
set udg_Level_EndRoundGold[6] = 18
set udg_Level_EndRoundGold[7] = 20
set udg_Level_EndRoundGold[8] = 23
set udg_Level_EndRoundGold[9] = 26
set udg_Level_EndRoundGold[10] = 30
set udg_Level_EndRoundGold[11] = 35
set udg_Level_EndRoundGold[12] = 40
set udg_Level_EndRoundGold[13] = 45
set udg_Level_EndRoundGold[14] = 50
set udg_Level_EndRoundGold[15] = 55
set udg_Level_EndRoundGold[16] = 60
set udg_Level_EndRoundGold[17] = 70
set udg_Level_EndRoundGold[18] = 80
set udg_Level_EndRoundGold[19] = 90
set udg_Level_EndRoundGold[20] = 100
set udg_Level_EndRoundGold[21] = 110
set udg_Level_EndRoundGold[22] = 120
set udg_Level_EndRoundGold[23] = 130
set udg_Level_EndRoundGold[24] = 140
set udg_Level_EndRoundGold[25] = 150
set udg_Level_EndRoundGold[26] = 160
set udg_Level_EndRoundGold[27] = 170
set udg_Level_EndRoundGold[28] = 180
set udg_Level_EndRoundGold[29] = 190
set udg_Level_EndRoundGold[30] = 200
endfunction
//===========================================================================
function InitTrig_Setup_Recommend_Value takes nothing returns nothing
set gg_trg_Setup_Recommend_Value = CreateTrigger( )
call TriggerAddAction( gg_trg_Setup_Recommend_Value, function Trig_Setup_Recommend_Value_Actions )
endfunction
function Trig_Setup_Points_TEST_Copy_Actions takes nothing returns nothing
set udg_Spawn1 = GetRandomLocInRect(gg_rct_Creep_1)
endfunction
//===========================================================================
function InitTrig_Setup_Points_TEST_Copy takes nothing returns nothing
set gg_trg_Setup_Points_TEST_Copy = CreateTrigger( )
call DisableTrigger( gg_trg_Setup_Points_TEST_Copy )
call TriggerAddAction( gg_trg_Setup_Points_TEST_Copy, function Trig_Setup_Points_TEST_Copy_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
>>>>> SUMMONED UNITS
|cffAA3333Using Summons|r
- Summons can be purchased at your Barracks or Advanced Barracks.
- Summons cost lumber and do not cost food.
- Summons automatically attack the opposing team at the beginning of each round. Like Fighters, you do not need to control them.
- Summons add to your income. See the Income panel for more details.
|cffAA3333Fact Sheet|r
- Each summon has a unique trait: some have abilities, some are flying, some move fast, etc.
- Killing a summoned unit rewards a player gold equal to its income for one level. For example, killing a Militia will reward the killing player with 1 gold.
>>>>> INCOME
|cffAA3333Income|R
- Income is earned every level.
- Purchase summons with lumber to add to your income.
|cffAA3333Fact Sheet|r
- Most summons add 5% of their lumber cost, in gold, to your income. Other summons add less income, but have special abilities.
- If playing one-side only, income is disabled.
>>>>> KING
|cffAA3333King|r
- Protect your King longer than your opponents can protect theirs to win
- You can purchase upgrades for your King at your Town.
- You can attack the enemy King by summoning units. See the Summoned Units information panel for details.
- You can control your King by clicking on it.
|cffAA3333Fact Sheet|r
- Upgrades for your King cost lumber.
- Your King also automatically upgrades in armor and attack speed.
- After each round, your King's gold is split among the team. The King's gold is then reset to 0.
- Your King learns an ability at level 4, 12, 20, and 28.
Level 4: Immolation, Shockwave, or War Stomp
Level 12: Cripple, Entangling Roots, or Frost Attack
Level 20: Command Aura, Devotion Aura, Endurance Aura, Thorns Aura, or Trueshot Aura
Level 28: Evasion, Bash, or Critical Strike
- If a team is empty (no players), their King will receive a "Sword of Pwnage," a very powerful item, to compensate. The playing team can try to kill the empty team's King as an alternative way of winning.
>>>>> GAME MODES
|cffAA3333Game Modes|r
Game modes are typed at the start of the game by Player 1.
|cffAA3333Primary Game Modes|r (only 1 allowed)
-ap: All Pick. All players can pick their race. This is the default mode.
-ar: All Random. All players are given a random race.
-fr: Fixed Random. Each player receives a race chosen at random. No two players will have the same race.
-sd: Single Draft. All players are given 2 random races to choose from.
-rd: Random Draft. Players take turns picking races from a fixed pool. Teams alternate picking. The order of picking within each team is random.
|cffAA3333Secondary Game Modes|r (can be combined)
-sm: Short Mode. Less time between rounds, all units attack and move 15% faster. King is 30% weaker.
-mm: Master Mind. Restricted vision and limited scoreboard information.
-ni: No Income. Income is disabled.
-hg: Hourglass: You receive gold for enemy leaks.
-nm: No Middle: Enemies that reach the middle (Dark Grass) give no gold when killed.
>>>>> CREDITS
|cffFFcc00Credits|r
LegionTD Mega is an expansion version base on Legion TD War 1.50c, which LISK leaved to public as an open map after he decided to discontinue further development.
Legion TD Mega will focus on X3 mode only. we will continue update and addingg more content in future version.
HuanAK
Lisk
PanicX
von_Oberstain
===== CHEAT WARNING =====
** all maps list under www.legiontd.com do not contain cheat
** all maps from legiontd.in-goo.com do have cheat !!! (detail below)
** please check Quests -> change log to view a list of maps made by me.
** any version do not list under change log are not made by me !!
because it is easy to insert the cheat code into map and rename map to new name. so if this map's version and file name do not match, then it is not **genuine** version
CHEAT CODE already found :
(Legion TD War 2.1 <--- Cheat FREE)
Legion TD War 2.3 (e,f,d) <--- Cheat !!
Legion TD War 2.4 <--- Cheat
Legion TD War 2.4b <--- Cheat
Legion TD War 2.42 <--- Cheat
Legion TD War 2.5B <--- Cheat
Legion TD War 2.6 <--- Cheat
Legion TD War 2.7 <--- Cheat
Legion TD War 2.8 <--- Cheat
"-7" is to activate the cheats
"+kasa 100" is add 100 gold)
"+drewno 100" is to add 100 lumber
**version 2.6 also have cheat pack with 50+ difference command
===========
Legion TD 1.31e cheat :
active by "-eni " Two spaces after -eni
-Lumber
-Gold
-Copy
-Kill
-Kick
-Invulnerable
-Vulnerable
=================
>>>>> CHANGELOG
3.1b (2011.05.21)
* Mercenary : spell is disable after wave start
* Add glowing aura to Prophet, Artic, Mercenary builder
* disable -cb should disable change to Mercenary
* Fixed Mutant fake anti-cheat warning
* Fixed : -ar mode & type your own mode will work correctly.
* Timer for each wave change (from 30-60 second to 40-55 second)
======================
Older changelog for unit:
Summary of Changes :
This is a quick summary of what difference between Legion TD Mega and other version
Creep :
lots of changes to creep's difficult. here is brief summary :
level 1-13 : Easy (good player can get lots of wisp/upgrade in early game)
Level 14-19: Hard (average game finish here)
Level 20-30: extreme hard ! (for good game, with above average player)
bounty :
-- New bonus gold formula (up to 300 bonus gold at lvl30)
-- New GG mode: small leak=100% gold, medium leak =50% gold, full leak=0% gold.
New Wisp
-- you can build 7 wisp, wisp collect 2 lumber every 10 second
-- you can research lumberjack to improve wisp's lumber rate
-- lumberjack research : 15 level, each level +1 lumber
king :
-- Reduce cost for all king's upgrade(80 lumber for +3 income)
-- King is stronger
-- add new heal to all player (10,000hp heal, can only heal once)
Summon :
-- Cannot buy summon from advance barrack untill lvl10+
-- Cannot buy Krakken/Warden/behemouth from advance barrack untill lvl15+
Race:
New Race : Paladin, Prophet
New Race : Elf, Goblin ,Artic :
-- several mode change, and difference spell/abilites
Beast :
-- Spawn of Dragon : Reduce damage on splash (never do full damage)
-- Dragon Aspect : Splash work on air & Reduce damage on splash
-- Greymane : better tank, ability change.
Marine :
-- Egg Sack: move faster now.
-- Buffed Highborne's dps(73->83)
-- Komodo : reduce agro range (won't attack from far away)
Shadow :
-- Gateguard/Harbinger : Pet have less hp
-- Lord of Death/Hades : cannot summon 2 pet at same time
Mech:
-- Zues : spell damage increase (40 to 50)
Nature :
-- Goliath : good tank & dps now.
-- Tree of Knowledge: limit to 20 target on AE
-- Yagg/Tree : high hp
Element :
-- Golem : more hp, better tank
-- Seer of Darkness/Fenix : slightly better
Ghost : (not major change)
Demi-Human :
-- Mutant : reduce cost 400->300 gold, stat change
-- Medicine Man/oracle : higher dps
-- Minotaur/Bigfoot : reduce AE damage
>>>>> CHANGELOG
changeds from 3.1a -> 3.1b
- Fixed Mutant fake anti-cheat warning
- Fixed : -ar mode & type your own mode will work correctly.
- Remove -cb should disable change builder & change to Mercenary
- Mercenary's spell is disable after wave start
- Add glowing aura to Prophet, Artic, Mercenary
3.1 (2011.05.05)
* new race: Mercenary
Mercenary is idea race for noob & and pure lumber.
Mercenary is disable if -li (limited incomer)
Mercenary's summon only teleport to king if attacking/attacked
Mercenary can't defend lvl23+, so please change builder before that
3.0 (2011.05.05)
Unit
* Fix Maverick's image (creep kill by image will give correct bounty).
* Maverick cannot cast image from building time.
* LoD/hades cannot summon 2 pet at same time.
* Change Royal Griffin's attack&ability( difference graphic, same dps)
* Update serveral ingame message/unit description/ability description
Game
* Game load faster.
* Remove value restrict on wisp (Pure incomer is back !)
* mode -li = Limit Incomer, disable pure imcomer.
* Max cost for lumber upgrade is 200 gold/lumber (8th,9th and higher).
* add 5 more level of lumber research (max = 15)
* can't buy summon from advance barrack untill level 10+
* can't buy Behemouth/Warden/Kraken untill 15+.
* New Race - Artic (difference spell & ability)
* New mode : HP (host pick, everyone will have same builder)
* gg mode changed : small leak = full gold. medium leak = 50% gold, huge leak=0% gold (100%, 75%, 50%, 25%, 0%)
* Anti-cheat monitor installed.
2.17
* New Race - Goblin Builder
* New Race - Prophet Builder
* Warning ! lvl31+ is difference.
* lvl23 and lvl27 is easier.
* Lag reduce from summon system.
* Fix incorrect spell/unit description.
* Hybrid can only change builder once
* Fix Hybrid error:
- Outcast move from T5 to T4
- Harlot move from T4 to T5
- Troll Fighter move from T3 to T4
- Phantom move form T4 to T3
2.16
* Change Crusader food (1->0)
* Correct dragon hawk Build's descrition (normal-> magic)
* Change hermit income (5->4)
* Adjust difficuly for -sd and -ar (5% and 10%)
* Lower difficult on lvl8 and lvl21
* Change bonus gold formula ( more gold for lvl 14+)
* Fix Komodo run too far issue
* Add new heal to builder(only work on king)
* Display score after Victory/Defeat (without watch cinematic)
v2.15
* Fix king upgrade refund bug.
* Fix change builder bug on -ar mode
* -ar and -sd is slightly harder(ap=-5%, sd = 0%, ar =5%)
* Maverick's illusion can teleport to king now
* Show modelist on startup
* Rewrite code to reduce lag during fight
v2.14e (2011.3.10)
* Fix change builder bug
* add upgrade restrict to lumber research and wisp to prevent pure incomer.
* lower starting gold to 270,
* Fix Crusader's damage to match unit description
* Change Hybrid T6 cost 315->305
* Elite Archer building is same as Elite Archer fighter now
* level 16 creep hp reduce 335->315
* level 21 HP reduce 780->730
* level 14 bounty raise from 10-12
* level 15 bounty raise from 8-9
* add High Elven Farm 2,3,4,5,6 (200 food)
* Test level 14/15/16/20/21 - OK
* Recommend value for lvl14=3000, 16=4000, 18=5000,20=6500, 21=7000
v2.14d (2011.3.9)
- add new race's unit description to Hybrid
- change starting gold to 300
- introduce income cap = level x 20 (nerfed pure incomer)
v2.14c (2011.3.7)
- Fix moon guard food cost (0->2)
v2.14b (2011.3.7)
- Fix Change Builder
- Fix hybrid (new race include)
- Fix doppleganger cost.
- Wave 14+ is easier(remove 15% hp buff for lvl14+)
- Add new command -kill for display total kill
- Add visual effect to Royal Griffin's multi attack
- Add visual effect to Sentry's magic attack
- Buff Cavalier's HP
v2.14a (2011.3.6)
- quick fix to 2.14 for creep won't spawn
v2.14 (2011.3.6)
- Add Change builder(you can only change 5 time)
- Hybrid unit will include elf & paladin
- Upgrade king regenation buffed and reduce king upgrade cost (100-80)
- Add spell to Druid ( Wraith of Nature)
- Nightsaber food reduce from 2 to 1.
- Moon Guard food cost raise from 0 to 2
- Wisp food cost reduce form 2 to 1
- Fix Sentry's ability
- Fix incorrect sell value on certain unit
- Creep wave difficult adjust (1%-15% hp buff move from lvl1-lvl10 to lvl5-lvl19)
* Reduce lag, 4v4 is playable ! (map should be 99% FREE of memory leak)
v2.13 (2011.3.4)
* Change lumber system, research will cost lumber as well as gold
* Creep wave is harder, from 1% hp buff to 15%.
* Tree of Knowledge changed ( buffed hp, nerfed AE damage to 20 target)
* change Battle cry is self only(+5armor, 20% damage)
* Buffed Golem(element) 's hp
* Buffed Seer/Phoenix's dps
* Buffed warden. it is as good as moon guard now.
v2.12 (2011.3.1)
* Fix texture/skin issue for builder
* Add new builder to random builder
* Correct unit/ability description
* Income and wisp count will update correctly
* Fix debug mode (-restart and -repick will work for all mode)
* Tweaked Spawn of Dragon's splash (increase range, but will never do full damage)
* Tweaked Dragon Aspect's splash ( splash will work on air creep, but never do full damage)
* Fix bounty from summon
* Tweaked lumber system (Wisp is more expensive, eg cost 2 food, 10 lumber.)
* Add 2 more lumber upgrade
----------------------------------------------------------
v2.11 (2011.2.27)
* fix bug with mode
* fix elite archer's multishot ability(increase range, so it will won't shot at 1 target)
* Dragon Aspect's splash work on air, but will never do full damage on splash(will do 40% & 10% depend on range)
----------------------------------------------------------
v2.10 (2011.2.26)
* add new race (alliance)
* remove worker(reduce lag), replace with wisp
* -gg mode only give half gold
* all summon will more bounty to other team
* high level summon have longer cool down
* farm can upgrade 10 time.
* player can see all unit's dps ingame
beast:
* modified spalsh damage(they will never do full damage on splash)
Demi:
* reduce cost on Mutant (400->300)
* buffed oracle's dps
* modified Minotaur/Bigfoot's AE spell (deal less damage)
Elf:
* remove starfall from Nightsaber
* new spell for Ascendent (-8 armor debuff)
Mech:
* buffed Zues's spell damage
* buffed Krogoth's dps
Shadow:
* nerfed gate guard's pet hp (185->145)
Marine:
* fangtooth's feast change(from every 3 -> 5 attacks.)
----------------------------------------------------------
v2.0 (first version, 2010.2.19)
* base on 1.50c
* add new race (Elf)
* change unit stat base on forum feedback
//TESH.scrollpos=12
//TESH.alwaysfold=0
function Trig_Update_Wisp_and_Upgrade_Copy_Func001Func003Func002C takes nothing returns boolean
if ( not ( IsPlayerAlly(GetEnumPlayer(), Player(8)) == true ) ) then
return false
endif
return true
endfunction
function Trig_Update_Wisp_and_Upgrade_Copy_Func001Func003Func003C takes nothing returns boolean
if ( not ( IsPlayerAlly(GetEnumPlayer(), Player(9)) == true ) ) then
return false
endif
return true
endfunction
function Trig_Update_Wisp_and_Upgrade_Copy_Func001Func003C takes nothing returns boolean
if ( not ( udg_ModeMM == true ) ) then
return false
endif
if ( not ( udg_SpecialEvent == false ) ) then
return false
endif
return true
endfunction
function Trig_Update_Wisp_and_Upgrade_Copy_Func001A takes nothing returns nothing
set udg_Temp_Integer = ( GetPlayerTechCountSimple('R003', GetEnumPlayer()) + GetPlayerTechCountSimple('R00H', GetEnumPlayer()) )
set udg_Temp_String3 = ( I2S(udg_numWorkers[GetConvertedPlayerId(GetEnumPlayer())]) + ( "/" + I2S(udg_Temp_Integer) ) )
if ( Trig_Update_Wisp_and_Upgrade_Copy_Func001Func003C() ) then
if ( Trig_Update_Wisp_and_Upgrade_Copy_Func001Func003Func002C() ) then
if IsPlayerAlly( GetLocalPlayer(), Player(8)) or IsPlayerObserver(GetLocalPlayer()) then
call MultiboardSetItemValueBJ( udg_Scoreboard, 4, udg_ScoreboardRow[GetConvertedPlayerId(GetEnumPlayer())], udg_Temp_String3 )
else
call MultiboardSetItemValueBJ( udg_Scoreboard, 4, udg_ScoreboardRow[GetConvertedPlayerId(GetEnumPlayer())], "TRIGSTR_9039" )
endif
else
endif
if ( Trig_Update_Wisp_and_Upgrade_Copy_Func001Func003Func003C() ) then
if IsPlayerAlly( GetLocalPlayer(), Player(9)) or IsPlayerObserver(GetLocalPlayer()) then
call MultiboardSetItemValueBJ( udg_Scoreboard, 4, udg_ScoreboardRow[GetConvertedPlayerId(GetEnumPlayer())], udg_Temp_String3 )
else
call MultiboardSetItemValueBJ( udg_Scoreboard, 4, udg_ScoreboardRow[GetConvertedPlayerId(GetEnumPlayer())], "TRIGSTR_9040" )
endif
else
endif
else
call MultiboardSetItemValueBJ( udg_Scoreboard, 4, udg_ScoreboardRow[GetConvertedPlayerId(GetEnumPlayer())], udg_Temp_String3 )
endif
endfunction
function Trig_Update_Wisp_and_Upgrade_Copy_Actions takes nothing returns nothing
call ForForce( udg_IngamePlayers_PlayerGroup, function Trig_Update_Wisp_and_Upgrade_Copy_Func001A )
endfunction
//===========================================================================
function InitTrig_Update_Wisp_and_Upgrade_Copy takes nothing returns nothing
set gg_trg_Update_Wisp_and_Upgrade_Copy = CreateTrigger( )
call TriggerAddAction( gg_trg_Update_Wisp_and_Upgrade_Copy, function Trig_Update_Wisp_and_Upgrade_Copy_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Creep_HP_Modifier_Actions takes nothing returns nothing
call SetPlayerTechResearchedSwap( 'R004', 15, Player(10) )
call SetPlayerTechResearchedSwap( 'R004', 15, Player(11) )
set udg_Temp_Unit = gg_unit_h0D7_0167
call SetUnitVertexColorBJ( udg_Temp_Unit, 100.00, 100.00, 100.00, 35.00 )
call TriggerRegisterUnitStateEvent(gg_trg_Burning_Legion, udg_Temp_Unit, UNIT_STATE_LIFE, LESS_THAN, 1000.0)
call DisableTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Creep_HP_Modifier takes nothing returns nothing
set gg_trg_Creep_HP_Modifier = CreateTrigger( )
call TriggerAddAction( gg_trg_Creep_HP_Modifier, function Trig_Creep_HP_Modifier_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Creeps_Group_Func003C takes nothing returns boolean
if ( ( GetOwningPlayer(GetEnteringUnit()) == Player(10) ) ) then
return true
endif
if ( ( GetOwningPlayer(GetEnteringUnit()) == Player(11) ) ) then
return true
endif
return false
endfunction
function Trig_Creeps_Group_Conditions takes nothing returns boolean
if ( not Trig_Creeps_Group_Func003C() ) then
return false
endif
if ( not ( IsUnitType(GetEnteringUnit(), UNIT_TYPE_GIANT) == false ) ) then
return false
endif
return true
endfunction
function Trig_Creeps_Group_Func002C takes nothing returns boolean
if ( not ( IsUnitType(GetEnteringUnit(), UNIT_TYPE_SUMMONED) == true ) ) then
return false
endif
return true
endfunction
function Trig_Creeps_Group_Actions takes nothing returns nothing
call GroupAddUnitSimple( GetEnteringUnit(), udg_Creeps_UnitGroup )
if ( Trig_Creeps_Group_Func002C() ) then
call GroupAddUnitSimple( GetEnteringUnit(), udg_Summons_UnitGroup )
else
endif
endfunction
//===========================================================================
function InitTrig_Creeps_Group takes nothing returns nothing
set gg_trg_Creeps_Group = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creeps_Group, gg_rct_Creep_1 )
call TriggerRegisterEnterRectSimple( gg_trg_Creeps_Group, gg_rct_Creep_2 )
call TriggerRegisterEnterRectSimple( gg_trg_Creeps_Group, gg_rct_Creep_3 )
call TriggerRegisterEnterRectSimple( gg_trg_Creeps_Group, gg_rct_Creep_4 )
call TriggerRegisterEnterRectSimple( gg_trg_Creeps_Group, gg_rct_Creep_5 )
call TriggerRegisterEnterRectSimple( gg_trg_Creeps_Group, gg_rct_Creep_6 )
call TriggerRegisterEnterRectSimple( gg_trg_Creeps_Group, gg_rct_Creep_7 )
call TriggerRegisterEnterRectSimple( gg_trg_Creeps_Group, gg_rct_Creep_8 )
call TriggerAddCondition( gg_trg_Creeps_Group, Condition( function Trig_Creeps_Group_Conditions ) )
call TriggerAddAction( gg_trg_Creeps_Group, function Trig_Creeps_Group_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_Creep_Deaths_JASS_Conditions takes nothing returns boolean
if ( GetOwningPlayer(GetTriggerUnit()) == Player(10) ) then
return true
endif
if ( GetOwningPlayer(GetTriggerUnit()) == Player(11) ) then
return true
endif
return false
endfunction
function Trig_Creep_Deaths_JASS_Actions takes nothing returns nothing
local unit d = GetTriggerUnit() // dying unit
local unit k = GetKillingUnit() // killing unit
local integer id = GetUnitUserData(k) // custom value of killing unit
local integer b = 0 // bounty
// if killed by unknow custom value, then do nothing
if ( id == 0 or udg_Level_Integer >=31) then
// remove corpse
call GroupRemoveUnit(udg_Creeps_UnitGroup, d)
call GroupRemoveUnit(udg_Summons_UnitGroup, d)
call RemoveUnit( GetTriggerUnit() )
call GroupRemoveUnit(udg_CreepsLeft[1], d)
call GroupRemoveUnit(udg_CreepsLeft[2], d)
return
endif
// kill count +1
set udg_PlayerKills_Integer[id] = udg_PlayerKills_Integer[id] +1
set udg_TotalKill = udg_TotalKill+1
// calculate Creep & Summon Bounty
if ( IsUnitType(d, UNIT_TYPE_SUMMONED) == true ) then
set b = GetUnitLevel(d)
else
set b = udg_LevelBounty_Integer[udg_Level_Integer]
endif
// if unit is leaked unit, Calcukate leak gold
if ( GetUnitAbilityLevel(d, 'A07D') == 1 ) then
set udg_LeaksCaught[GetUnitUserData(k)] = ( udg_LeaksCaught[id] + 1 )
set b = R2I (I2R(b)*udg_Leaked_Bount_Perc[GetUnitUserData(d)])
endif
// killed by Left King
if ( k == gg_unit_h00K_0009 ) then
// kill by left king, give gold to right king
call SetPlayerState(Player(9), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(Player(9), PLAYER_STATE_RESOURCE_GOLD) + b)
call SetPlayerState(Player(9), PLAYER_STATE_GOLD_GATHERED, GetPlayerState(Player(9), PLAYER_STATE_GOLD_GATHERED) + b)
endif
// killed by Right King
if ( k == gg_unit_h00K_0006 ) then
// kill by RIGHT king, give gold to LEFT king
call SetPlayerState(Player(8), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(Player(8), PLAYER_STATE_RESOURCE_GOLD) + b)
call SetPlayerState(Player(8), PLAYER_STATE_GOLD_GATHERED, GetPlayerState(Player(8), PLAYER_STATE_GOLD_GATHERED) + b)
endif
//call DisplayTimedTextToPlayer(Player(0), 0, 0, 30, "Bounty = "+I2S(b)+", ID="+I2S(id))
// add bounty to player
call SetPlayerState(Player(id-1), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(Player(id-1), PLAYER_STATE_RESOURCE_GOLD) + b)
call SetPlayerState(Player(id-1), PLAYER_STATE_GOLD_GATHERED, GetPlayerState(Player(id-1), PLAYER_STATE_GOLD_GATHERED) + b)
set udg_GoldFromKills[id] = ( udg_GoldFromKills[id] + b )
set udg_TotalGold[id] = ( udg_TotalGold[id] + b )
// display gold (as text) above creep's head
if (b >0) then
call showUnitTextPlayer (d, "+" + I2S(b), 100.00, 77.00, 0.00, Player(id-1))
endif
if ( udg_ModeHG == false ) then
call SetPlayerState(Player(9), PLAYER_STATE_RESOURCE_GOLD, 0)
call SetPlayerState(Player(8), PLAYER_STATE_RESOURCE_GOLD, 0)
endif
// fight start
if (udg_FightStart == false) then
set udg_FightStart = true
endif
call GroupRemoveUnit(udg_Creeps_UnitGroup, d)
call GroupRemoveUnit(udg_Summons_UnitGroup, d)
call GroupRemoveUnit(udg_CreepsLeft[1], d)
call GroupRemoveUnit(udg_CreepsLeft[2], d)
call GroupRemoveUnit(udg_CreepSpawnPoint[GetUnitUserData(d)], d)
call GroupRemoveUnit(udg_CreepSpawnMove[GetUnitUserData(d)], d)
// instant remove corpse if it is 4v4
//if ( CountPlayersInForceBJ(udg_IngamePlayers_PlayerGroup) == 8 ) then
// call RemoveUnit( GetTriggerUnit() )
// return
//endif
set d = null // dying unit
set k = null // killing unit
call PolledWait( 1.00 )
call RemoveUnit( GetTriggerUnit() )
// remove corpse
endfunction
//===========================================================================
function InitTrig_Creep_Deaths_JASS takes nothing returns nothing
set gg_trg_Creep_Deaths_JASS = CreateTrigger( )
// player 11 & 12 die, killing unit is player 9 & 10.
call TriggerRegisterPlayerUnitEvent(gg_trg_Creep_Deaths_JASS, Player(10), EVENT_PLAYER_UNIT_DEATH, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_Creep_Deaths_JASS, Player(11), EVENT_PLAYER_UNIT_DEATH, null)
call TriggerAddCondition( gg_trg_Creep_Deaths_JASS, Condition( function Trig_Creep_Deaths_JASS_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Deaths_JASS, function Trig_Creep_Deaths_JASS_Actions )
endfunction
function Trig_Spawn_Creeps_Actions takes nothing returns nothing
call ExecuteFunc("CreateCreepWaveTimer")
call TriggerExecute( gg_trg_Pause_Attackers )
call TriggerSleepAction( 2.00 )
call TriggerExecute( gg_trg_Unpause_Attackers )
call TriggerSleepAction( 1.00 )
call TriggerExecute( gg_trg_Warp_Summons )
call TriggerSleepAction( 0.50 )
endfunction
//===========================================================================
function InitTrig_Spawn_Creeps takes nothing returns nothing
set gg_trg_Spawn_Creeps = CreateTrigger( )
call TriggerAddAction( gg_trg_Spawn_Creeps, function Trig_Spawn_Creeps_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Remove_Junk_Func001002002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_GIANT) == true )
endfunction
function Trig_Remove_Junk_Func002A takes nothing returns nothing
if ((GetEnumUnit() != gg_unit_h00K_0006) and ( GetEnumUnit() != gg_unit_h00K_0009 )) then
call RemoveUnit( GetEnumUnit() )
endif
endfunction
function Trig_Remove_Junk_Actions takes nothing returns nothing
set udg_Temp_UG = GetUnitsInRectMatching(bj_mapInitialPlayableArea, Condition(function Trig_Remove_Junk_Func001002002))
call ForGroup(udg_Temp_UG, function Trig_Remove_Junk_Func002A )
call DestroyGroup (udg_Temp_UG)
endfunction
//===========================================================================
function InitTrig_Remove_Junk takes nothing returns nothing
set gg_trg_Remove_Junk = CreateTrigger( )
call TriggerAddAction( gg_trg_Remove_Junk, function Trig_Remove_Junk_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_West_Enter_Arena_Func006C takes nothing returns boolean
if ( ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_SUMMONED) == true ) ) then
return true
endif
if ( ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_GIANT) == true ) ) then
return true
endif
return false
endfunction
function Trig_West_Enter_Arena_Conditions takes nothing returns boolean
if ( not ( udg_SpecialEvent == true ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(8) ) ) then
return false
endif
if ( not Trig_West_Enter_Arena_Func006C() ) then
return false
endif
return true
endfunction
function Trig_West_Enter_Arena_Actions takes nothing returns nothing
call GroupAddUnitSimple( GetTriggerUnit(), udg_Fighter_West )
call GroupAddUnitSimple( GetTriggerUnit(), udg_Fighter_Group )
endfunction
//===========================================================================
function InitTrig_West_Enter_Arena takes nothing returns nothing
set gg_trg_West_Enter_Arena = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_West_Enter_Arena, gg_rct_ArenaVision )
call TriggerAddCondition( gg_trg_West_Enter_Arena, Condition( function Trig_West_Enter_Arena_Conditions ) )
call TriggerAddAction( gg_trg_West_Enter_Arena, function Trig_West_Enter_Arena_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_Enter_Arena_OR_Conditions takes nothing returns boolean
if ( ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_SUMMONED) == true ) ) then
return true
endif
if ( ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_GIANT) == true ) ) then
return true
endif
return false
endfunction
function Trig_Enter_Arena_Conditions takes nothing returns boolean
if ( udg_SpecialEvent == false ) then
return false
endif
if ( not Trig_Enter_Arena_OR_Conditions() ) then
return false
endif
return true
endfunction
function Trig_Enter_Arena_Actions takes nothing returns nothing
call GroupAddUnit(udg_Fighter_Group, GetTriggerUnit())
if ( GetUnitTypeId(GetTriggerUnit()) == 'n007' ) then
return
endif
if ( GetOwningPlayer(GetTriggerUnit()) == Player(8) ) then
call GroupAddUnit( udg_Fighter_West, GetTriggerUnit() )
endif
if ( GetOwningPlayer(GetTriggerUnit()) == Player(9) ) then
call GroupAddUnit( udg_Fighter_East, GetTriggerUnit() )
endif
endfunction
//===========================================================================
function InitTrig_Enter_Arena takes nothing returns nothing
local region r = CreateRegion()
set gg_trg_Enter_Arena = CreateTrigger( )
call RegionAddRect(r,gg_rct_ArenaVision)
call TriggerRegisterEnterRegion(gg_trg_Enter_Arena, r, null)
call TriggerAddCondition( gg_trg_Enter_Arena, Condition( function Trig_Enter_Arena_Conditions ) )
call TriggerAddAction( gg_trg_Enter_Arena, function Trig_Enter_Arena_Actions )
set r = null
endfunction
//TESH.scrollpos=2
//TESH.alwaysfold=0
function Trig_East_Enter_Arena_Conditions takes nothing returns boolean
if ( not ( udg_SpecialEvent == true ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(9) ) ) then
return false
endif
if ( ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_GIANT) == true ) ) then
return true
endif
return true
endfunction
function Trig_East_Enter_Arena_Actions takes nothing returns nothing
call GroupAddUnitSimple( GetTriggerUnit(), udg_Fighter_East )
call GroupAddUnitSimple( GetTriggerUnit(), udg_Fighter_Group )
endfunction
//===========================================================================
function InitTrig_East_Enter_Arena takes nothing returns nothing
set gg_trg_East_Enter_Arena = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_East_Enter_Arena, gg_rct_ArenaVision )
call TriggerAddCondition( gg_trg_East_Enter_Arena, Condition( function Trig_East_Enter_Arena_Conditions ) )
call TriggerAddAction( gg_trg_East_Enter_Arena, function Trig_East_Enter_Arena_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Clean_Arena_Fighter_Function takes nothing returns nothing
if ( GetEnumUnit() != gg_unit_h00K_0006 and GetEnumUnit() != gg_unit_h00K_0009) then
if( IsUnitType(GetEnumUnit(), UNIT_TYPE_GIANT) == true or IsUnitType(GetEnumUnit(), UNIT_TYPE_SUMMONED) == true) then
call RemoveUnit( GetEnumUnit() ) // remove unit from game
endif
endif
endfunction
function Trig_Clean_Arena_Fighter_Actions takes nothing returns nothing
// Remove all Fighter
call ForGroup(udg_Fighter_West, function Trig_Clean_Arena_Fighter_Function)
call GroupClear( udg_Fighter_West )
call ForGroup(udg_Fighter_East, function Trig_Clean_Arena_Fighter_Function)
call GroupClear( udg_Fighter_East )
endfunction
//===========================================================================
function InitTrig_Clean_Arena_Fighter takes nothing returns nothing
set gg_trg_Clean_Arena_Fighter = CreateTrigger( )
call TriggerAddAction( gg_trg_Clean_Arena_Fighter, function Trig_Clean_Arena_Fighter_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_GAME_OVER_Count_down_Conditions takes nothing returns boolean
if ( not ( udg_GameEnded_Boolean == true ) ) then
return false
endif
return true
endfunction
function Trig_GAME_OVER_Count_down_Func041A takes nothing returns nothing
call EndGame( true )
endfunction
function Trig_GAME_OVER_Count_down_Actions takes nothing returns nothing
call DisplayTimedTextToForce( GetPlayersAll(), 1.00, ( udg_PlayerColor[1] + "game will disconnect in 30 seconds." ) )
call DisplayTimedTextToForce( GetPlayersAll(), 1.00, (udg_PlayerColor[5] +"30") )
call PolledWait( 5.00 )
call DisplayTimedTextToForce( GetPlayersAll(), 1.00, (udg_PlayerColor[5] +"25") )
call PolledWait( 5.00 )
call DisplayTimedTextToForce( GetPlayersAll(), 1.00, (udg_PlayerColor[5] +"20") )
call PolledWait( 5.00 )
call DisplayTimedTextToForce( GetPlayersAll(), 1.00, (udg_PlayerColor[5] +"15") )
call PolledWait( 5.00 )
call DisplayTimedTextToForce( GetPlayersAll(), 1.00, (udg_PlayerColor[5] +"10") )
call PolledWait( 1.00 )
call DisplayTimedTextToForce( GetPlayersAll(), 1.00, (udg_PlayerColor[1] +"9") )
call PolledWait( 1.00 )
call DisplayTimedTextToForce( GetPlayersAll(), 1.00, (udg_PlayerColor[1] +"8") )
call PolledWait( 1.00 )
call DisplayTimedTextToForce( GetPlayersAll(), 1.00, (udg_PlayerColor[1] +"7") )
call PolledWait( 1.00 )
call DisplayTimedTextToForce( GetPlayersAll(), 1.00, (udg_PlayerColor[1] +"6") )
call PolledWait( 1.00 )
call DisplayTimedTextToForce( GetPlayersAll(), 1.00, (udg_PlayerColor[1] +"5") )
call PolledWait( 1.00 )
call DisplayTimedTextToForce( GetPlayersAll(), 1.00, (udg_PlayerColor[1] +"4") )
call PolledWait( 1.00 )
call DisplayTimedTextToForce( GetPlayersAll(), 1.00, (udg_PlayerColor[1] +"3") )
call PolledWait( 1.00 )
call DisplayTimedTextToForce( GetPlayersAll(), 1.00, (udg_PlayerColor[1] +"2") )
call PolledWait( 1.00 )
call DisplayTimedTextToForce( GetPlayersAll(), 1.00, (udg_PlayerColor[1] +"1") )
call PolledWait( 1.00 )
call ForForce( udg_IngamePlayers_PlayerGroup, function Trig_GAME_OVER_Count_down_Func041A )
endfunction
//===========================================================================
function InitTrig_GAME_OVER_Count_down takes nothing returns nothing
set gg_trg_GAME_OVER_Count_down = CreateTrigger( )
call TriggerAddCondition( gg_trg_GAME_OVER_Count_down, Condition( function Trig_GAME_OVER_Count_down_Conditions ) )
call TriggerAddAction( gg_trg_GAME_OVER_Count_down, function Trig_GAME_OVER_Count_down_Actions )
endfunction
function Trig_Create_Fighters_Copy_3_Actions takes nothing returns nothing
call PolledWait( 2 )
endfunction
//===========================================================================
function InitTrig_Create_Fighters_Copy_3 takes nothing returns nothing
set gg_trg_Create_Fighters_Copy_3 = CreateTrigger( )
call DisableTrigger( gg_trg_Create_Fighters_Copy_3 )
call TriggerAddAction( gg_trg_Create_Fighters_Copy_3, function Trig_Create_Fighters_Copy_3_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Create_Fighters_Copy_2_Actions takes nothing returns nothing
call UnitAddAbility(GetTriggerUnit(), 'A0BO' )
endfunction
//===========================================================================
function InitTrig_Create_Fighters_Copy_2 takes nothing returns nothing
set gg_trg_Create_Fighters_Copy_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Create_Fighters_Copy_2 )
call TriggerAddAction( gg_trg_Create_Fighters_Copy_2, function Trig_Create_Fighters_Copy_2_Actions )
endfunction
function Trig_Create_Fighters_Copy_Actions takes nothing returns nothing
call CreateNUnitsAtLocFacingLocBJ( 1, 'hfoo', Player(0), GetRectCenter(GetPlayableMapRect()), udg_SpawnArr[1] )
endfunction
//===========================================================================
function InitTrig_Create_Fighters_Copy takes nothing returns nothing
set gg_trg_Create_Fighters_Copy = CreateTrigger( )
call DisableTrigger( gg_trg_Create_Fighters_Copy )
call TriggerAddAction( gg_trg_Create_Fighters_Copy, function Trig_Create_Fighters_Copy_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Unpause_Fighters_Function takes nothing returns nothing
call IssuePointOrderLoc(GetTriggerUnit(), "attack", udg_PathingPointArray[GetUnitUserData(GetTriggerUnit())])
//call DestroyTrigger(GetTriggeringTrigger())
endfunction
function Trig_Unpause_Fighters_Add_Events_Function takes nothing returns nothing
call TriggerRegisterUnitEvent( gg_trg_Fight_Start_Add_Events, GetEnumUnit(), EVENT_UNIT_ACQUIRED_TARGET )
call TriggerAddAction( gg_trg_Fight_Start_Add_Events, function Trig_Unpause_Fighters_Function )
endfunction
function Trig_Unpause_Fighters_Add_Events_Actions takes nothing returns nothing
call ForGroup(udg_Fighter_Group, function Trig_Unpause_Fighters_Add_Events_Function)
endfunction
function InitTrig_Fight_Start_Add_Events takes nothing returns nothing
call DestroyTrigger(gg_trg_Fight_Start_Add_Events)
set gg_trg_Fight_Start_Add_Events = CreateTrigger( )
call TriggerAddAction( gg_trg_Fight_Start_Add_Events, function Trig_Unpause_Fighters_Add_Events_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Unpause_Fighters_Function takes nothing returns nothing
call IssuePointOrderLoc(GetTriggerUnit(), "attack", udg_PathingPointArray[GetUnitUserData(GetTriggerUnit())])
endfunction
function Trig_Unpause_Fighters_Add_Events_Function takes nothing returns nothing
call TriggerRegisterUnitEvent(udg_Trig, GetEnumUnit(), EVENT_UNIT_ACQUIRED_TARGET)
endfunction
function InitTrig_Fight_Start_Add_Events_Copy_2 takes nothing returns nothing
call DestroyTrigger(udg_Trig)
set udg_Trig = CreateTrigger()
call ForGroup(udg_Fighter_Group, function Trig_Unpause_Fighters_Add_Events_Function)
call TriggerAddAction(udg_Trig, function Trig_Unpause_Fighters_Function )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Unpause_Fighters_Function takes nothing returns nothing
call IssuePointOrderLoc(u, "attack", udg_PathingPointArray[GetUnitUserData(u)])
//call DestroyTrigger(GetTriggeringTrigger())
endfunction
function Trig_Unpause_Fighters_Add_Events_Function takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterUnitEvent( t, GetEnumUnit(), EVENT_UNIT_ACQUIRED_TARGET )
call TriggerAddAction( t, function Trig_Unpause_Fighters_Function )
endfunction
function Trig_Unpause_Fighters_Add_Events_Actions takes nothing returns nothing
call ForGroup(udg_Fighter_Group, function Trig_Unpause_Fighters_Add_Events_Function)
endfunction
function InitTrig_Fight_Start_Add_Events takes nothing returns nothing
set gg_trg_Fight_Start_Add_Events = CreateTrigger( )
call TriggerAddAction( gg_trg_Fight_Start_Add_Events, function Trig_Unpause_Fighters_Add_Events_Actions )
endfunction
//TESH.scrollpos=39
//TESH.alwaysfold=0
function Trig_Create_Fighters_JASS_Function takes nothing returns nothing
// Vars
local unit u = GetEnumUnit()
local unit u2
local location p = GetUnitLoc(u)
local player id = GetOwningPlayer(u)
// Hide Tower
call ShowUnit( u, false)
// Set Owning Player
if ( IsPlayerAlly(id, Player(8)) == true ) then
set udg_Temp_Player = Player(8)
else
set udg_Temp_Player = Player(9)
endif
// Find fighter type that matching tower
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = udg_numTowers
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( GetUnitTypeId(u) == udg_TowerTypeArr[bj_forLoopAIndex] ) then
set udg_Temp_Integer = bj_forLoopAIndex
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
// Create Fighter
//set u2 = CreateUnitAtLoc(udg_Temp_Player, udg_TowerUnitArr[udg_Temp_Integer],udg_SpawnArr[(GetPlayerId(id)+1)])
set u2 = CreateUnitAtLoc(udg_Temp_Player, udg_TowerUnitArr[udg_Temp_Integer], p, AngleBetweenPoints(p, udg_SpawnArr[(GetPlayerId(id)+1)]))
//set u2 = CreateUnit(udg_Temp_Player, udg_TowerUnitArr[udg_Temp_Integer], GetLocationX(p), GetLocationY(p), udg_SpawnArr[(GetPlayerId(id)+1)])
call SetUnitColor( u2, GetPlayerColor(id) ) // player changed, color stay same
call SetUnitUserData( u2, (GetPlayerId(id)+1) ) // custom value of unit
call GroupAddUnit(udg_Fighter_Group, u2) // add to fighter group
call GroupAddUnit(udg_Fighter_Group_Player[(GetPlayerId(id)+1)], u2) // add to player's fighter group (for auto assist)
call UnitResetCooldown( u2 ) // reset cooldown on all ability
//call UnitAddAbility( u2, 'A017') // add pathing dummy ability
//call SetUnitAbilityLevel(u2, 'A017', (GetPlayerId(id)+1)) // set ability level to player's ID
//call IssuePointOrderLoc( u2, "patrol", p )
// Pause Fighter
//call SetUnitMoveSpeed( u2, 0.00 )
//call IssuePointOrderLoc( u2, "patrol", udg_PathingPointArray[(GetPlayerId(id)+1)] )
//call SetUnitPathing( udg_Temp_Unit2, false )
// remove leak
call RemoveLocation (p)
set p = null
set u = null
set u2 = null
endfunction
function Trig_Create_Fighters_JASS_Actions takes nothing returns nothing
// Fighters
call ForGroup(udg_Tower_Group, function Trig_Create_Fighters_JASS_Function)
//call TriggerExecute( gg_trg_Fight_Start_Add_Events )
//call InitTrig_Fight_Start_Add_Events ()
call Fight_Startd_Events()
endfunction
//===========================================================================
function InitTrig_Create_Fighters_JASS takes nothing returns nothing
set gg_trg_Create_Fighters_JASS = CreateTrigger( )
call TriggerAddAction( gg_trg_Create_Fighters_JASS, function Trig_Create_Fighters_JASS_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Calculate_Score_Func001A takes nothing returns nothing
local integer id = GetPlayerId(GetEnumPlayer()) + 1 // array start from 1-8
local integer i = 0
local integer level = udg_Level_Integer
local real r1 = 0.0
local real r2 = 0.0
if(level > 30) then
set level = 30
endif
// value divide by recommend value : 0.00-1.00
set r1 = (I2R(udg_FightersValue[id]) / S2R(udg_RecommendValue[level]) )
set i = 100+(5-udg_TotalChangedBuilder[id])*10 // change builder modifier : 100-150
if (i <100) then
set i = 100
endif
if (i > 150) then
set i = 150
endif
set r1 = r1 * I2R(i)
set r2 = (I2R(udg_PlayerIncome[id]) / I2R(udg_Level_EndRoundGold[level]) )
set r2 = r2 * 100.0
// add score to total score
set udg_TotalScore[id] = udg_TotalScore[id] + R2I(r1) + R2I(r2)
endfunction
function Trig_Calculate_Score_Actions takes nothing returns nothing
call ForForce( udg_IngamePlayers_PlayerGroup, function Trig_Calculate_Score_Func001A )
call TriggerExecute( gg_trg_Update_Score )
endfunction
//===========================================================================
function InitTrig_Calculate_Score takes nothing returns nothing
set gg_trg_Calculate_Score = CreateTrigger( )
call TriggerAddAction( gg_trg_Calculate_Score, function Trig_Calculate_Score_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Fighter_Death_JASS_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer id = GetUnitUserData(u)
call GroupRemoveUnit(udg_Fighter_Group, u)
call GroupRemoveUnit(udg_Fighter_East, u)
call GroupRemoveUnit(udg_Fighter_West, u)
call GroupRemoveUnit(udg_Fighter_King_LEFT, u)
call GroupRemoveUnit(udg_Fighter_King_LEFT, u)
call GroupRemoveUnit(udg_Fighter_Group_Player[id], u)
// fight start
if (udg_FightStart == false) then
set udg_FightStart = true
endif
set u = null
if ((GetEnumUnit() != gg_unit_h00K_0006) and ( GetEnumUnit() != gg_unit_h00K_0009 )) then
call TriggerSleepAction( 1.00 )
call RemoveUnit( GetTriggerUnit() ) // remove corpse after 1 second
endif
endfunction
//===========================================================================
function InitTrig_Fighter_Death_JASS takes nothing returns nothing
set gg_trg_Fighter_Death_JASS = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent(gg_trg_Fighter_Death_JASS, Player(8), EVENT_PLAYER_UNIT_DEATH, null)
call TriggerRegisterPlayerUnitEvent(gg_trg_Fighter_Death_JASS, Player(9), EVENT_PLAYER_UNIT_DEATH, null)
call TriggerAddAction( gg_trg_Fighter_Death_JASS, function Trig_Fighter_Death_JASS_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Clean_Fighters_Function takes nothing returns nothing
if ( GetEnumUnit() != gg_unit_h00K_0006 and GetEnumUnit() != gg_unit_h00K_0009) then
if( IsUnitType(GetEnumUnit(), UNIT_TYPE_GIANT) == true or IsUnitType(GetEnumUnit(), UNIT_TYPE_SUMMONED) == true) then
call RemoveUnit( GetEnumUnit() ) // remove unit from game
endif
endif
endfunction
function Trig_Clean_Dummy_Function takes nothing returns nothing
call RemoveUnit( GetEnumUnit() ) // remove unit from game
endfunction
function Trig_Clean_Dummy_Condition takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == 'u006' ) // dummy caster
endfunction
function Trig_Clean_Fighters_Actions takes nothing returns nothing
// Remove all Fighter
call ForGroup(udg_Fighter_Group, function Trig_Clean_Fighters_Function)
call GroupClear( udg_Fighter_Group )
// Remove all hired unit
call ForGroup(udg_Hire_Group, function Trig_Clean_Fighters_Function)
call GroupClear( udg_Hire_Group )
// reset warpgroups
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 8
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call GroupClear( udg_WarpGroup[bj_forLoopAIndex] )
call GroupClear( udg_Fighter_Group_Player[bj_forLoopAIndex] )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call GroupClear( udg_Fighter_King_LEFT )
call GroupClear( udg_Fighter_King_RIGHT )
call GroupClear( udg_Fighter_East )
call GroupClear( udg_Fighter_West )
call GroupEnumUnitsInRect (udg_Temp_UG, bj_mapInitialPlayableArea, Condition(function Trig_Clean_Dummy_Condition) )
call ForGroup(udg_Temp_UG, function Trig_Clean_Dummy_Function)
call DestroyGroup(udg_Temp_UG)
endfunction
//===========================================================================
function InitTrig_Clean_Fighters takes nothing returns nothing
set gg_trg_Clean_Fighters = CreateTrigger( )
call TriggerAddAction( gg_trg_Clean_Fighters, function Trig_Clean_Fighters_Actions )
endfunction
//TESH.scrollpos=34
//TESH.alwaysfold=0
function Trig_Fighters_SFX_Func001002002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_GIANT) == true )
endfunction
function Trig_Fighters_SFX_Func002Func001Func002C takes nothing returns boolean
if ( ( GetUnitTypeId(GetEnumUnit()) == 'h066' ) ) then
return true // soul of hero : Attack
endif
if ( ( GetUnitTypeId(GetEnumUnit()) == 'h067' ) ) then
return true // Soul of Hero : Defend
endif
if ( ( GetUnitTypeId(GetEnumUnit()) == 'h068' ) ) then
return true // Soul of Villain
endif
if ( ( GetUnitTypeId(GetEnumUnit()) == 'h0D3' ) ) then
return true // Death Dragon
endif
return false
endfunction
function Trig_Fighters_SFX_Func002Func001C takes nothing returns boolean
if ( not Trig_Fighters_SFX_Func002Func001Func002C() ) then
return false
endif
return true
endfunction
function Trig_Fighters_SFX_Func002Func002C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnumUnit()) == 'h06G' ) ) then
return false // Meridian
endif
return true
endfunction
function Trig_Fighters_SFX_Func002A takes nothing returns nothing
if ( Trig_Fighters_SFX_Func002Func001C() ) then
call SetUnitVertexColorBJ( GetEnumUnit(), 100.00, 100.00, 100.00, 35.00 )
else
endif
if ( Trig_Fighters_SFX_Func002Func002C() ) then
call SetUnitVertexColorBJ( GetEnumUnit(), 100.00, 100.00, 100.00, 35.00 )
else
endif
endfunction
function Trig_Fighters_SFX_Actions takes nothing returns nothing
set udg_Temp_UG = GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_Fighters_SFX_Func001002002))
call ForGroupBJ( udg_Temp_UG, function Trig_Fighters_SFX_Func002A )
call DestroyGroup (udg_Temp_UG)
endfunction
//===========================================================================
function InitTrig_Fighters_SFX takes nothing returns nothing
set gg_trg_Fighters_SFX = CreateTrigger( )
call TriggerAddAction( gg_trg_Fighters_SFX, function Trig_Fighters_SFX_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Unpause_Hire_Summon_Copy_Conditions takes nothing returns boolean
if ( not ( IsUnitInGroup(GetAttacker(), udg_Hire_Group) == true ) ) then
return false
endif
if ( not ( GetUnitMoveSpeed(GetAttacker()) < 5.00 ) ) then
return false
endif
return true
endfunction
function Trig_Unpause_Hire_Summon_Copy_Func003A takes nothing returns nothing
call SetUnitMoveSpeed( GetEnumUnit(), GetUnitDefaultMoveSpeed(GetEnumUnit()) )
endfunction
function Trig_Unpause_Hire_Summon_Copy_Actions takes nothing returns nothing
call SetUnitMoveSpeed( GetAttacker(), GetUnitDefaultMoveSpeed(GetAttacker()) )
call ForGroup(udg_Hire_Group, function Trig_Unpause_Hire_Summon_Copy_Func003A)
endfunction
//===========================================================================
function InitTrig_Unpause_Hire_Summon_JASS takes nothing returns nothing
set gg_trg_Unpause_Hire_Summon_JASS = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Unpause_Hire_Summon_JASS, Player(8), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Unpause_Hire_Summon_JASS, Player(9), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Unpause_Hire_Summon_JASS, Condition( function Trig_Unpause_Hire_Summon_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Unpause_Hire_Summon_JASS, function Trig_Unpause_Hire_Summon_Copy_Actions )
endfunction
//TESH.scrollpos=25
//TESH.alwaysfold=0
function Trig_Fight_Start_Copy_Func009C takes nothing returns boolean
if ( ( GetOwningPlayer(GetEventTargetUnit()) == Player(10) ) ) then
return true
endif
if ( ( GetOwningPlayer(GetEventTargetUnit()) == Player(11) ) ) then
return true
endif
return false
endfunction
function Trig_Fight_Start_Copy_Conditions takes nothing returns boolean
if ( not ( GetUnitMoveSpeed(GetTriggerUnit()) < 5.00 ) ) then
return false
endif
if ( not Trig_Fight_Start_Copy_Func009C() ) then
return false
endif
return true
endfunction
function Trig_Fight_Start_Copy_Func007C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'h02U' ) ) then
return false
endif
return true
endfunction
function Trig_Fight_Start_Copy_Actions takes nothing returns nothing
call SetUnitMoveSpeed( GetTriggerUnit(), GetUnitDefaultMoveSpeed(GetTriggerUnit()) )
call SetUnitMoveSpeed( GetTriggerUnit(), GetUnitDefaultMoveSpeed(GetTriggerUnit()) )
call SetUnitPathing( GetTriggerUnit(), true )
set udg_Temp_Integer = GetUnitUserData(GetTriggerUnit())
// Abilities Before Fight start
if ( Trig_Fight_Start_Copy_Func007C() ) then
call IssueImmediateOrderBJ( GetTriggerUnit(), "roar" )
else
endif
endfunction
//===========================================================================
function InitTrig_Fight_Start_Copy takes nothing returns nothing
set gg_trg_Fight_Start_Copy = CreateTrigger( )
call DisableTrigger( gg_trg_Fight_Start_Copy )
call TriggerAddCondition( gg_trg_Fight_Start_Copy, Condition( function Trig_Fight_Start_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Fight_Start_Copy, function Trig_Fight_Start_Copy_Actions )
endfunction
function Trig_Fighter_Attacking_Func004C takes nothing returns boolean
if ( ( GetOwningPlayer(GetTriggerUnit()) == Player(10) ) ) then
return true
endif
if ( ( GetOwningPlayer(GetTriggerUnit()) == Player(11) ) ) then
return true
endif
return false
endfunction
function Trig_Fighter_Attacking_Conditions takes nothing returns boolean
if ( not ( udg_FightStart == false ) ) then
return false
endif
if ( not Trig_Fighter_Attacking_Func004C() ) then
return false
endif
return true
endfunction
function Trig_Fighter_Attacking_Actions takes nothing returns nothing
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_8846" )
set udg_FightStart = true
endfunction
//===========================================================================
function InitTrig_Fighter_Attacking takes nothing returns nothing
set gg_trg_Fighter_Attacking = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Fighter_Attacking, Player(8), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Fighter_Attacking, Player(9), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Fighter_Attacking, Condition( function Trig_Fighter_Attacking_Conditions ) )
call TriggerAddAction( gg_trg_Fighter_Attacking, function Trig_Fighter_Attacking_Actions )
endfunction
//TESH.scrollpos=55
//TESH.alwaysfold=0
function Trig_Purchase_Summon_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetEnteringUnit(), UNIT_TYPE_SUMMONED) == true ) ) then
return false
endif
if ( not ( IsUnitType(GetEnteringUnit(), UNIT_TYPE_GIANT) == false ) ) then
return false
endif
if ( not ( IsUnitType(GetEnteringUnit(), UNIT_TYPE_UNDEAD) == false ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(8) ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(9) ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(10) ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(11) ) ) then
return false
endif
return true
endfunction
function Trig_Purchase_Summon_Func005C takes nothing returns boolean
if ( not ( IsPlayerAlly(GetOwningPlayer(GetEnteringUnit()), Player(8)) == true ) ) then
return false
endif
return true
endfunction
function Trig_Purchase_Summon_Actions takes nothing returns nothing
local unit u = GetEnteringUnit()
local player p = GetOwningPlayer(GetEnteringUnit())
local integer id = GetPlayerId(p) + 1
//update summon count
set udg_numberOfSummons[id] = ( udg_numberOfSummons[id] + 1 )
// add to income
if ( udg_onBonusLevel == false ) then
set udg_PlayerIncome[id] = ( udg_PlayerIncome[id] + GetUnitPointValueByType(GetUnitTypeId(GetEnteringUnit())) )
else
endif
// create unit
if ( IsPlayerAlly(p, Player(8)) == true ) then
set udg_Temp_Player = Player(11)
set udg_Temp_Point = GetRandomLocInRect(gg_rct_LSummonHoldAreaSpawn)
else
set udg_Temp_Player = Player(10)
set udg_Temp_Point = GetRandomLocInRect(gg_rct_RSummonHoldAreaSpawn)
endif
set bj_lastCreatedUnit = CreateUnitAtLoc(udg_Temp_Player, GetUnitTypeId(GetEnteringUnit()), udg_Temp_Point, bj_UNIT_FACING)
call SetUnitColor( bj_lastCreatedUnit, GetPlayerColor(GetOwningPlayer(GetEnteringUnit())) )
call SetUnitUserData( bj_lastCreatedUnit, id )
// update total lumber spent
set udg_TotalLumber_Spent[id] = udg_TotalLumber_Spent[id] + (GetUnitLevel(u)*20)
// clean up leak
set u = null
set p = null
call RemoveUnit( GetEnteringUnit() )
call RemoveLocation (udg_Temp_Point)
// trigger update income on score board
call TriggerExecute( gg_trg_Update_Income )
endfunction
//===========================================================================
function InitTrig_Purchase_Summon takes nothing returns nothing
set gg_trg_Purchase_Summon = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Purchase_Summon, GetPlayableMapRect() )
call TriggerAddCondition( gg_trg_Purchase_Summon, Condition( function Trig_Purchase_Summon_Conditions ) )
call TriggerAddAction( gg_trg_Purchase_Summon, function Trig_Purchase_Summon_Actions )
endfunction
//TESH.scrollpos=36
//TESH.alwaysfold=0
function Trig_Purchase_Summon_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetEnteringUnit(), UNIT_TYPE_SUMMONED) == true ) ) then
return false
endif
if ( not ( IsUnitType(GetEnteringUnit(), UNIT_TYPE_GIANT) == false ) ) then
return false
endif
if ( not ( IsUnitType(GetEnteringUnit(), UNIT_TYPE_UNDEAD) == false ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(8) ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(9) ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(10) ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(11) ) ) then
return false
endif
return true
endfunction
function Trig_Purchase_Summon_Func003C takes nothing returns boolean
if ( not ( udg_onBonusLevel == false ) ) then
return false
endif
//if ( GetUnitTypeId(udg_Builder_Unit[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))]) == 'u00P' ) then
// return false
//endif
return true
endfunction
function Trig_Purchase_Summon_Func005C takes nothing returns boolean
if ( not ( IsPlayerAlly(GetOwningPlayer(GetEnteringUnit()), Player(8)) == true ) ) then
return false
endif
return true
endfunction
function Trig_Purchase_Summon_Actions takes nothing returns nothing
local unit u = GetEnteringUnit()
local player p = GetOwningPlayer(GetEnteringUnit())
local integer id = GetPlayerId(p) + 1
set udg_numberOfSummons[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = ( udg_numberOfSummons[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] + 1 )
// add to income
if ( Trig_Purchase_Summon_Func003C() ) then
set udg_PlayerIncome[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = ( udg_PlayerIncome[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] + GetUnitPointValueByType(GetUnitTypeId(GetEnteringUnit())) )
else
endif
// create unit
if ( Trig_Purchase_Summon_Func005C() ) then
set udg_Temp_Player = Player(11)
set udg_Temp_Point = GetRandomLocInRect(gg_rct_LSummonHoldAreaSpawn)
else
set udg_Temp_Player = Player(10)
set udg_Temp_Point = GetRandomLocInRect(gg_rct_RSummonHoldAreaSpawn)
endif
call CreateNUnitsAtLoc( 1, GetUnitTypeId(GetEnteringUnit()), udg_Temp_Player, udg_Temp_Point, bj_UNIT_FACING )
set udg_Temp_Unit2 = GetLastCreatedUnit()
call SetUnitColor( udg_Temp_Unit2, GetPlayerColor(GetOwningPlayer(GetEnteringUnit())) )
call SetUnitUserData( udg_Temp_Unit2, GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit())) )
//set b = GetUnitLevel(d)
call RemoveUnit( GetEnteringUnit() )
call RemoveLocation (udg_Temp_Point)
// trigger update income on score board
call TriggerExecute( gg_trg_Update_Income )
endfunction
//===========================================================================
function InitTrig_Purchase_Summon_Copy takes nothing returns nothing
set gg_trg_Purchase_Summon_Copy = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Purchase_Summon_Copy, GetPlayableMapRect() )
call TriggerAddCondition( gg_trg_Purchase_Summon_Copy, Condition( function Trig_Purchase_Summon_Conditions ) )
call TriggerAddAction( gg_trg_Purchase_Summon_Copy, function Trig_Purchase_Summon_Actions )
endfunction
//TESH.scrollpos=20
//TESH.alwaysfold=0
function Trig_Warp_Summons_Func002Func014001001001 takes nothing returns boolean
return ( GetPlayerSlotState(GetFilterPlayer()) == PLAYER_SLOT_STATE_PLAYING )
endfunction
function Trig_Warp_Summons_Func002Func014001001002001 takes nothing returns boolean
return ( IsPlayerAlly(GetFilterPlayer(), Player(9)) == true )
endfunction
function Trig_Warp_Summons_Func002Func014001001002002 takes nothing returns boolean
return ( GetFilterPlayer() != Player(9) )
endfunction
function Trig_Warp_Summons_Func002Func014001001002 takes nothing returns boolean
return GetBooleanAnd( Trig_Warp_Summons_Func002Func014001001002001(), Trig_Warp_Summons_Func002Func014001001002002() )
endfunction
function Trig_Warp_Summons_Func002Func014001001 takes nothing returns boolean
return GetBooleanAnd( Trig_Warp_Summons_Func002Func014001001001(), Trig_Warp_Summons_Func002Func014001001002() )
endfunction
function Trig_Warp_Summons_Func002Func014A takes nothing returns nothing
set udg_Temp_Integer3 = ( udg_Temp_Integer3 + 1 )
set udg_Temp_Player_Arr[udg_Temp_Integer3] = GetEnumPlayer()
endfunction
function Trig_Warp_Summons_Func002Func015001001001 takes nothing returns boolean
return ( GetPlayerSlotState(GetFilterPlayer()) == PLAYER_SLOT_STATE_PLAYING )
endfunction
function Trig_Warp_Summons_Func002Func015001001002001 takes nothing returns boolean
return ( IsPlayerAlly(GetFilterPlayer(), Player(8)) == true )
endfunction
function Trig_Warp_Summons_Func002Func015001001002002 takes nothing returns boolean
return ( GetFilterPlayer() != Player(8) )
endfunction
function Trig_Warp_Summons_Func002Func015001001002 takes nothing returns boolean
return GetBooleanAnd( Trig_Warp_Summons_Func002Func015001001002001(), Trig_Warp_Summons_Func002Func015001001002002() )
endfunction
function Trig_Warp_Summons_Func002Func015001001 takes nothing returns boolean
return GetBooleanAnd( Trig_Warp_Summons_Func002Func015001001001(), Trig_Warp_Summons_Func002Func015001001002() )
endfunction
function Trig_Warp_Summons_Func002Func015A takes nothing returns nothing
set udg_Temp_Integer4 = ( udg_Temp_Integer4 + 1 )
set udg_Temp_Player_Arr2[udg_Temp_Integer4] = GetEnumPlayer()
endfunction
function Trig_Warp_Summons_Func002Func016C takes nothing returns boolean
if ( not ( udg_LeftTeamAlive == false ) ) then
return false
endif
return true
endfunction
function Trig_Warp_Summons_Func002Func017C takes nothing returns boolean
if ( not ( udg_RightTeamAlive == false ) ) then
return false
endif
return true
endfunction
function Trig_Warp_Summons_Func002C takes nothing returns boolean
if ( not ( udg_spawnall == true ) ) then
return false
endif
return true
endfunction
function Trig_Warp_Summons_Func008Func003C takes nothing returns boolean
if ( not ( udg_SummonCounterL == udg_Temp_Integer3 ) ) then
return false
endif
return true
endfunction
function Trig_Warp_Summons_Func008A takes nothing returns nothing
local location loc = udg_SpawnArr[GetConvertedPlayerId(udg_Temp_Player_Arr[udg_SummonCounterL])]
call SetUnitPositionLoc( GetEnumUnit(), loc )
if ( Trig_Warp_Summons_Func008Func003C() ) then
set udg_SummonCounterL = 1
else
set udg_SummonCounterL = ( udg_SummonCounterL + 1 )
endif
call RemoveLocation(loc)
set loc = null
endfunction
function Trig_Warp_Summons_Func011Func003C takes nothing returns boolean
if ( not ( udg_SummonCounterR == udg_Temp_Integer4 ) ) then
return false
endif
return true
endfunction
function Trig_Warp_Summons_Func011A takes nothing returns nothing
local location loc = udg_SpawnArr[GetConvertedPlayerId(udg_Temp_Player_Arr2[udg_SummonCounterR])]
call SetUnitPositionLoc( GetEnumUnit(), loc )
if ( Trig_Warp_Summons_Func011Func003C() ) then
set udg_SummonCounterR = 1
else
set udg_SummonCounterR = ( udg_SummonCounterR + 1 )
endif
call RemoveLocation(loc)
set loc = null
endfunction
function Trig_Warp_Summons_Actions takes nothing returns nothing
// --- DON"T TRY remove leak here, summon will never teleport, and your fighter will never teleport
if ( Trig_Warp_Summons_Func002C() ) then
set udg_Temp_Player_Arr[1] = Player(4)
set udg_Temp_Player_Arr[2] = Player(5)
set udg_Temp_Player_Arr[3] = Player(6)
set udg_Temp_Player_Arr[4] = Player(7)
set udg_Temp_Player_Arr2[1] = Player(0)
set udg_Temp_Player_Arr2[2] = Player(1)
set udg_Temp_Player_Arr2[3] = Player(2)
set udg_Temp_Player_Arr2[4] = Player(3)
set udg_Temp_Integer3 = 4
set udg_Temp_Integer4 = 4
else
// Set Temp Player Groups (possible summon points)
set udg_Temp_Integer3 = 0
set udg_Temp_Integer4 = 0
call ForForce( GetPlayersMatching(Condition(function Trig_Warp_Summons_Func002Func014001001)), function Trig_Warp_Summons_Func002Func014A )
call ForForce( GetPlayersMatching(Condition(function Trig_Warp_Summons_Func002Func015001001)), function Trig_Warp_Summons_Func002Func015A )
if ( Trig_Warp_Summons_Func002Func016C() ) then
set udg_Temp_Player_Arr2[1] = Player(0)
set udg_Temp_Player_Arr2[2] = Player(1)
set udg_Temp_Player_Arr2[3] = Player(2)
set udg_Temp_Player_Arr2[4] = Player(3)
set udg_Temp_Integer4 = 4
else
endif
if ( Trig_Warp_Summons_Func002Func017C() ) then
set udg_Temp_Player_Arr[1] = Player(4)
set udg_Temp_Player_Arr[2] = Player(5)
set udg_Temp_Player_Arr[3] = Player(6)
set udg_Temp_Player_Arr[4] = Player(7)
set udg_Temp_Integer3 = 4
else
endif
endif
//
set udg_SummonCounterL = GetRandomInt(1, udg_Temp_Integer3)
set udg_SummonCounterR = GetRandomInt(1, udg_Temp_Integer4)
//
set udg_Temp_UG = GetUnitsInRectOfPlayer(gg_rct_LSummonHoldArea, Player(11))
call ForGroupBJ( udg_Temp_UG, function Trig_Warp_Summons_Func008A )
call GroupClear( udg_Temp_UG )
set udg_Temp_UG = GetUnitsInRectOfPlayer(gg_rct_RSummonHoldArea, Player(10))
call ForGroupBJ( udg_Temp_UG, function Trig_Warp_Summons_Func011A )
endfunction
//===========================================================================
function InitTrig_Warp_Summons_JASS takes nothing returns nothing
set gg_trg_Warp_Summons_JASS = CreateTrigger( )
call TriggerAddAction( gg_trg_Warp_Summons_JASS, function Trig_Warp_Summons_Actions )
endfunction
//TESH.scrollpos=261
//TESH.alwaysfold=0
function Trig_Setup_Unit_Sets_Actions takes nothing returns nothing
// Set 1
set udg_Temp_Integer = 0
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet1[udg_Temp_Integer] = 'h010'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet1[udg_Temp_Integer] = 'h01P'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet1[udg_Temp_Integer] = 'h01C'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet1[udg_Temp_Integer] = 'h06J'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet1[udg_Temp_Integer] = 'h040'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet1[udg_Temp_Integer] = 'h05N'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet1[udg_Temp_Integer] = 'h00M'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet1[udg_Temp_Integer] = 'h07J'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet1[udg_Temp_Integer] = 'h08F'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet1[udg_Temp_Integer] = 'h09L'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet1[udg_Temp_Integer] = 'h0A8' // Small Land Mine
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet1[udg_Temp_Integer] = 'h0BC' // Tuskar
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet1[udg_Temp_Integer] = 'h0BF' //Orc Warrior
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet1[udg_Temp_Integer] = 'h0CF' //Apolyte building
//
set udg_UnitSetSize[1] = udg_Temp_Integer
////////////////////////////////
// Set 2
set udg_Temp_Integer = 0
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet2[udg_Temp_Integer] = 'h012'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet2[udg_Temp_Integer] = 'h01T'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet2[udg_Temp_Integer] = 'h06K'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet2[udg_Temp_Integer] = 'h01E'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet2[udg_Temp_Integer] = 'h042'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet2[udg_Temp_Integer] = 'h05S'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet2[udg_Temp_Integer] = 'h00O'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet2[udg_Temp_Integer] = 'h07O'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet2[udg_Temp_Integer] = 'h08H'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet2[udg_Temp_Integer] = 'h09W'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet2[udg_Temp_Integer] = 'h0AE' // Geomancer
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet2[udg_Temp_Integer] = 'h0BE' // Frost Wolf
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet2[udg_Temp_Integer] = 'h0BV' // h0BV Orc Warlock
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet2[udg_Temp_Integer] = 'h0CI' // Ghoul
//
set udg_UnitSetSize[2] = udg_Temp_Integer
// Set 3
set udg_Temp_Integer = 0
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet3[udg_Temp_Integer] = 'h014' //harpy t3
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet3[udg_Temp_Integer] = 'h06M' // tribe t3
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet3[udg_Temp_Integer] = 'h044' // watcher t3
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet3[udg_Temp_Integer] = 'h01H' //sprite t3
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet3[udg_Temp_Integer] = 'h01V' //gateguard t3
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet3[udg_Temp_Integer] = 'h00P' //captain t3
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet3[udg_Temp_Integer] = 'h05R' //phantom T3
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet3[udg_Temp_Integer] = 'h07Q' // bottom feed t3
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet3[udg_Temp_Integer] = 'h08N' //sentry t3
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet3[udg_Temp_Integer] = 'h09N' // footman t3
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet3[udg_Temp_Integer] = 'h0AB' //Turrent t3
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet3[udg_Temp_Integer] = 'h0BH' //Ice Troll
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet3[udg_Temp_Integer] = 'h0BX' //h0BX Raider
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet3[udg_Temp_Integer] = 'h0CO' // meat wagon building
//
set udg_UnitSetSize[3] = udg_Temp_Integer
// Set 4
set udg_Temp_Integer = 0
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet4[udg_Temp_Integer] = 'h016' // Troll fighter T4
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet4[udg_Temp_Integer] = 'h06O'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet4[udg_Temp_Integer] = 'h046'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet4[udg_Temp_Integer] = 'h01I'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet4[udg_Temp_Integer] = 'h01X'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet4[udg_Temp_Integer] = 'h00N'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet4[udg_Temp_Integer] = 'h05V' //outcast -- element T4
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet4[udg_Temp_Integer] = 'h07S'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet4[udg_Temp_Integer] = 'h09R'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet4[udg_Temp_Integer] = 'h08Q'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet4[udg_Temp_Integer] = 'h0AH' //flying machine
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet4[udg_Temp_Integer] = 'h0BJ' //polar bear
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet4[udg_Temp_Integer] = 'h0C4' // h0C4 Young witch Doctor
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet4[udg_Temp_Integer] = 'h0CQ' // Necromance building
//
set udg_UnitSetSize[4] = udg_Temp_Integer
// Set 5
set udg_Temp_Integer = 0
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet5[udg_Temp_Integer] = 'h06Q' //harlot
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet5[udg_Temp_Integer] = 'h018'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet5[udg_Temp_Integer] = 'h01K'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet5[udg_Temp_Integer] = 'h048'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet5[udg_Temp_Integer] = 'h00Q'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet5[udg_Temp_Integer] = 'h01Z'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet5[udg_Temp_Integer] = 'h05X'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet5[udg_Temp_Integer] = 'h07U'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet5[udg_Temp_Integer] = 'h09T'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet5[udg_Temp_Integer] = 'h08V'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet5[udg_Temp_Integer] = 'h0AL' // alchemist
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet5[udg_Temp_Integer] = 'h0BM' // Wandigoo
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet5[udg_Temp_Integer] = 'h0C5' // h0C5 orc's Wyvern
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet5[udg_Temp_Integer] = 'h0CW' // Zombie Building
//
set udg_UnitSetSize[5] = udg_Temp_Integer
// Set 6
set udg_Temp_Integer = 0
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet6[udg_Temp_Integer] = 'h01A'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet6[udg_Temp_Integer] = 'h06S'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet6[udg_Temp_Integer] = 'h021'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet6[udg_Temp_Integer] = 'h05Z'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet6[udg_Temp_Integer] = 'h04A'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet6[udg_Temp_Integer] = 'h01M'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet6[udg_Temp_Integer] = 'h00S'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet6[udg_Temp_Integer] = 'h07W'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet6[udg_Temp_Integer] = 'h090'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet6[udg_Temp_Integer] = 'h0A3'
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet6[udg_Temp_Integer] = 'h0AR' //steamroller
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet6[udg_Temp_Integer] = 'h0BO' // Young Frost Dragon
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet6[udg_Temp_Integer] = 'h0C9' // H0C9 Orc Warchief
//
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_UnitSet6[udg_Temp_Integer] = 'h0D0' // Guardian of Death building
//
set udg_UnitSetSize[6] = udg_Temp_Integer
endfunction
//===========================================================================
function InitTrig_Setup_Unit_Sets takes nothing returns nothing
set gg_trg_Setup_Unit_Sets = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Setup_Unit_Sets, 1.00 )
call TriggerAddAction( gg_trg_Setup_Unit_Sets, function Trig_Setup_Unit_Sets_Actions )
endfunction
//TESH.scrollpos=90
//TESH.alwaysfold=0
function Trig_Unit_Sets_Func001C takes nothing returns boolean
if ( ( GetUnitTypeId(GetTriggerUnit()) == 'h07D' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetTriggerUnit()) == 'h07E' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetTriggerUnit()) == 'h07G' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetTriggerUnit()) == 'h07F' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetTriggerUnit()) == 'h07H' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetTriggerUnit()) == 'h07I' ) ) then
return true
endif
return false
endfunction
function Trig_Unit_Sets_Conditions takes nothing returns boolean
if ( not Trig_Unit_Sets_Func001C() ) then
return false
endif
return true
endfunction
function Trig_Unit_Sets_Actions takes nothing returns nothing
local unit u
set u = GetTriggerUnit()
call GroupRemoveUnitSimple( GetTriggerUnit(), udg_Tower_Group )
// Sfx
set udg_Temp_Point = GetUnitLoc( u )
call AddSpecialEffectLocBJ( udg_Temp_Point, "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
//
call PolledWait( 0.30 )
if ( ( GetUnitTypeId(u) == 'h07D' ) ) then
set u = ReplaceUnitBJ( u, udg_UnitSet1[GetRandomInt(1, udg_UnitSetSize[1])], bj_UNIT_STATE_METHOD_MAXIMUM )
set udg_Temp_Integer2 = GetUnitPointValue(GetLastReplacedUnitBJ())
else
endif
if ( ( GetUnitTypeId(u) == 'h07E' ) ) then
set u = ReplaceUnitBJ( u, udg_UnitSet2[GetRandomInt(1, udg_UnitSetSize[2])], bj_UNIT_STATE_METHOD_MAXIMUM )
else
endif
if ( ( GetUnitTypeId(u) == 'h07G' ) ) then
set u = ReplaceUnitBJ( u, udg_UnitSet3[GetRandomInt(1, udg_UnitSetSize[3])], bj_UNIT_STATE_METHOD_MAXIMUM )
else
endif
if ( ( GetUnitTypeId(u) == 'h07F' ) ) then
set u = ReplaceUnitBJ( u, udg_UnitSet4[GetRandomInt(1, udg_UnitSetSize[4])], bj_UNIT_STATE_METHOD_MAXIMUM )
else
endif
if ( ( GetUnitTypeId(u) == 'h07H' ) ) then
set u = ReplaceUnitBJ( u, udg_UnitSet5[GetRandomInt(1, udg_UnitSetSize[5])], bj_UNIT_STATE_METHOD_MAXIMUM )
else
endif
if ( ( GetUnitTypeId(u) == 'h07I' ) ) then
set u = ReplaceUnitBJ( u, udg_UnitSet6[GetRandomInt(1, udg_UnitSetSize[6])], bj_UNIT_STATE_METHOD_MAXIMUM )
else
endif
//
set u = GetLastReplacedUnitBJ()
call GroupAddUnitSimple( GetLastReplacedUnitBJ(), udg_Tower_Group )
// calculate Hybrid profit/lost
// Morping, return cost
set udg_Temp_Integer = GetUnitPointValue(GetTriggerUnit())
call SetPlayerStateBJ( GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_GOLD_GATHERED, ( GetPlayerState(GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_GOLD_GATHERED) - udg_Temp_Integer) )
//set udg_TotalGold[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = ( udg_TotalGold[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] - udg_Temp_Integer )
// real tower, real cost
set udg_Temp_Integer2 = GetUnitPointValue( GetLastReplacedUnitBJ())
call SetPlayerStateBJ( GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_GOLD_GATHERED, ( GetPlayerState(GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_GOLD_GATHERED) + udg_Temp_Integer2) )
//set udg_TotalGold[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = ( udg_TotalGold[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] + udg_Temp_Integer2 )
if( udg_Temp_Integer > udg_Temp_Integer2 ) then
set udg_Temp_Integer3 = udg_Temp_Integer - udg_Temp_Integer2
call showUnitTextPlayer (GetTriggerUnit(), "- " + I2S(udg_Temp_Integer3), 100.00, 0.00, 0.00, GetOwningPlayer(GetTriggerUnit()))
set udg_TotalGold[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = ( udg_TotalGold[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] - udg_Temp_Integer3 )
else
endif
if( udg_Temp_Integer < udg_Temp_Integer2 ) then
set udg_Temp_Integer3 = udg_Temp_Integer2 - udg_Temp_Integer
call showUnitTextPlayer (GetTriggerUnit(), "+ " + I2S(udg_Temp_Integer3), 100.00, 77.00, 0.00, GetOwningPlayer(GetTriggerUnit()))
set udg_TotalGold[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = ( udg_TotalGold[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] + udg_Temp_Integer3 )
else
endif
call SetUnitVertexColorBJ( u, 100, 100, 100, 50.00 )
call SetUnitTimeScalePercent( u, 0.00 )
call ResetUnitAnimation( u )
// Fix scaling for gay units
if ( ( GetUnitTypeId(u) == 'h05N' ) ) then
call SetUnitTimeScalePercent( u, 100.00)
call PolledWait( 0.30 )
call SetUnitTimeScalePercent( u, 0.00 )
call ResetUnitAnimation( u )
else
endif
set u = null
call TriggerExecute( gg_trg_Value_Fighters )
endfunction
//===========================================================================
function InitTrig_Unit_Sets takes nothing returns nothing
set gg_trg_Unit_Sets = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Unit_Sets, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH )
call TriggerAddCondition( gg_trg_Unit_Sets, Condition( function Trig_Unit_Sets_Conditions ) )
call TriggerAddAction( gg_trg_Unit_Sets, function Trig_Unit_Sets_Actions )
endfunction
//TESH.scrollpos=47
//TESH.alwaysfold=0
function Trig_Unit_Sets_Func001C takes nothing returns boolean
if ( ( GetUnitTypeId(GetTriggerUnit()) == 'h07D' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetTriggerUnit()) == 'h07E' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetTriggerUnit()) == 'h07G' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetTriggerUnit()) == 'h07F' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetTriggerUnit()) == 'h07H' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetTriggerUnit()) == 'h07I' ) ) then
return true
endif
return false
endfunction
function Trig_Unit_Sets_Conditions takes nothing returns boolean
if ( not Trig_Unit_Sets_Func001C() ) then
return false
endif
return true
endfunction
function Trig_Unit_Sets_Actions takes nothing returns nothing
local unit u
set u = GetTriggerUnit()
// Sfx
set udg_Temp_Point = GetUnitLoc( u )
call AddSpecialEffectLocBJ( udg_Temp_Point, "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
//
call PolledWait( 0.30 )
if ( ( GetUnitTypeId(u) == 'h07D' ) ) then
set u = ReplaceUnitBJ( u, udg_UnitSet1[GetRandomInt(1, udg_UnitSetSize[1])], bj_UNIT_STATE_METHOD_MAXIMUM )
else
endif
if ( ( GetUnitTypeId(u) == 'h07E' ) ) then
set u = ReplaceUnitBJ( u, udg_UnitSet2[GetRandomInt(1, udg_UnitSetSize[2])], bj_UNIT_STATE_METHOD_MAXIMUM )
else
endif
if ( ( GetUnitTypeId(u) == 'h07G' ) ) then
set u = ReplaceUnitBJ( u, udg_UnitSet3[GetRandomInt(1, udg_UnitSetSize[3])], bj_UNIT_STATE_METHOD_MAXIMUM )
else
endif
if ( ( GetUnitTypeId(u) == 'h07F' ) ) then
set u = ReplaceUnitBJ( u, udg_UnitSet4[GetRandomInt(1, udg_UnitSetSize[4])], bj_UNIT_STATE_METHOD_MAXIMUM )
else
endif
if ( ( GetUnitTypeId(u) == 'h07H' ) ) then
set u = ReplaceUnitBJ( u, udg_UnitSet5[GetRandomInt(1, udg_UnitSetSize[5])], bj_UNIT_STATE_METHOD_MAXIMUM )
else
endif
if ( ( GetUnitTypeId(u) == 'h07I' ) ) then
set u = ReplaceUnitBJ( u, udg_UnitSet6[GetRandomInt(1, udg_UnitSetSize[6])], bj_UNIT_STATE_METHOD_MAXIMUM )
else
endif
//
//set u = GetLastReplacedUnitBJ()
call GroupAddUnitSimple( u, udg_Tower_Group )
call SetUnitVertexColorBJ( u, 100, 100, 100, 50.00 )
call SetUnitTimeScalePercent( u, 0.00 )
call ResetUnitAnimation( u )
// Fix scaling for gay units
if ( ( GetUnitTypeId(u) == 'h05N' ) ) then
call SetUnitTimeScalePercent( u, 100.00)
call PolledWait( 0.30 )
call SetUnitTimeScalePercent( u, 0.00 )
call ResetUnitAnimation( u )
else
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Unit_Sets_Copy takes nothing returns nothing
set gg_trg_Unit_Sets_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Unit_Sets_Copy, EVENT_PLAYER_UNIT_CONSTRUCT_FINISH )
call TriggerAddCondition( gg_trg_Unit_Sets_Copy, Condition( function Trig_Unit_Sets_Conditions ) )
call TriggerAddAction( gg_trg_Unit_Sets_Copy, function Trig_Unit_Sets_Actions )
endfunction
function Trig_Dismiss_Copy_Actions takes nothing returns nothing
set udg_Temp_Point = GetUnitLoc(GetSpellAbilityUnit())
endfunction
//===========================================================================
function InitTrig_Dismiss_Copy takes nothing returns nothing
set gg_trg_Dismiss_Copy = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dismiss_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_Dismiss_Copy, function Trig_Dismiss_Copy_Actions )
endfunction
function Trig_Attack_Copy_8_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'n007' ) ) then
return false
endif
return true
endfunction
function Trig_Attack_Copy_8_Actions takes nothing returns nothing
endfunction
//===========================================================================
function InitTrig_Attack_Copy_8 takes nothing returns nothing
set gg_trg_Attack_Copy_8 = CreateTrigger( )
call DisableTrigger( gg_trg_Attack_Copy_8 )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Attack_Copy_8, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Attack_Copy_8, Condition( function Trig_Attack_Copy_8_Conditions ) )
call TriggerAddAction( gg_trg_Attack_Copy_8, function Trig_Attack_Copy_8_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_Attack_Copy_7_Func005C takes nothing returns boolean
if ( ( GetOwningPlayer(GetTriggerUnit()) == Player(8) ) ) then
return true
endif
if ( ( GetOwningPlayer(GetTriggerUnit()) == Player(9) ) ) then
return true
endif
return false
endfunction
function Trig_Attack_Copy_7_Conditions takes nothing returns boolean
if ( not ( udg_SpecialEvent == false ) ) then
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Unpause_Group) == false ) ) then
return false
endif
if ( not Trig_Attack_Copy_7_Func005C() ) then
return false
endif
return true
endfunction
function Trig_Attack_Copy_7_Actions takes nothing returns nothing
call PolledWait( 2 )
set udg_Temp_Real = ( I2R(udg_FightersValue[udg_Temp_Integer)]) / S2R(udg_RecommendValue[udg_Temp_Integer]) )
udg_Temp_Real2 = 100+(5-udg_Temp_Integer)*10
udg_Temp_integer = R2I( udg_Temp_Real*udg_Temp_Real2 )
endfunction
//===========================================================================
function InitTrig_Attack_Copy_7 takes nothing returns nothing
set gg_trg_Attack_Copy_7 = CreateTrigger( )
call DisableTrigger( gg_trg_Attack_Copy_7 )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Attack_Copy_7, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Attack_Copy_7, Condition( function Trig_Attack_Copy_7_Conditions ) )
call TriggerAddAction( gg_trg_Attack_Copy_7, function Trig_Attack_Copy_7_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_Attack_Copy_6_Func004C takes nothing returns boolean
if ( ( GetOwningPlayer(GetTriggerUnit()) == Player(8) ) ) then
return true
endif
if ( ( GetOwningPlayer(GetTriggerUnit()) == Player(9) ) ) then
return true
endif
return false
endfunction
function Trig_Attack_Copy_6_Conditions takes nothing returns boolean
if ( not ( udg_SpecialEvent == false ) ) then
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Unpause_Group) == false ) ) then
return false
endif
if ( not Trig_Attack_Copy_6_Func004C() ) then
return false
endif
return true
endfunction
function Trig_Attack_Copy_6_Actions takes nothing returns nothing
call PolledWait( 2 )
set temp_real = udg_
endfunction
//===========================================================================
function InitTrig_Attack_Copy_6 takes nothing returns nothing
set gg_trg_Attack_Copy_6 = CreateTrigger( )
call DisableTrigger( gg_trg_Attack_Copy_6 )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Attack_Copy_6, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Attack_Copy_6, Condition( function Trig_Attack_Copy_6_Conditions ) )
call TriggerAddAction( gg_trg_Attack_Copy_6, function Trig_Attack_Copy_6_Actions )
endfunction
//TESH.scrollpos=12
//TESH.alwaysfold=0
function Trig_Attack_Copy_5_Func005C takes nothing returns boolean
if ( ( GetOwningPlayer(GetTriggerUnit()) == Player(8) ) ) then
return true
endif
if ( ( GetOwningPlayer(GetTriggerUnit()) == Player(9) ) ) then
return true
endif
return false
endfunction
function Trig_Attack_Copy_5_Conditions takes nothing returns boolean
if ( not ( udg_SpecialEvent == false ) ) then
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Unpause_Group) == false ) ) then
return false
endif
if ( not Trig_Attack_Copy_5_Func005C() ) then
return false
endif
return true
endfunction
function Trig_Attack_Copy_5_Func002002002 takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == 'u006' )
endfunction
function Trig_Attack_Copy_5_Actions takes nothing returns nothing
set udg_TotalLumber_Spent[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = ( udg_TotalLumber_Spent[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] + 50 )
set udg_Temp_UG = GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_Attack_Copy_5_Func002002002))
endfunction
//===========================================================================
function InitTrig_Attack_Copy_5 takes nothing returns nothing
set gg_trg_Attack_Copy_5 = CreateTrigger( )
call DisableTrigger( gg_trg_Attack_Copy_5 )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Attack_Copy_5, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Attack_Copy_5, Condition( function Trig_Attack_Copy_5_Conditions ) )
call TriggerAddAction( gg_trg_Attack_Copy_5, function Trig_Attack_Copy_5_Actions )
endfunction
//TESH.scrollpos=15
//TESH.alwaysfold=0
function Trig_Attack_Copy_4_Func004C takes nothing returns boolean
if ( ( GetOwningPlayer(GetTriggerUnit()) == Player(8) ) ) then
return true
endif
if ( ( GetOwningPlayer(GetTriggerUnit()) == Player(9) ) ) then
return true
endif
return false
endfunction
function Trig_Attack_Copy_4_Conditions takes nothing returns boolean
if ( not ( udg_SpecialEvent == false ) ) then
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Unpause_Group) == false ) ) then
return false
endif
if ( not Trig_Attack_Copy_4_Func004C() ) then
return false
endif
return true
endfunction
function Trig_Attack_Copy_4_Func001002002 takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == 'u006' )
endfunction
function Trig_Attack_Copy_4_Actions takes nothing returns nothing
call GroupEnumUnitsInRect (udg_Temp_UG, bj_mapInitialPlayableArea, GetUnitTypeId(GetFilterUnit()) == 'u006' )
set udg_Temp_UG = GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_Attack_Copy_4_Func001002002))
endfunction
//===========================================================================
function InitTrig_Attack_Copy_4 takes nothing returns nothing
set gg_trg_Attack_Copy_4 = CreateTrigger( )
call DisableTrigger( gg_trg_Attack_Copy_4 )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Attack_Copy_4, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Attack_Copy_4, Condition( function Trig_Attack_Copy_4_Conditions ) )
call TriggerAddAction( gg_trg_Attack_Copy_4, function Trig_Attack_Copy_4_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_Attack_Copy_3_Func004C takes nothing returns boolean
if ( ( GetOwningPlayer(GetTriggerUnit()) == Player(8) ) ) then
return true
endif
if ( ( GetOwningPlayer(GetTriggerUnit()) == Player(9) ) ) then
return true
endif
return false
endfunction
function Trig_Attack_Copy_3_Conditions takes nothing returns boolean
if ( not ( udg_SpecialEvent == false ) ) then
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Unpause_Group) == false ) ) then
return false
endif
if ( not Trig_Attack_Copy_3_Func004C() ) then
return false
endif
return true
endfunction
function Trig_Attack_Copy_3_Actions takes nothing returns nothing
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUTIN, 2, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, 0 )
endfunction
//===========================================================================
function InitTrig_Attack_Copy_3 takes nothing returns nothing
set gg_trg_Attack_Copy_3 = CreateTrigger( )
call DisableTrigger( gg_trg_Attack_Copy_3 )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Attack_Copy_3, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Attack_Copy_3, Condition( function Trig_Attack_Copy_3_Conditions ) )
call TriggerAddAction( gg_trg_Attack_Copy_3, function Trig_Attack_Copy_3_Actions )
endfunction
function Trig_Attack_Copy_Func004C takes nothing returns boolean
if ( ( GetOwningPlayer(GetTriggerUnit()) == Player(8) ) ) then
return true
endif
if ( ( GetOwningPlayer(GetTriggerUnit()) == Player(9) ) ) then
return true
endif
return false
endfunction
function Trig_Attack_Copy_Conditions takes nothing returns boolean
if ( not ( udg_SpecialEvent == false ) ) then
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Unpause_Group) == false ) ) then
return false
endif
if ( not Trig_Attack_Copy_Func004C() ) then
return false
endif
return true
endfunction
function Trig_Attack_Copy_Actions takes nothing returns nothing
call SmartCameraPanBJ( Player(0), GetRectCenter(GetPlayableMapRect()), 0.5 )
endfunction
//===========================================================================
function InitTrig_Attack_Copy takes nothing returns nothing
set gg_trg_Attack_Copy = CreateTrigger( )
call DisableTrigger( gg_trg_Attack_Copy )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Attack_Copy, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Attack_Copy, Condition( function Trig_Attack_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Attack_Copy, function Trig_Attack_Copy_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Death_Dragon_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'h0D3' ) ) then
return false
endif
if ( not ( GetUnitManaPercent(GetAttacker()) == 100.00 ) ) then
return false
endif
return true
endfunction
function Trig_Death_Dragon_Actions takes nothing returns nothing
call IssueImmediateOrderBJ( GetAttacker(), "corrosivebreath" )
endfunction
//===========================================================================
function InitTrig_Death_Dragon takes nothing returns nothing
set gg_trg_Death_Dragon = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Death_Dragon, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Death_Dragon, Condition( function Trig_Death_Dragon_Conditions ) )
call TriggerAddAction( gg_trg_Death_Dragon, function Trig_Death_Dragon_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Thrall_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'h0CB' ) ) then
return false // Thrall
endif
//if ( not ( GetUnitManaPercent(GetAttacker()) == 100.00 ) ) then
// return false
//endif
if ( not ( GetUnitState(GetAttacker(), UNIT_STATE_MANA) >0 ) ) then
return false // Thrall
endif
if ( not ( GetUnitState(GetAttacker(), UNIT_STATE_MANA) == GetUnitState(GetAttacker(), UNIT_STATE_MAX_MANA) ) ) then
return false
endif
return true
endfunction
function Trig_Thrall_Actions takes nothing returns nothing
//call IssueTargetOrderBJ( GetAttacker(), "thunderbolt", GetAttackedUnitBJ() )
call IssueTargetOrder( GetAttacker(), "thunderbolt", GetTriggerUnit() )
call IssuePointOrderLoc( GetTriggerUnit(), "attack", udg_PathingPointArray[GetUnitUserData(GetTriggerUnit())])
endfunction
//===========================================================================
function InitTrig_Thrall takes nothing returns nothing
set gg_trg_Thrall = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Thrall, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Thrall, Condition( function Trig_Thrall_Conditions ) )
call TriggerAddAction( gg_trg_Thrall, function Trig_Thrall_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Autocast_Tidal_Wave_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'h089' ) ) then
return false
endif
if ( ( GetUnitDefaultFlyHeight(GetAttackedUnitBJ()) < 25.00 ) ) then
return true
endif
if ( ( UnitHasBuffBJ(GetAttackedUnitBJ(), 'B026') == true ) ) then
return true
endif
if ( ( UnitHasBuffBJ(GetAttackedUnitBJ(), 'B028') == true ) ) then
return true
endif
return false
endfunction
function Trig_Autocast_Tidal_Wave_Actions takes nothing returns nothing
local unit u = GetAttacker()
local location pt = GetUnitLoc(GetAttackedUnitBJ())
call IssuePointOrderLocBJ( u, "shockwave", pt )
//call DisplayTimedTextToForce(GetPlayersAll(), 30.0, "Tidal wave!")
//call DisplayTimedTextToForce(GetPlayersAll(), 30.0, "")
set u = null
call RemoveLocation(pt)
set pt = null
endfunction
//===========================================================================
function InitTrig_Autocast_Tidal_Wave takes nothing returns nothing
set gg_trg_Autocast_Tidal_Wave = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Autocast_Tidal_Wave, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Autocast_Tidal_Wave, Condition( function Trig_Autocast_Tidal_Wave_Conditions ) )
call TriggerAddAction( gg_trg_Autocast_Tidal_Wave, function Trig_Autocast_Tidal_Wave_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Tidal_Wave_dummy_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'h089' ) ) then
return false
endif
if ( not ( GetUnitManaPercent(GetAttacker()) == 100.00 ) ) then
return false
endif
if ( ( GetUnitDefaultFlyHeight(GetAttackedUnitBJ()) < 25.00 ) ) then
return true
endif
if ( ( UnitHasBuffBJ(GetAttackedUnitBJ(), 'B026') == true ) ) then
return true
endif
if ( ( UnitHasBuffBJ(GetAttackedUnitBJ(), 'B028') == true ) ) then
return true
endif
return false
endfunction
function Trig_Tidal_Wave_dummy_Actions takes nothing returns nothing
local unit u
local location pt = GetUnitLoc(GetAttackedUnitBJ())
set udg_Temp_Point = GetUnitLoc(GetAttacker())
call SetUnitManaBJ(GetAttacker(), 0)
call CreateNUnitsAtLoc( 1, 'u006', GetOwningPlayer(GetAttacker()), udg_Temp_Point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call SetUnitUserData( u, GetUnitUserData(GetAttacker()) )
call UnitAddAbilityBJ( 'A07B', u )
//call TriggerSleepAction(1.00)
call IssuePointOrderLocBJ( u, "shockwave", pt )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', u )
endfunction
//===========================================================================
function InitTrig_Autocast_Tidal_Wave_dummy takes nothing returns nothing
set gg_trg_Autocast_Tidal_Wave_dummy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Autocast_Tidal_Wave_dummy, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Autocast_Tidal_Wave_dummy, Condition( function Trig_Tidal_Wave_dummy_Conditions ) )
call TriggerAddAction( gg_trg_Autocast_Tidal_Wave_dummy, function Trig_Tidal_Wave_dummy_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
// Thunderbird
function Trig_Thunder_Wave_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'h032' ) ) then
return false
endif
return true
endfunction
function Trig_Thunder_Wave_Actions takes nothing returns nothing
local unit u
set udg_Temp_Point = GetUnitLoc(GetAttacker())
call CreateNUnitsAtLoc( 1, 'u006', GetOwningPlayer(GetAttacker()), udg_Temp_Point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call SetUnitUserData( u, GetUnitUserData(GetAttacker()) )
call UnitAddAbilityBJ( 'A03X', u )
call TriggerSleepAction(1.00)
call IssueImmediateOrderBJ( u, "fanofknives" )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', u )
call RemoveLocation (udg_Temp_Point)
endfunction
//===========================================================================
function InitTrig_Thunder_Wave takes nothing returns nothing
set gg_trg_Thunder_Wave = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Thunder_Wave, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Thunder_Wave, Condition( function Trig_Thunder_Wave_Conditions ) )
call TriggerAddAction( gg_trg_Thunder_Wave, function Trig_Thunder_Wave_Actions )
endfunction
//TESH.scrollpos=10
//TESH.alwaysfold=0
// Pheonix
function Trig_Focus_Energy_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'h04N' ) ) then
return false
endif
return true
endfunction
function Trig_Focus_Energy_Actions takes nothing returns nothing
local unit u = GetAttacker()
local unit u2 = GetAttackedUnitBJ()
local string s
local real r
local integer i = R2I(( GetUnitStateSwap(UNIT_STATE_MANA, GetAttacker()) / 3.00 ))
local player pl = GetOwningPlayer(u)
call TriggerSleepAction(0.633)
call UnitDamageTargetBJ( u, u2, I2R(i), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
set i = ( i + GetRandomInt(193, 205) )
set s = I2S(i)
set r = GetUnitFlyHeight(u)
//call showUnitTextAllWithZ(u, s, 100.0, 0.0, 0.0, 10.0, r)
call showUnitTextAlliesWithZ(u, s, 100.0, 0.0, 0.0, 10.0, r, pl)
endfunction
//===========================================================================
function InitTrig_Focus_Energy takes nothing returns nothing
set gg_trg_Focus_Energy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Focus_Energy, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Focus_Energy, Condition( function Trig_Focus_Energy_Conditions ) )
call TriggerAddAction( gg_trg_Focus_Energy, function Trig_Focus_Energy_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Exploding_Shell_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'h02H' ) ) then
return false
endif
return true
endfunction
function Trig_Exploding_Shell_Func001C takes nothing returns boolean
if ( not ( GetRandomInt(0, 10) <= 4 ) ) then
return false
endif
return true
endfunction
function Trig_Exploding_Shell_Actions takes nothing returns nothing
local unit u
if ( Trig_Exploding_Shell_Func001C() ) then
set udg_Temp_Point = GetUnitLoc(GetAttackedUnitBJ())
call CreateNUnitsAtLoc( 1, 'u006', GetOwningPlayer(GetAttacker()), udg_Temp_Point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call SetUnitUserData( u, GetUnitUserData(GetAttacker()) )
call UnitAddAbilityBJ( 'A03V', u )
call TriggerSleepAction(0.60)
call IssueImmediateOrderBJ( u, "fanofknives" )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', u )
call RemoveLocation (udg_Temp_Point)
else
endif
endfunction
//===========================================================================
function InitTrig_Exploding_Shell takes nothing returns nothing
set gg_trg_Exploding_Shell = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Exploding_Shell, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Exploding_Shell, Condition( function Trig_Exploding_Shell_Conditions ) )
call TriggerAddAction( gg_trg_Exploding_Shell, function Trig_Exploding_Shell_Actions )
endfunction
//TESH.scrollpos=4
//TESH.alwaysfold=0
function Trig_Autocast_Magnataur_Shockwave_Conditions takes nothing returns boolean
if ( not ( udg_InRound == true ) ) then
return false
endif
return true
endfunction
function Trig_Autocast_Magnataur_Shockwave_Func003Func002002003001 takes nothing returns boolean
return ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(GetEnumUnit())) == true )
endfunction
function Trig_Autocast_Magnataur_Shockwave_Func003Func002002003002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_GIANT) == true )
endfunction
function Trig_Autocast_Magnataur_Shockwave_Func003Func002002003 takes nothing returns boolean
return GetBooleanAnd( Trig_Autocast_Magnataur_Shockwave_Func003Func002002003001(), Trig_Autocast_Magnataur_Shockwave_Func003Func002002003002() )
endfunction
function Trig_Autocast_Magnataur_Shockwave_Func003Func003C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_Temp_UG) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Autocast_Magnataur_Shockwave_Func003A takes nothing returns nothing
set udg_Temp_Point = GetUnitLoc(GetEnumUnit())
set udg_Temp_UG2 = GetUnitsInRangeOfLocMatching(500.00, udg_Temp_Point, Condition(function Trig_Autocast_Magnataur_Shockwave_Func003Func002002003))
if ( Trig_Autocast_Magnataur_Shockwave_Func003Func003C() ) then
set udg_Temp_Unit = GroupPickRandomUnit(udg_Temp_UG2)
set udg_Temp_Point2 = GetUnitLoc(udg_Temp_Unit)
call IssuePointOrderLocBJ( GetEnumUnit(), "shockwave", udg_Temp_Point2 )
call RemoveLocation (udg_Temp_Point2)
else
endif
call RemoveLocation (udg_Temp_Point)
call DestroyGroup (udg_Temp_UG2)
endfunction
function Trig_Autocast_Magnataur_Shockwave_Actions takes nothing returns nothing
set udg_Temp_UG = GetUnitsOfTypeIdAll('H05K')
call ForGroupBJ( udg_Temp_UG, function Trig_Autocast_Magnataur_Shockwave_Func003A )
call DestroyGroup (udg_Temp_UG)
endfunction
//===========================================================================
function InitTrig_Autocast_Magnataur_Shockwave takes nothing returns nothing
set gg_trg_Autocast_Magnataur_Shockwave = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Autocast_Magnataur_Shockwave, 1.00 )
call TriggerAddCondition( gg_trg_Autocast_Magnataur_Shockwave, Condition( function Trig_Autocast_Magnataur_Shockwave_Conditions ) )
call TriggerAddAction( gg_trg_Autocast_Magnataur_Shockwave, function Trig_Autocast_Magnataur_Shockwave_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Assign_Summon_To_Player_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetEnteringUnit(), UNIT_TYPE_GIANT) == true ) ) then
return false
endif
if ( not ( IsUnitType(GetEnteringUnit(), UNIT_TYPE_SUMMONED) == true ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(8) ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetEnteringUnit()) != Player(9) ) ) then
return false
endif
return true
endfunction
function Trig_Assign_Summon_To_Player_Func004C takes nothing returns boolean
if ( not ( IsPlayerAlly(GetOwningPlayer(GetEnteringUnit()), Player(8)) == true ) ) then
return false
endif
return true
endfunction
function Trig_Assign_Summon_To_Player_Actions takes nothing returns nothing
local unit u
set udg_Temp_Point = GetUnitLoc(GetEnteringUnit())
if ( Trig_Assign_Summon_To_Player_Func004C() ) then
set udg_Temp_Player = Player(8)
else
set udg_Temp_Player = Player(9)
endif
set u = CreateUnit(udg_Temp_Player, GetUnitTypeId(GetEnteringUnit()), GetLocationX(udg_Temp_Point), GetLocationY(udg_Temp_Point), bj_UNIT_FACING)
call SetUnitColor( u, GetPlayerColor(GetOwningPlayer(GetEnteringUnit())) )
call SetUnitUserData( u, GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit())) )
call GroupAddUnit(udg_Fighter_Group, u)
//call UnitAddAbilityBJ( 'A017', u )
call UnitApplyTimedLifeBJ( I2R(GetUnitPointValueByType(GetUnitTypeId(u))), 'BTLF', u )
call RemoveUnit( GetEnteringUnit() )
call RemoveLocation (udg_Temp_Point)
endfunction
//===========================================================================
function InitTrig_Assign_Summon_To_Player takes nothing returns nothing
set gg_trg_Assign_Summon_To_Player = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Assign_Summon_To_Player, GetPlayableMapRect() )
call TriggerAddCondition( gg_trg_Assign_Summon_To_Player, Condition( function Trig_Assign_Summon_To_Player_Conditions ) )
call TriggerAddAction( gg_trg_Assign_Summon_To_Player, function Trig_Assign_Summon_To_Player_Actions )
endfunction
//TESH.scrollpos=17
//TESH.alwaysfold=0
function Trig_Summon_SFX_Func011C takes nothing returns boolean
if ( ( GetOwningPlayer(GetEnteringUnit()) == Player(8) ) ) then
return true
endif
if ( ( GetOwningPlayer(GetEnteringUnit()) == Player(9) ) ) then
return true
endif
return false
endfunction
function Trig_Summon_SFX_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetEnteringUnit(), UNIT_TYPE_GIANT) == true ) ) then
return false
endif
if ( not ( IsUnitType(GetEnteringUnit(), UNIT_TYPE_SUMMONED) == true ) ) then
return false
endif
if ( not Trig_Summon_SFX_Func011C() ) then
return false
endif
return true
endfunction
function Trig_Summon_SFX_Actions takes nothing returns nothing
local effect sfx
local unit u
// sfx
set u = GetEnteringUnit()
set sfx = AddSpecialEffectTarget("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl", u, "origin")
call TriggerSleepAction( 4.00 )
call DestroyEffect(sfx)
set u = null
endfunction
//===========================================================================
function InitTrig_Summon_SFX takes nothing returns nothing
set gg_trg_Summon_SFX = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Summon_SFX, bj_mapInitialPlayableArea )
call TriggerAddCondition( gg_trg_Summon_SFX, Condition( function Trig_Summon_SFX_Conditions ) )
call TriggerAddAction( gg_trg_Summon_SFX, function Trig_Summon_SFX_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Reorder_Ability_Casters_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetSpellAbilityUnit(), UNIT_TYPE_GIANT) == true ) ) then
return false
endif
return true
endfunction
function Trig_Reorder_Ability_Casters_Func001C takes unit u returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A017', u) > 0 ) ) then
return false
endif
if ( not ( RectContainsUnit(gg_rct_LKingSpawnWide, u) == false ) ) then
return false
endif
if ( not ( RectContainsUnit(gg_rct_RKingSpawnWide, u) == false ) ) then
return false
endif
return true
endfunction
function Trig_Reorder_Ability_Casters_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
//call TriggerSleepAction(1.00)
call PolledWait(1.00)
if ( Trig_Reorder_Ability_Casters_Func001C(u) ) then
call IssuePointOrderLocBJ( u, "attack", udg_PathingPointArray[GetUnitAbilityLevelSwapped('A017', u)] )
else
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Reorder_Ability_Casters takes nothing returns nothing
set gg_trg_Reorder_Ability_Casters = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reorder_Ability_Casters, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddCondition( gg_trg_Reorder_Ability_Casters, Condition( function Trig_Reorder_Ability_Casters_Conditions ) )
call TriggerAddAction( gg_trg_Reorder_Ability_Casters, function Trig_Reorder_Ability_Casters_Actions )
endfunction
function Trig_Testing_Copy_6_Conditions takes nothing returns boolean
if ( not ( IsUnitIdType(GetUnitTypeId(GetTriggerUnit()), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_SUMMONED) == true ) ) then
return false
endif
return true
endfunction
function Trig_Testing_Copy_6_Actions takes nothing returns nothing
call GroupPointOrderLocBJ( udg_Fighter_Group_Player[udg_Temp_Integer], "attack", udg_PathingPointArray[udg_Temp_Integer] )
endfunction
//===========================================================================
function InitTrig_Testing_Copy_6 takes nothing returns nothing
set gg_trg_Testing_Copy_6 = CreateTrigger( )
call DisableTrigger( gg_trg_Testing_Copy_6 )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Testing_Copy_6, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Testing_Copy_6, Condition( function Trig_Testing_Copy_6_Conditions ) )
call TriggerAddAction( gg_trg_Testing_Copy_6, function Trig_Testing_Copy_6_Actions )
endfunction
function Trig_Testing_Copy_5_Conditions takes nothing returns boolean
if ( not ( IsUnitIdType(GetUnitTypeId(GetTriggerUnit()), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_SUMMONED) == true ) ) then
return false
endif
return true
endfunction
function Trig_Testing_Copy_5_Actions takes nothing returns nothing
set udg_LevelDescript_String[GetForLoopIndexA()] = ( ( ( ( ( ( "|cffC0C0C0[|r |cffFFcc00L" + I2S(GetForLoopIndexA()) ) + "|r |cffC0C0C0]|r" ) + " " ) + udg_Temp_String ) + "s" ) + ( ( "|cffC0C0C0 --- (|r" + udg_LevelATKType_String[GetForLoopIndexA()] ) + ( "|cffC0C0C0, |r" + ( udg_LevelDEFType_String[GetForLoopIndexA()] + ( "|cffC0C0C0) --- |r" + ( I2S(udg_LevelWaveCount_Integer[GetForLoopIndexA()]) + "|cffC0C0C0 at each spawn.|r" ) ) ) ) ) )
endfunction
//===========================================================================
function InitTrig_Testing_Copy_5 takes nothing returns nothing
set gg_trg_Testing_Copy_5 = CreateTrigger( )
call DisableTrigger( gg_trg_Testing_Copy_5 )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Testing_Copy_5, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Testing_Copy_5, Condition( function Trig_Testing_Copy_5_Conditions ) )
call TriggerAddAction( gg_trg_Testing_Copy_5, function Trig_Testing_Copy_5_Actions )
endfunction
function Trig_Testing_Copy_Conditions takes nothing returns boolean
if ( not ( RectContainsUnit(gg_rct_LeftTooFar, GetEnumUnit()) == true ) ) then
return false
endif
return true
endfunction
function Trig_Testing_Copy_Actions takes nothing returns nothing
set udg_LevelDescript_String[GetForLoopIndexA()] = ( ( ( ( ( ( "|cffC0C0C0[|r |cffFFcc00L" + I2S(GetForLoopIndexA()) ) + "|r |cffC0C0C0]|r" ) + " " ) + udg_Temp_String ) + "s" ) + ( ( "|cffC0C0C0 --- (|r" + udg_LevelATKType_String[GetForLoopIndexA()] ) + ( "|cffC0C0C0, |r" + ( udg_LevelDEFType_String[GetForLoopIndexA()] + ( "|cffC0C0C0) --- |r" + ( I2S(udg_LevelWaveCount_Integer[GetForLoopIndexA()]) + "|cffC0C0C0 at each spawn.|r" ) ) ) ) ) )
endfunction
//===========================================================================
function InitTrig_Testing_Copy takes nothing returns nothing
set gg_trg_Testing_Copy = CreateTrigger( )
call DisableTrigger( gg_trg_Testing_Copy )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Testing_Copy, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Testing_Copy, Condition( function Trig_Testing_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Testing_Copy, function Trig_Testing_Copy_Actions )
endfunction
function Trig_Testing_trigger_Copy_3_Actions takes nothing returns nothing
call IssuePointOrderLocBJ( GetEnumUnit(), "patrol", udg_LKingSpawnPt )
endfunction
//===========================================================================
function InitTrig_Testing_trigger_Copy_3 takes nothing returns nothing
set gg_trg_Testing_trigger_Copy_3 = CreateTrigger( )
call DisableTrigger( gg_trg_Testing_trigger_Copy_3 )
call TriggerAddAction( gg_trg_Testing_trigger_Copy_3, function Trig_Testing_trigger_Copy_3_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Testing_trigger_Copy_2_Actions takes nothing returns nothing
call SetUnitFacingTimed( gg_unit_h00K_0009, bj_UNIT_FACING, 0 )
call SetUnitFacingTimed( gg_unit_h00K_0006, bj_UNIT_FACING, 0 )
endfunction
//===========================================================================
function InitTrig_Testing_trigger_Copy_2 takes nothing returns nothing
set gg_trg_Testing_trigger_Copy_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Testing_trigger_Copy_2 )
call TriggerAddAction( gg_trg_Testing_trigger_Copy_2, function Trig_Testing_trigger_Copy_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Testing_trigger_Copy_Func001C takes nothing returns boolean
if ( ( GetOwningPlayer(GetEnteringUnit()) == Player(10) ) ) then
return true
endif
if ( ( GetOwningPlayer(GetEnteringUnit()) == Player(9) ) ) then
return true
endif
if ( ( IsUnitInGroup(GetTriggerUnit(), udg_AntiStuckGroup) == true ) ) then
return true
endif
return false
endfunction
function Trig_Testing_trigger_Copy_Conditions takes nothing returns boolean
if ( not Trig_Testing_trigger_Copy_Func001C() ) then
return false
endif
set udg_Temp_String = "Positive Vote : " + I2S(udg_VoteCountYes-udg_VoteCountNo) + " (Require:" + R2S( I2R(udg_Temp_Integer)*0.5) + ")"
return true
endfunction
function Trig_Testing_trigger_Copy_Actions takes nothing returns nothing
call IssuePointOrderLocBJ( GetEnteringUnit(), "attack", udg_LMidLeft )
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_8842" )
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_8843" )
call SetUnitUserData( GetEnteringUnit(), 1 )
call GroupAddUnitSimple( GetTriggerUnit(), udg_CreepSpawnPoint[1] )
call GroupRemoveUnitSimple( GetTriggerUnit(), udg_CreepSpawnPoint[1] )
endfunction
//===========================================================================
function InitTrig_Testing_trigger_Copy takes nothing returns nothing
set gg_trg_Testing_trigger_Copy = CreateTrigger( )
call DisableTrigger( gg_trg_Testing_trigger_Copy )
call TriggerRegisterLeaveRectSimple( gg_trg_Testing_trigger_Copy, GetCurrentCameraBoundsMapRectBJ() )
call TriggerAddCondition( gg_trg_Testing_trigger_Copy, Condition( function Trig_Testing_trigger_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Testing_trigger_Copy, function Trig_Testing_trigger_Copy_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_New_Spawn_1_Conditions takes nothing returns boolean
if ( not ( udg_SpecialEvent == false ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(10) ) ) then // 11 = left creep
return false
endif
return true
endfunction
function Trig_New_Spawn_1_Actions takes nothing returns nothing
//if ( GetUnitAbilityLevel(GetTriggerUnit(), 'A017') == 0 ) then
// call UnitAddAbility(GetTriggerUnit(), 'A017') // add pathing dummy ability
//endif
//call SetUnitAbilityLevel(GetTriggerUnit(), 'A017', 1) // player 1 = 1
call IssuePointOrderLoc( GetTriggerUnit(), "attack", udg_LMidLeft )
call IssuePointOrderLoc( GetTriggerUnit(), "patrol", udg_LKing ) // left king
//call SetUnitPathing( GetTriggerUnit(), false )
call GroupAddUnit(udg_Creeps_UnitGroup, GetTriggerUnit()) // Creep Group
call GroupAddUnit(udg_CreepsLeft[1], GetTriggerUnit()) // West creep
call GroupAddUnit(udg_CreepSpawnPoint[1], GetTriggerUnit())
if (GetUnitUserData(GetTriggerUnit()) == 0 ) then // custom value
call SetUnitUserData( GetEnteringUnit(), 1 )
endif
endfunction
//===========================================================================
function InitTrig_Creep_Enter_Spawn_1 takes nothing returns nothing
set gg_trg_Creep_Enter_Spawn_1 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Enter_Spawn_1, gg_rct_Creep_1 )
call TriggerAddCondition( gg_trg_Creep_Enter_Spawn_1, Condition( function Trig_New_Spawn_1_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Enter_Spawn_1, function Trig_New_Spawn_1_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_New_Spawn_2_Conditions takes nothing returns boolean
if ( not ( udg_SpecialEvent == false ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(10) ) ) then // 11 = left creep
return false
endif
return true
endfunction
function Trig_New_Spawn_2_Actions takes nothing returns nothing
call IssuePointOrderLoc( GetTriggerUnit(), "attack", udg_LMidLeft )
call IssuePointOrderLoc( GetTriggerUnit(), "patrol", udg_LKing ) // left king
call GroupAddUnit(udg_Creeps_UnitGroup, GetTriggerUnit()) // Creep Group
call GroupAddUnit(udg_CreepsLeft[1], GetTriggerUnit()) // West creep
call GroupAddUnit(udg_CreepSpawnPoint[2], GetTriggerUnit())
if (GetUnitUserData(GetTriggerUnit()) == 0 ) then // custom value
call SetUnitUserData( GetEnteringUnit(), 2 )
endif
endfunction
//===========================================================================
function InitTrig_Creep_Enter_Spawn_2 takes nothing returns nothing
set gg_trg_Creep_Enter_Spawn_2 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Enter_Spawn_2, gg_rct_Creep_2 )
call TriggerAddCondition( gg_trg_Creep_Enter_Spawn_2, Condition( function Trig_New_Spawn_2_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Enter_Spawn_2, function Trig_New_Spawn_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_New_Spawn_3_Conditions takes nothing returns boolean
if ( not ( udg_SpecialEvent == false ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(10) ) ) then // 11 = left creep
return false
endif
return true
endfunction
function Trig_New_Spawn_3_Actions takes nothing returns nothing
call IssuePointOrderLoc( GetTriggerUnit(), "attack", udg_LMidRight )
call IssuePointOrderLoc( GetTriggerUnit(), "patrol", udg_LKing ) // left king
call GroupAddUnit(udg_Creeps_UnitGroup, GetTriggerUnit()) // Creep Group
call GroupAddUnit(udg_CreepsLeft[1], GetTriggerUnit()) // West creep
call GroupAddUnit(udg_CreepSpawnPoint[3], GetTriggerUnit())
if (GetUnitUserData(GetTriggerUnit()) == 0 ) then // custom value
call SetUnitUserData( GetEnteringUnit(), 3 )
endif
endfunction
//===========================================================================
function InitTrig_Creep_Enter_Spawn_3 takes nothing returns nothing
set gg_trg_Creep_Enter_Spawn_3 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Enter_Spawn_3, gg_rct_Creep_3 )
call TriggerAddCondition( gg_trg_Creep_Enter_Spawn_3, Condition( function Trig_New_Spawn_3_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Enter_Spawn_3, function Trig_New_Spawn_3_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_New_Spawn_4_Conditions takes nothing returns boolean
if ( not ( udg_SpecialEvent == false ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(10) ) ) then // 11 = left creep
return false
endif
return true
endfunction
function Trig_New_Spawn_4_Actions takes nothing returns nothing
call IssuePointOrderLoc( GetTriggerUnit(), "attack", udg_LMidRight )
call IssuePointOrderLoc( GetTriggerUnit(), "patrol", udg_LKing ) // left king
call GroupAddUnit(udg_Creeps_UnitGroup, GetTriggerUnit()) // Creep Group
call GroupAddUnit(udg_CreepsLeft[1], GetTriggerUnit()) // West creep
call GroupAddUnit(udg_CreepSpawnPoint[4], GetTriggerUnit()) // change ID
if (GetUnitUserData(GetTriggerUnit()) == 0 ) then // custom value
call SetUnitUserData( GetEnteringUnit(), 4 )
endif
endfunction
//===========================================================================
function InitTrig_Creep_Enter_Spawn_4 takes nothing returns nothing
set gg_trg_Creep_Enter_Spawn_4 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Enter_Spawn_4, gg_rct_Creep_4 )
call TriggerAddCondition( gg_trg_Creep_Enter_Spawn_4, Condition( function Trig_New_Spawn_4_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Enter_Spawn_4, function Trig_New_Spawn_4_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_New_Spawn_5_Conditions takes nothing returns boolean
if ( not ( udg_SpecialEvent == false ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(11) ) ) then // 12 = right creep
return false
endif
return true
endfunction
function Trig_New_Spawn_5_Actions takes nothing returns nothing
call IssuePointOrderLoc( GetTriggerUnit(), "attack", udg_RMidLeft )
call IssuePointOrderLoc( GetTriggerUnit(), "patrol", udg_RKing ) // right king
call GroupAddUnit(udg_Creeps_UnitGroup, GetTriggerUnit()) // Creep Group
call GroupAddUnit(udg_CreepsLeft[2], GetTriggerUnit()) // East creep
call GroupAddUnit(udg_CreepSpawnPoint[5], GetTriggerUnit())
if (GetUnitUserData(GetTriggerUnit()) == 0 ) then // custom value
call SetUnitUserData( GetEnteringUnit(), 5 )
endif
endfunction
//===========================================================================
function InitTrig_Creep_Enter_Spawn_5 takes nothing returns nothing
set gg_trg_Creep_Enter_Spawn_5 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Enter_Spawn_5, gg_rct_Creep_5 )
call TriggerAddCondition( gg_trg_Creep_Enter_Spawn_5, Condition( function Trig_New_Spawn_5_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Enter_Spawn_5, function Trig_New_Spawn_5_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_New_Spawn_6_Conditions takes nothing returns boolean
if ( not ( udg_SpecialEvent == false ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(11) ) ) then // 12 = right creep
return false
endif
return true
endfunction
function Trig_New_Spawn_6_Actions takes nothing returns nothing
call IssuePointOrderLoc( GetTriggerUnit(), "attack", udg_RMidLeft )
call IssuePointOrderLoc( GetTriggerUnit(), "patrol", udg_RKing ) // right king
call GroupAddUnit(udg_Creeps_UnitGroup, GetTriggerUnit()) // Creep Group
call GroupAddUnit(udg_CreepsLeft[2], GetTriggerUnit()) // East creep
call GroupAddUnit(udg_CreepSpawnPoint[6], GetTriggerUnit())
if (GetUnitUserData(GetTriggerUnit()) == 0 ) then // custom value
call SetUnitUserData( GetEnteringUnit(), 6 )
endif
endfunction
//===========================================================================
function InitTrig_Creep_Enter_Spawn_6 takes nothing returns nothing
set gg_trg_Creep_Enter_Spawn_6 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Enter_Spawn_6, gg_rct_Creep_6 )
call TriggerAddCondition( gg_trg_Creep_Enter_Spawn_6, Condition( function Trig_New_Spawn_6_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Enter_Spawn_6, function Trig_New_Spawn_6_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_New_Spawn_7_Conditions takes nothing returns boolean
if ( not ( udg_SpecialEvent == false ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(11) ) ) then // 12 = right creep
return false
endif
return true
endfunction
function Trig_New_Spawn_7_Actions takes nothing returns nothing
call IssuePointOrderLoc( GetTriggerUnit(), "attack", udg_RMidRight )
call IssuePointOrderLoc( GetTriggerUnit(), "patrol", udg_RKing ) // right king
call GroupAddUnit(udg_Creeps_UnitGroup, GetTriggerUnit()) // Creep Group
call GroupAddUnit(udg_CreepsLeft[2], GetTriggerUnit()) // East creep
call GroupAddUnit(udg_CreepSpawnPoint[7], GetTriggerUnit())
if (GetUnitUserData(GetTriggerUnit()) == 0 ) then // custom value
call SetUnitUserData( GetEnteringUnit(), 7 )
endif
endfunction
//===========================================================================
function InitTrig_Creep_Enter_Spawn_7 takes nothing returns nothing
set gg_trg_Creep_Enter_Spawn_7 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Enter_Spawn_7, gg_rct_Creep_7 )
call TriggerAddCondition( gg_trg_Creep_Enter_Spawn_7, Condition( function Trig_New_Spawn_7_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Enter_Spawn_7, function Trig_New_Spawn_7_Actions )
endfunction
//TESH.scrollpos=5
//TESH.alwaysfold=0
function Trig_New_Spawn_8_Conditions takes nothing returns boolean
if ( not ( udg_SpecialEvent == false ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(11) ) ) then // 12 = right creep
return false
endif
return true
endfunction
function Trig_New_Spawn_8_Actions takes nothing returns nothing
call IssuePointOrderLoc( GetTriggerUnit(), "attack", udg_RMidRight )
call IssuePointOrderLoc( GetTriggerUnit(), "patrol", udg_RKing ) // right king
call GroupAddUnit(udg_Creeps_UnitGroup, GetTriggerUnit()) // Creep Group
call GroupAddUnit(udg_CreepsLeft[2], GetTriggerUnit()) // East creep
call GroupAddUnit(udg_CreepSpawnPoint[8], GetTriggerUnit())
if (GetUnitUserData(GetTriggerUnit()) == 0 ) then // custom value
call SetUnitUserData( GetEnteringUnit(), 8 )
endif
endfunction
//===========================================================================
function InitTrig_Creep_Enter_Spawn_8 takes nothing returns nothing
set gg_trg_Creep_Enter_Spawn_8 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Enter_Spawn_8, gg_rct_Creep_8 )
call TriggerAddCondition( gg_trg_Creep_Enter_Spawn_8, Condition( function Trig_New_Spawn_8_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Enter_Spawn_8, function Trig_New_Spawn_8_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Creep_Leave_Spawn_LEFT_JASS_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(10) ) ) then
return false
endif
return true
endfunction
function Trig_Creep_Leave_Spawn_LEFT_JASS_Actions takes nothing returns nothing
local integer i = GetUnitUserData(GetTriggerUnit())
if ( IsUnitInGroup(GetTriggerUnit(), udg_CreepSpawnPoint[i]) == true ) then
call GroupAddUnit(udg_CreepSpawnMove[i], GetTriggerUnit())
call GroupRemoveUnit(udg_CreepSpawnPoint[i], GetTriggerUnit())
endif
//call SetUnitPathing( GetTriggerUnit(), true )
endfunction
//===========================================================================
function InitTrig_Creep_Leave_Spawn_LEFT_JASS takes nothing returns nothing
local trigger t = CreateTrigger()
local region r = CreateRegion()
call RegionAddRect(r,gg_rct_Creep_1)
call RegionAddRect(r,gg_rct_Creep_2)
call RegionAddRect(r,gg_rct_Creep_3)
call RegionAddRect(r,gg_rct_Creep_4)
call TriggerRegisterLeaveRegion(gg_trg_Creep_Leave_Spawn_LEFT_JASS, r, null)
//set gg_trg_Creep_Leave_Spawn_LEFT_JASS = CreateTrigger( )
//call TriggerRegisterLeaveRectSimple( gg_trg_Creep_Leave_Spawn_LEFT_JASS, gg_rct_Creep_1 )
//call TriggerRegisterLeaveRectSimple( gg_trg_Creep_Leave_Spawn_LEFT_JASS, gg_rct_Creep_2 )
//call TriggerRegisterLeaveRectSimple( gg_trg_Creep_Leave_Spawn_LEFT_JASS, gg_rct_Creep_3 )
//call TriggerRegisterLeaveRectSimple( gg_trg_Creep_Leave_Spawn_LEFT_JASS, gg_rct_Creep_4 )
call TriggerAddCondition( gg_trg_Creep_Leave_Spawn_LEFT_JASS, Condition( function Trig_Creep_Leave_Spawn_LEFT_JASS_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Leave_Spawn_LEFT_JASS, function Trig_Creep_Leave_Spawn_LEFT_JASS_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Creep_Leave_Spawn_RIGHT_JASS_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(11) ) ) then
return false
endif
return true
endfunction
function Trig_Creep_Leave_Spawn_RIGHT_JASS_Actions takes nothing returns nothing
local integer i = GetUnitUserData(GetTriggerUnit())
if ( IsUnitInGroup(GetTriggerUnit(), udg_CreepSpawnPoint[i]) == true ) then
call GroupAddUnit(udg_CreepSpawnMove[i], GetTriggerUnit())
call GroupRemoveUnit(udg_CreepSpawnPoint[i], GetTriggerUnit())
endif
//call SetUnitPathing( GetTriggerUnit(), true )
endfunction
//===========================================================================
function InitTrig_Creep_Leave_Spawn_RIGHT_JASS takes nothing returns nothing
local trigger t = CreateTrigger()
local region r = CreateRegion()
call RegionAddRect(r,gg_rct_Creep_5)
call RegionAddRect(r,gg_rct_Creep_6)
call RegionAddRect(r,gg_rct_Creep_7)
call RegionAddRect(r,gg_rct_Creep_8)
call TriggerRegisterLeaveRegion(gg_trg_Creep_Leave_Spawn_RIGHT_JASS, r, null)
//set gg_trg_Creep_Leave_Spawn_RIGHT_JASS = CreateTrigger( )
//call TriggerRegisterLeaveRectSimple( gg_trg_Creep_Leave_Spawn_RIGHT_JASS, gg_rct_Creep_5 )
//call TriggerRegisterLeaveRectSimple( gg_trg_Creep_Leave_Spawn_RIGHT_JASS, gg_rct_Creep_6 )
//call TriggerRegisterLeaveRectSimple( gg_trg_Creep_Leave_Spawn_RIGHT_JASS, gg_rct_Creep_7 )
//call TriggerRegisterLeaveRectSimple( gg_trg_Creep_Leave_Spawn_RIGHT_JASS, gg_rct_Creep_8 )
call TriggerAddCondition( gg_trg_Creep_Leave_Spawn_RIGHT_JASS, Condition( function Trig_Creep_Leave_Spawn_RIGHT_JASS_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Leave_Spawn_RIGHT_JASS, function Trig_Creep_Leave_Spawn_RIGHT_JASS_Actions )
endfunction
function Trig_New_Pathing_L_Left_1_Copy_Func001C takes nothing returns boolean
if ( ( GetOwningPlayer(GetEnteringUnit()) == Player(10) ) ) then
return true
endif
if ( ( GetOwningPlayer(GetEnteringUnit()) == Player(9) ) ) then
return true
endif
return false
endfunction
function Trig_New_Pathing_L_Left_1_Copy_Conditions takes nothing returns boolean
if ( not Trig_New_Pathing_L_Left_1_Copy_Func001C() ) then
return false
endif
return true
endfunction
function Trig_New_Pathing_L_Left_1_Copy_Actions takes nothing returns nothing
call IssuePointOrderLocBJ( GetEnteringUnit(), "attack", udg_LMidLeft )
call SetUnitUserData( GetEnteringUnit(), 1 )
endfunction
//===========================================================================
function InitTrig_New_Pathing_L_Left_1_Copy takes nothing returns nothing
set gg_trg_New_Pathing_L_Left_1_Copy = CreateTrigger( )
call DisableTrigger( gg_trg_New_Pathing_L_Left_1_Copy )
call TriggerRegisterEnterRectSimple( gg_trg_New_Pathing_L_Left_1_Copy, gg_rct_Creep_1 )
call TriggerAddCondition( gg_trg_New_Pathing_L_Left_1_Copy, Condition( function Trig_New_Pathing_L_Left_1_Copy_Conditions ) )
call TriggerAddAction( gg_trg_New_Pathing_L_Left_1_Copy, function Trig_New_Pathing_L_Left_1_Copy_Actions )
endfunction
//TESH.scrollpos=23
//TESH.alwaysfold=0
function Trig_Fighter_West_OR_Conditions takes nothing returns boolean
if ( ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_SUMMONED) == true ) ) then
return true
endif
if ( ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_GIANT) == true ) ) then
return true
endif
return false
endfunction
function Trig_Fighter_West_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(8) ) ) then //plater 9 = left
return false
endif
if ( not Trig_Fighter_West_OR_Conditions() ) then
return false
endif
return true
endfunction
function Trig_Fighter_West_Actions takes nothing returns nothing
call GroupAddUnit(udg_Fighter_Group, GetTriggerUnit())
//call DisplayTimedTextToForce( GetPlayersAll(), 30, ( ( GetUnitName(GetTriggerUnit()) + "'s Enter:: " ) + I2S(GetUnitUserData(GetTriggerUnit())) ) )
if(GetUnitUserData(GetTriggerUnit()) >0) then
call GroupAddUnit(udg_Fighter_Group_Player[GetUnitUserData(GetTriggerUnit())], GetTriggerUnit())
//call DisplayTimedTextToForce( GetPlayersAll(), 30, ( ( GetUnitName(GetTriggerUnit()) + "'s Join:: " ) + I2S(GetUnitUserData(GetTriggerUnit())) ) )
endif
endfunction
//===========================================================================
function InitTrig_Fighter_West takes nothing returns nothing
local region r = CreateRegion()
set gg_trg_Fighter_West = CreateTrigger( )
call RegionAddRect(r,gg_rct_P1)
call RegionAddRect(r,gg_rct_P2)
call RegionAddRect(r,gg_rct_P3)
call RegionAddRect(r,gg_rct_P4)
call TriggerRegisterEnterRegion(gg_trg_Fighter_West, r, null)
call TriggerAddCondition( gg_trg_Fighter_West, Condition( function Trig_Fighter_West_Conditions ) )
call TriggerAddAction( gg_trg_Fighter_West, function Trig_Fighter_West_Actions )
set r = null
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Fighter_East_OR_Conditions takes nothing returns boolean
if ( ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_SUMMONED) == true ) ) then
return true
endif
if ( ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_GIANT) == true ) ) then
return true
endif
return false
endfunction
function Trig_Fighter_East_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(9) ) ) then //plater 10 = right
return false
endif
if ( not Trig_Fighter_East_OR_Conditions() ) then
return false
endif
return true
endfunction
function Trig_Fighter_East_Actions takes nothing returns nothing
call GroupAddUnit(udg_Fighter_Group, GetTriggerUnit())
if(GetUnitUserData(GetTriggerUnit()) >0) then
call GroupAddUnit(udg_Fighter_Group_Player[GetUnitUserData(GetTriggerUnit())], GetTriggerUnit())
endif
endfunction
//===========================================================================
function InitTrig_Fighter_East takes nothing returns nothing
local region r = CreateRegion()
set gg_trg_Fighter_East = CreateTrigger( )
call RegionAddRect(r,gg_rct_P1)
call RegionAddRect(r,gg_rct_P2)
call RegionAddRect(r,gg_rct_P3)
call RegionAddRect(r,gg_rct_P4)
call TriggerRegisterEnterRegion(gg_trg_Fighter_East, r, null)
call TriggerAddCondition( gg_trg_Fighter_East, Condition( function Trig_Fighter_East_Conditions ) )
call TriggerAddAction( gg_trg_Fighter_East, function Trig_Fighter_East_Actions )
set r = null
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_New_Pathing_P1_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(8) ) ) then //plater 9 = left
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Fighter_Group_Player[1]) == false ) ) then // custom value = 1
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Fighter_Group_Player[2]) == false ) ) then // custom value = 1
return false
endif
return true
endfunction
function Trig_New_Pathing_P1_Actions takes nothing returns nothing
call GroupAddUnit(udg_Fighter_Group, GetTriggerUnit())
if(GetUnitUserData(GetTriggerUnit()) >0) then
call GroupAddUnit(udg_Fighter_Group_Player[GetUnitUserData(GetTriggerUnit())], GetTriggerUnit())
endif
endfunction
//===========================================================================
function InitTrig_Player_1_Fighter_P1 takes nothing returns nothing
set gg_trg_Player_1_Fighter_P1 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Player_1_Fighter_P1, gg_rct_P1 )
call TriggerAddCondition( gg_trg_Player_1_Fighter_P1, Condition( function Trig_New_Pathing_P1_Conditions ) )
call TriggerAddAction( gg_trg_Player_1_Fighter_P1, function Trig_New_Pathing_P1_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_New_Pathing_P2_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(8) ) ) then //player 9 = fighter
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Fighter_Group_Player[1]) == false ) ) then // custom value = 1
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Fighter_Group_Player[2]) == false ) ) then // custom value = 1
return false
endif
return true
endfunction
function Trig_New_Pathing_P2_Actions takes nothing returns nothing
//call UnitAddAbility(GetTriggerUnit(), 'A017') // add pathing dummy ability
//call SetUnitAbilityLevel(GetTriggerUnit(), 'A017', 2) // player 1 = 1
//call IssuePointOrderLoc( GetTriggerUnit(), "attack", udg_Spawn2 )
call GroupAddUnit(udg_Fighter_Group_Player[GetUnitUserData(GetTriggerUnit())], GetTriggerUnit())
call GroupAddUnit(udg_Fighter_Group, GetTriggerUnit())
endfunction
//===========================================================================
function InitTrig_Player_2_Fighter_P2 takes nothing returns nothing
set gg_trg_Player_2_Fighter_P2 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Player_2_Fighter_P2, gg_rct_P2 )
call TriggerAddCondition( gg_trg_Player_2_Fighter_P2, Condition( function Trig_New_Pathing_P2_Conditions ) )
call TriggerAddAction( gg_trg_Player_2_Fighter_P2, function Trig_New_Pathing_P2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_New_Pathing_P3_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(8) ) ) then //plater 9 = left
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Fighter_Group_Player[3]) == false ) ) then // custom value = 1
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Fighter_Group_Player[4]) == false ) ) then // custom value = 1
return false
endif
return true
endfunction
function Trig_New_Pathing_P3_Actions takes nothing returns nothing
//call UnitAddAbility(GetTriggerUnit(), 'A017') // add pathing dummy ability
//call SetUnitAbilityLevel(GetTriggerUnit(), 'A017', 3) // player 1 = 1
//call IssuePointOrderLoc( GetTriggerUnit(), "attack", udg_Spawn3 )
call GroupAddUnit(udg_Fighter_Group_Player[GetUnitUserData(GetTriggerUnit())], GetTriggerUnit())
call GroupAddUnit(udg_Fighter_Group, GetTriggerUnit())
endfunction
//===========================================================================
function InitTrig_Player_3_Fighter_P3 takes nothing returns nothing
set gg_trg_Player_3_Fighter_P3 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Player_3_Fighter_P3, gg_rct_P3 )
call TriggerAddCondition( gg_trg_Player_3_Fighter_P3, Condition( function Trig_New_Pathing_P3_Conditions ) )
call TriggerAddAction( gg_trg_Player_3_Fighter_P3, function Trig_New_Pathing_P3_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_New_Pathing_P4_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(8) ) ) then //player 9 = fighter
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Fighter_Group_Player[3]) == false ) ) then // custom value = 1
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Fighter_Group_Player[4]) == false ) ) then // custom value = 1
return false
endif
return true
endfunction
function Trig_New_Pathing_P4_Actions takes nothing returns nothing
//call UnitAddAbility(GetTriggerUnit(), 'A017') // add pathing dummy ability
//call SetUnitAbilityLevel(GetTriggerUnit(), 'A017', 4) // player 1 = 1
//call IssuePointOrderLoc( GetTriggerUnit(), "attack", udg_Spawn4 )
call GroupAddUnit(udg_Fighter_Group_Player[GetUnitUserData(GetTriggerUnit())], GetTriggerUnit())
call GroupAddUnit(udg_Fighter_Group, GetTriggerUnit())
endfunction
//===========================================================================
function InitTrig_Player_4_Fighter_P4 takes nothing returns nothing
set gg_trg_Player_4_Fighter_P4 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Player_4_Fighter_P4, gg_rct_P4 )
call TriggerAddCondition( gg_trg_Player_4_Fighter_P4, Condition( function Trig_New_Pathing_P4_Conditions ) )
call TriggerAddAction( gg_trg_Player_4_Fighter_P4, function Trig_New_Pathing_P4_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_New_Pathing_P5_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(9) ) ) then //east player
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Fighter_Group_Player[5]) == false ) ) then // custom value = 1
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Fighter_Group_Player[6]) == false ) ) then // custom value = 1
return false
endif
return true
endfunction
function Trig_New_Pathing_P5_Actions takes nothing returns nothing
//call UnitAddAbility(GetTriggerUnit(), 'A017') // add pathing dummy ability
//call SetUnitAbilityLevel(GetTriggerUnit(), 'A017', 5) // player 1 = 1
//call IssuePointOrderLoc( GetTriggerUnit(), "attack", udg_Spawn5 )
call GroupAddUnit(udg_Fighter_Group_Player[GetUnitUserData(GetTriggerUnit())], GetTriggerUnit())
call GroupAddUnit(udg_Fighter_Group, GetTriggerUnit())
endfunction
//===========================================================================
function InitTrig_Player_5_Fighter_P5 takes nothing returns nothing
set gg_trg_Player_5_Fighter_P5 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Player_5_Fighter_P5, gg_rct_P5 )
call TriggerAddCondition( gg_trg_Player_5_Fighter_P5, Condition( function Trig_New_Pathing_P5_Conditions ) )
call TriggerAddAction( gg_trg_Player_5_Fighter_P5, function Trig_New_Pathing_P5_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_New_Pathing_P6_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(9) ) ) then //east player
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Fighter_Group_Player[5]) == false ) ) then // custom value = 1
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Fighter_Group_Player[6]) == false ) ) then // custom value = 1
return false
endif
return true
endfunction
function Trig_New_Pathing_P6_Actions takes nothing returns nothing
//call UnitAddAbility(GetTriggerUnit(), 'A017') // add pathing dummy ability
//call SetUnitAbilityLevel(GetTriggerUnit(), 'A017', 6) // player 1 = 1
//call IssuePointOrderLoc( GetTriggerUnit(), "attack", udg_Spawn6 )
call GroupAddUnit(udg_Fighter_Group_Player[GetUnitUserData(GetTriggerUnit())], GetTriggerUnit())
call GroupAddUnit(udg_Fighter_Group, GetTriggerUnit())
endfunction
//===========================================================================
function InitTrig_Player_6_Fighter_P6 takes nothing returns nothing
set gg_trg_Player_6_Fighter_P6 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Player_6_Fighter_P6, gg_rct_P6 )
call TriggerAddCondition( gg_trg_Player_6_Fighter_P6, Condition( function Trig_New_Pathing_P6_Conditions ) )
call TriggerAddAction( gg_trg_Player_6_Fighter_P6, function Trig_New_Pathing_P6_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_New_Pathing_P7_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(9) ) ) then //east player
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Fighter_Group_Player[7]) == false ) ) then // custom value = 1
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Fighter_Group_Player[8]) == false ) ) then // custom value = 1
return false
endif
return true
endfunction
function Trig_New_Pathing_P7_Actions takes nothing returns nothing
//call UnitAddAbility(GetTriggerUnit(), 'A017') // add pathing dummy ability
//call SetUnitAbilityLevel(GetTriggerUnit(), 'A017', 7) // player 1 = 1
//call IssuePointOrderLoc( GetTriggerUnit(), "attack", udg_Spawn7 )
call GroupAddUnit(udg_Fighter_Group_Player[GetUnitUserData(GetTriggerUnit())], GetTriggerUnit())
call GroupAddUnit(udg_Fighter_Group, GetTriggerUnit())
endfunction
//===========================================================================
function InitTrig_Player_7_Fighter_P7 takes nothing returns nothing
set gg_trg_Player_7_Fighter_P7 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Player_7_Fighter_P7, gg_rct_P7 )
call TriggerAddCondition( gg_trg_Player_7_Fighter_P7, Condition( function Trig_New_Pathing_P7_Conditions ) )
call TriggerAddAction( gg_trg_Player_7_Fighter_P7, function Trig_New_Pathing_P7_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_New_Pathing_P8_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(9) ) ) then //east player
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Fighter_Group_Player[7]) == false ) ) then // custom value = 1
return false
endif
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_Fighter_Group_Player[8]) == false ) ) then // custom value = 1
return false
endif
return true
endfunction
function Trig_New_Pathing_P8_Actions takes nothing returns nothing
//call UnitAddAbility(GetTriggerUnit(), 'A017') // add pathing dummy ability
//call SetUnitAbilityLevel(GetTriggerUnit(), 'A017', 8) // player 1 = 1
//call IssuePointOrderLoc( GetTriggerUnit(), "attack", udg_Spawn8 )
call GroupAddUnit(udg_Fighter_Group_Player[8], GetTriggerUnit())call GroupAddUnit(udg_Fighter_Group_Player[GetUnitUserData(GetTriggerUnit())], GetTriggerUnit())
call GroupAddUnit(udg_Fighter_Group, GetTriggerUnit())
if()
endfunction
//===========================================================================
function InitTrig_Player_8_Fighter_P8 takes nothing returns nothing
set gg_trg_Player_8_Fighter_P8 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Player_8_Fighter_P8, gg_rct_P8 )
call TriggerAddCondition( gg_trg_Player_8_Fighter_P8, Condition( function Trig_New_Pathing_P8_Conditions ) )
call TriggerAddAction( gg_trg_Player_8_Fighter_P8, function Trig_New_Pathing_P8_Actions )
endfunction
//TESH.scrollpos=18
//TESH.alwaysfold=0
function Trig_WarpGroup_Left_JASS_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(8) ) ) then
return false
endif
return true
endfunction
function Trig_WarpGroup_Left_JASS_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer i = GetUnitUserData(u)
call GroupAddUnit(udg_WarpGroup[i], u)
call GroupRemoveUnit(udg_Fighter_Group_Player[i], u)
if(udg_WarpReady == false) then
set udg_WarpReady = true
endif
set u = null
endfunction
//===========================================================================
function InitTrig_WarpGroup_Left_JASS takes nothing returns nothing
local trigger t = CreateTrigger()
local region r = CreateRegion()
call RegionAddRect(r,gg_rct_Warp_1)
call RegionAddRect(r,gg_rct_Warp_2)
call RegionAddRect(r,gg_rct_Warp_3)
call RegionAddRect(r,gg_rct_Warp_4)
call TriggerRegisterEnterRegion(t, r, null)
//set gg_trg_WarpGroup_Left_JASS = CreateTrigger( )
//call TriggerRegisterEnterRectSimple( gg_trg_WarpGroup_Left_JASS, gg_rct_Creep_1 )
//call TriggerRegisterEnterRectSimple( gg_trg_WarpGroup_Left_JASS, gg_rct_Creep_2 )
//call TriggerRegisterEnterRectSimple( gg_trg_WarpGroup_Left_JASS, gg_rct_Creep_3 )
//call TriggerRegisterEnterRectSimple( gg_trg_WarpGroup_Left_JASS, gg_rct_Creep_4 )
call TriggerAddCondition( t, Condition( function Trig_WarpGroup_Left_JASS_Conditions ) )
call TriggerAddAction( t, function Trig_WarpGroup_Left_JASS_Actions )
set t = null
set r = null
endfunction
//TESH.scrollpos=18
//TESH.alwaysfold=0
function Trig_WarpGroup_Right_JASS_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(9) ) ) then
return false
endif
return true
endfunction
function Trig_WarpGroup_Right_JASS_Func001C takes nothing returns boolean
if ( not ( GetUnitUserData(GetTriggerUnit()) == 0 ) ) then
return false
endif
return true
endfunction
function Trig_WarpGroup_Right_JASS_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer i = GetUnitUserData(u)
call GroupAddUnit(udg_WarpGroup[i], u)
call GroupRemoveUnit(udg_Fighter_Group_Player[i], u)
if(udg_WarpReady == false) then
set udg_WarpReady = true
endif
set u = null
endfunction
//===========================================================================
function InitTrig_WarpGroup_Right_JASS takes nothing returns nothing
local trigger t = CreateTrigger()
local region r = CreateRegion()
call RegionAddRect(r,gg_rct_Warp_5)
call RegionAddRect(r,gg_rct_Warp_6)
call RegionAddRect(r,gg_rct_Warp_7)
call RegionAddRect(r,gg_rct_Warp_8)
call TriggerRegisterEnterRegion(t, r, null)
//set gg_trg_WarpGroup_Right_JASS = CreateTrigger( )
//call TriggerRegisterEnterRectSimple( gg_trg_WarpGroup_Right_JASS, gg_rct_Creep_5 )
//call TriggerRegisterEnterRectSimple( gg_trg_WarpGroup_Right_JASS, gg_rct_Creep_6 )
//call TriggerRegisterEnterRectSimple( gg_trg_WarpGroup_Right_JASS, gg_rct_Creep_7 )
//call TriggerRegisterEnterRectSimple( gg_trg_WarpGroup_Right_JASS, gg_rct_Creep_8 )
call TriggerAddCondition( t, Condition( function Trig_WarpGroup_Right_JASS_Conditions ) )
call TriggerAddAction( t, function Trig_WarpGroup_Right_JASS_Actions )
set t = null
set r = null
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Warp_LEFT_PERIOD_Func003C takes nothing returns boolean
if ( ( CountUnitsInGroup(udg_WarpGroup[1]) > 0 ) ) then
return true
endif
if ( ( CountUnitsInGroup(udg_WarpGroup[2]) > 0 ) ) then
return true
endif
if ( ( CountUnitsInGroup(udg_WarpGroup[3]) > 0 ) ) then
return true
endif
if ( ( CountUnitsInGroup(udg_WarpGroup[4]) > 0 ) ) then
return true
endif
return false
endfunction
function Trig_Warp_LEFT_PERIOD_Conditions takes nothing returns boolean
if ( not ( udg_InRound == true ) ) then
return false
endif
if ( not ( udg_WarpReady == true ) ) then
return false
endif
if ( not Trig_Warp_LEFT_PERIOD_Func003C() ) then
return false
endif
return true
endfunction
function Trig_Warp_LEFT_PERIOD_Func001Func001Func001A takes nothing returns nothing
local unit u = GetEnumUnit()
local location p1 = null
local location p2 = null
if ( GetUnitState(u, UNIT_STATE_LIFE) > 0 ) then
set p1 = GetUnitLoc(u)
call SetUnitPositionLoc( u, udg_LKingSpawnPt )
call IssuePointOrderLoc( u, "hold", udg_LKingSpawnPt ) // left king
call SetUnitAbilityLevel(u, 'A017', 9) // pathing dummy
call SetUnitPathing( u, false )
set bj_lastCreatedEffect = AddSpecialEffectLoc("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl", p1)
call DestroyEffect(bj_lastCreatedEffect)
set p2 = GetUnitLoc(u)
set bj_lastCreatedEffect = AddSpecialEffectLoc("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl", p2)
call DestroyEffect(bj_lastCreatedEffect)
else
endif
call GroupRemoveUnit(udg_WarpGroup[bj_forLoopAIndex], u)
call GroupRemoveUnit(udg_Fighter_Group_Player[bj_forLoopAIndex], u)
call GroupAddUnit(udg_Fighter_King_LEFT, u) // defend left king
call RemoveLocation(p1)
call RemoveLocation(p2)
set u = null
endfunction
function Trig_Warp_LEFT_PERIOD_Actions takes nothing returns nothing
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 4
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( ( CountUnitsInGroup(udg_CreepSpawnPoint[bj_forLoopAIndex]) == 0 ) ) then
call ForGroupBJ( udg_WarpGroup[bj_forLoopAIndex], function Trig_Warp_LEFT_PERIOD_Func001Func001Func001A )
else
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction
//===========================================================================
function InitTrig_Warp_LEFT_PERIOD takes nothing returns nothing
set gg_trg_Warp_LEFT_PERIOD = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Warp_LEFT_PERIOD, 1.00 )
call TriggerAddCondition( gg_trg_Warp_LEFT_PERIOD, Condition( function Trig_Warp_LEFT_PERIOD_Conditions ) )
call TriggerAddAction( gg_trg_Warp_LEFT_PERIOD, function Trig_Warp_LEFT_PERIOD_Actions )
endfunction
//TESH.scrollpos=1
//TESH.alwaysfold=0
function Trig_Warp_RIGHT_PERIOD_Func003C takes nothing returns boolean
if ( ( CountUnitsInGroup(udg_WarpGroup[5]) > 0 ) ) then
return true
endif
if ( ( CountUnitsInGroup(udg_WarpGroup[6]) > 0 ) ) then
return true
endif
if ( ( CountUnitsInGroup(udg_WarpGroup[7]) > 0 ) ) then
return true
endif
if ( ( CountUnitsInGroup(udg_WarpGroup[8]) > 0 ) ) then
return true
endif
return false
endfunction
function Trig_Warp_RIGHT_PERIOD_Conditions takes nothing returns boolean
if ( not ( udg_InRound == true ) ) then
return false
endif
if ( not ( udg_WarpReady == true ) ) then
return false
endif
if ( not Trig_Warp_LEFT_PERIOD_Func003C() ) then
return false
endif
return true
endfunction
function Trig_Warp_RIGHT_PERIOD_Func001Func001Func001A takes nothing returns nothing
local unit u = GetEnumUnit()
local location p1 = null
local location p2 = null
if ( GetUnitState(u, UNIT_STATE_LIFE) > 0 ) then
set p1 = GetUnitLoc(u)
call SetUnitPositionLoc( u, udg_LKingSpawnPt )
call IssuePointOrderLoc( u, "hold", udg_RKingSpawnPt ) // right king
call SetUnitAbilityLevel(u, 'A017', 10) // pathing dummy
call SetUnitPathing( u, false )
set bj_lastCreatedEffect = AddSpecialEffectLoc("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl", p1)
call DestroyEffect(bj_lastCreatedEffect)
set p2 = GetUnitLoc(u)
set bj_lastCreatedEffect = AddSpecialEffectLoc("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl", p2)
call DestroyEffect(bj_lastCreatedEffect)
else
endif
call GroupRemoveUnit(udg_WarpGroup[bj_forLoopAIndex], u)
call GroupRemoveUnit(udg_Fighter_Group_Player[bj_forLoopAIndex], u)
call GroupAddUnit(udg_Fighter_King_RIGHT, u) // right king defend
call RemoveLocation(p1)
call RemoveLocation(p2)
set u = null
endfunction
function Trig_Warp_RIGHT_PERIOD_Actions takes nothing returns nothing
set bj_forLoopAIndex = 5
set bj_forLoopAIndexEnd = 8
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( ( CountUnitsInGroup(udg_CreepSpawnPoint[bj_forLoopAIndex]) == 0 ) ) then
call ForGroupBJ( udg_WarpGroup[bj_forLoopAIndex], function Trig_Warp_RIGHT_PERIOD_Func001Func001Func001A )
else
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction
//===========================================================================
function InitTrig_Warp_RIGHT_PERIOD takes nothing returns nothing
set gg_trg_Warp_RIGHT_PERIOD = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Warp_RIGHT_PERIOD, 1.00 )
call TriggerAddCondition( gg_trg_Warp_RIGHT_PERIOD, Condition( function Trig_Warp_RIGHT_PERIOD_Conditions ) )
call TriggerAddAction( gg_trg_Warp_RIGHT_PERIOD, function Trig_Warp_RIGHT_PERIOD_Actions )
endfunction
//TESH.scrollpos=45
//TESH.alwaysfold=0
function Trig_Kick_Start_Func004C takes nothing returns boolean
if ( ( GetClickedButton() == udg_DialogPlayer[1] ) ) then
return true
endif
if ( ( GetClickedButton() == udg_DialogPlayer[2] ) ) then
return true
endif
if ( ( GetClickedButton() == udg_DialogPlayer[3] ) ) then
return true
endif
if ( ( GetClickedButton() == udg_DialogPlayer[4] ) ) then
return true
endif
if ( ( GetClickedButton() == udg_DialogPlayer[5] ) ) then
return true
endif
if ( ( GetClickedButton() == udg_DialogPlayer[6] ) ) then
return true
endif
if ( ( GetClickedButton() == udg_DialogPlayer[7] ) ) then
return true
endif
if ( ( GetClickedButton() == udg_DialogPlayer[8] ) ) then
return true
endif
return false
endfunction
function Trig_Kick_Start_Conditions takes nothing returns boolean
if ( not ( udg_Vote_Start == true ) ) then
return false
endif
if ( not Trig_Kick_Start_Func004C() ) then
return false
endif
return true
endfunction
function Trig_Kick_Start_Func005Func003C takes nothing returns boolean
if ( not ( GetClickedButton() == udg_DialogPlayer[udg_Temp_Integer] ) ) then
return false
endif
return true
endfunction
function Trig_Kick_Start_Func005A takes nothing returns nothing
call DialogDisplayBJ( false, udg_DialogKick, GetEnumPlayer() )
set udg_Temp_Integer = GetConvertedPlayerId(GetEnumPlayer())
if ( Trig_Kick_Start_Func005Func003C() ) then
set udg_DialogKickPlayer = udg_Temp_Integer
else
endif
endfunction
function Trig_Kick_Start_Func015A takes nothing returns nothing
call DialogDisplayBJ( true, udg_DialogVote, GetEnumPlayer() )
endfunction
function Trig_Kick_Start_Actions takes nothing returns nothing
call DisplayTimedTextToForce( GetPlayersAll(), 10, ( udg_PlayerColor[GetConvertedPlayerId(GetTriggerPlayer())] + ( GetPlayerName(GetTriggerPlayer()) + "|r start a vote kick ! (vote will expired in 20 seconds)" ) ) )
// Who is kick player ?
call ForForce( udg_IngamePlayers_PlayerGroup, function Trig_Kick_Start_Func005A )
// Start Vote
call DialogClearBJ( udg_DialogVote )
call DialogSetMessageBJ( udg_DialogVote, ( "Kick " + ( udg_PlayerColor[udg_DialogKickPlayer] + ( GetPlayerName(ConvertedPlayer(udg_DialogKickPlayer)) + "|r ?" ) ) ) )
call DialogAddButtonBJ( udg_DialogVote, ( udg_PlayerColor_String[1] + ( "Yes" + "|r" ) ) )
set udg_DialogYes = GetLastCreatedButtonBJ()
call DialogAddButtonBJ( udg_DialogVote, ( udg_PlayerColor_String[2] + ( "No" + "|r" ) ) )
set udg_DialogNo = GetLastCreatedButtonBJ()
call DialogAddButtonBJ( udg_DialogVote, "TRIGSTR_8821" )
set udg_DialogNull = GetLastCreatedButtonBJ()
call ForForce( udg_IngamePlayers_PlayerGroup, function Trig_Kick_Start_Func015A )
set udg_VoteCountYes = 0
set udg_VoteCountNo = 0
set udg_VoteCountNull = 0
set udg_Vote_Starter = GetConvertedPlayerId(GetTriggerPlayer())
// Start Vote
call PauseTimerBJ( true, udg_Vote_Timer_lock )
call StartTimerBJ( udg_Vote_Timer, false, 20.00 )
call MultiboardDisplayBJ( true, udg_Scoreboard )
endfunction
//===========================================================================
function InitTrig_Votekick_Start takes nothing returns nothing
set gg_trg_Votekick_Start = CreateTrigger( )
call TriggerRegisterDialogEventBJ( gg_trg_Votekick_Start, udg_DialogKick )
call TriggerAddCondition( gg_trg_Votekick_Start, Condition( function Trig_Kick_Start_Conditions ) )
call TriggerAddAction( gg_trg_Votekick_Start, function Trig_Kick_Start_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
Primary
|cffFFcc00-ap|r: all pick (easy -5%)
|cffFFcc00-sd|r: single draft (normal 0%)
|cffFFcc00-ar|r: all random (hard 5%)
|cffFFcc00-rd|r: random draft
|cffFFcc00-fr|r: fixed random
Secondary
|CFFFF0000-mm|r: mastermind
|CFFFF0000-hg|r: hourglass
|CFFFF0000-cb|r: change builder
|CFFFF0000-x3|r: 3 time creep spawn
|CFFFF0000-ni|r: no income
|CFFFF0000-nm|r: no middle
|CFFFF0000-sm|r: short mode (less lumber)
|CFFFF0000-
function Trig_Mode_X3_Copy_Conditions takes nothing returns boolean
if ( not ( udg_ModeX3 == false ) ) then
return false
endif
return true
endfunction
function Trig_Mode_X3_Copy_Func006Func001C takes nothing returns boolean
if ( not ( udg_ModeAP == true ) ) then
return false
endif
return true
endfunction
function Trig_Mode_X3_Copy_Func006Func002C takes nothing returns boolean
if ( not ( udg_ModeSD == true ) ) then
return false
endif
return true
endfunction
function Trig_Mode_X3_Copy_Func006Func003C takes nothing returns boolean
if ( not ( udg_ModeAR == true ) ) then
return false
endif
return true
endfunction
function Trig_Mode_X3_Copy_Func006A takes nothing returns nothing
if ( Trig_Mode_X3_Copy_Func006Func001C() ) then
call AdjustPlayerStateBJ( 200, GetEnumPlayer(), PLAYER_STATE_RESOURCE_GOLD )
else
endif
if ( Trig_Mode_X3_Copy_Func006Func002C() ) then
call AdjustPlayerStateBJ( 190, GetEnumPlayer(), PLAYER_STATE_RESOURCE_GOLD )
else
endif
if ( Trig_Mode_X3_Copy_Func006Func003C() ) then
call AdjustPlayerStateBJ( 180, GetEnumPlayer(), PLAYER_STATE_RESOURCE_GOLD )
else
endif
call AdjustPlayerStateBJ( 50, GetEnumPlayer(), PLAYER_STATE_RESOURCE_LUMBER )
call SetPlayerStateBJ( GetEnumPlayer(), PLAYER_STATE_FOOD_CAP_CEILING, 200 )
endfunction
function Trig_Mode_X3_Copy_Actions takes nothing returns nothing
//
set udg_ModeX3 = true
//
set udg_LevelWaveCountList = ",36,45,36,36,36,36,30,36,45,03,54,45,45,24,36,45,36,45,36,03,36,48,36,36,45,36,36,18,30,03"
call ForForce( udg_IngamePlayers_PlayerGroup, function Trig_Mode_X3_Copy_Func006A )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = udg_MaxLevel_Integer
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_Level_TimeToPrepare[GetForLoopIndexA()] = ( 30 + GetForLoopIndexA() )
set udg_Temp_Integer = GetForLoopIndexA()
set udg_Level_EndRoundGold[GetForLoopIndexA()] = ((((GetForLoopIndexA()*GetForLoopIndexA())*0.2) + (GetForLoopIndexA()*2)) +10)
// 1.41b and earlier
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call DisplayTimedTextToForce( GetPlayersAll(), 10.00, "TRIGSTR_6373" )
call DisableTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Mode_X3_Copy takes nothing returns nothing
set gg_trg_Mode_X3_Copy = CreateTrigger( )
call TriggerAddCondition( gg_trg_Mode_X3_Copy, Condition( function Trig_Mode_X3_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Mode_X3_Copy, function Trig_Mode_X3_Copy_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Select_a_Mode_HCL_Event_Actions takes nothing returns nothing
if (udg_command == "") then
return
elseif (udg_command == "0" or udg_command == "-0") then
set udg_HCL_Mode = true
set udg_W3MMD_Enable = true
else
//if if (udg_command != "" and udg_command !="0") then
set udg_HCL_Mode = true
set udg_W3MMD_Enable = true
set udg_Temp_String = udg_command
if ( SubStringBJ(udg_Temp_String, 1, 1) != "-" ) then
set udg_Temp_String = ( "-" + udg_Temp_String ) //place a dash if it isn't there already
endif //if there is already a dash, don't add one
call DisplayTimedTextToForce( GetPlayersAll(), 10.00, ( "HostBot has entered the game-mode: |cffFFcc00" + ( udg_Temp_String + "|r" ) ) )
call DisableTrigger( gg_trg_Select_a_Mode_Event )
if ( StringLength(udg_Temp_String) == 3 ) then
call TriggerExecute( gg_trg_Select_a_Quick_x3_Mode_Run )
else
call TriggerExecute( gg_trg_Select_a_Mode_Run )
endif
call ResumeTimer( udg_GameTimer )
call StartTimerBJ( udg_GameTimer, false, 1.00 )
endif
endfunction
//===========================================================================
function InitTrig_Select_a_Mode_HCL_Event takes nothing returns nothing
set gg_trg_Select_a_Mode_HCL_Event = CreateTrigger( )
call TriggerAddAction( gg_trg_Select_a_Mode_HCL_Event, function Trig_Select_a_Mode_HCL_Event_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Select_a_Mode_HCL_Event_Actions takes nothing returns nothing
if (HCL_GetCommandString() != "") then
set udg_Temp_String = HCL_GetCommandString()
if ( SubStringBJ(udg_Temp_String, 1, 1) != "-" ) then
set udg_Temp_String = ( "-" + udg_Temp_String ) //place a dash if it isn't there already
endif //if there is already a dash, don't add one
call DisplayTimedTextToForce( GetPlayersAll(), 10.00, ( "Bot has entered the game-mode: |cffFFcc00" + ( udg_Temp_String + "|r" ) ) )
call TriggerExecute( gg_trg_Select_a_Mode_Run )
endif
endfunction
//===========================================================================
function InitTrig_Select_a_Mode_HCL_Event_OLD takes nothing returns nothing
set gg_trg_Select_a_Mode_HCL_Event_OLD = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Select_a_Mode_HCL_Event_OLD, 0.50 )
call TriggerAddAction( gg_trg_Select_a_Mode_HCL_Event_OLD, function Trig_Select_a_Mode_HCL_Event_Actions )
endfunction
function Trig_Remove_debug_trigger_Actions takes nothing returns nothing
call DestroyTrigger( gg_trg_enable_debug )
call DestroyTrigger( gg_trg_enable_debug_SP )
call DestroyTrigger( gg_trg_Skip )
call DestroyTrigger( gg_trg_Detect_Single_Player_and_Single_Team )
call DestroyTrigger( gg_trg_set_level )
call DestroyTrigger( gg_trg_toggle_noincome )
call DestroyTrigger( gg_trg_set_income )
call DestroyTrigger( gg_trg_spawnall )
call DestroyTrigger( gg_trg_start_level )
call DestroyTrigger( gg_trg_cine_test )
call DestroyTrigger( gg_trg_king_abil )
call DestroyTrigger( gg_trg_clear_level )
call DestroyTrigger( gg_trg_cleare )
call DestroyTrigger( gg_trg_clearw )
call DestroyTrigger( gg_trg_repick )
call DestroyTrigger( gg_trg_gold )
call DestroyTrigger( gg_trg_wood )
call DestroyTrigger( gg_trg_food )
call DestroyTrigger( gg_trg_buildall )
call DestroyTrigger( gg_trg_heal )
call DestroyTrigger( gg_trg_restart )
call DestroyTrigger( gg_trg_pause )
call DestroyTrigger( gg_trg_resume )
call DestroyTrigger( gg_trg_ik )
call DestroyTrigger( gg_trg_spawn_specific )
call DestroyTrigger( gg_trg_foodmax )
endfunction
//===========================================================================
function InitTrig_Remove_debug_trigger takes nothing returns nothing
set gg_trg_Remove_debug_trigger = CreateTrigger( )
call TriggerAddAction( gg_trg_Remove_debug_trigger, function Trig_Remove_debug_trigger_Actions )
endfunction
function Trig_Sell_Worker_Copy_Copy_Func001001 takes nothing returns boolean
return ( udg_ModeX3 == true )
endfunction
function Trig_Sell_Worker_Copy_Copy_Actions takes nothing returns nothing
if ( Trig_Sell_Worker_Copy_Copy_Func001001() ) then
call DoNothing( )
else
call DoNothing( )
endif
endfunction
//===========================================================================
function InitTrig_Sell_Worker_Copy_Copy takes nothing returns nothing
set gg_trg_Sell_Worker_Copy_Copy = CreateTrigger( )
call DisableTrigger( gg_trg_Sell_Worker_Copy_Copy )
call TriggerAddAction( gg_trg_Sell_Worker_Copy_Copy, function Trig_Sell_Worker_Copy_Copy_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function dead takes nothing returns nothing
local unit u = GetDyingUnit()
//call TriggerSleepAction(8)
call PolledWait( 8 )
call RemoveUnit(u)
set u = null
endfunction
//===========================================================================
function InitTrig_Clean_Dead takes nothing returns nothing
set gg_trg_Clean_Dead = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Clean_Dead, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_Clean_Dead, function dead )
endfunction
//TESH.scrollpos=11
//TESH.alwaysfold=0
function Trig_Allied_Resources_Function takes nothing returns nothing
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
set udg_Temp_Point = GetUnitLoc(GetEnumUnit())
set udg_Temp_Player = GetOwningPlayer(GetEnumUnit())
set udg_Temp_String = ( ( ( "|cffFFcc00" + I2S(GetPlayerState(udg_Temp_Player, PLAYER_STATE_RESOURCE_GOLD)) ) + "|r gold|n" ) + ( ( ( "|cff339933" + I2S(GetPlayerState(udg_Temp_Player, PLAYER_STATE_RESOURCE_LUMBER)) ) + "|r lumber |n" ) + ( ( "|cff993333" + I2S(GetPlayerState(udg_Temp_Player, PLAYER_STATE_RESOURCE_FOOD_USED)) ) + ( "/ |cff993333" + ( I2S(GetPlayerState(udg_Temp_Player, PLAYER_STATE_RESOURCE_FOOD_CAP)) + "|r Food" ) ) ) ) )
set udg_ResTextArr[udg_Temp_Integer] = showLocTextAllies(udg_Temp_Point, udg_Temp_String, 255, 255, 255, udg_Temp_Player)
call RemoveLocation(udg_Temp_Point)
endfunction
function Trig_Allied_Resources_Actions takes nothing returns nothing
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 8
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call DestroyTextTag( udg_ResTextArr[bj_forLoopAIndex] )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
if ( udg_GameEnded_Boolean == false ) then
set udg_Temp_Integer = 0
set udg_Temp_UG = GetUnitsOfTypeIdAll('h023') // tower
call ForGroup( udg_Temp_UG, function Trig_Allied_Resources_Function )
call DestroyGroup(udg_Temp_UG)
else
call DisableTrigger( GetTriggeringTrigger() )
endif
endfunction
//===========================================================================
function InitTrig_Allied_Resources takes nothing returns nothing
set gg_trg_Allied_Resources = CreateTrigger( )
call DisableTrigger( gg_trg_Allied_Resources )
call TriggerRegisterTimerEvent(gg_trg_Allied_Resources, 0.50, true)
call TriggerAddAction( gg_trg_Allied_Resources, function Trig_Allied_Resources_Actions )
endfunction
//TESH.scrollpos=46
//TESH.alwaysfold=0
scope AntiCP initializer Init
//****************************************************************************************
//
// | Anti-CheatPack System v1.00 by saw792 |
//
// Using this system will report any modification to the map script. Combined with map
// optimisation it will effectively stop people from using a modified version of your
// map, as it disables all GUI trigger functionality and all JASS triggers (with the
// exception of libraries, for technical reasons) on detection of modification.
//
// It is recommended that all functioning vJASS code is writeen within scopes (with the
// exception of systems) in order for them to be disabled on modification detection.
//
//
// Implementation Instructions:
//
// 1. Create a blank disabled trigger named AntiCPConfig, convert to custom text
// 2. Copy/Paste the AntiCPConfig library into the blank trigger
// 3. Click the name of your map in the left-hand panel in the trigger editor
// 4. Copy/Paste the AntiCP scope into the Custom Text section
// NB: The scope MUST be at the VERY top of the custom text section, and
// NOT in a blank trigger
// 5. Follow the instructions in the AntiCPConfig library
// 6. Set the HANDLE_COUNT variable below to the output of the library
// 7. Configure other constants below
// 8. Set ENABLED = true
// 9. Save your map and enjoy
//
// NB: Every time you save a final version run the AntiCPConfig library again
// as the handle count has probably changed
// NB: When modifying your map set ENABLED = false, and set it to true again
// when a final version is saved
//
//****************************************************************************************
globals
// get message from editor, then add 1
private constant integer HANDLE_COUNT = 996
//System enabled or disabled
private constant boolean ENABLED = true
//Disable triggers initializers on detection?
private constant boolean TRIGGER_DISABLE = false
//Show a message to players if modification is detected?
private constant boolean SHOW_TEXT = true
//Text to display when SHOW_TEXT = true
//If SHOW_TEXT = false it is recommended that this string be emptied (i.e. = "")
//private constant string DISP_TEXT = "This map has been modified. Please delete it and redownload from a trusted source."
private constant string DISP_TEXT = "T"+"h"+"i"+"s"+" "+"m"+"a"+"p"+" "+"h"+"a"+"s"+" "+"b"+"e"+"e"+"n"+" "+"m"+"o"+"d"+"e"+"f"+"i"+"e"+"d"+"."
endglobals
private function T2I takes trigger t returns integer
return GetHandleId( t )
endfunction
private function Init takes nothing returns nothing
local integer i
local trigger t = CreateTrigger()
if (T2I(t) - 1048584) != HANDLE_COUNT and ENABLED then
if SHOW_TEXT then
//call DisplayTextToForce(bj_FORCE_ALL_PLAYERS, DISP_TEXT)
//call DisplayTextToForce(bj_FORCE_ALL_PLAYERS, "Current Handle count :"+I2S(T2I(t) - 1048584))
//call DisplayTextToForce(bj_FORCE_ALL_PLAYERS, "Handle count should be : 996")
//call DisplayTextToForce(bj_FORCE_ALL_PLAYERS, "This is illigal version !!")
set udg_Vote_EnablePlayer[10] = true
//if bj_isSinglePlayer == false then
//call EndGame(false)
//endif
endif
if TRIGGER_DISABLE then
set i = i
endif
endif
call DestroyTrigger(t)
set t = null
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Burning_Legion_Actions takes nothing returns nothing
local string s = ""
set s = "|cffFF0000H"+"ua"+"nA"+"k:|r |c00fe890d"
set s = s + "T"+"his"+" Ma"+"p h"+"as b"+"een m"+"odif"+"ied w"+"ith wr"+"ong d"+"ata,"
set s = s + " ga"+"me wi"+"ll s"+"hutt"+"ing d"+"own !"+"|r "
// This Map has been modified with wrong data, game will shutting down !
call DisplayTimedTextToForce( bj_FORCE_ALL_PLAYERS, 30.00, s)
call TriggerExecute( gg_trg_GAME_OVER_Count_down )
endfunction
//===========================================================================
function InitTrig_Burning_Legion takes nothing returns nothing
set gg_trg_Burning_Legion = CreateTrigger( )
call TriggerAddAction( gg_trg_Burning_Legion, function Trig_Burning_Legion_Actions )
endfunction
function Trig_Burning_Legion_Copy_Actions takes nothing returns nothing
call TriggerExecute( gg_trg_GAME_OVER_Count_down )
call SetUnitVertexColorBJ( udg_Temp_Unit, 100.00, 100.00, 100.00, 35.00 )
endfunction
//===========================================================================
function InitTrig_Burning_Legion_Copy takes nothing returns nothing
set gg_trg_Burning_Legion_Copy = CreateTrigger( )
call DisableTrigger( gg_trg_Burning_Legion_Copy )
call TriggerAddAction( gg_trg_Burning_Legion_Copy, function Trig_Burning_Legion_Copy_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_Lag_Monitor_Period_Copy_Func003Func001Func001001001 takes nothing returns boolean
return ( GetFilterPlayer() == GetEnumPlayer() )
endfunction
function Trig_Lag_Monitor_Period_Copy_Func003A takes nothing returns nothing
if ( udg_Beta_Lag[GetConvertedPlayerId(GetEnumPlayer())] == true ) then
call DisplayTimedTextToForce( GetPlayersMatching(Condition(function Trig_Lag_Monitor_Period_Copy_Func003Func001Func001001001)), 7.00, I2S(bj_queuedExecTotal) )
endif
endfunction
function Trig_Lag_Monitor_Period_Copy_Actions takes nothing returns nothing
call ForForce( udg_IngamePlayers_PlayerGroup, function Trig_Lag_Monitor_Period_Copy_Func003A )
endfunction
//===========================================================================
function InitTrig_Lag_Monitor_Period_Copy takes nothing returns nothing
set gg_trg_Lag_Monitor_Period_Copy = CreateTrigger( )
call DisableTrigger( gg_trg_Lag_Monitor_Period_Copy )
call TriggerRegisterTimerEventPeriodic( gg_trg_Lag_Monitor_Period_Copy, 1.00 )
call TriggerAddAction( gg_trg_Lag_Monitor_Period_Copy, function Trig_Lag_Monitor_Period_Copy_Actions )
endfunction
//TESH.scrollpos=1
//TESH.alwaysfold=0
function Trig_wood_Copy_Actions takes nothing returns nothing
set udg_Temp_Integer = S2I(SubStringBJ(GetEventPlayerChatString(), 5, StringLength(GetEventPlayerChatString())))
//call SetPlayerStateBJ( GetTriggerPlayer(), PLAYER_STATE_RESOURCE_LUMBER, udg_Temp_Integer )
//call SetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_LUMBER) + udg_Temp_Integer)
//call DisplayTimedTextToForce( GetPlayersAll(), 12.00, ( ( "[|cffFF0000Debug|r] " + udg_PlayerColor_String[GetConvertedPlayerId(GetTriggerPlayer())] ) + ( GetPlayerName(GetTriggerPlayer()) + ( "|r *CURRENT* lumber set to " + I2S(udg_Temp_Integer) ) ) ) )
call SetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD) + udg_Temp_Integer)
call DisplayTimedTextToForce( GetPlayersAll(), 12.00, ( ( "[|cffFF0000Debug|r] " + udg_PlayerColor_String[GetConvertedPlayerId(GetTriggerPlayer())] ) + ( GetPlayerName(GetTriggerPlayer()) + ( "|r *CURRENT* gold set to " + I2S(udg_Temp_Integer) ) ) ) )
endfunction
//===========================================================================
function InitTrig_Beta_Debug_Wood_Copy takes nothing returns nothing
set gg_trg_Beta_Debug_Wood_Copy = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Beta_Debug_Wood_Copy, Player(0), "-tc", false )
call TriggerAddAction( gg_trg_Beta_Debug_Wood_Copy, function Trig_wood_Copy_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
=== Debug Command ===
[|cffFF0000Debug|r] Debug mode enabled.
Available Commands: -debug, -gold X, -lumber X, -food, -foodmax, -toggleincome, -income X, -spawnall, -spawn X, -buildall, -start, -level X, -clear, -cleare, -clearw, -repick, -abil, -heal, -heale, -healw, -restart, -pause (or -p), -resume (or -r), -ike, -ikw
Example: -gold 5000
Descriptions of commands avaiable in Quests (F9)
=== Debug Quest ===
-debug = enables -debug mode
-gold X = set your gold to X
-lumber X = set your gold to X
-food = set food to 100 (max in a normal game)
-foodmax = set food to 200
-toggleincome = toggles income on/off
-income X = set your income to X
-spawnall = toggle all spawns on/off
-spawn X = toggle spawn for lane X
-buildall = toggle building in other players' areas
-start = force a level to start
-level X = changes level to X where X is an integer
-clear = explodes all current enemies
-cleare = explodes all east enemies
-clearw = explodes all west enemies
-repick = repicks your builder
-abil = gives your King a random ability
-heal = heals both Kings
-heale = heal East King only
-healw = heal West King only
-restart = restarts the game (mostly). Red only.
-ike = make East King invulnerable
-ikw = make West King invulnerable
-pause or -p = pause Spawn Timer
-resume or -r = resume Spawn Timer
//TESH.scrollpos=138
//TESH.alwaysfold=0
function Trig_restart_Func001001002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_GIANT) == true )
endfunction
function Trig_restart_Func001A takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_restart_Func002001002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_ANCIENT) == true )
endfunction
function Trig_restart_Func002A takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_restart_Func003001002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_SUMMONED) == true )
endfunction
function Trig_restart_Func003A takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_restart_Func004A takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_restart_Func005A takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_restart_Func006A takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_restart_Func007A takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_restart_Func008A takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_restart_Func012A takes nothing returns nothing
call SelectUnitForPlayerSingle( udg_Builder_Unit[GetConvertedPlayerId(GetEnumPlayer())], GetEnumPlayer() )
call ForceUICancelBJ( GetEnumPlayer() )
endfunction
function Trig_restart_Func013A takes nothing returns nothing
call RemoveUnit( udg_Builder_Unit[GetConvertedPlayerId(GetEnumPlayer())] )
endfunction
function Trig_restart_Func014C takes nothing returns boolean
if ( not ( IsPlayerInForce(Player(0), udg_IngamePlayers_PlayerGroup) == true ) ) then
return false
endif
return true
endfunction
function Trig_restart_Func015C takes nothing returns boolean
if ( not ( IsPlayerInForce(Player(1), udg_IngamePlayers_PlayerGroup) == true ) ) then
return false
endif
return true
endfunction
function Trig_restart_Func016C takes nothing returns boolean
if ( not ( IsPlayerInForce(Player(2), udg_IngamePlayers_PlayerGroup) == true ) ) then
return false
endif
return true
endfunction
function Trig_restart_Func017C takes nothing returns boolean
if ( not ( IsPlayerInForce(Player(3), udg_IngamePlayers_PlayerGroup) == true ) ) then
return false
endif
return true
endfunction
function Trig_restart_Func018C takes nothing returns boolean
if ( not ( IsPlayerInForce(Player(4), udg_IngamePlayers_PlayerGroup) == true ) ) then
return false
endif
return true
endfunction
function Trig_restart_Func019C takes nothing returns boolean
if ( not ( IsPlayerInForce(Player(5), udg_IngamePlayers_PlayerGroup) == true ) ) then
return false
endif
return true
endfunction
function Trig_restart_Func020C takes nothing returns boolean
if ( not ( IsPlayerInForce(Player(6), udg_IngamePlayers_PlayerGroup) == true ) ) then
return false
endif
return true
endfunction
function Trig_restart_Func021C takes nothing returns boolean
if ( not ( IsPlayerInForce(Player(7), udg_IngamePlayers_PlayerGroup) == true ) ) then
return false
endif
return true
endfunction
function Trig_restart_Func024A takes nothing returns nothing
set udg_PlayerIncome[GetConvertedPlayerId(GetEnumPlayer())] = 0
call CreateNUnitsAtLoc( 1, 'e000', GetEnumPlayer(), GetPlayerStartLocationLoc(GetEnumPlayer()), bj_UNIT_FACING )
call SelectUnitForPlayerSingle( GetLastCreatedUnit(), GetEnumPlayer() )
// retore race picker
// set udg_Builder_Unit[GetConvertedPlayerId(GetEnumPlayer())] = GetLastCreatedUnit()
if( udg_ModeAR == true ) then
call EnableTrigger( gg_trg_Mode_AR )
call TriggerExecute( gg_trg_Mode_AR )
else
if( udg_ModeSD == true ) then
call EnableTrigger( gg_trg_Mode_SD )
call TriggerExecute( gg_trg_Mode_SD )
else
call EnableTrigger( gg_trg_Mode_AP )
call TriggerExecute( gg_trg_Mode_AP )
endif
endif
if( udg_ModeX3 == true ) then
call SetPlayerStateBJ( GetEnumPlayer(), PLAYER_STATE_RESOURCE_GOLD, 270 )
call SetPlayerStateBJ( GetEnumPlayer(), PLAYER_STATE_RESOURCE_LUMBER, 90 )
else
call SetPlayerStateBJ( GetEnumPlayer(), PLAYER_STATE_RESOURCE_GOLD, 100 )
call SetPlayerStateBJ( GetEnumPlayer(), PLAYER_STATE_RESOURCE_LUMBER, 30 )
endif
call PanCameraToTimedLocForPlayer( GetEnumPlayer(), GetPlayerStartLocationLoc(GetEnumPlayer()), 0 )
endfunction
function Trig_restart_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_restart_Func001001002)), function Trig_restart_Func001A )
call ForGroupBJ( GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_restart_Func002001002)), function Trig_restart_Func002A )
call ForGroupBJ( GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_restart_Func003001002)), function Trig_restart_Func003A )
call ForGroupBJ( GetUnitsOfPlayerAll(Player(10)), function Trig_restart_Func004A )
call ForGroupBJ( GetUnitsOfPlayerAll(Player(11)), function Trig_restart_Func005A )
call ForGroupBJ( GetUnitsOfTypeIdAll('ewsp'), function Trig_restart_Func006A )
call ForGroupBJ( udg_Tower_Group, function Trig_restart_Func007A )
call ForGroupBJ( udg_Fighter_Group, function Trig_restart_Func008A )
call GroupClear( udg_Fighter_Group )
call GroupClear( udg_Tower_Group )
// Workers
call ForForce( udg_IngamePlayers_PlayerGroup, function Trig_restart_Func012A )
call ForForce( udg_IngamePlayers_PlayerGroup, function Trig_restart_Func013A )
if ( Trig_restart_Func014C() ) then
set udg_Temp_Point = GetUnitLoc(GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(Player(0), 'h023')))
set udg_Temp_Point = OffsetLocation(udg_Temp_Point, 0, 256.00)
call CreateNUnitsAtLoc( 1, 'ewsp', Player(0), udg_Temp_Point, 90.00 )
call IssueTargetDestructableOrder( GetLastCreatedUnit(), "harvest", gg_dest_LTlt_0101 )
else
endif
if ( Trig_restart_Func015C() ) then
set udg_Temp_Point = GetUnitLoc(GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(Player(1), 'h023')))
set udg_Temp_Point = OffsetLocation(udg_Temp_Point, 0, 256.00)
call CreateNUnitsAtLoc( 1, 'ewsp', Player(1), udg_Temp_Point, 90.00 )
call IssueTargetDestructableOrder( GetLastCreatedUnit(), "harvest", gg_dest_LTlt_0133 )
else
endif
if ( Trig_restart_Func016C() ) then
set udg_Temp_Point = GetUnitLoc(GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(Player(2), 'h023')))
set udg_Temp_Point = OffsetLocation(udg_Temp_Point, 0, 256.00)
call CreateNUnitsAtLoc( 1, 'ewsp', Player(2), udg_Temp_Point, 90.00 )
call IssueTargetDestructableOrder( GetLastCreatedUnit(), "harvest", gg_dest_LTlt_0116 )
else
endif
if ( Trig_restart_Func017C() ) then
set udg_Temp_Point = GetUnitLoc(GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(Player(3), 'h023')))
set udg_Temp_Point = OffsetLocation(udg_Temp_Point, 0, 256.00)
call CreateNUnitsAtLoc( 1, 'ewsp', Player(3), udg_Temp_Point, 90.00 )
call IssueTargetDestructableOrder( GetLastCreatedUnit(), "harvest", gg_dest_LTlt_0148 )
else
endif
if ( Trig_restart_Func018C() ) then
set udg_Temp_Point = GetUnitLoc(GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(Player(4), 'h023')))
set udg_Temp_Point = OffsetLocation(udg_Temp_Point, 0, 256.00)
call CreateNUnitsAtLoc( 1, 'ewsp', Player(4), udg_Temp_Point, 90.00 )
call IssueTargetDestructableOrder( GetLastCreatedUnit(), "harvest", gg_dest_LTlt_0162 )
else
endif
if ( Trig_restart_Func019C() ) then
set udg_Temp_Point = GetUnitLoc(GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(Player(5), 'h023')))
set udg_Temp_Point = OffsetLocation(udg_Temp_Point, 0, 256.00)
call CreateNUnitsAtLoc( 1, 'ewsp', Player(5), udg_Temp_Point, 90.00 )
call IssueTargetDestructableOrder( GetLastCreatedUnit(), "harvest", gg_dest_LTlt_0190 )
else
endif
if ( Trig_restart_Func020C() ) then
set udg_Temp_Point = GetUnitLoc(GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(Player(6), 'h023')))
set udg_Temp_Point = OffsetLocation(udg_Temp_Point, 0, 256.00)
call CreateNUnitsAtLoc( 1, 'ewsp', Player(6), udg_Temp_Point, 90.00 )
call IssueTargetDestructableOrder( GetLastCreatedUnit(), "harvest", gg_dest_LTlt_0176 )
else
endif
if ( Trig_restart_Func021C() ) then
set udg_Temp_Point = GetUnitLoc(GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(Player(7), 'h023')))
set udg_Temp_Point = OffsetLocation(udg_Temp_Point, 0, 256.00)
call CreateNUnitsAtLoc( 1, 'ewsp', Player(7), udg_Temp_Point, 90.00 )
call IssueTargetDestructableOrder( GetLastCreatedUnit(), "harvest", gg_dest_LTlt_0204 )
else
endif
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 8
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_numWorkers[GetForLoopIndexA()] = 1
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
//
call ForForce( udg_IngamePlayers_PlayerGroup, function Trig_restart_Func024A )
// king
call SetUnitLifePercentBJ( gg_unit_h00K_0009, 100 )
call SetUnitLifePercentBJ( gg_unit_h00K_0006, 100 )
call SetUnitManaPercentBJ( gg_unit_h00K_0009, 100 )
call SetUnitManaPercentBJ( gg_unit_h00K_0006, 100 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = udg_numKingAbilities
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call UnitRemoveAbilityBJ( udg_KingAbilities[GetForLoopIndexA()], gg_unit_h00K_0009 )
call UnitRemoveAbilityBJ( udg_KingAbilities[GetForLoopIndexA()], gg_unit_h00K_0006 )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
// lvl
set udg_Level_Integer = 0
call StartTimerBJ( udg_Spawn_Timer, false, 90.00 )
call TimerDialogSetTitleBJ( udg_Spawn_Timer_Window, ( "Level " + ( I2S(( udg_Level_Integer + 1 )) + " in" ) ) )
call DisplayTimedTextToForce( GetPlayersAll(), 10.00, "TRIGSTR_4866" )
endfunction
//===========================================================================
function InitTrig_restart takes nothing returns nothing
set gg_trg_restart = CreateTrigger( )
call DisableTrigger( gg_trg_restart )
call TriggerRegisterPlayerChatEvent( gg_trg_restart, Player(0), "-restart", true )
call TriggerAddAction( gg_trg_restart, function Trig_restart_Actions )
endfunction
//TESH.scrollpos=180
//TESH.alwaysfold=0
function Trig_restart_Func001001002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_GIANT) == true )
endfunction
function Trig_restart_Func001A takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_restart_Func002001002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_ANCIENT) == true )
endfunction
function Trig_restart_Func002A takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_restart_Func003001002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_SUMMONED) == true )
endfunction
function Trig_restart_Func003A takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_restart_Func004A takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_restart_Func005A takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_restart_Func006A takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_restart_Func007A takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_restart_Func008A takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_restart_Func012A takes nothing returns nothing
call SelectUnitForPlayerSingle( udg_Builder_Unit[GetConvertedPlayerId(GetEnumPlayer())], GetEnumPlayer() )
call ForceUICancelBJ( GetEnumPlayer() )
endfunction
function Trig_restart_Func013A takes nothing returns nothing
call RemoveUnit( udg_Builder_Unit[GetConvertedPlayerId(GetEnumPlayer())] )
endfunction
function Trig_restart_Func014C takes nothing returns boolean
if ( not ( IsPlayerInForce(Player(0), udg_IngamePlayers_PlayerGroup) == true ) ) then
return false
endif
return true
endfunction
function Trig_restart_Func015C takes nothing returns boolean
if ( not ( IsPlayerInForce(Player(1), udg_IngamePlayers_PlayerGroup) == true ) ) then
return false
endif
return true
endfunction
function Trig_restart_Func016C takes nothing returns boolean
if ( not ( IsPlayerInForce(Player(2), udg_IngamePlayers_PlayerGroup) == true ) ) then
return false
endif
return true
endfunction
function Trig_restart_Func017C takes nothing returns boolean
if ( not ( IsPlayerInForce(Player(3), udg_IngamePlayers_PlayerGroup) == true ) ) then
return false
endif
return true
endfunction
function Trig_restart_Func018C takes nothing returns boolean
if ( not ( IsPlayerInForce(Player(4), udg_IngamePlayers_PlayerGroup) == true ) ) then
return false
endif
return true
endfunction
function Trig_restart_Func019C takes nothing returns boolean
if ( not ( IsPlayerInForce(Player(5), udg_IngamePlayers_PlayerGroup) == true ) ) then
return false
endif
return true
endfunction
function Trig_restart_Func020C takes nothing returns boolean
if ( not ( IsPlayerInForce(Player(6), udg_IngamePlayers_PlayerGroup) == true ) ) then
return false
endif
return true
endfunction
function Trig_restart_Func021C takes nothing returns boolean
if ( not ( IsPlayerInForce(Player(7), udg_IngamePlayers_PlayerGroup) == true ) ) then
return false
endif
return true
endfunction
function Trig_restart_Func024A takes nothing returns nothing
call SetPlayerStateBJ( GetEnumPlayer(), PLAYER_STATE_RESOURCE_GOLD, 100 )
call SetPlayerStateBJ( GetEnumPlayer(), PLAYER_STATE_RESOURCE_LUMBER, 30 )
set udg_PlayerIncome[GetConvertedPlayerId(GetEnumPlayer())] = 0
call CreateNUnitsAtLoc( 1, 'e000', GetEnumPlayer(), GetPlayerStartLocationLoc(GetEnumPlayer()), bj_UNIT_FACING )
call SelectUnitForPlayerSingle( GetLastCreatedUnit(), GetEnumPlayer() )
// retore race picker
// set udg_Builder_Unit[GetConvertedPlayerId(GetEnumPlayer())] = GetLastCreatedUnit()
if( udg_ModeAR == true ) then
call EnableTrigger( gg_trg_Mode_AR )
call TriggerExecute( gg_trg_Mode_AR )
else
if( udg_ModeSD == true ) then
call EnableTrigger( gg_trg_Mode_SD )
call TriggerExecute( gg_trg_Mode_SD )
else
call EnableTrigger( gg_trg_Mode_AP )
call TriggerExecute( gg_trg_Mode_AP )
endif
endif
call PanCameraToTimedLocForPlayer( GetEnumPlayer(), GetPlayerStartLocationLoc(GetEnumPlayer()), 0 )
endfunction
function Trig_restart_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_restart_Func001001002)), function Trig_restart_Func001A )
call ForGroupBJ( GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_restart_Func002001002)), function Trig_restart_Func002A )
call ForGroupBJ( GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_restart_Func003001002)), function Trig_restart_Func003A )
call ForGroupBJ( GetUnitsOfPlayerAll(Player(10)), function Trig_restart_Func004A )
call ForGroupBJ( GetUnitsOfPlayerAll(Player(11)), function Trig_restart_Func005A )
call ForGroupBJ( GetUnitsOfTypeIdAll('h025'), function Trig_restart_Func006A )
call ForGroupBJ( udg_Tower_Group, function Trig_restart_Func007A )
call ForGroupBJ( udg_Fighter_Group, function Trig_restart_Func008A )
call GroupClear( udg_Fighter_Group )
call GroupClear( udg_Tower_Group )
// Workers
call ForForce( udg_IngamePlayers_PlayerGroup, function Trig_restart_Func012A )
call ForForce( udg_IngamePlayers_PlayerGroup, function Trig_restart_Func013A )
if ( Trig_restart_Func014C() ) then
set udg_Temp_Point = GetUnitLoc(GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(Player(0), 'h023')))
set udg_Temp_Point = OffsetLocation(udg_Temp_Point, 0, 256.00)
call CreateNUnitsAtLoc( 1, 'h025', Player(0), udg_Temp_Point, 90.00 )
call IssueTargetDestructableOrder( GetLastCreatedUnit(), "harvest", gg_dest_LTlt_0101 )
else
endif
if ( Trig_restart_Func015C() ) then
set udg_Temp_Point = GetUnitLoc(GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(Player(1), 'h023')))
set udg_Temp_Point = OffsetLocation(udg_Temp_Point, 0, 256.00)
call CreateNUnitsAtLoc( 1, 'h025', Player(1), udg_Temp_Point, 90.00 )
call IssueTargetDestructableOrder( GetLastCreatedUnit(), "harvest", gg_dest_LTlt_0133 )
else
endif
if ( Trig_restart_Func016C() ) then
set udg_Temp_Point = GetUnitLoc(GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(Player(2), 'h023')))
set udg_Temp_Point = OffsetLocation(udg_Temp_Point, 0, 256.00)
call CreateNUnitsAtLoc( 1, 'h025', Player(2), udg_Temp_Point, 90.00 )
call IssueTargetDestructableOrder( GetLastCreatedUnit(), "harvest", gg_dest_LTlt_0116 )
else
endif
if ( Trig_restart_Func017C() ) then
set udg_Temp_Point = GetUnitLoc(GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(Player(3), 'h023')))
set udg_Temp_Point = OffsetLocation(udg_Temp_Point, 0, 256.00)
call CreateNUnitsAtLoc( 1, 'h025', Player(3), udg_Temp_Point, 90.00 )
call IssueTargetDestructableOrder( GetLastCreatedUnit(), "harvest", gg_dest_LTlt_0148 )
else
endif
if ( Trig_restart_Func018C() ) then
set udg_Temp_Point = GetUnitLoc(GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(Player(4), 'h023')))
set udg_Temp_Point = OffsetLocation(udg_Temp_Point, 0, 256.00)
call CreateNUnitsAtLoc( 1, 'h025', Player(4), udg_Temp_Point, 90.00 )
call IssueTargetDestructableOrder( GetLastCreatedUnit(), "harvest", gg_dest_LTlt_0162 )
else
endif
if ( Trig_restart_Func019C() ) then
set udg_Temp_Point = GetUnitLoc(GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(Player(5), 'h023')))
set udg_Temp_Point = OffsetLocation(udg_Temp_Point, 0, 256.00)
call CreateNUnitsAtLoc( 1, 'h025', Player(5), udg_Temp_Point, 90.00 )
call IssueTargetDestructableOrder( GetLastCreatedUnit(), "harvest", gg_dest_LTlt_0190 )
else
endif
if ( Trig_restart_Func020C() ) then
set udg_Temp_Point = GetUnitLoc(GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(Player(6), 'h023')))
set udg_Temp_Point = OffsetLocation(udg_Temp_Point, 0, 256.00)
call CreateNUnitsAtLoc( 1, 'h025', Player(6), udg_Temp_Point, 90.00 )
call IssueTargetDestructableOrder( GetLastCreatedUnit(), "harvest", gg_dest_LTlt_0176 )
else
endif
if ( Trig_restart_Func021C() ) then
set udg_Temp_Point = GetUnitLoc(GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(Player(7), 'h023')))
set udg_Temp_Point = OffsetLocation(udg_Temp_Point, 0, 256.00)
call CreateNUnitsAtLoc( 1, 'h025', Player(7), udg_Temp_Point, 90.00 )
call IssueTargetDestructableOrder( GetLastCreatedUnit(), "harvest", gg_dest_LTlt_0204 )
else
endif
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 8
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_numWorkers[GetForLoopIndexA()] = 1
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
//
call ForForce( udg_IngamePlayers_PlayerGroup, function Trig_restart_Func024A )
// king
call SetUnitLifePercentBJ( gg_unit_h00K_0009, 100 )
call SetUnitLifePercentBJ( gg_unit_h00K_0006, 100 )
call SetUnitManaPercentBJ( gg_unit_h00K_0009, 100 )
call SetUnitManaPercentBJ( gg_unit_h00K_0006, 100 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = udg_numKingAbilities
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call UnitRemoveAbilityBJ( udg_KingAbilities[GetForLoopIndexA()], gg_unit_h00K_0009 )
call UnitRemoveAbilityBJ( udg_KingAbilities[GetForLoopIndexA()], gg_unit_h00K_0006 )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
// lvl
set udg_Level_Integer = 0
call StartTimerBJ( udg_Spawn_Timer, false, 90.00 )
call TimerDialogSetTitleBJ( udg_Spawn_Timer_Window, ( "Level " + ( I2S(( udg_Level_Integer + 1 )) + " in" ) ) )
call DisplayTimedTextToForce( GetPlayersAll(), 10.00, "TRIGSTR_4866" )
endfunction
//===========================================================================
function InitTrig_restart takes nothing returns nothing
set gg_trg_restart = CreateTrigger( )
call DisableTrigger( gg_trg_restart )
call TriggerRegisterPlayerChatEvent( gg_trg_restart, Player(0), "-restart", true )
call TriggerAddAction( gg_trg_restart, function Trig_restart_Actions )
endfunction