1. Are you planning to upload your awesome map to Hive? Please review the rules here.
    Dismiss Notice
  2. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  3. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  4. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Trigger Viewer

BnBv1.9j.w3x
Variables
Variables
Notes
ToDo
ItemStacksCombine
ItemStacks
TrainEffects
TrainFireball
TrainLightningBolt
Income
Periodic
Monsters
MonsterShowCountdown
ManaBeastAttack
MonsterBounty
SpawnMonster
MindlessHostile
IncreaseSpawn
SpawnerRetrain
SpawnerIncreaseRetrain
SpawnerGoldRetrain
SpawnRedSet
SpawnRed
SpawnBlueSet
SpawnBlue
SpawnYellowSet
SpawnYellow
SpawnGreenSet
SpawnGreen
BuildingUniversal
FireTowerRetrain
FireTowerConstruction
LightningTowerRetrain
LightningTowerConstruction
BuildSound
UnitUniversal
UnitTypeLimit
UnitTypeLimitMessage
UniversalRetrain
PickUpDropArtifact
UnitEnterWrongRegion
UseItemSound
IllusoryDeathRemove
BuildingDeathRemovie
DummyDie
RaceDwarf
AviaryRestore
MountainKingAttack
AviaryCast
CastInebriate
CastRevelry
CastCarpentry
CastThunder
CastSnipe
CastShatter
CastStormRider
CastSummonMortarTeam
LumberMillConstruct
StormCageConstruct
MonumentConstruct
RifleFortConstruct
AviaryConstruct
MunitionsConstruct
MunitionsCheck
TrainRifleman
TrainMountainKing
RacePriestess
SlaveSacrifice
ConsortKill
MyrmidonKill
InitiateKill
CastOffering
CastSacredSerpent
CastSacredSerpentFinish
CastWrathoftheChosen
CastDivineOil
CastLoveoftheChosen
CastInitiate
BrazierConstruct
Braziercheck
CastTempleGaurd
DivineFlameConstruct
TentConstruct
SerpentShrineConstruct
FirstTempleConstruct
PalaceConstruct
TrainMyrmidon
TrainConsort
RaceCount
CursedBeastDies
NosferatuAttack
VillagerAttack
CursedBeastAttack
KillBlackRider
CastFeast
CastBlackRider
CastPlagueofRats
CastLivingStone
CastAncientOne
CastBloodCurse
FountainBloodConstruct
FountainofBloodCheck
CastleRuinsMana
RuinedCastleConstruct
CursedManorConstruct
InfectedGranaryConstruct
StatueConstruct
ImpaledCorpseconstruct
TrainVillager
TrainVampire
RaceCultist
DarkTrollDeath
MonsterJellyEat
SpiteDie
MurlocDie
JellyDie
MonsterJellyDie
MutantDies
EvilDreamEnd
CastDarkAlchemy
CastDarkAlchemyFinish
CastEvilSeed
CastAnnihilate
CastSwampGuard
CastVoidPulse
CastSlimeAdvance
StranglingFruitConstruction
JellyPitRetrain
JellyPitConstruction
BroodMotherConstruct
BroodMotherRetrain
EvilEyeConstruct
EvilEyeCheck
EvilEyeCast
SwampMarketConstruct
SwampMarketRetrain
SacredArmConstruct
SacredArmRetrain
TrainMutant
TrainJelly
RaceMesmer
CastManaStorm
CastTransmute
CastPhantasm
CastManaBurn
CastManaSurge
CastManaSurgeFinish
CastSorcery
SorceressAttack
MageKnightAttack
SanctumCast
TowerDreamsConstruct
TowerDreamsCast
TempleDoubtConstruct
ArcaneVaultConstruct
ArcaneVaultRetrain
HouseJoyConstruct
HouseofJoyCast
TempleofdoubtCast
SanctumConstruct
SanctumCheck
SanctumRetrain
TroveConstruct
TroveRetrain
TrainHighEld
TrainMageKnight
TrainIllusionist
RaceCryomancer
IceTrollAttack
MagnaKill
CastLeechingCold
CastIceHunt
CastMagnificence
CastFreezeArmy
CastBlizzard
CastColdSnap
CastCryophytosis
TrollLodgeICon
TrollLodgeIRe
IglooConstruct
IglooRetrain
GlacierConstruct
GlacierRetrain
NorthRunesConstruct
FrostAltarConstruct
FrostAltarRetrain
ColdThroneCast
ColdThroneConstruct
ColdThroneCheck
TrainTuskSpear
TrainIceTroll
RaceDiabolist
CastLordsGaze
CastApocalypse
CastMassConversion
CastBloodPact
CastCalling
CastChannel
CastChannelFinish
CastLesserCalling
WarlockAttack
GreaterDemonAttack
DemonAttack
TrainDemon
TrainGreaterDemon
AltarofDarknessConstruct
AltarofDarknessRetrain
LordGateConstruct
LordGateRetrain
ApocShrineConstruct
AcolyteConstruct
AcolyteCheck
SlabRetrain
SlabConstruct
PortalConstruct
PortalRetrain
RaceGardener
DruidAttack
DryadAttack
WispDeath
CastStrangeLights
CastNewGrowth
CastDruidism
CastSprout
CastRejuvinate
CastTranquility
UnderGrowthConstruct
BriarsConstruct
BriarsCheck
FatherTreeConstruct
FatherTreeUpgrade
MotherTreeConstruct
MotherTreeUpgrade
MotherTreeRetrain
FatherTreeRetrain
StarBlossomRetrain
StarBlossomConstruct
RosebudRetrain
RosebudConstruct
TrainTreefolk
TrainDryad
RaceAssassin
RevelerKill
SatyrAttack
CastAcidbomb
CasSpiderSummoning
CastSatyrRevel
CastAmbush
CastAssassinate
CastBlackArrow
EggSackRetrain
EggSackConstruct
ApothecaryRetrain
ApothecaryConstruct
PoisonWellRetrain
PoisonWellConstruct
HideoutRetrain
HideoutConstruct
DeathOakConstruct
DeathOakCheck
ShadowHouseConstruct
ShadowHouseCheck
TrainDarkElf
TrainSpider
RaceWarlord
FireProphetAttack
TrainTroll
TrainGrunt
CastMob
CastBerserk
CastRage
CastGlory
CastRaid Copy
CastFireWorship
SacredTorchRetrain
SacredTorchConstruct
TrollHallRetrain
TrollHallConstruct
OrcBarRetrain
OrcBarConstruct
GloryBannerConstruct
GloryBannerCheck
CampfireConstruct
CampfireCheck
MillConstruct
MillRetrain
RaceMachinist
CastAssault
CastMissileDefence
CastBombard
CastMassDetonate
DetonateDies
CastMarchoftheMachines
CastRepair
TrainGyrocopter
TrainSiegeTank
DemoLabCheck
DemoLabConstruction
ResearchStationCheck
ResearchStationConstruction
CannonFortConstruction
CannonFortRetrain
Workshop1Construction
Workshop1Retrain
GeneratorCheck
GeneratorConstruction
GeneratorRetrain
FactoryConstruction
FactoryRetrain
RaceMiner
CaveCowEat
WormAttack
NewtMana
CastQuake
CastTreasureHunt
CastKoboldBoss
CastCaveRanch
CastNewtPact
CastGeomancy
KoboldBurrowConstruct
KoboldBurrowRetrain
ShaftCheck
ShaftConstruction
CrystalVeinCheck
CrystalVeinConstruction
CrystalVeinRetrain
OreVeinCheck
OreVeinConstruction
FissureConstruction
FissureCheck
MineCheck
KoboldMineConstruction
KoboldMineRetrain
TrainKobold
RaceLich
BansheeDecay
NecroRaise
GhoulDies
AbomAttacks
ZombieKill
CastTomeofDeath
CastDeathWail
CastConvertPlague
CastReanimate
CastDeathCoil
CastNightoftheDead
PlagueStoneCheck
PlagueStoneConstruct
CursedGraveConstruct
CursedGraveCheck
CryptRetrain
CryptConstruction
GraveyardRetrain
GraveyardConstruction
SkullTorchConstruction
SkullTorchRetrain
OssuaryConstruction
OssuaryRetrain
TrainGhoul
TrainGhost
RaceKing
LordAttack
CastFortify
CastHolyFire
CastMilitia
CastSallyForth
CastChampion
CastMercenaries
TrainKnight
TrainFootman
BlacksmithCheck
BlacksmithConstruction
CastleCheckForAll
FarmConstruction
BarracksConstruction
BarracksRetrain
CastleConstruction
CastleRetrain
MarketConstruction
MarketRetrain
AltarofLightconstruction
AltarofLightRetrain
GoldAndMana
TrainGold
TrainMana
TrainGen
BuffTrig
MoveTrainedToPlatform
BaseUpgrades
UpgradeDarkSmite
UpgradeDelveDeep
UpgradeEquity
UpgradeCrusade
UpgradeSavagery
UpgradeRebirth
UpgradeVoodoo
UpgradeGiantGrowth
UpgradeTomeofPower
UpgradeAngryMob
UpgradeDynamicDuo
UpgradeGeogenesis
UpgradeEndofLight
UpgradeBloodBrothers
UpgradeDemilich
UpgradeAlchemist
UpgradeAntLion
UpgradeHellKnight
UpgradeHarvester
UpgradeDevourMind
UpgradeRegenerate
UpgradeHarvest
UpgradeDrainLife
UpgradeTemplar
UpgradeThunderBeast
UpgradeCelestial
UpgradeKhan
UpgradeLord
UpgradeMagicWater
UpgradeEruption
UpgradeCallBelow
UpgradeAnnihilate
UpgradeDevour
UpgradeWrathoftheAncients
UpgradeDecay
UpgradeRingofLife
UpgradeScepter
UpgradeMagicArrow
UpgradeElixirTrans
UpgradeCarrion
UpgradeHungryBones
UpgradeDeathMask
UpgradeRoots
UpgradePheonixFire
UpgradePick
UpgradePotion
UpgradeRaiment
UpgradeDeathDrum
UpgradeEarthblood
UpgradeLivingSand
UpgradeMinion
UpgradeSerf
UpgradeAngryGhost
UpgradeCentaurHorde
UpgradeFame
UpgradeDreamcatcher
UpgradeEdict
UpgradeRevengeCharm
UpgradeBloodlust
UpgradeTrophy
UpgradeFrenzy
UpgradeInfernalcontract
UpgradeVoidFlesh
UpgradeManaVial
UpgradeWaterCharm
UpgradeDarkRing
UpgradeFireScroll
UpgradeMerchant
UpgradeLordRing
UpgradeStoneOfPower
UpgradeStoneOfEternity
UpgradeWoodworking
UpgradeAngryDead
UpgradeDeathOrb
UpgradeBrood
UpgradeRelic
UpgradeStrip
RemoveUpgradeGeneral
BaseTrigs
KillLodge
KillMouth
KillReaverDen
KillSkullTower
KillNecropolis
KillHalls
KillTomb
KillBoneyard
KillZiggurat
DeathTotem
DeathPagoda
DeathCitadel
DeathPagodaNew
DeathMonolith
CastNexus
CastHellgate
CastTabernacle
CastAcademy
CastTentacle
ConstructShrine
ConstructWorldTree
ConstructAncient
ConstructCarpentryGuild
ConstructTemple
TrainGoldBazaar
TrainTavern
TrainAlchemistLab
TrainMansion
TrainVoodooShop
TrainManaNode
TrainFireShrine
TrainVoidNode
TrainEarthNode
TrainWaterShrine
HellKnightKill
TemplarHeal
TemplarDeath
ZealotAttack
VengefulAttack
DemilichAttack
AntLionAttack
AlchemistAttack
PriestAttack
PickBase
UpgradeRefund
BasePickUpgrade
BasePickRandom
BasePickMessage
PicksAndBuildersTrig
Demolish
Surrender
PickSpecific
PickRandom
PickAllRandom
CheckPickRandom
PickList
PickAssassin
PickPriestess
PickDwarf
PickMesmer
PickCryomancer
PickCultist
PickCount
PickKing
PickWarlord
PickLich
PickEngineer
PickMine
PickGardener
PickDiabolist
VictoryDefeat
TowerDeath
WinsNeededIncrease
TeamTrigs
FFA
NEvsSW
NWvsSE
Cross
FloatingText
Northperiodic
Initialization
LeaderboardAndText
RandomSpawnVariables
SetVairables
GameStart30
GameStart
Restart
FirstStart
Intro
SetNames
NameCheck
IntroSkip
Melee Initialization
Modes
PlayerLeaves
VoteRotatingTeams
VoteFixedTeams
VoteAllPick
VoteAllRandom
VoteBuilderRandom
VoteRestart
VoteCancelRestart
VoteNoHelp
VoteHelp
ModeDummyRemove
Commands
Clear
Testgeneral
EndGame
camera
camera2
Testing
TestFFA
TestAggro
EnterAttackMonster
EnterMonster
DeathMonsterAggroClear
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
AcNumber integer No
agroup group No
anumber integer No
APlayer player No
apoint location No
areal real No
atimer timer No
atimerwindow timerdialog No
aunit unit No
BaseDamageCalc integer No
BaseDamageUnit unit No
BaseITem itemcode Yes
BaseType unitcode Yes
BaseTypeNumber integer No
bgroup group No
bnumber integer No
bpoint location No
BuildArea rect Yes
BuildCenterE location No
BuildCenterN location No
BuildCenterS location No
BuildCenterW location No
Builder unit Yes
bunit unit No
cgroup group No
ChargeNumber integer No
cnumber integer No
Color playercolor Yes
ComputerTwin player Yes
cpoint location No
cunit unit No
CurrentPlayer integer No
DestructibleType destructablecode Yes
dnumber integer No
EndGame timer No
FountainOfBloodYes integer No
GloryNumber integer No
GoldSpawn location No
Income integer Yes
IncreaseSpawn integer No
IncreaseSpawnPoint location No
IntroPlaying integer No
IntWinsCheck integer No
ItemGainedType itemcode No
LastPickedBuilder unitcode Yes
LeaderMode leaderboard No
LeaderWins leaderboard No
ModeAllRandom integer No
ModeRandomBuilder integer No 1
Monsterisalive integer No
MonsterSpawn location No
MonsterSpawner unit No
MonsterSpawnTimer timer No
MonsterType unitcode Yes
MonsterTypeNumber integer No
NameBlue string No
NameGreen string No
NamePrefix string Yes
NamePrefixNumber integer No
NameRed string No
NameSuffix string Yes
NameSuffixNumber integer No
NameTeam1 string No
NameTeam2 string No
NameYellow string No
PlayerLeft integer No
PlayerPrefix integer Yes
PlayersSurviving force No
PlayerSuffix integer Yes
PlayerTwin player Yes
PlayerUse player Yes
PointBlue location No
PointGreen location No
PointRed location No
PointYellow location No
RandomSpawn trigger Yes
RandomSpawnType unitcode Yes
RandomSpawnTypeNumber integer No
RandomSummonEast unitcode No
RandomSummonNorth unitcode No
RandomSummonSouth unitcode No
RandomSummonType unitcode Yes
RandomSummonTypeNumber integer No
RandomSummonWest unitcode No
RandomUnitEast unitcode No
RandomUnitNorth unitcode No
RandomUnitSouth unitcode No
RandomUnitWest unitcode No
Restarts timer No
SinglePlayer integer No
Skippers force No
SpawnPoint rect Yes
SpawnSet trigger Yes
StartedYes integer No
StartingGold integer Yes
StartingMana real Yes
StartingPlayers force No
TeamPrefix string Yes
TeamPrefixNumber integer No
TeamsInt integer No
TeamsRotatingYes integer No
TeamSuffix string Yes
TeamSuffixNumber integer No
TeamTrig trigger Yes
Terrain terraintype Yes
TerrainB terraintype Yes
TerrainC terraintype Yes
TextGold texttag Yes
TextLife texttag Yes
TextMana texttag Yes
TextMonstertimer texttag No
TextTeam texttag Yes
Tower unit Yes
TreeType destructablecode Yes
VictoryEffect weathereffect No
VictorySound sound No
VictoryTotalSound sound No
VoidGroup group No
VoteFFAnoAI force No
VoteNoFFAnoAI force No
VotePick force No
VoteRandomAll force No
VoteRandomBuilders force No
VoteRestart force No
VoteTeamFixed force No
VoteTeamRotate force No
VoteTips force No
VoteTipsNo force No
Wins integer Yes
WinsNeeded integer No
Zoom integer Yes
Random building every monster death
from a wisp that builds and ancient, so it disappears
This is a "migrant" of "religion" and is a sub-race
its building does not produce a spell
it trains events
"migrant" is set for that round and is an info ability given to builder

