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

Dragon Nest TD v1.79.w3x
Variables
Variables
Initialization
Melee Initialization
Single Player
Voting
Fire Egg
Earth Egg
Wind Egg
Water Egg
Ice Egg
Nature Egg
Lightning Egg
Shadow Egg
Gold Egg
Start bonus
Player leave
Lose
LoseRed
LoseBlue
LoseTeal
LosePurple
LoseYellow
LoseOrange
Win
GamerSmurf Kill
Peon movement speed
Activate Strength skill
Activate Ignite Breath skill
Untitled Trigger 001
GDD
GDD Variable Creator
GUI Friendly Damage Detection
Ship
Create Coast Guard
Coast Guard step 1
Remove Coast Guard
Ship1
Ship2
Ship3
Ship4
Ship5
Ship6
Egg
Enhanced Egg Fire
Enhanced Egg Earth
Enhanced Egg Wind
Enhanced Egg Water
Enhanced Egg Ice
Enhanced Egg Nature
Enhanced Egg Lightning
Enhanced Egg Shadow
Enhanced Egg Gold
Build egg
Gold egg lvl 1 to 10
Gold egg lvl 11 to 20
Gold egg lvl 21 to 30
Lightning egg
Wind egg
Shadow egg
Shadow egg 2
Shadow egg red
Shadow egg blue
Shadow egg teal
Shadow egg purple
Shadow egg yellow
Shadow egg orange
Build on egg
Drop egg
Egg enters map
Egg under attack
Egg under attack delay trigger
Egg Attack
Attack Red building
Turn on Attack Red building
Attack Blue building
Turn on Attack Blue building
Attack Teal building
Turn on Attack Teal building
Attack Purple building
Turn on Attack Purple building
Attack Yellow building
Turn on Attack Yellow building
Attack Orange building
Turn on Attack Orange building
Tower Triggers
Voidwalker
Firelord Tower
Firelord Tower 2
Witch Doctor Tower
Witch Doctor Tower 2
Forrest Tower
Demon Tower
Demon Tower 2
Shockwave Tower
Shockwave Tower Copy
Remove Rally from Maze Tower
Random Tower
Shaman Tower 2
Shaman Tower 3
Shaman Tower 4
Necromancer Tower 1
Necromancer Mage
Necromancer Unit check
Necromancer Unit check 2
Skeletal Mage ability
Berserker ability
Display Range
Display egg ability range
Display tower ability range
Strength Tower lvl 1
Strength Tower lvl 2
Strength Tower lvl 3
Strength Tower lvl 4
Strength Tower lvl 5
Strength Tower lvl 6
Wolf Caller
Wolf Caller 2
Tube Wyrm
Tube Wyrm ability
Remove Totem
Remove Skeleton
Knive Tower
Upgrade Warden Tower
Minigame
Start Minigame 1
Start Minigame 2
Boss AI
Minigame 2 gold
Minigame 2 lumber
animation
Close Minigame
Prize gold 1
Prize gold 2
Prize lumber 1
Prize lumber 2
Fireball
During minigame 2
During minigame 1
Example 4
Missile Periodic
Reset
Terrain and Boundary
Damage
Damage Method 1 And 4
After Destination 1 to 6
After Destination Others
Fragment
Anti cheat
Avoid building red
Avoid building blue
Avoid building teal
Avoid building purple
Avoid building yellow
Avoid building orange
Player 1
Player 2
Player 3
Player 4
Player 5
Player 6
Player 7
Player 8
Player 9
Player 10
Player 11
Player 12
Creeps
Update End Round Gold
Start wave
During wave
Hurtigere creep tjek
Value2
End wave
Ajust Str Tower
Spawn Levels
AttackRed
AttackRedEgg
AttackBlue
AttackBlueEgg
AttackTeal
AttackTealEgg
AttackPurple
AttackPurpleEgg
AttackYellow
AttackYellowEgg
AttackOrange
AttackOrangeEgg
Anti block system
Unstuck creeps
Remove Referee units
Remove Referee units 2
Spawn for red
Spawn for blue
Spawn for teal
Spawn for purple
Spawn for yellow
Spawn for orange
Random Order 1
Random Order 2
Random Order 3
Random Order 4
Random Order 5
Random Order 6
Random Order 7
Random Order 8
Initialization
Multiboard
Multiboard ny
Multiboard Copy
Update Kills
Update Egg HP
Commands
Untitled Trigger 002
air
Sell tower
Sell tower Maze Tower
Funny String
Zoom
Next
Champion
Info
Cls
Setup Creeps
Setup Creep Types
Attack Types
Armor Types
Setup Creep Properties
Generate Creep Properties
Upgrades
Health Potion
Peon Teleport
Peon Harvest
Buy Mana Shield
Buy Income
Activate buy
Activate buy 2
Update Abilities
Activate ability
Buy Ability
Upgrade food limit
Ajust Display Range
Buy Reinforcement
Buy Reinforcement Bonus
Bonus Level
Prize
Fire Egg ability
Water Egg ability
Ice Egg ability
Wind Egg ability
Lightning Egg ability
Create Leaderboard
LeaderboardRed
LeaderboardBlue
LeaderboardTeal
LeaderboardPurple
LeaderboardYellow
LeaderboardOrange
Enter map-specific custom script code below. This text will be included in the map script after variables are declared and before any trigger code.

		
Name Type Is Array Initial Value
AbilityArmor integer Yes
AbilityBoss integer Yes
AbilityEvasion integer Yes
AbilityHowlAura integer Yes
AbilityRegen integer Yes
AbilityUnholy integer Yes
AfterDestination integer Yes
AjustRange real Yes
AlreadyHit group Yes
Angle real Yes
Angle2 real No
ATKChaosList string No
ATKMagicList string No
ATKNormalList string No
ATKPierceList string No
ATKSiegeList string No
AttackType attacktype Yes
BerserkerRandom integer No
BlockCount integer Yes
BonusBlue integer No
BonusCount integer No
BonusOrange integer No
BonusPurple integer No
BonusRed integer No
BonusTeal integer No
BonusYellow integer No
BuildNecromancerTower group No
ButtonBonusFood button Yes
ButtonBonusGold button Yes
ButtonBonusLumber button Yes
ButtonBonusManashield button Yes
ButtonBonusRange button No
ButtonEarthEgg button No
ButtonFireEgg button No
ButtonGold1 button No
ButtonGold2 button No
ButtonGoldEgg button No
ButtonIceEgg button No
ButtonLightningEgg button No
ButtonLumber1 button No
ButtonLumber2 button No
ButtonNatureEgg button No
ButtonNo button No
ButtonNormalGameplay button No
ButtonShadowEgg button No
ButtonSurvivalGameplay button No
ButtonWaterEgg button No
ButtonWindEgg button No
ButtonYes button No
cc_endtag string No
cc_players string Yes
ChampionWave1 integer No
ChampionWave2 integer No
ChampionWave3 integer No
ChampionWave4 integer No
ChampionWave5 integer No
ChooseAbility dialog No
ChooseBonus dialog Yes
ChooseEgg dialog No
ChooseGameplay dialog No
ChooseMinigame dialog No
ChoosePrize dialog No
CollisionRadius real Yes
CountCreeps integer No
Counter integer No 1
Counter2 integer No 0
CountTrees integer No
CreateString integer No
CreepGroup1 group No
CreepGroup2 group No
CreepGroup3 group No
CreepGroup4 group No
CreepGroup5 group No
CreepGroup6 group No
CreepGroup7 group No
CreepGroup8 group No
Damage real Yes
DamageMethod integer Yes
DamageSource unit Yes
DamageSpecialEffect string Yes
DamageSpecialEffectLocation string Yes
DEFFortifiedList string No
DEFHeavyList string No
DEFLightList string No
DEFMediumList string No
DEFUnarmoredList string No
Distance real Yes
Drag boolean Yes
Egg unit Yes
EggHP integer Yes
EggPositionBlue location No
EggPositionOrange location No
EggPositionPurple location No
EggPositionRed location No
EggPositionTeal location No
EggPositionYellow location No
EggSelect integer Yes
EnemyGroup group No
EnemyGroup_Champ group No
EnemyGroup_Copy group No
ExplodeRadius real Yes
Explosion integer Yes
FirelordDmg integer No
FirelordUnit unit Yes
GDD__Integers integer Yes
GDD__LeftMapGroup group No
GDD__TriggerArray trigger Yes
GDD__UnitArray unit Yes
GDD_Damage real No
GDD_DamagedUnit unit No
GDD_DamageSource unit No
GDD_Event real No
HintString string Yes
HorizontalArc real Yes
HpIncrease real No
Income integer Yes
IncomeCreep integer Yes
IncomeMulti integer Yes
IncomeMultiText integer Yes
Index integer No
IndexReseter integer No
IntegerBlue integer No
IntegerC integervar Yes
IntegerOrange integer No
IntegerPurple integer No
IntegerRed integer No
IntegerTeal integer No
IntegerYellow integer No
Jump boolean Yes
Kills integer Yes
KillWarlockUnit group No
LastValidIndex integer No
LeaderboardValue integer Yes
Level_EndRoundGold integer Yes
Level_Integer integer No
Level_UnitType unitcode Yes
Level_UnitType_Copy unitcode Yes
Level_UnitTypeBonus unitcode Yes
LevelArmor_String string Yes
LevelATKType_String string Yes
LevelAttack_String string Yes
LevelBounty_Integer integer Yes
LevelBountyList string No
LevelDEFType_String string Yes
LevelDescript_String string Yes
LevelWaveArmor integer Yes
LevelWaveCount_Integer integer Yes
LevelWaveCountList string No
LevelWaveHP integer Yes
LevelWaveMoveSpeed integer Yes
LongPathGroup group No
LoopIndex integervar No
ManaShieldCheck integer Yes
MaxLevel_Integer integer No
MinigameGold integer Yes
MinigameLumber integer Yes
MinigameVotes integer No
Missile unit Yes
MissileEffect effect Yes
MissileEffectString string Yes
MissileSize real Yes
ModeVotes integer No
Multiboard_Spots integer Yes
MultiboardVar multiboard No
MyListString string No
MyUnit unit Yes
NecromancerWindWalk group No
NumberArray integer Yes
NumberOfShamanlvl3 group No
NumberOfShamanlvl4 group No
NumberOfShamanlvl5 group No
player_colour integer No
player_row integer No
PlayerGrougForMinigame force No
PlayerGroup force No
PlayerNumber integer No
Point location No
Point2 location No
PointDemon location No
RandomCreepNumber integer No
RandomIndex integer No
RandomInteger integer No
RandomNumber integer No
RandomNumber2 integer No
RandomNumber3 integer No
RandomNumber4 integer No
RandomNumberAI integer No
RandomTower integer No
RandomUnit unit No
Range real No
Rangeeffect effect Yes
RedRegion rect No
ReinforcementBlue integer No
ReinforcementBlueBonus integer No
ReinforcementOrange integer No
ReinforcementOrangeBonus integer No
ReinforcementPurple integer No
ReinforcementPurpleBonus integer No
ReinforcementRed integer No
ReinforcementRedBonus integer No
ReinforcementTeal integer No
ReinforcementTealBonus integer No
ReinforcementYellow integer No
ReinforcementYellowBonus integer No
RemoveSkeleton group No
RemoveTotemAndSkeleton group No
SkeletalMageAbility integer Yes
SkeletonArcherCount integer Yes
SkeletonMageCount integer Yes
SkeletonWarriorCount integer Yes
Spawn_Timer timer No
Speed real Yes
StartPoint location Yes
TargetsAllies boolean Yes
Temp_Integer integer No
Temp_Integer2 integer No
Temp_Integer3 integer No
Temp_Integer4 integer No
Temp_Real real No
Temp_String string No
Temp_String3 string No
TempBlockPoint location Yes
TempBlockPoint2 location Yes
TempDemonGroup group No
TempGroup group No
TempGroup11 group No
TempGroup2 group No
TempGroup22 group No
TempGroup22_Champ group No
TempGroup22_Copy group No
TempGroup3 group No
TempGroup4 group No
TempGroup5 group No
TempGroup6 group No
TempGroupAbility group No
TempGroupDark group No
TempGroupMinigame group No
TempGroupMinigame2 group No
TempGroupTjek group No
TempGroupTjek2 group No
TempGroupTjek3 group No
TempGroupTjek4 group No
TempGroupTjek5 group No
TempGroupTjek6 group No
TempGroupTjek7 group No
TempGroupTjek8 group No
TempGroupUnstuck group No
TempLongPathPoint location No
TempOffset location No
TempPath1 group No
TempPath2 group No
TempPath3 group No
TempPath4 group No
TempPath5 group No
TempPath6 group No
TempPoint location No
TempPoint2 location No
TempPoint3 location No
TempPoint4 location No
TempPoint5 location No
TempPointBerserker location No
TempReal real No
TempTreePoint location No
TempUnits group No
TempUnitType unitcode No
TerrainandBoundaryReaction integer Yes
Value integer Yes
ValueGroup group No
VerticalArc real Yes
VoteTimer timer No
WarMill integer Yes
WarMillBlue unitcode Yes
WarMillCounter1 integer No
WarMillCounter2 integer No
WarMillCounter3 integer No
WarMillCounter4 integer No
WarMillCounter5 integer No
WarMillCounter6 integer No
WarMillOrange unitcode Yes
WarMillPurple unitcode Yes
WarMillRed unitcode Yes
WarMillTeal unitcode Yes
WarMillYellow unitcode Yes
WaveGroup group Yes
WhichDoctor integer No
WichtDocterCounter integer No
Upgrade 1.79:
Added Champion waves
Added starting bonus and removed random starting bonus chance
Added Voidwalker Tower
Changed terrain a bit
Creep walk speed 340 --> 400
Increased cost and damage of Aqua Tower
Small buff to Ancient Tower
Building close to creeps(Range of 400) is now activated after wave 1





Author:
Voidwalker attack effect created by Mythic

