1. Are you planning to upload your awesome map to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  5. Choose your ride to damnation in the 5th Special Effect Contest Poll.
    Dismiss Notice
  6. The winners of the 13th Techtree Contest have been announced!
    Dismiss Notice
  7. The 13th Music Contest Poll is up! Vote for the best tracks in this symphony of frost and flame.
    Dismiss Notice
  8. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Trigger Viewer

Wars of Theosa 1.15.5.w3x
Variables
Initialisierung
Initialisierung
Initialisierung
CreateVotingUnits
Einheitenbeschraenken
Texte
Infobook
Rallypoints
CreateUnits
Sudden Death Und Intro
ErhoehenUm15s
ErhoehenUm30
ErhoehenUm60
ErhoehenUm90
ErhoehenUm120
WillKeinSD
KeinSDGenehmigt
Waehl doch
IntroNo
IntroYes
EinheitHatGewaehlt
Anfangsfilm
AufSuddenDeathWarten
TimerUmstellen
Für Spieler
Game Gerüst
SpielerGeht
UsedItem
Building Plot
EinheitStirbtUndSiegBedingung
UpgradeStarted
Upgrade Stopped
Upgrade Finished
UnitCache
EinheitSpawnt
UnitFinishedUpgrade
Commands
StartCommands
Testvote
Skills
AllianceSkills
Autocasts
Blulales Skills
CrimeCartellSkills
DemonInvadersSkills
DoombringerFusion
Creep Skills
Casts
FaehigkeitenErlernen
GeneralSkill
Unit wird angegriffen
ZauberdummyEntfernen
CommandUnit
RallypointSetzen
CommandUnit
Brekana Deeps
Wasserschrein
Raus
Private
Sieg
Abspielen
Events
InitTriggerKills
InitTriggerBuildingFinished
InitUnitTrainingFinished
BlueBeechTreeOnslaught
CCRetreatTroglospyl
CCRetreatPigclans
CCRetreatEteTerro
DarkNexus
DemonCommandDeath
ElfClean
Erlking
Ironthrone
Kasaa
Milthar
Morbeen
Sharenar Death
Sharrazor
Tor balak Death
Testecke
Unbezeichneter Auslöser 001
Kartenspezifischen eigenen Skript-Code unten eingeben. Dieser Text wird in das Karten-Skript nach der Deklaration der Variablen und vor jeglichem Auslöser-Code eingefügt.
//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

 
Besonderheiten:
- Pigclans können je eine Einheit mehr machen, aber einen Peasant weniger
- Doombringer crafted Elites sind nicht betroffen
Einheitenbeschraenken
  Events
  Conditions
  Actions
    Player Group - Pick every player in PlayersAll and do (Actions)
      Loop - Actions
        -------- Peasants --------
        Player - Limit training of Novice (Black Hand) to 6 for (Picked player)
        Player - Limit training of Peasant (Caras) to 6 for (Picked player)
        Player - Limit training of Voidformer (Doombringer) to 6 for (Picked player)
        Player - Limit training of Miner (Dwarves) to 6 for (Picked player)
        Player - Limit training of Liran (Elves) to 6 for (Picked player)
        Player - Limit training of Lumberjack (Ete´terro) to 6 for (Picked player)
        Player - Limit training of Crusty Worker (Goldseeker) to 6 for (Picked player)
        Player - Limit training of Peasant (Humans Zegol) to 6 for (Picked player)
        Player - Limit training of Truffle Seeker (Pigclans) to 5 for (Picked player)
        Player - Limit training of Bonecarver (Shellers) to 6 for (Picked player)
        Player - Limit training of Slave (Troglospyl) to 6 for (Picked player)
        Player - Limit training of Peasant (Trolls) to 6 for (Picked player)
        -------- Elite5 auf 2 --------
        Player - Limit training of Balrog (Elite) ***** (Doombringer) to 2 for (Picked player)
        -------- Elite4 auf 2 --------
        Player - Limit training of Avenger (Elite) **** (Doombringer) to 2 for (Picked player)
        Player - Limit training of Sheller-Lord (Elite) **** (Shellers) to 2 for (Picked player)
        Player - Limit training of Stretchsilver Maid (Elite) **** (Carras) to 2 for (Picked player)
        Player - Limit training of Dragon Lord (Elite) **** (Trolls) to 2 for (Picked player)
        Player - Limit training of Fellord (Elite) **** (Pigclans) to 3 for (Picked player)
        Player - Limit training of Ringer (Elite) **** (Troglospyl) to 2 for (Picked player)
        Player - Limit training of Thunderstorm Ironbreaker (Elite) **** (Ete´thero) to 2 for (Picked player)
        Player - Limit training of Rock Elemental (Elite) **** (Dwarves) to 2 for (Picked player)
        Player - Limit training of Ironskin (Elite) **** (Humans Zegol) to 2 for (Picked player)
        Player - Limit training of Knight (Elite) **** (Humans Zegol) to 2 for (Picked player)
        -------- Elite3 auf 3 --------
        Player - Limit training of Champion (Elite) *** (Cult of the Black Hand) to 3 for (Picked player)
        Player - Limit training of Lieutenant (Elite) *** (Carras) to 3 for (Picked player)
        Player - Limit training of Berserker (Elite) *** (Trolls) to 3 for (Picked player)
        Player - Limit training of Shieldmaid (Elite) *** (Trolls) to 3 for (Picked player)
        Player - Limit training of Magma Walker (Elite) *** (Troglospyl) to 3 for (Picked player)
        Player - Limit training of Thunderstorm Painpriest (Elite) *** (Ete´thero) to 3 for (Picked player)
        Player - Limit training of Golden Guard (Elite) *** (Gooldseeker) to 3 for (Picked player)
        Player - Limit training of Mithril Shieldmaster (Elite) *** (Dwarves) to 3 for (Picked player)
        Player - Limit training of Berserker (Elite) *** (Elves) to 3 for (Picked player)
        -------- Wird für andere Einheiten verwendet --------
        Player - Limit training of Shadow Feather Dragon (Elite) *** (Cult of the Black Hand) to iMaxBlackHandShadowFDrakes for (Picked player)
        -------- Elite2 auf 4 --------
        Player - Limit training of Catapult (Elite) ** (Cult of the Black Hand) to 4 for (Picked player)
        Player - Limit training of Siege Tank (Elite) ** (Doombringer) to 4 for (Picked player)
        Player - Limit training of Corral Siegecatapult (Elite) ** (Shellers) to 4 for (Picked player)
        Player - Limit training of Catapult (Elite) ** (Carras) to 4 for (Picked player)
        Player - Limit training of Cryptomancer (Elite) ** (Carras) to 4 for (Picked player)
        Player - Limit training of Felguard (Elite) ** (Pigclans) to 5 for (Picked player)
        Player - Limit training of F*cking Rogue (Elite) ** (Troglospyl) to 4 for (Picked player)
        Player - Limit training of Assault Waggon (Elite) ** (Ete´thero) to 4 for (Picked player)
        Player - Limit training of D45 Deconstructor (Elite) ** (Gooldseeker) to 4 for (Picked player)
        Player - Limit training of Cryptomancer (Elite) ** (Dwarves) to 4 for (Picked player)
        Player - Limit training of Paladin (Elite) ** (Humans Zegol) to 4 for (Picked player)
        Player - Limit training of Darkwoodent (Elite) ** (Elves) to 4 for (Picked player)
        Player - Limit training of Ranger Captain (Elite) ** (Elves) to 4 for (Picked player)
        -------- Elite1 auf 4 --------
        Player - Limit training of Demon Captain (Elite) * (Doombringer) to 4 for (Picked player)
        Player - Limit training of Tanksoldier (Elite) * (Cult of the Black Hand) to 4 for (Picked player)
        Player - Limit training of Banner Carrier (Elite) * (Cult of the Black Hand) to 4 for (Picked player)
        Player - Limit training of Thunderlizard (Elite) * (Shellers) to 4 for (Picked player)
        Player - Limit training of Ritualist (Elite) * (Carras) to 4 for (Picked player)
        Player - Limit training of Ice Warden (Elite) * (Trolls) to 4 for (Picked player)
        Player - Limit training of Rioter (Elite) * (Pigclans) to 5 for (Picked player)
        Player - Limit training of Samurai (Elite) * (Troglospyl) to 4 for (Picked player)
        Player - Limit training of Golden Prophet (Elite) * (Gooldseeker) to 4 for (Picked player)
        Player - Limit training of Overseer (Elite) * (Gooldseeker) to 4 for (Picked player)
        Player - Limit training of S99 Shotingstar (Elite) * (Gooldseeker) to 4 for (Picked player)
        Player - Limit training of Waterelemental (Elite) * (Elves) to 4 for (Picked player)
        Player - Limit training of Corporal (Elite) * (Humans Zegol) to 4 for (Picked player)
        Player - Limit training of Mercenary Captain (Elite) * to 4 for (Picked player)
        -------- Wird für andere Einheiten verwendet --------
        Player - Limit training of Officer (Elite) * (Cult of the Black Hand, ohne mount) to iMaxBlackHandOfficers for (Picked player)
        -------- Sonstiges --------
        Player - Limit training of Longship Dock (Building) * (Trolls) to 1 for (Picked player)
        Player - Limit training of Shrine to 1 for (Picked player)
        Player - Make Tidehunter ***** (Shellers) Unavailable for training/construction by (Picked player)
    -------- Building Plots --------
    Player Group - Pick every player in PlayersAll and do (Actions)
      Loop - Actions
        -------- Large Building Plots --------
        Player - Make Large Building Plot *** (Bluelales) Unavailable for training/construction by (Picked player)
        Player - Make Large Building Plot *** (Crime Cartell) Unavailable for training/construction by (Picked player)
        Player - Make Large Building Plot *** (Demon Invaders) Unavailable for training/construction by (Picked player)
        Player - Make Large Building Plot *** (Stranded Alliance) Unavailable for training/construction by (Picked player)
        -------- Medium Building Plots --------
        Player - Make Medium Building Plot *** (Bluelales) Unavailable for training/construction by (Picked player)
        Player - Make Medium Building Plot *** (Crime Cartell) Unavailable for training/construction by (Picked player)
        Player - Make Medium Building Plot *** (Demon Invaders) Unavailable for training/construction by (Picked player)
        Player - Make Medium Building Plot *** (Stranded Alliance) Unavailable for training/construction by (Picked player)
        -------- Small Building Plots --------
        Player - Make Small Building Plot *** (Bluelales) Unavailable for training/construction by (Picked player)
        Player - Make Small Building Plot *** (Crime Cartel) Unavailable for training/construction by (Picked player)
        Player - Make Small Building Plot *** (Demon Invaders) Unavailable for training/construction by (Picked player)
        Player - Make Small Building Plot *** (Stranded Alliance) Unavailable for training/construction by (Picked player)
    Player Group - Pick every player in PlayersAlli and do (Actions)
      Loop - Actions
        Player - Make Large Building Plot *** (Stranded Alliance) Available for training/construction by (Picked player)
        Player - Make Medium Building Plot *** (Stranded Alliance) Available for training/construction by (Picked player)
        Player - Make Small Building Plot *** (Stranded Alliance) Available for training/construction by (Picked player)
    Player Group - Pick every player in PlayersBlu and do (Actions)
      Loop - Actions
        Player - Make Large Building Plot *** (Bluelales) Available for training/construction by (Picked player)
        Player - Make Medium Building Plot *** (Bluelales) Available for training/construction by (Picked player)
        Player - Make Small Building Plot *** (Bluelales) Available for training/construction by (Picked player)
    Player Group - Pick every player in PlayersCC and do (Actions)
      Loop - Actions
        Player - Make Large Building Plot *** (Crime Cartell) Available for training/construction by (Picked player)
        Player - Make Medium Building Plot *** (Crime Cartell) Available for training/construction by (Picked player)
        Player - Make Small Building Plot *** (Crime Cartel) Available for training/construction by (Picked player)
    Player Group - Pick every player in PlayersDemon and do (Actions)
      Loop - Actions
        Player - Make Large Building Plot *** (Demon Invaders) Available for training/construction by (Picked player)
        Player - Make Medium Building Plot *** (Demon Invaders) Available for training/construction by (Picked player)
        Player - Make Small Building Plot *** (Demon Invaders) Available for training/construction by (Picked player)