maybe you can pick your migrant, and is randomed at start of game

ex. Apocalypse Priest, builds structure that trains damage to enemy base
Grove Druid, structure that trains healing

Astrologer->stars, cloning, teleport, ethereal and Tauren->totems, ghostform
+1 Bases in all types
+1 Summoning Circle Base that can spend lumber powerfully (to make a unit if you want to buff)
ToDo
  Events
  Conditions
  Actions
ItemStacks
  Events
    Unit - A unit Acquires an item
  Conditions
    (Item-class of (Item being manipulated)) Equal to Charged
  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
            (Item carried by (Triggering unit) in slot (Integer A)) Not equal to (Item being manipulated)
            (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
          Then - Actions
            Set VariableSet anumber = (Charges remaining in (Item carried by (Triggering unit) in slot (Integer A)))
            Set VariableSet bnumber = (Charges remaining in (Item being manipulated))
            Set VariableSet anumber = (anumber + bnumber)
            Item - Set charges remaining in (Item carried by (Triggering unit) in slot (Integer A)) to anumber
            Item - Remove (Item being manipulated)
          Else - Actions
            Do nothing
TrainFireball
  Events
    Unit - A unit Finishes training a unit
  Conditions
    (Unit-type of (Trained unit)) Equal to Fireball custom
  Actions
    Set VariableSet aunit = (Trained unit)
    Set VariableSet bunit = (Triggering unit)
    Trigger - Run BuffTrig <gen> (checking conditions)
    Set VariableSet agroup = (Units in Platform <gen> matching ((((Owner of (Matching unit)) is an enemy of (Owner of (Trained unit)).) Equal to True) and (((Matching unit) is alive) Equal to True)))
    Set VariableSet aunit = (Random unit from agroup)
    Floating Text - Create floating text that reads Fireball! above aunit with Z offset 0, using font size 10, color (100%, 25.00%, 0.00%), and 0% transparency
    Floating Text - Change (Last created floating text): Disable permanence
    Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
    Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
    Custom script: call DestroyGroup (udg_agroup)
    Set VariableSet apoint = (Position of aunit)
    Set VariableSet agroup = (Units within 300.00 of apoint.)
    Unit Group - Pick every unit in agroup and do (Actions)
      Loop - Actions
        Unit - Cause (Trained unit) to damage (Picked unit), dealing 8.00 damage of attack type Spells and damage type Normal
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Picked unit) using Abilities\Spells\Other\Doom\DoomDeath.mdl
        Special Effect - Destroy (Last created special effect)
    Custom script: call DestroyGroup (udg_agroup)
    Custom script: call RemoveLocation (udg_apoint)
    Unit - Remove (Trained unit) from the game
TrainLightningBolt
  Events
    Unit - A unit Finishes training a unit
  Conditions
    (Unit-type of (Trained unit)) Equal to Lightning Bolt custom
  Actions
    Set VariableSet aunit = (Trained unit)
    Set VariableSet bunit = (Triggering unit)
    Trigger - Run BuffTrig <gen> (checking conditions)
    Set VariableSet agroup = (Units in Platform <gen> matching ((((Owner of (Matching unit)) is an enemy of (Owner of (Trained unit)).) Equal to True) and (((Matching unit) is alive) Equal to True)))
    Set VariableSet aunit = (Random unit from agroup)
    Custom script: call DestroyGroup (udg_agroup)
    Floating Text - Create floating text that reads Lightning Bolt! above aunit with Z offset 0, using font size 10, color (0.00%, 25.00%, 100.00%), and 0% transparency
    Floating Text - Change (Last created floating text): Disable permanence
    Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
    Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
    Unit - Cause (Trained unit) to damage aunit, dealing 20.00 damage of attack type Spells and damage type Normal
    Special Effect - Create a special effect attached to the chest (attachpoint) of aunit using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
    Special Effect - Destroy (Last created special effect)
    Unit - Remove (Trained unit) from the game
Periodic
  Events
    Unit - A unit Finishes training a unit
  Conditions
    (Unit-type of (Triggering unit)) Equal to Spawner Gold
  Actions
    For each (Integer A) from 1 to 4, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Tower[(Player number of PlayerUse[(Integer A)])] is alive) Equal to True
          Then - Actions
            Floating Text - Create floating text that reads (+ + (String(Income[(Player number of PlayerUse[(Integer A)])]))) above Tower[(Player number of PlayerUse[(Integer A)])] with Z offset 0, using font size 10, color (100%, 100%, 0.00%), and 0% transparency
            Floating Text - Change (Last created floating text): Disable permanence
            Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
            Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
            Player - Add Income[(Player number of PlayerUse[(Integer A)])] to PlayerUse[(Integer A)].Current gold
          Else - Actions
            Do nothing
    Unit - Remove (Trained unit) from the game
MonsterShowCountdown
  Events
    Time - Every 1.00 seconds of game time
  Conditions
    (Remaining time for MonsterSpawnTimer) Less than 11.00
    Monsterisalive Equal to 0
  Actions
    Floating Text - Change text of TextMonstertimer to (String((Integer((Remaining time for MonsterSpawnTimer))))) using font size 20.00
    Floating Text - Change the color of TextMonstertimer to (35.00%, 45.00%, 10.00%) with 0% transparency
ManaBeastAttack
  Events
    Unit - A unit Is attacked
  Conditions
    (Unit-type of (Attacking unit)) Equal to Mana Beast
  Actions
    Set VariableSet agroup = (Units in Platform <gen> matching (((Max mana of (Matching unit)) Greater than or equal to 5.00) and (((((Matching unit) is A structure) Equal to False) and (((((Matching unit) is alive) Equal to True) and ((Owner of (Matching unit)) Not equal to Player 12 (Brown))) and (((Owner of (Matching unit)) is an enemy of (Owner of (Attacking unit)).) Equal to True))) and ((Level of dummy dummy for (Matching unit)) Equal to 0))))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in agroup) Greater than or equal to 1
      Then - Actions
        Floating Text - Create floating text that reads Devour Magic above (Attacking unit) with Z offset 0, using font size 10, color (100%, 100.00%, 100.00%), and 0% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
        Unit Group - Pick every unit in agroup and do (Actions)
          Loop - Actions
            Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - 5.00)
            Unit - Cause (Attacking unit) to damage (Picked unit), dealing 10.00 damage of attack type Spells and damage type Normal
            Special Effect - Create a special effect attached to the chest (attachpoint) of (Picked unit) using Abilities\Spells\Human\ManaFlare\ManaFlareBoltImpact.mdl
            Special Effect - Destroy (Last created special effect)
      Else - Actions
        Do nothing
    Custom script: call DestroyGroup (udg_agroup)
MonsterBounty
  Events
    Unit - A unit Dies
  Conditions
    (Owner of (Triggering unit)) Equal to Player 12 (Brown)
  Actions
    Set VariableSet Monsterisalive = 0
    Set VariableSet anumber = (Random integer number between 150 and 300)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        ((Owner of (Killing unit)) controller) Equal to Computer
      Then - Actions
        Set VariableSet apoint = (Position of (Triggering unit))
        Player - Add anumber to PlayerTwin[(Player number of (Owner of (Killing unit)))].Current gold
        Floating Text - Create floating text that reads ((Name of PlayerTwin[(Player number of (Owner of (Killing unit)))]) + ( + + ((String(anumber)) + gold!))) at apoint with Z offset 0, using font size 15.00, color (100%, 100%, 0.00%), and 0% transparency
        Game - Display to (All players) the text: ((Name of PlayerTwin[(Player number of (Owner of (Killing unit)))]) + ( |cffffcc00+ + ((String(anumber)) + gold!|r)))
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 4.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
        Custom script: call RemoveLocation (udg_apoint)
        For each (Integer A) from 1 to 7, do (Actions)
          Loop - Actions
            Player - Add 1 to (Player((Integer A))).Current lumber
        Game - Display to (All players) the text: You gain |c0096FF96+1 lumber!|r
        Sound - Play QuestNew <gen>
      Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((Owner of (Killing unit)) controller) Equal to User
          Then - Actions
            Player - Add anumber to (Owner of (Killing unit)).Current gold
            Set VariableSet apoint = (Position of (Triggering unit))
            Floating Text - Create floating text that reads ((Name of (Owner of (Killing unit))) + ( + + ((String(anumber)) + gold!))) at apoint with Z offset 0, using font size 15.00, color (100%, 100%, 0.00%), and 0% transparency
            Game - Display to (All players) the text: ((Name of (Owner of (Killing unit))) + ( |cffffcc00+ + ((String(anumber)) + gold!|r)))
            Floating Text - Change (Last created floating text): Disable permanence
            Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
            Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
            Custom script: call RemoveLocation (udg_apoint)
            For each (Integer A) from 1 to 7, do (Actions)
              Loop - Actions
                Player - Add 1 to (Player((Integer A))).Current lumber
            Game - Display to (All players) the text: You gain |c0096FF96+1 lumber!|r
            Sound - Play QuestNew <gen>
          Else - Actions
            Do nothing
SpawnMonster
  Events
    Time - MonsterSpawnTimer expires
  Conditions
  Actions
    Set VariableSet agroup = (Units in Platform <gen> matching ((((Matching unit) is alive) Equal to True) and ((Owner of (Matching unit)) Equal to Player 12 (Brown))))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in agroup) Equal to 0
      Then - Actions
        Set VariableSet Monsterisalive = 1
        Sound - Play Reincarnation <gen>
        Set VariableSet apoint = (Random point in Platform <gen>)
        Unit - Create 1.MonsterType[(Random integer number between 1 and MonsterTypeNumber)] for Player 12 (Brown) at apoint facing (Random angle) degrees
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
        Game - Display to (All players) the text: (A |c006E4A24 + ((Name of (Last created unit)) + |r appears!))
        Special Effect - Destroy (Last created special effect)
        Custom script: call RemoveLocation (udg_apoint)
      Else - Actions
        Do nothing
    Custom script: call DestroyGroup (udg_agroup)
    Countdown Timer - Start MonsterSpawnTimer as a One-shot timer that will expire in 60.00 seconds
IncreaseSpawn
  Events
    Unit - A unit Finishes training a unit
  Conditions
    (Unit-type of (Triggering unit)) Equal to Spawner Increase
  Actions
    Set VariableSet IncreaseSpawn = (IncreaseSpawn + 1)
    Unit - Remove (Trained unit) from the game
SpawnerRetrain
  Events
    Unit - A unit Finishes training a unit
  Conditions
    (Unit-type of (Triggering unit)) Equal to Builder randomspawn
  Actions
    For each (Integer A) from 1 to 2, do (Actions)
      Loop - Actions
        Unit - Order (Triggering unit) to train/upgrade to a RandomSpawn 30
SpawnerIncreaseRetrain
  Events
    Unit - A unit Finishes training a unit
  Conditions
    (Unit-type of (Triggering unit)) Equal to Spawner Increase
  Actions
    For each (Integer A) from 1 to 2, do (Actions)
      Loop - Actions
        Unit - Order (Triggering unit) to train/upgrade to a IncreaseSpawn80
SpawnerGoldRetrain
  Events
    Unit - A unit Finishes training a unit
  Conditions
    (Unit-type of (Triggering unit)) Equal to Spawner Gold
  Actions
    For each (Integer A) from 1 to 2, do (Actions)
      Loop - Actions
        Unit - Order (Triggering unit) to train/upgrade to a GoldSpawn1