minigame
Hvis det kun er ancinet tower og druid tower som bliver angrebet af bonus wave, så kan damage ignoreres på disse towers
Melee Initialization
  Events
    Map initialization
  Conditions
  Actions
    Cinematic - Fade out over 0.00 seconds using texture Black Mask and color (0%, 0%, 0%) with 0% transparency
    Unit - Hide Shade 0016 <gen>
    Unit - Hide Shade 0017 <gen>
    Unit - Hide Shade 0026 <gen>
    Unit - Hide Shade 0033 <gen>
    Unit - Hide Shade 0034 <gen>
    Unit - Hide Shade 0035 <gen>
    Unit - Hide You already dropped your egg 0037 <gen>
    Unit - Hide You already dropped your egg 0038 <gen>
    Unit - Hide You already dropped your egg 0039 <gen>
    Unit - Hide You already dropped your egg 0040 <gen>
    Unit - Hide You already dropped your egg 0041 <gen>
    Unit - Hide You already dropped your egg 0042 <gen>
    Cinematic - Fade out over 0.00 seconds using texture Black Mask and color (0%, 0%, 0%) with 0% transparency
    Player - Limit training of Shaman Tower lvl 1 to 1 for Player 1 (Red)
    Player - Limit training of Shaman Tower lvl 1 to 1 for Player 2 (Blue)
    Player - Limit training of Shaman Tower lvl 1 to 1 for Player 3 (Teal)
    Player - Limit training of Shaman Tower lvl 1 to 1 for Player 4 (Purple)
    Player - Limit training of Shaman Tower lvl 1 to 1 for Player 5 (Yellow)
    Player - Limit training of Shaman Tower lvl 1 to 1 for Player 6 (Orange)
    Player - Limit training of Wolf Caller Tower lvl 1 to 1 for Player 1 (Red)
    Player - Limit training of Wolf Caller Tower lvl 1 to 1 for Player 2 (Blue)
    Player - Limit training of Wolf Caller Tower lvl 1 to 1 for Player 3 (Teal)
    Player - Limit training of Wolf Caller Tower lvl 1 to 1 for Player 4 (Purple)
    Player - Limit training of Wolf Caller Tower lvl 1 to 1 for Player 5 (Yellow)
    Player - Limit training of Wolf Caller Tower lvl 1 to 1 for Player 6 (Orange)
    Player - Limit training of Necromancer Tower lvl 1 to 1 for Player 1 (Red)
    Player - Limit training of Necromancer Tower lvl 1 to 1 for Player 2 (Blue)
    Player - Limit training of Necromancer Tower lvl 1 to 1 for Player 3 (Teal)
    Player - Limit training of Necromancer Tower lvl 1 to 1 for Player 4 (Purple)
    Player - Limit training of Necromancer Tower lvl 1 to 1 for Player 5 (Yellow)
    Player - Limit training of Necromancer Tower lvl 1 to 1 for Player 6 (Orange)
    Player - Limit training of Firelord Tower lvl 1 to 1 for Player 1 (Red)
    Player - Limit training of Firelord Tower lvl 1 to 1 for Player 2 (Blue)
    Player - Limit training of Firelord Tower lvl 1 to 1 for Player 3 (Teal)
    Player - Limit training of Firelord Tower lvl 1 to 1 for Player 4 (Purple)
    Player - Limit training of Firelord Tower lvl 1 to 1 for Player 5 (Yellow)
    Player - Limit training of Firelord Tower lvl 1 to 1 for Player 6 (Orange)
    Visibility - Create an initially Enabled visibility modifier for Player 7 (Green) emitting Visibility across MapVision <gen>
    Visibility - Create an initially Enabled visibility modifier for Player 8 (Pink) emitting Visibility across MapVision <gen>
    Visibility - Create an initially Enabled visibility modifier for Player 9 (Gray) emitting Visibility across MapVision <gen>
    Visibility - Create an initially Enabled visibility modifier for Player 10 (Light Blue) emitting Visibility across MapVision <gen>
    Visibility - Create an initially Enabled visibility modifier for Player 11 (Dark Green) emitting Visibility across MapVision <gen>
    Visibility - Create an initially Enabled visibility modifier for Player 12 (Brown) emitting Visibility across MapVision <gen>
    For each (Integer A) from 1 to 6, 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
                ((Player((Integer A))) slot status) Equal to Is playing
                ((Player((Integer A))) controller) Equal to User
          Then - Actions
            Player Group - Add (Player((Integer A))) to PlayerGroup
            Player Group - Add (Player((Integer A))) to PlayerGrougForMinigame
            Player - Make Peon Unavailable for training/construction by (Player((Integer A)))
            Player - Set (Player((Integer A))).Current gold to 50
            Player - Set (Player((Integer A))).Current lumber to 30
          Else - Actions
            Unit Group - Pick every unit in (Units in (Playable map area) owned by (Player((Integer A)))) and do (Actions)
              Loop - Actions
                Unit - Remove (Picked unit) from the game
    Trigger - Run Peon_movement_speed <gen> (ignoring conditions)
    Trigger - Turn on Buy_Income <gen>
    Player - Make Player 1 (Red) treat Player 7 (Green) as an Enemy
    Player - Make Player 1 (Red) treat Player 8 (Pink) as an Ally
    Player - Make Player 1 (Red) treat Player 9 (Gray) as an Ally
    Player - Make Player 1 (Red) treat Player 10 (Light Blue) as an Ally
    Player - Make Player 1 (Red) treat Player 11 (Dark Green) as an Ally
    Player - Make Player 1 (Red) treat Player 12 (Brown) as an Ally
    Player - Make Player 2 (Blue) treat Player 7 (Green) as an Ally
    Player - Make Player 2 (Blue) treat Player 8 (Pink) as an Enemy
    Player - Make Player 2 (Blue) treat Player 9 (Gray) as an Ally
    Player - Make Player 2 (Blue) treat Player 10 (Light Blue) as an Ally
    Player - Make Player 2 (Blue) treat Player 11 (Dark Green) as an Ally
    Player - Make Player 2 (Blue) treat Player 12 (Brown) as an Ally
    Player - Make Player 3 (Teal) treat Player 7 (Green) as an Ally
    Player - Make Player 3 (Teal) treat Player 8 (Pink) as an Ally
    Player - Make Player 3 (Teal) treat Player 9 (Gray) as an Enemy
    Player - Make Player 3 (Teal) treat Player 10 (Light Blue) as an Ally
    Player - Make Player 3 (Teal) treat Player 11 (Dark Green) as an Ally
    Player - Make Player 3 (Teal) treat Player 12 (Brown) as an Ally
    Player - Make Player 4 (Purple) treat Player 7 (Green) as an Ally
    Player - Make Player 4 (Purple) treat Player 8 (Pink) as an Ally
    Player - Make Player 4 (Purple) treat Player 9 (Gray) as an Ally
    Player - Make Player 4 (Purple) treat Player 10 (Light Blue) as an Enemy
    Player - Make Player 4 (Purple) treat Player 11 (Dark Green) as an Ally
    Player - Make Player 4 (Purple) treat Player 12 (Brown) as an Ally
    Player - Make Player 5 (Yellow) treat Player 7 (Green) as an Ally
    Player - Make Player 5 (Yellow) treat Player 8 (Pink) as an Ally
    Player - Make Player 5 (Yellow) treat Player 9 (Gray) as an Ally
    Player - Make Player 5 (Yellow) treat Player 10 (Light Blue) as an Ally
    Player - Make Player 5 (Yellow) treat Player 11 (Dark Green) as an Enemy
    Player - Make Player 5 (Yellow) treat Player 12 (Brown) as an Ally
    Player - Make Player 6 (Orange) treat Player 7 (Green) as an Ally
    Player - Make Player 6 (Orange) treat Player 8 (Pink) as an Ally
    Player - Make Player 6 (Orange) treat Player 9 (Gray) as an Ally
    Player - Make Player 6 (Orange) treat Player 10 (Light Blue) as an Ally
    Player - Make Player 6 (Orange) treat Player 11 (Dark Green) as an Ally
    Player - Make Player 6 (Orange) treat Player 12 (Brown) as an Enemy
    Player - Make Player 7 (Green) treat Player 2 (Blue) as an Ally
    Player - Make Player 7 (Green) treat Player 3 (Teal) as an Ally
    Player - Make Player 7 (Green) treat Player 4 (Purple) as an Ally
    Player - Make Player 7 (Green) treat Player 5 (Yellow) as an Ally
    Player - Make Player 7 (Green) treat Player 6 (Orange) as an Ally
    Player - Make Player 8 (Pink) treat Player 1 (Red) as an Ally
    Player - Make Player 8 (Pink) treat Player 3 (Teal) as an Ally
    Player - Make Player 8 (Pink) treat Player 4 (Purple) as an Ally
    Player - Make Player 8 (Pink) treat Player 5 (Yellow) as an Ally
    Player - Make Player 8 (Pink) treat Player 6 (Orange) as an Ally
    Player - Make Player 9 (Gray) treat Player 1 (Red) as an Ally
    Player - Make Player 9 (Gray) treat Player 2 (Blue) as an Ally
    Player - Make Player 9 (Gray) treat Player 4 (Purple) as an Ally
    Player - Make Player 9 (Gray) treat Player 5 (Yellow) as an Ally
    Player - Make Player 9 (Gray) treat Player 6 (Orange) as an Ally
    Player - Make Player 10 (Light Blue) treat Player 1 (Red) as an Ally
    Player - Make Player 10 (Light Blue) treat Player 2 (Blue) as an Ally
    Player - Make Player 10 (Light Blue) treat Player 3 (Teal) as an Ally
    Player - Make Player 10 (Light Blue) treat Player 5 (Yellow) as an Ally
    Player - Make Player 10 (Light Blue) treat Player 6 (Orange) as an Ally
    Player - Make Player 11 (Dark Green) treat Player 1 (Red) as an Ally
    Player - Make Player 11 (Dark Green) treat Player 2 (Blue) as an Ally
    Player - Make Player 11 (Dark Green) treat Player 3 (Teal) as an Ally
    Player - Make Player 11 (Dark Green) treat Player 4 (Purple) as an Ally
    Player - Make Player 11 (Dark Green) treat Player 6 (Orange) as an Ally
    Player - Make Player 12 (Brown) treat Player 1 (Red) as an Ally
    Player - Make Player 12 (Brown) treat Player 2 (Blue) as an Ally
    Player - Make Player 12 (Brown) treat Player 3 (Teal) as an Ally
    Player - Make Player 12 (Brown) treat Player 4 (Purple) as an Ally
    Player - Make Player 12 (Brown) treat Player 5 (Yellow) as an Ally
    Player - Make Player 13 (Maroon) treat Player 1 (Red) as an Enemy
    Player - Make Player 13 (Maroon) treat Player 2 (Blue) as an Enemy
    Player - Make Player 13 (Maroon) treat Player 3 (Teal) as an Enemy
    Player - Make Player 13 (Maroon) treat Player 4 (Purple) as an Enemy
    Player - Make Player 13 (Maroon) treat Player 5 (Yellow) as an Enemy
    Player - Make Player 13 (Maroon) treat Player 6 (Orange) as an Enemy
    Player - Make Player 1 (Red) treat Player 13 (Maroon) as an Enemy
    Player - Make Player 2 (Blue) treat Player 13 (Maroon) as an Enemy
    Player - Make Player 3 (Teal) treat Player 13 (Maroon) as an Enemy
    Player - Make Player 4 (Purple) treat Player 13 (Maroon) as an Enemy
    Player - Make Player 5 (Yellow) treat Player 13 (Maroon) as an Enemy
    Player - Make Player 6 (Orange) treat Player 13 (Maroon) as an Enemy
    Unit - Order Ship 0036 <gen> to Move To.(Center of Ship6 <gen>)
    For each (Integer A) from 1 to 6, do (Actions)
      Loop - Actions
        Set VariableSet Income[(Integer A)] = 1
    For each (Integer B) from 1 to 6, do (Actions)
      Loop - Actions
        Set VariableSet TempBlockPoint[(Integer B)] = (Center of Ability_Region <gen>)
        Set VariableSet TempBlockPoint2[(Integer B)] = (Center of MapVision <gen>)
    -------- Gold colour --------
    Set VariableSet cc_players[0] = |cffffcc00
    -------- Player colours. --------
    Set VariableSet cc_players[1] = |c00ff0303
    Set VariableSet cc_players[2] = |c000042ff
    Set VariableSet cc_players[3] = |c001ce6b9
    Set VariableSet cc_players[4] = |c007027c3
    Set VariableSet cc_players[5] = |c00fffc01
    Set VariableSet cc_players[6] = |c00feba0e
    Set VariableSet cc_endtag = |r
    Quest - Create a Required quest titled Gameplay with the description Objective:Drop your selected egg at a location where you can use the terrain as a part of your maze.Each egg has some advantages during the game.Waves are spawning from one of 8 caves chosen at random at each wave.You can research upgrades to help you survive the 35 waves or upgrade creeps sent to your opponents(PvP mode)., using icon path ReplaceableTextures\CommandButtons\BTNSelectHeroOn.blp
    Quest - Create a Optional quest titled Credits with the description Thanks to testers:BowenLian, TDSrock, CH3-CH2-OHImported models and icons:Nature egg, Ice egg, Fire egg, Earth egg, Wind egg and Water egg are created by VortigonShadow egg created by alfredx_sotnGold egg created by Blizzard EntertainmentDemon Tower created by HappyTaurenAmethyst Tower created by Pyramidhe@dDragonmaw Rider created by SelleniskoShadow Elemental Tower created by icewolf055Water strike icon created by Golden-DrakeGust of Wind icon created by Sin'dorei300Scratching icon created by KimboGolden Shell icon created by DarkfangGUI-Friendly Damage Detection v1.2.1 by WeepIgnite breath icon created by 4eNNightmareSummon Wolf icon created by KimboGoblin Hovercraft created by FreddykNecromancer created by Sin'dorei300Necromancer icon created by D.eeLightning Totem icon created by Raging EntBerserker Tower created by SkipperBerserker Tower icon created by NFWarBTNNaturesWrath created by -Berz-Ancient Warrior created by DarkholmeMo'arg Overlord by FerSZ, MurlocologistEnhanced egg upgrade by Darky29Witch Doctor created by ironmaidenFirelord created by TarrasqueFirelord icon created by kolaVoidwalker effect created by Mythic, using icon path ReplaceableTextures\WorldEditUI\Editor-MultipleUnits.blp
    Unit - Set Rally-Point for Great Hall 0000 <gen> to Summer Tree Wall 2052 <gen>
    Unit - Set Rally-Point for Great Hall 0018 <gen> to Summer Tree Wall 2056 <gen>
    Unit - Set Rally-Point for Great Hall 0019 <gen> to Summer Tree Wall 2060 <gen>
    Unit - Set Rally-Point for Great Hall 0020 <gen> to Summer Tree Wall 2064 <gen>
    Unit - Set Rally-Point for Great Hall 0021 <gen> to Summer Tree Wall 2068 <gen>
    Unit - Set Rally-Point for Great Hall 0022 <gen> to Summer Tree Wall 2072 <gen>
    Unit - Remove Rally from Great Hall 0000 <gen>
    Unit - Remove Rally from Great Hall 0018 <gen>
    Unit - Remove Rally from Great Hall 0019 <gen>
    Unit - Remove Rally from Great Hall 0020 <gen>
    Unit - Remove Rally from Great Hall 0021 <gen>
    Unit - Remove Rally from Great Hall 0022 <gen>
    Player Group - Pick every player in PlayerGroup and do (Actions)
      Loop - Actions
        Camera - Pan camera for (Picked player) to ((Picked player) start location) over 0 seconds
        Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across Vision <gen>
    Visibility - Disable fog of war
    Visibility - Disable black mask
    AI - Ignore the guard positions of all Player 7 (Green) units
    AI - Ignore the guard positions of all Player 8 (Pink) units
    AI - Ignore the guard positions of all Player 9 (Gray) units
    AI - Ignore the guard positions of all Player 10 (Light Blue) units
    AI - Ignore the guard positions of all Player 11 (Dark Green) units
    AI - Ignore the guard positions of all Player 12 (Brown) units
    Game - Turn the day/night cycle Off
    Game - Set the time of day to 12
    Set VariableSet PlayerNumber = (Number of players in PlayerGroup)
    Player - Turn Gives bounty On for Player 7 (Green)
    Player - Turn Gives bounty On for Player 8 (Pink)
    Player - Turn Gives bounty On for Player 9 (Gray)
    Player - Turn Gives bounty On for Player 10 (Light Blue)
    Player - Turn Gives bounty On for Player 11 (Dark Green)
    Player - Turn Gives bounty On for Player 12 (Brown)
    Player - Change color of Player 7 (Green) to Brown, Changing color of existing units
    Player - Change color of Player 8 (Pink) to Brown, Changing color of existing units
    Player - Change color of Player 9 (Gray) to Brown, Changing color of existing units
    Player - Change color of Player 10 (Light Blue) to Brown, Changing color of existing units
    Player - Change color of Player 11 (Dark Green) to Brown, Changing color of existing units
    Player - Change color of Player 12 (Brown) to Brown, Changing color of existing units
    Set VariableSet RandomNumber2 = (Random integer number between 1 and 6)
    Set VariableSet RandomNumber3 = (Random integer number between 1 and 2)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of players in PlayerGroup) Equal to 1
      Then - Actions
        Trigger - Run Single_Player <gen> (ignoring conditions)
        Player Group - Pick every player in PlayerGroup and do (Actions)
          Loop - Actions
            Player - Make Life regen Unavailable for training/construction by (Picked player)
            Player - Make Devotion Aura Unavailable for training/construction by (Picked player)
            Player - Make Unholy Unavailable for training/construction by (Picked player)
            Player - Make Evasion Unavailable for training/construction by (Picked player)
            Player - Make Pit Lord Unavailable for training/construction by (Picked player)
            Player - Set the current research level of R005 (techcode) to 20 for (Picked player)
            Unit Group - Pick every unit in (Units of type War Mill) and do (Remove (Picked unit) from the game)
      Else - Actions
        Wait 0.20 seconds
        Dialog - Clear ChooseGameplay
        Dialog - Change the title of ChooseGameplay to Vote for game mode:
        Dialog - Create a dialog button for ChooseGameplay labelled PvP
        Set VariableSet ButtonNormalGameplay = (Last created dialog Button)
        Dialog - Create a dialog button for ChooseGameplay labelled Last Man Standing
        Set VariableSet ButtonSurvivalGameplay = (Last created dialog Button)
        Player Group - Pick every player in PlayerGroup and do (Actions)
          Loop - Actions
            Dialog - Show ChooseGameplay for (Picked player)
        Countdown Timer - Start VoteTimer as a One-shot timer that will expire in 7.00 seconds
        Countdown Timer - Create a timer window for (Last started timer) with title Voting time:
        Wait 7.00 seconds
        Player Group - Pick every player in PlayerGroup and do (Actions)
          Loop - Actions
            Dialog - Hide ChooseGameplay for (Picked player)
        Countdown Timer - Destroy (Last created timer window)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ModeVotes Greater than or equal to 0
          Then - Actions
            Game - Display to (All players) the text: Most votes for PvP
            Player - Set the current research level of R007 (techcode) to 40 for Player 1 (Red)
            Player - Set the current research level of R007 (techcode) to 40 for Player 2 (Blue)
            Player - Set the current research level of R007 (techcode) to 40 for Player 3 (Teal)
            Player - Set the current research level of R007 (techcode) to 40 for Player 4 (Purple)
            Player - Set the current research level of R007 (techcode) to 40 for Player 5 (Yellow)
            Player - Set the current research level of R007 (techcode) to 40 for Player 6 (Orange)
            Trigger - Turn off Single_Player <gen>
          Else - Actions
            Game - Display to (All players) the text: Most votes for Last Man Standing
            Trigger - Run Single_Player <gen> (ignoring conditions)
            Unit Group - Pick every unit in (Units of type War Mill) and do (Remove (Picked unit) from the game)
            Player Group - Pick every player in PlayerGroup and do (Actions)
              Loop - Actions
                Player - Make Life regen Unavailable for training/construction by (Picked player)
                Player - Make Devotion Aura Unavailable for training/construction by (Picked player)
                Player - Make Unholy Unavailable for training/construction by (Picked player)
                Player - Make Evasion Unavailable for training/construction by (Picked player)
                Player - Make Pit Lord Unavailable for training/construction by (Picked player)
                Player - Set the current research level of R005 (techcode) to 20 for (Picked player)
        Wait 0.10 seconds
        Dialog - Clear ChooseMinigame
        Dialog - Change the title of ChooseMinigame to Minigame enabled:
        Dialog - Create a dialog button for ChooseMinigame labelled Yes
        Set VariableSet ButtonYes = (Last created dialog Button)
        Dialog - Create a dialog button for ChooseMinigame labelled No
        Set VariableSet ButtonNo = (Last created dialog Button)
        Player Group - Pick every player in PlayerGroup and do (Actions)
          Loop - Actions
            Dialog - Show ChooseMinigame for (Picked player)
        Countdown Timer - Start VoteTimer as a One-shot timer that will expire in 5.00 seconds
        Countdown Timer - Create a timer window for (Last started timer) with title Voting time:
        Wait 5.00 seconds
        Player Group - Pick every player in PlayerGroup and do (Actions)
          Loop - Actions
            Dialog - Hide ChooseMinigame for (Picked player)
        Countdown Timer - Destroy (Last created timer window)
        Trigger - Turn off Voting <gen>
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            MinigameVotes Greater than or equal to 0
          Then - Actions
            Game - Display to (All players) the text: |cFF228B22Minigame enabled|r
          Else - Actions
            Game - Display to (All players) the text: |cFFFF0033Minigame disabled|r
        Wait 0.10 seconds
    Cinematic - Fade in over 1.00 seconds using texture Black Mask and color (0%, 0%, 0%) with 0% transparency
    Unit - Order Peon 0032 <gen> to Harvest.Summer Tree Wall 2051 <gen>
    Unit - Order Peon 0031 <gen> to Harvest.Summer Tree Wall 2057 <gen>
    Unit - Order Peon 0030 <gen> to Harvest.Summer Tree Wall 2061 <gen>
    Unit - Order Peon 0029 <gen> to Harvest.Summer Tree Wall 2065 <gen>
    Unit - Order Peon 0028 <gen> to Harvest.Summer Tree Wall 2069 <gen>
    Unit - Order Peon 0027 <gen> to Harvest.Summer Tree Wall 2073 <gen>
    Set VariableSet ChampionWave1 = (Random integer number between 5 and 9)
    Set VariableSet ChampionWave2 = (Random integer number between 11 and 17)
    Set VariableSet ChampionWave3 = (Random integer number between 18 and 23)
    Set VariableSet ChampionWave4 = (Random integer number between 24 and 29)
    Set VariableSet ChampionWave5 = (Random integer number between 30 and 35)
    Wait 0.20 seconds
    Dialog - Clear ChooseEgg
    Dialog - Change the title of ChooseEgg to Choose your dragon egg:
    Dialog - Create a dialog button for ChooseEgg labelled |cFF228B22Nature Egg - Regeneration|r
    Set VariableSet ButtonNatureEgg = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseEgg labelled |cFFFF0033Fire Egg - Increased damage|r
    Set VariableSet ButtonFireEgg = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseEgg labelled |cFF32CD32Earth Egg - Increased HP|r
    Set VariableSet ButtonEarthEgg = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseEgg labelled |cFF0033FFWater Egg - Decrease armor|r
    Set VariableSet ButtonWaterEgg = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseEgg labelled |cFFffd700Gold Egg - Golden Shell|r
    Set VariableSet ButtonGoldEgg = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseEgg labelled |cFFFFFAF0Ice Egg - Slow aura|r
    Set VariableSet ButtonIceEgg = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseEgg labelled |cFFa6a6a6Wind Egg - Resource reduction|r
    Set VariableSet ButtonWindEgg = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseEgg labelled |cFFffcd32Lightning Egg - Increased attack speed to nearby tower|r
    Set VariableSet ButtonLightningEgg = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseEgg labelled |cFF7027c3Shadow Egg - Explosion|r
    Set VariableSet ButtonShadowEgg = (Last created dialog Button)
    Player Group - Pick every player in PlayerGroup and do (Actions)
      Loop - Actions
        Dialog - Show ChooseEgg for (Picked player)
    Game - Display to (All players) the text: |c00ff8040Wave 1 spawns in 80 seconds.|r
    Countdown Timer - Start Spawn_Timer as a One-shot timer that will expire in 80.00 seconds
    Countdown Timer - Create a timer window for (Last started timer) with title (Wave + (1 + in:))
    Set VariableSet LastValidIndex = 57
    For each (Integer A) from 1 to LastValidIndex, do (Actions)
      Loop - Actions
        Set VariableSet NumberArray[(Integer A)] = (Integer A)
    Trigger - Run Funny_String <gen> (ignoring conditions)
    Wait 5.80 seconds
    Animation - Play Troll 0043 <gen>'s channel (animationname) animation
    Trigger - Turn on Value2 <gen>
    Game - Display to (All players) the text: Drop your egg at a proper location with your builder by clicking on the item "Drop egg"
    Trigger - Turn on Anti_block_system <gen>
    Wait 74.20 seconds
    Trigger - Run Start_wave <gen> (ignoring conditions)