Texte
  Events
  Conditions
  Actions
    Floating Text - Create floating text that reads Brekana Deeps You have to be the Owner of the Shrine or the Goldseeker Legion at (Center of Brekana_Deeps_Outside <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Alnera Jungle at (Center of Alnera <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Bloodstone Highlands at (Center of Bloodstone_Highlands <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Blue Beech Tree Forest at (Center of Blue_Beech_Tree_Forest <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Blueshadeditch at (Center of Blueshadeditch <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Brekana Deeps at (Center of Brekana_Deeps_Name <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Dead Man´s Descent at (Center of Dead_Mans_Descent <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Desert of Kasaa at (Center of Desert_of_Kasaa <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Fireleafpass at (Center of Fireleafpass <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Frosthornmountains at (Center of Frosthornmountains <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Gnoll Forest at (Center of Gnoll_Forest <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Icewindbay at (Center of Icewindbay <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Icewindtundra at (Center of Icewindtundra <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Kalkaforest at (Center of Kalkaforest <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Kassazantundra at (Center of Kassazantundra <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Keria - Desert of Lonelines at (Center of Keria_Desert_of_Lonelines <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Mount Kassazan at (Center of Mount_Kassazan <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Northern Bloodbathvalley at (Center of Northern_Bloodbathvalley <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Northland at (Center of Northland <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Northwindforest at (Center of Northwindforest <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Obsidium Volcano at (Center of Obsidium_Volcano <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Purgatory Swamps at (Center of Purgatory_Swamps <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Serosh at (Center of Serosh <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Silvercoast at (Center of Silvercoast <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Slaughtermountains at (Center of Slaughtermountains <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Southern Bloodbathvalley at (Center of Southern_Bloodbathvalley <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Sugarrushcoast - Happy Halloween at (Center of Sugarrushcoast <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads The imbricated Country at (Center of The_imbricated_Country <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Tiranza at (Center of Tiranza <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Troglospyl at (Center of Troglospyl <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Void Outpost: Balfas at (Center of Void <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Leafes the Void and enters Theosa at the targeted point at (Center of LeaveVoid <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Create floating text that reads Steppe of Hallas at (Center of SteppeOfHallas <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    -------- SuddenDeathWahl --------
    Floating Text - Create floating text that reads Time until Sudden Death? at (Center of SuddenDeath <gen>) with Z offset 0, using font size 30.00, color (100.00%, 100%, 100%), and 0% transparency
    Set VariableSet IntroTexte[0] = (Last created floating text)
    Floating Text - Create floating text that reads Very Short - 30 minutes at (Center of 30min <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Set VariableSet IntroTexte[1] = (Last created floating text)
    Floating Text - Create floating text that reads Short - 1 hour at (Center of 1h <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Set VariableSet IntroTexte[2] = (Last created floating text)
    Floating Text - Create floating text that reads Medium - 1 hour 30 minutes at (Center of 1h30min <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Set VariableSet IntroTexte[3] = (Last created floating text)
    Floating Text - Create floating text that reads Long - 2 hours at (Center of 2h <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Set VariableSet IntroTexte[4] = (Last created floating text)
    Floating Text - Create floating text that reads Endless at (Center of endless <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Set VariableSet IntroTexte[5] = (Last created floating text)
    Floating Text - Create floating text that reads 15 s (Instant SD) at (Center of 15s <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Set VariableSet IntroTexte[6] = (Last created floating text)
    -------- IntroWahl --------
    Floating Text - Create floating text that reads Intro at (Center of Intro <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Set VariableSet IntroTexte[7] = (Last created floating text)
    Floating Text - Create floating text that reads No Intro at (Center of NoIntro <gen>) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Set VariableSet IntroTexte[8] = (Last created floating text)
Units:
Tier1: 5dps, 100Hp, 2 Gold, 1Essen
Tier2: 7,5dps, 150HP, 3 Gold, 1Essen
Tier3: 10dps, 200HP, 4 Gold, 2Essen
Tier4: 12,5dps, 250HP, 6 Gold, 2Essen
Tier5 15dps, 300HP, 8Gold, 3Essen
ETier1: 25dps, 500HP, 11Gold, 6Essen
ETier2: 25dps, 750HP, 18Gold, 9Essen
ETier3: 25dps, 1000HP, 24Gold, 12Essen
ETier4: 25dps, 1250HP, 30Gold, 15Essen
ETier5: 25dps, 1500HP, 36Gold, 19Essen


Holz: min. 1/3 vom Gold
Infobook
  Events
  Conditions
  Actions
    -------- Völkerinfos - Hauptquests --------
    Quest - Create a Required quest titled Caras and Stelethyds with the description Carras are known as men of the north praying to the fallen ancestors. Furthermore Carras construct large buildings showing their skills and are known as the leading race of the Blulales.Stelethyds are proud spiderlike warriors and live in the dark deeps of the earth. They are lead by women - where the strongest achieve the rank of a Stretchsilver Maid - and men are usually active as spellcaster who are known for their abilities in working with crystalls.Your cities are the center of the blulalien realm so you won´t be much threatened in the early game. Although your outpost in Keria the desert of lonelines will be overrunned by the Eastern Crime Cartell pretty soon.Support your allies with troops so that they can hold against assaults. Furthermore somebody has to build a defense against the Crime Cartell at the Eastside of Tiranza but be prepared of air attacks and sea attacks., using icon path ReplaceableTextures\CommandButtons\BTNHeroDeathKnight.blp
    Quest - Create a Required quest titled Trolls with the description Trolls are people of a fierce nature and with excellent combat skills. Their people have simple needs and they don´t build big cities but since the age of destruction destroyed their old homeland they suffered a lot.Although the Trolls had much problems - these warriors are willed to defend the new homeland.Your main base is located in the icy north making it quite safe. Enemy attacks concerning this base should be spotted by your allies but you must not forget about your southern base which is also the the southern borderline.Your most useful supporters are Guardiens and Ice Wardens so ensure to have some of those guys., using icon path ReplaceableTextures\CommandButtons\BTNIceTroll.blp
    Quest - Create a Required quest titled Shellers with the description As a fishlike race the Shellers had quite small losses trough the age of destruction and the huge waves affected you less than the others.Your people live with the elements but they are not able to use all of them. Your spellcasters use Water to heal your units and wind to damage enemies.You are protecting the western parts of the blulalien realm and the very border to the demon invaders so be prepared.Your units have the special ability to swim so you are able to start assaults from the seaside (This includes your Siege Weapons) so make use of it.Furthermore you are able ensnare enemy units with Whipers and Sheller Lords so try to focus strategical targets like fleeing Elites.In order to unlock more units and upgrades you have to start researches in 3 categories: Train units, build buildings and use abilities., using icon path ReplaceableTextures\CommandButtons\BTNMurloc.blp
    Quest - Create a Required quest titled Humans and Zegols with the description Humans are a race with great losses through the age of destruction. Nethertheless this has strengthen their religion of the eternel light giving them hope to a better future. Furhtermore noble Knights and Paladines are a sign of your peoples hope.Zegols are strong humanoids looking like dragons and although they´ve got wings they are not able to fly. Nethertheless they are well skilled fighters and able to use windmagic.You´ve constructed many cities (To be exact 3) but one is the borderline to the Eastern Crime Cartell and one is the borderline to the Demon Invaders which might be destroyed pretty soon if the Cult wants to achieve the knowledge to train Necromancers from the Erlking inside his crypt.Help your allies with strong tanks like Zegol Ironskins or Knights.You can choose between 2 final researches: Either you will be able to train more Elites and to further improve their upgrades or to enhance your spellcasters., using icon path ReplaceableTextures\CommandButtons\BTNFootman.blp
    Quest - Create a Required quest titled Dwarves with the description The Dwarves of the Stranded Alliance helped the others to survive after the Age of Destruction.These people spend much time under earth giving them a special relationship to earth and darkness. Dark magic is used in both possibilities: support and attack but must be compared to shadow magic which is sometimes the case.Furthermore the dwarvish culture appreciates good festivals and beer. Also hiting an anvil while forging a weapon seems to be quite relaxing to Dwarves.Your base is inside a mountain so you have good defensive possibilities (if the enemy doesn´t siege you down). You can produce more food then other factions if you build breweries instead of common farms so try to speak with your allies if you have not enough small building plots.Other defensive possibilities are your canon towers dealing splash damage and Engineers who are able to build mines., using icon path ReplaceableTextures\CommandButtons\BTNRifleman.blp
    Quest - Create a Required quest titled Elves with the description Elves are a race who lost many forests during the last years shattering it´s hope. In order to clean this your people started to cultivate this countries´ forests.These people life toghether with the nature making them able to call the nature´s spirits to help. The elvish armies are also supported by well skilled rangers and soldiers.You are protecting the northern borderline which can be attacked by every faction. Also the Demon Invaders and the Crime Cartell have the possibility to attack positions which are located sout of this position.Most of your ranged units have an increased range to other races so pay attention to use this ability wisely.Upgrading your army is a test of patience and strategy because you need an additional resource for basic-upgrades at your Classification unit: Health of Forest (The unit´s mana).If you chose the Final Upgrade Recovery of Nature you will be able to cleanse the Purgatory Swamps and the Dead Man's Decent using "Rise of Nature" multiple times which will summon Elite Units after a certain amount., using icon path ReplaceableTextures\CommandButtons\BTNPriest.blp
    Quest - Create a Required quest titled Cult of the Black Hand with the description The "Cult of the Black Hand" - the eternal cult of demons. They follow the demonic aim to destroy the whole order of the beginning and they do not fear the death which is just a door to another live making the souls of these warriors to demons in the void.After you have caused all the cataclysm of Theosa you are to finish what you have begun.You are the smallest force (only 2 players) so be carefull. Ensure the Slaugtherhouse (your northern borderline) to be safe because the Blulales can attack this quite fast. Use your strong air units to ensure this and to lead attacks.Furthermore you have the possibility to train Necromancers after you have defeated the Erlking (If another Force kills the Erlking, the knowledge of Necromancery is lost and you can not research the Necromancer´s final upgrade). The Erlking is inside his crypt in the Blue Beech Tree Forest south of the Human base.Necromancers can summon permanent units from corpes so they can be quite useful after battles.If you have Necromancers you have also the possibility to sacrifice your own units (Black Soldiers and Crossbowmen) because you have a chance of 66% to receive a Tier 2 or Tier 3 unit., using icon path ReplaceableTextures\CommandButtons\BTNDoom.blp
    Quest - Create a Required quest titled Doombringer Legion with the description The "Doombringer Legion" is one of many other demonic hordes. They follow the demonic aim to destroy the whole order of the beginning.The Cult of the Black Hand has brought this Legion to this world to cause Doom.You start with nearly no influence so you should work toghether with your ally to build new bases and to receive more income.At first you should start to build the Great Void Portal because this will enable you to summon Balrogs (Elite Tier 5!) with quite destructive skills.enemys and strike them down with brutality.A special characteristic of your race is that you have to fuse units to get stronger ones without a training limit for Elite units. To do so you have to call them to your Void Siege Camp using the Fusionist there., using icon path ReplaceableTextures\CommandButtons\BTNDoomGuard.blp
    Quest - Create a Required quest titled Troglospyl with the description The City of Troglospyl is the leading force in the Eastern Crime Cartell and maybe the city with the greatest looses of culture.The age of destruction shattered many cultures and although it caused medium damage to the city Troglospyl lost many people they´ve traded with forcing the people of Troglospyl to survive by raid at all costs.Troglospyl once was known to have well skilled Samurais, Ringers, Mages and Artisans but today those wellskilled people are corrupted and complemented by hated rogues (The others hate the rogues).Your base is located in the undergrounds of Troglospyl-City and furthermore it´s the border to the Stranded Alliance so be prepared and avoid a siege against you. Work toghether with the Pigclans to hold the southern border of the Eastern Crime Cartell.Since you have stealthunits make sure to surprise your enemys.Your buildings are also more versatile than others because of the ability to attack and shortened building time. So try building bases quickly., using icon path ReplaceableTextures\CommandButtons\BTNBandit.blp
    Quest - Create a Required quest titled Ete´terro Trolls with the description The Ete´terro Trolls are named after their former leader Bakalla Ete´terro. They live in a region called "Dead man´s descent" which is called like that as a consequence of the Trolls´ fierceness.Once the descent was a jungle filled with life but earthquakes and fanatic cultists who deifeid the forces of destruction destroyed it and only this barren was left.Nearly nothing lefted and so they were forced to join the Crime Cartell.You protect the very northern border of the Crime Cartell and have good defensive possibilities.Wolf Overlords can affect all units in a certain range making them quite useful. The Voodoo Lord can be one of your most important units if you try to attacks with a huge amount of summoned units giving you a special strategy.Anyway your strategy should be to spam week units: either Splitters and Axemasters or Voodoolords and their summons., using icon path ReplaceableTextures\CommandButtons\BTNDarkTrollShadowPriest.blp
    Quest - Create a Required quest titled Pigclans with the description The Pigclans didn´t made it easily through the age of destruction. The pigmen don´t have much culture but they appreciate good and much food making this to their main objectiv through the raids they are forced to.Nethertheless religion is not unknown to your people and once your people praised Kasaa - the god of the Kasaa beasts which got this name from their god. Kasaa is apart from this point deified as god of treasure hunters.Kasaa was less and less present so your people became interested in dark magic.You have 2 bases: one in Keria the desert of lonelines - which is quite safe - and one in the very center of the realm of the Stranded Alliance which is in urgent danger.Try to hold that position or Troglospyl-City is alone and in urgent danger. If you want to attack then your first target should be the blulalien outpost in the Keria and then try to bring the war to the Blulales.In order to get stronger units you have to feed weak units with battlecooks and upgrade them after that. You also can train more Elite Units than other races., using icon path ReplaceableTextures\CommandButtons\BTNRazorManeChief.blp
    Quest - Create a Required quest titled Goldseeker Legion with the description The Goldseeker Legion is the most greedy faction in Theosa. These people are lead by Eugene called "The glorious one" who made it through the age of the destruction without wasting money.The Legion had only few losses and built a city in the Brekana Deeps where they deinie Mammon and plan new raids.Furthermore the engineers of the legion are among the smartest engineers in Theosa making them capable to build fighting robots near the front.You protect the northern part of the Eastern Crime Cartell but as you will see you have no real defense there. So either you protect the way to Tiranza or the Blulales construct their defenses there.Furthermore your units live in the sea enabling them to swim so you should attack enemies from the seaside. Finally you should make use of your Engineers because they can build robotic units near the front. You can build as many robots as you want but the number of robots you can activate is limited by your produced amount of food.Also your weakest units need no training time in the common sense. This means: most of your weak units can be bought as mercenaries by anyone near their training buildings. So pay attention., using icon path ReplaceableTextures\CommandButtons\BTNLobstrokkBlue.blp
    -------- Generelle Infos - Nebenquests --------
    Quest - Create a Optional quest titled The Map Makers last word with the description Hello toghether,i hope that you like the map and that the map is playable.It took me a long time to build it and to try to fix all bugs (I can't promise that there are still some bugs).This is my first multiplayer map and i'm no native english speaker so there could remain some wrong translations.Furthermore i would appreciate if you rate the map (https://www.hiveworkshop.com/), make suggestions or report bugs i haven't seen..PS: The map is not protected so feel free to work with it. You can use the content as you wish (Content of other people - should be nothing but models - could be different) or modify the map if you want your own game style., using icon path ReplaceableTextures\CommandButtons\BTNFrostWyrm.blp
    Quest - Create a Optional quest titled Last Updatechanges with the description Changelog 15.5-New Buttons for units (See credits): Sheller Bonecarver, Farsasz Iceeye, Garith Thundersteel-New Buttons for skills (See credits): Slash, Bonewing-Changed Buttons to other default available Buttons: Sheller Fortress, Temple of Water, Troll Watchtower, Hall of Darkness, Deadly Attack, Fire Spirit, Detonate, Light's Protection (Effect), Windbolt-Changed Button Borders (using Button Manager and Warcraft 3 Viewer): Wild Arrow, Dune Protection, Ball of the Night, Defending Wind, Hardened Magma (Buff), Longbow, Dragonskin, Enhanced Endurance, Heavy Strike, Night's Agony, Split, Burning Blade, Marksmanship, Jarl's Aura, Fortified Defense, Improved Range, Hunter's Aura, Saviour's Aura, Ranger's Aura, Bash of Rocks, Shieldbreaker, Skillshot, Crystal Protection, Mark, Protection of the Ancestors, Heart of the Forest, Unstoppable Greed, Titan's Punishment, Moving Flame-Changed default Button and Borders: Burning Attacks-Buttons for Unitgroups: those buttons now contain the number of units that are trained (e.g. The command button for 5 Alliance Soldiers now contains a "x5"). -Fixed Typos: Guardien ' Guardian, Crystall Former ' Crystal Former (includes skills and other appearances)-Added the "Siege Precision"-Ability: The damage of many Siege units against buildings will be increased with each attack.-Renamed Doombringer Peasant to Voidformer-Skill: Cooldown of Titan's Punishment reduced to 3 seconds-Skill: Throw a stone of the Pigclan Destroyer now stuns for 4 seconds-Unit: Movementspeed of Ete'thero Assault Wagon increased to 240-Added heroglowing to heroes using Non-Hero-Models (see https://www.hiveworkshop.com/threads/how-to-add-hero-glow-without-modeling.146416/)- Player Colors are now fixed- Bugfix: Despair caused by hero deaths no affects the owner of the hero and not it's killers, using icon path ReplaceableTextures\CommandButtons\BTNFrostWyrm.blp
    Quest - Create a Optional quest titled Units I with the description Units have different attributes and can be classified as "Common", "Elite", "Boss" and "Building". Their strength is further represented by a special number of stars behind their name.Some units have no star (for example peasants) who are classiefied as common tier 0.Initially classification and rank are representative to a units strenght which changes with researching upgrades.Initially units have the following stats:Common:Tier 0: 50 Hp, 2.5 dps, 1 Food, 1 Gold, Training Time 5Tier 1: 100 Hp, 5 dps, 1 Food, 2 Gold , Training Time 10Tier 2: 150 Hp, 7.5 dps, 1 Food, 3 Gold, Training Time 15Tier 3: 200 Hp, 10 dps, 2 Food, 4 Gold, Training Time 20Tier 4: 250 Hp, 12.5 dps, 2 Food, 6 Gold, Training Time 25Tier 5: 300 Hp, 15 dps, 3 Food, 8 Gold, Training Time 30, using icon path ReplaceableTextures\CommandButtons\BTNFootman.blp
    Quest - Create a Optional quest titled Units II with the description Elite:Tier 1: 500 Hp, 25 dps, 6 Food, 11 Gold, Limit 4Tier 2: 750 Hp, 25 dps, 9 Food, 18 Gold, Limit 4Tier 3: 1000 Hp, 25 dps, 12 Food, 24 Gold, Limit 3Tier 4: 1250 Hp, 25 dps, 15 Food, 30 Gold, Limit 2Tier 5, 1500 Hp, 25 dps, 19 Food, 36 Gold, Limit 2Generally Elite Units have a training time of 60 but Elite Tier 5 Units have a training time of 75.Bosses:There are a few heroes who are classified as boss but most ot them are hostile ones with special loot.All Bosses have a dps of 35.Tier 1: 2500 Hp Tier 2: 3750 Hp, Tier 3: 5000 Hp,Tier 4: 6250 Hp, Tier 5: 7500 HpBuildingsThere is an extra info to buildings.Training more unitsSome units can be trained in groups making them cheaper and more usable., using icon path ReplaceableTextures\CommandButtons\BTNRifleman.blp
    Quest - Create a Optional quest titled Hotkeys with the description Hotkeys are not contained in tooltips but it´s standardized. The position of an icon shows the belonging key.Buildings:First row: Q W R ESecond row: A S D FThird row: Y X C VSkills:Usually a unit has up to 4 skills in the third row so simply use Q, W, E or R.Sometimes units have skills in the second row then use D or F., using icon path ReplaceableTextures\CommandButtons\BTNSelectHeroOn.blp
    Quest - Create a Optional quest titled Commands with the description - give up : you give up and all your units are removed - count: Shows you the living units of all players (includes Techunits and dummies) - zoom ####: Zooms to distance between 1000 and 3000, using icon path ReplaceableTextures\CommandButtons\BTNHeroTinker.blp
    Quest - Create a Optional quest titled Buildings with the description The majority of buildings can be build on "Building Plots" making them limited. There are three types of building plots:Small Building PlotHere you may build Food Production, Towers and Lumbermills.Medium Building PlotThe position of the majority of your barracks.Large Building PlotHere you build fortresses. These ones train peasants, revive fallen heroes and are quite strong.Generally it´s quite hard to destroy buildings so you will need Siege Weapons or a big army. Towers and Fortresses fight attacking troops but without units supporting them they are lost, too., using icon path ReplaceableTextures\CommandButtons\BTNStoneArchitecture.blp
    Quest - Create a Optional quest titled Rallypoints with the description As you will see Rallypoints are a little problem caused by severel game mechanics like training units in groups.In order to make this easier all players grant control over a Command Unit (It´s classified as a hero) with severel skills to set Rallypoints. There`s also an ability to set Rallypoints making summoned units walking there which is quite interesting to some tactics., using icon path ReplaceableTextures\WorldEditUI\Editor-Random-Unit.blp
    Quest - Create a Optional quest titled Money with the description Gold You will get permanently gold depending on the number of your controlled Control Points. Each Control Point increases your Income by 10 gold per minute. Lumber Lumber is harvested from trees all over the map. They have many hitpoints so they shouldn´t die., using icon path ReplaceableTextures\CommandButtons\BTNChestOfGold.blp
    Quest - Create a Optional quest titled Credits I with the description ModelsArabianTowers MikeAzureDragonCrystalLord General FrankAzureDragonElementarist General FrankBanditBerserker (Modell) Mr. BobBanditBerserker (Texture) Stanakin SkywalkerBarracks (Strongholdstyle) MikeBloodElvenSwordmaster ElenaiBloodelfPikeman General FrankChaosRazormane KuhneghetzCleric McCrossbowFootman Wandering SoulCryptFlyer AndrewOverload519DemonTower HappyTaurenDemon_BulwarkBastionCitadel General FrankDire_Bandit / Dire_Footman DirefuryDraconian Guard CallahanDwarfArchMage (e.G. Mudsorcerer) GreyArchonDwarfArchmage (e.G. ShadowWeaver) GreyArchonFortificationPalisade MassiveMasterGiantMantis tee.dubsGiantSandWorm Sephiroth_VIIGnollAltarofFangs MephestrialGnollBrawler MephestrialGnollMystweaver MephestrialGnollStalker MephestrialHeroChronomancer Deolrin, using icon path ReplaceableTextures\CommandButtons\BTNHeroTinker.blp
    Quest - Create a Optional quest titled Credits II with the description Ragnar Flamebeard Blizzard Entertainment, SelleniskoHuman Archer Happy TaurenHumanChurch (WC2 Church) KetMaleElfRanger McNagaSerpent KehelNerubianArcaneTower MatiS Ocula -GrendelOrcRogue LinazePumpkinPhantom ThrikodiusQuillboarBarracks Edge45QuillboarChampion DeolrinRazorManeHunter Wandering SoulRazormaneWorker garfieldRedDragonFirePhalanx General FrankRoyalDwarf RadagastDwarven Runecaster GreyArchonDwarvenShieldBreaker NorinradSkeletonPirate126 WhiteDeathSlavemaster -GrendelSnowPine GottfreiTree (e.G: Malaar Tree) Grey KnightVrykulSpearCarrier SelleniskoVrykulWarrior SelleniskoVrykulWorker SelleniskoWarcraft II Mage AndrewOverload519WCII_GreatHall Red XIIIClassicBat manasouUruk Hai Pikeman FingolfinBloodelf Mage General FrankDoomsayer HawkwingGeneralHeroGlow assassin_lord, using icon path ReplaceableTextures\CommandButtons\BTNHeroTinker.blp
    Quest - Create a Optional quest titled Credits II with the description Icon CreatorBerserkerMurloc Marcos DABMurloc Prince YaserBlade Prince YaserFrostwyrmwing The PandaMurloc Hut Blizzard Entertainment, genin32HeroRifleman TurieLAncient Sword LoDownSteel Sword Blizzard Entertainment, genin32Mastercraft Longsword Prince Yaser, using icon path ReplaceableTextures\CommandButtons\BTNHeroTinker.blp
    Quest - Create a Optional quest titled Credits III with the description The following tools helped me to create this map (Thank you): Button Manager Warcraft III Viewer http://www.flamingtext.com/ Also thanks to the Hiveworkshop, using icon path ReplaceableTextures\CommandButtons\BTNHeroTinker.blp
    Quest - Create a Optional quest titled Multyplayer with the description If you play alone or if you don´t have 12 players then you should fill the missing places with computer players. Reason: This causes problems with the maps victory conditions. This is everything for now., using icon path ReplaceableTextures\CommandButtons\BTNKnight.blp
//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

 
Create some units at the beginning to reduce file size and lags
//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

 
ErhoehenUm15s
  Events
    Unit - A unit enters 15s <gen>
  Conditions
  Actions
    Unit - Move (Triggering unit) instantly to (Random point in VoterKillzone <gen>)
    Camera - .Apply. gg_cam_IntroVoting for (Owner of (Triggering unit)) over 1.00 seconds
    Set VariableSet iSuddenDeathZeitGesamt = (iSuddenDeathZeitGesamt + 15)
    Set VariableSet iSuddenDeathAbgegebeneStimmen = (iSuddenDeathAbgegebeneStimmen + 1)
ErhoehenUm30
  Events
    Unit - A unit enters 30min <gen>
  Conditions
  Actions
    Unit - Move (Triggering unit) instantly to (Random point in VoterKillzone <gen>)
    Camera - .Apply. gg_cam_IntroVoting for (Owner of (Triggering unit)) over 1.00 seconds
    Set VariableSet iSuddenDeathZeitGesamt = (iSuddenDeathZeitGesamt + 1800)
    Set VariableSet iSuddenDeathAbgegebeneStimmen = (iSuddenDeathAbgegebeneStimmen + 1)
ErhoehenUm60
  Events
    Unit - A unit enters 1h <gen>
  Conditions
  Actions
    Unit - Move (Triggering unit) instantly to (Random point in VoterKillzone <gen>)
    Camera - .Apply. gg_cam_IntroVoting for (Owner of (Triggering unit)) over 1.00 seconds
    Set VariableSet iSuddenDeathZeitGesamt = (iSuddenDeathZeitGesamt + 3600)
    Set VariableSet iSuddenDeathAbgegebeneStimmen = (iSuddenDeathAbgegebeneStimmen + 1)
ErhoehenUm90
  Events
    Unit - A unit enters 1h30min <gen>
  Conditions
  Actions
    Unit - Move (Triggering unit) instantly to (Random point in VoterKillzone <gen>)
    Camera - .Apply. gg_cam_IntroVoting for (Owner of (Triggering unit)) over 1.00 seconds
    Set VariableSet iSuddenDeathZeitGesamt = (iSuddenDeathZeitGesamt + 5400)
    Set VariableSet iSuddenDeathAbgegebeneStimmen = (iSuddenDeathAbgegebeneStimmen + 1)
ErhoehenUm120
  Events
    Unit - A unit enters 2h <gen>
  Conditions
  Actions
    Unit - Move (Triggering unit) instantly to (Random point in VoterKillzone <gen>)
    Camera - .Apply. gg_cam_IntroVoting for (Owner of (Triggering unit)) over 1.00 seconds
    Set VariableSet iSuddenDeathZeitGesamt = (iSuddenDeathZeitGesamt + 7200)
    Set VariableSet iSuddenDeathAbgegebeneStimmen = (iSuddenDeathAbgegebeneStimmen + 1)
WillKeinSD
  Events
    Unit - A unit enters endless <gen>
  Conditions
  Actions
    Unit - Move (Triggering unit) instantly to (Random point in VoterKillzone <gen>)
    Camera - .Apply. gg_cam_IntroVoting for (Owner of (Triggering unit)) over 1.00 seconds
    Set VariableSet iSuddenDeathAbgegebeneStimmen = (iSuddenDeathAbgegebeneStimmen + 1)
    Set VariableSet iWantsNoSuddenDeath = (iWantsNoSuddenDeath + 1)
    Trigger - Run KeinSDGenehmigt <gen> (checking conditions)
KeinSDGenehmigt
  Events
  Conditions
    iWantsNoSuddenDeath Greater than (iPlayers / 4)
  Actions
    Game - Display to (All players) the text: More than half of all Players voted against Sudden Death! Sudden Death is now deactivated! Time to kill your opponents!
    Unit Group - Pick every unit in (Units in SuddenDeathWahl <gen>) and do (Actions)
      Loop - Actions
        Unit - Move (Picked unit) instantly to oVoterKillZoneCenter
    Trigger - Remove Waehl_doch <gen> from the trigger queue
    Trigger - Turn off AufSuddenDeathWarten <gen>
    Trigger - Run TimerUmstellen <gen> (ignoring conditions)
Waehl doch
  Events
  Conditions
  Actions
    -------- Maximale vote zeit 5 min --------
    Game - Display to (All players) the text: Now you have 5 minutes to vote for the Sudden Death Timer. To get Information watch the "Quests".
    Countdown Timer - Start tWaehldoch as a One-shot timer that will expire in 300.00 seconds
    Set VariableSet oTimerArray[0] = (Last started timer)
    Countdown Timer - Create a timer window for (Last started timer) with title Time to vote!
    Set VariableSet oTimerWindowArray[0] = (Last created timer window)
    Wait 300.00 seconds
    Unit Group - Pick every unit in (Units in VotingArea <gen>) and do (Actions)
      Loop - Actions
        Unit - Move (Triggering unit) instantly to (Random point in VoterKillzone <gen>)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        iSuddenDeathAbgegebeneStimmen Less than (iPlayers / 4)
      Then - Actions
        Countdown Timer - Destroy oTimerWindowArray[0]
        Game - Display to (All players) the text: You´ve had enough time to vote now. Sudden Death will be the average of what has been voted.
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            iSuddenDeathAbgegebeneStimmen Greater than 0
          Then - Actions
            Wait 2 seconds
            Trigger - Run EinheitHatGewaehlt <gen> (ignoring conditions)
          Else - Actions
            Set VariableSet iSuddenDeathZeitGesamt = 5400
            Set VariableSet iSuddenDeathAbgegebeneStimmen = (iSuddenDeathAbgegebeneStimmen + 1)
            Game - Display to (All players) the text: Nobody voted! Now you will play a medium game. (Sudden death after 1:30 h)
      Else - Actions
IntroNo
  Events
    Unit - A unit enters NoIntro <gen>
  Conditions
  Actions
    Unit - Move (Triggering unit) instantly to (Random point in VoterKillzone <gen>)
    Set VariableSet iIntroVote[1] = (iIntroVote[1] + 1)
IntroYes
  Events
    Unit - A unit enters Intro <gen>
  Conditions
  Actions
    Unit - Move (Triggering unit) instantly to (Random point in VoterKillzone <gen>)
    Set VariableSet iIntroVote[0] = (iIntroVote[0] + 1)
EinheitHatGewaehlt
  Events
    Unit - A unit enters VoterKillzone <gen>
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in (Units in VotingArea <gen>)) Equal to 0
      Then - Actions
        Trigger - Run Anfangsfilm <gen> (ignoring conditions)
        Wait 2 seconds
        Trigger - Turn off (This trigger)
      Else - Actions
        Game - Display to (All players) the text: (Remaining Votes: + (String((Number of units in (Units in VotingArea <gen>)))))
Anfangsfilm
  Events
  Conditions
  Actions
    Trigger - Turn off (This trigger)
    -------- Anderes --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        iIntroVote[0] Greater than (iPlayers / 4)
      Then - Actions
        Player Group - Pick every player in (All players) and do (Actions)
          Loop - Actions
            Cinematic - Turn on letterbox mode (hide interface) for (All players): fade out over 2.00 seconds
        -------- Kameras --------
        Camera - .Apply. gg_cam_CarrasStart for Player 1 (Red) over 1.00 seconds
        Camera - .Apply. gg_cam_TrollsStart for Player 2 (Blue) over 1.00 seconds
        Camera - .Apply. gg_cam_ShellersStart for Player 3 (Teal) over 1.00 seconds
        Camera - .Apply. gg_cam_HumansStart for Player 4 (Purple) over 1.00 seconds
        Camera - .Apply. gg_cam_DwarvesStart for Player 5 (Yellow) over 1.00 seconds
        Camera - .Apply. gg_cam_ElvesStart for Player 6 (Orange) over 1.00 seconds
        Camera - .Apply. gg_cam_DemonInvadersStart for Player 7 (Green) over 1.00 seconds
        Camera - .Apply. gg_cam_DemonInvadersStart for Player 8 (Pink) over 1.00 seconds
        Camera - .Apply. gg_cam_TroglospylStart for Player 9 (Gray) over 1.00 seconds
        Camera - .Apply. gg_cam_PigclansStart for Player 10 (Light Blue) over 1.00 seconds
        Camera - .Apply. gg_cam_EteTerroStart for Player 11 (Dark Green) over 1.00 seconds
        Camera - .Apply. gg_cam_GoldseekerStart for Player 12 (Brown) over 1.00 seconds
        Wait 3.00 seconds
        -------- Texte --------
        Game - Display to PlayersAll for 25.00 seconds the text: The world of Theosa has suffered a worldwide disaster of huge waves, earthquakes and other rumors. The world seems to became peaceful once more but it´s inhabitans now live on a quite smaller habitable surface and chaotic beings invade the world under the banner of a black hand.
        Wait 25.00 seconds
        Cinematic - Clear the screen of text messages for PlayersAll.
        Game - Display to PlayersAll for 25.00 seconds the text: The eastern parts of this continent is now populated by the members of the "Eastern Crime Cartell" - fallen cultures and exiled criminals who survived the disaster. The north is populated by the Blulales who are used to the rumors of the icy north but they were also forced to help each other.
        Wait 25.00 seconds
        Cinematic - Clear the screen of text messages for PlayersAll.
        Game - Display to PlayersAll for 25.00 seconds the text: Finally there are people in the southern parts calling them the "Stranded Alliance" - Humans and Elves who lived in other parts of Theosa were sproud around the world after the flooding of these parts. They´ve got help by the Dwarves who supported them with food, tools and of course some beer.
        Wait 25.00 seconds
        Cinematic - Clear the screen of text messages for PlayersAll.
        Game - Display to PlayersAll for 15.00 seconds the text: Blulales and the Stranded Alliance weren´t good friends at all and the problems caused by the Eastern Crime Cartell haven't changed that.
        Wait 15.00 seconds
        Cinematic - Clear the screen of text messages for PlayersAll.
        Game - Display to (Player group(Player 1 (Red))) the text: You are playing "Carras and Stelethyds". Carras are known as men of the north praying to the fallen ancestors. Furthermore Carras construct large buildings showing their skills and are known as the leading race of the Blulales.
        Game - Display to (Player group(Player 1 (Red))) the text: Stelethyds are proud spiderlike warriors and live in the dark deeps of the earth. They are lead by women - where the strongest achieve the rank of a Stretchsilver Maid - and men are usually active as spellcaster who are known for their abilities in working with crystalls.
        Game - Display to (Player group(Player 2 (Blue))) the text: You are playing the northern Trolls - people of a fierce nature and with excellent combat skills. Your people have simple needs and they don´t build big cities but since the age of destruction destroyed their old homeland they suffered a lot.
        Game - Display to (Player group(Player 2 (Blue))) the text: Although you had much problems your warriors are willed to defend the new homeland.
        Game - Display to (Player group(Player 3 (Teal))) the text: You are playing "Shellers". As a fishlike race you had quite small losses trough the age of destruction and the huge waves affected you less than the others.
        Game - Display to (Player group(Player 3 (Teal))) the text: Your people live with the elements but they are not able to use all of them. Your spellcasters use Water to heal your units and wind to damage enemies.
        Game - Display to (Player group(Player 4 (Purple))) the text: You are playing "Humans and Zegols". Humans are a race with great losses through the age of destruction. Nethertheless this has strengthen their religion of the eternel light giving them hope to a better future. Furhtermore noble Knights and Paladines are a sign of your peoples hope.
        Game - Display to (Player group(Player 4 (Purple))) the text: Zegols are strong humanoids looking like dragons and although they´ve got wings they are not able to fly. Nethertheless they are well skilled fighters and able to use windmagic.
        Game - Display to (Player group(Player 5 (Yellow))) the text: You are playing the Dwarves of the Stranded Alliance who helped the others to survive after the Age of Destruction. Your people spend much time under earth giving them a special relationship to earth and darkness. Dark magic is used in both possibilities: support and attack.
        Game - Display to (Player group(Player 5 (Yellow))) the text: Furthermore the dwarvish culture appreciates good festivals and beer and hiting an anvil while forging a weapon seems to be quite relaxing.
        Game - Display to (Player group(Player 6 (Orange))) the text: You are playing "Elves" - a race who lost many forests during the last years shattering it´s hope. In order to clean this your people started to cultivate this countries´ forests.
        Game - Display to (Player group(Player 6 (Orange))) the text: Your people life toghether with the nature making them able to call the nature´s spirits to help you. The elvish armies are also supported by well skilled rangers and soldiers.
        Game - Display to (Player group(Player 7 (Green))) the text: You are playing the "Cult of the Black Hand" - the eternal cult of demons. You follow the demonic aim to destroy the whole order of the beginning and you do not fear the death which is just a door to another live making the souls of your warriors to demons in the void.
        Game - Display to (Player group(Player 8 (Pink))) the text: You are playing the "Doombringer Legion" - one of countless other demonic hordes. You follow the demonic aim to destroy the whole order of the beginning. Your ally the Cult of the Black Hand has brought you to this world making the Cult to your only ally.
        Game - Display to (Player group(Player 9 (Gray))) the text: You are playing the City of Troglospyl - the leading force in the Eastern Crime Cartell and maybe the city with the greatest loose of culture.The age of destruction shattered many cultures and although it caused medium damage to your city you lost many people you´ve traded with forcing you to survive by raid all you get.
        Game - Display to (Player group(Player 9 (Gray))) the text: Troglospyl once was known to have well skilled Samurais, Ringers, Mages and Artisans but today those wellskilled people are corrupted and complemented by hated rogues (The others hate the rogues).
        Game - Display to (Player group(Player 10 (Light Blue))) the text: You are playing the Pigclans and you got easily past the age of destruction. Your people don´t have much culture but they appreciate good and much food making this to their main objectiv through raids you are forced to.
        Game - Display to (Player group(Player 10 (Light Blue))) the text: Nethertheless religion is not unknown to your people and once your people praised Kasaa - the god of the Kasaa beasts which got this name from their god. Kasaa is apart from this point deified as god of treasure hunters.Kasaa was less and less present so your people became interested in dark magic.
        Game - Display to (Player group(Player 11 (Dark Green))) the text: You are playing the Ete´terro Trolls named after their former leader Bakalla Ete´terro. Your people live in a region called "Dead man´s descent" which is called like that as a consequence of the Trolls´ fierceness.
        Game - Display to (Player group(Player 11 (Dark Green))) the text: Once the descent was a jungle filled with live but earthquakes and fanatic cultists who deifeid the forces of destruction destroyed it and only this barren was left. Nearly nothing lefted and so you were forced to join the Crime Cartell.
        Game - Display to (Player group(Player 12 (Brown))) the text: You are playing the Goldseeker Legion the most greedy faction in Theosa. Your people are lead by Eugene called "The glorious one" who made it through the age of the destruction without wasting money.
        Game - Display to (Player group(Player 12 (Brown))) the text: The Legion had only few losses and built a city in the Brekana Deeps where they deinie Mammon and plan new raids. Furthermore you engineers are among the smartest engineers in Theosa making them capable to build fighting robots near the front.
        Wait 35.00 seconds
        Cinematic - Clear the screen of text messages for PlayersAll.
        Game - Display to PlayersAll the text: What to do:
        Wait 1.00 seconds
        Game - Display to PlayersAll the text: Generally there are 2 strategies which can be combined.1. Build a huge amount of cheap units because they can be produced in greater numbers like 5 standard units.2. Focus on Elite units who need more food, ressources and time but who are much stronger than common units.Many units have supporting skills like auras and defense enhancing skills so ensure to have some of those units.Remember that specifics of different races can change the strategies.
        Wait 25.00 seconds
        Cinematic - Clear the screen of text messages for PlayersAll.
        Game - Display to (Player group(Player 1 (Red))) the text: Your cities are the center of the blulalien realm so you won´t be much threatened in the early game. Although your outpost in Keria the desert of lonelines will be overrunned by the Eastern Crime Cartell pretty soon.Support your allies with troops so that they can hold against assaults. Furthermore somebody has to build a defense against the Crime Cartell at the Eastside of Tiranza but be prepared of air attacks and sea attacks.
        Game - Display to (Player group(Player 2 (Blue))) the text: Your main base is located in the icy north making it quite safe. Enemy attacks concerning this base should be spotted by your allies but you must not forget about your southern base which is also the the southern borderline.Your most useful supporters are Guardiens and Ice Wardens so ensure to have some of those guys.
        Game - Display to (Player group(Player 3 (Teal))) the text: You are protecting the western parts of the blulalien realm and the very border to the demon invaders so be prepared.Your units have the special ability to swim so you are able to start assaults from the seaside (This includes your Siege Weapons) so make use of it.Furthermore you are able ensnare enemy units with Whipers and Sheller Lords so try to focus strategical targets like fleeing Elites.
        Game - Display to (Player group(Player 4 (Purple))) the text: You´ve constructed a huge amount of cities (To be exact 3) but one is the borderline to the Eastern Crime Cartell and one is the borderline to the Demon Invaders which might be destroyed pretty soon if the Cult wants to achieve the knowledge to train Necromancers from the Erlking inside his crypt.Help your allies with strong tanks like Zegol Ironskins or Knights.
        Game - Display to (Player group(Player 5 (Yellow))) the text: Your base is inside a mountain so you have good defensive possibilities (if the enemy doesn´t siege you down). You can produce more food then other factions if you build breweries instead of common farms so try to speak with your allies if you have not enough small building plots.Other defensive possibilities are your canon towers dealing splash damage and Engineers who are able to build mines.
        Game - Display to (Player group(Player 6 (Orange))) the text: You are protection the northern borderline which can be attacked by every faction but the Demon Invaders and the Crime Cartell have also the possibility to attack positions which are located more southern.Most of your ranged units have an increased range to other races so pay attention to use this ability wisely.
        Game - Display to (Player group(Player 7 (Green))) the text: After you have caused all the cataclysm of Theosa you are to finish what you have begun.You are the smallest force (only 2 players) so be carefull. Ensure the Slaugtherhouse (your northern borderline) to be safe because the Blulales can attack this quite fast. Use your strong air units to ensure this and to lead attacks.Furthermore you have the possibility to train Necromancers after you have defeated the Erlking (If another Force kills the Erlking, the knowledge of Necromancery is lost). The Erlking is inside his crypt in the Blue Beech Tree Forest south of the Human base.Necromancers can summon permanent units from corpes so they can be quite useful after battles.
        Game - Display to (Player group(Player 7 (Green))) the text: If you have Necromancers you have also the possibility to sacrifice your own units (Black Soldiers and Crossbowmen) because you have a chance of 66% to receive a Tier 2 or Tier 3 unit.
        Game - Display to (Player group(Player 8 (Pink))) the text: You start with nearly no influence so you should work toghether with your ally to build new bases and to receive more income.At first you should start to build the Great Void Portal because this will enable you to summon Balrogs (Elite Tier 5!) with quite destructive skills.Make use of Siege Gargoyles (flying Siege units) to surprise your enemys and strike them down with brutality.
        Game - Display to (Player group(Player 9 (Gray))) the text: Your base is located in the undergrounds of Troglospyl-City and furthermore it´s the border to the Stranded Alliance so be prepared and avoid a siege against you. Work toghether with the Pigclans to hold the southern border of the Eastern Crime Cartell.Since you have severel stealthunits make sure to surprise your enemys.
        Game - Display to (Player group(Player 10 (Light Blue))) the text: You have 2 bases: one in Keria the desert of lonelines - which is quite safe - and one in the very center of the realm of the Stranded Alliance which is in urgent danger.Try to hold that position or Troglospyl-City is alone in urgent danger. If you attack than your first target should be the blulalien outpost in the Desert of Lonelines and than try to bring the war to the Blulales.
        Game - Display to (Player group(Player 11 (Dark Green))) the text: You protect the very northern border of the Crime Cartell and have good defensive possibilities.Wolf Overlords can affect all units in a certain range making them quite useful. The Voodoo Lord can be one of your most important units if you try to attacks with huge amount of summoned units giving you a special strategy.
        Game - Display to (Player group(Player 12 (Brown))) the text: You protect the northern part of the Eastern Crime Cartell but as you will see you have no real defense there. So either you protect the way to Tiranza or the Blulales construct their defenses there.
        Wait 35.00 seconds
        Cinematic - Clear the screen of text messages for PlayersAll.
        -------- Heroes --------
        Game - Display to (Player group(Player 1 (Red))) the text: Your first hero is Varamir the Highlord of the Carras. He will fight in your armies first lines and support your units with an Aura. He can taunt enemy units and increase his armor while doing this. Nethertheless he debuffs enemy units with his Frostfireblade and affect enemies and allies with his "Honorseeking Sword".Your second hero is Vizeera Runethunder the Runequeen of the Stelethyds. With the herritage of the Runequeens she uses Runes to stun enemy units and to strengthen herself. She has good tank abilities if she enhances her skin with Stretchsilver and activates the Runehammer to leech life from enemy living units.
        Game - Display to (Player group(Player 2 (Blue))) the text: Furthermore you have control of two heroes.Voratoll the Prophet of the icy water is your first one. He attacks enemies with AoEs and supports your units with his Chilling Aura. He wears also an amulet which allows to summon weak Water Elementals but drops when he dies. Althoug he is revivable.Your second hero Zeth´arul the Lord of the Borderguard is not revivable. He attacks single enemies with fast attacks and has with his ability Evasion and his heroic ability Will of Death good survival chances.Beyond these two heroes there is the possibility to achieve a third non-revivable hero who will aid you with damage and an supporting Aura.
        Game - Display to (Player group(Player 3 (Teal))) the text: To continue you have two heroes.Farsasz Iceeye is a warrior hero who can increase his own defensive abilities and heal multiple friendly units. As his heroic skill he can summon an supporting Eye of Ice.Your second hero is Lisara Bladescale the Warden. She will fastly tear down single targets and support your units with extra damage. She´s also able to disable an enemy unit with her Warden´s Prison.
        Game - Display to (Player group(Player 4 (Purple))) the text: To continue you should use your two heroes.Malgus Brighhammer the Paladin and the right hand of the king of Melith is a supporting hero who fights in the first lines. With his heroic skill he has also good tank stats.Your second hero is Falszar Iceblade the Bladelord. He leads the troops of the Zegol faction. He attacks enemies with strong single target attacks and AoE skills.
        Game - Display to (Player group(Player 5 (Yellow))) the text: The Leader of your Dwarvish realm is Bordin Mithrilplate the Dwarven Thane and your first hero. He´s a warrior hero with a strong enhanceable armor and stun abilities.Your second hero is Garith Thundersteel the Commander of the Guard. He´s an adept in strategical knowledge so his abilities can turn the tide of a battle.Nethertheless you can achieve a third non-revivable hero who will help you with strong healing abilities.
        Game - Display to (Player group(Player 6 (Orange))) the text: Your first hero is Allesandra the Magistrix of the Water. She will attack your units with strong AoEs and debuffing attacks. As other elves she has an increased range which can be useful in some situations.Dalaro Barkshield the Keeper of Sharenar is the second elf hero. He is able to slow down single targets and to support your units with heal and extra armor.
        Game - Display to (Player group(Player 7 (Green))) the text: Initially you have two heroes."Bladestorm" Thorano the Armmaster is a warrior hero attacking enemies with AoEs and Weakening Attacks. He can also summon Spirits to your aid as his heroic skill.Dannimos the Black Highcultist is your strongest hero who is classified as a Tier 1 Boss. He is a well skilled fighter with both: weapons and magic giving him the ability to combine Weapons with magic. He has several skills to damage his enemies. Pay attention because Dannimos is not revivable.If you manage to kill the Erlking you will also grant control of Arthur Blackmoore the Skeleton Battlemaster who will attack enemies dealing much damage and increase nearby friendly units´ damage. Also use his heroic skill which deals 200 damage.
        Game - Display to (Player group(Player 8 (Pink))) the text: During the whole game you will have a maximum of 2 hero.Initially you'll be able to control Morbeen the demonic fiend and harbringer of the demonic destruction. He's a litterally weak hero but starts at level 4. He´s meant to annoy your enemies while killing their units with fast attacks.Use Morbeen´s ability Blink wisely because it allows him to walk ways that can´t be used by many other units.If you have constructed the Great Void Portal Morbeen's death gives you your second hero: Sharrazor the Highexecutioner who will debuff enemy units and deal huge amount of damage. He's a Tier 1 Boss but also non-revivable so pay attention.|nYour third hero will be summoned by the Cult of the Black Hand: Skrullos'therar the second leader of the Doombringer Legion will join and assist you with Elemental and Gorar Magic.
        Game - Display to (Player group(Player 9 (Gray))) the text: You have also two heroes you should use.Barrock Deathfist the Overlord is the brutish leader of Troglospyl City and initiated the Eastern Crime Cartell. He has good defensive abilities and can taunt enemy units. With his heroic skill he can also deal much single target damage.Your second hero Faerick Pinhead the Insane Sorcerer is your second hero. He was once a proud sorcerer but the fall of Troglospyl strongly affected Faerick who saw much knowledge been lost. He manipulates battles and has an destructive heroic skill which should be used wisely.
        Game - Display to (Player group(Player 10 (Light Blue))) the text: The Pigclans have been united by Borkaer the Sandlord. He is a litterally passive warrior hero who supports your units with an Aura. With his heroic ability Sand of Time he can also slow down many enemy units.Your second hero is Gronk Borkor the Dusthill Lieutenant. He can heal single units and wounds enemy units dealing damage over time.
        Game - Display to (Player group(Player 11 (Dark Green))) the text: In this game you can use one hero: Tarash Ete´Terro the Voodoofighter.He will aid your army as an assassin with abilities dealing damage to multiple targets. With his heroic skill he can furthermore root an enemy unit for short time but this ability triggers with every common attack by Tarrash.He´s revivable and far cheaper than other heroes to revive so make use of him.
        Game - Display to (Player group(Player 12 (Brown))) the text: You already have greedy units but your heroes are even greedier. Eugene the Saviour of Money who didn´t wasted gold during the age of destruction is a litterally passive heroe. His wave-presence deals constantly damage and his Greed can be upgraded to steal ressources from ALL enemy units so make use of him.Marallas the Treasure Lord is your second hero and a summoner. He can buff your units and "Recycle" enemy units. Also use his skill Crusty Combo which can cheat food and elite units cap!.Pay attention because Marallas is not revivable.
        Wait 40.00 seconds
        Cinematic - Clear the screen of text messages for PlayersAll.
        -------- Specials --------
        Game - Display to (Player group(Player 1 (Red))) the text: Your race specifis: Rank: Jarl Difficulty: Normal This race (these 2 races) does not have quite special properties. You can build many types of Elite units - so use them. You can also use several active skills which needs speed and is the difficulty of the race.
        Game - Display to (Player group(Player 2 (Blue))) the text: Now let´s see what makes the trolls specific:Rank: VikingDifficulty: NormalTrolls are a quite passive race during combats supporting own units with auras and first aid kits to heal after these battles. Also use AoE-skills because several units have one. As a late upgrade you can also build longship docks providing you with additional income you can use for more units or to supply your allies.
        Game - Display to (Player group(Player 3 (Teal))) the text: Now there are some special things to say about your race.Rank: Self-made specialistDifficulty: HardYou will a have a quite hard beginning phase where you have to improve your army and to unlock better units. There are 3 Technologies you have to upgrade: Crafting, Spellpower and Unit Training. In order to improve them you have to build buildings, use skills and train units. (Seems quite easy but you need some luck)In order to increase the Crafting Level you have to free the renegade bonecarver Scarbone who´s located north of your base.Later you will focus strategical targets and use control and support abilities.
        Game - Display to (Player group(Player 4 (Purple))) the text: So what´s special about your race?Rank: LieutenantDifficulty: NormalThere´s not much to say but you should chose your final upgrade wisely. You can either chose to build more and stronger elite units which will make you concentrate on small groups or pick the sorcerer´s way which improves some of your spellcasters.
        Game - Display to (Player group(Player 5 (Yellow))) the text: After the information about your heroes there are small special things about your race.Rank: A stone in the beerDifficulty: Normal - Hard|nYou have less upgrades than other races so might reach the end game quite fast where you have to make a choice affecting your further actions.|nYou can focus on tanks, strong damage or on movement and regeneration speed.
        Game - Display to (Player group(Player 6 (Orange))) the text: Here are the specifics of the wood loving race:Rank: Archer with mana problemsDifficulty: NormalElves traditionally use bows they build without dealing to much damage to the nature. Your troops use bowmen in different ranks but all with a higher range than ranged fighters of other races. You use many auto-cast skills to enhance attacks and some supporting auras. Nevertheless upgrading your units requires some time because your classification unit requires slowly regeneration mana to start an upgrade which is not refunded if cancelled. This is the problem of tree fanatics who don´t want to hurt the nature.
        Game - Display to (Player group(Player 7 (Green))) the text: The not so dark secrets about the Cult:Rank: Versatile in the UndergroundDifficulty: NormalThe Cult can use many different units making it a quite versatile race. Make sure to have some Necromancers because they can fast summon permanent minions from corpses costing no food. Furthermore use auras and cooperate with your ally because you are the smallest force.Also you are able to summon a powerful hero for your ally which is quite important.
        Game - Display to (Player group(Player 8 (Pink))) the text: Dark Demonic Lessons:Rank: CrafterDifficulty: HardDemons are quite defensive units with higher defense and health regeneration values than other races. Battles will contain a medium amount of micro management (compared to other races) but you have to plan your army and which units you use because you have to literally build these units from smaller ones (e.g. you can fuse 2 Eskator Artillerists to one Eskator Mage). This doesn´t affect all units but the strongest units have to be fused like that. This saves some money because these units do not cost extra money and are only limited by the food you have meaning Balrogs aren't limited by 2 for example.Lessons learned?
        Game - Display to (Player group(Player 9 (Gray))) the text: Furthermore your race has some specifics. Rank: CamperDifficulty: NormalDue to the eradication of Theosa during the age of destruction it´s hard for you to hire new criminals which increases the training time of your units by 20%. However your buildings need 25% less time being build and ALL buildings can attack enemy units.Also the upgrades at your classification unit cost more than the ones of other races but you can focus earlier on your prefered paths.
        Game - Display to (Player group(Player 10 (Light Blue))) the text: Last but not least your race has some specific properties.Rank: Show me the foodDifficulty: HardThe Battlecook is your most important unit. Farms can give him Food (Mana) he can use to cook meals for your units. With those meals you unlock upgrades to your units.Except of your simple units you have to pay more money to get stronger units. Also you can build only 5 workers but each one more unit of each Elite Type than other races.
        Game - Display to (Player group(Player 11 (Dark Green))) the text: Finally there are some specifics about your race. Rank: SpamDifficulty: EasyThe most important information about your race is spam, spam and one more time spam. You can train even faster weak units than other races (about -15% time on common units) but have also the option to train a couple of elite units which might be useful when attacking an enemy but don´t forget to produce more units.Voodoo Lords are your primary spellcasters and important if you play the summoner path. You have one ultimate upgrade wether you want to train weak units even faster or if you want better summoners.Also your buildings have weaker armor than other races so play offensive - your units are cheap.
        Game - Display to (Player group(Player 12 (Brown))) the text: Let´s come to the specifics of your race.Rank: GreedIsGoodDifficulty: NormalYour units can walk on water so supprise your enemies. Some units don´t need to be trained. They can be bougth at Crab Barracks and the Temple of Money like common mercenaries (Pay attention: Your enemies can buy them as well). Finally your Engineers can build limitless armies of robots but only a limited number of them can be Activatet!
        Wait 35.00 seconds
        Cinematic - Clear the screen of text messages for PlayersAll.
        Game - Display to PlayersAll the text: Good luck and have fun.
        Player Group - Pick every player in (All players) and do (Actions)
          Loop - Actions
            Cinematic - Turn off letterbox mode (show interface) for (All players): fade in over 0.30 seconds
      Else - Actions
    -------- Wichtige Dinger --------
    Trigger - Run AufSuddenDeathWarten <gen> (checking conditions)
    Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
      Loop - Actions
        Unit - Unpause (Picked unit)
    -------- Trigger --------
    Trigger - Run TimerUmstellen <gen> (ignoring conditions)
    Trigger - Remove Waehl_doch <gen> from the trigger queue
    Trigger - Turn off ErhoehenUm30 <gen>
    Trigger - Turn off ErhoehenUm60 <gen>
    Trigger - Turn off ErhoehenUm90 <gen>
    Trigger - Turn off ErhoehenUm120 <gen>
    Trigger - Turn off WillKeinSD <gen>
    Trigger - Turn off IntroNo <gen>
    Trigger - Turn off IntroYes <gen>
    Trigger - Turn off WillKeinSD <gen>
AufSuddenDeathWarten
  Events
  Conditions
    iWantsNoSuddenDeath Less than (iPlayers / 4)
  Actions
    Set VariableSet iSDBerechneteWartezeit = (iSuddenDeathZeitGesamt / iSuddenDeathAbgegebeneStimmen)
    Wait 0.20 seconds
    -------- Was zum Sudden Death gehört --------
    Countdown Timer - Start tSuddenDeath as a One-shot timer that will expire in (Real(iSDBerechneteWartezeit)) seconds
    Set VariableSet oTimerArray[1] = (Last started timer)
    Countdown Timer - Create a timer window for (Last started timer) with title Sudden Death
    Set VariableSet oTimerWindowArray[1] = (Last created timer window)
    Wait (Real(iSDBerechneteWartezeit)) seconds
    Countdown Timer - Destroy oTimerWindowArray[1]
    Game - Display to (All players) the text: It´s time for Sudden Death! Handycap to all players: 1%. Neutrals are removed.
    Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Owner of (Picked unit)) Equal to Neutral Hostile
          Then - Actions
            Unit - Remove (Picked unit) from the game
          Else - Actions
    Player - Set Player 1 (Red) handicap to 1.00%
    Player - Set Player 2 (Blue) handicap to 1.00%
    Player - Set Player 3 (Teal) handicap to 1.00%
    Player - Set Player 4 (Purple) handicap to 1.00%
    Player - Set Player 5 (Yellow) handicap to 1.00%
    Player - Set Player 6 (Orange) handicap to 1.00%
    Player - Set Player 7 (Green) handicap to 1.00%
    Player - Set Player 8 (Pink) handicap to 1.00%
    Player - Set Player 9 (Gray) handicap to 1.00%
    Player - Set Player 10 (Light Blue) handicap to 1.00%
    Player - Set Player 11 (Dark Green) handicap to 1.00%
    Player - Set Player 12 (Brown) handicap to 1.00%
//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

 
SpielerGeht
  Events
    Player - Player 1 (Red) leaves the game
    Player - Player 2 (Blue) leaves the game
    Player - Player 3 (Teal) leaves the game
    Player - Player 4 (Purple) leaves the game
    Player - Player 5 (Yellow) leaves the game
    Player - Player 6 (Orange) leaves the game
    Player - Player 7 (Green) leaves the game
    Player - Player 8 (Pink) leaves the game
    Player - Player 9 (Gray) leaves the game
    Player - Player 10 (Light Blue) leaves the game
    Player - Player 11 (Dark Green) leaves the game
    Player - Player 12 (Brown) leaves the game
  Conditions
  Actions
    Unit Group - Pick every unit in (Units in (Playable map area) owned by (Triggering player)) and do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            And - All (Conditions) are true
              Conditions
                (UnitCache <gen> contains (Picked unit)) Equal to False
                (Classifications <gen> contains (Picked unit)) Equal to False
          Then - Actions
            Unit - Kill (Picked unit)
          Else - Actions
//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

 
UnitCache
  Events
    Unit - A unit enters UnitCache <gen>
  Conditions
  Actions
    Unit - Make (Triggering unit) Invulnerable
Punktewerte:
10: Kleines Gebäude
93: TrainierteEinheiteGruppen
94: Wird aus kleineren Einheiten zusammengebaut
95: Arbeiter
96: alle ZauberDummys
97: Summons Einheiten
98: Upgegradete Einheiten
99 + Untoter: in Gruppen trainiert
100: normales Gebäude, normale Einheit
101: Held
200: Großes Gebäude
201: Capital-Building

Event-Punktewerte
11 Blueshadeditch
//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

 
Mobs von DemonInvaders
//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

 
Weitere Event-Pläne
- Appaling Nightmare
- Seestadt / Hafenstadt in Steppe von Hallas
//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