SpawnRedSet
  Events
  Conditions
  Actions
    Set VariableSet apoint = (Center of P1Build <gen>)
    Unit - Create 1.Builder randomspawn for Player 1 (Red) at apoint facing Default building facing degrees
    Set VariableSet Builder[1] = (Last created unit)
    Unit - Order (Last created unit) to train/upgrade to a RandomSpawn 30
    Set VariableSet anumber = (Random integer number between 1 and RandomSpawnTypeNumber)
    Unit - Create 1.RandomSpawnType[anumber] for Player 1 (Red) at apoint facing Default building facing degrees
    Game - Display to (All players) the text: (|c00FF0303North|r will train |c00FF9696 + ((Name of (Last created unit)) + |r))
    Unit - Remove (Last created unit) from the game
    Set VariableSet RandomUnitNorth = RandomSpawnType[anumber]
    Set VariableSet anumber = (Random integer number between 1 and RandomSummonTypeNumber)
    Unit - Create 1.RandomSummonType[anumber] for Player 1 (Red) at apoint facing Default building facing degrees
    Game - Display to (All players) the text: (|c00FF0303North|r will summon |c00FF9696 + ((Name of (Last created unit)) + |r))
    Unit - Remove (Last created unit) from the game
    Set VariableSet RandomSummonNorth = RandomSummonType[anumber]
    Custom script: call RemoveLocation (udg_apoint)
SpawnRed
  Events
    Unit - A unit Finishes training a unit
  Conditions
    (Owner of (Triggering unit)) Equal to Player 1 (Red)
    (Unit-type of (Triggering unit)) Equal to Builder randomspawn
  Actions
    For each (Integer A) from 1 to (1 + IncreaseSpawn), do (Actions)
      Loop - Actions
        Set VariableSet apoint = (Center of SpawnPoint[(Player number of (Owner of (Triggering unit)))])
        Unit - Create 1.RandomUnitNorth for Player 8 (Pink) at apoint facing (Random angle) degrees
        Unit - Change color of (Last created unit) to Red
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
        Special Effect - Destroy (Last created special effect)
        Custom script: call RemoveLocation (udg_apoint)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Mana of (Triggering unit)) Greater than or equal to 60.00
      Then - Actions
        Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) - 60.00)
        Set VariableSet apoint = (Center of SpawnPoint[(Player number of (Owner of (Triggering unit)))])
        Unit - Create 1.RandomSummonNorth for Player 8 (Pink) at apoint facing (Random angle) degrees
        Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( summons + (Name of (Last created unit))))
        Unit - Change color of (Last created unit) to Red
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
        Special Effect - Destroy (Last created special effect)
        Custom script: call RemoveLocation (udg_apoint)
      Else - Actions
        Do nothing
    Unit - Remove (Trained unit) from the game
SpawnBlueSet
  Events
  Conditions
  Actions
    Set VariableSet apoint = (Center of P2Build <gen>)
    Unit - Create 1.Builder randomspawn for Player 2 (Blue) at apoint facing Default building facing degrees
    Set VariableSet Builder[2] = (Last created unit)
    Unit - Order (Last created unit) to train/upgrade to a RandomSpawn 30
    Set VariableSet anumber = (Random integer number between 1 and RandomSpawnTypeNumber)
    Unit - Create 1.RandomSpawnType[anumber] for Player 2 (Blue) at apoint facing Default building facing degrees
    Game - Display to (All players) the text: (|c000042FFEast|r will train |c00FF9696 + ((Name of (Last created unit)) + |r))
    Unit - Remove (Last created unit) from the game
    Set VariableSet RandomUnitEast = RandomSpawnType[anumber]
    Set VariableSet anumber = (Random integer number between 1 and RandomSummonTypeNumber)
    Unit - Create 1.RandomSummonType[anumber] for Player 2 (Blue) at apoint facing Default building facing degrees
    Game - Display to (All players) the text: (|c000042FFEast|r will summon |c00FF9696 + ((Name of (Last created unit)) + |r))
    Unit - Remove (Last created unit) from the game
    Set VariableSet RandomSummonEast = RandomSummonType[anumber]
    Custom script: call RemoveLocation (udg_apoint)
SpawnBlue
  Events
    Unit - A unit Finishes training a unit
  Conditions
    (Owner of (Triggering unit)) Equal to Player 2 (Blue)
    (Unit-type of (Triggering unit)) Equal to Builder randomspawn
  Actions
    For each (Integer A) from 1 to (1 + IncreaseSpawn), do (Actions)
      Loop - Actions
        Set VariableSet apoint = (Center of SpawnPoint[(Player number of (Owner of (Triggering unit)))])
        Unit - Create 1.RandomUnitEast for Player 3 (Teal) at apoint facing (Random angle) degrees
        Unit - Change color of (Last created unit) to Blue
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
        Special Effect - Destroy (Last created special effect)
        Custom script: call RemoveLocation (udg_apoint)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Mana of (Triggering unit)) Greater than or equal to 60.00
      Then - Actions
        Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) - 60.00)
        Set VariableSet apoint = (Center of SpawnPoint[(Player number of (Owner of (Triggering unit)))])
        Unit - Create 1.RandomSummonEast for Player 3 (Teal) at apoint facing (Random angle) degrees
        Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( summons + (Name of (Last created unit))))
        Unit - Change color of (Last created unit) to Blue
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
        Special Effect - Destroy (Last created special effect)
        Custom script: call RemoveLocation (udg_apoint)
      Else - Actions
        Do nothing
    Unit - Remove (Trained unit) from the game
SpawnYellowSet
  Events
  Conditions
  Actions
    Set VariableSet apoint = (Center of P4Build <gen>)
    Unit - Create 1.Builder randomspawn for Player 5 (Yellow) at apoint facing Default building facing degrees
    Set VariableSet Builder[5] = (Last created unit)
    Unit - Order (Last created unit) to train/upgrade to a RandomSpawn 30
    Set VariableSet anumber = (Random integer number between 1 and RandomSpawnTypeNumber)
    Unit - Create 1.RandomSpawnType[anumber] for Player 5 (Yellow) at apoint facing Default building facing degrees
    Game - Display to (All players) the text: (|c00FFFC01West|r will train |c00FF9696 + ((Name of (Last created unit)) + |r))
    Unit - Remove (Last created unit) from the game
    Set VariableSet RandomUnitWest = RandomSpawnType[anumber]
    Set VariableSet anumber = (Random integer number between 1 and RandomSummonTypeNumber)
    Unit - Create 1.RandomSummonType[anumber] for Player 5 (Yellow) at apoint facing Default building facing degrees
    Game - Display to (All players) the text: (|c00FFFC01West|r will summon |c00FF9696 + ((Name of (Last created unit)) + |r))
    Unit - Remove (Last created unit) from the game
    Set VariableSet RandomSummonWest = RandomSummonType[anumber]
    Custom script: call RemoveLocation (udg_apoint)
SpawnYellow
  Events
    Unit - A unit Finishes training a unit
  Conditions
    (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
    (Unit-type of (Triggering unit)) Equal to Builder randomspawn
  Actions
    For each (Integer A) from 1 to (1 + IncreaseSpawn), do (Actions)
      Loop - Actions
        Set VariableSet apoint = (Center of SpawnPoint[(Player number of (Owner of (Triggering unit)))])
        Unit - Create 1.RandomUnitWest for Player 6 (Orange) at apoint facing (Random angle) degrees
        Unit - Change color of (Last created unit) to Yellow
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
        Special Effect - Destroy (Last created special effect)
        Custom script: call RemoveLocation (udg_apoint)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Mana of (Triggering unit)) Greater than or equal to 60.00
      Then - Actions
        Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) - 60.00)
        Set VariableSet apoint = (Center of SpawnPoint[(Player number of (Owner of (Triggering unit)))])
        Unit - Create 1.RandomSummonWest for Player 6 (Orange) at apoint facing (Random angle) degrees
        Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( summons + (Name of (Last created unit))))
        Unit - Change color of (Last created unit) to Yellow
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
        Special Effect - Destroy (Last created special effect)
        Custom script: call RemoveLocation (udg_apoint)
      Else - Actions
        Do nothing
    Unit - Remove (Trained unit) from the game
SpawnGreenSet
  Events
  Conditions
  Actions
    Set VariableSet apoint = (Center of P3Build <gen>)
    Unit - Create 1.Builder randomspawn for Player 7 (Green) at apoint facing Default building facing degrees
    Set VariableSet Builder[7] = (Last created unit)
    Unit - Order (Last created unit) to train/upgrade to a RandomSpawn 30
    Set VariableSet anumber = (Random integer number between 1 and RandomSpawnTypeNumber)
    Unit - Create 1.RandomSpawnType[anumber] for Player 7 (Green) at apoint facing Default building facing degrees
    Game - Display to (All players) the text: (|c0020C000South|r will train |c00FF9696 + ((Name of (Last created unit)) + |r))
    Unit - Remove (Last created unit) from the game
    Set VariableSet RandomUnitSouth = RandomSpawnType[anumber]
    Set VariableSet anumber = (Random integer number between 1 and RandomSummonTypeNumber)
    Unit - Create 1.RandomSummonType[anumber] for Player 7 (Green) at apoint facing Default building facing degrees
    Game - Display to (All players) the text: (|c0020C000South|r will summon |c00FF9696 + ((Name of (Last created unit)) + |r))
    Unit - Remove (Last created unit) from the game
    Set VariableSet RandomSummonSouth = RandomSummonType[anumber]
    Custom script: call RemoveLocation (udg_apoint)
SpawnGreen
  Events
    Unit - A unit Finishes training a unit
  Conditions
    (Owner of (Triggering unit)) Equal to Player 7 (Green)
    (Unit-type of (Triggering unit)) Equal to Builder randomspawn
  Actions
    For each (Integer A) from 1 to (1 + IncreaseSpawn), do (Actions)
      Loop - Actions
        Set VariableSet apoint = (Center of SpawnPoint[(Player number of (Owner of (Triggering unit)))])
        Unit - Create 1.RandomUnitSouth for Player 11 (Dark Green) at apoint facing (Random angle) degrees
        Unit - Change color of (Last created unit) to Green
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
        Special Effect - Destroy (Last created special effect)
        Custom script: call RemoveLocation (udg_apoint)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Mana of (Triggering unit)) Greater than or equal to 60.00
      Then - Actions
        Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) - 60.00)
        Set VariableSet apoint = (Center of SpawnPoint[(Player number of (Owner of (Triggering unit)))])
        Unit - Create 1.RandomSummonSouth for Player 11 (Dark Green) at apoint facing (Random angle) degrees
        Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( summons + (Name of (Last created unit))))
        Unit - Change color of (Last created unit) to Green
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
        Special Effect - Destroy (Last created special effect)
        Custom script: call RemoveLocation (udg_apoint)
      Else - Actions
        Do nothing
    Unit - Remove (Trained unit) from the game
FireTowerRetrain
  Events
    Unit - A unit Finishes training a unit
  Conditions
    (Unit-type of (Triggering unit)) Equal to Fire Tower custom
  Actions
    For each (Integer A) from 1 to 2, do (Actions)
      Loop - Actions
        Unit - Order (Triggering unit) to train/upgrade to a Fireball custom
FireTowerConstruction
  Events
    Unit - A unit Finishes construction
  Conditions
    (Unit-type of (Triggering unit)) Equal to Fire Tower custom
  Actions
    Hero - Create Apocalypse and give it to Builder[(Player number of (Owner of (Triggering unit)))]
    For each (Integer A) from 1 to 2, do (Actions)
      Loop - Actions
        Unit - Order (Triggering unit) to train/upgrade to a Fireball custom
LightningTowerRetrain
  Events
    Unit - A unit Finishes training a unit
  Conditions
    (Unit-type of (Triggering unit)) Equal to Lightning Tower custom
  Actions
    For each (Integer A) from 1 to 2, do (Actions)
      Loop - Actions
        Unit - Order (Triggering unit) to train/upgrade to a Lightning Bolt custom
LightningTowerConstruction
  Events
    Unit - A unit Finishes construction
  Conditions
    (Unit-type of (Triggering unit)) Equal to Lightning Tower custom
  Actions
    For each (Integer A) from 1 to 2, do (Actions)
      Loop - Actions
        Unit - Order (Triggering unit) to train/upgrade to a Lightning Bolt custom