Single Player
  Events
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Level_Integer Equal to 11
      Then - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            Or - Any (Conditions) are true
              Conditions
                RandomNumber2 Equal to 1
                RandomNumber2 Equal to 2
          Then - Actions
            Set VariableSet AbilityHowlAura[1] = 1
            Set VariableSet AbilityHowlAura[2] = 1
            Set VariableSet AbilityHowlAura[3] = 1
            Set VariableSet AbilityHowlAura[4] = 1
            Set VariableSet AbilityHowlAura[5] = 1
            Set VariableSet AbilityHowlAura[6] = 1
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            Or - Any (Conditions) are true
              Conditions
                RandomNumber2 Equal to 3
                RandomNumber2 Equal to 4
          Then - Actions
            Set VariableSet AbilityArmor[1] = 1
            Set VariableSet AbilityArmor[2] = 1
            Set VariableSet AbilityArmor[3] = 1
            Set VariableSet AbilityArmor[4] = 1
            Set VariableSet AbilityArmor[5] = 1
            Set VariableSet AbilityArmor[6] = 1
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            Or - Any (Conditions) are true
              Conditions
                RandomNumber2 Equal to 5
                RandomNumber2 Equal to 6
          Then - Actions
            Set VariableSet AbilityRegen[1] = 1
            Set VariableSet AbilityRegen[2] = 1
            Set VariableSet AbilityRegen[3] = 1
            Set VariableSet AbilityRegen[4] = 1
            Set VariableSet AbilityRegen[5] = 1
            Set VariableSet AbilityRegen[6] = 1
          Else - Actions
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Level_Integer Equal to 14
      Then - Actions
        Set VariableSet ReinforcementRed = (ReinforcementRed + 1)
        Set VariableSet ReinforcementBlue = (ReinforcementBlue + 1)
        Set VariableSet ReinforcementTeal = (ReinforcementTeal + 1)
        Set VariableSet ReinforcementPurple = (ReinforcementPurple + 1)
        Set VariableSet ReinforcementYellow = (ReinforcementYellow + 1)
        Set VariableSet ReinforcementOrange = (ReinforcementOrange + 1)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Level_Integer Equal to 16
      Then - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            Or - Any (Conditions) are true
              Conditions
                RandomNumber2 Equal to 6
                RandomNumber2 Equal to 1
          Then - Actions
            Set VariableSet AbilityArmor[1] = 1
            Set VariableSet AbilityArmor[2] = 1
            Set VariableSet AbilityArmor[3] = 1
            Set VariableSet AbilityArmor[4] = 1
            Set VariableSet AbilityArmor[5] = 1
            Set VariableSet AbilityArmor[6] = 1
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            Or - Any (Conditions) are true
              Conditions
                RandomNumber2 Equal to 2
                RandomNumber2 Equal to 3
          Then - Actions
            Set VariableSet AbilityRegen[1] = 1
            Set VariableSet AbilityRegen[2] = 1
            Set VariableSet AbilityRegen[3] = 1
            Set VariableSet AbilityRegen[4] = 1
            Set VariableSet AbilityRegen[5] = 1
            Set VariableSet AbilityRegen[6] = 1
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            Or - Any (Conditions) are true
              Conditions
                RandomNumber2 Equal to 4
                RandomNumber2 Equal to 5
          Then - Actions
            Set VariableSet AbilityHowlAura[1] = 1
            Set VariableSet AbilityHowlAura[2] = 1
            Set VariableSet AbilityHowlAura[3] = 1
            Set VariableSet AbilityHowlAura[4] = 1
            Set VariableSet AbilityHowlAura[5] = 1
            Set VariableSet AbilityHowlAura[6] = 1
          Else - Actions
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Level_Integer Equal to 19
      Then - Actions
        Set VariableSet ReinforcementRed = (ReinforcementRed + 1)
        Set VariableSet ReinforcementBlue = (ReinforcementBlue + 1)
        Set VariableSet ReinforcementTeal = (ReinforcementTeal + 1)
        Set VariableSet ReinforcementPurple = (ReinforcementPurple + 1)
        Set VariableSet ReinforcementYellow = (ReinforcementYellow + 1)
        Set VariableSet ReinforcementOrange = (ReinforcementOrange + 1)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Level_Integer Equal to 20
      Then - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            Or - Any (Conditions) are true
              Conditions
                RandomNumber2 Equal to 1
                RandomNumber2 Equal to 4
          Then - Actions
            Set VariableSet AbilityRegen[1] = 1
            Set VariableSet AbilityRegen[2] = 1
            Set VariableSet AbilityRegen[3] = 1
            Set VariableSet AbilityRegen[4] = 1
            Set VariableSet AbilityRegen[5] = 1
            Set VariableSet AbilityRegen[6] = 1
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            Or - Any (Conditions) are true
              Conditions
                RandomNumber2 Equal to 3
                RandomNumber2 Equal to 6
          Then - Actions
            Set VariableSet AbilityHowlAura[1] = 1
            Set VariableSet AbilityHowlAura[2] = 1
            Set VariableSet AbilityHowlAura[3] = 1
            Set VariableSet AbilityHowlAura[4] = 1
            Set VariableSet AbilityHowlAura[5] = 1
            Set VariableSet AbilityHowlAura[6] = 1
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            Or - Any (Conditions) are true
              Conditions
                RandomNumber2 Equal to 2
                RandomNumber2 Equal to 5
          Then - Actions
            Set VariableSet AbilityArmor[1] = 1
            Set VariableSet AbilityArmor[2] = 1
            Set VariableSet AbilityArmor[3] = 1
            Set VariableSet AbilityArmor[4] = 1
            Set VariableSet AbilityArmor[5] = 1
            Set VariableSet AbilityArmor[6] = 1
          Else - Actions
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Level_Integer Equal to 21
      Then - Actions
        Set VariableSet ReinforcementRed = (ReinforcementRed + 1)
        Set VariableSet ReinforcementBlue = (ReinforcementBlue + 1)
        Set VariableSet ReinforcementTeal = (ReinforcementTeal + 1)
        Set VariableSet ReinforcementPurple = (ReinforcementPurple + 1)
        Set VariableSet ReinforcementYellow = (ReinforcementYellow + 1)
        Set VariableSet ReinforcementOrange = (ReinforcementOrange + 1)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Level_Integer Equal to 22
      Then - Actions
        Set VariableSet ReinforcementRed = (ReinforcementRed + 1)
        Set VariableSet ReinforcementBlue = (ReinforcementBlue + 1)
        Set VariableSet ReinforcementTeal = (ReinforcementTeal + 1)
        Set VariableSet ReinforcementPurple = (ReinforcementPurple + 1)
        Set VariableSet ReinforcementYellow = (ReinforcementYellow + 1)
        Set VariableSet ReinforcementOrange = (ReinforcementOrange + 1)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Level_Integer Equal to 23
      Then - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            RandomNumber3 Equal to 1
          Then - Actions
            Set VariableSet AbilityEvasion[1] = 1
            Set VariableSet AbilityEvasion[2] = 1
            Set VariableSet AbilityEvasion[3] = 1
            Set VariableSet AbilityEvasion[4] = 1
            Set VariableSet AbilityEvasion[5] = 1
            Set VariableSet AbilityEvasion[6] = 1
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            RandomNumber3 Equal to 2
          Then - Actions
            Set VariableSet AbilityUnholy[1] = 1
            Set VariableSet AbilityUnholy[2] = 1
            Set VariableSet AbilityUnholy[3] = 1
            Set VariableSet AbilityUnholy[4] = 1
            Set VariableSet AbilityUnholy[5] = 1
            Set VariableSet AbilityUnholy[6] = 1
          Else - Actions
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Level_Integer Equal to 24
      Then - Actions
        Set VariableSet ReinforcementRed = (ReinforcementRed + 1)
        Set VariableSet ReinforcementBlue = (ReinforcementBlue + 1)
        Set VariableSet ReinforcementTeal = (ReinforcementTeal + 1)
        Set VariableSet ReinforcementPurple = (ReinforcementPurple + 1)
        Set VariableSet ReinforcementYellow = (ReinforcementYellow + 1)
        Set VariableSet ReinforcementOrange = (ReinforcementOrange + 1)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Level_Integer Equal to 25
      Then - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            RandomNumber3 Equal to 1
          Then - Actions
            Set VariableSet AbilityUnholy[1] = 1
            Set VariableSet AbilityUnholy[2] = 1
            Set VariableSet AbilityUnholy[3] = 1
            Set VariableSet AbilityUnholy[4] = 1
            Set VariableSet AbilityUnholy[5] = 1
            Set VariableSet AbilityUnholy[6] = 1
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            RandomNumber3 Equal to 2
          Then - Actions
            Set VariableSet AbilityEvasion[1] = 1
            Set VariableSet AbilityEvasion[2] = 1
            Set VariableSet AbilityEvasion[3] = 1
            Set VariableSet AbilityEvasion[4] = 1
            Set VariableSet AbilityEvasion[5] = 1
            Set VariableSet AbilityEvasion[6] = 1
          Else - Actions
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        And - All (Conditions) are true
          Conditions
            Level_Integer Greater than 25
            Level_Integer Less than 32
      Then - Actions
        Set VariableSet ReinforcementRed = (ReinforcementRed + 1)
        Set VariableSet ReinforcementBlue = (ReinforcementBlue + 1)
        Set VariableSet ReinforcementTeal = (ReinforcementTeal + 1)
        Set VariableSet ReinforcementPurple = (ReinforcementPurple + 1)
        Set VariableSet ReinforcementYellow = (ReinforcementYellow + 1)
        Set VariableSet ReinforcementOrange = (ReinforcementOrange + 1)
      Else - Actions
