//TESH.scrollpos=0
//TESH.alwaysfold=0
Name | Type | is_array | initial_value |
arr_iElfClean | integer | Yes | |
arr_iIncome | integer | Yes | |
arr_iPlayersInForce | integer | Yes | |
bCommanderOTGStrategy | boolean | No | |
bForceAlive | boolean | Yes | true |
bPlayerAlive | boolean | Yes | true |
bRallypointForEverybody | boolean | Yes | |
bRallypointForSummoned | boolean | Yes | |
bRallypointForTrainedUnits | boolean | Yes | |
bWritePlayerDeath | boolean | No | |
iControlPoints | integer | Yes | |
iDemonCommanderDeads | integer | No | |
iForcesAlive | integer | No | 4 |
iIntroVote | integer | Yes | |
iLivingPlayers | integer | No | 12 |
iLivingUnits | integer | Yes | |
iMaxBlackHandOfficers | integer | No | 3 |
iMaxBlackHandShadowFDrakes | integer | No | 2 |
IntroTexte | texttag | Yes | |
iPlayers | integer | No | |
iSDBerechneteWartezeit | integer | No | |
iSharrazorCond | integer | No | |
iSkelletkriegerZufall | integer | No | |
iSuddenDeathAbgegebeneStimmen | integer | No | |
iSuddenDeathZeitGesamt | integer | No | |
iTechUnits | integer | Yes | 6 |
iWantsNoSuddenDeath | integer | No | |
oRallypointOfSummoned | location | Yes | |
oRallypointOfTrainsAndAll | location | Yes | |
oRockTerrain | terraintype | No | TerrainTypeLrok |
oTimerArray | timer | Yes | |
oTimerWindowArray | timerdialog | Yes | |
oVoterKillZoneCenter | location | No | |
oWinningForce | force | No | |
PlayersAll | force | No | |
PlayersAlli | force | No | |
PlayersBlu | force | No | |
PlayersCC | force | No | |
PlayersDemon | force | No | |
tSuddenDeath | timer | No | |
tWaehldoch | timer | No | |
uCommandUnit | unit | Yes | |
uDmgDummy | unit | No | |
uRallypoint | unit | Yes | |
uRallypointAll | unit | Yes | |
uRallypointSummoned | unit | Yes | |
uShrineOfTheSeas | unit | No | UnitNull |
uVoratoll | unit | No |
//TESH.scrollpos=117
//TESH.alwaysfold=0
function DisableInterfaceForAllPlayers takes nothing returns nothing
call ShowInterfaceForceOff( udg_PlayersAll, 0.10 )
endfunction
function SetNumberOfUnitsVariables takes nothing returns nothing
local group tempgroup = GetUnitsInRectOfPlayer(GetPlayableMapRect(), GetEnumPlayer())
//All common units and the techunits are in this group
// The rallypoint units have to be added because of classification and spell-dummy
set udg_iLivingUnits[ GetPlayerId(GetEnumPlayer() )] = CountUnitsInGroup(tempgroup) + 3
set udg_iTechUnits[ GetPlayerId(GetEnumPlayer() )] = 6
call DestroyGroup(tempgroup)
set tempgroup = GetUnitsOfPlayerAndTypeId(GetEnumPlayer(), 'n024')
set udg_arr_iIncome[GetPlayerId(GetEnumPlayer())] = CountUnitsInGroup(tempgroup) + 1
call DestroyGroup(tempgroup)
endfunction
function SetPauseForEnumUnitTrue takes nothing returns nothing
call PauseUnitBJ( true, GetEnumUnit() )
endfunction
function SetPauseForEnumUnitFalse takes nothing returns nothing
call PauseUnitBJ( false, GetEnumUnit() )
endfunction
function CreateMaskOfWarForPlayer takes nothing returns nothing
call CreateFogModifierRectBJ( true, GetEnumPlayer(), FOG_OF_WAR_MASKED, GetPlayableMapRect() )
endfunction
function IsEnumUnitUndeadOrUpgraded takes nothing returns boolean
if ( (GetUnitPointValue(GetEnumUnit()) == 99) or (GetUnitPointValue(GetEnumUnit()) == 98 )) then
return true
endif
return false
endfunction
function RemoveUndeadClassificationFromReplacedAndUpgradedUnits takes nothing returns nothing
if ( IsEnumUnitUndeadOrUpgraded() ) then
call UnitRemoveTypeBJ( UNIT_TYPE_UNDEAD, GetEnumUnit() )
else
endif
endfunction
function ShowInterFaceforAllPlayers takes nothing returns nothing
call ShowInterfaceForceOn( udg_PlayersAll, 0.10 )
endfunction
function SetUnitTransperencyTo50 takes nothing returns nothing
call SetUnitVertexColorBJ( GetEnumUnit(), 100, 100, 100, 50.00 )
endfunction
function SetStartRessources takes nothing returns nothing
call SetPlayerStateBJ( GetEnumPlayer(), PLAYER_STATE_RESOURCE_GOLD, 50 )
call SetPlayerStateBJ( GetEnumPlayer(), PLAYER_STATE_RESOURCE_LUMBER, 100 )
endfunction
function SetSiegePrecisionAbility takes nothing returns nothing
if( GetUnitAbilityLevel(GetEnumUnit(), 'A0E4') == 1 ) then
call UnitRemoveAbility(GetEnumUnit(), 'A0E4')
call UnitAddAbility(GetEnumUnit(), 'ANic')
if(IsUnitType(GetEnumUnit(), UNIT_TYPE_MECHANICAL) == false) then
call SetUnitAbilityLevel(GetEnumUnit(), 'ANic', 2)
endif
endif
endfunction
function Trig_Initialisierung_Actions takes nothing returns nothing
local group tempGroup
set udg_PlayersAll = GetPlayersAll()
// camera-settings
call ForForce( udg_PlayersAll, function DisableInterfaceForAllPlayers )
// Optik
call FogMaskEnableOn( )
call ForForce( udg_PlayersAll, function CreateMaskOfWarForPlayer )
// initialize variables
set udg_arr_iPlayersInForce[0] = 3
set udg_arr_iPlayersInForce[1] = 3
set udg_arr_iPlayersInForce[2] = 2
set udg_arr_iPlayersInForce[3] = 4
set udg_uShrineOfTheSeas = gg_unit_h001_0231
set udg_uDmgDummy = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'h002', -12925, 13375, 270.0)
set udg_oVoterKillZoneCenter = GetRectCenter(gg_rct_VoterKillzone)
call ForForce( udg_PlayersAll, function SetNumberOfUnitsVariables )
set udg_iTechUnits[7] = udg_iTechUnits[7]+1
//Forces
call ForceAddPlayer(udg_PlayersBlu, Player(0))
call ForceAddPlayer(udg_PlayersBlu, Player(1))
call ForceAddPlayer(udg_PlayersBlu, Player(2))
call ForceAddPlayer(udg_PlayersAlli, Player(3))
call ForceAddPlayer(udg_PlayersAlli, Player(4))
call ForceAddPlayer(udg_PlayersAlli, Player(5))
call ForceAddPlayer(udg_PlayersDemon, Player(6))
call ForceAddPlayer(udg_PlayersDemon, Player(7))
call ForceAddPlayer(udg_PlayersCC, Player(8))
call ForceAddPlayer(udg_PlayersCC, Player(9))
call ForceAddPlayer(udg_PlayersCC, Player(10))
call ForceAddPlayer(udg_PlayersCC, Player(11))
call TriggerSleepAction( 1.50 )
//CreateUnits
call TriggerExecute(gg_trg_CreateUnits)
// Handle units that are trained in groups
// they are still classified as undead
call TriggerSleepAction( 0.50 )
set tempGroup = GetUnitsInRectAll(GetPlayableMapRect())
call ForGroupBJ(tempGroup , function RemoveUndeadClassificationFromReplacedAndUpgradedUnits )
call ForGroup(tempGroup, function SetSiegePrecisionAbility)
// Game Intro ===================================
call TriggerSleepAction( 0.50 )
call DisplayTextToForce( udg_PlayersAll, "Welcome to:")
call TriggerSleepAction( 0.50 )
call DisplayTextToForce(udg_PlayersAll, "Wars of Theosa" )
call DisableTrigger(gg_trg_InitTriggerKills)
call TriggerSleepAction( 2.50) //2.5
call DisplayTextToForce( udg_PlayersAll, "A peaceful world becoming a battlefield to survive and to regain this old peace.")
call ClearTextMessagesBJ( udg_PlayersAll )
call TriggerSleepAction( 4.00 ) //4
call DisplayTextToForce( udg_PlayersAll, "Before you start your game you have to choose the gameoptions containing Sudden Death and Intro" )
call ClearTextMessagesBJ( udg_PlayersAll )
call TriggerSleepAction( 7.00 ) //7
call DisplayTextToForce( udg_PlayersAll, "Sudden Death means that neutral hostiles are removed and that every player got an Handy Cap of 1% so this will become crazy." )
call ClearTextMessagesBJ( udg_PlayersAll )
call TriggerSleepAction( 8.00 ) //8
call DisplayTextToForce( udg_PlayersAll, "If you don´t want Sudden Death then you need more than 50% of human players voting for endless." )
call ClearTextMessagesBJ( udg_PlayersAll )
call TriggerSleepAction( 7.00 ) //7
call DisplayTextToForce( udg_PlayersAll, "If you want to see race specific intros you need more than 50% of human players voting for it. You can only vote one time per choice so be carefull" )
call ClearTextMessagesBJ( udg_PlayersAll )
call TriggerSleepAction( 8.00 ) //8
call DisplayTextToForce( udg_PlayersAll, "If you are new to the game it is recomanded to read the informations first (Press F9).Most important ones:" )
call DisplayTextToForce( udg_PlayersAll, "Hotkeys, Credits and The Map Makers last words. Now you get up to 5 minutes to prepare.")
call TriggerSleepAction( 3.00 ) //3
// enable cameras
call ForForce( udg_PlayersAll, function ShowInterFaceforAllPlayers )
call TriggerExecute(gg_trg_CreateVotingUnits)
call ForGroupBJ( tempGroup, function SetPauseForEnumUnitTrue)
call DestroyGroup(tempGroup)
set tempGroup = GetUnitsInRectAll(gg_rct_VotingArea)
call ForGroupBJ(tempGroup , function SetPauseForEnumUnitFalse )
call DestroyGroup(tempGroup)
// Trancparency for units =========================
call ForGroupBJ( GetUnitsInRectAll(gg_rct_Entsetzlicher_Alptraum), function SetUnitTransperencyTo50 )
call TriggerSleepAction( 0.50 )
// Ressources
call ForForce( udg_PlayersAll, function SetStartRessources )
call TriggerSleepAction( 0.50 )
// Other Triggers
call TriggerExecute( gg_trg_Texte )
call TriggerSleepAction( 0.50 )
call TriggerExecute( gg_trg_Infobook )
call TriggerSleepAction( 0.50 )
call TriggerExecute( gg_trg_Waehl_doch )
call TriggerSleepAction( 0.50 )
call TriggerExecute( gg_trg_Einheitenbeschraenken )
call TriggerSleepAction( 0.50 )
call TriggerExecute( gg_trg_Rallypoints )
//Visibility Void
call CreateFogModifierRectBJ( true, Player(7), FOG_OF_WAR_VISIBLE, gg_rct_VoidArea )
call CreateFogModifierRectBJ( true, Player(6), FOG_OF_WAR_VISIBLE, gg_rct_VoidArea )
//other stuff
call ModifyGateBJ( bj_GATEOPERATION_OPEN, gg_dest_ZTsx_1320 )
endfunction
//===========================================================================
function InitTrig_Initialisierung takes nothing returns nothing
set gg_trg_Initialisierung = CreateTrigger( )
call TriggerAddAction( gg_trg_Initialisierung, function Trig_Initialisierung_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_CreateVotingUnits_Actions takes nothing returns nothing
local integer ic
local integer j = 0
local location temploc
local unit tempunit
set temploc = GetRectCenter(gg_rct_SuddenDeathWahl)
loop
set ic = 0
loop
if ( GetPlayerController(Player(ic)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(ic)) == PLAYER_SLOT_STATE_PLAYING) then
set tempunit = CreateUnitAtLoc(Player(ic), 'e000', temploc, bj_UNIT_FACING )
set tempunit = null
set udg_iPlayers = ( udg_iPlayers + 1 )
endif
exitwhen ic == 11
set ic = ic + 1
endloop
call RemoveLocation(temploc)
set temploc = GetRectCenter(gg_rct_VoteForIntro)
set j = j + 1
exitwhen j == 2
endloop
call RemoveLocation(temploc)
set temploc = null
endfunction
//===========================================================================
function InitTrig_CreateVotingUnits takes nothing returns nothing
set gg_trg_CreateVotingUnits = CreateTrigger( )
call TriggerAddAction( gg_trg_CreateVotingUnits, function Trig_CreateVotingUnits_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Rallypoints_Func001Func008002001002001 takes nothing returns boolean
return ( GetUnitTypeId(GetEnumUnit()) == 'N03S' )
endfunction
function Trig_Rallypoints_Func001Func008002001002002 takes nothing returns boolean
return ( GetOwningPlayer(GetEnumUnit()) == GetEnumPlayer() )
endfunction
function Trig_Rallypoints_Func001Func008002001002 takes nothing returns boolean
return GetBooleanAnd( Trig_Rallypoints_Func001Func008002001002001(), Trig_Rallypoints_Func001Func008002001002002() )
endfunction
function Trig_Rallypoints_Func001A takes nothing returns nothing
local location temploc
local group tempgroup
set temploc = GetRandomLocInRect(gg_rct_UnitCache)
set udg_uRallypoint[GetPlayerId(GetEnumPlayer())] = CreateUnitAtLoc(GetEnumPlayer(), 'nhyc', temploc, bj_UNIT_FACING )
set udg_uRallypointSummoned[GetPlayerId(GetEnumPlayer())] = CreateUnitAtLoc(GetEnumPlayer(), 'nnrg', temploc, bj_UNIT_FACING )
set udg_uRallypointAll[GetPlayerId(GetEnumPlayer())] = CreateUnitAtLoc(GetEnumPlayer(), 'nmyr', temploc, bj_UNIT_FACING )
// CommandunitAbspeichern
set tempgroup = GetUnitsInRectMatching(gg_rct_Classifications, Condition(function Trig_Rallypoints_Func001Func008002001002))
set udg_uCommandUnit[GetPlayerId(GetEnumPlayer())] = FirstOfGroup(tempgroup)
call DestroyGroup(tempgroup)
call RemoveLocation(temploc)
endfunction
function Trig_Rallypoints_Actions takes nothing returns nothing
call ForForce( udg_PlayersAll, function Trig_Rallypoints_Func001A )
endfunction
//===========================================================================
function InitTrig_Rallypoints takes nothing returns nothing
set gg_trg_Rallypoints = CreateTrigger( )
call TriggerAddAction( gg_trg_Rallypoints, function Trig_Rallypoints_Actions )
endfunction
//TESH.scrollpos=49
//TESH.alwaysfold=0
function Trig_CreateUnits_Actions takes nothing returns nothing
local integer i = 0
local unit tempunit
//Trolls
// Troll Axemen
//Norhtland
call CreateUnit(Player(1), 'o005', -1380, 11804, 315.0)
call CreateUnit(Player(1), 'o005', -1647, 11673, 340.0)
call CreateUnit(Player(1), 'o005', -174, 11370, 330.0)
call CreateUnit(Player(1), 'o005', -167, 11180, 10.0)
call CreateUnit(Player(1), 'o005', -2104, 12054, 315.0)
call CreateUnit(Player(1), 'o005', -2104, 12054, 315.0)
call CreateUnit(Player(1), 'o005', -2104, 12054, 315.0)
call CreateUnit(Player(1), 'o005', 820, 9898, 135.0)
//Zeth arul
call CreateUnit(Player(1), 'o005', 28, 3367, 270.0)
call CreateUnit(Player(1), 'o005', -28, 3367, 270.0)
call CreateUnit(Player(1), 'o005', -128, 3367, 270.0)
call CreateUnit(Player(1), 'o005', -168, 3367, 270.0)
//Zeth arul Guardien
call CreateUnit(Player(1), 'o00K', -78, 3279, 270.0)
call CreateUnit(Player(1), 'o00K', -703, 3569, 315.0)
call CreateUnit(Player(1), 'o00K', -1037, 3253, 270.0)
//IcyFarms
call CreateUnit(Player(1), 'o004', 1072, 9564, 270.0)
call CreateUnit(Player(1), 'o004', 957, 9510, 270.0)
call CreateUnit(Player(1), 'o004', -1812, 12672, 270.0)
call CreateUnit(Player(1), 'o004', -1670, 12617, 270.0)
//Watchtowers
call CreateUnit(Player(1), 'o007', -520, 2431, 270.0)
call CreateUnit(Player(1), 'o007', -1015, 2431, 270.0)
call CreateUnit(Player(1), 'o007', 396, 2285, 270.0)
call CreateUnit(Player(1), 'o007', 888, 2285, 270.0)
call TriggerSleepAction(0.5)
//Elves
//Footmen
//Sharenar
call CreateUnit(Player(5), 'ewsp', -1175, -10470, 270.0)
call CreateUnit(Player(5), 'ewsp', -1115, -10470, 270.0)
call CreateUnit(Player(5), 'ewsp', -1055, -10470, 270.0)
call CreateUnit(Player(5), 'ewsp', -455, -9250, 0.0)
call CreateUnit(Player(5), 'ewsp', -421, -9775, 0.0)
//Front
call CreateUnit(Player(5), 'ewsp', 237, -4600, 90.0)
call CreateUnit(Player(5), 'ewsp', 519, -4600, 90.0)
call CreateUnit(Player(5), 'ewsp', 420, -4720, 90.0)
call CreateUnit(Player(5), 'ewsp', 294, -4720, 90.0)
call CreateUnit(Player(5), 'ewsp', 1768, -5563, 255.0)
call CreateUnit(Player(5), 'ewsp', 1776, -5707, 105.0)
//Watchtowers
call CreateUnit(Player(5), 'etrp', -396, -4471, 270.0)
call CreateUnit(Player(5), 'etrp', -127, -4471, 270.0)
call CreateUnit(Player(5), 'etrp', 1067, -4401, 270.0)
call CreateUnit(Player(5), 'etrp', 1406, -4401, 270.0)
call CreateUnit(Player(5), 'etrp', 1725, -4409, 270.0)
call TriggerSleepAction(0.5)
//Gnolls
//GnollSoldier
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'n016', -6235, -3516, 0.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'n016', -6235, -3747, 0.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'n016', -7345, -5027, 135.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'n016', -8802, -4619, 45.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'n016', -8802, -4619, 45.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'n016', -8802, -4619, 45.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'n016', -9634, -3060, 135.0)
call TriggerSleepAction(0.5)
//Cult of the Black Hand
//Black Soldiers
loop
call CreateUnit(Player(6), 'u00D', -5784, -1269, 315.0)
set i = i +1
exitwhen i == 9
endloop
set i = 0
call CreateUnit(Player(6), 'u00D', -4155, 1370, 135.0)
call CreateUnit(Player(6), 'u00D', -4155, 1370, 135.0)
call CreateUnit(Player(6), 'u00D', -4155, 1370, 135.0)
loop
call CreateUnit(Player(6), 'u00D', -12357, -18611, 25.0)
set i = i +1
exitwhen i == 5
endloop
set i = 0
//Black Crossbowmen
loop
call CreateUnit(Player(6), 'u00G', -5965, -1089, 315.0)
set i = i +1
exitwhen i == 6
endloop
set i = 0
//Black Peasant
loop
call CreateUnit(Player(6), 'h00B', -12471, -18219, 315.0)
set i = i +1
exitwhen i == 4
endloop
set i = 0
call TriggerSleepAction(0.5)
//Doombringer
//Doom Peasant
loop
call CreateUnit(Player(7), 'h00C', -14653, -18661, 35.0)
set i = i +1
exitwhen i == 4
endloop
set i = 0
call TriggerSleepAction(0.8)
//Heroes
//Bladelord
call CreateUnit(Player(3), 'Hamg', 4537, -14034, 135.0)
call TriggerSleepAction(1.0)
//Malgus
call CreateUnit(Player(3), 'Hpal', 4033, -14944, 315.0)
call TriggerSleepAction(1.0)
//Allesandra
call CreateUnit(Player(5), 'Emoo', -1696, -9540, 270.0)
call TriggerSleepAction(1.0)
//Dalaro
call CreateUnit(Player(5), 'Ekee', -1562, -10720, 45.0)
call TriggerSleepAction(1.0)
//Garith
call CreateUnit(Player(4), 'Oshd', 15619, -17164, 270.0)
call TriggerSleepAction(1.0)
//Bordin
call CreateUnit(Player(4), 'Otch', 15106, -19737, 90.0)
call TriggerSleepAction(1.0)
//Varamir
call CreateUnit(Player(0), 'Uear', 2391, 13315, 0.0)
call TriggerSleepAction(1.0)
//Vizeera
call CreateUnit(Player(0), 'Uanb', 9059, 14988, 0.0)
call TriggerSleepAction(1.0)
//Voratoll
set udg_uVoratoll = CreateUnit(Player(1), 'Ofar', -1595, 12292, 187.5)
call TriggerSleepAction(1.0)
//Zeth'arul
call CreateUnit(Player(1), 'Obla', -873, 3402, 315)
call TriggerSleepAction(1.0)
//Lisara
call CreateUnit(Player(2), 'Ewar', -2096, 5647, 135)
call TriggerSleepAction(1.0)
//Farsasz
call CreateUnit(Player(2), 'Eill', -3429, 11100, 180)
call TriggerSleepAction(1.0)
//Dannimos
call CreateUnit(Player(6), 'Ulic', -13467, -18674, 315)
call TriggerSleepAction(1.0)
//Thorano
call CreateUnit(Player(6), 'Udea', -12186, -18496, 225)
call TriggerSleepAction(1.0)
//Morbeen
set tempunit = CreateUnit(Player(7), 'Udre', -1464, 1342, 43.75)
call SetHeroLevel(tempunit, 4, false)
call TriggerSleepAction(1.0)
//Barrok Deathfist
call CreateUnit(Player(8), 'Hmkg', 10874, -17503, 0)
call TriggerSleepAction(1.0)
//Faerick
call CreateUnit(Player(8), 'Hblm',11134, -17345, 225)
call TriggerSleepAction(1.0)
//Gronk
call CreateUnit(Player(9), 'Hdgo', 2008, -7941, 290)
call TriggerSleepAction(1.0)
//Borkaer
call CreateUnit(Player(9), 'Hapm', 9139, 1026, 180)
call TriggerSleepAction(1.0)
//Tarash
call CreateUnit(Player(10), 'Nbbc', 5900, 12042, 30)
call TriggerSleepAction(1.0)
//Eugene
call CreateUnit(Player(11), 'Edem', -19390, 13656, 90)
call TriggerSleepAction(1.0)
//Marallas
call CreateUnit(Player(11), 'E00R', -19409, 13914, 286.27)
call TriggerSleepAction(1.0)
set tempunit = null
endfunction
//===========================================================================
function InitTrig_CreateUnits takes nothing returns nothing
set gg_trg_CreateUnits = CreateTrigger( )
call TriggerAddAction( gg_trg_CreateUnits, function Trig_CreateUnits_Actions )
endfunction
//TESH.scrollpos=24
//TESH.alwaysfold=0
function income takes nothing returns nothing
local integer i
set i = 0
loop
call AdjustPlayerStateBJ( udg_arr_iIncome[i]*10 , Player(i), PLAYER_STATE_RESOURCE_GOLD )
set i = i + 1
exitwhen i == 12
endloop
call DisplayTextToForce(udg_PlayersAll, "Income")
endfunction
function Trig_TimerUmstellen_Actions takes nothing returns nothing
call DestroyTimerDialogBJ( udg_oTimerWindowArray[0] )
call StartTimerBJ( udg_oTimerArray[0], false, 60.00 )
call TimerStart(udg_oTimerArray[0], 60.00, true, function income)
call CreateTimerDialogBJ( GetLastCreatedTimerBJ(), "Next Income" )
set udg_oTimerWindowArray[0] = GetLastCreatedTimerDialogBJ()
call EnableTrigger(gg_trg_InitTriggerKills)
// TexteEntfernen
set bj_forLoopAIndex = 0
set bj_forLoopAIndexEnd = 8
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call DestroyTextTagBJ( udg_IntroTexte[GetForLoopIndexA()] )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
// Commands An
call EnableTrigger( gg_trg_StartCommands )
//Write Player Death enablen
call TriggerSleepAction(10.00)
set udg_bWritePlayerDeath = true
endfunction
//===========================================================================
function InitTrig_TimerUmstellen takes nothing returns nothing
set gg_trg_TimerUmstellen = CreateTrigger( )
call TriggerAddAction( gg_trg_TimerUmstellen, function Trig_TimerUmstellen_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_UsedItem_Actions takes nothing returns nothing
local item Item = GetManipulatedItem()
if ( GetItemTypeId(Item) == 'wcyc' ) then
call UnitRemoveBuffsBJ( bj_REMOVEBUFFS_ALL, gg_unit_n03P_1047 )
else
endif
set Item = null
endfunction
//===========================================================================
function InitTrig_UsedItem takes nothing returns nothing
set gg_trg_UsedItem = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_UsedItem, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddAction( gg_trg_UsedItem, function Trig_UsedItem_Actions )
endfunction
//TESH.scrollpos=13
//TESH.alwaysfold=0
function Trig_Building_Plot_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00I' ) ) then
return false
endif
return true
endfunction
function Trig_Building_Plot_Func001Func003Func001C takes unit u returns boolean
if ( not ( GetUnitTypeId(u) == 'n026' ) ) then
return false
endif
return true
endfunction
function Trig_Building_Plot_Func001Func003C takes unit u returns boolean
if ( not ( GetUnitTypeId(u) == 'n027' ) ) then
return false
endif
return true
endfunction
function Trig_Building_Plot_Func001C takes unit u returns boolean
if ( not ( GetUnitTypeId(u) == 'n028' ) ) then
return false
endif
return true
endfunction
function Trig_Building_Plot_Actions takes nothing returns nothing
local unit uPlot = GetSpellTargetUnit()
local unit uCaster = GetTriggerUnit()
if ( Trig_Building_Plot_Func001C(uPlot) ) then
call ReplaceUnitBJ( uPlot, 'n01W', bj_UNIT_STATE_METHOD_MAXIMUM )
call SetUnitOwner( GetLastReplacedUnitBJ(), GetOwningPlayer(uCaster), true )
elseif ( Trig_Building_Plot_Func001Func003C(uPlot) ) then
call ReplaceUnitBJ( uPlot, 'n01X', bj_UNIT_STATE_METHOD_MAXIMUM )
call SetUnitOwner( GetLastReplacedUnitBJ(), GetOwningPlayer(uCaster), true )
elseif ( Trig_Building_Plot_Func001Func003Func001C(uPlot) ) then
call ReplaceUnitBJ( uPlot, 'n020', bj_UNIT_STATE_METHOD_MAXIMUM )
call SetUnitOwner( GetLastReplacedUnitBJ(), GetOwningPlayer(uCaster), true )
endif
set uPlot = null
set uCaster = null
endfunction
//===========================================================================
function InitTrig_Building_Plot takes nothing returns nothing
set gg_trg_Building_Plot = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Building_Plot, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Building_Plot, Condition( function Trig_Building_Plot_Conditions ) )
call TriggerAddAction( gg_trg_Building_Plot, function Trig_Building_Plot_Actions )
endfunction
//TESH.scrollpos=159
//TESH.alwaysfold=0
function Heroes takes unit uDie returns nothing
local integer iunit = GetUnitTypeId(uDie)
if(IsUnitType(uDie, UNIT_TYPE_HERO) == false) then
return
endif
//Helden: Zeth´arul, Dannimos, Sharrazor, Saresha, Sulfas, Morbeen
//IDs: 'Obla', 'Ucrl', 'Udre', 'Ulic', 'Ocbh', 'Ocb2'
if(iunit=='Obla' or iunit== 'Ucrl' or iunit== 'Udre' or iunit== 'Ulic' or iunit== 'Ocbh' or iunit == 'Ocb2' or iunit=='E00R') then
call RemoveUnit(uDie)
//Events
if(iunit == 'Obla' ) then
call DisplayTextToForce(udg_PlayersAll, "Zeth´arul a troll hero who has sworn to defend his people against any enemy has fallen in battle! He won´t be revived due to his acceptance of a defeat as a true warrior. His fellow soldiers remember him a swear to follow this legacy.")
call SetPlayerTechResearched(Player(1), 'Robs', 1)
endif
endif
endfunction
//Einheit entfernen
function UnitRemoven takes nothing returns nothing
call KillUnit(GetEnumUnit())
endfunction
//Sieg/Niederlage
function RemovePlayerFromLivingPlayers takes player p returns nothing
local integer iPlayer = GetPlayerId(p)
if ( udg_bPlayerAlive[GetPlayerId(p)] == false) then
return
endif
set udg_bPlayerAlive[GetPlayerId(p)] = false
set udg_iLivingPlayers = udg_iLivingPlayers -1
set udg_iLivingUnits[GetPlayerId(p)] = 0
//Fraktionsvariablen
if ( iPlayer < 3 ) then
set udg_arr_iPlayersInForce[0] = udg_arr_iPlayersInForce[0]-1
elseif ( iPlayer < 6) then
set udg_arr_iPlayersInForce[1] = udg_arr_iPlayersInForce[1]-1
elseif ( iPlayer < 8) then
set udg_arr_iPlayersInForce[2] = udg_arr_iPlayersInForce[2]-1
elseif (iPlayer < 12) then
set udg_arr_iPlayersInForce[3] = udg_arr_iPlayersInForce[3]-1
endif
//Lebende Fraktionen
if (udg_arr_iPlayersInForce[0] == 0 and udg_bForceAlive[0] == true) then
set udg_bForceAlive[0] = false
set udg_iForcesAlive = udg_iForcesAlive - 1
call DisplayTextToForce(udg_PlayersAll, "The Blulales have been defeated!")
elseif (udg_arr_iPlayersInForce[1] == 0 and udg_bForceAlive[1] == true) then
set udg_bForceAlive[1] = false
set udg_iForcesAlive = udg_iForcesAlive - 1
call DisplayTextToForce(udg_PlayersAll, "The Stranded Alliance has been defeated!")
elseif (udg_arr_iPlayersInForce[2] == 0 and udg_bForceAlive[2] == true) then
set udg_bForceAlive[2] = false
set udg_iForcesAlive = udg_iForcesAlive - 1
call DisplayTextToForce(udg_PlayersAll, "The Demon Invaders have been defeated!")
elseif (udg_arr_iPlayersInForce[3] == 0 and udg_bForceAlive[3] == true) then
set udg_bForceAlive[3] = false
set udg_iForcesAlive = udg_iForcesAlive - 1
call DisplayTextToForce(udg_PlayersAll, "The Eastern Crime Cartell has been defeated!")
endif
//Wenn nur noch eine Fraktion übrig ist
if udg_iForcesAlive == 1 then
if (udg_arr_iPlayersInForce[0] > 0) then
call DisplayTextToForce(udg_PlayersAll, "Congrats to the blulalien Armies! They have won this war!")
call ForceAddPlayer(udg_oWinningForce, Player(0))
call ForceAddPlayer(udg_oWinningForce, Player(1))
call ForceAddPlayer(udg_oWinningForce, Player(2))
elseif (udg_arr_iPlayersInForce[1] > 0) then
call DisplayTextToForce(udg_PlayersAll, "The Stranded Alliance has managed to clear their new home from it´s enemies!")
call ForceAddPlayer(udg_oWinningForce, Player(3))
call ForceAddPlayer(udg_oWinningForce, Player(4))
call ForceAddPlayer(udg_oWinningForce, Player(5))
elseif (udg_arr_iPlayersInForce[2] > 0) then
call DisplayTextToForce(udg_PlayersAll, "The Demones have purged Theosa from those weak fools. Long live the shadow!")
call ForceAddPlayer(udg_oWinningForce, Player(6))
call ForceAddPlayer(udg_oWinningForce, Player(7))
elseif (udg_arr_iPlayersInForce[3] > 0) then
call DisplayTextToForce(udg_PlayersAll, "The Eastern Crime Cartell has enslaved the other races of Theosa")
call ForceAddPlayer(udg_oWinningForce, Player(8))
call ForceAddPlayer(udg_oWinningForce, Player(9))
call ForceAddPlayer(udg_oWinningForce, Player(10))
call ForceAddPlayer(udg_oWinningForce, Player(11))
endif
call TriggerExecute(gg_trg_Abspielen)
else
call DisplayTextToForce(udg_PlayersAll, "Remaining Players " + I2S(udg_iLivingPlayers))
call DisplayTextToForce(udg_PlayersAll, "Remaining Forces " + I2S(udg_iForcesAlive))
endif
endfunction
//eigentlicherTrigger
function Trig_EinheitStirbt_Actions takes nothing returns nothing
local unit uDie = GetTriggerUnit()
local unit uKill = GetKillingUnit()
local player pTrigg = GetOwningPlayer(uDie)
local unit uErsatz
local integer iTechUnits
local location locDead = GetUnitLoc(uDie)
local group tempGroup
//ShrineOfTheSeas
if(uDie== udg_uShrineOfTheSeas) then
call CreateUnitAtLoc(GetOwningPlayer(uKill), 'h001', locDead, bj_UNIT_FACING )
set udg_uShrineOfTheSeas = GetLastCreatedUnit()
endif
//Gebäude
if ( IsUnitType(uDie, UNIT_TYPE_STRUCTURE) == true ) then
if (GetUnitPointValue(uDie) == 200 or GetUnitPointValue(uDie) == 201) then
call CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE), 'n026', locDead, bj_UNIT_FACING )
if(GetUnitPointValue(uDie) == 201) then
set udg_arr_iIncome[GetPlayerId(pTrigg)] = udg_arr_iIncome[GetPlayerId(pTrigg)] - 1
endif
endif
if ( GetUnitPointValue(uDie) == 100 ) then
call CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE), 'n027', locDead, bj_UNIT_FACING )
endif
if ( GetUnitPointValue(uDie) == 10 ) then
call CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE), 'n028', locDead, bj_UNIT_FACING )
endif
//Controllpoints
if ( GetUnitTypeId(uDie) == 'n024' ) then
set udg_arr_iIncome[GetPlayerId(pTrigg)] = udg_arr_iIncome[GetPlayerId(pTrigg)] - 1
if (GetOwningPlayer(uKill) != Player(PLAYER_NEUTRAL_AGGRESSIVE) ) then
call CreateUnitAtLoc(GetOwningPlayer(uKill), 'n024', locDead, bj_UNIT_FACING )
set udg_arr_iIncome[GetPlayerId(GetOwningPlayer(uKill))] = udg_arr_iIncome[GetPlayerId(GetOwningPlayer(uKill))] + 1
else
call CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE), 'n024', locDead, bj_UNIT_FACING )
endif
endif
//keine Gebäude
else
call Heroes(uDie)
if ( GetUnitTypeId(uDie) == 'u00P' ) then
//BlackHandOfficer
set uErsatz = CreateUnitAtLoc(Player(6), 'u00Q', locDead, bj_UNIT_FACING )
call SetUnitLifePercentBJ( uErsatz, 40.00 )
set udg_iMaxBlackHandOfficers = ( udg_iMaxBlackHandOfficers + 1 )
call SetPlayerTechMaxAllowedSwap( 'u00Q', udg_iMaxBlackHandOfficers, Player(6) )
set udg_iMaxBlackHandShadowFDrakes = ( udg_iMaxBlackHandShadowFDrakes + 1 )
call SetPlayerTechMaxAllowedSwap( 'u00O', udg_iMaxBlackHandShadowFDrakes, Player(6) )
//Der Officer soll nicht zum Rallypoint der CommandUnit gehen
call TriggerSleepAction(0.1)
call IssueImmediateOrder(uErsatz, "stop")
endif
endif
if GetPlayerId(pTrigg) < 12 then
if ((GetUnitPointValue(uDie) != 93) and (GetUnitPointValue(uDie) != 96) ) then
set udg_iLivingUnits[GetPlayerId(pTrigg)] = udg_iLivingUnits[GetPlayerId(pTrigg)]-1
endif
set tempGroup = GetUnitsInRectOfPlayer(gg_rct_UnitCache, pTrigg)
//Specific number of Techunits + AllUnits in UnitCache - 3 Techunits that are always there
set iTechUnits = udg_iTechUnits[GetPlayerId(pTrigg)]+ CountUnitsInGroup(tempGroup) - 3
call DestroyGroup(tempGroup)
if (udg_iLivingUnits[GetPlayerId(pTrigg)] == iTechUnits) then
//If a playerslot is empty then the chat shouldn´t get spammed
if(udg_bWritePlayerDeath) then
call DisplayTextToForce(udg_PlayersAll, GetPlayerName(pTrigg) + "´s armies have been defeated." )
endif
call RemovePlayerFromLivingPlayers(pTrigg)
set tempGroup = GetUnitsInRectOfPlayer(GetPlayableMapRect(), pTrigg)
call ForGroupBJ(tempGroup, function UnitRemoven )
call DestroyGroup(tempGroup)
endif
endif
//remove local variables
set uDie = null
set uKill = null
set pTrigg = null
set uErsatz = null
call RemoveLocation(locDead)
set locDead = null
endfunction
//===========================================================================
function InitTrig_EinheitStirbtUndSiegBedingung takes nothing returns nothing
set gg_trg_EinheitStirbtUndSiegBedingung = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_EinheitStirbtUndSiegBedingung, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_EinheitStirbtUndSiegBedingung, function Trig_EinheitStirbt_Actions )
endfunction
//TESH.scrollpos=27
//TESH.alwaysfold=0
function Trig_UpgradeStarted_Actions takes nothing returns nothing
local unit uTrigg = GetTriggerUnit()
local player pTrigg = GetOwningPlayer(uTrigg)
local integer iTech = GetResearched()
//Elf Upgrades
if ( GetUnitTypeId(uTrigg) == 'n03C' ) then
if(GetUnitState(uTrigg, UNIT_STATE_MANA) >= 3) then
call SetUnitState(uTrigg, UNIT_STATE_MANA, GetUnitState(uTrigg, UNIT_STATE_MANA)-3)
else
call IssueImmediateOrderById(uTrigg, 851976)
call DisplayTextToPlayer(pTrigg,0,0, "Not enough mana. The unit needs more mana to start the research")
endif
//Dwarve Upgrades
elseif (GetUnitTypeId(uTrigg) == 'n03D') then
//DarkArmor
if(iTech == 'Rora') then
call SetPlayerTechMaxAllowed(pTrigg,'Roar',0)
call SetPlayerTechMaxAllowed(pTrigg,'Rosp',0)
//Heavy Armor
elseif(iTech == 'Roar') then
call SetPlayerTechMaxAllowed(pTrigg,'Rora',0)
call SetPlayerTechMaxAllowed(pTrigg,'Rosp',0)
//Earthen Weapons
elseif(iTech == 'Rosp') then
call SetPlayerTechMaxAllowed(pTrigg,'Roar',0)
call SetPlayerTechMaxAllowed(pTrigg,'Rora',0)
endif
endif
set uTrigg = null
set pTrigg = null
endfunction
//===========================================================================
function InitTrig_UpgradeStarted takes nothing returns nothing
set gg_trg_UpgradeStarted = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_UpgradeStarted, EVENT_PLAYER_UNIT_RESEARCH_START )
call TriggerAddAction( gg_trg_UpgradeStarted, function Trig_UpgradeStarted_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_Upgrade_Stopped_Actions takes nothing returns nothing
local unit uTrigg = GetTriggerUnit()
local player pTrigg = GetOwningPlayer(uTrigg)
local integer iTech = GetResearched()
//Dwarves
if (GetUnitTypeId(uTrigg) == 'n03D') then
//DarkArmor
if(iTech == 'Rora') then
call SetPlayerTechMaxAllowed(pTrigg,'Roar',1)
call SetPlayerTechMaxAllowed(pTrigg,'Rosp',1)
//Heavy Armor
elseif(iTech == 'Roar') then
call SetPlayerTechMaxAllowed(pTrigg,'Rora',1)
call SetPlayerTechMaxAllowed(pTrigg,'Rosp',1)
//Earthen Weapons
elseif(iTech == 'Rosp') then
call SetPlayerTechMaxAllowed(pTrigg,'Roar',1)
call SetPlayerTechMaxAllowed(pTrigg,'Rora',1)
endif
endif
set uTrigg = null
set pTrigg = null
endfunction
//===========================================================================
function InitTrig_Upgrade_Stopped takes nothing returns nothing
set gg_trg_Upgrade_Stopped = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Upgrade_Stopped, EVENT_PLAYER_UNIT_RESEARCH_CANCEL )
call TriggerAddAction( gg_trg_Upgrade_Stopped, function Trig_Upgrade_Stopped_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Upgrade_Finished_Actions takes nothing returns nothing
local integer iTech = GetResearched()
local unit uTrigg = GetResearchingUnit()
local player pTrigg = GetOwningPlayer(uTrigg)
//Longship Dock
if ( iTech == 'Rowd' and GetPlayerTechCount(pTrigg, iTech,true) == 2) then
call SetPlayerTechMaxAllowed(pTrigg, 'oalt', 2)
//Enhanced Manifestation + Waves of Energy
elseif( iTech == 'R04E') then
call SetPlayerTechMaxAllowed(pTrigg, 'R04F', 1)
endif
set uTrigg = null
set pTrigg = null
endfunction
//===========================================================================
function InitTrig_Upgrade_Finished takes nothing returns nothing
set gg_trg_Upgrade_Finished = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Upgrade_Finished, EVENT_PLAYER_UNIT_RESEARCH_FINISH )
call TriggerAddAction( gg_trg_Upgrade_Finished, function Trig_Upgrade_Finished_Actions )
endfunction
//TESH.scrollpos=48
//TESH.alwaysfold=0
function Trig_EinheitSpawnt_Actions takes nothing returns nothing
local unit uTrigg = GetTriggerUnit()
local player pTrigg = GetOwningPlayer(uTrigg)
local integer iUnit = GetUnitTypeId(uTrigg)
local integer iRandom
local location tempLoc
//Variables
//Update number of living units unless the unit is a unitgroup or a spelldummy
if (GetPlayerId(pTrigg) < 12 and not( GetUnitPointValue(uTrigg) == 93 or GetUnitPointValue(uTrigg) == 96)) then
set udg_iLivingUnits[GetPlayerId(pTrigg)] = udg_iLivingUnits[GetPlayerId(pTrigg)] + 1
endif
//If the unit is created by merging 2 units then update the number of living units
if (GetUnitPointValue(uTrigg) == 94) then
//Es wird ein Spawn-Event ausgelöst; Bsp: Offizier
set udg_iLivingUnits[GetPlayerId(pTrigg)] = udg_iLivingUnits[GetPlayerId(pTrigg)] - 2
endif
// Zum Rallypoint bewegen
// AlleEinheiten
//If the rallypoint for all units is set and when the point value is at least 97 which excludes
//Spelldummies, Workers and units that a composed by lower units
if ( udg_bRallypointForEverybody[GetPlayerId(pTrigg)] and GetUnitPointValue(uTrigg) >= 97) then
call TriggerSleepAction( 1.50 )
call IssuePointOrderLocBJ( uTrigg, "attack", udg_oRallypointOfTrainsAndAll[GetPlayerId(pTrigg)] )
else
// only trained units have an order
if ( udg_bRallypointForTrainedUnits[GetPlayerId(pTrigg)] and GetUnitPointValue(uTrigg) >= 99) then
call TriggerSleepAction( 1.50 )
call IssuePointOrderLocBJ( uTrigg, "attack", udg_oRallypointOfTrainsAndAll[GetPlayerId(pTrigg)] )
else
// only summoned units have an order
if ( udg_bRallypointForSummoned[GetPlayerId(pTrigg)] and GetUnitPointValue(uTrigg) == 97) then
call TriggerSleepAction( 1.50 )
call IssuePointOrderLocBJ( uTrigg, "attack", udg_oRallypointOfSummoned[GetPlayerId(pTrigg)] )
endif
endif
endif
// Optisches
if ( iUnit== 'n03R' or iUnit == 'n023' ) then
call TriggerSleepAction(1.5)
call SetUnitOwner( uTrigg, Player(PLAYER_NEUTRAL_PASSIVE), true )
call SetUnitLifePercentBJ( uTrigg, 100 )
elseif((GetUnitTypeId(uTrigg)== 'ucs3') or (GetUnitTypeId(uTrigg)=='ugrm')) then
call SetUnitVertexColor(uTrigg, 100, 100,100, 70)
endif
//Check if unit has Siege Precision
if( GetUnitAbilityLevel(uTrigg, 'A0E4') == 1 ) then
call UnitRemoveAbility(uTrigg, 'A0E4')
call UnitAddAbility(uTrigg, 'ANic')
if(IsUnitType(uTrigg, UNIT_TYPE_MECHANICAL) == false) then
call SetUnitAbilityLevel(uTrigg, 'ANic', 2)
endif
endif
// In Gruppen trainierte Einheiten ============================================
// Sind wie Hydra Hatchlings behandelt (beschworen) -> müssen ersetzt werden, damit es Leichen gibt
if ( GetUnitPointValue(uTrigg) == 99 ) then
call TriggerSleepAction( 0.30 )
if IsUnitType(uTrigg, UNIT_TYPE_UNDEAD) then
set uTrigg = ReplaceUnitBJ( uTrigg, GetUnitTypeId(uTrigg), bj_UNIT_STATE_METHOD_RELATIVE )
call UnitRemoveTypeBJ( UNIT_TYPE_UNDEAD, uTrigg )
//werden gespawnt -> Variable +1 -> Ersetzen -> Variable +1 -> Variable -1
set udg_iLivingUnits[GetPlayerId(pTrigg)] = udg_iLivingUnits[GetPlayerId(pTrigg)] - 1
endif
endif
// Bluelales
if ( iUnit == 'n03L' ) then
set tempLoc = GetUnitLoc(uTrigg)
call IssuePointOrderLocBJ( uTrigg, "selfdestruct", tempLoc)
call RemoveLocation(tempLoc)
elseif ( iUnit == 'ucs1' ) then
call TriggerSleepAction( 2 )
call RemoveUnit( uTrigg )
//Knorr
elseif (iUnit == 'odes') then
call TriggerSleepAction(2.0)
call SetUnitOwner(uTrigg, Player(PLAYER_NEUTRAL_PASSIVE), false)
set tempLoc = GetUnitLoc(uTrigg)
call IssuePointOrderLoc(uTrigg, "move", PolarProjectionBJ(tempLoc, 10000, AngleBetweenPoints(GetRectCenter(GetPlayableMapRect()), tempLoc)))
call RemoveLocation(tempLoc)
call TriggerSleepAction(20.00)
call SetUnitVertexColor(uTrigg, 100,100,100, 90)
call TriggerSleepAction(0.2)
call SetUnitVertexColor(uTrigg, 100,100,100, 80)
call TriggerSleepAction(0.2)
call SetUnitVertexColor(uTrigg, 100,100,100, 60)
call TriggerSleepAction(0.2)
call SetUnitVertexColor(uTrigg, 100,100,100, 30)
call TriggerSleepAction(0.2)
if(GetUnitState(uTrigg, UNIT_STATE_LIFE)>0) then
call RemoveUnit(uTrigg)
call DisplayTextToPlayer(pTrigg,0,0, "Your Knorr made it to the see. Soon you will receive additional income.")
call TriggerSleepAction( 60.00)
set iRandom = GetRandomInt(30, 60)
call SetPlayerState(pTrigg, PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(pTrigg, PLAYER_STATE_RESOURCE_GOLD) + iRandom)
call DisplayTextToPlayer(pTrigg,0,0, "A Knorr has returned. You receive " + I2S(iRandom) + " Gold!")
else
call DisplayTextToPlayer(pTrigg,0,0, "Your Knorr has sunken. It won´t provide you with money.")
endif
//FireswordGuardsman
elseif(iUnit == 'nfgb') then
call TriggerSleepAction (0.1)
set iRandom = GetRandomInt(0,1)
if(iRandom == 0) then
call SetUnitPosition(uTrigg, -19245, 2056)
else
call SetUnitPosition(uTrigg, -17645, 2056)
call TriggerSleepAction(0.2)
call IssuePointOrder(uTrigg, "attack", -18430.0, 2050.0)
endif
endif
// StrandedAlliance
if ( iUnit == 'n023' and IsUnitType(uTrigg, UNIT_TYPE_SUMMONED) == true ) then
call SetUnitVertexColorBJ( uTrigg, 25.00, 25.00, 100, 30.00 )
endif
// DemonInvaders
//Skelette
if ( iUnit == 'u00T' ) then
set iRandom = GetRandomInt(1, 3)
if ( iRandom == 1 ) then
call ReplaceUnitBJ( uTrigg, 'u00V', bj_UNIT_STATE_METHOD_RELATIVE )
return
elseif ( iRandom == 2 ) then
call ReplaceUnitBJ( uTrigg, 'u00S', bj_UNIT_STATE_METHOD_RELATIVE )
else
call ReplaceUnitBJ( uTrigg, 'u00U', bj_UNIT_STATE_METHOD_RELATIVE )
endif
set udg_iLivingUnits[GetPlayerId(pTrigg)] = udg_iLivingUnits[GetPlayerId(pTrigg)] - 1 // the unit is replaced
elseif (iUnit == 'o016' ) then
set tempLoc = GetUnitLoc(uTrigg)
call IssuePointOrderLocBJ( uTrigg, "stasistrap", tempLoc)
call RemoveLocation(tempLoc)
// Offiziere
elseif ( iUnit == 'u00P' ) then
set udg_iMaxBlackHandOfficers = ( udg_iMaxBlackHandOfficers - 1 )
call SetPlayerTechMaxAllowedSwap( 'u00Q', udg_iMaxBlackHandOfficers, pTrigg )
set udg_iMaxBlackHandShadowFDrakes = ( udg_iMaxBlackHandShadowFDrakes - 1 )
call SetPlayerTechMaxAllowedSwap( 'u00O', udg_iMaxBlackHandShadowFDrakes, pTrigg )
endif
// Eastern Crime Cartell
if ( iUnit == 'u010' or iUnit == 'u00Z' ) then
call SetUnitVertexColorBJ( uTrigg, 50.00, 50.00, 100, 50.00 )
endif
//Sheller Unit Training Level
if (pTrigg == Player(2)) then
if(GetPlayerTechCount(pTrigg, 'Remk', true) < 10) then
set iRandom = GetRandomInt(1,100)
if(iRandom == 20 or iRandom == 21) then
call SetPlayerTechResearched(pTrigg,'Remk', GetPlayerTechCount(pTrigg, 'Remk', true) + 1)
call DisplayTextToPlayer(pTrigg,0, 0, "You gained 1 Unit Training Point!")
endif
endif
endif
set uTrigg = null
set pTrigg = null
endfunction
//===========================================================================
function InitTrig_EinheitSpawnt takes nothing returns nothing
set gg_trg_EinheitSpawnt = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_EinheitSpawnt, GetPlayableMapRect() )
call TriggerAddAction( gg_trg_EinheitSpawnt, function Trig_EinheitSpawnt_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_UnitFinishedUpgrade_Actions takes nothing returns nothing
local unit uTrigg = GetTriggerUnit()
//Remove Undead Classification if not needed --> Sheller Training Plots
if ( IsUnitType(uTrigg, UNIT_TYPE_UNDEAD) ) then
call UnitRemoveType(uTrigg, UNIT_TYPE_UNDEAD)
endif
set uTrigg = null
endfunction
//===========================================================================
function InitTrig_UnitFinishedUpgrade takes nothing returns nothing
set gg_trg_UnitFinishedUpgrade = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_UnitFinishedUpgrade, EVENT_PLAYER_UNIT_UPGRADE_FINISH )
call TriggerAddAction( gg_trg_UnitFinishedUpgrade, function Trig_UnitFinishedUpgrade_Actions )
endfunction
//TESH.scrollpos=24
//TESH.alwaysfold=0
function Trig_StartCommands_Func001Func001A takes nothing returns nothing
local unit uEnum
if ( RectContainsUnit(gg_rct_Classifications, uEnum) or RectContainsUnit(gg_rct_UnitCache, uEnum) ) then
call KillUnit( uEnum )
endif
set uEnum = null
endfunction
function Trig_StartCommands_Func001C takes string sTrigg returns boolean
if ( not ( sTrigg == "- give up" ) ) then
return false
endif
return true
endfunction
function UnitsZaehlen takes player pTrigg returns nothing
local integer i = 0
local force tempforce
set tempforce = GetForceOfPlayer(pTrigg)
loop
call DisplayTextToForce(tempforce, GetPlayerName(Player(i)) + ": " + I2S(udg_iLivingUnits[i]) + " units alive")
set i = i+1
exitwhen i == 12
endloop
call DestroyForce(tempforce)
endfunction
function Trig_StartCommands_Actions takes nothing returns nothing
local player pTrigg = GetTriggerPlayer()
local string sTrigg = GetEventPlayerChatString()
local integer ic
if ( Trig_StartCommands_Func001C(sTrigg) ) then
call ForGroup( GetUnitsInRectOfPlayer(GetPlayableMapRect(), pTrigg), function Trig_StartCommands_Func001Func001A )
call TriggerSleepAction( 2 )
call CustomDefeatBJ( pTrigg, "You´ve been defeated!" )
elseif (sTrigg == "- count") then
call UnitsZaehlen(pTrigg)
elseif (SubString(sTrigg, 0, 6) == "- zoom") then
set ic = S2I(SubString(sTrigg, 7, StringLength(sTrigg)))
//Limits
if (ic > 3000) then
set ic = 3000
elseif (ic < 1000) then
set ic = 1000
endif
call SetCameraFieldForPlayer(pTrigg, CAMERA_FIELD_TARGET_DISTANCE, ic, 1.0)
endif
set pTrigg = null
endfunction
//===========================================================================
function InitTrig_StartCommands takes nothing returns nothing
set gg_trg_StartCommands = CreateTrigger( )
call DisableTrigger( gg_trg_StartCommands )
call TriggerRegisterPlayerChatEvent( gg_trg_StartCommands, Player(0), "-", false )
call TriggerRegisterPlayerChatEvent( gg_trg_StartCommands, Player(1), "-", false )
call TriggerRegisterPlayerChatEvent( gg_trg_StartCommands, Player(2), "-", false )
call TriggerRegisterPlayerChatEvent( gg_trg_StartCommands, Player(3), "-", false )
call TriggerRegisterPlayerChatEvent( gg_trg_StartCommands, Player(4), "-", false )
call TriggerRegisterPlayerChatEvent( gg_trg_StartCommands, Player(5), "-", false )
call TriggerRegisterPlayerChatEvent( gg_trg_StartCommands, Player(6), "-", false )
call TriggerRegisterPlayerChatEvent( gg_trg_StartCommands, Player(7), "-", false )
call TriggerRegisterPlayerChatEvent( gg_trg_StartCommands, Player(8), "-", false )
call TriggerRegisterPlayerChatEvent( gg_trg_StartCommands, Player(9), "-", false )
call TriggerRegisterPlayerChatEvent( gg_trg_StartCommands, Player(10), "-", false )
call TriggerRegisterPlayerChatEvent( gg_trg_StartCommands, Player(11), "-", false )
call TriggerAddAction( gg_trg_StartCommands, function Trig_StartCommands_Actions )
endfunction
//TESH.scrollpos=27
//TESH.alwaysfold=0
function EndlessActions takes nothing returns nothing
local location temploc = GetRectCenter(gg_rct_endless)
call IssuePointOrderLocBJ( GetEnumUnit(), "move", temploc )
call RemoveLocation(temploc)
endfunction
function LongActions takes nothing returns nothing
local location temploc = GetRectCenter(gg_rct_2h)
call IssuePointOrderLocBJ( GetEnumUnit(), "move", temploc )
call RemoveLocation(temploc)
endfunction
function MediumActions takes nothing returns nothing
local location temploc = GetRectCenter(gg_rct_1h30min)
call IssuePointOrderLocBJ( GetEnumUnit(), "move", temploc )
call RemoveLocation(temploc)
endfunction
function ShortActions takes nothing returns nothing
local location temploc = GetRectCenter(gg_rct_1h)
call IssuePointOrderLocBJ( GetEnumUnit(), "move", temploc )
call RemoveLocation(temploc)
endfunction
function VeryShortActions takes nothing returns nothing
local location temploc = GetRectCenter(gg_rct_30min)
call IssuePointOrderLocBJ( GetEnumUnit(), "move", temploc )
call RemoveLocation(temploc)
endfunction
function InstantSDActions takes nothing returns nothing
local location temploc = GetRectCenter(gg_rct_15s)
call IssuePointOrderLocBJ( GetEnumUnit(), "move", temploc )
call RemoveLocation(temploc)
endfunction
function IntroActions takes nothing returns nothing
local location temploc = GetRectCenter(gg_rct_Intro)
call IssuePointOrderLocBJ( GetEnumUnit(), "move", temploc )
call RemoveLocation(temploc)
endfunction
function NoIntroActions takes nothing returns nothing
local location temploc = GetRectCenter(gg_rct_NoIntro)
call IssuePointOrderLocBJ( GetEnumUnit(), "move", temploc )
call RemoveLocation(temploc)
endfunction
function Trig_Testvote_Actions takes nothing returns nothing
local group groupSD = GetUnitsInRectAll(gg_rct_SuddenDeathWahl)
local group groupIntro = GetUnitsInRectAll(gg_rct_VoteForIntro)
if ( GetEventPlayerChatString() == "- vote very short" ) then
call ForGroupBJ(groupSD , function VeryShortActions )
elseif ( GetEventPlayerChatString() == "- vote medium" ) then
call ForGroupBJ( groupSD, function MediumActions )
elseif ( GetEventPlayerChatString() == "- vote endless" ) then
call ForGroupBJ( groupSD, function EndlessActions)
elseif ( GetEventPlayerChatString() == "- vote short" ) then
call ForGroupBJ( groupSD, function ShortActions)
elseif ( GetEventPlayerChatString() == "- vote long" ) then
call ForGroupBJ( groupSD, function LongActions )
elseif ( GetEventPlayerChatString() == "- vote instant SD") then
call ForGroupBJ( groupSD, function InstantSDActions )
endif
if ( GetEventPlayerChatString() == "- vote nointro" ) then
call ForGroupBJ( groupIntro, function NoIntroActions )
elseif ( GetEventPlayerChatString() == "- vote intro" ) then
call ForGroupBJ( groupIntro, function IntroActions )
endif
call DestroyGroup(groupSD)
call DestroyGroup(groupIntro)
endfunction
//===========================================================================
function InitTrig_Testvote takes nothing returns nothing
set gg_trg_Testvote = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Testvote, Player(0), "- vote", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Testvote, Player(1), "- vote", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Testvote, Player(2), "- vote", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Testvote, Player(3), "- vote", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Testvote, Player(4), "- vote", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Testvote, Player(5), "- vote", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Testvote, Player(6), "- vote", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Testvote, Player(7), "- vote", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Testvote, Player(8), "- vote", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Testvote, Player(9), "- vote", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Testvote, Player(10), "- vote", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Testvote, Player(11), "- vote", false )
call TriggerAddAction( gg_trg_Testvote, function Trig_Testvote_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_AllianceSkills_Actions takes nothing returns nothing
local unit uTrigg = GetTriggerUnit()
local unit uTarget = GetSpellTargetUnit()
local player pTrigg = GetOwningPlayer(uTrigg)
local integer iAbility = GetSpellAbilityId()
local unit uErsatz
local unit uErsatzI
local integer ic = 0
local real rc = 0.00
local location loc = GetSpellTargetLoc()
local location temploc
// Humans And Zegol =======================================
if ( pTrigg == Player(3) ) then
//Weakening Strike
if (iAbility == 'A081') then
set temploc = GetUnitLoc(uTrigg)
set uErsatz = CreateUnitAtLoc( Player(GetPlayerId(GetOwningPlayer(uTrigg))), 'h00I', temploc, bj_UNIT_FACING )
call RemoveLocation(temploc)
call UnitAddAbility(uErsatz, 'A082')
call IssueTargetOrder( uErsatz, "faeriefire", uTarget )
return
endif
//ArcanumGun
if ( iAbility == 'A07L' ) then
call TriggerSleepAction( 0.25 )
set temploc = GetUnitLoc(uTrigg)
set uErsatz = CreateUnitAtLoc(Player(3), 'h00I', temploc, bj_UNIT_FACING )
call RemoveLocation(temploc)
call UnitAddAbility(uErsatz, 'A01K' )
call IssueTargetOrder( uErsatz, "chainlightning", uTarget )
else
//Charge
if ( iAbility == 'A07T' ) then
set uTrigg = ReplaceUnitBJ(uTrigg, 'h004', bj_UNIT_STATE_METHOD_RELATIVE )
set temploc = GetRandomLocInRect(gg_rct_UnitCache)
set uErsatz = CreateUnitAtLoc(Player(3), 'hdhw', temploc, bj_UNIT_FACING ) //Hilfseinheit für das Limit der Knights
call RemoveLocation(temploc)
loop
call TriggerSleepAction( 0.50 )
set ic = ic+1
set temploc = GetUnitLoc(uTrigg)
call IssuePointOrderLoc( uTrigg, "move", PolarProjectionBJ(temploc, 750.00, GetUnitFacing(uTrigg)) )
set uErsatzI = CreateUnitAtLoc(Player(3), 'h00I', temploc, bj_UNIT_FACING )
call RemoveLocation(temploc)
call UnitAddAbility(uErsatzI, 'A09C' )
call IssueImmediateOrder( uErsatzI, "stomp" )
exitwhen ic == 10
endloop
call RemoveUnit(uErsatz)
call ReplaceUnitBJ(uTrigg, 'hdhw', bj_UNIT_STATE_METHOD_RELATIVE )
return
//Light´s Protection
elseif ( iAbility == 'A07X' or iAbility == 'A09R') then
call UnitAddAbility(uTarget, 'A07Y' )
call TriggerSleepAction( 15.00 )
call UnitRemoveAbility(uTarget, 'A07Y' )
return
endif
endif
else
endif
// Dwarves ================================================
if ( pTrigg == Player(4) ) then
//StunningRock
if ( iAbility == 'A06V' ) then
call TriggerSleepAction( 0.50 )
set temploc = GetUnitLoc(uTarget)
set uErsatz = CreateUnitAtLoc(Player(4), 'h00I', temploc, bj_UNIT_FACING )
call RemoveLocation(temploc)
call UnitAddAbility(uErsatz, 'A06W' )
call IssueImmediateOrder( uErsatz, "stomp" )
//Offensive und Defensive Strategy
elseif (iAbility == 'A0A7') then
//auf Protector´s Aura setzen
if (udg_bCommanderOTGStrategy) then
set udg_bCommanderOTGStrategy = false
call UnitAddAbility(uTrigg, 'A0A9')
call SetUnitAbilityLevel(uTrigg, 'A0A9', GetUnitAbilityLevel(uTrigg,'A0A7'))
call UnitRemoveAbility(uTrigg, 'A0A8')
else
set udg_bCommanderOTGStrategy = true
call UnitAddAbility(uTrigg, 'A0A8')
call SetUnitAbilityLevel(uTrigg, 'A0A8', GetUnitAbilityLevel(uTrigg,'A0A7'))
call UnitRemoveAbility(uTrigg, 'A0A9')
endif
//Earthwrath
elseif (iAbility == 'A0AD') then
set temploc = GetUnitLoc(uTrigg)
set uErsatz = CreateUnitAtLoc(pTrigg, 'h00I', temploc,0)
call UnitAddAbility(uErsatz,'A0AE')
call SetUnitPositionLoc(uErsatz, PolarProjectionBJ(temploc, 350.0, GetUnitFacing(uTrigg)))
call TriggerSleepAction(0.2)
call IssueImmediateOrder(uErsatz, "stomp")
set uErsatzI = CreateUnitAtLoc(pTrigg, 'h00I', temploc,0)
call UnitAddAbility(uErsatzI,'A0AE')
call SetUnitPositionLoc(uErsatzI, PolarProjectionBJ(temploc, 550.0, GetUnitFacing(uTrigg)))
call TriggerSleepAction(0.2)
call IssueImmediateOrder(uErsatzI, "stomp")
call RemoveLocation(temploc)
//Rescue
elseif (iAbility == 'A0AU') then
call SetUnitInvulnerable(uTarget, true)
call TriggerSleepAction(0.5*GetUnitAbilityLevel(uTrigg, 'A0AU'))
call SetUnitInvulnerable(uTarget, false)
endif
endif
// Elves ==================================================
if ( pTrigg == Player(5) ) then
//WavesOfDestruction
if (iAbility == 'A01O') then
set loc = GetUnitLoc(uTarget)
loop
set ic = ic + 1
set uErsatz = CreateUnitAtLoc(pTrigg, 'h002', PolarProjectionBJ(loc, 400.00, rc), rc + 180.00 )
call UnitAddAbility(uErsatz, 'A0CI')
call IssuePointOrderLoc(uErsatz, "carrionswarm", loc)
//Die Einheit soll sterben, aber, hoffentlich, genug Zeit haben um zu casten
// und der gesamte Skill soll schnell ablaufen
call UnitAddAbility(uErsatz, 'A025')
call SetUnitState(uErsatz, UNIT_STATE_LIFE, RMaxBJ(0, 15))
call TriggerSleepAction( 0.10)
set rc = rc + 60.0
exitwhen ic == 18
endloop
//Rise of Nature
elseif(iAbility == 'A0D8' ) then
call SetPlayerTechResearched(pTrigg, 'Redt', GetPlayerTechCount(pTrigg, 'Redt', true)-2)
set uErsatz = CreateUnitAtLoc(pTrigg, 'edcm', loc, 270)
call IssueImmediateOrder(uErsatz, "spiritwolf")
call TriggerSleepAction(55.0)
call KillUnit(uErsatz)
//Increase Health of the Forest
elseif(iAbility == 'ACr1') then
if(GetPlayerTechCount(pTrigg,'Redt',true) <4)then
call AddPlayerTechResearched(pTrigg, 'Redt', 1)
call DisplayTextToPlayer(pTrigg, 0, 0, "Level of Health of the Forest: " + I2S(GetPlayerTechCount(pTrigg,'Redt',true)))
else
call AddPlayerTechResearched(pTrigg, 'Redt', 1)
call UnitRemoveAbility(uTrigg, 'ACr1')
call DisplayTextToPlayer(pTrigg, 0, 0, "Level of Health of the Forest: " + I2S(GetPlayerTechCount(pTrigg,'Redt',true)) + "(maxed)")
endif
endif
endif
set uTrigg = null
set uTarget = null
set pTrigg = null
set uErsatz = null
set uErsatzI = null
call RemoveLocation(loc)
set loc = null
set temploc = null
endfunction
//===========================================================================
function InitTrig_AllianceSkills takes nothing returns nothing
set gg_trg_AllianceSkills = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AllianceSkills, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AllianceSkills, Player(4), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AllianceSkills, Player(5), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_AllianceSkills, function Trig_AllianceSkills_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Autocasts_Actions takes nothing returns nothing
local unit uTrigg = GetTriggerUnit()
local player pTrigg = GetOwningPlayer(uTrigg)
local unit uErsatz
local unit uTarget = GetSpellTargetUnit()
local integer iAbility = GetSpellAbilityId()
local location temploc
local unit tempunit
local group tempgroup
//Shieldbreaker
if ( iAbility == 'A03R' or iAbility == 'A02Z' ) then
set temploc = GetUnitLoc(uTrigg)
set uErsatz = CreateUnitAtLoc(Player(GetPlayerId(pTrigg)), 'h00I', temploc, bj_UNIT_FACING )
call RemoveLocation(temploc)
call UnitAddAbility(uErsatz, 'A033' )
call IssueTargetOrder( uErsatz, "faeriefire", uTarget )
endif
endfunction
//===========================================================================
function InitTrig_Autocasts takes nothing returns nothing
set gg_trg_Autocasts = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Autocasts, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddAction( gg_trg_Autocasts, function Trig_Autocasts_Actions )
endfunction
//TESH.scrollpos=167
//TESH.alwaysfold=0
function HuntersWebCheck takes nothing returns boolean
return ( IsUnitAlly(GetEnumUnit(), Player(2)) == false )
endfunction
function HuntersWebAction takes unit target, location loc returns nothing
local unit tempunit
set tempunit = CreateUnitAtLoc(Player(2), 'h00I', loc, bj_UNIT_FACING )
call UnitAddAbility(tempunit, 'A02H' )
call IssueTargetOrder( tempunit, "ensnare", target )
endfunction
function Trig_Blulales_Skills_Actions takes nothing returns nothing
local integer ic = 0
local real rc = 0.0
local unit uTrigg = GetTriggerUnit()
local player pTrigg = GetOwningPlayer(uTrigg)
local unit uErsatz
local unit uTarget = GetSpellTargetUnit()
local integer iAbility = GetSpellAbilityId()
local location oLocation = GetSpellTargetLoc()
local location temploc
local unit tempunit
local group tempgroup
//allgemeineSkills =================================================================================================================
//DefendersWill
if (iAbility == 'A030') then
call UnitAddAbility(uTrigg, 'A07E')
call TriggerSleepAction(15.00)
call UnitRemoveAbility(uTrigg,'A07E')
endif
// Carras Skills==============================================================================================
if ( pTrigg == Player(0) ) then
//SplintedBlade
if ( iAbility == 'A03I' ) then
set temploc = GetUnitLoc(uTrigg)
set uErsatz = CreateUnitAtLoc(Player(0), 'ucs1', temploc, bj_UNIT_FACING )
call SetUnitPositionLoc( uErsatz, PolarProjectionBJ(temploc, 250.00, ( GetUnitFacing(uTrigg) + 90.00 )) )
call IssueTargetOrder( uErsatz, "attack", uTarget )
set uErsatz = CreateUnitAtLoc(Player(0), 'ucs1', GetUnitLoc(uTrigg), bj_UNIT_FACING )
call SetUnitPositionLoc( uErsatz, PolarProjectionBJ(GetUnitLoc(uTrigg), 250.00, ( GetUnitFacing(uTrigg) - 90.00 )) )
call IssueTargetOrder( uErsatz, "attack", uTarget )
return
//Charge, Lieutenant
elseif ( iAbility == 'A03X' ) then
call TriggerSleepAction(0.2)
set uTrigg = ReplaceUnitBJ(uTrigg, 'ucs2', bj_UNIT_STATE_METHOD_RELATIVE )
set temploc = GetRandomLocInRect(gg_rct_UnitCache)
set uErsatz = CreateUnitAtLoc( Player(0), 'uabo', temploc, bj_UNIT_FACING ) //Hilfseinheit für das Limit der Lieutenants
call RemoveLocation(temploc)
loop
call TriggerSleepAction( 0.50 )
set temploc = GetUnitLoc(uTrigg)
call IssuePointOrderLocBJ( uTrigg, "move", PolarProjectionBJ(temploc, 500.00, GetUnitFacing(uTrigg)) )
set tempunit = CreateUnitAtLoc(pTrigg, 'h00I', temploc, bj_UNIT_FACING )
call RemoveLocation(temploc)
call UnitAddAbility(tempunit, 'A09C' )
call IssueImmediateOrder( tempunit, "stomp" )
exitwhen ic == 10
set ic = ic+1
endloop
call RemoveUnit(uErsatz)
call ReplaceUnitBJ(uTrigg, 'uabo', bj_UNIT_STATE_METHOD_RELATIVE )
return
//Warrior´s Challenge
elseif ( iAbility == 'A0BO') then
call UnitAddAbility(uTrigg, 'A07E')
call SetUnitAbilityLevel(uTrigg, 'A07E', GetUnitAbilityLevel(uTrigg, 'A0BO') )
call TriggerSleepAction(10.0)
call UnitRemoveAbility(uTrigg, 'A07E')
//Honorseeking Sword
elseif (iAbility == 'A0BQ') then
set uErsatz = CreateUnitAtLoc(pTrigg, 'h00I', oLocation, bj_UNIT_FACING )
call UnitAddAbility(uErsatz, 'A0BS')
call UnitAddAbility(uErsatz, 'A0BT')
call UnitAddAbility(uErsatz, 'A0CO')
call IssueTargetOrder(uErsatz, "rejuvination", uTrigg)
call SetUnitMoveSpeed(uErsatz, 0.00)
endif
endif
// TrollSkills =======================================================================================================================
if ( pTrigg == Player(1) ) then
//BlizzardAssault
if ( iAbility == 'A037' ) then
call TriggerSleepAction( 0.25 )
call UnitAddAbility(uTrigg, 'A038' )
set uTrigg = ReplaceUnitBJ( uTrigg, 'e00L', bj_UNIT_STATE_METHOD_RELATIVE )
loop
call TriggerSleepAction( 0.50 )
set temploc = GetUnitLoc(uTrigg)
call IssuePointOrderLoc( uTrigg, "move", PolarProjectionBJ(temploc, 750.00, GetUnitFacing(uTrigg)) )
set tempunit = CreateUnitAtLoc(Player(1), 'h00I', temploc, bj_UNIT_FACING )
call RemoveLocation(temploc)
call UnitAddAbility(tempunit, 'A039' )
call IssueImmediateOrder( tempunit, "stomp" )
exitwhen ic == 10
set ic = ic+1
endloop
call TriggerSleepAction( 0.25 )
call ReplaceUnitBJ( uTrigg, 'e00K', bj_UNIT_STATE_METHOD_RELATIVE )
return
//Frozen Explosion
elseif (iAbility == 'A0AK') then
set oLocation = GetUnitLoc(uTrigg)
set tempunit = CreateUnitAtLoc(pTrigg, 'h00I', oLocation, bj_UNIT_FACING )
call UnitAddAbility(tempunit, 'A0AM')
call IssueTargetOrder(tempunit, "frostnova", uTrigg) //has the tempunit or the triggerunit to cast?
loop
exitwhen ic == 6
set uErsatz = CreateUnitAtLoc(pTrigg, 'h00I', oLocation, bj_UNIT_FACING)
call SetUnitPositionLoc(uErsatz, PolarProjectionBJ(oLocation, 300.0, rc))
call UnitAddAbility(uErsatz, 'A0AM')
set temploc = GetUnitLoc(uErsatz)
set tempunit = CreateUnitAtLoc(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'h01Q', temploc, bj_UNIT_FACING )
call IssueTargetOrder(uErsatz, "frostnova", tempunit)
call RemoveLocation(temploc)
set rc = rc + 60
set ic = ic+1
endloop
endif
else
endif
// Sheller Skills==============================================================================================
if ( pTrigg == Player(2) ) then
//SpiritWater
if ( iAbility == 'A02B' ) then
set temploc = GetUnitLoc(uTrigg)
set tempunit = CreateUnitAtLoc(Player(2), 'h00I', temploc, bj_UNIT_FACING )
call RemoveLocation(temploc)
call UnitAddAbility(tempunit, 'A02C' )
call IssueTargetOrder( tempunit, "healingwave", uTarget )
//BladeWindProtection
elseif ( iAbility == 'A028' ) then
call UnitAddAbility(uTarget, 'A029' )
call TriggerSleepAction(10.00)
call UnitRemoveAbility(uTarget, 'A029')
//Freeze
elseif ( iAbility == 'A023' ) then
set temploc = GetUnitLoc(uTrigg)
set tempunit = CreateUnitAtLoc(Player(2), 'h00I', temploc, bj_UNIT_FACING )
call RemoveLocation(temploc)
call UnitAddAbility(tempunit, 'A024')
call IssueTargetOrder( tempunit, "creepthunderbolt", uTarget )
//Hunter´sWeb
elseif ( iAbility == 'A02G' ) then
set tempgroup = GetUnitsInRangeOfLocMatching(200.00, oLocation, Condition(function HuntersWebCheck))
loop
exitwhen CountUnitsInGroup(tempgroup) == 0
set temploc = GetUnitLoc(GetTriggerUnit())
call HuntersWebAction(FirstOfGroup(tempgroup), temploc)
call RemoveLocation(temploc)
call GroupRemoveUnit(tempgroup, FirstOfGroup(tempgroup))
endloop
call DestroyGroup(tempgroup)
//Stormstrike
elseif( iAbility == 'A0D5') then
set temploc = GetUnitLoc(uTrigg)
set tempunit = CreateUnitAtLoc(Player(2), 'h00I', temploc, bj_UNIT_FACING )
call RemoveLocation(temploc)
call UnitAddAbility(tempunit, 'A0D6')
call IssueTargetOrder(tempunit, "shockwave", uTarget)
endif
//Spellpower-Level
if(GetPlayerTechCount(pTrigg, 'Resw', true) < 10) then
set ic = GetRandomInt(0, 100)
if(ic <= 3) then
call SetPlayerTechResearched(pTrigg,'Resw', GetPlayerTechCount(pTrigg,'Resw',true) +1 )
call DisplayTextToPlayer(pTrigg, 0, 0, "You gained 1 Spellpower Point!")
endif
endif
endif
set uTrigg = null
set pTrigg = null
set uErsatz = null
set uTarget = null
call RemoveLocation(oLocation)
set oLocation = null
set tempgroup = null
set temploc = null
set tempunit = null
endfunction
//===========================================================================
function InitTrig_Blulales_Skills takes nothing returns nothing
set gg_trg_Blulales_Skills = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Blulales_Skills, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Blulales_Skills, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Blulales_Skills, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_Blulales_Skills, function Trig_Blulales_Skills_Actions )
endfunction
//TESH.scrollpos=223
//TESH.alwaysfold=0
function RiotCondition takes nothing returns boolean
local force tempforce = GetPlayersAllies(Player(8))
local boolean result = GetBooleanOr( GetPlayerController(Player(9)) == MAP_CONTROL_USER , GetOwningPlayer(GetTriggerUnit()) == ForcePickRandomPlayer(tempforce) )
call DestroyForce(tempforce)
return result
endfunction
function RiotAction takes unit utarget returns nothing
local unit tempunit
local location temploc = GetUnitLoc(utarget)
set tempunit = CreateUnitAtLoc(Player(9), 'h00I', temploc, bj_UNIT_FACING )
call RemoveLocation(temploc)
call UnitAddAbility(tempunit, 'A05X' )
call IssueTargetOrder( tempunit, "bloodlust", utarget )
return
endfunction
function Trig_CrimeCartellSkills_Actions takes nothing returns nothing
local unit uTarget = GetSpellTargetUnit()
local unit uTrigg = GetTriggerUnit()
local player pTrigg = GetOwningPlayer(uTrigg)
local integer iAbility = GetSpellAbilityId()
local integer ic = 0
local real rc = 0.00
local location loc
local real array rl //Verwendung: EinheitenBewegen
local unit uErsatz
local integer iUnitType = GetUnitTypeId(uTarget) //Fuer Pigclan Upgrades
local location temploc
local group tempgroup
local unit tempunit
set loc = GetSpellTargetLoc()
// Troglospyl Skills =================================================================================================
//Sacrifice FireSpirit
if ( pTrigg == Player(8) ) then
if ( iAbility == 'A06D' ) then
call TriggerSleepAction( 0.50 )
call KillUnit( uTrigg )
return
//OutOfTheRing
elseif ( iAbility == 'A06Z' ) then
//Die Postitionen der Einheiten
//Der Ringer
call RemoveLocation(loc)
set loc = GetUnitLoc(uTrigg)
set rl[0] = GetLocationX(loc)
set rl[1] = GetLocationY(loc)
//Das Ziel
call RemoveLocation(loc)
set loc = GetUnitLoc(uTarget)
set rl[2] = GetLocationX(loc)
set rl[3] = GetLocationY(loc)
//Die Punkte, um die bewegt wird
//delta x
set rl[4] = rl[2]-rl[0]
//delta y
set rl[5] = rl[3] - rl[1]
loop
call SetUnitX(uTarget, rl[2]+rl[4])
call SetUnitY(uTarget, rl[3]+rl[5])
call TriggerSleepAction(0.1)
exitwhen ic == 10
set ic = ic+1
endloop
//Hardened Magma
elseif ( iAbility == 'A06F' ) then
call UnitAddAbility(uTrigg, 'A083')
call TriggerSleepAction( 15.00 )
call UnitRemoveAbility(uTrigg, 'A083' )
return
//Exploding Star
elseif (iAbility == 'A09N') then
loop
set ic = ic+1
set tempunit = CreateUnitAtLoc(pTrigg, 'h00I', loc, rc)
call UnitAddAbility(tempunit,'A09O')
call IssuePointOrderLoc(tempunit, "carrionswarm", PolarProjectionBJ(loc, 200, rc))
set rc = rc + 90.00
exitwhen ic == 4
endloop
endif
endif
// PigClans Skills ========================================================================================================
if ( pTrigg == Player(9) ) then
//Riot
if ( iAbility == 'A05Z' ) then
set tempgroup = GetUnitsInRangeOfLocMatching(600.00, GetUnitLoc(uTrigg), Condition(function RiotCondition))
// call ForGroup( tempgroup, function RiotAction )
loop
exitwhen CountUnitsInGroup(tempgroup) == 0
call RiotAction(FirstOfGroup(tempgroup))
call GroupRemoveUnit(tempgroup, FirstOfGroup(tempgroup))
endloop
call DestroyGroup(tempgroup)
//Food of the Fighter
elseif(iAbility=='A0CS') then
//Footman
if(iUnitType=='h000') then
call UnitAddAbility(uTarget, 'A0CR') //Grunt
call UnitAddAbility(uTarget, 'A0CZ') //Destroyer
endif
//Food of the Focus
elseif(iAbility=='A0D0') then
//Archer
if(iUnitType=='h00S')then
call UnitAddAbility(uTarget, 'A0D1') //Rioter
call UnitAddAbility(uTarget,'A0CU') //Duneguard
elseif(iUnitType=='h00X') then
call UnitAddAbility(uTarget,'A0CV')
endif
//Food of the Darkness
elseif(iAbility=='A0CY')then
//Grunt
if(iUnitType=='h012')then
call UnitAddAbility(uTarget,'A0CW')
elseif(iUnitType=='h00T') then
call UnitAddAbility(uTarget,'A0CX')
endif
//Upgradeskills, wenn eine Einheit 2 Upgrade Möglichkeiten hat
//Upgrade zum Destroyer
elseif(iAbility=='A0CZ') then
call UnitAddAbility(uTrigg, 'A0CQ')
call TriggerSleepAction(1)
call IssueImmediateOrderById( uTrigg, 'h00W' )
//Upgrade zum Rioter
elseif(iAbility=='A0D1') then
call UnitAddAbility(uTrigg, 'A0CT')
call TriggerSleepAction(1)
call IssueImmediateOrderById( uTrigg, 'h00V' )
//Dark Purpose
elseif(iAbility== 'A05Q') then
set temploc = GetUnitLoc(uTrigg)
set uErsatz = CreateUnitAtLoc(pTrigg, 'h00I', temploc, 0)
call RemoveLocation(temploc)
call UnitAddAbility(uErsatz, 'A07O')
call IssueTargetOrder(uErsatz, "rejuvination", uTarget)
//Wave of Wounds
elseif(iAbility == 'A0A3') then
set rl[0] = GetUnitFacing(uTrigg)
set rc = 100.0
set loc= GetUnitLoc(uTrigg)
loop
exitwhen ic == 3
set temploc = GetUnitLoc(uTrigg)
set uErsatz = CreateUnitAtLoc(pTrigg, 'h00I', temploc,rl[0])
call RemoveLocation(temploc)
call UnitAddAbility(uErsatz, 'A0A4')
call TriggerSleepAction(0.3)
call IssueTargetOrder( uErsatz, "acidbomb" , CreateUnitAtLoc(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'h01Q', PolarProjectionBJ(loc, rc, rl[0]), bj_UNIT_FACING) )
set ic = ic+1
set rc = rc + 200.0
endloop
endif
//Upgrades
call TriggerSleepAction(1.0)
if IsUnitType(uTrigg, UNIT_TYPE_UNDEAD) then
set uTrigg = ReplaceUnitBJ( uTrigg, GetUnitTypeId(uTrigg), bj_UNIT_STATE_METHOD_RELATIVE )
call UnitRemoveTypeBJ( UNIT_TYPE_UNDEAD, uTrigg )
//Ersetzen -> Variable +1 -> Variable -1
set udg_iLivingUnits[GetPlayerId(pTrigg)] = udg_iLivingUnits[GetPlayerId(pTrigg)] - 1
return
endif
endif
// Ete´Thero Skills ========================================
if (GetPlayerId(pTrigg) == 10) then
if(iAbility == 'A04I') then
call UnitAddAbility(uTrigg, 'A07E')
call TriggerSleepAction(15)
call UnitRemoveAbility(uTrigg, 'A07E')
//Living Blade
elseif(iAbility == 'A0AN') then
call TriggerSleepAction(0.2)
call ShowUnit(uTrigg, false)
call SetUnitPositionLoc(uTrigg, loc)
call TriggerSleepAction(0.7)
call ShowUnit(uTrigg, true)
endif
endif
// Goldseeker Skills =========================================
if ( pTrigg == Player(11) ) then
//Prophet´sProtection
if ( iAbility == 'A04X' ) then
set temploc = GetUnitLoc(uTrigg)
set tempunit = CreateUnitAtLoc(Player(11), 'h00I', temploc, bj_UNIT_FACING )
call RemoveLocation(temploc)
call UnitAddAbility(tempunit, 'A04Y' )
call IssueTargetOrder( tempunit, "antimagicshell", uTarget )
//Harthaut für 10 sekunden
call UnitAddAbility(uTarget, 'A07F')
call TriggerSleepAction(10.00)
call UnitRemoveAbility(uTarget, 'A07F')
return
//DestructionDeLuxe
elseif( iAbility== 'A04S') then
call UnitAddAbility(uTrigg, 'A07E')
call TriggerSleepAction( 15.00)
call UnitRemoveAbility( uTrigg, 'A07E')
return
//ProtectionOfMoney
elseif (iAbility == 'A0C9') then
call UnitAddAbility(uTrigg, 'A0CA')
call IssueImmediateOrder(uTrigg, "berserk")
call TriggerSleepAction(2.0)
call UnitRemoveAbility(uTrigg, 'A0CA')
endif
endif
call RemoveLocation(loc)
set loc = null
set pTrigg = null
set uTrigg = null
set uTarget = null
set uErsatz = null
set tempgroup = null
set temploc = null
endfunction
//===========================================================================
function InitTrig_CrimeCartellSkills takes nothing returns nothing
set gg_trg_CrimeCartellSkills = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CrimeCartellSkills, Player(8), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CrimeCartellSkills, Player(9), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CrimeCartellSkills, Player(10), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CrimeCartellSkills, Player(11), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_CrimeCartellSkills, function Trig_CrimeCartellSkills_Actions )
endfunction
//TESH.scrollpos=104
//TESH.alwaysfold=0
function Kill takes nothing returns nothing
call KillUnit(GetEnumUnit())
call RemoveUnit(GetEnumUnit())
endfunction
function Trig_DemonInvadersSkills_Actions takes nothing returns nothing
local unit uTrigg = GetTriggerUnit()
local unit uTarget = GetSpellTargetUnit()
local player pTrigg = GetOwningPlayer(uTrigg)
local integer iAbility = GetSpellAbilityId()
local integer ic = 0 //Zaehlvariable
local integer ic2 = 0
local real rc = 0
local group groupUnits
local location loc1 = GetSpellTargetLoc()
local unit tempunit
local location temploc
// Doombringer
if ( GetUnitTypeId(uTrigg) != 'h00I' ) then
if ( iAbility == 'A00Z' or iAbility == 'A01U' ) then
call TriggerSleepAction( 0.25 )
set temploc = GetUnitLoc(uTrigg)
set tempunit = CreateUnitAtLoc(pTrigg, 'h00I', temploc, bj_UNIT_FACING )
call RemoveLocation(temploc)
call UnitAddAbility(tempunit, 'A01K' )
call IssueTargetOrder( tempunit, "chainlightning", uTarget )
return
elseif ( iAbility == 'A030' ) then
call UnitAddAbility(uTrigg, 'A07E' )
call TriggerSleepAction( 15.00 )
call UnitRemoveAbility(uTrigg, 'A07E' )
return
//Call of the Void
elseif (iAbility =='ACbn') then
if( not(IsUnitType(uTarget, UNIT_TYPE_STRUCTURE)) and GetUnitPointValue(uTarget) < 101) then
call TriggerSleepAction(1.00)
call SetUnitPosition(uTarget, -18883, -18848)
endif
//Fire of Destruction
elseif ( iAbility == 'A08Y' ) then
set temploc = GetUnitLoc(uTrigg)
set tempunit = CreateUnitAtLoc( pTrigg, 'h00I', temploc, bj_UNIT_FACING )
call UnitAddAbility(tempunit, 'A08Z' )
call IssuePointOrderLocBJ( tempunit, "rainoffire", temploc )
set tempunit = CreateUnitAtLoc(pTrigg, 'h00I', temploc, bj_UNIT_FACING )
call UnitAddAbility(tempunit, 'A090' )
call IssuePointOrderLoc( tempunit, "rainoffire", temploc)
call RemoveLocation(temploc)
//Demolishion
elseif (iAbility == 'A0B5') then
call TriggerSleepAction(1.2)
set temploc = GetUnitLoc(uTrigg)
set tempunit = CreateUnitAtLoc(pTrigg, 'h00I', temploc, bj_UNIT_FACING )
call UnitAddAbility(tempunit, 'A092')
call IssueImmediateOrder(tempunit, "stomp")
call TriggerSleepAction(1.0)
call RemoveLocation(temploc)
set temploc = GetUnitLoc(uTrigg)
set tempunit = CreateUnitAtLoc(pTrigg, 'h00I', temploc, bj_UNIT_FACING )
call UnitAddAbility(tempunit, 'A092')
call IssueImmediateOrder(tempunit, "stomp")
call TriggerSleepAction(0.7)
call RemoveLocation(temploc)
set temploc = GetUnitLoc(uTrigg)
set tempunit = CreateUnitAtLoc( pTrigg, 'h00I', temploc, bj_UNIT_FACING )
call UnitAddAbility(tempunit, 'A092')
call IssueImmediateOrder(tempunit, "stomp")
call TriggerSleepAction(0.5)
call RemoveLocation(temploc)
set temploc = GetUnitLoc(uTrigg)
set tempunit = CreateUnitAtLoc(pTrigg, 'h00I', temploc, bj_UNIT_FACING )
call UnitAddAbility(tempunit, 'A092')
call IssueImmediateOrder(tempunit, "stomp")
call RemoveLocation(temploc)
//Falling Bridges
elseif (iAbility == 'A0BA') then
call TriggerSleepAction(0.5)
call UnitAddAbility(uTrigg, 'A0BB')
call IssueImmediateOrder(uTrigg, "thunderclap")
call TriggerSleepAction(0.5)
call UnitRemoveAbility(uTrigg, 'A0BB')
call UnitAddAbility(uTrigg, 'A0BC')
call IssuePointOrderLoc(uTrigg, "shockwave", loc1)
call TriggerSleepAction(0.5)
call UnitRemoveAbility(uTrigg, 'A0BC')
set tempunit = CreateUnitAtLoc(pTrigg, 'h00I', loc1, bj_UNIT_FACING)
call UnitAddAbility(tempunit, 'A0BD')
call IssueImmediateOrder(tempunit, "howlofterror")
//Portal to Theosa
elseif(iAbility == 'A0DB') then
set groupUnits = GetUnitsInRectMatching(gg_rct_LeaveVoid,null)
loop
exitwhen CountUnitsInGroup(groupUnits) == 0
call SetUnitPositionLoc(FirstOfGroup(groupUnits), loc1)
call GroupRemoveUnit(groupUnits, FirstOfGroup(groupUnits))
call TriggerSleepAction(0.5)
endloop
call DestroyGroup(groupUnits)
//Eruption
elseif( iAbility == 'A0EO' ) then
set tempunit = CreateUnitAtLoc(pTrigg, 'uloc', loc1, 270.0)
call UnitAddAbility(tempunit, 'A06X')
call SetUnitMoveSpeed(tempunit, 0.0)
call IssueImmediateOrder(tempunit, "stomp")
call UnitAddAbility(tempunit, 'A0EP')
call SetUnitAbilityLevel(tempunit, 'A0EP', GetUnitAbilityLevel(uTrigg, 'A0EO' ))
set temploc = GetUnitLoc(tempunit)
set groupUnits = GetUnitsInRangeOfLocMatching(300.0 , temploc, null)
call RemoveLocation(temploc)
call SetUnitState(tempunit, UNIT_STATE_LIFE, I2R(CountUnitsInGroup(groupUnits)*GetUnitAbilityLevel(uTrigg, 'A0EO' )))
//Gorar Fireball
elseif(iAbility == 'A0EQ') then
set rc = GetUnitMoveSpeed(uTrigg)
call SetUnitMoveSpeed(uTrigg, 0.0)
set ic = GetRandomInt(1, 360)
set tempunit = CreateUnit(pTrigg, 'uloc', GetUnitX(uTrigg) + Cos(ic)*600, GetUnitY(uTrigg) + Sin(ic)*600, 270.0)
call UnitAddAbility(tempunit, 'A0EU')
call UnitAddAbility(tempunit, 'ACbl')
call IssueTargetOrder(tempunit, "bloodlust", uTrigg)
call SetUnitState(tempunit, UNIT_STATE_LIFE, 15.1)
set ic = GetRandomInt(1, 360)
set tempunit = CreateUnit(pTrigg, 'uloc', GetUnitX(uTrigg) + Cos(ic)*600, GetUnitY(uTrigg) + Sin(ic)*600, 270.0)
call UnitAddAbility(tempunit, 'A0EU')
call UnitAddAbility(tempunit, 'AChv')
call IssueTargetOrder(tempunit, "healingwave", uTrigg)
call SetUnitState(tempunit, UNIT_STATE_LIFE, 15.1)
call TriggerSleepAction(15.0)
call SetUnitMoveSpeed(uTrigg, rc)
endif
endif
// BlackHand
if ( iAbility == 'A01S' ) then
set temploc = GetUnitLoc(uTrigg)
set tempunit = CreateUnitAtLoc(pTrigg, 'h00I', temploc, bj_UNIT_FACING )
call RemoveLocation(temploc)
call UnitAddAbility(tempunit, 'A01T' )
call IssueTargetOrder( tempunit, "shadowstrike", uTarget )
return
//Weakening Strike
elseif(iAbility == 'A0AZ') then
set temploc = GetUnitLoc(uTrigg)
set tempunit = CreateUnitAtLoc(pTrigg, 'h00I', temploc, bj_UNIT_FACING)
call RemoveLocation(temploc)
call UnitAddAbility(tempunit, 'A082')
call SetUnitAbilityLevel(tempunit, 'A082', GetUnitAbilityLevel(uTrigg,'A0AZ'))
call IssueTargetOrder(tempunit, "faeriefire", uTarget)
//Bow of Soulhunt
elseif(iAbility == 'A0B8') then
call UnitAddAbility(uTrigg, 'A07E')
call TriggerSleepAction(5.0)
call UnitRemoveAbility(uTrigg, 'A07E')
endif
call DestroyGroup(groupUnits)
set groupUnits = null
call RemoveLocation(loc1)
set loc1 = null
set uTrigg = null
set uTarget = null
set pTrigg = null
set tempunit = null
set temploc = null
endfunction
//===========================================================================
function InitTrig_DemonInvadersSkills takes nothing returns nothing
set gg_trg_DemonInvadersSkills = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_DemonInvadersSkills, Player(6), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_DemonInvadersSkills, Player(7), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_DemonInvadersSkills, function Trig_DemonInvadersSkills_Actions )
endfunction
//TESH.scrollpos=130
//TESH.alwaysfold=0
function Trig_DoombringerFusion_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'ACtc' ) ) then
return false
endif
return true
endfunction
function Trig_DoombringerFusion_Actions takes nothing returns nothing
local unit uTrigg = GetTriggerUnit()
local unit uTarget = GetSpellTargetUnit()
local player pTrigg = GetOwningPlayer(uTrigg)
local integer iAbility = GetSpellAbilityId()
local integer ic = 0 //Zaehlvariable
local integer ic2 = 0
local real rc
local group groupUnits
local group groupUnits2 //Für den Fusionskill benötigt --> Gruppe 1 nur zum überprüfen
local location loc1 = GetSpellTargetLoc()
local unit tempunit
local location temploc
set groupUnits = GetUnitsInRectOfPlayer(gg_rct_DoombringerFusion, Player(7))
if(CountUnitsInGroup(groupUnits) < 2) then
call DisplayTextToPlayer(pTrigg,0,0, "Not enough units to start a fusion")
endif
set uTarget = FirstOfGroup(groupUnits)
set ic = GetUnitTypeId(uTarget)
call GroupRemoveUnit(groupUnits, uTarget) //wird nicht mehr in der Gruppe gebraucht
set groupUnits2 = CreateGroup()
call GroupAddUnit(groupUnits2, uTarget)
if(CountUnitsInGroup(groupUnits) == 1) then
set uTarget = FirstOfGroup(groupUnits)
//Der erste ist ein Eskator Artillerist benötigt das Veralar I Upgrade
if(ic == 'n025' and GetPlayerTechCount(pTrigg, 'Rura', true) >= 1) then
set ic = GetUnitTypeId(uTarget)
//Der zweite ist ein Demon Soldier
if(ic == 'n01T') then
set ic2 = 'n02U' //Eskator Agent
//Der zweite ist ein Eskator Artillerist
elseif(ic== 'n025' ) then
set ic2 = 'n02T' //Eskator Mage
endif
//Der erste ist ein Demon Soldier, Braucht Veralar I
elseif(ic == 'n01T' and GetPlayerTechCount(pTrigg, 'Rura', true) >= 1) then
set uTarget = FirstOfGroup(groupUnits)
set ic = GetUnitTypeId(uTarget)
//Der zweite ist ein Eskator Artillerist
if(ic == 'n025') then
set ic2 = 'n02U' //Eskator Agent
//Der zweite ist ein Gargoyle, Braucht Veralar II
elseif(ic == 'u007' and GetPlayerTechCount(pTrigg, 'Rura', true) >= 2) then
set ic2 = 'n02S'//Winged Demon
endif
//Der erste ist ein Demon Captain, Braucht Gorar Upgrade
elseif (ic == 'n02W' and GetPlayerTechCount(pTrigg, 'Rusp', true) >= 1) then
set ic = GetUnitTypeId(uTarget)
//Der zweite ist ein Eskator Agent
if(ic == 'n02U') then
set ic2 = 'n02X' //Avenger --> 7 Nahrung muss verfügbar sein
if(not(GetPlayerState(pTrigg, PLAYER_STATE_RESOURCE_FOOD_CAP) >= GetPlayerState(pTrigg, PLAYER_STATE_RESOURCE_FOOD_USED) + 7)) then
return
endif
endif
//Der erste ist ein Eskator Agent, Braucht Gorar Upgrade
elseif (ic == 'n02U' and GetPlayerTechCount(pTrigg, 'Rusp', true) >= 1) then
set ic = GetUnitTypeId(uTarget)
//Der zweite ist ein Eskator Agent
if(ic == 'n02W') then
set ic2 = 'n02X' //Avenger --> 7 Nahrung muss verfügbar sein
if(not(GetPlayerState(pTrigg, PLAYER_STATE_RESOURCE_FOOD_CAP) >= GetPlayerState(pTrigg, PLAYER_STATE_RESOURCE_FOOD_USED) + 7)) then
return
endif
endif
//Der erste ist ein Avenger, braucht Vorvrar
elseif (ic == 'n02X' and GetPlayerTechCount(pTrigg, 'Rusf', true) >=0) then
set ic = GetUnitTypeId(uTarget)
//Der zweite ist ein Siege Gargoyle
if(ic == 'n02V') then
set ic2 = 'n02Y'//Balrog
endif
//Der erste ist ein Siege Gargoyle, braucht Vorvrar
elseif (ic == 'n02V' and GetPlayerTechCount(pTrigg, 'Rusf', true) >=0) then
set ic = GetUnitTypeId(uTarget)
//Der zweite ist ein Avenger
if(ic == 'n02X') then
set ic2 = 'n02Y'//Balrog
endif
endif
call GroupAddUnit(groupUnits2, uTarget)
//SiegeGargoyle; Braucht Veralar II
elseif(CountUnitsInGroup(groupUnits) == 3 and GetPlayerTechCount(pTrigg, 'Rura', true) >= 2) then
if(ic !='u007') then
endif
set ic2 = 0
loop
set ic2 = ic2 +1
if(GetUnitTypeId(FirstOfGroup(groupUnits)) == 'u007') then
call GroupAddUnit(groupUnits2, FirstOfGroup(groupUnits))
call GroupRemoveUnit(groupUnits, FirstOfGroup(groupUnits))
else
set ic2 = 3
endif
exitwhen ic2 == 3
endloop
if(CountUnitsInGroup(groupUnits2) == 4) then
set ic2 = 'n02V' //Siege Gargoyle --> 8 Nahrung muss verfügbar sein
if(not(GetPlayerState(pTrigg, PLAYER_STATE_RESOURCE_FOOD_CAP) >= GetPlayerState(pTrigg, PLAYER_STATE_RESOURCE_FOOD_USED) + 8)) then
return
endif
endif
endif
//Create the new unit
if( not(ic2==0)) then
call CreateUnit(pTrigg, ic2, -19334, - 19200, 270.0)
call ForGroup(groupUnits2, function Kill)
endif
call DestroyGroup(groupUnits)
set groupUnits = null
call DestroyGroup(groupUnits2)
set groupUnits2 = null
call RemoveLocation(loc1)
set loc1 = null
set uTrigg = null
set uTarget = null
set pTrigg = null
set tempunit = null
set temploc = null
endfunction
//===========================================================================
function InitTrig_DoombringerFusion takes nothing returns nothing
set gg_trg_DoombringerFusion = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_DoombringerFusion, Player(7), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_DoombringerFusion, Condition( function Trig_DoombringerFusion_Conditions ) )
call TriggerAddAction( gg_trg_DoombringerFusion, function Trig_DoombringerFusion_Actions )
endfunction
//TESH.scrollpos=58
//TESH.alwaysfold=0
function Trig_Creep_Skills_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) ) ) then
return false
endif
return true
endfunction
function GetPlayerUnitCondition takes nothing returns boolean
if(GetOwningPlayer(GetFilterUnit()) != Player(PLAYER_NEUTRAL_AGGRESSIVE)) then
return true
else
return false
endif
endfunction
function RandomRun takes nothing returns nothing
local integer i = GetRandomInt(0,3)
if(i== 1 and GetUnitAbilityLevel(GetEnumUnit(),'B02Q')>0) then
call IssuePointOrder(GetEnumUnit(), "move", GetRandomReal(-20000.0, -18400.0), GetRandomReal(5200.0, 7200.0))
endif
endfunction
function Trig_Creep_Skills_Actions takes nothing returns nothing
local unit uTrigg = GetTriggerUnit()
local player pTrigg = GetOwningPlayer(uTrigg)
local integer iAbility = GetSpellAbilityId()
local location SpellTarget = GetSpellTargetLoc()
local integer ic = 0
local integer array iPosition //wird u.a. bei Drakulus verwendet
local group groupUnits
local unit tempunit
//Drakulus Rockattack
if(iAbility == 'Awrg') then
//Positions
set iPosition[0] = -18190
set iPosition[1] = -3410
set iPosition[2] = -17800
set iPosition[3] = -4200
set iPosition[4] = -17000
set iPosition[5] = -4200
set iPosition[6] = -16650
set iPosition[7] = -3450
set iPosition[8] = -17300
set iPosition[9] = -3130
set groupUnits = GetUnitsInRectMatching(gg_rct_Batcave, Condition(function GetPlayerUnitCondition))
call TriggerSleepAction(0.5)
loop
call CreateUnit(pTrigg, 'ndrf', iPosition[2*ic], iPosition[2*ic+1], 270.00)
set ic = ic +1
exitwhen ic == 5
endloop
//Unsinkable - The Blooddust
elseif(iAbility == 'A0DL') then
call CreateItem('wcyc', GetRandomReal(-20000.0,-18250.0), GetRandomReal(9000.0, 10000.0))
//Firepillar Varlassasz
elseif(iAbility == 'ACcv') then
call CreateUnit(pTrigg, 'nsrw', -19550.0, 6950.0, 270.0)
call CreateUnit(pTrigg, 'nsra', -19550.0, 6644.0, 270.0)
call CreateUnit(pTrigg, 'nsrn', -19120.0, 6950.0, 270.0)
call CreateUnit(pTrigg, 'nsrh', -19120.0, 6644.0, 270.0)
//Firedream Varlassasz
elseif(iAbility == 'Acht') then
loop
set groupUnits = GetUnitsInRectMatching(gg_rct_MiltharCity, Condition(function GetPlayerUnitCondition))
call ForGroup(groupUnits, function RandomRun)
call DestroyGroup(groupUnits)
set ic = ic + 1
exitwhen ic == 10
endloop
//Erlking Send a daughter
elseif(iAbility == 'A0E7') then
call TriggerSleepAction(3.5)
set tempunit = CreateUnitAtLoc(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'n015', SpellTarget, 270)
call UnitAddAbility(tempunit, 'A025')
endif
set uTrigg = null
set pTrigg = null
set tempunit = null
call RemoveLocation(SpellTarget)
set SpellTarget = null
call DestroyGroup(groupUnits)
set groupUnits = null
endfunction
//===========================================================================
function InitTrig_Creep_Skills takes nothing returns nothing
set gg_trg_Creep_Skills = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Creep_Skills, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Creep_Skills, Condition( function Trig_Creep_Skills_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Skills, function Trig_Creep_Skills_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Casts_Actions takes nothing returns nothing
local unit uTrigg = GetTriggerUnit()
local unit uTarget = GetSpellTargetUnit()
local player pTrigg = GetOwningPlayer(uTrigg)
local integer iAbility = GetSpellAbilityId()
local unit tempunit
local location temploc
//Concentrated Firebold
if ( iAbility == 'A03J' ) then
call TriggerSleepAction(1.00)
set temploc = GetUnitLoc(uTrigg)
set tempunit = CreateUnitAtLoc(pTrigg, 'h00I', temploc, bj_UNIT_FACING )
call UnitAddAbility(tempunit, 'A03K' )
call IssueTargetOrder( tempunit, "chainlightning", uTarget )
call TriggerSleepAction( 1.00 )
set tempunit = CreateUnitAtLoc(pTrigg, 'h00I', temploc, bj_UNIT_FACING )
call UnitAddAbility(tempunit, 'A03K' )
call IssueTargetOrder( tempunit, "chainlightning", uTarget )
call RemoveLocation(temploc)
endif
set uTrigg = null
set uTarget = null
set pTrigg = null
endfunction
//===========================================================================
function InitTrig_Casts takes nothing returns nothing
set gg_trg_Casts = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Casts, EVENT_PLAYER_UNIT_SPELL_CHANNEL )
call TriggerAddAction( gg_trg_Casts, function Trig_Casts_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_FaehigkeitenErlernen_Actions takes nothing returns nothing
local unit uTrigg = GetTriggerUnit()
local integer iAbility = GetLearnedSkill()
local integer iLevel = GetUnitAbilityLevel(uTrigg, iAbility)
local player pTrigg = GetOwningPlayer(uTrigg)
//Chilling Aura
if ( iAbility == 'S00R' ) then
if ( iLevel == 1 ) then
call SelectHeroSkill( uTrigg, 'A0AJ' )
else
call SetUnitAbilityLevel( uTrigg, 'A0AJ', iLevel)
endif
//Piercing Slash
elseif (iAbility == 'S00S') then
call SetPlayerTechResearched(pTrigg, 'R04I', iLevel)
//Heart of the Forest
elseif ( iAbility == 'A0CN') then
call SetPlayerTechResearched(pTrigg, 'R04K' , 1)
endif
set uTrigg = null
set pTrigg = null
endfunction
//===========================================================================
function InitTrig_FaehigkeitenErlernen takes nothing returns nothing
set gg_trg_FaehigkeitenErlernen = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_FaehigkeitenErlernen, EVENT_PLAYER_HERO_SKILL )
call TriggerAddAction( gg_trg_FaehigkeitenErlernen, function Trig_FaehigkeitenErlernen_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_GeneralSkill_Actions takes nothing returns nothing
local unit uTrigg = GetTriggerUnit()
local integer iAbility = GetSpellAbilityId()
//Destroy
if ( iAbility == 'A0EI' ) then
call KillUnit( uTrigg )
endif
set uTrigg = null
endfunction
//===========================================================================
function InitTrig_GeneralSkill takes nothing returns nothing
set gg_trg_GeneralSkill = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_GeneralSkill, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_GeneralSkill, function Trig_GeneralSkill_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Unit_wird_angegriffen_Actions takes nothing returns nothing
local unit uTarget = GetTriggerUnit()
local unit uAttack = GetAttacker()
local unit u
local location temploc
// Skill "Burning"
if ( GetUnitAbilityLevel(uAttack, 'S001') > 0) then
call UnitRemoveAbility(uTarget, 'B032')
set temploc = GetUnitLoc(uTarget)
set u = CreateUnitAtLoc(GetOwningPlayer(uAttack), 'h00H', temploc, bj_UNIT_FACING )
call IssueTargetOrderBJ( u, "attack", uTarget )
call TriggerSleepAction( 5.00 )
call RemoveUnit(u)
else
endif
set uTarget = null
set uAttack = null
set u = null
endfunction
//===========================================================================
function InitTrig_Unit_wird_angegriffen takes nothing returns nothing
set gg_trg_Unit_wird_angegriffen = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Unit_wird_angegriffen, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddAction( gg_trg_Unit_wird_angegriffen, function Trig_Unit_wird_angegriffen_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_ZauberdummyEntfernen_Actions takes nothing returns nothing
local unit uTrigg = GetTriggerUnit()
if (GetUnitTypeId(uTrigg) == 'h00I') then
call TriggerSleepAction( 10.00 )
call RemoveUnit( uTrigg )
endif
set uTrigg = null
endfunction
//===========================================================================
function InitTrig_ZauberdummyEntfernen takes nothing returns nothing
set gg_trg_ZauberdummyEntfernen = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_ZauberdummyEntfernen, GetEntireMapRect() )
call TriggerAddAction( gg_trg_ZauberdummyEntfernen, function Trig_ZauberdummyEntfernen_Actions )
endfunction
//TESH.scrollpos=4
//TESH.alwaysfold=0
function Trig_RallypointSetzen_Conditions takes nothing returns boolean
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("smart") ) ) then
return false
endif
return true
endfunction
function Trig_RallypointSetzen_Actions takes nothing returns nothing
local real ia
local real ib
local unit uTrigg = GetTriggerUnit()
local player pTrigg = GetOwningPlayer(uTrigg)
if(GetUnitTypeId(uTrigg) == 'N03S') then
// "smart" heißt wohl Rechtsklick
call RemoveLocation(udg_oRallypointOfTrainsAndAll[GetPlayerId(pTrigg)])
set udg_oRallypointOfTrainsAndAll[GetPlayerId(pTrigg)] = GetOrderPointLoc()
set ia = GetOrderPointX()
set ib = GetOrderPointY()
set udg_oRallypointOfTrainsAndAll[GetPlayerId(pTrigg)] = Location(ia, ib)
endif
set uTrigg = null
set pTrigg = null
endfunction
//===========================================================================
function InitTrig_RallypointSetzen takes nothing returns nothing
set gg_trg_RallypointSetzen = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_RallypointSetzen, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerAddCondition( gg_trg_RallypointSetzen, Condition( function Trig_RallypointSetzen_Conditions ) )
call TriggerAddAction( gg_trg_RallypointSetzen, function Trig_RallypointSetzen_Actions )
endfunction
//TESH.scrollpos=40
//TESH.alwaysfold=0
function RallypointSummonsFalse takes player pTrigg, integer iTrigg returns nothing
set udg_bRallypointForSummoned[iTrigg] = false
call ReplaceUnitBJ( udg_uRallypointSummoned[iTrigg], 'nnrg', bj_UNIT_STATE_METHOD_RELATIVE )
set udg_uRallypointSummoned[iTrigg] = GetLastReplacedUnitBJ()
call DisplayTextToForce( GetForceOfPlayer(pTrigg), "Remove Rallypoint for summoned units." )
endfunction
function RallypointSummonsTrue takes player pTrigg, integer iTrigg returns nothing
set udg_bRallypointForSummoned[iTrigg] = true
call ReplaceUnitBJ( udg_uRallypointSummoned[iTrigg], 'nnmg', bj_UNIT_STATE_METHOD_RELATIVE )
set udg_uRallypointSummoned[iTrigg] = GetLastReplacedUnitBJ()
call DisplayTextToForce( GetForceOfPlayer(pTrigg), "Set Rallypoint for summoned units." )
endfunction
function RallypointTrainedFalse takes player pTrigg, integer iTrigg returns nothing
set udg_bRallypointForTrainedUnits[iTrigg] = false
call ReplaceUnitBJ( udg_uRallypoint[iTrigg], 'nhyc', bj_UNIT_STATE_METHOD_RELATIVE )
set udg_uRallypoint[iTrigg] = GetLastReplacedUnitBJ()
call DisplayTextToForce( GetForceOfPlayer(pTrigg), "Remove Rallypoint for trained units." )
endfunction
function RallypointTrainedTrue takes player pTrigg, integer iTrigg returns nothing
set udg_bRallypointForTrainedUnits[iTrigg] = true
call ReplaceUnitBJ( udg_uRallypoint[iTrigg], 'nwgs', bj_UNIT_STATE_METHOD_RELATIVE )
set udg_uRallypoint[iTrigg] = GetLastReplacedUnitBJ()
call DisplayTextToForce( GetForceOfPlayer(pTrigg), "Set Rallypoint for trained units." )
endfunction
function RallypointForAllFalse takes player pTrigg, integer iTrigg returns nothing
set udg_bRallypointForEverybody[iTrigg] = false
call ReplaceUnitBJ( udg_uRallypointAll[iTrigg], 'nmyr', bj_UNIT_STATE_METHOD_RELATIVE )
set udg_uRallypointAll[iTrigg] = GetLastReplacedUnitBJ()
call DisplayTextToForce( GetForceOfPlayer(pTrigg), "Remove Rallypoint for all units." )
endfunction
function RallypointForAllTrue takes player pTrigg, integer iTrigg returns nothing
local force tempforce = GetForceOfPlayer(pTrigg)
set udg_bRallypointForEverybody[iTrigg] = true
set udg_uRallypointAll[iTrigg] = ReplaceUnitBJ( udg_uRallypointAll[iTrigg], 'nnsw', bj_UNIT_STATE_METHOD_RELATIVE )
call DisplayTextToForce( tempforce, "Set Rallypoint for all units." )
call DestroyForce(tempforce)
endfunction
function Trig_CommandUnit_Actions takes nothing returns nothing
local unit uTrigg = GetTriggerUnit()
local integer iAbility = GetSpellAbilityId()
local location locAbility = GetSpellTargetLoc()
local unit uTarget = GetSpellTargetUnit()
local player pTrigg = GetOwningPlayer(uTrigg)
local integer iTrigg = GetPlayerId(pTrigg)
local group Units
if (not(GetUnitTypeId(uTrigg) == 'N03S' )) then
return
endif
// Wenn der Rallypoint für Trainierte Einheiten festgelegt wird ===================================================
if ( iAbility == 'A095' or iAbility == 'A098') then
// Wenn noch der Rallypoint für alle Einheiten existiert =======================================================
if ( udg_bRallypointForEverybody[GetPlayerId(pTrigg)] ) then
// Der Rallypoint for All
call RallypointForAllFalse(pTrigg, iTrigg )
// Der Rallypoint for Summons -> sollen weiterhin zu dem Punkt
call RallypointSummonsTrue(pTrigg, iTrigg )
set udg_oRallypointOfSummoned[iTrigg] = GetUnitRallyPoint(uTrigg)
endif
// UnterschiedObDerRallypoint festgesetzt wird, oder ob er aufgehoben wird ===================================================
if ( iAbility == 'A095' ) then
call RallypointTrainedTrue(pTrigg, iTrigg )
else
call RallypointTrainedFalse(pTrigg, iTrigg )
endif
return
// Rallypoint für Alle =========================================================================================
elseif ( iAbility == 'A097' ) then
call RallypointSummonsFalse(pTrigg, iTrigg )
call RallypointTrainedFalse(pTrigg, iTrigg )
call RallypointForAllTrue(pTrigg, iTrigg )
return
// Rallypoint für alle entfernen ============================================================
elseif ( iAbility == 'A09B' ) then
call RallypointForAllFalse(pTrigg, iTrigg )
return
// Rallypoint für Summons ==========================================================================================
elseif (iAbility == 'A099' ) then
if ( udg_bRallypointForEverybody[GetPlayerId(pTrigg)] ) then
// Trainierte Einheiten laufen weiterhin zum Rallypoint der Commandunit
call RallypointForAllFalse(pTrigg, iTrigg )
call RallypointTrainedTrue(pTrigg, iTrigg )
//else Es bestand kein Rallypoint für alle Einheiten, also muss nichts geänder werden
endif
// Summons sollen zum Zielort der Fähigkeit laufen (in jedem Fall)
call RallypointSummonsTrue(pTrigg, iTrigg )
set udg_oRallypointOfSummoned[iTrigg] = locAbility
return
// Rallypoint für Summons wird entfernt
elseif ( iAbility == 'A096' ) then
// Bestand ein Rallypoint für alle Einheiten
if ( udg_bRallypointForEverybody[GetPlayerId(pTrigg)] ) then
call RallypointTrainedTrue(pTrigg, iTrigg )
call RallypointForAllFalse(pTrigg, iTrigg )
endif
call RallypointSummonsFalse(pTrigg, iTrigg )
return
//Move to Point
elseif( iAbility == 'A0E2') then
set Units = GetUnitsInRectOfPlayer(bj_mapInitialPlayableArea, pTrigg)
loop
exitwhen (CountUnitsInGroup(Units) == 0)
//keine Arbeiter
if(GetUnitPointValue(FirstOfGroup(Units)) != 95) then
call IssuePointOrderLoc(FirstOfGroup(Units), "move", locAbility)
endif
call GroupRemoveUnit(Units, FirstOfGroup(Units))
endloop
//Attack Point
elseif(iAbility == 'A0E1') then
set Units = GetUnitsInRectOfPlayer(GetPlayableMapRect(), pTrigg)
loop
exitwhen (CountUnitsInGroup(Units) == 0)
//keine Arbeiter
if(GetUnitPointValue(FirstOfGroup(Units)) != 95) then
call IssuePointOrderLoc(FirstOfGroup(Units), "attack", locAbility)
endif
call GroupRemoveUnit(Units, FirstOfGroup(Units))
endloop
//Attack Unit
elseif(iAbility == 'A0E3') then
set Units = GetUnitsInRectOfPlayer(GetPlayableMapRect(), pTrigg)
loop
exitwhen (CountUnitsInGroup(Units) == 0)
//keine Arbeiter oder Gebäude
if(GetUnitPointValue(FirstOfGroup(Units)) !=95 and not(IsUnitType(FirstOfGroup(Units), UNIT_TYPE_STRUCTURE))) then
call IssueTargetOrder(FirstOfGroup(Units), "attack", uTarget)
endif
call GroupRemoveUnit(Units, FirstOfGroup(Units))
endloop
endif
set uTrigg = null
call RemoveLocation(locAbility)
set locAbility = null
set uTarget = null
set pTrigg = null
call DestroyGroup(Units)
set Units = null
endfunction
//===========================================================================
function InitTrig_CommandUnit takes nothing returns nothing
set gg_trg_CommandUnit = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_CommandUnit, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_CommandUnit, function Trig_CommandUnit_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Wasserschrein_Actions takes nothing returns nothing
local location temploc
set temploc = GetUnitLoc(GetTriggerUnit())
set udg_uShrineOfTheSeas = CreateUnitAtLoc(GetOwningPlayer(GetKillingUnitBJ()), 'h001', temploc, bj_UNIT_FACING )
call RemoveLocation(temploc)
endfunction
//===========================================================================
function InitTrig_Wasserschrein takes nothing returns nothing
set gg_trg_Wasserschrein = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Wasserschrein, gg_unit_h001_0231, EVENT_UNIT_DEATH )
call TriggerAddAction( gg_trg_Wasserschrein, function Trig_Wasserschrein_Actions )
endfunction
//TESH.scrollpos=1
//TESH.alwaysfold=0
function Trig_Raus_Func001Func003C takes nothing returns boolean
if ( ( GetOwningPlayer(GetTriggerUnit()) == GetOwningPlayer(udg_uShrineOfTheSeas) ) ) then
return true
endif
if ( ( GetOwningPlayer(GetTriggerUnit()) != Player(11) ) ) then
return true
endif
if ( ( IsUnitAlly(GetTriggerUnit(), GetOwningPlayer(udg_uShrineOfTheSeas)) == false ) ) then
return true
endif
if ( ( GetOwningPlayer(GetTriggerUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) ) ) then
return true
endif
if ( ( GetOwningPlayer(GetTriggerUnit()) == Player(PLAYER_NEUTRAL_PASSIVE) ) ) then
return true
endif
return false
endfunction
function Trig_Raus_Func001C takes nothing returns boolean
if ( not Trig_Raus_Func001Func003C() ) then
return false
endif
return true
endfunction
function Trig_Raus_Actions takes nothing returns nothing
local location temploc
if ( not Trig_Raus_Func001C() ) then
set temploc = GetRectCenter(gg_rct_Brekana_Deeps_Outside)
call SetUnitPositionLoc( GetTriggerUnit(), temploc )
call RemoveLocation(temploc)
endif
endfunction
//===========================================================================
function InitTrig_Raus takes nothing returns nothing
set gg_trg_Raus = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Raus, gg_rct_Brekana_Deeps )
call TriggerAddAction( gg_trg_Raus, function Trig_Raus_Actions )
endfunction
//TESH.scrollpos=18
//TESH.alwaysfold=0
function playVictory takes nothing returns nothing
if (IsPlayerInForce(GetEnumPlayer(), udg_oWinningForce) ) then
call MeleeVictoryDialogBJ(GetEnumPlayer(), true)
else
call MeleeDefeatDialogBJ(GetEnumPlayer(), true)
endif
endfunction
function Trig_Abspielen_Actions takes nothing returns nothing
call DisplayTextToForce(udg_PlayersAll, "Congrats you finished the map with one force dominating over the others.")
call TriggerSleepAction(2.5)
call DisplayTextToForce(udg_PlayersAll, "Many died, some were sacrificed for different purposes and only few were victorious.")
call TriggerSleepAction(2.5)
call DisplayTextToForce(udg_PlayersAll, "You brought it this far and played until one possible end of the war happens. (Also if there isn't only one force survivng in the canon.)")
call TriggerSleepAction(2.5)
call DisplayTextToForce(GetPlayersAll(), "Thanks for playing and don´t forget to give some feedback! ;-)" )
call DisplayTextToForce(GetPlayersAll(), "The map will close in 60 seconds." )
call TriggerSleepAction(60.0)
call ForForce(GetPlayersAll(), function playVictory)
endfunction
//===========================================================================
function InitTrig_Abspielen takes nothing returns nothing
set gg_trg_Abspielen = CreateTrigger( )
call TriggerAddAction( gg_trg_Abspielen, function Trig_Abspielen_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Despair takes location loc, player pTrigg returns nothing
local unit tempunit
set tempunit = CreateUnitAtLoc(pTrigg, 'h00I', loc, 270.0)
call UnitAddAbility(tempunit, 'A0E5')
call IssueImmediateOrder(tempunit, "howlofterror")
endfunction
function Fury takes location loc, player pTrigg returns nothing
local unit tempunit
set tempunit = CreateUnitAtLoc(pTrigg, 'h00I', loc, 270.0)
call UnitAddAbility(tempunit, 'A0E6')
call IssueImmediateOrder(tempunit, "roar")
endfunction
function Fireleafpass takes player pTrigg returns nothing
local integer ic
call DisplayTextToForce(udg_PlayersAll, "The Mercenary Camp of Upper Sarwas has been raided and the mercenaries have aggreed to offer their services for low money")
call CreateUnit(pTrigg, 'nheb', -9854.0, 3282.0, 345.0)
call CreateUnit(pTrigg, 'o002', -8881.0, 2764.0, 270.0)
call CreateUnit(pTrigg, 'o002', -9136.0, 2388.0, 270.0)
call CreateUnit(pTrigg, 'o002', -9404.0, 3645.0, 270.0)
loop
call CreateUnit(pTrigg, 'nbel', -9642.0, 2983.0, 315.0)
set ic = ic + 1
exitwhen ic == 5
endloop
call CreateUnit(pTrigg, 'njks', -9642.0, 2983.0, 315.0)
endfunction
function Trig_InitTriggerKills_Actions takes nothing returns nothing
local unit uTrigg = GetDyingUnit()
local integer iTrigg = GetUnitTypeId(uTrigg)
local player pTrigg = GetOwningPlayer(uTrigg)
local integer i = 0 //used in loops
local unit uKill = GetKillingUnit()
local player pKill = GetOwningPlayer(uKill)
local unit tempunit
local location temploc
local group tempgroup
local location locTrigg = GetUnitLoc(uTrigg)
//Heroes
if( IsUnitType( uTrigg, UNIT_TYPE_HERO) == true ) then
set i = GetRandomInt(1, 10)
if( i <= 5 ) then
call Despair(locTrigg, pTrigg)
call DisplayTextToForce(udg_PlayersAll, "The death of " + GetHeroProperName(uTrigg) + " shattered the hope of his nearby allies.")
else
call Fury(locTrigg, pTrigg)
call DisplayTextToForce(udg_PlayersAll, "The death of " + GetHeroProperName(uTrigg) + " enraged his nearby allies. They do anything to revenge this.")
endif
set i = 0
endif
//Pyrios
if (iTrigg == 'n010') then
call CreateItem('ckng', GetUnitX(uTrigg), GetUnitY(uTrigg))
//Erlking
elseif ( iTrigg == 'n014' ) then
call ConditionalTriggerExecute( gg_trg_Erlking )
//Morbeen
elseif (iTrigg == 'Udre') then
call ConditionalTriggerExecute( gg_trg_Morbeen)
//Scarbone´s Workshop
elseif (iTrigg == 'nmfs') then
call SetUnitOwner( gg_unit_nfv2_0156, Player(2), true )
call DisplayTextToForce(udg_PlayersAll, "Sheller warriors have beaten the renegade Icefall Clan and freed Ralszar Scarbone and his workshop!")
call SetPlayerState(pTrigg, PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(pTrigg, PLAYER_STATE_RESOURCE_GOLD) + 50)
call DisplayTextToPlayer(pTrigg,0,0, "You´ve gained 50 gold")
//Dusthill
elseif(iTrigg == 'h011') then
call DisplayTextToForce(udg_PlayersAll, "The dusthill has been destroyed. The view of the falling constructions increases it´s destroyers´ bloodlust even more")
call KillDestructable( gg_dest_B00O_0134 )
call TriggerSleepAction(0.1)
call KillDestructable( gg_dest_B00O_0133 )
call TriggerSleepAction(0.1)
call KillDestructable( gg_dest_B00O_0132 )
call Despair(locTrigg, GetOwningPlayer(uKill))
//Jatoernheimr
elseif(iTrigg == 'unp2') then
call DisplayTextToForce(udg_PlayersAll, "Jatoernheimr the Carras Citadel has fallen. The remaining people doubt that they will survive")
call Despair(locTrigg, GetOwningPlayer(uKill))
//Icegard
elseif(iTrigg == 'o003') then
call Fury(locTrigg, pTrigg)
call DisplayTextToForce(udg_PlayersAll, "The Troll´s mainbuilding - Icegard - has fallen. This unleashes it´s survivors´ fury.")
set tempgroup = CreateNUnitsAtLoc( 15, 'o005', Player(1), locTrigg, bj_UNIT_FACING )
call DestroyGroup(tempgroup)
//Criminals who hate Voratoll --> If you read this comment: He killed some people for his position
//Location
set temploc = GetUnitLoc(udg_uVoratoll)
if( GetLocationX(temploc) - 2000 < 1000 and GetLocationY(temploc) -123450 < 1000) then
call UnitDamageTarget(udg_uDmgDummy, udg_uVoratoll, 400.00, true, false, ATTACK_TYPE_MELEE, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
call DisplayTextToPlayer(Player(1), 0, 0, "Some radical trolls blame Voratoll for the fall of Icegard and tried to assassinate him in the trouble of the battle.")
endif
call RemoveLocation(temploc)
//Icestreamfortress
elseif(iTrigg == 'u00W') then
call DisplayTextToForce(udg_PlayersAll, "The Icestreamfortress has been destroyed. This lost strongly weakened the Iceeye tribe.")
call DisplayTextToPlayer(Player(2), 0, 0, "While loosing the Icestreamfortress the Grayfin tribe gained much power. You can no longer train Sheller Lords but you grant control of Tidehunters")
call SetPlayerTechMaxAllowed(Player(2), 'nwat', -1)
//MelithCasle
elseif(iTrigg == 'hcas') then
call Despair(locTrigg, pKill)
call DisplayTextToForce(udg_PlayersAll, "The Castle of Melith has fallen. Also the king disappeared but the people saw a little ship escaping Melith.")
set tempunit = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'hbot', 5048, -15312, 345.0)
call IssuePointOrder( tempunit, "move", 6732, -15590)
call TriggerSleepAction(0.8)
call SetUnitVertexColor(tempunit, 100,100,100, 90)
call TriggerSleepAction(0.2)
call SetUnitVertexColor(tempunit, 100,100,100, 80)
call TriggerSleepAction(0.2)
call SetUnitVertexColor(tempunit, 100,100,100, 60)
call TriggerSleepAction(0.2)
call SetUnitVertexColor(tempunit, 100,100,100, 30)
call TriggerSleepAction(0.2)
call RemoveUnit(tempunit)
//Iron Throne
elseif(iTrigg == 'ofrt') then
call Fury(locTrigg, pTrigg)
call DisplayTextToForce(udg_PlayersAll, "The Iron Throne - the throne of dwarves has fallen. It´s binding to the earth elements has been broken and the nearby earth elementals are running amok.")
if(TimerGetRemaining(udg_oTimerArray[1]) <= 0) then
return
endif
//if killed by Troglospyl: Magma-Elementals make them calm down
if(pKill == Player(8)) then
call SetPlayerTechResearched(pTrigg, 'Rhla', 1)
call DisplayTextToForce(udg_PlayersAll, "The unleashed elementals of the Ironthrone have been absorbed by the elemental forces of Troglospyl before they could cause any damage.")
else
call DisplayTextToForce(udg_PlayersAll, "The earth elementals cannot be controlled and caused urgent damage to the dwarvish caves.")
call TriggerExecute(gg_trg_Ironthrone)
endif
//Sharenar
elseif( iTrigg == 'etoe') then
call DisplayTextToForce(udg_PlayersAll, "Sharenar - the last elven forest has been destroyed and felt into corruption. The remaining spirits start a last despaired assault to revenge this.")
call SetBlight(pTrigg, -1360, -10300, 400, true)
call TriggerExecute(gg_trg_Sharenar_Death)
call Despair(locTrigg, pKill)
//Bluebeech-Forest: Demon-Onslaught
elseif(uTrigg == gg_unit_htow_0656) then
if(pKill == Player(6) or pKill == Player(7)) then
call DisplayTextToForce(udg_PlayersAll, "The Demon Invaders have destroyed the village of Silverwood in the Blue Beech Tree Forest. They recruit reinforcement from the survivors and summon more demons.")
call TriggerExecute(gg_trg_BlueBeechTreeOnslaught)
endif
//Troglospyl-City
elseif(iTrigg == 'h01C') then
call Despair(locTrigg, GetOwningPlayer(uKill))
call DisplayTextToForce(udg_PlayersAll, "The center of Troglospyl City has been burned to the ground and it´s inhabitants see their empire falling a second time. The victory becomes more and more unlikely.")
call TriggerExecute(gg_trg_CCRetreatTroglospyl)
//Pig-Town
elseif(iTrigg == 'h00R') then
call DisplayTextToForce(udg_PlayersAll, "The underground of the Pigmen city has fallen. Will the Pigmen survive?")
call TriggerExecute(gg_trg_CCRetreatPigclans)
//Tor balak
elseif( iTrigg == 'o00T') then
call TriggerExecute(gg_trg_Tor_balak_Death)
call DisplayTextToForce(udg_PlayersAll, "Tor´balak the halls of devastation have been devastated - ironically. The Ete´terro trolls are starting their revenge.")
call TriggerSleepAction(0.3)
call Fury(locTrigg, pTrigg)
call TriggerExecute(gg_trg_CCRetreatEteTerro)
//Golden Palace
elseif(iTrigg == 'u011') then
call Despair(locTrigg, pKill)
call DisplayTextToForce(udg_PlayersAll, "The Golden Palace of Eugene the glorious one has been raided! The Goldseeker Legion looses 33% of their current gold to the attacker.")
set i = GetPlayerState(pTrigg, PLAYER_STATE_RESOURCE_GOLD)
call SetPlayerState(pTrigg, PLAYER_STATE_RESOURCE_GOLD, 2*i/3)
call SetPlayerState(pKill, PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(pKill, PLAYER_STATE_RESOURCE_GOLD) + i/3)
//Slaugther-House
elseif(iTrigg == 'u00R') then
if(pKill == Player(0) or pKill == Player(1) or pKill == Player(2))then
call DisplayTextToForce(udg_PlayersAll, "The Slaugtherhouse has been destroyed and the imprisoned people can finally return home but will always remember the dark experiments and immolations.")
set tempgroup = CreateNUnitsAtLoc(7, 'ugho', pKill, locTrigg, 225)
call DestroyGroup(tempgroup)
set tempgroup = CreateNUnitsAtLoc(5, 'e00A', pKill, locTrigg, 225)
call DestroyGroup(tempgroup)
set tempgroup = CreateNUnitsAtLoc(2, 'o00E', pKill, locTrigg, 225)
call DestroyGroup(tempgroup)
else
call DisplayTextToForce(udg_PlayersAll, "The Slaugtherhouse has been destroyed but the destroyers haven´t shown mercy to the imprisoned blulales.")
loop
call KillUnit(CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE), 'ugho', locTrigg, 225))
set i = i + 1
exitwhen i == 4
endloop
endif
//Bluelalen Outpost in Keria
elseif( uTrigg == gg_unit_unpl_0582) then
call DisplayTextToForce(udg_PlayersAll, "The Carras Outpost in Keria the desert of lonelines has finally fallen to his aggressors.")
call Despair(locTrigg, pKill)
//Zeth´arul s Tower
elseif(iTrigg == 'o00C') then
call DisplayTextToForce(udg_PlayersAll, "The Tower of Zeth´arul has fallen. The blulalen southern border is shattered.")
call Despair(locTrigg, pKill)
//Elven Frontline
elseif(uTrigg == gg_unit_etol_0631) then
call DisplayTextToForce(udg_PlayersAll, "The elven frontline at the very southern end of bloodbath valley has fallen. The surrounding area begins to decay.")
call SetBlightLoc(pTrigg, locTrigg, 400, true)
call Despair(locTrigg, pKill)
//Human City next to Dusthill --> Battleships for Conqueror (maybe)
elseif(uTrigg == gg_unit_htow_0606) then
//Dark Nexus, Sharrazor, Skrullos, Dannimos
elseif(iTrigg == 'u00C' or iTrigg == 'Uwar' or iTrigg == 'Ulic' or iTrigg == 'Ucrl' ) then
if(iTrigg == 'u00C' ) then
call DisplayTextToForce(udg_PlayersAll, "The Dark Nexus - center of the Cult of the Black Hand in Theosa - has fallen. The moral sinks but they fight until the bitter end. Furthermore they lose control over the volcano causing a small eruption")
call TriggerExecute(gg_trg_DarkNexus)
call TriggerSleepAction(2.0)
call Despair(locTrigg, pTrigg)
//Eruption
set tempunit = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'h00I', -13350.0 , -18778.0, 0.0)
call UnitAddAbility(tempunit, 'ACbc')
call IssuePointOrder(tempunit, "breathoffire", -13300.0, -18778.0)
set tempunit = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'h00I', -13350.0 , -18778.0, 90.0)
call UnitAddAbility(tempunit, 'ACbc')
call IssuePointOrder(tempunit, "breathoffire", -13350.0, -18700.0)
set tempunit = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'h00I', -13350.0 , -18778.0, 180.0)
call UnitAddAbility(tempunit, 'ACbc')
call IssuePointOrder(tempunit, "breathoffire", -13400.0, -18778.0)
set tempunit = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'h00I', -13350.0 , -18778.0, 360.0)
call UnitAddAbility(tempunit, 'ACbc')
call IssuePointOrder(tempunit, "breathoffire", -13350.0, -18820.0)
endif
set udg_iDemonCommanderDeads = udg_iDemonCommanderDeads + 1
call TriggerExecute(gg_trg_DemonCommandDeath)
//Dark Citadel
elseif(iTrigg == 'u005') then
call Fury(locTrigg, pTrigg)
call TriggerExecute(gg_trg_DemonCommandDeath)
call DisplayTextToForce(udg_PlayersAll, "The Dark Citadel of the Doombringer Legion has been destroyed. The black forces begin to have great loses.")
//Kasaa
elseif(iTrigg == 'n01K') then
call ConditionalTriggerExecute( gg_trg_Kasaa )
//Cult Outpost Purgatory Swamps
elseif(uTrigg == gg_unit_n02J_0666) then
call DisplayTextToForce(udg_PlayersAll, "An outpost of the Cult of the black Hand in the purgatory swamps has been destroyed. The remaining Shadow Bandits fight for their life. Some of them start a rebellion because they forced to serve the cult.")
loop
if( GetRandomInt(0, 10) < 5) then
call CreateUnitAtLoc(pTrigg, 'u00H', locTrigg, 45.0)
else
call CreateUnitAtLoc(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'u00H', locTrigg, 45.0)
endif
set i = i +1
exitwhen i == 13
endloop
//Blood Bath Valley Control Point
elseif(uTrigg == gg_unit_n024_0527) then
call DisplayTextToForce(udg_PlayersAll, "The Center of Bloodbath Valley has been reclaimed once more by a bloodfirsty warrior. The Goblins of the Theosanien Battle-Club reward this couragenous with 100 gold.")
//Arthur Blackmoore
elseif(iTrigg == 'U012') then
call DisplayTextToForce(udg_PlayersAll, "The old undead king Arthur Blackmoore died once more and has been released from the Cult´s Will. Maybe he can finally find the peace of death.")
//FireleafpassFlag
elseif (iTrigg == 'nef5') then
call Fireleafpass(pKill)
endif
set uTrigg = null
set pTrigg = null
set uKill = null
set pKill = null
call RemoveLocation(locTrigg)
endfunction
//===========================================================================
function InitTrig_InitTriggerKills takes nothing returns nothing
set gg_trg_InitTriggerKills = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_InitTriggerKills, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_InitTriggerKills, function Trig_InitTriggerKills_Actions )
endfunction
//TESH.scrollpos=53
//TESH.alwaysfold=0
function Trig_InitTriggerBuildingFinished_Func004Func002Func003A takes nothing returns nothing
call CreateNUnitsAtLoc( 3, 'nele', Player(PLAYER_NEUTRAL_AGGRESSIVE), GetUnitLoc(GetEnumUnit()), bj_UNIT_FACING )
call CreateNUnitsAtLoc( 1, 'njgb', Player(PLAYER_NEUTRAL_AGGRESSIVE), GetUnitLoc(GetEnumUnit()), bj_UNIT_FACING )
endfunction
function Trig_InitTriggerBuildingFinished_Actions takes nothing returns nothing
local unit uTrigg
local player pTrigg
local integer iUnit
local integer iRandom
local location temploc
local group tempgroup
set uTrigg = GetTriggerUnit()
set pTrigg = GetOwningPlayer(uTrigg)
call TriggerSleepAction( 1.00 )
set iUnit = GetUnitTypeId(uTrigg)
//Sheller Craftig Level
if(pTrigg == Player(2)) then
//TrainingPlots ausschließen
if(GetUnitPointValue(uTrigg) == 99) then
return
endif
//Building Project
if(iUnit == 'nvr0' and GetPlayerTechCount(pTrigg,'Resm', true) != 5)then
call SetPlayerTechResearched(pTrigg,'Resm', GetPlayerTechCount(pTrigg,'Resm', true)+1)
call DisplayTextToPlayer(pTrigg, 0 , 0, "You gained 1 Crafting Point!")
return
endif
if (GetPlayerTechCount(pTrigg,'Resm', true) == 5) then
else
set iRandom = GetRandomInt(1, 100)
if (iRandom < 20) then
call SetPlayerTechResearched(pTrigg,'Resm', GetPlayerTechCount(pTrigg,'Resm', true)+1)
call DisplayTextToPlayer(pTrigg, 0 , 0, "You gained 1 Crafting Point!")
endif
return
endif
endif
// Pigclans-Ulti
// Kasaa s Loyalists
if ( iUnit == 'nefm' ) then
call SetPlayerTechResearched(pTrigg, 'Rhcd', 1 )
call DisplayTextToForce(udg_PlayersAll, "The Pigclans found the tomb of Kasaa and chose one´s more to serve him. The tomb of Kasaa staies closed and the Pigclans gained Kasaa´s Boon making their units stronger!")
// Tomb Raiders
elseif ( iUnit == 'nef0' ) then
call UnitAddAbility(gg_unit_nef3_0483 , 'A0EI')
call UnitAddAbility(gg_unit_nef3_0485 , 'A0EI')
call DisplayTextToForce(udg_PlayersAll, "The Pigclans found the tomb of Kasaa and chose not to serve him anymore but to raid the old tombs which unlocks the tomb of Kasaa. They gain two powerful items but unleash the fury of Kasaa!")
call WaygateActivate(gg_unit_n013_0480, true)
set temploc = GetRectCenter(gg_rct_KasaaCryptInside)
call WaygateSetDestination(gg_unit_n013_0480, GetLocationX(temploc), GetLocationY(temploc))
call RemoveLocation(temploc)
call DisplayTextToForce(udg_PlayersAll, "The fury of Kasaa will be unleashed in 60 seconds. Prepare your defences!")
call TriggerSleepAction(60.0)
if(TimerGetRemaining(udg_oTimerArray[1]) > 0) then
call DisplayTextToForce(udg_PlayersAll, "Kasaa unleashes his fury. His beasts appear at every Control Point.")
set tempgroup = GetUnitsOfTypeIdAll('n024')
call ForGroupBJ( tempgroup, function Trig_InitTriggerBuildingFinished_Func004Func002Func003A )
call DestroyGroup(tempgroup)
else
call DisplayTextToForce(udg_PlayersAll, "Kasaa couldn't unleash his fury because he has been killed by the mighty Suddendeath-Death")
endif
//Best Training
elseif (iUnit == 'nef1') then
call SetPlayerTechMaxAllowed(pTrigg, 'hkni', 3 )
call SetPlayerTechMaxAllowed(pTrigg, 'hdhw', 3)
call SetPlayerTechMaxAllowed(pTrigg, 'hgry', 5 )
call SetPlayerTechMaxAllowed(pTrigg, 'hcth', 5 )
//Sorcerer s Power
elseif (iUnit == 'nef2') then
call SetPlayerTechResearched(pTrigg, 'Rhst',1)
//Great Void Portal
elseif ( uTrigg == gg_unit_n01V_0515 ) then
set udg_iSharrazorCond = udg_iSharrazorCond + 1
call DisplayTextToForce(udg_PlayersAll, "The Demon Invaders have constructed the Great Void Portal. Now they can summon even more and darker Demons")
call TriggerExecute( gg_trg_Sharrazor )
endif
set uTrigg = null
set pTrigg = null
set temploc = null
set tempgroup = null
endfunction
//===========================================================================
function InitTrig_InitTriggerBuildingFinished takes nothing returns nothing
set gg_trg_InitTriggerBuildingFinished = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_InitTriggerBuildingFinished, EVENT_PLAYER_UNIT_UPGRADE_FINISH )
call TriggerAddAction( gg_trg_InitTriggerBuildingFinished, function Trig_InitTriggerBuildingFinished_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
//If any other stuff is added then remove the call which removes this trigger after Skrullos therar has been summoned
function Trig_InitUnitTrainingFinished_Actions takes nothing returns nothing
local unit uTrigg = GetTriggerUnit()
local unit uTrain = GetTrainedUnit()
local player pTrigg = GetOwningPlayer(uTrigg)
//Skrullos therar
if ( GetUnitTypeId(uTrain) == 'Uwar' ) then
if(udg_arr_iPlayersInForce[2] < 2) then
call RemoveUnit(uTrain)
call DisplayTextToPlayer(pTrigg, 0, 0, "Unfortunately the Doombringer Legion has been defeated and Skrullos´therar does not think that the tide of war will turn soon enough.")
else
call SetUnitOwner( uTrain, Player(7), true )
call DisplayTextToForce(udg_PlayersAll, "The Demonlord Skrullos'therar has been summoned to the world of Theosa to lead the assault upon the mortals")
endif
call KillUnit( uTrigg )
call SetPlayerUnitAvailableBJ( 'Uwar', false, Player(6) )
call DestroyTrigger(gg_trg_InitUnitTrainingFinished)
else
endif
endfunction
//===========================================================================
function InitTrig_InitUnitTrainingFinished takes nothing returns nothing
set gg_trg_InitUnitTrainingFinished = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_InitUnitTrainingFinished, EVENT_PLAYER_UNIT_TRAIN_FINISH )
call TriggerAddAction( gg_trg_InitUnitTrainingFinished, function Trig_InitUnitTrainingFinished_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_BlueBeechTreeOnslaught_Actions takes nothing returns nothing
if ( udg_bPlayerAlive[6]) then
call CreateUnit(Player(6), 'u00D', -3892, -3121, 270.0)
call CreateUnit(Player(6), 'u00D', -3842, -3121, 270.0)
call CreateUnit(Player(6), 'u00D', -3757, -3121, 270.0)
call CreateUnit(Player(6), 'u00D', -3892, -3051, 270.0)
call CreateUnit(Player(6), 'u00D', -3842, -3051, 270.0)
call CreateUnit(Player(6), 'u00D', -3757, -3051, 270.0)
call CreateUnit(Player(6), 'u00D', -3880, -3247, 270.0)
call CreateUnit(Player(6), 'u00J', -4777, -2924, 345.0)
call CreateUnit(Player(6), 'u00J', -4702, -2836, 345.0)
call CreateUnit(Player(6), 'u00J', -4604, -2745, 345.0)
call CreateUnit(Player(6), 'u00J', -4822, -2832, 345.0)
call CreateUnit(Player(6), 'u00J', -4718, -2763, 345.0)
call CreateUnit(Player(6), 'u00L', -3846, -3711, 160.0)
endif
if(udg_bPlayerAlive[7]) then
call CreateUnit(Player(7), 'n01T', -4802, -3641, 0.0)
call CreateUnit(Player(7), 'n01T', -4802, -3685, 0.0)
call CreateUnit(Player(7), 'n01T', -4802, -3720, 0.0)
call CreateUnit(Player(7), 'n01T', -4752, -3641, 0.0)
call CreateUnit(Player(7), 'n01T', -4752, -3685, 0.0)
call CreateUnit(Player(7), 'n01T', -4752, -3720, 0.0)
call CreateUnit(Player(7), 'n02B', -4214, -4035, 0.0)
call CreateUnit(Player(7), 'n02B', -4291, -4035, 0.0)
call CreateUnit(Player(7), 'n02B', -4214, -3948, 0.0)
call CreateUnit(Player(7), 'n02B', -4291, -3948, 0.0)
call CreateUnit(Player(7), 'n02X', -4173, -3757, 145.0)
endif
endfunction
//===========================================================================
function InitTrig_BlueBeechTreeOnslaught takes nothing returns nothing
set gg_trg_BlueBeechTreeOnslaught = CreateTrigger( )
call TriggerAddAction( gg_trg_BlueBeechTreeOnslaught, function Trig_BlueBeechTreeOnslaught_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_CCRetreatTroglospyl_Actions takes nothing returns nothing
local integer ic = 0
call DisplayTextToPlayer(Player(8), 0, 0, "You lost your capital and the only option for now seems to fall back to the desert of Kasaa. Lawrencar - a loyalist who greatly influenced the cartell´s formation - has prepared a small camp there.")
// 1xThieve s Camp
call CreateUnit(Player(8), 'h015', 6628, -1465, bj_UNIT_FACING )
// 2xFarms
call CreateUnit(Player(8), 'h018', 7047, -1297, bj_UNIT_FACING )
call CreateUnit(Player(8), 'h018', 7200, -1537, bj_UNIT_FACING )
// 1xTower
call CreateUnit(Player(8), 'h017', 7123, -1872, bj_UNIT_FACING )
// 1xSanctuary of Magma (if researched)
if(GetPlayerTechResearched(Player(8), 'R054', true)) then
call CreateUnit(Player(8), 'h016', 6774, -957, bj_UNIT_FACING )
endif
// 5xRogue
loop
call CreateUnit(Player(8), 'h01L', 6596, -1168, bj_UNIT_FACING )
set ic = ic + 1
exitwhen ic == 5
endloop
set ic = 0
// 1xSlaves
call CreateUnit(Player(8), 'h00G', 6851, -1309, bj_UNIT_FACING )
// 3xBrawler
call CreateUnit(Player(8), 'h01M', 7310, -1200, bj_UNIT_FACING )
call CreateUnit(Player(8), 'h01M', 7310, -1200, bj_UNIT_FACING )
call CreateUnit(Player(8), 'h01M', 7310, -1200, bj_UNIT_FACING )
endfunction
//===========================================================================
function InitTrig_CCRetreatTroglospyl takes nothing returns nothing
set gg_trg_CCRetreatTroglospyl = CreateTrigger( )
call TriggerAddAction( gg_trg_CCRetreatTroglospyl, function Trig_CCRetreatTroglospyl_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_CCRetreatPigclans_Actions takes nothing returns nothing
local integer ic = 0
call DisplayTextToPlayer(Player(9), 0, 0, "Some of your troops managed to gather some ressources from your destroyed capital. They fled through escape tunnel to the desert of Kasaa hoping be safe there.")
// 100 Gold
call AdjustPlayerStateBJ( 100, Player(9), PLAYER_STATE_RESOURCE_GOLD )
// 2 Felguards
call CreateUnit( Player(9), 'h00T', 7955, -32, bj_UNIT_FACING )
call CreateUnit( Player(9), 'h00T', 7955, -32, bj_UNIT_FACING )
// 5 Grunts
loop
call CreateUnit( Player(9), 'h012', 7850, 295 , bj_UNIT_FACING )
set ic = ic + 1
exitwhen ic == 5
endloop
// 1 Truffleseeker
call CreateUnit( Player(9), 'h00E', 8277, 145 , bj_UNIT_FACING )
endfunction
//===========================================================================
function InitTrig_CCRetreatPigclans takes nothing returns nothing
set gg_trg_CCRetreatPigclans = CreateTrigger( )
call TriggerAddAction( gg_trg_CCRetreatPigclans, function Trig_CCRetreatPigclans_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_CCRetreatEteTerro_Actions takes nothing returns nothing
local integer ic = 0
call DisplayTextToPlayer( Player(10), 0, 0, "After the destruction of Tor´balak you can only flee and hope that the agent of Troglospyl - who is called Lawrencar - has proven usefull and prepared a camp at the dessert of Kasaa.")
// 1 Thunderstorm Painpriest
call CreateUnit( Player(10), 'o010', 6379, 289, bj_UNIT_FACING )
// 2 Voodoolords
call CreateUnit( Player(10), 'o012', 6379, 2, bj_UNIT_FACING )
// 2 Assemblytotems
call CreateUnit( Player(10), 'n03M', 5922, 393, bj_UNIT_FACING )
call CreateUnit( Player(10), 'n03M', 6008, -21, bj_UNIT_FACING )
// 2 Hunters House
call CreateUnit( Player(10), 'n03N', 6688, 730, bj_UNIT_FACING )
call CreateUnit( Player(10), 'n03N', 6818, 428, bj_UNIT_FACING )
// 15 Splitters
loop
call CreateUnit( Player(10), 'o00U', 6557, 107, bj_UNIT_FACING )
set ic = ic + 1
exitwhen ic == 15
endloop
endfunction
//===========================================================================
function InitTrig_CCRetreatEteTerro takes nothing returns nothing
set gg_trg_CCRetreatEteTerro = CreateTrigger( )
call TriggerAddAction( gg_trg_CCRetreatEteTerro, function Trig_CCRetreatEteTerro_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_DarkNexus_Actions takes nothing returns nothing
local integer i = 0
if(udg_bPlayerAlive[7]) then
//Voidwalker
loop
call CreateUnit(Player(7), 'n02I', -12672, -17918, bj_UNIT_FACING )
set i = i + 1
exitwhen i == 5
endloop
set i = 0
loop
call CreateUnit(Player(7), 'n02I', -13777, -17962, bj_UNIT_FACING )
set i = i + 1
exitwhen i == 5
endloop
set i = 0
loop
call CreateUnit(Player(7), 'n02I', -14328, -19191, bj_UNIT_FACING )
set i = i + 1
exitwhen i == 5
endloop
set i = 0
//Guards
loop
call CreateUnit(Player(7), 'n02B', -12672, -17918, bj_UNIT_FACING )
set i = i + 1
exitwhen i == 3
endloop
set i = 0
loop
call CreateUnit(Player(7), 'n02B', -14458, -18438, bj_UNIT_FACING )
set i = i + 1
exitwhen i == 3
endloop
set i = 0
endif
//Cultists
loop
call CreateUnit(Player(6), 'u00J', -12199, -18666, bj_UNIT_FACING )
set i = i + 1
exitwhen i == 7
endloop
set i = 0
loop
call CreateUnit(Player(6), 'u00J', -13352, -18767, bj_UNIT_FACING )
set i = i + 1
exitwhen i == 7
endloop
set i = 0
//Champions
loop
call CreateUnit(Player(6), 'u00M', -12339, -18269, bj_UNIT_FACING )
set i = i + 1
exitwhen i == 3
endloop
endfunction
//===========================================================================
function InitTrig_DarkNexus takes nothing returns nothing
set gg_trg_DarkNexus = CreateTrigger( )
call TriggerAddAction( gg_trg_DarkNexus, function Trig_DarkNexus_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function KillEnumUnit takes nothing returns nothing
call KillUnit( GetEnumUnit() )
endfunction
function Trig_DemonCommandDeath_Actions takes nothing returns nothing
local group tempgroup
if ( udg_iDemonCommanderDeads == 5 ) then
call DisplayTextToForce( udg_PlayersAll, "The Demon Invaders lost all mainbases and their great leaders in this world. They have lost this war and prepare to leave this world in order to return with a stronger army.\nThey will lose in 3 minutes." )
set tempgroup = GetUnitsOfPlayerAll(Player(6))
call ForGroupBJ( tempgroup, function KillEnumUnit )
call DestroyGroup(tempgroup)
set tempgroup = GetUnitsOfPlayerAll(Player(7))
call ForGroupBJ( tempgroup, function KillEnumUnit )
call DestroyGroup(tempgroup)
endif
endfunction
//===========================================================================
function InitTrig_DemonCommandDeath takes nothing returns nothing
set gg_trg_DemonCommandDeath = CreateTrigger( )
call TriggerAddAction( gg_trg_DemonCommandDeath, function Trig_DemonCommandDeath_Actions )
endfunction
//TESH.scrollpos=34
//TESH.alwaysfold=0
function Trig_ElfClean_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'edcm' ) ) then
return false
endif
return true
endfunction
function ReplaceNorthendTrees takes nothing returns nothing
local location temploc
local integer ir
if ( GetDestructableTypeId(GetEnumDestructable()) == 'NTtw' ) then
set ir = GetRandomInt(0, 2)
set temploc = GetDestructableLoc(GetEnumDestructable())
call RemoveDestructable( GetEnumDestructable() )
call CreateDestructableLoc( 'ZTtw', temploc, GetRandomDirectionDeg(), 1, ir )
endif
endfunction
function Trig_ElfClean_Actions takes nothing returns nothing
local unit uTrigg = GetTriggerUnit()
local location locTrigg = GetUnitLoc(uTrigg)
local location temploc
local integer ic = 0 //used in loops
//PurgatorySwamps is cleaned after 2 summons
if( RectContainsCoords(gg_rct_PurgatorySwampDecayed, GetUnitX(uTrigg), GetUnitY(uTrigg)) and udg_arr_iElfClean[0] < 2) then
set udg_arr_iElfClean[0] = udg_arr_iElfClean[0] + 1
if(udg_arr_iElfClean[0] == 2) then
call DisplayTextToForce(udg_PlayersAll, "The elves have cleaned the Purgatory Swamps from many diseases. The region is now able to recover from the suffer. Also the local Firewood Ents have become active again and will support the elvish forces.")
loop
call CreateUnitAtLoc(Player(5), 'nssn', locTrigg, 270.0)
set ic = ic + 1
exitwhen ic == 5
endloop
set ic = 0
loop
set temploc = GetRectCenter(gg_rct_PurgatorySwampDecayed)
call SetBlightLoc(Player(PLAYER_NEUTRAL_PASSIVE), temploc, 750, false)
call SetTerrainTypeBJ( temploc, 'Lgrd', -1, 10, 0 )
call SetTerrainTypeBJ( temploc, 'Agrd', -1, 5, 0 )
call RemoveLocation(temploc)
set ic = ic + 1
exitwhen ic == 3
endloop
endif
//DeadMansDecent is cleaned after 3 summons
elseif (RectContainsCoords(gg_rct_DeadMansDecentDecay, GetUnitX(uTrigg), GetUnitY(uTrigg))) then
set udg_arr_iElfClean[1] = udg_arr_iElfClean[1] + 1
if(udg_arr_iElfClean[1] == 3) then
call DisplayTextToForce(udg_PlayersAll, "The elves have cured the Dead Man´s Decent from the dark curses laying over it. The jungle can no regrow again and thanks the elves with mighty Deadwoodcedar Ents to support their cause.")
loop
call CreateUnitAtLoc(Player(5), 'eshd', locTrigg, 270.0)
set ic = ic + 1
exitwhen ic == 8
endloop
set ic = 0
loop
set temploc = GetRandomLocInRect(gg_rct_DeadMansDecentDecay)
call SetBlightLoc(Player(PLAYER_NEUTRAL_PASSIVE), temploc, 750, false)
call SetTerrainTypeBJ( temploc, 'Lgrd', -1, 9, 0 )
call SetTerrainTypeBJ( temploc, 'Agrd', -1, 4, 0 )
call RemoveLocation(temploc)
set ic = ic + 1
exitwhen ic == 6
endloop
call EnumDestructablesInRect( gg_rct_DeadMansDecentDecay, null, function ReplaceNorthendTrees )
endif
endif
call RemoveLocation(locTrigg)
if(udg_arr_iElfClean[0] == 2 and udg_arr_iElfClean[1] == 3) then
call DestroyTrigger(gg_trg_ElfClean)
endif
endfunction
//===========================================================================
function InitTrig_ElfClean takes nothing returns nothing
set gg_trg_ElfClean = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_ElfClean, gg_rct_PurgatorySwampDecayed )
call TriggerRegisterEnterRectSimple( gg_trg_ElfClean, gg_rct_DeadMansDecentDecay )
call TriggerAddCondition( gg_trg_ElfClean, Condition( function Trig_ElfClean_Conditions ) )
call TriggerAddAction( gg_trg_ElfClean, function Trig_ElfClean_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Erlking_Actions takes nothing returns nothing
local unit uTrigg = GetDyingUnit()
local unit uKill = GetKillingUnit()
local player pKill = GetOwningPlayer(uKill)
local location l = GetUnitLoc(GetDyingUnit())
local location temploc
if ( pKill == Player(6) or pKill == Player(7) ) then
set temploc = GetRandomLocInRect(gg_rct_UnitCache)
call CreateUnitAtLoc(ConvertedPlayer(7), 'nalb', temploc, 270)
call RemoveLocation(temploc)
call DisplayTextToForce( udg_PlayersAll, "The Erlking has been killed by the Demon Invaders. The Cult of the Black Hand now has access to Necromancers!")
call DisplayTextToForce( udg_PlayersAll, "Furthermore the Undead King Arthur Blackmoore has joined the forces of the Cult")
call CreateUnitAtLoc(Player(6), 'U012', l, 180)
call TriggerSleepAction(3.0)
call DisplayTextToForce( udg_PlayersAll, "Once Blackmoore tried to protect his kingdom against the evil Erlking but now he is enslaved by those who killed his Tormentor.")
else
call DisplayTextToForce(udg_PlayersAll, "The Erlking has been killed by Theosanien forces. His knowledge about Necromancy is lost forever")
call DisplayTextToPlayer(Player(6),0, 0 , "You´ve missed to kill the Erlking. Now you won´t be able to train Necromancers!")
endif
set uTrigg = null
set uKill = null
set pKill = null
call RemoveLocation(l)
set l = null
endfunction
//===========================================================================
function InitTrig_Erlking takes nothing returns nothing
set gg_trg_Erlking = CreateTrigger( )
call TriggerAddAction( gg_trg_Erlking, function Trig_Erlking_Actions )
endfunction
//TESH.scrollpos=15
//TESH.alwaysfold=0
function DamageUnit takes unit u returns nothing
if (GetRandomInt(1, 10) >= 5) then
call UnitDamageTargetBJ( udg_uDmgDummy, u, 50.00, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_NORMAL )
else
endif
endfunction
function CreateUnits takes nothing returns nothing
//Elites
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'okod', 15588, -19874, 180.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'okod', 14957, -18047, 0.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'okod', 14360, -18364, 90.0)
call TriggerSleepAction(0.6)
//Commons
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'ngst', 14542, -19622, 25.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'ngst', 15802, -19062, 180.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'ngst', 15607, -18116, 315.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'ngst', 15817, -17243, 180.0)
call TriggerSleepAction(2.0)
//Units Outside
//Elites
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'okod', 5419, -12248, 70.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'okod', 8576, -10977, 270.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'okod', 8913, -11334, 225.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'okod', 8387, -12282, 35.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'okod', 2392, -8193, 200.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'okod', 3001, -10162, 45.0)
//Commons
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'ngst', 4941, -12049, 20.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'ngst', 4575, -11376, 270.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'ngst', 9287, -12374, 315.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'ngst', 8478, -12554, 180.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'ngst', 8417, -11514, 25.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'ngst', 1982, -9311, 315.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'ngst', 3381, -9536, 225.0)
call CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'ngst', 1816, -7917, 180.0)
endfunction
function Trig_Ironthrone_Actions takes nothing returns nothing
local group Units = GetUnitsInRectAll(gg_rct_Stonezan)
loop
exitwhen(CountUnitsInGroup(Units) == 0)
call DamageUnit(FirstOfGroup(Units))
call GroupRemoveUnit(Units,FirstOfGroup(Units))
endloop
call CreateUnits()
call DestroyGroup(Units)
set Units = null
endfunction
//===========================================================================
function InitTrig_Ironthrone takes nothing returns nothing
set gg_trg_Ironthrone = CreateTrigger( )
call TriggerAddAction( gg_trg_Ironthrone, function Trig_Ironthrone_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Milthar_Actions takes nothing returns nothing
local unit uTrigg = GetTriggerUnit()
local player pTrigg = GetOwningPlayer(uTrigg)
if(pTrigg == Player(3) or pTrigg == Player(4) or pTrigg == Player(5)) then
call DisableTrigger(gg_trg_Milthar)
call DisplayTextToForce(udg_PlayersAll, "The dwarvish city of Milthar has been found by the Stranded Alliance. The dwarves can finally reclaim this city but it looks like other beeings have taken over this place.")
call TriggerSleepAction(0.2)
call DisplayTextToPlayer(Player(4), 0, 0, "You will get control of the buildings inside Milthar in 45 seconds. Enemies within it will attack them if they haven´t been destroyed yet.")
call TriggerSleepAction(45.0)
call SetUnitOwner( gg_unit_otrb_0292, Player(4), true )
call SetUnitOwner( gg_unit_obar_0296, Player(4), true )
call SetUnitOwner( gg_unit_ovln_0290, Player(4), true )
call SetUnitOwner( gg_unit_owtw_0285, Player(4), true )
call SetUnitOwner( gg_unit_owtw_0279, Player(4), true )
call DestroyTrigger(gg_trg_Milthar)
endif
endfunction
//===========================================================================
function InitTrig_Milthar takes nothing returns nothing
set gg_trg_Milthar = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Milthar, gg_rct_MiltharCity )
call TriggerAddAction( gg_trg_Milthar, function Trig_Milthar_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Morbeen_Actions takes nothing returns nothing
local location temploc
set temploc = GetRectCenter(gg_rct_DwarvenSpawnpoint)
call SetUnitPositionLoc( gg_unit_Ocb2_0053, temploc )
call RemoveLocation(temploc)
call SetUnitOwner( gg_unit_Ocb2_0053, Player(4), true )
set temploc = GetRectCenter(gg_rct_TrollsSpawnpoint)
call SetUnitPositionLoc( gg_unit_Ocbh_0078, temploc )
call RemoveLocation(temploc)
call SetUnitOwner( gg_unit_Ocbh_0078, Player(1), true )
call DisplayTextToForce( udg_PlayersAll, "The Demonic Fiend Morbeen has been killed but he´s been only the messager of a far bigger evil.\nThe Titans Sulfas and Saresha who have been hunting Morbeen see their objective finished but know that they have to help the mortals of this world.\nSulfas joins the Blulalen Trolls and his Sister Saresha joins the Dwarves of the Stranded Alliance." )
set udg_iSharrazorCond = ( udg_iSharrazorCond + 1 )
call ConditionalTriggerExecute( gg_trg_Sharrazor )
endfunction
//===========================================================================
function InitTrig_Morbeen takes nothing returns nothing
set gg_trg_Morbeen = CreateTrigger( )
call TriggerAddAction( gg_trg_Morbeen, function Trig_Morbeen_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Sharenar_Death_Actions takes nothing returns nothing
call CreateUnit(Player(5), 'efdr', -900, - 10893, 100.0)
call CreateUnit(Player(5), 'efdr', -1041, - 10896, 100.0)
call CreateUnit(Player(5), 'efdr', -629, - 10579, 100.0)
call CreateUnit(Player(5), 'efdr', -1251, - 11347, 100.0)
call CreateUnit(Player(5), 'efdr', -1659, - 11213, 100.0)
call CreateUnit(Player(5), 'efdr', -1930, - 11069, 100.0)
call CreateUnit(Player(5), 'efdr', -2052, - 10662, 100.0)
call CreateUnit(Player(5), 'efdr', -1968, - 10227, 100.0)
call CreateUnit(Player(5), 'efdr', -1775, - 10138, 100.0)
call CreateUnit(Player(5), 'efdr', -1104, - 9913, 100.0)
call CreateUnit(Player(5), 'efdr', -541, - 9849, 100.0)
call CreateUnit(Player(5), 'efdr', -418, - 10218, 100.0)
call CreateUnit(Player(5), 'efdr', -851, - 10408, 100.0)
endfunction
//===========================================================================
function InitTrig_Sharenar_Death takes nothing returns nothing
set gg_trg_Sharenar_Death = CreateTrigger( )
call TriggerAddAction( gg_trg_Sharenar_Death, function Trig_Sharenar_Death_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Sharrazor_Actions takes nothing returns nothing
if ( udg_iSharrazorCond == 2 ) then
call DisplayTextToForce(udg_PlayersAll, "The demonic Highexecutioner has been summoned by the Demon Invaders to eliminate important targets: Two Titans who have been spotted")
call SetUnitPosition( gg_unit_Ucrl_1409, GetRectCenterX(gg_rct_GreatVoidPortal), GetRectCenterY(gg_rct_GreatVoidPortal) )
call SetUnitOwner(gg_unit_Ucrl_1409, Player(7), true)
endif
endfunction
//===========================================================================
function InitTrig_Sharrazor takes nothing returns nothing
set gg_trg_Sharrazor = CreateTrigger( )
call TriggerAddAction( gg_trg_Sharrazor, function Trig_Sharrazor_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Tor_balak_Death_Actions takes nothing returns nothing
call CreateUnit(Player(10), 'o00U', 6710, 12285, 225.0)
call CreateUnit(Player(10), 'o00U', 5587, 12059, 225.0)
call CreateUnit(Player(10), 'o00U', 5895, 11959, 225.0)
call CreateUnit(Player(10), 'o00W', 6527, 12405, 225.0)
call CreateUnit(Player(10), 'o00Z', 6022, 12295, 225.0)
endfunction
//===========================================================================
function InitTrig_Tor_balak_Death takes nothing returns nothing
set gg_trg_Tor_balak_Death = CreateTrigger( )
call TriggerAddAction( gg_trg_Tor_balak_Death, function Trig_Tor_balak_Death_Actions )
endfunction
function Trig_Unbezeichneter_Ausl__ser_001_Actions takes nothing returns nothing
call ClearTextMessagesBJ( udg_PlayersAll )
endfunction
//===========================================================================
function InitTrig_Unbezeichneter_Ausl__ser_001 takes nothing returns nothing
set gg_trg_Unbezeichneter_Ausl__ser_001 = CreateTrigger( )
call TriggerAddAction( gg_trg_Unbezeichneter_Ausl__ser_001, function Trig_Unbezeichneter_Ausl__ser_001_Actions )
endfunction