BuildSound
  Events
    Unit - A unit Finishes construction
  Conditions
  Actions
    Sound - Play GoodJob <gen>
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( builds a|cffffcc00 + ((Name of (Triggering unit)) + |r)))
UnitTypeLimit
  Events
    Unit - A unit enters Platform <gen>
  Conditions
    ((Owner of (Triggering unit)) controller) Equal to Computer
    (Level of dummy dummy for (Triggering unit)) Equal to 0
  Actions
    Set VariableSet agroup = (Units in Platform <gen> matching (((Unit-type of (Matching unit)) Equal to (Unit-type of (Triggering unit))) and ((((Matching unit) is alive) Equal to True) and (((Owner of (Triggering unit)) Equal to (Owner of (Matching unit))) and (((Matching unit) is A structure) Equal to False)))))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in agroup) Greater than or equal to 30
      Then - Actions
        Set VariableSet aunit = (Triggering unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (UnitTypeLimitMessage <gen> is on) Equal to True
          Then - Actions
            Trigger - Run UnitTypeLimitMessage <gen> (checking conditions)
          Else - Actions
            Do nothing
        Unit - Remove (Triggering unit) from the game
      Else - Actions
        Do nothing
    Custom script: call DestroyGroup (udg_agroup)
UnitTypeLimitMessage
  Events
  Conditions
  Actions
    Game - Display to (All players) the text: (|c00540081 + ((Name of aunit) + limit reached!|r))
    Trigger - Turn off (This trigger)
    Wait 1.00 seconds
    Trigger - Turn on (This trigger)
UniversalRetrain
  Events
    Unit - A unit Finishes training a unit
  Conditions
    (Triggering unit) Not equal to Tower[(Player number of (Owner of (Triggering unit)))]
  Actions
    For each (Integer A) from 1 to 2, do (Actions)
      Loop - Actions
        Unit - Order (Triggering unit) to train/upgrade to a (Unit-type of (Trained unit))
PickUpDropArtifact
  Events
    Unit - A unit Acquires an item
  Conditions
    (Triggering unit) Equal to Builder[(Player number of (Owner of (Triggering unit)))]
    (Item-class of (Item being manipulated)) Equal to Artifact
  Actions
    Hero - Drop (Item being manipulated) from (Triggering unit).
    Set VariableSet apoint = (Center of SpawnPoint[(Player number of (Owner of (Hero manipulating item)))])
    Item - Move (Item being manipulated) to apoint
    Custom script: call RemoveLocation (udg_apoint)
UnitEnterWrongRegion
  Events
    Unit - A unit enters (Playable map area)
  Conditions
    ((Owner of (Triggering unit)) controller) Equal to Computer
    (Platform <gen> contains (Triggering unit)) Equal to False
  Actions
    Unit - Remove (Triggering unit) from the game
UseItemSound
  Events
    Unit - A unit Uses an item
  Conditions
  Actions
    Sound - Play HealingSprayDeath1 <gen>
IllusoryDeathRemove
  Events
    Unit - A unit Dies
  Conditions
    Or - Any (Conditions) are true
      Conditions
        (Unit-type of (Triggering unit)) Equal to Illusion custom
        (Unit-type of (Triggering unit)) Equal to Wendigo
  Actions
    Set VariableSet apoint = (Position of (Dying unit))
    Special Effect - Create a special effect attached to the chest (attachpoint) of (Dying unit) using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
    Special Effect - Destroy (Last created special effect)
    Custom script: call RemoveLocation (udg_apoint)
BuildingDeathRemovie
  Events
    Unit - A unit 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 (Triggering unit)) Equal to Sacred Torch custom
            (Unit-type of (Triggering unit)) Equal to King's Monument custom
            (Unit-type of (Triggering unit)) Equal to Campfire custom
            (Unit-type of (Triggering unit)) Equal to Cursed Manor custom
            (Unit-type of (Triggering unit)) Equal to Fountain of Blood custom
            (Unit-type of (Triggering unit)) Equal to Impaled Corpse custom
            (Unit-type of (Triggering unit)) Equal to Castle Ruins custom
      Then - Actions
        Set VariableSet apoint = (Position of (Dying unit))
        Special Effect - Create a special effect at apoint using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
        Special Effect - Destroy (Last created special effect)
        Custom script: call RemoveLocation (udg_apoint)
        Unit - Remove (Dying unit) from the game
      Else - Actions
        Do nothing
    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 Skull Torch custom
            (Unit-type of (Triggering unit)) Equal to Cursed Grave custom
            (Unit-type of (Triggering unit)) Equal to Plague Stone custom
            (Unit-type of (Triggering unit)) Equal to Slab custom
      Then - Actions
        Set VariableSet apoint = (Position of (Dying unit))
        Special Effect - Create a special effect at apoint using Objects\Spawnmodels\Undead\UDeathSmall\UDeathSmall.mdl
        Special Effect - Destroy (Last created special effect)
        Custom script: call RemoveLocation (udg_apoint)
        Unit - Remove (Dying unit) from the game
      Else - Actions
        Do nothing
    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 Strangling Fruit (smaller)
            (Unit-type of (Triggering unit)) Equal to Strangling Fruit custom
            (Unit-type of (Triggering unit)) Equal to Starblossom custom
            (Unit-type of (Triggering unit)) Equal to Briars custom
            (Unit-type of (Triggering unit)) Equal to Undergrowth custom
            (Unit-type of (Triggering unit)) Equal to Monolith
      Then - Actions
        Set VariableSet apoint = (Position of (Dying unit))
        Special Effect - Create a special effect at apoint using Objects\Spawnmodels\NightElf\NEDeathSmall\NEDeathSmall.mdl
        Special Effect - Destroy (Last created special effect)
        Custom script: call RemoveLocation (udg_apoint)
        Unit - Remove (Dying unit) from the game
      Else - Actions
        Do nothing
    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 Ice custom
            (Unit-type of (Triggering unit)) Equal to Cold Throne custom
            (Unit-type of (Triggering unit)) Equal to Glacier custom
            (Unit-type of (Triggering unit)) Equal to Igloo custom
      Then - Actions
        Set VariableSet apoint = (Position of (Dying unit))
        Special Effect - Create a special effect at apoint using Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl
        Special Effect - Destroy (Last created special effect)
        Custom script: call RemoveLocation (udg_apoint)
        Unit - Remove (Dying unit) from the game
      Else - Actions
        Do nothing
DummyDie
  Events
    Unit - A unit Dies
  Conditions
    (Level of dummy dummy for (Triggering unit)) Equal to 1
  Actions
    Unit - Remove (Triggering unit) from the game
AviaryRestore
  Events
    Unit - A unit Finishes construction
  Conditions
    (Unit-type of Builder[(Player number of (Owner of (Triggering unit)))]) Equal to Dwarf
  Actions
    Set VariableSet apoint = (Position of (Triggering unit))
    Set VariableSet agroup = (Units within 200.00 of apoint matching ((((Matching unit) is alive) Equal to True) and (((Unit-type of (Matching unit)) Equal to Aviary custom) and ((Owner of (Triggering unit)) Equal to (Owner of (Matching unit))))).)
    Set VariableSet anumber = (Number of units in agroup)
    Custom script: call RemoveLocation (udg_apoint)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        anumber Greater than or equal to 1
      Then - Actions
        Set VariableSet bnumber = (15 x anumber)
        Set VariableSet cnumber = (anumber x 25)
        Set VariableSet dnumber = (anumber x 40)
        Unit - Set mana of Builder[(Player number of (Owner of (Triggering unit)))] to ((Mana of Builder[(Player number of (Owner of (Triggering unit)))]) + (Real(bnumber)))
        Floating Text - Create floating text that reads (+ + (String(bnumber))) above Tower[(Player number of (Owner of (Triggering unit)))] with Z offset 0, using font size 10, color (0.00%, 25.00%, 100.00%), and 0% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
        Game - Display to (Player group((Owner of (Triggering unit)))) the text: (You gain |c006969FF+ + ((String(bnumber)) + mana!|r))
        Player - Add cnumber to (Owner of (Triggering unit)).Current gold
        Floating Text - Create floating text that reads (+ + (String(cnumber))) above Tower[(Player number of (Owner of (Triggering unit)))] with Z offset 50.00, using font size 10, color (100.00%, 100.00%, 0.00%), and 0% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
        Game - Display to (Player group((Owner of (Triggering unit)))) the text: (You gain |cffffcc00+ + ((String(cnumber)) + gold!|r))
        Unit - Set life of Tower[(Player number of (Owner of (Triggering unit)))] to ((Life of Tower[(Player number of (Owner of (Triggering unit)))]) + (Real(dnumber)))
        Floating Text - Create floating text that reads (+ + (String(dnumber))) above Tower[(Player number of (Owner of (Triggering unit)))] with Z offset -50.00, using font size 10, color (25.00%, 100.00%, 25.00%), and 0% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
      Else - Actions
        Do nothing
    Custom script: call DestroyGroup (udg_agroup)
MountainKingAttack
  Events
    Unit - A unit Is attacked
  Conditions
    (Unit-type of (Attacking unit)) Equal to Mountain King custom
    (Mana of (Attacking unit)) Greater than or equal to 5.00
  Actions
    Unit - Set mana of (Attacking unit) to ((Mana of (Attacking unit)) - 5.00)
    Floating Text - Create floating text that reads Thunder Clap above (Attacking unit) with Z offset 0, using font size 10, color (50.00%, 50.00%, 100.00%), and 0% transparency
    Floating Text - Change (Last created floating text): Disable permanence
    Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
    Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
    Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
    Special Effect - Create a special effect attached to the chest (attachpoint) of (Attacking unit) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
    Special Effect - Destroy (Last created special effect)
    Set VariableSet apoint = (Position of (Attacking unit))
    Set VariableSet agroup = (Units within 300.00 of apoint matching ((((Matching unit) is alive) Equal to True) and (((Owner of (Matching unit)) is an enemy of (Owner of (Attacking unit)).) Equal to True)).)
    Unit Group - Pick every unit in agroup and do (Actions)
      Loop - Actions
        Unit - Cause (Attacking unit) to damage (Picked unit), dealing 7.00 damage of attack type Spells and damage type Normal
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Picked unit) using Abilities\Weapons\Bolt\BoltImpact.mdl
        Special Effect - Destroy (Last created special effect)
    Custom script: call DestroyGroup (udg_agroup)
    Custom script: call RemoveLocation (udg_apoint)
AviaryCast
  Events
    Unit - A unit Uses an item
  Conditions
    (Unit-type of (Triggering unit)) Equal to Dwarf
  Actions
    Set VariableSet agroup = (Units owned by (Owner of (Triggering unit)) matching ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Equal to Aviary custom)).)
    Set VariableSet anumber = (Number of units in agroup)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        anumber Greater than or equal to 1
      Then - Actions
        For each (Integer A) from 1 to anumber, do (Actions)
          Loop - Actions
            Set VariableSet bgroup = (Units in Platform <gen> matching ((((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit)).) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Level of dummy dummy for (Matching unit)) Equal to 0) and (((Matching unit) is A structure) Equal to False)))))
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Number of units in bgroup) Greater than or equal to 1
              Then - Actions
                Set VariableSet aunit = (Random unit from bgroup)
                Unit - Cause Builder[(Player number of (Owner of (Triggering unit)))] to damage aunit, dealing 14.00 damage of attack type Spells and damage type Normal
                Special Effect - Create a special effect attached to the chest (attachpoint) of aunit using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
                Special Effect - Destroy (Last created special effect)
                Floating Text - Create floating text that reads Lightning above aunit with Z offset 0, using font size 10, color (50.00%, 50.00%, 100.00%), and 0% transparency
                Floating Text - Change (Last created floating text): Disable permanence
                Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
                Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
                Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
              Else - Actions
                Do nothing
            Custom script: call DestroyGroup (udg_agroup)
      Else - Actions
        Do nothing
    Custom script: call DestroyGroup (udg_agroup)
CastInebriate
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Revelry custom
  Actions
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( casts |c007EBFF1 + ((Name of (Ability being cast)) + |r)))
    Set VariableSet agroup = (Units in Platform <gen> matching ((((Matching unit) has buff Drunken Haze) Equal to False) and (((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit)).) Equal to True))) and ((Level of dummy dummy for (Matching unit)) Equal to 0))))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in agroup) Greater than or equal to 1
      Then - Actions
        Set VariableSet aunit = (Random unit from agroup)
        Set VariableSet apoint = (Position of aunit)
        Unit - Create 1.Inebriate dummy for (Owner of (Triggering unit)) at apoint facing Default building facing degrees
        Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
        Unit - Order (Last created unit) to Neutral Brewmaster - Drunken Haze.aunit
        Floating Text - Create floating text that reads Inebriate above aunit with Z offset 0, using font size 10, color (100.00%, 100.00%, 50.00%), and 0% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
        Custom script: call RemoveLocation (udg_apoint)
      Else - Actions
        Game - Display to (All players) the text: It fizzles...
    Custom script: call DestroyGroup (udg_agroup)
CastRevelry
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Revelry custom
  Actions
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( casts |c007EBFF1 + ((Name of (Ability being cast)) + |r)))
    Set VariableSet agroup = (Units in Platform <gen> matching ((((Owner of (Matching unit)) is an ally of (Owner of (Triggering unit)).) Equal to True) and (((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is A structure) Equal to False))) and ((Level of dummy dummy for (Matching unit)) Equal to 0))))
    Unit Group - Pick every unit in agroup and do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Level of +8 life for (Picked unit)) Equal to 0
          Then - Actions
            Unit - Add +8 life to (Picked unit)
            Unit - Add -2 armor to (Picked unit)
            Special Effect - Create a special effect attached to the chest (attachpoint) of (Picked unit) using Abilities\Spells\Human\Avatar\AvatarCaster.mdl
            Special Effect - Destroy (Last created special effect)
          Else - Actions
            Do nothing
    Custom script: call DestroyGroup (udg_agroup)
CastCarpentry
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Carpentry
  Actions
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( casts |c007EBFF1 + ((Name of (Ability being cast)) + |r)))
    Floating Text - Create floating text that reads +200 above Tower[(Player number of (Owner of (Triggering unit)))] with Z offset 0, using font size 10, color (25.00%, 100.00%, 25.00%), and 0% transparency
    Floating Text - Change (Last created floating text): Disable permanence
    Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
    Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
    Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
    Unit - Set life of Tower[(Player number of (Owner of (Triggering unit)))] to ((Life of Tower[(Player number of (Owner of (Triggering unit)))]) + 200.00)
    Special Effect - Create a special effect attached to the sprite (attachpoint) of Tower[(Player number of (Owner of (Triggering unit)))] using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
    Special Effect - Destroy (Last created special effect)
CastThunder
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Thunder
  Actions
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( casts |c007EBFF1 + ((Name of (Ability being cast)) + |r)))
    Set VariableSet agroup = (Units in Platform <gen> matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Level of dummy dummy for (Matching unit)) Equal to 0) and (((Matching unit) is A structure) Equal to False)))))
    Unit Group - Pick every unit in agroup and do (Actions)
      Loop - Actions
        Unit - Cause (Casting unit) to damage (Picked unit), dealing 14.00 damage of attack type Spells and damage type Normal
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Picked unit) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
        Special Effect - Destroy (Last created special effect)
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Picked unit) using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
        Special Effect - Destroy (Last created special effect)
    Custom script: call DestroyGroup (udg_agroup)
    Set VariableSet aunit = Tower[(Player number of (Owner of (Triggering unit)))]
    Unit - Cause (Casting unit) to damage aunit, dealing 60.00 damage of attack type Spells and damage type Normal
    Game - Display to (Player group((Owner of (Triggering unit)))) the text: |c00FF9696Your Base takes 60 damage!|r
    Special Effect - Create a special effect attached to the sprite (attachpoint) of aunit using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
    Special Effect - Destroy (Last created special effect)