Voting
  Events
    Dialog - A dialog button is clicked for ChooseGameplay
    Dialog - A dialog button is clicked for ChooseMinigame
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Clicked dialog button) Equal to ButtonYes
      Then - Actions
        Set VariableSet MinigameVotes = (MinigameVotes + 1)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Clicked dialog button) Equal to ButtonNo
      Then - Actions
        Set VariableSet MinigameVotes = (MinigameVotes - 1)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Clicked dialog button) Equal to ButtonNormalGameplay
      Then - Actions
        Set VariableSet ModeVotes = (ModeVotes + 1)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Clicked dialog button) Equal to ButtonSurvivalGameplay
      Then - Actions
        Set VariableSet ModeVotes = (ModeVotes - 1)
      Else - Actions
Fire Egg
  Events
    Dialog - A dialog button is clicked for ChooseEgg
  Conditions
    (Clicked dialog button) Equal to ButtonFireEgg
  Actions
    Set VariableSet EggSelect[(Player number of (Triggering player))] = 1
    Dialog - Clear ChooseBonus[(Player number of (Triggering player))]
    Dialog - Change the title of ChooseBonus[(Player number of (Triggering player))] to Choose your starting bonus
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF228B2295 extra starting lumber|r
    Set VariableSet ButtonBonusLumber[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFFffd70015 extra starting gold|r
    Set VariableSet ButtonBonusGold[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF32CD32Food lvl 2|r
    Set VariableSet ButtonBonusFood[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF0033FFManashield and Range Tech lvl 1|r
    Set VariableSet ButtonBonusManashield[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Show ChooseBonus[(Player number of (Triggering player))] for (Triggering player)
Earth Egg
  Events
    Dialog - A dialog button is clicked for ChooseEgg
  Conditions
    (Clicked dialog button) Equal to ButtonEarthEgg
  Actions
    Set VariableSet EggSelect[(Player number of (Triggering player))] = 2
    Dialog - Clear ChooseBonus[(Player number of (Triggering player))]
    Dialog - Change the title of ChooseBonus[(Player number of (Triggering player))] to Choose your starting bonus
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF228B2295 extra starting lumber|r
    Set VariableSet ButtonBonusLumber[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFFffd70015 extra starting gold|r
    Set VariableSet ButtonBonusGold[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF32CD32Food lvl 2|r
    Set VariableSet ButtonBonusFood[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF0033FFManashield and Range Tech lvl 1|r
    Set VariableSet ButtonBonusManashield[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Show ChooseBonus[(Player number of (Triggering player))] for (Triggering player)
Wind Egg
  Events
    Dialog - A dialog button is clicked for ChooseEgg
  Conditions
    (Clicked dialog button) Equal to ButtonWindEgg
  Actions
    Set VariableSet EggSelect[(Player number of (Triggering player))] = 3
    Dialog - Clear ChooseBonus[(Player number of (Triggering player))]
    Dialog - Change the title of ChooseBonus[(Player number of (Triggering player))] to Choose your starting bonus
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF228B2295 extra starting lumber|r
    Set VariableSet ButtonBonusLumber[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFFffd70015 extra starting gold|r
    Set VariableSet ButtonBonusGold[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF32CD32Food lvl 2|r
    Set VariableSet ButtonBonusFood[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF0033FFManashield and Range Tech lvl 1|r
    Set VariableSet ButtonBonusManashield[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Show ChooseBonus[(Player number of (Triggering player))] for (Triggering player)
Water Egg
  Events
    Dialog - A dialog button is clicked for ChooseEgg
  Conditions
    (Clicked dialog button) Equal to ButtonWaterEgg
  Actions
    Set VariableSet EggSelect[(Player number of (Triggering player))] = 4
    Dialog - Clear ChooseBonus[(Player number of (Triggering player))]
    Dialog - Change the title of ChooseBonus[(Player number of (Triggering player))] to Choose your starting bonus
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF228B2295 extra starting lumber|r
    Set VariableSet ButtonBonusLumber[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFFffd70015 extra starting gold|r
    Set VariableSet ButtonBonusGold[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF32CD32Food lvl 2|r
    Set VariableSet ButtonBonusFood[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF0033FFManashield and Range Tech lvl 1|r
    Set VariableSet ButtonBonusManashield[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Show ChooseBonus[(Player number of (Triggering player))] for (Triggering player)
Ice Egg
  Events
    Dialog - A dialog button is clicked for ChooseEgg
  Conditions
    (Clicked dialog button) Equal to ButtonIceEgg
  Actions
    Set VariableSet EggSelect[(Player number of (Triggering player))] = 5
    Dialog - Clear ChooseBonus[(Player number of (Triggering player))]
    Dialog - Change the title of ChooseBonus[(Player number of (Triggering player))] to Choose your starting bonus
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF228B2295 extra starting lumber|r
    Set VariableSet ButtonBonusLumber[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFFffd70015 extra starting gold|r
    Set VariableSet ButtonBonusGold[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF32CD32Food lvl 2|r
    Set VariableSet ButtonBonusFood[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF0033FFManashield and Range Tech lvl 1|r
    Set VariableSet ButtonBonusManashield[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Show ChooseBonus[(Player number of (Triggering player))] for (Triggering player)
Nature Egg
  Events
    Dialog - A dialog button is clicked for ChooseEgg
  Conditions
    (Clicked dialog button) Equal to ButtonNatureEgg
  Actions
    Set VariableSet EggSelect[(Player number of (Triggering player))] = 6
    Dialog - Clear ChooseBonus[(Player number of (Triggering player))]
    Dialog - Change the title of ChooseBonus[(Player number of (Triggering player))] to Choose your starting bonus
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF228B2295 extra starting lumber|r
    Set VariableSet ButtonBonusLumber[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFFffd70015 extra starting gold|r
    Set VariableSet ButtonBonusGold[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF32CD32Food lvl 2|r
    Set VariableSet ButtonBonusFood[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF0033FFManashield and Range Tech lvl 1|r
    Set VariableSet ButtonBonusManashield[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Show ChooseBonus[(Player number of (Triggering player))] for (Triggering player)
Lightning Egg
  Events
    Dialog - A dialog button is clicked for ChooseEgg
  Conditions
    (Clicked dialog button) Equal to ButtonLightningEgg
  Actions
    Set VariableSet EggSelect[(Player number of (Triggering player))] = 7
    Dialog - Clear ChooseBonus[(Player number of (Triggering player))]
    Dialog - Change the title of ChooseBonus[(Player number of (Triggering player))] to Choose your starting bonus
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF228B2295 extra starting lumber|r
    Set VariableSet ButtonBonusLumber[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFFffd70015 extra starting gold|r
    Set VariableSet ButtonBonusGold[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF32CD32Food lvl 2|r
    Set VariableSet ButtonBonusFood[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF0033FFManashield and Range Tech lvl 1|r
    Set VariableSet ButtonBonusManashield[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Show ChooseBonus[(Player number of (Triggering player))] for (Triggering player)
Shadow Egg
  Events
    Dialog - A dialog button is clicked for ChooseEgg
  Conditions
    (Clicked dialog button) Equal to ButtonShadowEgg
  Actions
    Set VariableSet EggSelect[(Player number of (Triggering player))] = 8
    Dialog - Clear ChooseBonus[(Player number of (Triggering player))]
    Dialog - Change the title of ChooseBonus[(Player number of (Triggering player))] to Choose your starting bonus
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF228B2295 extra starting lumber|r
    Set VariableSet ButtonBonusLumber[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFFffd70015 extra starting gold|r
    Set VariableSet ButtonBonusGold[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF32CD32Food lvl 2|r
    Set VariableSet ButtonBonusFood[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF0033FFManashield and Range Tech lvl 1|r
    Set VariableSet ButtonBonusManashield[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Show ChooseBonus[(Player number of (Triggering player))] for (Triggering player)
Gold Egg
  Events
    Dialog - A dialog button is clicked for ChooseEgg
  Conditions
    (Clicked dialog button) Equal to ButtonGoldEgg
  Actions
    Set VariableSet EggSelect[(Player number of (Triggering player))] = 9
    Dialog - Clear ChooseBonus[(Player number of (Triggering player))]
    Dialog - Change the title of ChooseBonus[(Player number of (Triggering player))] to Choose your starting bonus
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF228B2295 extra starting lumber|r
    Set VariableSet ButtonBonusLumber[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFFffd70015 extra starting gold|r
    Set VariableSet ButtonBonusGold[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF32CD32Food lvl 2|r
    Set VariableSet ButtonBonusFood[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Create a dialog button for ChooseBonus[(Player number of (Triggering player))] labelled |cFF0033FFManashield and Range Tech lvl 1|r
    Set VariableSet ButtonBonusManashield[(Player number of (Triggering player))] = (Last created dialog Button)
    Dialog - Show ChooseBonus[(Player number of (Triggering player))] for (Triggering player)
Start bonus
  Events
    Dialog - A dialog button is clicked for ChooseBonus[1]
    Dialog - A dialog button is clicked for ChooseBonus[2]
    Dialog - A dialog button is clicked for ChooseBonus[3]
    Dialog - A dialog button is clicked for ChooseBonus[4]
    Dialog - A dialog button is clicked for ChooseBonus[5]
    Dialog - A dialog button is clicked for ChooseBonus[6]
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Clicked dialog button) Equal to ButtonBonusGold[1]
            (Clicked dialog button) Equal to ButtonBonusGold[2]
            (Clicked dialog button) Equal to ButtonBonusGold[3]
            (Clicked dialog button) Equal to ButtonBonusGold[4]
            (Clicked dialog button) Equal to ButtonBonusGold[5]
            (Clicked dialog button) Equal to ButtonBonusGold[6]
      Then - Actions
        Player - Add 15 to (Triggering player).Current gold
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Clicked dialog button) Equal to ButtonBonusFood[1]
            (Clicked dialog button) Equal to ButtonBonusFood[2]
            (Clicked dialog button) Equal to ButtonBonusFood[3]
            (Clicked dialog button) Equal to ButtonBonusFood[4]
            (Clicked dialog button) Equal to ButtonBonusFood[5]
            (Clicked dialog button) Equal to ButtonBonusFood[6]
      Then - Actions
        Player - Set the current research level of R000 (techcode) to 2 for (Triggering player)
        Unit - Create 1.Food for (Triggering player) at (Center of SecretFood1 <gen>) facing Default building facing degrees
        Unit - Hide (Last created unit)
        Unit - Create 1.Food for (Triggering player) at (Center of SecretFood2 <gen>) facing Default building facing degrees
        Unit - Hide (Last created unit)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Clicked dialog button) Equal to ButtonBonusLumber[1]
            (Clicked dialog button) Equal to ButtonBonusLumber[2]
            (Clicked dialog button) Equal to ButtonBonusLumber[3]
            (Clicked dialog button) Equal to ButtonBonusLumber[4]
            (Clicked dialog button) Equal to ButtonBonusLumber[5]
            (Clicked dialog button) Equal to ButtonBonusLumber[6]
      Then - Actions
        Player - Add 95 to (Triggering player).Current lumber
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Clicked dialog button) Equal to ButtonBonusManashield[1]
            (Clicked dialog button) Equal to ButtonBonusManashield[2]
            (Clicked dialog button) Equal to ButtonBonusManashield[3]
            (Clicked dialog button) Equal to ButtonBonusManashield[4]
            (Clicked dialog button) Equal to ButtonBonusManashield[5]
            (Clicked dialog button) Equal to ButtonBonusManashield[6]
      Then - Actions
        Player - Add 150 to (Triggering player).Current lumber
        If ((Triggering player) Equal to Player 1 (Red)) then do (Order Great Hall 0000 <gen> to research R006 (techcode)) else do (Do nothing)
        If ((Triggering player) Equal to Player 2 (Blue)) then do (Order Great Hall 0018 <gen> to research R006 (techcode)) else do (Do nothing)
        If ((Triggering player) Equal to Player 3 (Teal)) then do (Order Great Hall 0019 <gen> to research R006 (techcode)) else do (Do nothing)
        If ((Triggering player) Equal to Player 4 (Purple)) then do (Order Great Hall 0020 <gen> to research R006 (techcode)) else do (Do nothing)
        If ((Triggering player) Equal to Player 5 (Yellow)) then do (Order Great Hall 0021 <gen> to research R006 (techcode)) else do (Do nothing)
        If ((Triggering player) Equal to Player 6 (Orange)) then do (Order Great Hall 0022 <gen> to research R006 (techcode)) else do (Do nothing)
        Player - Set the current research level of R001 (techcode) to 1 for (Triggering player)
      Else - Actions
Player leave
  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
  Conditions
  Actions
    For each (Integer A) from 1 to 6, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Triggering player) Equal to (Player((Integer A)))
          Then - Actions
            Set VariableSet KillWarlockUnit = (Units owned by (Triggering player) of type Warlock (Minigame))
            Player Group - Remove (Player((Integer A))) from PlayerGrougForMinigame.
            Unit Group - Pick every unit in KillWarlockUnit and do (Actions)
              Loop - Actions
                Unit - Kill (Picked unit)
            Custom script: call DestroyGroup (udg_KillWarlockUnit)
            Set VariableSet EggHP[(Integer A)] = 0
            Multiboard - Set the text for MultiboardVar item in column 3, row Multiboard_Spots[(Player number of (Triggering player))] to (|c02FF0101 + ((String(EggHP[(Player number of (Triggering player))])) + |r))
            Multiboard - Set the text for MultiboardVar item in column 4, row Multiboard_Spots[(Player number of (Triggering player))] to Dead
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Unit-type of Egg[(Player number of (Triggering player))]) Equal to Shadow Egg
              Then - Actions
                Unit - Remove Darkness (Dark egg) from Egg[(Player number of (Triggering player))]
              Else - Actions
            Unit - Kill Egg[(Integer A)]
          Else - Actions
    Trigger - Run Peon_movement_speed <gen> (ignoring conditions)
Lose
  Events
    Unit - A unit owned by Player 1 (Red).Dies
    Unit - A unit owned by Player 2 (Blue).Dies
    Unit - A unit owned by Player 3 (Teal).Dies
    Unit - A unit owned by Player 4 (Purple).Dies
    Unit - A unit owned by Player 5 (Yellow).Dies
    Unit - A unit owned by Player 6 (Orange).Dies
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Unit-type of (Dying unit)) Equal to Fire egg
            (Unit-type of (Dying unit)) Equal to Earth egg
            (Unit-type of (Dying unit)) Equal to Ice egg
            (Unit-type of (Dying unit)) Equal to Nature egg
            (Unit-type of (Dying unit)) Equal to Water egg
            (Unit-type of (Dying unit)) Equal to Wind egg
            (Unit-type of (Dying unit)) Equal to Lightning egg
            (Unit-type of (Dying unit)) Equal to Shadow Egg
            (Unit-type of (Dying unit)) Equal to Gold egg
      Then - Actions
        Player Group - Remove (Owner of (Dying unit)) from PlayerGrougForMinigame.
        Trigger - Run Peon_movement_speed <gen> (ignoring conditions)
        For each (Integer A) from 1 to 6, do (Actions)
          Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Owner of (Dying unit)) Equal to (Player((Integer A)))
              Then - Actions
                Set VariableSet EggHP[(Integer A)] = 0
                Multiboard - Set the text for MultiboardVar item in column 3, row Multiboard_Spots[(Player number of (Owner of (Dying unit)))] to (|c02FF0101 + ((String(EggHP[(Player number of (Owner of (Dying unit)))])) + |r))
                Multiboard - Set the text for MultiboardVar item in column 4, row Multiboard_Spots[(Player number of (Owner of (Dying unit)))] to Dead
                Player Group - Remove (Player((Integer A))) from PlayerGrougForMinigame.
              Else - Actions
                Do nothing
        Game - Display to (All players) the text: ((Name of (Owner of (Dying unit))) + 's egg is dead and is defeated)
        Player - Set (Owner of (Dying unit)).Current gold to 0
        Player - Set (Owner of (Dying unit)).Current lumber to 0
        Set VariableSet TempGroup11 = (Units owned by (Owner of (Dying unit)).)
        Unit Group - Pick every unit in TempGroup11 and do (Actions)
          Loop - Actions
            Unit - Remove (Picked unit) from the game
        Custom script: call DestroyGroup (udg_TempGroup11)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Owner of (Dying unit)) Equal to Player 1 (Red)
          Then - Actions
            Set VariableSet TempGroup11 = (Units owned by Player 7 (Green).)
            Unit Group - Pick every unit in TempGroup11 and do (Actions)
              Loop - Actions
                Unit - Remove (Picked unit) from the game
            Custom script: call DestroyGroup (udg_TempGroup11)
            Trigger - Run LoseRed <gen> (ignoring conditions)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Owner of (Dying unit)) Equal to Player 2 (Blue)
          Then - Actions
            Set VariableSet TempGroup11 = (Units owned by Player 8 (Pink).)
            Unit Group - Pick every unit in TempGroup11 and do (Actions)
              Loop - Actions
                Unit - Remove (Picked unit) from the game
            Custom script: call DestroyGroup (udg_TempGroup11)
            Trigger - Run LoseBlue <gen> (ignoring conditions)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Owner of (Dying unit)) Equal to Player 3 (Teal)
          Then - Actions
            Set VariableSet TempGroup11 = (Units owned by Player 9 (Gray).)
            Unit Group - Pick every unit in TempGroup11 and do (Actions)
              Loop - Actions
                Unit - Remove (Picked unit) from the game
            Custom script: call DestroyGroup (udg_TempGroup11)
            Trigger - Run LoseTeal <gen> (ignoring conditions)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Owner of (Dying unit)) Equal to Player 4 (Purple)
          Then - Actions
            Set VariableSet TempGroup11 = (Units owned by Player 10 (Light Blue).)
            Unit Group - Pick every unit in TempGroup11 and do (Actions)
              Loop - Actions
                Unit - Remove (Picked unit) from the game
            Custom script: call DestroyGroup (udg_TempGroup11)
            Trigger - Run LosePurple <gen> (ignoring conditions)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Owner of (Dying unit)) Equal to Player 5 (Yellow)
          Then - Actions
            Set VariableSet TempGroup11 = (Units owned by Player 11 (Dark Green).)
            Unit Group - Pick every unit in TempGroup11 and do (Actions)
              Loop - Actions
                Unit - Remove (Picked unit) from the game
            Custom script: call DestroyGroup (udg_TempGroup11)
            Trigger - Run LoseYellow <gen> (ignoring conditions)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Owner of (Dying unit)) Equal to Player 6 (Orange)
          Then - Actions
            Set VariableSet TempGroup11 = (Units owned by Player 12 (Brown).)
            Unit Group - Pick every unit in TempGroup11 and do (Actions)
              Loop - Actions
                Unit - Remove (Picked unit) from the game
            Custom script: call DestroyGroup (udg_TempGroup11)
            Trigger - Run LoseOrange <gen> (ignoring conditions)
          Else - Actions
      Else - Actions
        Do nothing
LoseRed
  Events
  Conditions
  Actions
    Wait 20.00 seconds
    Set VariableSet TempGroup11 = (Units owned by Player 7 (Green).)
    Unit Group - Pick every unit in TempGroup11 and do (Actions)
      Loop - Actions
        Unit - Remove (Picked unit) from the game
    Custom script: call DestroyGroup (udg_TempGroup11)
LoseBlue
  Events
  Conditions
  Actions
    Wait 20.00 seconds
    Set VariableSet TempGroup11 = (Units owned by Player 8 (Pink).)
    Unit Group - Pick every unit in TempGroup11 and do (Actions)
      Loop - Actions
        Unit - Remove (Picked unit) from the game
    Custom script: call DestroyGroup (udg_TempGroup11)
LoseTeal
  Events
  Conditions
  Actions
    Wait 20.00 seconds
    Set VariableSet TempGroup11 = (Units owned by Player 9 (Gray).)
    Unit Group - Pick every unit in TempGroup11 and do (Actions)
      Loop - Actions
        Unit - Remove (Picked unit) from the game
    Custom script: call DestroyGroup (udg_TempGroup11)
LosePurple
  Events
  Conditions
  Actions
    Wait 20.00 seconds
    Set VariableSet TempGroup11 = (Units owned by Player 10 (Light Blue).)
    Unit Group - Pick every unit in TempGroup11 and do (Actions)
      Loop - Actions
        Unit - Remove (Picked unit) from the game
    Custom script: call DestroyGroup (udg_TempGroup11)
LoseYellow
  Events
  Conditions
  Actions
    Wait 20.00 seconds
    Set VariableSet TempGroup11 = (Units owned by Player 11 (Dark Green).)
    Unit Group - Pick every unit in TempGroup11 and do (Actions)
      Loop - Actions
        Unit - Remove (Picked unit) from the game
    Custom script: call DestroyGroup (udg_TempGroup11)
LoseOrange
  Events
  Conditions
  Actions
    Wait 20.00 seconds
    Set VariableSet TempGroup11 = (Units owned by Player 12 (Brown).)
    Unit Group - Pick every unit in TempGroup11 and do (Actions)
      Loop - Actions
        Unit - Remove (Picked unit) from the game
    Custom script: call DestroyGroup (udg_TempGroup11)
Win
  Events
  Conditions
  Actions
    For each (Integer A) from 1 to 6, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Egg[(Integer A)] is alive) Equal to True
          Then - Actions
            Game - Victory (Player((Integer A))) (Show dialogs, Show scores)
          Else - Actions
            Game - Defeat (Player((Integer A))) with the message: Defeat! Your egg did not survive
GamerSmurf Kill
  Events
    Player - Player 1 (Red) types a chat message containing kill7 (stringnoformat) as An exact match
    Player - Player 1 (Red) types a chat message containing kill8 (stringnoformat) as An exact match
    Player - Player 1 (Red) types a chat message containing kill9 (stringnoformat) as An exact match
    Player - Player 1 (Red) types a chat message containing kill10 (stringnoformat) as An exact match
    Player - Player 1 (Red) types a chat message containing kill11 (stringnoformat) as An exact match
    Player - Player 1 (Red) types a chat message containing kill12 (stringnoformat) as An exact match
  Conditions
    (Name of Player 1 (Red)) Equal to GamerSmurf
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Matched chat string) Equal to kill7
      Then - Actions
        Set VariableSet TempGroup11 = (Units owned by Player 7 (Green).)
        Unit Group - Pick every unit in TempGroup11 and do (Actions)
          Loop - Actions
            Unit - Kill (Picked unit)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Matched chat string) Equal to kill8
      Then - Actions
        Set VariableSet TempGroup11 = (Units owned by Player 8 (Pink).)
        Unit Group - Pick every unit in TempGroup11 and do (Actions)
          Loop - Actions
            Unit - Kill (Picked unit)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Matched chat string) Equal to kill9
      Then - Actions
        Set VariableSet TempGroup11 = (Units owned by Player 9 (Gray).)
        Unit Group - Pick every unit in TempGroup11 and do (Actions)
          Loop - Actions
            Unit - Kill (Picked unit)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Matched chat string) Equal to kill10
      Then - Actions
        Set VariableSet TempGroup11 = (Units owned by Player 10 (Light Blue).)
        Unit Group - Pick every unit in TempGroup11 and do (Actions)
          Loop - Actions
            Unit - Kill (Picked unit)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Matched chat string) Equal to kill11
      Then - Actions
        Set VariableSet TempGroup11 = (Units owned by Player 11 (Dark Green).)
        Unit Group - Pick every unit in TempGroup11 and do (Actions)
          Loop - Actions
            Unit - Kill (Picked unit)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Matched chat string) Equal to kill12
      Then - Actions
        Set VariableSet TempGroup11 = (Units owned by Player 12 (Brown).)
        Unit Group - Pick every unit in TempGroup11 and do (Actions)
          Loop - Actions
            Unit - Kill (Picked unit)
      Else - Actions
    Custom script: call DestroyGroup (udg_TempGroup11)
Peon movement speed
  Events
  Conditions
  Actions
    Set VariableSet TempGroup = (Units of type Peon)
    Unit Group - Pick every unit in TempGroup and do (Actions)
      Loop - Actions
        Unit - Set (Picked unit) movement speed to (190.00 - (5.00 x (Real((Number of players in PlayerGrougForMinigame)))))
    Custom script: call DestroyGroup (udg_TempGroup)
    Set VariableSet TempGroup = (Units of type Peon)
    Unit Group - Pick every unit in TempGroup and do (Actions)
      Loop - Actions
        Unit - Set (Picked unit) movement speed to (190.00 - (5.00 x (Real((Number of players in PlayerGrougForMinigame)))))
    Custom script: call DestroyGroup (udg_TempGroup)
Activate Strength skill
  Events
    Unit - A unit Finishes construction
    Unit - A unit Finishes an upgrade
    Unit - A unit enters MapVision <gen>
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Unit-type of (Triggering unit)) Equal to Strength Tower lvl 1
            (Unit-type of (Triggering unit)) Equal to Strength Tower lvl 2
            (Unit-type of (Triggering unit)) Equal to Strength Tower lvl 3
            (Unit-type of (Triggering unit)) Equal to Strength Tower lvl 4
            (Unit-type of (Triggering unit)) Equal to Strength Tower lvl 5
            (Unit-type of (Triggering unit)) Equal to Strength Tower lvl 6
      Then - Actions
        Unit - Order (Triggering unit) to Night Elf Priestess Of The Moon - Activate Searing Arrows.
      Else - Actions
Activate Ignite Breath skill
  Events
    Unit - A unit Finishes construction
    Unit - A unit Finishes an upgrade
    Unit - A unit enters MapVision <gen>
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Unit-type of (Triggering unit)) Equal to Tube Wyrm Tower lvl 1
            (Unit-type of (Triggering unit)) Equal to Tube Wyrm Tower lvl 1 (Water version)
            (Unit-type of (Triggering unit)) Equal to Tube Wyrm Tower lvl 2
            (Unit-type of (Triggering unit)) Equal to Tube Wyrm Tower lvl 2 (Water version)
            (Unit-type of (Triggering unit)) Equal to Tube Wyrm Tower lvl 3
            (Unit-type of (Triggering unit)) Equal to Tube Wyrm Tower lvl 3 (Water version)
            (Unit-type of (Triggering unit)) Equal to Tube Wyrm Tower lvl 4
            (Unit-type of (Triggering unit)) Equal to Tube Wyrm Tower lvl 4 (Water version)
            (Unit-type of (Triggering unit)) Equal to Tube Wyrm Tower lvl 5
            (Unit-type of (Triggering unit)) Equal to Tube Wyrm Tower lvl 5 (Water version)
            (Unit-type of (Triggering unit)) Equal to Tube Wyrm Tower lvl 6
            (Unit-type of (Triggering unit)) Equal to Tube Wyrm Tower lvl 6 (Water version)
            (Unit-type of (Triggering unit)) Equal to Tube Wyrm Tower lvl 7
            (Unit-type of (Triggering unit)) Equal to Tube Wyrm Tower lvl 7 (Water version)
      Then - Actions
        Unit - Order (Triggering unit) to Night Elf Priestess Of The Moon - Activate Searing Arrows.
      Else - Actions
Untitled Trigger 001
  Events
    Destructible - Summer Tree Wall 1758 <gen> dies
  Conditions
  Actions
    Game - Defeat Player 1 (Red) with the message: Defeat!
    Game - Defeat Player 2 (Blue) with the message: Defeat!
    Game - Defeat Player 3 (Teal) with the message: Defeat!
    Game - Defeat Player 4 (Purple) with the message: Defeat!
    Game - Defeat Player 5 (Yellow) with the message: Defeat!
    Game - Defeat Player 6 (Orange) with the message: Defeat!
GDD Variable Creator
  Events
  Conditions
  Actions
    Set VariableSet GDD_Event = 0.00
    Set VariableSet GDD_Damage = 0.00
    Set VariableSet GDD_DamagedUnit = No unit
    Set VariableSet GDD_DamageSource = No unit
    Set VariableSet GDD__TriggerArray[0] = (This trigger)
    Set VariableSet GDD__Integers[0] = 0
    Set VariableSet GDD__UnitArray[0] = No unit
    Set VariableSet GDD__LeftMapGroup = GDD__LeftMapGroup
// GUI-Friendly Damage Detection -- v1.2.1 -- by Weep
//    http:// www.thehelper.net/forums/showthread.php?t=137957
//
//    Requires: only this trigger and its variables.
//
// -- What? --
//    This snippet provides a leak-free, GUI-friendly implementation of an "any unit takes
//    damage" event.  It requires no JASS knowledge to use.
//
//    It uses the Game - Value Of Real Variable event as its method of activating other
//    triggers, and passes the event responses through a few globals.
//
// -- Why? --
//    The traditional GUI method of setting up a trigger than runs when any unit is damaged
//    leaks trigger events.  This snippet is easy to implement and removes the need to do
//    you own GUI damage detection setup.
//
// -- How To Implement --
//    0. Before you copy triggers that use GDD into a new map, you need to copy over GDD
//       with its GDD Variable Creator trigger, or there will be a problem: the variables
//       won't be automatically created correctly.
//
//    1. Be sure "Automatically create unknown variables while pasting trigger data" is
//       enabled in the World Editor general preferences.
//    2. Copy this trigger category ("GDD") and paste it into your map.
//       (Alternately: create the variables listed in the globals block below, create a
//       trigger named "GUI Friendly Damage Detection", and paste in this entire text.)
//    3. Create your damage triggers using Game - Value Of Real Variable as the event,
//       select GDD_Event as the variable, and leave the rest of the settings to the default
//       "becomes Equal to 0.00".
//       The event responses are the following variables:
//          GDD_Damage is the amount of damage, replacing Event Response - Damage Taken.
//          GDD_DamagedUnit is the damaged unit, replacing Event Response - Triggering Unit.
//              Triggering Unit can still be used, if you need to use waits.
//              Read the -- Notes -- section below for more info.
//          GDD_DamageSource is the damaging unit, replacing Event Response - Damage Source.
//
// -- Notes --
//    GDD's event response variables are not wait-safe; you can't use them after a wait in
//    a trigger.  If you need to use waits, Triggering Unit (a.k.a. GetTriggerUnit()) can
//    be used in place of GDD_DamageSource.  There is no usable wait-safe equivalent to
//    Event Damage or Damage Source; you'll need to save the values yourself.
//
//    Don't write any values to the variables used as the event responses, or it will mess
//    up any other triggers using this snippet for their triggering.  Only use their values.
//
//    This uses arrays, so can detect damage for a maximum of 8190 units at a time, and
//    cleans up data at a rate of 33.33 per second, by default.  This should be enough for
//    most maps, but if you want to change the rate, change the value returned in the
//    GDD_RecycleRate function at the top of the code, below.
//
//    By default, GDD will not register units that have Locust at the moment of their
//    entering the game, and will not recognize when they take damage (which can only
//    happen if the Locust ability is later removed from the unit.)  To allow a unit to have
//    Locust yet still cause GDD damage events if Locust is removed, you can either design
//    the unit to not have Locust by default and add it via triggers after creation, or
//    edit the GDD_Filter function at the top of the code, below.
//
// -- Credits --
//    Captain Griffin on wc3c.net for the research and concept of GroupRefresh.
//
//    Credit in your map not needed, but please include this README.
//
// -- Version History --
//    1.2.1: Minor code cleaning.  Added configuration functions.  Updated documentation.
//    1.2.0: Made this snippet work properly with recursive damage.
//    1.1.1: Added a check in order to not index units with the Locust ability (dummy units).
//           If you wish to check for damage taken by a unit that is unselectable, do not
//           give the unit-type Locust in the object editor; instead, add the Locust ability
//           'Aloc' via a trigger after its creation, then remove it.
//    1.1.0: Added a check in case a unit gets moved out of the map and back.
//    1.0.0: First release.


//===================================================================
// Configurables.
function GDD_RecycleRate takes nothing returns real //The rate at which the system checks units to see if they've been removed from the game
    return 0.03
endfunction

function GDD_Filter takes unit u returns boolean //The condition a unit has to pass to have it registered for damage detection
    return GetUnitAbilityLevel(u, 'Aloc') == 0 //By default, the system ignores Locust units, because they normally can't take damage anyway
endfunction

//===================================================================
// This is just for reference.
// If you use JassHelper, you could uncomment this section instead of creating the variables in the trigger editor.

// globals
//  real udg_GDD_Event = 0.
//  real udg_GDD_Damage = 0.
//  unit udg_GDD_DamagedUnit
//  unit udg_GDD_DamageSource
//  trigger array udg_GDD__TriggerArray
//  integer array udg_GDD__Integers
//  unit array udg_GDD__UnitArray
//  group udg_GDD__LeftMapGroup = CreateGroup()
// endglobals

//===================================================================
// System code follows.  Don't touch!
function GDD_Event takes nothing returns boolean
    local unit damagedcache = udg_GDD_DamagedUnit
    local unit damagingcache = udg_GDD_DamageSource
    local real damagecache = udg_GDD_Damage
    set udg_GDD_DamagedUnit = GetTriggerUnit()
    set udg_GDD_DamageSource = GetEventDamageSource()
    set udg_GDD_Damage = GetEventDamage()
    set udg_GDD_Event = 1.
    set udg_GDD_Event = 0.
    set udg_GDD_DamagedUnit = damagedcache
    set udg_GDD_DamageSource = damagingcache
    set udg_GDD_Damage = damagecache
    set damagedcache = null
    set damagingcache = null
    return false
endfunction

function GDD_AddDetection takes nothing returns boolean
//  if(udg_GDD__Integers[0] > 8190) then
//      call BJDebugMsg("GDD: Too many damage events!  Decrease number of units present in the map or increase recycle rate.")
//      ***Recycle rate is specified in the GDD_RecycleRate function at the top of the code.  Smaller is faster.***
//      return
//  endif
    if(IsUnitInGroup(GetFilterUnit(), udg_GDD__LeftMapGroup)) then
        call GroupRemoveUnit(udg_GDD__LeftMapGroup, GetFilterUnit())
    elseif(GDD_Filter(GetFilterUnit())) then
        set udg_GDD__Integers[0] = udg_GDD__Integers[0]+1
        set udg_GDD__UnitArray[udg_GDD__Integers[0]] = GetFilterUnit()
        set udg_GDD__TriggerArray[udg_GDD__Integers[0]] = CreateTrigger()
        call TriggerRegisterUnitEvent(udg_GDD__TriggerArray[udg_GDD__Integers[0]], udg_GDD__UnitArray[udg_GDD__Integers[0]], EVENT_UNIT_DAMAGED)
        call TriggerAddCondition(udg_GDD__TriggerArray[udg_GDD__Integers[0]], Condition(function GDD_Event))
    endif
    return false
endfunction

function GDD_PreplacedDetection takes nothing returns nothing
    local group g = CreateGroup()
    local integer i = 0
    loop
        call GroupEnumUnitsOfPlayer(g, Player(i), Condition(function GDD_AddDetection))
        set i = i+1
        exitwhen i == bj_MAX_PLAYER_SLOTS
    endloop
    call DestroyGroup(g)
    set g = null
endfunction

function GDD_GroupRefresh takes nothing returns nothing
// Based on GroupRefresh by Captain Griffen on wc3c.net
    if (bj_slotControlUsed[5063] == true) then
        call GroupClear(udg_GDD__LeftMapGroup)
        set bj_slotControlUsed[5063] = false
    endif
    call GroupAddUnit(udg_GDD__LeftMapGroup, GetEnumUnit())
endfunction

function GDD_Recycle takes nothing returns nothing
    if(udg_GDD__Integers[0] <= 0) then
        return
    elseif(udg_GDD__Integers[1] <= 0) then
        set udg_GDD__Integers[1] = udg_GDD__Integers[0]
    endif
    if(GetUnitTypeId(udg_GDD__UnitArray[udg_GDD__Integers[1]]) == 0) then
        call DestroyTrigger(udg_GDD__TriggerArray[udg_GDD__Integers[1]])
        set udg_GDD__TriggerArray[udg_GDD__Integers[1]] = null
        set udg_GDD__TriggerArray[udg_GDD__Integers[1]] = udg_GDD__TriggerArray[udg_GDD__Integers[0]]
        set udg_GDD__UnitArray[udg_GDD__Integers[1]] = udg_GDD__UnitArray[udg_GDD__Integers[0]]
        set udg_GDD__UnitArray[udg_GDD__Integers[0]] = null
        set udg_GDD__Integers[0] = udg_GDD__Integers[0]-1
    endif
    set udg_GDD__Integers[1] = udg_GDD__Integers[1]-1
endfunction

function GDD_LeaveMap takes nothing returns boolean
    local boolean cached = bj_slotControlUsed[5063]
    if(udg_GDD__Integers[2] < 64) then
        set udg_GDD__Integers[2] = udg_GDD__Integers[2]+1
    else
        set bj_slotControlUsed[5063] = true
        call ForGroup(udg_GDD__LeftMapGroup, function GDD_GroupRefresh)
        set udg_GDD__Integers[2] = 0
    endif
    call GroupAddUnit(udg_GDD__LeftMapGroup, GetFilterUnit())
    set bj_slotControlUsed[5063] = cached
    return false
endfunction

// ===========================================================================
function InitTrig_GUI_Friendly_Damage_Detection takes nothing returns nothing
    local region r = CreateRegion()
    call RegionAddRect(r, GetWorldBounds())
    call TriggerRegisterEnterRegion(CreateTrigger(), r, Condition(function GDD_AddDetection))
    call TriggerRegisterLeaveRegion(CreateTrigger(), r, Condition(function GDD_LeaveMap))
    call GDD_PreplacedDetection()
    call TimerStart(CreateTimer(), GDD_RecycleRate(), true, function GDD_Recycle)
    set r = null
endfunction
Create Coast Guard
  Events
    Time - Every 90.00 seconds of game time
  Conditions
  Actions
    Unit - Create 1.Coast Guard for Neutral Passive at (Center of Create_Coast_Guard <gen>) facing 265.00 degrees
    Unit - Order (Last created unit) to Move To.(Center of Coast_Guard_step_1 <gen>)
Coast Guard step 1
  Events
    Unit - A unit enters Coast_Guard_step_1 <gen>
  Conditions
    (Unit-type of (Entering unit)) Equal to Coast Guard
  Actions
    Unit - Order (Entering unit) to Move To.(Center of Remove_Coast_Guard <gen>)
Remove Coast Guard
  Events
    Unit - A unit enters Remove_Coast_Guard <gen>
  Conditions
    (Unit-type of (Entering unit)) Equal to Coast Guard
  Actions
    Unit - Remove (Entering unit) from the game
Ship1
  Events
    Unit - A unit enters Ship6 <gen>
  Conditions
    Ship 0036 <gen> Equal to (Entering unit)
  Actions
    Unit - Hide Ship 0036 <gen>
    Wait 25.00 seconds
    Unit - Make Ship 0036 <gen> face 330.00 over 0 seconds
    Unit - Move (Entering unit) instantly to (Center of Ship7 <gen>), facing (Center of Ship9 <gen>)
Ship2
  Events
    Unit - A unit enters Ship7 <gen>
  Conditions
    Ship 0036 <gen> Equal to (Entering unit)
  Actions
    Set VariableSet TempPoint4 = (Center of Ship9 <gen>)
    Unit - Order Ship 0036 <gen> to Move To.TempPoint4
    Custom script: call RemoveLocation (udg_TempPoint4)
    Wait 0.15 game-time seconds
    Unit - Unhide Ship 0036 <gen>
Ship3
  Events
    Unit - A unit enters Ship9 <gen>
  Conditions
    Ship 0036 <gen> Equal to (Entering unit)
  Actions
    Set VariableSet TempPoint4 = (Center of Ship7 <gen>)
    Unit - Order Ship 0036 <gen> to Move To.TempPoint4
    Custom script: call RemoveLocation (udg_TempPoint4)
    Trigger - Turn off Ship1 <gen>
    Trigger - Turn off Ship2 <gen>
    Trigger - Turn on Ship4 <gen>
    Trigger - Turn on Ship5 <gen>
Ship4
  Events
    Unit - A unit enters Ship7 <gen>
  Conditions
    Ship 0036 <gen> Equal to (Entering unit)
  Actions
    Unit - Hide Ship 0036 <gen>
    Wait 25.00 seconds
    Unit - Move Ship 0036 <gen> instantly to (Center of Ship6 <gen>), facing (Center of 64 <gen>)
    Unit - Order Ship 0036 <gen> to Move To.(Center of Ship1 <gen>)
    Wait 0.15 seconds
    Unit - Unhide Ship 0036 <gen>
Ship5
  Events
    Unit - A unit enters Ship6 <gen>
  Conditions
    Ship 0036 <gen> Equal to (Entering unit)
  Actions
    Set VariableSet TempPoint4 = (Center of Ship1 <gen>)
    Unit - Order Ship 0036 <gen> to Move To.TempPoint4
    Custom script: call RemoveLocation (udg_TempPoint4)
Ship6
  Events
    Unit - A unit enters Ship1 <gen>
  Conditions
    Ship 0036 <gen> Equal to (Entering unit)
  Actions
    Set VariableSet TempPoint4 = (Center of Ship6 <gen>)
    Unit - Order Ship 0036 <gen> to Move To.TempPoint4
    Custom script: call RemoveLocation (udg_TempPoint4)
    Trigger - Turn on Ship1 <gen>
    Trigger - Turn on Ship2 <gen>
    Trigger - Turn off Ship4 <gen>
    Trigger - Turn off Ship5 <gen>
Enhanced Egg Fire
  Events
    Unit - A unit Sells a unit
  Conditions
    (Unit-type of (Sold unit)) Equal to Enhanced Egg fire
  Actions
    Unit - Remove (Sold unit) from the game
    Unit - Increase level of Command Aura (Fire egg) for (Selling unit)
Enhanced Egg Earth
  Events
    Unit - A unit Sells a unit
  Conditions
    (Unit-type of (Sold unit)) Equal to Enhanced Egg earth
  Actions
    Unit - Remove (Sold unit) from the game
    Unit - Add Hardened Shell (armor +17) to (Selling unit)
Enhanced Egg Wind
  Events
    Unit - A unit Sells a unit
  Conditions
    (Unit-type of (Sold unit)) Equal to Enhanced Egg wind
  Actions
    Unit - Remove (Sold unit) from the game
    Unit - Increase level of Resource for (Selling unit)
Enhanced Egg Water
  Events
    Unit - A unit Sells a unit
  Conditions
    (Unit-type of (Sold unit)) Equal to Enhanced Egg water
  Actions
    Unit - Remove (Sold unit) from the game
    Unit - Increase level of Slippery Terrain (Water egg) for (Selling unit)
Enhanced Egg Ice
  Events
    Unit - A unit Sells a unit
  Conditions
    (Unit-type of (Sold unit)) Equal to Enhanced Egg ice
  Actions
    Unit - Remove (Sold unit) from the game
    Unit - Increase level of Slow Aura (Neutral Hostile) for (Selling unit)
Enhanced Egg Nature
  Events
    Unit - A unit Sells a unit
  Conditions
    (Unit-type of (Sold unit)) Equal to Enhanced Egg nature
  Actions
    Unit - Remove (Sold unit) from the game
    Unit - Add Hardened Shell (armor +17) to (Selling unit)
Enhanced Egg Lightning
  Events
    Unit - A unit Sells a unit
  Conditions
    (Unit-type of (Sold unit)) Equal to Enhanced Egg lightning
  Actions
    Unit - Remove (Sold unit) from the game
    Unit - Increase level of Lightning Pulse (egg) for (Selling unit)
Enhanced Egg Shadow
  Events
    Unit - A unit Sells a unit
  Conditions
    (Unit-type of (Sold unit)) Equal to Enhanced Egg shadow
  Actions
    Unit - Remove (Sold unit) from the game
    Unit - Add Harvest Corpse (Shadow Egg) to (Selling unit)
Enhanced Egg Gold
  Events
    Unit - A unit Sells a unit
  Conditions
    (Unit-type of (Sold unit)) Equal to Enhanced Egg gold
  Actions
    Unit - Remove (Sold unit) from the game
    Unit - Add Fortified Shell to (Selling unit)
Build egg
  Events
    Unit - A unit enters MapVision <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Scout Tower
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (1 <gen> contains (Triggering unit)) Equal to True
            (2 <gen> contains (Triggering unit)) Equal to True
            (3 <gen> contains (Triggering unit)) Equal to True
            (4 <gen> contains (Triggering unit)) Equal to True
            (5 <gen> contains (Triggering unit)) Equal to True
            (6 <gen> contains (Triggering unit)) Equal to True
            (7 <gen> contains (Triggering unit)) Equal to True
            (8 <gen> contains (Triggering unit)) Equal to True
            (9 <gen> contains (Triggering unit)) Equal to True
            (10 <gen> contains (Triggering unit)) Equal to True
            (11 <gen> contains (Triggering unit)) Equal to True
            (12 <gen> contains (Triggering unit)) Equal to True
            (13 <gen> contains (Triggering unit)) Equal to True
            (14 <gen> contains (Triggering unit)) Equal to True
            (15 <gen> contains (Triggering unit)) Equal to True
            (16 <gen> contains (Triggering unit)) Equal to True
            (17 <gen> contains (Triggering unit)) Equal to True
            (18 <gen> contains (Triggering unit)) Equal to True
            (19 <gen> contains (Triggering unit)) Equal to True
            (20 <gen> contains (Triggering unit)) Equal to True
            (21 <gen> contains (Triggering unit)) Equal to True
            (22 <gen> contains (Triggering unit)) Equal to True
            (23 <gen> contains (Triggering unit)) Equal to True
            (24 <gen> contains (Triggering unit)) Equal to True
            (25 <gen> contains (Triggering unit)) Equal to True
            (26 <gen> contains (Triggering unit)) Equal to True
            (27 <gen> contains (Triggering unit)) Equal to True
            (28 <gen> contains (Triggering unit)) Equal to True
            (29 <gen> contains (Triggering unit)) Equal to True
            (30 <gen> contains (Triggering unit)) Equal to True
            (31 <gen> contains (Triggering unit)) Equal to True
            (32 <gen> contains (Triggering unit)) Equal to True
            (33 <gen> contains (Triggering unit)) Equal to True
            (34 <gen> contains (Triggering unit)) Equal to True
            (35 <gen> contains (Triggering unit)) Equal to True
            (36 <gen> contains (Triggering unit)) Equal to True
            (37 <gen> contains (Triggering unit)) Equal to True
            (38 <gen> contains (Triggering unit)) Equal to True
            (39 <gen> contains (Triggering unit)) Equal to True
            (40 <gen> contains (Triggering unit)) Equal to True
            (41 <gen> contains (Triggering unit)) Equal to True
            (42 <gen> contains (Triggering unit)) Equal to True
            (43 <gen> contains (Triggering unit)) Equal to True
            (44 <gen> contains (Triggering unit)) Equal to True
            (45 <gen> contains (Triggering unit)) Equal to True
            (46 <gen> contains (Triggering unit)) Equal to True
            (47 <gen> contains (Triggering unit)) Equal to True
            (48 <gen> contains (Triggering unit)) Equal to True
            (49 <gen> contains (Triggering unit)) Equal to True
            (50 <gen> contains (Triggering unit)) Equal to True
            (51 <gen> contains (Triggering unit)) Equal to True
            (52 <gen> contains (Triggering unit)) Equal to True
            (53 <gen> contains (Triggering unit)) Equal to True
            (54 <gen> contains (Triggering unit)) Equal to True
            (55 <gen> contains (Triggering unit)) Equal to True
            (56 <gen> contains (Triggering unit)) Equal to True
            (57 <gen> contains (Triggering unit)) Equal to True
            (58 <gen> contains (Triggering unit)) Equal to True
            (59 <gen> contains (Triggering unit)) Equal to True
            (60 <gen> contains (Triggering unit)) Equal to True
            (61 <gen> contains (Triggering unit)) Equal to True
            (62 <gen> contains (Triggering unit)) Equal to True
            (63 <gen> contains (Triggering unit)) Equal to True
            (64 <gen> contains (Triggering unit)) Equal to True
            (65 <gen> contains (Triggering unit)) Equal to True
            (66 <gen> contains (Triggering unit)) Equal to True
            (67 <gen> contains (Triggering unit)) Equal to True
            (68 <gen> contains (Triggering unit)) Equal to True
            (69 <gen> contains (Triggering unit)) Equal to True
            (70 <gen> contains (Triggering unit)) Equal to True
            (71 <gen> contains (Triggering unit)) Equal to True
            (80 <gen> contains (Triggering unit)) Equal to True
            (81 <gen> contains (Triggering unit)) Equal to True
            (82 <gen> contains (Triggering unit)) Equal to True
            (83 <gen> contains (Triggering unit)) Equal to True
            (84 <gen> contains (Triggering unit)) Equal to True
            (85 <gen> contains (Triggering unit)) Equal to True
            (86 <gen> contains (Triggering unit)) Equal to True
            (87 <gen> contains (Triggering unit)) Equal to True
            (88 <gen> contains (Triggering unit)) Equal to True
            (89 <gen> contains (Triggering unit)) Equal to True
            (126 <gen> contains (Triggering unit)) Equal to True
            (90 <gen> contains (Triggering unit)) Equal to True
            (91 <gen> contains (Triggering unit)) Equal to True
            (92 <gen> contains (Triggering unit)) Equal to True
            (93 <gen> contains (Triggering unit)) Equal to True
            (94 <gen> contains (Triggering unit)) Equal to True
            (95 <gen> contains (Triggering unit)) Equal to True
            (96 <gen> contains (Triggering unit)) Equal to True
            (97 <gen> contains (Triggering unit)) Equal to True
            (98 <gen> contains (Triggering unit)) Equal to True
            (99 <gen> contains (Triggering unit)) Equal to True
            (100 <gen> contains (Triggering unit)) Equal to True
            (111 <gen> contains (Triggering unit)) Equal to True
            (112 <gen> contains (Triggering unit)) Equal to True
            (113 <gen> contains (Triggering unit)) Equal to True
            (115 <gen> contains (Triggering unit)) Equal to True
            (118 <gen> contains (Triggering unit)) Equal to True
            (119 <gen> contains (Triggering unit)) Equal to True
            (120 <gen> contains (Triggering unit)) Equal to True
            (121 <gen> contains (Triggering unit)) Equal to True
            (122 <gen> contains (Triggering unit)) Equal to True
            (123 <gen> contains (Triggering unit)) Equal to True
            (124 <gen> contains (Triggering unit)) Equal to True
            (125 <gen> contains (Triggering unit)) Equal to True
            (127 <gen> contains (Triggering unit)) Equal to True
            (128 <gen> contains (Triggering unit)) Equal to True
      Then - Actions
        Unit - Remove (Triggering unit) from the game
        Item - Create Drop egg at (Center of Minigame <gen>)
        If ((Owner of (Triggering unit)) Equal to Player 1 (Red)) then do (Give (Last created item) to Mor'ghor 0010 <gen>) else do (Do nothing)
        If ((Owner of (Triggering unit)) Equal to Player 2 (Blue)) then do (Give (Last created item) to Mor'ghor 0011 <gen>) else do (Do nothing)
        If ((Owner of (Triggering unit)) Equal to Player 3 (Teal)) then do (Give (Last created item) to Mor'ghor 0012 <gen>) else do (Do nothing)
        If ((Owner of (Triggering unit)) Equal to Player 4 (Purple)) then do (Give (Last created item) to Mor'ghor 0013 <gen>) else do (Do nothing)
        If ((Owner of (Triggering unit)) Equal to Player 5 (Yellow)) then do (Give (Last created item) to Mor'ghor 0014 <gen>) else do (Do nothing)
        If ((Owner of (Triggering unit)) Equal to Player 6 (Orange)) then do (Give (Last created item) to Mor'ghor 0015 <gen>) else do (Do nothing)
        Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (Matching player)).) the text: You can't drop your egg at a location creeps can't reach. Try again at another location.
      Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Number of units in (Units in (Region centered at (Position of (Triggering unit)) with size (2000.00, 2000.00)) matching ((Custom value of (Matching unit)) Equal to 100))) Greater than or equal to 1
          Then - Actions
            Unit - Remove (Triggering unit) from the game
            Item - Create Drop egg at (Center of Minigame <gen>)
            If ((Owner of (Triggering unit)) Equal to Player 1 (Red)) then do (Give (Last created item) to Mor'ghor 0010 <gen>) else do (Do nothing)
            If ((Owner of (Triggering unit)) Equal to Player 2 (Blue)) then do (Give (Last created item) to Mor'ghor 0011 <gen>) else do (Do nothing)
            If ((Owner of (Triggering unit)) Equal to Player 3 (Teal)) then do (Give (Last created item) to Mor'ghor 0012 <gen>) else do (Do nothing)
            If ((Owner of (Triggering unit)) Equal to Player 4 (Purple)) then do (Give (Last created item) to Mor'ghor 0013 <gen>) else do (Do nothing)
            If ((Owner of (Triggering unit)) Equal to Player 5 (Yellow)) then do (Give (Last created item) to Mor'ghor 0014 <gen>) else do (Do nothing)
            If ((Owner of (Triggering unit)) Equal to Player 6 (Orange)) then do (Give (Last created item) to Mor'ghor 0015 <gen>) else do (Do nothing)
            Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (Matching player)).) the text: Keep a distance of minimum 2000 to other eggs. Try again at another location
          Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                EggSelect[(Player number of (Owner of (Triggering unit)))] Equal to 1
              Then - Actions
                Unit - Replace (Triggering unit) with a Fire egg using The new unit's default life and mana
              Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                EggSelect[(Player number of (Owner of (Triggering unit)))] Equal to 2
              Then - Actions
                Unit - Replace (Triggering unit) with a Earth egg using The new unit's default life and mana
              Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                EggSelect[(Player number of (Owner of (Triggering unit)))] Equal to 3
              Then - Actions
                Unit - Replace (Triggering unit) with a Wind egg using The new unit's default life and mana
              Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                EggSelect[(Player number of (Owner of (Triggering unit)))] Equal to 4
              Then - Actions
                Unit - Replace (Triggering unit) with a Water egg using The new unit's default life and mana
              Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                EggSelect[(Player number of (Owner of (Triggering unit)))] Equal to 5
              Then - Actions
                Unit - Replace (Triggering unit) with a Ice egg using The new unit's default life and mana
              Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                EggSelect[(Player number of (Owner of (Triggering unit)))] Equal to 6
              Then - Actions
                Unit - Replace (Triggering unit) with a Nature egg using The new unit's default life and mana
              Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                EggSelect[(Player number of (Owner of (Triggering unit)))] Equal to 7
              Then - Actions
                Unit - Replace (Triggering unit) with a Lightning egg using The new unit's default life and mana
              Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                EggSelect[(Player number of (Owner of (Triggering unit)))] Equal to 8
              Then - Actions
                Unit - Replace (Triggering unit) with a Shadow Egg using The new unit's default life and mana
              Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                EggSelect[(Player number of (Owner of (Triggering unit)))] Equal to 9
              Then - Actions
                Unit - Replace (Triggering unit) with a Gold egg using The new unit's default life and mana
              Else - Actions
            Unit - Add Ghost (Visible) to (Last replaced unit)
            Unit - Set the custom value of (Last replaced unit) to 100
            Set VariableSet Egg[(Player number of (Owner of (Triggering unit)))] = (Last replaced unit)
            Set VariableSet Point2 = (Position of (Triggering unit))
            Special Effect - Create a special effect at Point2 using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
            Special Effect - Destroy (Last created special effect)
            Custom script: call RemoveLocation(udg_Point2)
            For each (Integer B) from 1 to 6, do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ManaShieldCheck[(Integer B)] Equal to 1
                  Then - Actions
                    Unit - Add Mana Shield to Egg[(Integer B)]
                  Else - Actions
Gold egg lvl 1 to 10
  Events
    Game - GDD_Event becomes Equal to 0
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of GDD_DamagedUnit) Equal to Gold egg
      Then - Actions
        Player - Add (Integer(GDD_Damage)) to (Owner of GDD_DamagedUnit).Current gold
      Else - Actions
Gold egg lvl 11 to 20
  Events
    Game - GDD_Event becomes Equal to 0
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of GDD_DamagedUnit) Equal to Gold egg
      Then - Actions
        Player - Add (2 x (Integer(GDD_Damage))) to (Owner of GDD_DamagedUnit).Current gold
      Else - Actions
Gold egg lvl 21 to 30
  Events
    Game - GDD_Event becomes Equal to 0
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of GDD_DamagedUnit) Equal to Gold egg
      Then - Actions
        Player - Add (3 x (Integer(GDD_Damage))) to (Owner of GDD_DamagedUnit).Current gold
      Else - Actions
Lightning egg
  Events
    Unit - A unit Begins casting an ability
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Ability being cast) Equal to Lightning Pulse (egg)
      Then - Actions
        Set VariableSet TempPoint4 = (Position of (Target unit of ability being cast))
        Unit - Create 1 Archer for (Owner of (Casting unit)) at (Position of (Casting unit)) facing TempPoint4
        Unit - Hide (Last created unit)
        Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
        Unit - Add Lightning Pulse (Blood lust) to (Last created unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Level of Lightning Pulse (egg) for Egg[(Player number of (Owner of (Triggering unit)))]) Equal to 2
          Then - Actions
            Unit - Increase level of Lightning Pulse (Blood lust) for (Last created unit)
          Else - Actions
        Unit - Order (Last created unit) to Orc Shaman - Bloodlust.(Target unit of ability being cast)
        Special Effect - Create a special effect at TempPoint4 using Abilities\Weapons\ChimaeraLightningMissile\ChimaeraLightningMissile.mdl
        Special Effect - Destroy (Last created special effect)
        Special Effect - Create a special effect at TempPoint4 using Abilities\Spells\Undead\ReplenishMana\SpiritTouchTarget.mdl
        Special Effect - Destroy (Last created special effect)
        Custom script: call RemoveLocation (udg_TempPoint4)
      Else - Actions
Wind egg
  Events
    Unit - A unit Finishes an upgrade
    Unit - A unit Finishes construction
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of Egg[(Player number of (Owner of (Triggering unit)))]) Equal to Wind egg
      Then - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            Or - Any (Conditions) are true
              Conditions
                (Unit-type of (Triggering unit)) Equal to Maze Tower
                (Unit-type of (Triggering unit)) Equal to Sell
          Then - Actions
          Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Level of Resource for Egg[(Player number of (Owner of (Triggering unit)))]) Equal to 2
              Then - Actions
                Player - Add 3 to (Owner of (Triggering unit)).Current gold
                Player - Add 7 to (Owner of (Triggering unit)).Current lumber
              Else - Actions
                Player - Add 2 to (Owner of (Triggering unit)).Current gold
                Player - Add 4 to (Owner of (Triggering unit)).Current lumber
      Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Level of Resource for Egg[(Player number of (Owner of (Triggering unit)))]) Equal to 1
          Then - Actions
            Player - Add 2 to (Owner of (Triggering unit)).Current gold
            Player - Add 4 to (Owner of (Triggering unit)).Current lumber
          Else - Actions
Shadow egg
  Events
    Game - GDD_Event becomes Equal to 0
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        And - All (Conditions) are true
          Conditions
            (Life of GDD_DamagedUnit) Less than or equal to GDD_Damage
            (Unit-type of GDD_DamagedUnit) Equal to Shadow Egg
      Then - Actions
        Unit - Create 1.Display range for (Owner of GDD_DamagedUnit) at (Position of GDD_DamagedUnit) facing Default building facing degrees
        Unit - Hide (Last created unit)
        Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
        Unit - Add Dark explosion to (Last created unit)
        Special Effect - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
        Special Effect - Destroy (Last created special effect)
        Unit - Order (Last created unit) to Human Mountain King - Thunder Clap.
        If ((Owner of GDD_DamagedUnit) Equal to Player 1 (Red)) then do (Run Shadow_egg_red <gen> (ignoring conditions)) else do (Do nothing)
        If ((Owner of GDD_DamagedUnit) Equal to Player 2 (Blue)) then do (Run Shadow_egg_blue <gen> (ignoring conditions)) else do (Do nothing)
        If ((Owner of GDD_DamagedUnit) Equal to Player 3 (Teal)) then do (Run Shadow_egg_teal <gen> (ignoring conditions)) else do (Do nothing)
        If ((Owner of GDD_DamagedUnit) Equal to Player 4 (Purple)) then do (Run Shadow_egg_purple <gen> (ignoring conditions)) else do (Do nothing)
        If ((Owner of GDD_DamagedUnit) Equal to Player 5 (Yellow)) then do (Run Shadow_egg_yellow <gen> (ignoring conditions)) else do (Do nothing)
        If ((Owner of GDD_DamagedUnit) Equal to Player 6 (Orange)) then do (Run Shadow_egg_orange <gen> (ignoring conditions)) else do (Do nothing)
      Else - Actions
Shadow egg 2
  Events
    Unit - A unit Dies
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        And - All (Conditions) are true
          Conditions
            ((Unit-type of (Triggering unit)) Equal to Level_UnitType[Level_Integer]) or ((Unit-type of (Triggering unit)) Equal to Level_UnitType_Copy[Level_Integer])
            (Number of living Shadow Egg units owned by (Owner of (Killing unit))) Equal to 1
      Then - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Level of Harvest Corpse (Shadow Egg) for (Random unit from (Units owned by (Owner of (Killing unit)) of type Shadow Egg))) Equal to 1
          Then - Actions
            Unit - Set life of Egg[(Player number of (Owner of (Killing unit)))] to ((Life of Egg[(Player number of (Owner of (Killing unit)))]) + 4.00)
          Else - Actions
      Else - Actions
Shadow egg red
  Events
  Conditions
  Actions
    Wait 0.10 seconds
    Set VariableSet TempGroupDark = (Units owned by Player 1 (Red) of type Shadow Egg)
    Unit Group - Pick every unit in TempGroupDark and do (Actions)
      Loop - Actions
        Unit - Remove Darkness (Dark egg) from (Picked unit)
        Unit - Set mana of (Picked unit) to 0.00%
    Custom script: call DestroyGroup (udg_TempGroupDark)
Shadow egg blue
  Events
  Conditions
  Actions
    Wait 0.10 seconds
    Set VariableSet TempGroupDark = (Units owned by Player 2 (Blue) of type Shadow Egg)
    Unit Group - Pick every unit in TempGroupDark and do (Actions)
      Loop - Actions
        Unit - Remove Darkness (Dark egg) from (Picked unit)
        Unit - Set mana of (Picked unit) to 0.00%
    Custom script: call DestroyGroup (udg_TempGroupDark)
Shadow egg teal
  Events
  Conditions
  Actions
    Wait 0.10 seconds
    Set VariableSet TempGroupDark = (Units owned by Player 3 (Teal) of type Shadow Egg)
    Unit Group - Pick every unit in TempGroupDark and do (Actions)
      Loop - Actions
        Unit - Remove Darkness (Dark egg) from (Picked unit)
        Unit - Set mana of (Picked unit) to 0.00%
    Custom script: call DestroyGroup (udg_TempGroupDark)
Shadow egg purple
  Events
  Conditions
  Actions
    Wait 0.10 seconds
    Set VariableSet TempGroupDark = (Units owned by Player 4 (Purple) of type Shadow Egg)
    Unit Group - Pick every unit in TempGroupDark and do (Actions)
      Loop - Actions
        Unit - Remove Darkness (Dark egg) from (Picked unit)
        Unit - Set mana of (Picked unit) to 0.00%
    Custom script: call DestroyGroup (udg_TempGroupDark)
Shadow egg yellow
  Events
  Conditions
  Actions
    Wait 0.10 seconds
    Set VariableSet TempGroupDark = (Units owned by Player 5 (Yellow) of type Shadow Egg)
    Unit Group - Pick every unit in TempGroupDark and do (Actions)
      Loop - Actions
        Unit - Remove Darkness (Dark egg) from (Picked unit)
        Unit - Set mana of (Picked unit) to 0.00%
    Custom script: call DestroyGroup (udg_TempGroupDark)
Shadow egg orange
  Events
  Conditions
  Actions
    Wait 0.10 seconds
    Set VariableSet TempGroupDark = (Units owned by Player 6 (Orange) of type Shadow Egg)
    Unit Group - Pick every unit in TempGroupDark and do (Actions)
      Loop - Actions
        Unit - Remove Darkness (Dark egg) from (Picked unit)
        Unit - Set mana of (Picked unit) to 0.00%
    Custom script: call DestroyGroup (udg_TempGroupDark)
Build on egg
  Events
    Unit - A unit Begins construction
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            ((Region centered at (Position of Egg[1]) with size (224.00, 224.00)) contains (Constructing structure)) Equal to True
            ((Region centered at (Position of Egg[2]) with size (224.00, 224.00)) contains (Constructing structure)) Equal to True
            ((Region centered at (Position of Egg[3]) with size (224.00, 224.00)) contains (Constructing structure)) Equal to True
            ((Region centered at (Position of Egg[4]) with size (224.00, 224.00)) contains (Constructing structure)) Equal to True
            ((Region centered at (Position of Egg[5]) with size (224.00, 224.00)) contains (Constructing structure)) Equal to True
            ((Region centered at (Position of Egg[6]) with size (224.00, 224.00)) contains (Constructing structure)) Equal to True
      Then - Actions
        Game - Display to (All players matching ((Owner of (Constructing structure)) Equal to (Matching player)).) the text: Keep a distance of 200 to the egg
        Unit - Remove (Constructing structure) from the game
        Player - Add (Point-value of (Constructing structure)) to (Owner of (Constructing structure)).Current gold
      Else - Actions
Drop egg
  Events
    Unit - A unit Begins casting an ability
  Conditions
    (Ability being cast) Equal to Silence
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            ((Triggering unit) has an item of type Fire Egg) Equal to True
            ((Triggering unit) has an item of type Earth Egg) Equal to True
            ((Triggering unit) has an item of type Gold Egg) Equal to True
            ((Triggering unit) has an item of type Ice Egg) Equal to True
            ((Triggering unit) has an item of type Lightning Egg) Equal to True
            ((Triggering unit) has an item of type Nature Egg) Equal to True
            ((Triggering unit) has an item of type Shadow Egg) Equal to True
            ((Triggering unit) has an item of type Water Egg) Equal to True
            ((Triggering unit) has an item of type Wind Egg) Equal to True
      Then - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            Or - Any (Conditions) are true
              Conditions
                (1 <gen> contains (Triggering unit)) Equal to True
                (2 <gen> contains (Triggering unit)) Equal to True
                (3 <gen> contains (Triggering unit)) Equal to True
                (4 <gen> contains (Triggering unit)) Equal to True
                (5 <gen> contains (Triggering unit)) Equal to True
                (6 <gen> contains (Triggering unit)) Equal to True
                (7 <gen> contains (Triggering unit)) Equal to True
                (8 <gen> contains (Triggering unit)) Equal to True
                (9 <gen> contains (Triggering unit)) Equal to True
                (10 <gen> contains (Triggering unit)) Equal to True
                (11 <gen> contains (Triggering unit)) Equal to True
                (12 <gen> contains (Triggering unit)) Equal to True
                (13 <gen> contains (Triggering unit)) Equal to True
                (14 <gen> contains (Triggering unit)) Equal to True
                (15 <gen> contains (Triggering unit)) Equal to True
                (16 <gen> contains (Triggering unit)) Equal to True
                (17 <gen> contains (Triggering unit)) Equal to True
                (18 <gen> contains (Triggering unit)) Equal to True
                (19 <gen> contains (Triggering unit)) Equal to True
                (20 <gen> contains (Triggering unit)) Equal to True
                (21 <gen> contains (Triggering unit)) Equal to True
                (22 <gen> contains (Triggering unit)) Equal to True
                (23 <gen> contains (Triggering unit)) Equal to True
                (24 <gen> contains (Triggering unit)) Equal to True
                (25 <gen> contains (Triggering unit)) Equal to True
                (26 <gen> contains (Triggering unit)) Equal to True
                (27 <gen> contains (Triggering unit)) Equal to True
                (28 <gen> contains (Triggering unit)) Equal to True
                (29 <gen> contains (Triggering unit)) Equal to True
                (30 <gen> contains (Triggering unit)) Equal to True
                (31 <gen> contains (Triggering unit)) Equal to True
                (32 <gen> contains (Triggering unit)) Equal to True
                (33 <gen> contains (Triggering unit)) Equal to True
                (34 <gen> contains (Triggering unit)) Equal to True
                (35 <gen> contains (Triggering unit)) Equal to True
                (36 <gen> contains (Triggering unit)) Equal to True
                (37 <gen> contains (Triggering unit)) Equal to True
                (38 <gen> contains (Triggering unit)) Equal to True
                (39 <gen> contains (Triggering unit)) Equal to True
                (40 <gen> contains (Triggering unit)) Equal to True
                (41 <gen> contains (Triggering unit)) Equal to True
                (42 <gen> contains (Triggering unit)) Equal to True
                (43 <gen> contains (Triggering unit)) Equal to True
                (44 <gen> contains (Triggering unit)) Equal to True
                (45 <gen> contains (Triggering unit)) Equal to True
                (46 <gen> contains (Triggering unit)) Equal to True
                (47 <gen> contains (Triggering unit)) Equal to True
                (48 <gen> contains (Triggering unit)) Equal to True
                (49 <gen> contains (Triggering unit)) Equal to True
                (50 <gen> contains (Triggering unit)) Equal to True
                (51 <gen> contains (Triggering unit)) Equal to True
                (52 <gen> contains (Triggering unit)) Equal to True
                (53 <gen> contains (Triggering unit)) Equal to True
                (54 <gen> contains (Triggering unit)) Equal to True
                (55 <gen> contains (Triggering unit)) Equal to True
                (56 <gen> contains (Triggering unit)) Equal to True
                (57 <gen> contains (Triggering unit)) Equal to True
                (58 <gen> contains (Triggering unit)) Equal to True
                (59 <gen> contains (Triggering unit)) Equal to True
                (60 <gen> contains (Triggering unit)) Equal to True
                (61 <gen> contains (Triggering unit)) Equal to True
                (62 <gen> contains (Triggering unit)) Equal to True
                (63 <gen> contains (Triggering unit)) Equal to True
                (64 <gen> contains (Triggering unit)) Equal to True
                (65 <gen> contains (Triggering unit)) Equal to True
                (66 <gen> contains (Triggering unit)) Equal to True
                (67 <gen> contains (Triggering unit)) Equal to True
                (68 <gen> contains (Triggering unit)) Equal to True
                (69 <gen> contains (Triggering unit)) Equal to True
                (70 <gen> contains (Triggering unit)) Equal to True
                (71 <gen> contains (Triggering unit)) Equal to True
                ( contains (Triggering unit)) Equal to True
                ( contains (Triggering unit)) Equal to True
<