CastSnipe
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Snipe custom
  Actions
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( casts |c007EBFF1 + ((Name of (Ability being cast)) + |r)))
    Set VariableSet agroup = (Units in Platform <gen> matching ((((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit)).) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Level of dummy dummy for (Matching unit)) Equal to 0) and (((Matching unit) is A structure) Equal to False)))))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in agroup) Greater than or equal to 1
      Then - Actions
        Set VariableSet aunit = (Random unit from agroup)
        Floating Text - Create floating text that reads Snipe above aunit with Z offset 0, using font size 10, color (100.00%, 100.00%, 50.00%), and 0% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
        Set VariableSet bgroup = (Units owned by (Owner of (Triggering unit)) of type Rifle Fort custom)
        Set VariableSet anumber = ((Number of units in bgroup) x 5)
        Set VariableSet anumber = (anumber + 5)
        Custom script: call DestroyGroup (udg_bgroup)
        Unit - Cause (Triggering unit) to damage aunit, dealing (Real(anumber)) damage of attack type Spells and damage type Normal
        Special Effect - Create a special effect attached to the chest (attachpoint) of aunit using Abilities\Weapons\Rifle\RifleImpact.mdl
        Special Effect - Destroy (Last created special effect)
        Special Effect - Create a special effect attached to the chest (attachpoint) of aunit using Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
        Special Effect - Destroy (Last created special effect)
      Else - Actions
        Game - Display to (All players) the text: It fizzles...
    Custom script: call DestroyGroup (udg_agroup)
CastShatter
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Shatter
  Actions
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( casts |c007EBFF1 + ((Name of (Ability being cast)) + |r)))
    Set VariableSet agroup = (Units in Platform <gen> matching ((((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit)).) Equal to True) and (((((Matching unit) is alive) Equal to True) and (((Matching unit) is Mechanical) Equal to True)) and (((Level of dummy dummy for (Matching unit)) Equal to 0) and (((Matching unit) is A structure) Equal to False)))))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in agroup) Greater than or equal to 1
      Then - Actions
        Set VariableSet aunit = (Random unit from agroup)
        Floating Text - Create floating text that reads Shatter above aunit with Z offset 0, using font size 10, color (50.00%, 50.00%, 100.00%), and 0% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
        Unit - Cause (Triggering unit) to damage aunit, dealing 1000000000.00 damage of attack type Spells and damage type Normal
        Special Effect - Create a special effect attached to the chest (attachpoint) of aunit using Abilities\Spells\Orc\Purge\PurgeBuffTarget.mdl
        Special Effect - Destroy (Last created special effect)
        Special Effect - Create a special effect attached to the chest (attachpoint) of aunit using Abilities\Weapons\Bolt\BoltImpact.mdl
        Special Effect - Destroy (Last created special effect)
      Else - Actions
        Set VariableSet bgroup = (Units in Platform <gen> matching ((((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit)).) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is A structure) Equal to True))))
        Set VariableSet aunit = (Random unit from bgroup)
        Game - Display to (Player group((Owner of aunit))) the text: |c00FF9696Your Base takes 15 damage!|r
        Unit - Cause (Triggering unit) to damage aunit, dealing 15.00 damage of attack type Spells and damage type Normal
        Special Effect - Create a special effect attached to the sprite (attachpoint) of aunit using Abilities\Spells\Orc\Purge\PurgeBuffTarget.mdl
        Special Effect - Destroy (Last created special effect)
        Special Effect - Create a special effect attached to the sprite (attachpoint) of aunit using Abilities\Weapons\Bolt\BoltImpact.mdl
        Special Effect - Destroy (Last created special effect)
        Floating Text - Create floating text that reads Shatter: 15 above aunit with Z offset 0, using font size 10, color (50.00%, 50.00%, 100.00%), and 0% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
        Custom script: call DestroyGroup (udg_bgroup)
    Custom script: call DestroyGroup (udg_agroup)
CastStormRider
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Storm Rider
  Actions
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( casts |c007EBFF1 + ((Name of (Ability being cast)) + |r)))
    Set VariableSet apoint = (Center of SpawnPoint[(Player number of (Owner of (Triggering unit)))])
    Unit - Create 1.Storm Rider for ComputerTwin[(Player number of (Owner of (Triggering unit)))] at apoint facing (Random angle) degrees
    Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
    Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\Orc\Purge\PurgeBuffTarget.mdl
    Special Effect - Destroy (Last created special effect)
    Custom script: call RemoveLocation (udg_apoint)
CastSummonMortarTeam
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Siege Gang custom
  Actions
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( casts |c007EBFF1 + ((Name of (Ability being cast)) + |r)))
    Set VariableSet apoint = (Center of SpawnPoint[(Player number of (Owner of (Triggering unit)))])
    Unit - Create 1.Mortar Team for ComputerTwin[(Player number of (Owner of (Triggering unit)))] at apoint facing (Random angle) degrees
    Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
    Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\Human\Flare\FlareCaster.mdl
    Special Effect - Destroy (Last created special effect)
    Custom script: call RemoveLocation (udg_apoint)
LumberMillConstruct
  Events
    Unit - A unit Finishes construction
  Conditions
    (Unit-type of (Triggering unit)) Equal to Dwarven Mill custom
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of items carried by Builder[(Player number of (Owner of (Triggering unit)))]) Less than 6
      Then - Actions
        Hero - Create Carpentry and give it to Builder[(Player number of (Owner of (Triggering unit)))]
      Else - Actions
        Item - Set charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Carpentry) to ((Charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Carpentry)) + 2)
    For each (Integer A) from 1 to 2, do (Actions)
      Loop - Actions
        Unit - Order (Triggering unit) to train/upgrade to a Gold market
StormCageConstruct
  Events
    Unit - A unit Finishes construction
  Conditions
    (Unit-type of (Triggering unit)) Equal to Storm Cage custom
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of items carried by Builder[(Player number of (Owner of (Triggering unit)))]) Less than 6
      Then - Actions
        Hero - Create Thunder and give it to Builder[(Player number of (Owner of (Triggering unit)))]
      Else - Actions
        Item - Set charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Thunder) to ((Charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Thunder)) + 3)
    For each (Integer A) from 1 to 2, do (Actions)
      Loop - Actions
        Unit - Order (Triggering unit) to train/upgrade to a Mana altar
MonumentConstruct
  Events
    Unit - A unit Finishes construction
  Conditions
    (Unit-type of (Triggering unit)) Equal to King's Monument custom
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of items carried by Builder[(Player number of (Owner of (Triggering unit)))]) Less than 6
      Then - Actions
        Hero - Create Shatter and give it to Builder[(Player number of (Owner of (Triggering unit)))]
      Else - Actions
        Item - Set charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Shatter) to ((Charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Shatter)) + 6)
    For each (Integer A) from 1 to 2, do (Actions)
      Loop - Actions
        Unit - Order (Triggering unit) to train/upgrade to a Mountain King custom
RifleFortConstruct
  Events
    Unit - A unit Finishes construction
  Conditions
    (Unit-type of (Triggering unit)) Equal to Rifle Fort custom
  Actions
    Set VariableSet apoint = (Position of (Triggering unit))
    Set VariableSet agroup = (Units within 200.00 of apoint matching (((Unit-type of (Matching unit)) Equal to Rifle Fort custom) and (((Matching unit) is alive) Equal to True)).)
    Unit Group - Pick every unit in agroup and do (Actions)
      Loop - Actions
        Set VariableSet cpoint = (Center of SpawnPoint[(Player number of (Owner of (Triggering unit)))])
        Unit - Create 1.Rifleman for ComputerTwin[(Player number of (Owner of (Triggering unit)))] at cpoint facing (Random angle) degrees
        Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
        Custom script: call RemoveLocation (udg_cpoint)
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\Human\Avatar\AvatarCaster.mdl
        Special Effect - Destroy (Last created special effect)
        Special Effect - Create a special effect attached to the sprite (attachpoint) of (Picked unit) using Abilities\Spells\Human\Avatar\AvatarCaster.mdl
        Special Effect - Destroy (Last created special effect)
    Custom script: call RemoveLocation (udg_apoint)
    Custom script: call DestroyGroup (udg_agroup)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of items carried by Builder[(Player number of (Owner of (Triggering unit)))]) Less than 6
      Then - Actions
        Hero - Create Snipe and give it to Builder[(Player number of (Owner of (Triggering unit)))]
      Else - Actions
        Item - Set charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Snipe) to ((Charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Snipe)) + 4)
    For each (Integer A) from 1 to 2, do (Actions)
      Loop - Actions
        Unit - Order (Triggering unit) to train/upgrade to a Rifleman
AviaryConstruct
  Events
    Unit - A unit Finishes construction
  Conditions
    (Unit-type of (Triggering unit)) Equal to Aviary custom
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of items carried by Builder[(Player number of (Owner of (Triggering unit)))]) Less than 6
      Then - Actions
        Hero - Create Storm Rider and give it to Builder[(Player number of (Owner of (Triggering unit)))]
      Else - Actions
        Item - Set charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Storm Rider) to ((Charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Storm Rider)) + 1)
MunitionsConstruct
  Events
    Unit - A unit Finishes construction
  Conditions
    (Unit-type of (Triggering unit)) Equal to Munitions custom
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of items carried by Builder[(Player number of (Owner of (Triggering unit)))]) Less than 6
      Then - Actions
        Hero - Create Siege Gang and give it to Builder[(Player number of (Owner of (Triggering unit)))]
      Else - Actions
        Item - Set charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Siege Gang) to ((Charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Siege Gang)) + 1)
    Set VariableSet apoint = (Position of (Triggering unit))
    Set VariableSet agroup = (Units within 200.00 of apoint matching (((Matching unit) is A structure) Equal to True).)
    Unit Group - Pick every unit in agroup and do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Level of Not A Training Building for self for (Picked unit)) Equal to 0
            (Level of Munitions for (Picked unit)) Equal to 0
          Then - Actions
            Unit - Add Munitions to (Picked unit)
            Special Effect - Create a special effect attached to the base (attachpoint) of (Picked unit) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
            Special Effect - Destroy (Last created special effect)
          Else - Actions
            Do nothing
    Custom script: call DestroyGroup (udg_agroup)
    Custom script: call RemoveLocation (udg_apoint)
MunitionsCheck
  Events
    Unit - A unit Finishes construction
  Conditions
    (Unit-type of Builder[(Player number of (Owner of (Triggering unit)))]) Equal to Dwarf
  Actions
    Set VariableSet apoint = (Position of (Triggering unit))
    Set VariableSet agroup = (Units within 200.00 of apoint matching ((Unit-type of (Matching unit)) Equal to Munitions custom).)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of Not A Training Building for self for (Triggering unit)) Equal to 0
        (Number of units in agroup) Greater than or equal to 1
      Then - Actions
        Unit - Add Munitions to (Triggering unit)
        Special Effect - Create a special effect attached to the base (attachpoint) of (Triggering unit) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
        Special Effect - Destroy (Last created special effect)
      Else - Actions
        Do nothing
    Custom script: call DestroyGroup (udg_agroup)
    Custom script: call RemoveLocation (udg_apoint)
TrainRifleman
  Events
    Unit - A unit Finishes training a unit
  Conditions
    (Unit-type of (Trained unit)) Equal to Rifleman
  Actions
    Set VariableSet bunit = (Triggering unit)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of Munitions for bunit) Equal to 1
      Then - Actions
        Set VariableSet apoint = (Position of bunit)
        Set VariableSet agroup = (Units within 200.00 of apoint matching ((Unit-type of (Matching unit)) Equal to Munitions custom).)
        Unit Group - Pick every unit in agroup and do (Actions)
          Loop - Actions
            Special Effect - Create a special effect attached to the sprite (attachpoint) of (Picked unit) using Abilities\Spells\Human\Flare\FlareCaster.mdl
            Special Effect - Destroy (Last created special effect)
        Set VariableSet AcNumber = (Number of units in agroup)
        Custom script: call RemoveLocation (udg_apoint)
        Custom script: call DestroyGroup (udg_agroup)
        For each (Integer B) from 1 to AcNumber, do (Actions)
          Loop - Actions
            Set VariableSet agroup = (Units in Platform <gen> matching ((((Matching unit) is alive) Equal to True) and (((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit)).) Equal to True))) and ((Level of dummy dummy for (Matching unit)) Equal to 0))))
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Number of units in agroup) Greater than or equal to 1
              Then - Actions
                Set VariableSet aunit = (Random unit from agroup)
                Set VariableSet apoint = (Position of aunit)
                Set VariableSet BaseDamageUnit = (Trained unit)
                Set VariableSet BaseDamageCalc = ((Base Damage of BaseDamageUnit for weapon index 0) + ((Dice Sides of BaseDamageUnit for weapon index 0) / 2))
                Set VariableSet areal = (Real((BaseDamageCalc + 1)))
                Unit - Cause Builder[(Player number of (Owner of (Triggering unit)))] to damage circular area after 0 seconds of radius 200.00 at apoint, dealing areal damage of attack type Spells and damage type Normal
                Special Effect - Create a special effect attached to the chest (attachpoint) of aunit using Abilities\Weapons\Mortar\MortarMissile.mdl
                Special Effect - Destroy (Last created special effect)
                Floating Text - Create floating text that reads Mortar above aunit with Z offset 0, using font size 10, color (100.00%, 75.00%, 25.00%), and 0% transparency
                Floating Text - Change (Last created floating text): Disable permanence
                Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
                Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
                Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
                Custom script: call RemoveLocation (udg_apoint)
              Else - Actions
                Do nothing
            Custom script: call DestroyGroup (udg_agroup)
      Else - Actions
        Do nothing
    Set VariableSet aunit = (Trained unit)
    Set VariableSet bunit = (Triggering unit)
    Trigger - Run BuffTrig <gen> (checking conditions)
    Set VariableSet aunit = (Trained unit)
    Trigger - Run MoveTrainedToPlatform <gen> (checking conditions)
TrainMountainKing
  Events
    Unit - A unit Finishes training a unit
  Conditions
    (Unit-type of (Trained unit)) Equal to Mountain King custom
  Actions
    Set VariableSet bunit = (Triggering unit)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of Munitions for bunit) Equal to 1
      Then - Actions
        Set VariableSet apoint = (Position of bunit)
        Set VariableSet agroup = (Units within 200.00 of apoint matching ((Unit-type of (Matching unit)) Equal to Munitions custom).)
        Unit Group - Pick every unit in agroup and do (Actions)
          Loop - Actions
            Special Effect - Create a special effect attached to the sprite (attachpoint) of (Picked unit) using Abilities\Spells\Human\Flare\FlareCaster.mdl
            Special Effect - Destroy (Last created special effect)
        Set VariableSet AcNumber = (Number of units in agroup)
        Custom script: call RemoveLocation (udg_apoint)
        Custom script: call DestroyGroup (udg_agroup)
        For each (Integer B) from 1 to AcNumber, do (Actions)
          Loop - Actions
            Set VariableSet agroup = (Units in Platform <gen> matching ((((Matching unit) is alive) Equal to True) and (((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit)).) Equal to True))) and ((Level of dummy dummy for (Matching unit)) Equal to 0))))
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Number of units in agroup) Greater than or equal to 1
              Then - Actions
                Set VariableSet aunit = (Random unit from agroup)
                Set VariableSet apoint = (Position of aunit)
                Set VariableSet BaseDamageUnit = (Trained unit)
                Set VariableSet BaseDamageCalc = ((Base Damage of BaseDamageUnit for weapon index 0) + ((Dice Sides of BaseDamageUnit for weapon index 0) / 2))
                Set VariableSet areal = (Real((BaseDamageCalc + 1)))
                Unit - Cause Builder[(Player number of (Owner of (Triggering unit)))] to damage circular area after 0 seconds of radius 200.00 at apoint, dealing areal damage of attack type Spells and damage type Normal
                Special Effect - Create a special effect attached to the chest (attachpoint) of aunit using Abilities\Weapons\Mortar\MortarMissile.mdl
                Special Effect - Destroy (Last created special effect)
                Floating Text - Create floating text that reads Mortar above aunit with Z offset 0, using font size 10, color (100.00%, 75.00%, 25.00%), and 0% transparency
                Floating Text - Change (Last created floating text): Disable permanence
                Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
                Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
                Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
                Custom script: call RemoveLocation (udg_apoint)
              Else - Actions
                Do nothing
            Custom script: call DestroyGroup (udg_agroup)
      Else - Actions
        Do nothing
    Set VariableSet aunit = (Trained unit)
    Set VariableSet bunit = (Triggering unit)
    Trigger - Run BuffTrig <gen> (checking conditions)
    Set VariableSet aunit = (Trained unit)
    Trigger - Run MoveTrainedToPlatform <gen> (checking conditions)
SlaveSacrifice
  Events
    Unit - A unit Is attacked
  Conditions
    (Unit-type of (Attacking unit)) Equal to Slave
    (Mana of (Attacking unit)) Greater than or equal to 10.00
  Actions
    Unit - Set mana of (Attacking unit) to ((Mana of (Attacking unit)) - 10.00)
    Floating Text - Create floating text that reads + 10 above (Attacking unit) with Z offset 0, using font size 10, color (0.00%, 25.00%, 100.00%), and 0% transparency
    Floating Text - Change (Last created floating text): Disable permanence
    Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
    Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
    Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
    Special Effect - Create a special effect attached to the chest (attachpoint) of (Attacking unit) using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
    Special Effect - Destroy (Last created special effect)
    Unit - Cause (Attacking unit) to damage (Attacking unit), dealing 100000000.00 damage of attack type Spells and damage type Normal
    Unit - Set mana of Builder[(Player number of PlayerTwin[(Player number of (Owner of (Attacking unit)))])] to ((Mana of Builder[(Player number of PlayerTwin[(Player number of (Owner of (Attacking unit)))])]) + 10.00)
ConsortKill
  Events
    Unit - A unit Dies
  Conditions
    (Unit-type of (Killing unit)) Equal to Consort
  Actions
    Floating Text - Create floating text that reads Summon Vestal above (Killing unit) with Z offset 0, using font size 10, color (75.00%, 100.00%, 0.00%), and 0% transparency
    Floating Text - Change (Last created floating text): Disable permanence
    Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
    Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
    Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
    Set VariableSet apoint = (Center of SpawnPoint[(Player number of PlayerTwin[(Player number of (Owner of (Killing unit)))])])
    Unit - Create 1.Vestal for (Owner of (Killing unit)) at apoint facing (Random angle) degrees
    Unit - Change color of (Last created unit) to Color[(Player number of (Owner of (Killing unit)))]
    Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\Items\AIim\AIimTarget.mdl
    Special Effect - Destroy (Last created special effect)
    Custom script: call RemoveLocation (udg_apoint)
MyrmidonKill
  Events
    Unit - A unit Dies
  Conditions
    (Unit-type of (Killing unit)) Equal to Myrmidon
  Actions
    Floating Text - Create floating text that reads +5 above (Killing unit) with Z offset 0, using font size 10, color (0.00%, 25.00%, 100.00%), and 0% transparency
    Floating Text - Change (Last created floating text): Disable permanence
    Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
    Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
    Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
    Unit - Set mana of Builder[(Player number of PlayerTwin[(Player number of (Owner of (Killing unit)))])] to ((Mana of Builder[(Player number of PlayerTwin[(Player number of (Owner of (Killing unit)))])]) + 5.00)
    Special Effect - Create a special effect attached to the chest (attachpoint) of (Killing unit) using Abilities\Spells\Undead\ReplenishMana\ReplenishManaCaster.mdl
    Special Effect - Destroy (Last created special effect)
InitiateKill
  Events
    Unit - A unit Dies
  Conditions
    (Unit-type of (Killing unit)) Equal to Initiate
  Actions
    Floating Text - Create floating text that reads +2 above (Killing unit) with Z offset 0, using font size 10, color (0.00%, 25.00%, 100.00%), and 0% transparency
    Floating Text - Change (Last created floating text): Disable permanence
    Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
    Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
    Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
    Unit - Set mana of Builder[(Player number of PlayerTwin[(Player number of (Owner of (Killing unit)))])] to ((Mana of Builder[(Player number of PlayerTwin[(Player number of (Owner of (Killing unit)))])]) + 2.00)
    Special Effect - Create a special effect attached to the chest (attachpoint) of (Killing unit) using Abilities\Spells\Undead\ReplenishMana\ReplenishManaCaster.mdl
    Special Effect - Destroy (Last created special effect)
CastOffering
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Offering
  Actions
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( casts |c007EBFF1 + ((Name of (Ability being cast)) + |r)))
    For each (Integer A) from 1 to 5, do (Actions)
      Loop - Actions
        Set VariableSet apoint = (Center of SpawnPoint[(Player number of (Owner of (Triggering unit)))])
        Unit - Create 1.Slave for ComputerTwin[(Player number of (Owner of (Triggering unit)))] at apoint facing (Random angle) degrees
        Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
        Custom script: call RemoveLocation (udg_apoint)
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
        Special Effect - Destroy (Last created special effect)
CastSacredSerpent
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Sacred Serpent
  Actions
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( casts |c007EBFF1 + ((Name of (Ability being cast)) + |r)))
    Set VariableSet apoint = (Center of SpawnPoint[(Player number of (Owner of (Triggering unit)))])
    Unit - Create 1.Serpent for ComputerTwin[(Player number of (Owner of (Triggering unit)))] at apoint facing (Random angle) degrees
    Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
    Custom script: call RemoveLocation (udg_apoint)
    Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
    Special Effect - Destroy (Last created special effect)
CastSacredSerpentFinish
  Events
    Unit - A unit Finishes casting an ability
  Conditions
    (Ability being cast) Equal to Sacred Serpent
  Actions
    Set VariableSet bgroup = (Units owned by (Owner of (Triggering unit)) of type Serpent Shrine custom)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in bgroup) Greater than or equal to 1
      Then - Actions
        Set VariableSet anumber = (10 x (Number of units in bgroup))
        Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + (Real(anumber)))
        Game - Display to (Player group((Owner of (Triggering unit)))) the text: (You gain |c006969FF+ + ((String(anumber)) + mana!|r))
        Special Effect - Create a special effect attached to the chest (attachpoint) of Tower[(Player number of (Owner of (Triggering unit)))] using Abilities\Spells\Items\AIim\AIimTarget.mdl
        Special Effect - Destroy (Last created special effect)
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Triggering unit) using Abilities\Spells\Items\AIim\AIimTarget.mdl
        Special Effect - Destroy (Last created special effect)
      Else - Actions
        Game - Display to (All players) the text: It fizzles...
    Custom script: call DestroyGroup (udg_bgroup)
CastWrathoftheChosen
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Wroth of the Chosen
  Actions
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( casts |c007EBFF1 + ((Name of (Ability being cast)) + |r)))
    Set VariableSet bgroup = (Units in Platform <gen> matching ((((Owner of (Triggering unit)) is an ally of (Owner of (Matching unit)).) Equal to True) and (((((Matching unit) is alive) Equal to True) and ((Level of +4 damage anointed for (Matching unit)) Equal to 1)) and (((Level of dummy dummy for (Matching unit)) Equal to 0) and (((Matching unit) is A structure) Equal to False)))))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in bgroup) Greater than or equal to 1
      Then - Actions
        Set VariableSet aunit = (Random unit from bgroup)
        Set VariableSet cgroup = (Units in Platform <gen> matching (((Matching unit) Not equal to aunit) and (((((Matching unit) is alive) Equal to True) and ((Level of +4 damage anointed for (Matching unit)) Equal to 0)) and (((Level of dummy dummy for (Matching unit)) Equal to 0) and (((Matching unit) is A structure) Equal to False)))))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Number of units in cgroup) Greater than or equal to 1
          Then - Actions
            Unit Group - Pick every unit in cgroup and do (Actions)
              Loop - Actions
                Floating Text - Create floating text that reads Wroth above (Picked unit) with Z offset 0, using font size 10, color (75.00%, 100.00%, 0.00%), and 0% transparency
                Floating Text - Change (Last created floating text): Disable permanence
                Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
                Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
                Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
                Unit - Cause (Triggering unit) to damage (Picked unit), dealing 20.00 damage of attack type Spells and damage type Normal
                Special Effect - Create a special effect attached to the chest (attachpoint) of (Picked unit) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
                Special Effect - Destroy (Last created special effect)
          Else - Actions
            Game - Display to (All players) the text: It fizzles...
        Custom script: call DestroyGroup (udg_cgroup)
      Else - Actions
        Set VariableSet agroup = (Units in Platform <gen> matching ((((Owner of (Triggering unit)) is an ally of (Owner of (Matching unit)).) Equal to True) and (((((Matching unit) is alive) Equal to True) and ((Level of +4 damage anointed for (Matching unit)) Equal to 0)) and (((Level of dummy dummy for (Matching unit)) Equal to 0) and (((Matching unit) is A structure) Equal to False)))))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Number of units in agroup) Greater than or equal to 1
          Then - Actions
            Set VariableSet aunit = (Random unit from agroup)
            Unit - Add +4 damage anointed to aunit
            Unit - Add +12 life anointed to aunit
            Special Effect - Create a special effect attached to the chest (attachpoint) of aunit using Abilities\Spells\Other\Awaken\Awaken.mdl
            Special Effect - Destroy (Last created special effect)
            Floating Text - Create floating text that reads Anointed above aunit with Z offset 0, using font size 10, color (75.00%, 100.00%, 0.00%), and 0% transparency
            Floating Text - Change (Last created floating text): Disable permanence
            Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
            Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
            Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
          Else - Actions
            Game - Display to (All players) the text: It fizzles...
        Custom script: call DestroyGroup (udg_agroup)
    Custom script: call DestroyGroup (udg_bgroup)
CastDivineOil
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Divine Oil custom
  Actions
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( casts |c007EBFF1 + ((Name of (Ability being cast)) + |r)))
    Set VariableSet bgroup = (Units in Platform <gen> matching ((((Owner of (Triggering unit)) is an ally of (Owner of (Matching unit)).) Equal to True) and (((((Matching unit) is alive) Equal to True) and ((Level of +4 damage anointed for (Matching unit)) Equal to 1)) and (((Level of dummy dummy for (Matching unit)) Equal to 0) and (((Matching unit) is A structure) Equal to False)))))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in bgroup) Greater than or equal to 1
      Then - Actions
        Set VariableSet aunit = (Random unit from bgroup)
        Set VariableSet apoint = (Position of aunit)
        Unit - Create 1.Salamander for ComputerTwin[(Player number of (Owner of (Triggering unit)))] at apoint facing (Random angle) degrees
        Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\Other\Doom\DoomDeath.mdl
        Special Effect - Destroy (Last created special effect)
        Custom script: call RemoveLocation (udg_apoint)
        Custom script: call DestroyGroup (udg_agroup)
      Else - Actions
        Set VariableSet agroup = (Units in Platform <gen> matching ((((Owner of (Triggering unit)) is an ally of (Owner of (Matching unit)).) Equal to True) and (((((Matching unit) is alive) Equal to True) and ((Level of +4 damage anointed for (Matching unit)) Equal to 0)) and (((Level of dummy dummy for (Matching unit)) Equal to 0) and (((Matching unit) is A structure) Equal to False)))))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Number of units in agroup) Greater than or equal to 1
          Then - Actions
            Set VariableSet aunit = (Random unit from agroup)
            Unit - Add +4 damage anointed to aunit
            Unit - Add +12 life anointed to aunit
            Special Effect - Create a special effect attached to the chest (attachpoint) of aunit using Abilities\Spells\Other\Awaken\Awaken.mdl
            Special Effect - Destroy (Last created special effect)
            Floating Text - Create floating text that reads Anointed above aunit with Z offset 0, using font size 10, color (75.00%, 100.00%, 0.00%), and 0% transparency
            Floating Text - Change (Last created floating text): Disable permanence
            Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
            Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
            Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
          Else - Actions
            Game - Display to (All players) the text: It fizzles...
        Custom script: call DestroyGroup (udg_agroup)
    Custom script: call DestroyGroup (udg_bgroup)
CastLoveoftheChosen
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Love of the Chosen
  Actions
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( casts |c007EBFF1 + ((Name of (Ability being cast)) + |r)))
    Set VariableSet bgroup = (Units in Platform <gen> matching ((((Owner of (Triggering unit)) is an ally of (Owner of (Matching unit)).) Equal to True) and (((((Matching unit) is alive) Equal to True) and ((Level of +4 damage anointed for (Matching unit)) Equal to 1)) and (((Level of dummy dummy for (Matching unit)) Equal to 0) and (((Matching unit) is A structure) Equal to False)))))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in bgroup) Greater than or equal to 1
      Then - Actions
        Set VariableSet aunit = (Random unit from bgroup)
        Set VariableSet apoint = (Position of aunit)
        For each (Integer A) from 1 to 6, do (Actions)
          Loop - Actions
            Unit - Create 1.Vestal for ComputerTwin[(Player number of (Owner of (Triggering unit)))] at apoint facing (Random angle) degrees
            Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
            Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\Items\AIim\AIimTarget.mdl
            Special Effect - Destroy (Last created special effect)
        Custom script: call RemoveLocation (udg_apoint)
        Custom script: call DestroyGroup (udg_agroup)
      Else - Actions
        Set VariableSet agroup = (Units in Platform <gen> matching ((((Owner of (Triggering unit)) is an ally of (Owner of (Matching unit)).) Equal to True) and (((((Matching unit) is alive) Equal to True) and ((Level of +4 damage anointed for (Matching unit)) Equal to 0)) and (((Level of dummy dummy for (Matching unit)) Equal to 0) and (((Matching unit) is A structure) Equal to False)))))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Number of units in agroup) Greater than or equal to 1
          Then - Actions
            Set VariableSet aunit = (Random unit from agroup)
            Unit - Add +4 damage anointed to aunit
            Unit - Add +12 life anointed to aunit
            Special Effect - Create a special effect attached to the chest (attachpoint) of aunit using Abilities\Spells\Other\Awaken\Awaken.mdl
            Special Effect - Destroy (Last created special effect)
            Floating Text - Create floating text that reads Anointed above aunit with Z offset 0, using font size 10, color (75.00%, 100.00%, 0.00%), and 0% transparency
            Floating Text - Change (Last created floating text): Disable permanence
            Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
            Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
            Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
          Else - Actions
            Game - Display to (All players) the text: It fizzles...
        Custom script: call DestroyGroup (udg_agroup)
    Custom script: call DestroyGroup (udg_bgroup)
CastInitiate
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Temple Guard
  Actions
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( casts |c007EBFF1 + ((Name of (Ability being cast)) + |r)))
    Set VariableSet bgroup = (Units in (Playable map area) matching ((((Owner of (Triggering unit)) is an ally of (Owner of (Matching unit)).) Equal to True) and (((((Matching unit) is alive) Equal to True) and ((Level of +4 damage anointed for (Matching unit)) Equal to 1)) and (((Level of dummy dummy for (Matching unit)) Equal to 0) and (((Matching unit) is A structure) Equal to False)))))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in bgroup) Greater than or equal to 1
      Then - Actions
        Set VariableSet apoint = (Center of SpawnPoint[(Player number of (Owner of (Triggering unit)))])
        Unit - Create 1.Initiate for ComputerTwin[(Player number of (Owner of (Triggering unit)))] at apoint facing (Random angle) degrees
        Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
        Special Effect - Destroy (Last created special effect)
        Custom script: call RemoveLocation (udg_apoint)
      Else - Actions
        Set VariableSet apoint = (Center of SpawnPoint[(Player number of (Owner of (Triggering unit)))])
        Unit - Create 1.Initiate for ComputerTwin[(Player number of (Owner of (Triggering unit)))] at apoint facing (Random angle) degrees
        Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
        Special Effect - Destroy (Last created special effect)
        Set VariableSet aunit = (Last created unit)
        Unit - Add +4 damage anointed to aunit
        Unit - Add +12 life anointed to aunit
        Special Effect - Create a special effect attached to the chest (attachpoint) of aunit using Abilities\Spells\Other\Awaken\Awaken.mdl
        Special Effect - Destroy (Last created special effect)
        Floating Text - Create floating text that reads Anointed above aunit with Z offset 0, using font size 10, color (75.00%, 100.00%, 0.00%), and 0% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
        Custom script: call RemoveLocation (udg_apoint)
    Custom script: call DestroyGroup (udg_bgroup)
BrazierConstruct
  Events
    Unit - A unit Finishes construction
  Conditions
    (Unit-type of (Triggering unit)) Equal to Brazier custom
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of items carried by Builder[(Player number of (Owner of (Triggering unit)))]) Less than 6
      Then - Actions
        Hero - Create Temple Guard and give it to Builder[(Player number of (Owner of (Triggering unit)))]
      Else - Actions
        Item - Set charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Temple Guard) to ((Charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Temple Guard)) + 1)
    Set VariableSet apoint = (Position of (Triggering unit))
    Set VariableSet agroup = (Units within 200.00 of apoint matching (((Matching unit) is A structure) Equal to True).)
    Unit Group - Pick every unit in agroup and do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Level of Not A Training Building for self for (Picked unit)) Equal to 0
            (Level of Brazier for (Picked unit)) Equal to 0
          Then - Actions
            Unit - Add Brazier to (Picked unit)
            Special Effect - Create a special effect attached to the base (attachpoint) of (Picked unit) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
            Special Effect - Destroy (Last created special effect)
          Else - Actions
            Do nothing
    Custom script: call DestroyGroup (udg_agroup)
    Custom script: call RemoveLocation (udg_apoint)
Braziercheck
  Events
    Unit - A unit Finishes construction
  Conditions
    (Unit-type of Builder[(Player number of (Owner of (Triggering unit)))]) Equal to Priestess
  Actions
    Set VariableSet apoint = (Position of (Triggering unit))
    Set VariableSet agroup = (Units within 200.00 of apoint matching ((Unit-type of (Matching unit)) Equal to Brazier custom).)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of Not A Training Building for self for (Triggering unit)) Equal to 0
        (Number of units in agroup) Greater than or equal to 1
      Then - Actions
        Unit - Add Brazier to (Triggering unit)
        Special Effect - Create a special effect attached to the base (attachpoint) of (Triggering unit) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
        Special Effect - Destroy (Last created special effect)
      Else - Actions
        Do nothing
    Custom script: call DestroyGroup (udg_agroup)
    Custom script: call RemoveLocation (udg_apoint)
CastTempleGaurd
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Temple Guard
  Actions
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( casts |c007EBFF1 + ((Name of (Ability being cast)) + |r)))
    Set VariableSet bgroup = (Units in (Playable map area) matching ((((Owner of (Triggering unit)) is an ally of (Owner of (Matching unit)).) Equal to True) and (((((Matching unit) is alive) Equal to True) and ((Level of +4 damage anointed for (Matching unit)) Equal to 1)) and (((Level of dummy dummy for (Matching unit)) Equal to 0) and (((Matching unit) is A structure) Equal to False)))))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in bgroup) Greater than or equal to 1
      Then - Actions
        Set VariableSet aunit = (Random unit from bgroup)
        Set VariableSet apoint = (Position of aunit)
        Unit - Create 1.Salamander for ComputerTwin[(Player number of (Owner of (Triggering unit)))] at apoint facing (Random angle) degrees
        Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\Other\Doom\DoomDeath.mdl
        Special Effect - Destroy (Last created special effect)
        Custom script: call RemoveLocation (udg_apoint)
        Custom script: call DestroyGroup (udg_agroup)
      Else - Actions
        Set VariableSet agroup = (Units in Platform <gen> matching ((((Owner of (Triggering unit)) is an ally of (Owner of (Matching unit)).) Equal to True) and (((((Matching unit) is alive) Equal to True) and ((Level of +4 damage anointed for (Matching unit)) Equal to 0)) and (((Level of dummy dummy for (Matching unit)) Equal to 0) and (((Matching unit) is A structure) Equal to False)))))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Number of units in agroup) Greater than or equal to 1
          Then - Actions
            Set VariableSet aunit = (Random unit from agroup)
            Unit - Add +4 damage anointed to aunit
            Unit - Add +12 life anointed to aunit
            Special Effect - Create a special effect attached to the chest (attachpoint) of aunit using Abilities\Spells\Other\Awaken\Awaken.mdl
            Special Effect - Destroy (Last created special effect)
            Floating Text - Create floating text that reads Anointed above aunit with Z offset 0, using font size 10, color (75.00%, 100.00%, 0.00%), and 0% transparency
            Floating Text - Change (Last created floating text): Disable permanence
            Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
            Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
            Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
          Else - Actions
            Game - Display to (All players) the text: It fizzles...
        Custom script: call DestroyGroup (udg_agroup)
    Custom script: call DestroyGroup (udg_bgroup)
DivineFlameConstruct
  Events
    Unit - A unit Finishes construction
  Conditions
    (Unit-type of (Triggering unit)) Equal to Divine Flame custom
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of items carried by Builder[(Player number of (Owner of (Triggering unit)))]) Less than 6
      Then - Actions
        Hero - Create Divine Oil and give it to Builder[(Player number of (Owner of (Triggering unit)))]
      Else - Actions
        Item - Set charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Divine Oil) to ((Charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Divine Oil)) + 4)
    For each (Integer A) from 1 to 2, do (Actions)
      Loop - Actions
        Unit - Order (Triggering unit) to train/upgrade to a Mana altar
TentConstruct
  Events
    Unit - A unit Finishes construction
  Conditions
    (Unit-type of (Triggering unit)) Equal to Tent custom
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of items carried by Builder[(Player number of (Owner of (Triggering unit)))]) Less than 6
      Then - Actions
        Hero - Create Offering and give it to Builder[(Player number of (Owner of (Triggering unit)))]
      Else - Actions
        Item - Set charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Offering) to ((Charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Offering)) + 3)
    For each (Integer A) from 1 to 2, do (Actions)
      Loop - Actions
        Unit - Order (Triggering unit) to train/upgrade to a Gold market
SerpentShrineConstruct
  Events
    Unit - A unit Finishes construction
  Conditions
    (Unit-type of (Triggering unit)) Equal to Serpent Shrine custom
  Actions
    Set VariableSet agroup = (Units owned by (Owner of (Triggering unit)) matching (((Unit-type of (Matching unit)) Equal to Serpent Shrine custom) and (((Matching unit) is alive) Equal to True)).)
    Unit Group - Pick every unit in agroup and do (Actions)
      Loop - Actions
        Set VariableSet aunit = (Picked unit)
        Special Effect - Create a special effect attached to the chest (attachpoint) of aunit using Abilities\Spells\Other\Awaken\Awaken.mdl
        Special Effect - Destroy (Last created special effect)
    Set VariableSet dnumber = (Number of units in agroup)
    Set VariableSet dnumber = (dnumber x 50)
    Custom script: call DestroyGroup (udg_agroup)
    Unit - Set life of Tower[(Player number of (Owner of (Triggering unit)))] to ((Life of Tower[(Player number of (Owner of (Triggering unit)))]) + (Real(dnumber)))
    Floating Text - Create floating text that reads (+ + (String(dnumber))) above Tower[(Player number of (Owner of (Triggering unit)))] with Z offset -50.00, using font size 10, color (25.00%, 100.00%, 25.00%), and 0% transparency
    Floating Text - Change (Last created floating text): Disable permanence
    Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
    Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
    Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of items carried by Builder[(Player number of (Owner of (Triggering unit)))]) Less than 6
      Then - Actions
        Hero - Create Sacred Serpent and give it to Builder[(Player number of (Owner of (Triggering unit)))]
      Else - Actions
        Item - Set charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Sacred Serpent) to ((Charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Sacred Serpent)) + 3)
FirstTempleConstruct
  Events
    Unit - A unit Finishes construction
  Conditions
    (Unit-type of (Triggering unit)) Equal to First Temple custom
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of items carried by Builder[(Player number of (Owner of (Triggering unit)))]) Less than 6
      Then - Actions
        Hero - Create Wroth of the Chosen and give it to Builder[(Player number of (Owner of (Triggering unit)))]
      Else - Actions
        Item - Set charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Wroth of the Chosen) to ((Charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Wroth of the Chosen)) + 3)
    For each (Integer A) from 1 to 2, do (Actions)
      Loop - Actions
        Unit - Order (Triggering unit) to train/upgrade to a Myrmidon
PalaceConstruct
  Events
    Unit - A unit Finishes construction
  Conditions
    (Unit-type of (Triggering unit)) Equal to Palace custom
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of items carried by Builder[(Player number of (Owner of (Triggering unit)))]) Less than 6
      Then - Actions
        Hero - Create Love of the Chosen and give it to Builder[(Player number of (Owner of (Triggering unit)))]
      Else - Actions
        Item - Set charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Love of the Chosen) to ((Charges remaining in (Item carried by Builder[(Player number of (Owner of (Triggering unit)))] of type Love of the Chosen)) + 3)
    For each (Integer A) from 1 to 2, do (Actions)
      Loop - Actions
        Unit - Order (Triggering unit) to train/upgrade to a Consort
TrainMyrmidon
  Events
    Unit - A unit Finishes training a unit
  Conditions
    (Unit-type of (Trained unit)) Equal to Myrmidon
  Actions
    Set VariableSet agroup = (Units in Platform <gen> matching ((((Owner of (Triggering unit)) is an ally of (Owner of (Matching unit)).) Equal to True) and (((((Matching unit) is alive) Equal to True) and ((Level of +4 damage anointed for (Matching unit)) Equal to 1)) and (((Level of dummy dummy for (Matching unit)) Equal to 0) and (((Matching unit) is A structure) Equal to False)))))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in agroup) Equal to 0
      Then - Actions
        Set VariableSet aunit = (Trained unit)
        Unit - Add +4 damage anointed to aunit
        Unit - Add +12 life anointed to aunit
        Special Effect - Create a special effect attached to the chest (attachpoint) of aunit using Abilities\Spells\Other\Awaken\Awaken.mdl
        Special Effect - Destroy (Last created special effect)
        Floating Text - Create floating text that reads Anointed above aunit with Z offset 0, using font size 10, color (75.00%, 100.00%, 0.00%), and 0% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
      Else - Actions
        Do nothing
    Custom script: call DestroyGroup (udg_agroup)
    Set VariableSet aunit = (Trained unit)
    Set VariableSet bunit = (Triggering unit)
    Trigger - Run BuffTrig <gen> (checking conditions)
    Set VariableSet aunit = (Trained unit)
    Trigger - Run MoveTrainedToPlatform <gen> (checking conditions)
TrainConsort
  Events
    Unit - A unit Finishes training a unit
  Conditions
    (Unit-type of (Trained unit)) Equal to Consort
  Actions
    Set VariableSet agroup = (Units in Platform <gen> matching ((((Owner of (Triggering unit)) is an ally of (Owner of (Matching unit)).) Equal to True) and (((((Matching unit) is alive) Equal to True) and ((Level of +4 damage anointed for (Matching unit)) Equal to 1)) and (((Level of dummy dummy for (Matching unit)) Equal to 0) and (((Matching unit) is A structure) Equal to False)))))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in agroup) Equal to 0
      Then - Actions
        Set VariableSet aunit = (Trained unit)
        Unit - Add +4 damage anointed to aunit
        Unit - Add +12 life anointed to aunit
        Special Effect - Create a special effect attached to the chest (attachpoint) of aunit using Abilities\Spells\Other\Awaken\Awaken.mdl
        Special Effect - Destroy (Last created special effect)
        Floating Text - Create floating text that reads Anointed above aunit with Z offset 0, using font size 10, color (75.00%, 100.00%, 0.00%), and 0% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
      Else - Actions
        Do nothing
    Custom script: call DestroyGroup (udg_agroup)
    Set VariableSet aunit = (Trained unit)
    Set VariableSet bunit = (Triggering unit)
    Trigger - Run BuffTrig <gen> (checking conditions)
    Set VariableSet aunit = (Trained unit)
    Trigger - Run MoveTrainedToPlatform <gen> (checking conditions)
CursedBeastDies
  Events
    Unit - A unit Dies
  Conditions
    (Unit-type of (Triggering unit)) Equal to Cursed Beast
  Actions
    Set VariableSet apoint = (Position of (Triggering unit))
    Unit - Create 1.Villager custom for (Owner of (Triggering unit)) at apoint facing (Random angle) degrees
    Unit - Change color of (Last created unit) to Color[(Player number of (Owner of (Dying unit)))]
    Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
    Special Effect - Destroy (Last created special effect)
    Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\Other\Stampede\MissileDeath.mdl
    Special Effect - Destroy (Last created special effect)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of +6 life for (Dying unit)) Equal to 1
      Then - Actions
        Unit - Add +6 life to (Last created unit)
      Else - Actions
        Do nothing
    Custom script: call RemoveLocation (udg_apoint)
NosferatuAttack
  Events
    Unit - A unit Is attacked
  Conditions
    (Mana of (Attacking unit)) Greater than or equal to 10.00
    (Unit-type of (Attacking unit)) Equal to Nosferatu
  Actions
    Set VariableSet agroup = (Units in Platform <gen> matching ((((Owner of (Matching unit)) is an ally of (Owner of (Attacking unit)).) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Undead) Equal to False) and (((Matching unit) is Mechanical) Equal to False))))))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in agroup) Greater than or equal to 1
      Then - Actions
        Set VariableSet aunit = (Random unit from agroup)
        Floating Text - Create floating text that reads Vampirism above (Attacking unit) with Z offset 0, using font size 10, color (75.00%, 25.00%, 25.00%), and 0% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
        Unit - Set mana of (Attacking unit) to ((Mana of (Attacking unit)) - 10.00)
        Unit - Change ownership of aunit to (Owner of (Attacking unit)) and Change color
        Unit - Replace aunit with a Vampire using The old unit's relative life and mana
        Unit - Change color of (Last replaced unit) to (Color of PlayerTwin[(Player number of (Owner of (Attacking unit)))])
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Last replaced unit) using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
        Special Effect - Destroy (Last created special effect)
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Last replaced unit) using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
        Special Effect - Destroy (Last created special effect)
        Floating Text - Create floating text that reads Vampirism above (Last replaced unit) with Z offset 0, using font size 10, color (75.00%, 25.00%, 25.00%), and 0% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
      Else - Actions
        Do nothing
    Custom script: call DestroyGroup (udg_agroup)
VillagerAttack
  Events
    Unit - A unit Is attacked
  Conditions
    (Mana of (Attacking unit)) Greater than or equal to 15.00
    Or - Any (Conditions) are true
      Conditions
        (Unit-type of (Attacking unit)) Equal to Villager custom
        (Unit-type of (Attacking unit)) Equal to Villager summoned
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of +6 life for (Attacking unit)) Equal to 1
      Then - Actions
        Set VariableSet FountainOfBloodYes = 1
      Else - Actions
        Set VariableSet FountainOfBloodYes = 0
    Set VariableSet aunit = (Attacking unit)
    Unit - Set mana of (Attacking unit) to ((Mana of (Attacking unit)) - 15.00)
    Unit - Replace aunit with a Cursed Beast using The old unit's relative life and mana
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        FountainOfBloodYes Equal to 1
      Then - Actions
        Unit - Add +6 life to (Last replaced unit)
      Else - Actions
        Do nothing
    Unit - Change color of (Last replaced unit) to (Color of PlayerTwin[(Player number of (Owner of (Last replaced unit)))])
    Special Effect - Create a special effect attached to the chest (attachpoint) of (Last replaced unit) using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
    Special Effect - Destroy (Last created special effect)
    Special Effect - Create a special effect attached to the chest (attachpoint) of (Last replaced unit) using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
    Special Effect - Destroy (Last created special effect)
    Floating Text - Create floating text that reads Transform above (Last replaced unit) with Z offset 0, using font size 10, color (75.00%, 25.00%, 25.00%), and 0% transparency
    Floating Text - Change (Last created floating text): Disable permanence
    Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
    Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
    Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
CursedBeastAttack
  Events
    Unit - A unit Is attacked
  Conditions
    (Mana of (Attacking unit)) Greater than or equal to 10.00
    (Unit-type of (Attacking unit)) Equal to Cursed Beast
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of +6 life for (Attacking unit)) Equal to 1
      Then - Actions
        Set VariableSet FountainOfBloodYes = 1
      Else - Actions
        Set VariableSet FountainOfBloodYes = 0
    Set VariableSet aunit = (Attacking unit)
    Unit - Set mana of (Attacking unit) to ((Mana of (Attacking unit)) - 10.00)
    Unit - Replace aunit with a Villager custom using The old unit's relative life and mana
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        FountainOfBloodYes Equal to 1
      Then - Actions
        Unit - Add +6 life to (Last replaced unit)
      Else - Actions
        Do nothing
    Unit - Change color of (Last replaced unit) to (Color of PlayerTwin[(Player number of (Owner of (Last replaced unit)))])
    Special Effect - Create a special effect attached to the chest (attachpoint) of (Last replaced unit) using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
    Special Effect - Destroy (Last created special effect)
    Special Effect - Create a special effect attached to the chest (attachpoint) of (Last replaced unit) using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
    Special Effect - Destroy (Last created special effect)
    Floating Text - Create floating text that reads Transform above (Last replaced unit) with Z offset 0, using font size 10, color (75.00%, 25.00%, 25.00%), and 0% transparency
    Floating Text - Change (Last created floating text): Disable permanence
    Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
    Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
    Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
KillBlackRider
  Events
    Unit - A unit Dies
  Conditions
    (Level of +6 damage blood knight for (Killing unit)) Equal to 0
    ((Dying unit) is Undead) Equal to False
    ((Dying unit) is Mechanical) Equal to False
    (Unit-type of (Killing unit)) Equal to Blood Knight
  Actions
    Floating Text - Create floating text that reads Bloodrage above (Killing unit) with Z offset 0, using font size 10, color (75.00%, 25.00%, 25.00%), and 0% transparency
    Floating Text - Change (Last created floating text): Disable permanence
    Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
    Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
    Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
    Unit - Add +6 damage blood knight to (Killing unit)
    Special Effect - Create a special effect attached to the weapon (attachpoint) of (Killing unit) using Abilities\Spells\Orc\Bloodlust\BloodlustTarget.mdl
    Special Effect - Destroy (Last created special effect)
CastFeast
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Feast
  Actions
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( casts |c007EBFF1 + ((Name of (Ability being cast)) + |r)))
    Set VariableSet agroup = (Units in Platform <gen> matching ((((Owner of (Matching unit)) is an ally of (Owner of (Triggering unit)).) Equal to True) and ((((((Matching unit) is A structure) Equal to False) and ((Level of dummy dummy for (Matching unit)) Equal to 0)) and (((Level of dummy dummy for (Matching unit)) Equal to 0) and (((Matching unit) is alive) Equal to True))) and ((Life of (Matching unit)) Less than (Max life of (Matching unit))))))
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in agroup) Greater than or equal to 1
      Then - Actions
        Set VariableSet aunit = (Random unit from agroup)
        Unit - Set life of aunit to ((Life of aunit) + 5.00)
        Special Effect - Create a special effect attached to the chest (attachpoint) of aunit using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
        Special Effect - Destroy (Last created special effect)
        Special Effect - Create a special effect attached to the chest (attachpoint) of aunit using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
        Special Effect - Destroy (Last created special effect)
        Floating Text - Create floating text that reads Feast above aunit with Z offset 0, using font size 10, color (75.00%, 25.00%, 25.00%), and 0% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
        Set VariableSet bgroup = (Units in Platform <gen> matching ((((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit)).) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Level of dummy dummy for (Matching unit)) Equal to 0) and (((Matching unit) is A structure) Equal to False)))))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Number of units in bgroup) Greater than or equal to 1
          Then - Actions
            Set VariableSet aunit = (Random unit from bgroup)
            Unit - Cause (Triggering unit) to damage aunit, dealing 5.00 damage of attack type Spells and damage type Normal
            Special Effect - Create a special effect attached to the chest (attachpoint) of aunit using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
            Special Effect - Destroy (Last created special effect)
            Special Effect - Create a special effect attached to the chest (attachpoint) of aunit using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
            Special Effect - Destroy (Last created special effect)
            Floating Text - Create floating text that reads Feast above aunit with Z offset 0, using font size 10, color (75.00%, 25.00%, 25.00%), and 0% transparency
            Floating Text - Change (Last created floating text): Disable permanence
            Floating Text - Set the velocity of (Last created floating text) to 64 towards 90 degrees
            Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
            Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
          Else - Actions
            Do nothing
        Custom script: call DestroyGroup (udg_bgroup)
      Else - Actions
        Game - Display to (All players) the text: It fizzles...
    Custom script: call DestroyGroup (udg_agroup)
CastBlackRider
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Black Rider
  Actions
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( casts |c007EBFF1 + ((Name of (Ability being cast)) + |r)))
    Set VariableSet agroup = (Units owned by (Owner of (Triggering unit)) of type Impaled Corpse custom)
    Set VariableSet anumber = (Number of units in agroup)
    Set VariableSet anumber = (anumber x 2)
    For each (Integer A) from 1 to anumber, do (Actions)
      Loop - Actions
        Set VariableSet apoint = (Center of SpawnPoint[(Player number of (Owner of (Triggering unit)))])
        Unit - Create 1.Villager summoned for ComputerTwin[(Player number of (Owner of (Triggering unit)))] at apoint facing (Random angle) degrees
        Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
        Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
        Special Effect - Destroy (Last created special effect)
        Custom script: call RemoveLocation (udg_apoint)
    Set VariableSet apoint = (Center of SpawnPoint[(Player number of (Owner of (Triggering unit)))])
    Unit - Create 1.Blood Knight for ComputerTwin[(Player number of (Owner of (Triggering unit)))] at apoint facing (Random angle) degrees
    Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
    Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
    Special Effect - Destroy (Last created special effect)
    Custom script: call RemoveLocation (udg_apoint)
    Custom script: call DestroyGroup (udg_agroup)
CastPlagueofRats
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Plague of Rats custom
  Actions
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( casts |c007EBFF1 + ((Name of (Ability being cast)) + |r)))
    Set VariableSet agroup = (Units owned by (Owner of (Triggering unit)) of type Infected Granary custom)
    Set VariableSet anumber = (Number of units in agroup)
    Custom script: call DestroyGroup (udg_agroup)
    For each (Integer A) from 1 to anumber, do (Actions)
      Loop - Actions
        Set VariableSet bgroup = (Units in Platform <gen> matching (((((Matching unit) is A structure) Equal to True) and (((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit)).) Equal to True)) and ((((Matching unit) is alive) Equal to True) and ((Level of dummy dummy for (Matching unit)) Equal to 0))))
        Unit Group - Pick every unit in bgroup and do (Actions)
          Loop - Actions
            For each (Integer B) from 1 to 2, do (Actions)
              Loop - Actions
                Set VariableSet apoint = (Position of (Picked unit))
                Unit - Create 1.Rat custom for ComputerTwin[(Player number of (Owner of (Triggering unit)))] at apoint facing (Random angle) degrees
                Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
                Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                Special Effect - Destroy (Last created special effect)
                Custom script: call RemoveLocation (udg_apoint)
        Custom script: call DestroyGroup (udg_bgroup)
CastLivingStone
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Living Stone
  Actions
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( casts |c007EBFF1 + ((Name of (Ability being cast)) + |r)))
    Set VariableSet apoint = (Center of SpawnPoint[(Player number of (Owner of (Triggering unit)))])
    Unit - Create 1.Gargoyle for ComputerTwin[(Player number of (Owner of (Triggering unit)))] at apoint facing (Random angle) degrees
    Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
    Special Effect - Create a special effect attached to the chest (attachpoint) of (Last created unit) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
    Special Effect - Destroy (Last created special effect)
    Custom script: call RemoveLocation (udg_apoint)
    Custom script: call DestroyGroup (udg_agroup)
CastAncientOne
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Ancient One custom
  Actions
    Set VariableSet aunit = Tower[(Player number of (Owner of (Triggering unit)))]
    Unit - Cause (Casting unit) to damage aunit, dealing 50.00 damage of attack type Spells and damage type Normal
    Game - Display to (Player group((Owner of (Triggering unit)))) the text: |c00FF9696Your Base takes 50 damage!|r
    Special Effect - Create a special effect attached to the sprite (attachpoint) of aunit using Environment\UndeadBuildingFire\UndeadLargeBuildingFire1.mdl
    Special Effect - Destroy (Last created special effect)
    Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( casts |c007EBFF1 + ((Name of (Ability being cast)) + |r)))