globals
  integer udg_Kills1=0
  integer udg_Kills2=0
  integer udg_Kills3=0
  integer udg_Kills4=0
  integer udg_Kills5=0
  integer udg_Kills6=0
  integer udg_Kills7=0
  integer udg_Kills8=0
  integer udg_ITM_MaxItemRecipes=0
  integer array udg_ITM_ReplacementItem
  integer array udg_ITM_ItemSlot1
  integer array udg_ITM_ItemSlot2
  integer array udg_ITM_ItemSlot3
  integer array udg_ITM_ItemSlot4
  integer array udg_ITM_ItemSlot5
  integer array udg_ITM_ItemSlot6
  timer array udg_Respawn_Hero_Timer
  timerdialog array udg_Respawn_Hero_Timer_Window
  unit array udg_Omnischalg_Einheit
  effect udg_Omnischlag_Effekt_1=null
  effect udg_Omnischlag_Effekt_2=null
  effect udg_Omnischlag_Effekt_3=null
  integer udg_Omnischlag_Level=0
  unit udg_Omnischlag_zaubert=null
  unit udg_Omnischlag_Ziel=null
  real udg_NovaRotationTargetVar=.0
  location udg_TriggeringUnitPointVar=null
  unit udg_AttackDummy=null
  unit udg_AttackedUnit=null
  unit udg_Caster=null
  real udg_Damage=0
  real udg_Delay_Time=0
  texttag udg_Hit_Text=null
  integer udg_How_Many_Times=0
  real udg_Shakoof=0
  sound array udg_SliceSound
  integer udg_Strike_Counter=0
  timer udg_Swift_Timer=CreateTimer()
  effect udg_TeleEffect=null
  timer udg_CREEPTIMER=CreateTimer()
  timerdialog udg_CREEPWINDOW=null
  integer udg_CREEPWAIT=0
  integer udg_PassiveSummonPercent=0
  integer udg_PassiveSummonChance=0
  integer udg_PassiveUnstableChance=0
  integer udg_PassiveUnstablePercent=0
  integer udg_PassiveBerserkChance=0
  integer udg_PassiveBerserkPercent=0
  timerdialog udg_WINDOW=null
  integer udg_HEROWAIT=0
  timer udg_OURTIMER=CreateTimer()
  unit udg_OURHERO=null
  dialog udg_DifficultyDialog
  button udg_EasyButton=null
  button udg_NormalButton=null
  button udg_HardButton=null
  button udg_ExtraHardButton=null
  integer array udg_DifficultyVote
  integer udg_DifficultyLevel=0
  string udg_ColorString=""
  force udg_PlayersInGame=CreateForce()
  boolean udg_TempBoolean=false
  boolean udg_Debug=false
  button udg_ImpossibleButton=null
  quest udg_PedroNegro=null
  quest udg_GoblinReward=null
  unit udg_multifuncunit=null
  unit udg_Drunk_Panda=null
  location udg_Drunk_Points=null
  unit udg_Drunk_Target=null
  unit array udg_Drunk_Tri_Pandas
  group udg_Drunken_Group=CreateGroup()
  unit udg_Fire_Panda=null
  location udg_Fire_Points=null
  real udg_Flame_Ang=0
  real udg_Flame_Dis=0
  integer udg_BashNumber=0
  real udg_Gate_Ang=0
  location array udg_GatePoint
  unit array udg_Shadow
  group array udg_Shadow_Gate
  real array udg_ShadowBashDis
  boolean array udg_StalkCheck
  location udg_TempPoint=null
  integer array udg_TempTerrain
  dialog udg_CinematicDialog
  button udg_Yes=null
  button udg_No=null
  fogmodifier udg_Cinematic=null
  effect array udg_Effect1
  effect array udg_Effect2
  effect array udg_Effect3
  real array udg_Wave_Angls
  location array udg_Wave_Points
  effect array udg_Effect4
  unit array udg_Quad_Orcs
  unit udg_Wolf_Dummy=null
  location udg_Wolf_Points=null
  unit udg_Orc_Slave=null
  location array udg_Freeze_Points
  location udg_Liquid_Mine=null
  unit udg_Poseidon_Caster=null
  unit udg_Poseidon_Surface_Unit=null
  group udg_Poseidon_Group=CreateGroup()
  location udg_Poseidon_Point=null
  real udg_Wave_Angle=0
  location udg_Wave_Point=null
  effect udg_Effect01=null
  effect udg_Effect02=null
  effect udg_Effect03=null
  effect udg_Effect04=null
  location udg_Uppercut_Point=null
  unit udg_Uppercut_Unit=null
  quest udg_Kerchek=null
  quest udg_TrollReward=null
  quest udg_GoblinConstruction=null
  player udg_CasterPlayer=null
  location udg_CasterPosition=null
  unit udg_HydroCaster1=null
  unit udg_HydroCaster2=null
  unit udg_CasterHero=null
  integer udg_PassivePerificationChance=0
  integer udg_PassivePerificationPercent=0
  integer udg_asetsint=0
  gamecache udg_cscache=null
  real array udg_StrafeAngle
  unit array udg_StrafeMissile
  unit udg_MaskedCaster=null
  unit udg_Shuriken_Dummy=null
  location udg_Shuriken_Points=null
  location udg_Dynasty_Point=null
  unit udg_Red_Dragon=null
  unit udg_Dragon_rush_caster=null
  unit udg_Shen_daorong=null
  unit udg_hungeeer_caster=null
  unit udg_hungeeer_target=null
  unit udg_Guardian=null
  unit array udg_ChargedBolts
  integer array udg_ChargedDefenseLevel
  unit udg_DB_Caster=null
  effect array udg_DB_Effects
  texttag udg_DB_FloatingText=null
  unit udg_DB_Target=null
  unit udg_CasterHero_Frozen=null
  player udg_CasterPlayer_Frozen=null
  location udg_CasterPosition_Frozen=null
  unit udg_IceCaster1=null
  unit udg_IceCaster2=null
  unit udg_Unit_Statue=null
  unit udg_Axe_Target=null
  unit udg_Dwarf=null
  unit udg_Aerial_caster=null
  unit udg_Earth_slayer_caster=null
  effect udg_blastgraphic=null
  unit array udg_BladeMasterShadow
  unit udg_CasterUnit=null
  timer udg_Shadow1Timer=CreateTimer()
  unit udg_TargetUnit=null
  timer udg_Shadow2Timer=CreateTimer()
  timer udg_Shadow3Timer=CreateTimer()
  timer udg_Shadow4Timer=CreateTimer()
  timer udg_Shadow5Timer=CreateTimer()
  fogmodifier udg_BMVisibility=null
  quest udg_Secret_Boss=null
  quest udg_Centaur_Khan=null
  location udg_Dragon_Point=null
  integer udg_PassiveUpheavalChance=0
  integer udg_PassiveUpheavalPercent=0
  real udg_ExperienceRate=45.
  integer array udg_Hero_Array
  integer udg_Random_Count=0
  integer array udg_Random_Data
  integer udg_Random_Hero=0
  integer udg_Total_Heroes=0
  unit udg_Death_Caster=null
  unit udg_SoulCaster=null
  group udg_Fest_Group=CreateGroup()
  location udg_TargetPosition=null
  unit udg_Unholy_Charm=null
  unit udg_BloodBath_Killer=null
  location udg_Thunderstorm_Point=null
  unit udg_UltimaWeaponHolder=null
  unit udg_MirrorCaster=null
  unit array udg_MirrorAssassin
  unit udg_FFCasted=null
  unit udg_FFCaster=null
  unit udg_BloodBathCine=null
  unit udg_ShadowFuryCaster=null
  unit udg_CentaurKhan=null
  group udg_EndHeroes=CreateGroup()
  unit udg_EndingKhan=null
  unit udg_EndingMoo=null
  unit array udg_Attacker
  integer array udg_Death_Count
  force udg_DestinyWarriors=CreateForce()
  integer array udg_Kill_Count
  integer udg_List=0
  integer array udg_Multiboard_Spots
  string array udg_Player_Colors
  integer udg_Player_Count=0
  unit array udg_Unit_Target
  unit array udg_PlayerIcons
  integer array udg_BossKill_Count
  location udg_NoAllyAttackPos=null
  location udg_CenterMoo=null
  location udg_DesertWinds=null
  location udg_PedroOpenCine=null
  location udg_PocketFactory=null
  location udg_TinkCenter=null
  location udg_MineField=null
  location udg_Shrine=null
  location udg_Goblin1=null
  location udg_Goblin2=null
  location udg_Goblin3=null
  location udg_Goblin4=null
  location udg_ClockworkPos=null
  location udg_TechiePos=null
  location udg_SapperPos=null
  location udg_RoboPos=null
  group udg_ShrinePray=CreateGroup()
  location udg_ShrinePoint=null
  group udg_TrollGroup=CreateGroup()
  location udg_TrollPoint=null
  location udg_GobZepPoint=null
  location udg_GobVillagePoint=null
  group udg_MineFieldGroup=CreateGroup()
  location udg_TrollSickPos=null
  location udg_TrollCinePoint=null
  group udg_BloodbathBattleZone=CreateGroup()
  location udg_HideBloodUnits=null
  location udg_BloodbathKiller=null
  location udg_BloodbathStand=null
  location udg_Bloodbath_Killer=null
  location udg_Region70=null
  location udg_battlezone=null
  location udg_TrollCenterMap=null
  location udg_TrollCineEntering=null
  location udg_WorldTreeCenter=null
  location udg_WorldTreeItem=null
  location udg_GoblinClockwork=null
  location udg_GoblinEntering=null
  location udg_PedroNegro_Unit=null
  location udg_PedroNegroCine=null
  group udg_PedroNegroGroup=CreateGroup()
  location udg_PedroNegroDeath=null
  group udg_PedroNegroDeathGroup=CreateGroup()
  location udg_UltimateWeaponHolderPos=null
  location udg_UltimaCineRandom=null
  location udg_VulnerablePoint=null
  location udg_VulnerableShieldMooCave=null
  location udg_DesertHill=null
  location udg_CenterEndingKhan=null
  location udg_TaurenSpawn=null
  location udg_TaurenSpawn2=null
  location udg_CentaurSpawn=null
  location udg_CentaurSpawn2=null
  group udg_WayPointT1=CreateGroup()
  group udg_WayPointTB1=CreateGroup()
  group udg_WayPointT2=CreateGroup()
  group udg_WayPointTB2=CreateGroup()
  group udg_WayPointC1=CreateGroup()
  group udg_WayPointC2=CreateGroup()
  group udg_WayPointCB1=CreateGroup()
  group udg_WayPointCB2=CreateGroup()
  location udg_WayPointRandom_BT1=null
  location udg_WayPointRandom_BT2=null
  location udg_WayPointRandom_Center=null
  location udg_WayPointRandom_DesertHill=null
  location udg_KeepOutRandom=null
  location udg_CenterOfMap=null
  location udg_ForestKeepRandom=null
  location udg_SecretCave=null
  location udg_TopSpawn=null
  location udg_BottomSpawn=null
  location udg_LeftSpawn=null
  location udg_RightSpawn=null
  group udg_Brown_Group=CreateGroup()
  group udg_TopSpawn_Group=CreateGroup()
  group udg_LeftSpawn_Group=CreateGroup()
  group udg_RightSpawn_Group=CreateGroup()
  group udg_BottomSpawn_Group=CreateGroup()
  location udg_Top=null
  location udg_Bottom=null
  location udg_Right=null
  location udg_Left=null
  group udg_Top_Group=CreateGroup()
  group udg_Bottom_Group=CreateGroup()
  group udg_Right_Group=CreateGroup()
  group udg_Left_Group=CreateGroup()
  location array udg_MirrorAssasin_LastCreated
  group array udg_Mirror_Attack
  location udg_Thunderstorm_Position=null
  location udg_SoulCasterPos=null
  location udg_SoulAcensionRandom=null
  location udg_DeathCasterPos=null
  location udg_Turbo_Mode=null
  location udg_EnchantedAxe_CasterPos=null
  location udg_EnchantedAxe_TargetPos=null
  location udg_Blitz_CasterPos=null
  location udg_TerraUpheaval_Caster=null
  location udg_Hungeeer_Facing=null
  location udg_DragonRush_Position=null
  location udg_DragoonDynasty_Caster=null
  location udg_MaskedCaster_Position=null
  location udg_Shuriken_Position=null
  group udg_FrostWave_Group=CreateGroup()
  location udg_FallingRocks_Caster=null
  location udg_UppercutUnit_Position=null
  location udg_Orc_Slave_Position=null
  location udg_Wolf_Dummy_Position=null
  location udg_Tsunami_NonChannel=null
  location udg_Ancestral_Target=null
  unit udg_Ancestral_Spirit=null
  unit udg_AncestralSpirt_Target=null
  location udg_Drunken_Panda_Position=null
  integer udg_WindPercent=0
  integer udg_WindChance=0
  unit udg_Weather_Maker=null
  location udg_Weather_Position=null
  weathereffect udg_HeavyWinds=null
  integer udg_SnowPercent=0
  integer udg_SnowChance=0
  weathereffect udg_Snow=null
  integer udg_AcidRainChance=0
  integer udg_AcidRainPercent=0
  weathereffect udg_AcidRain=null
  weathereffect udg_DecayMist=null
  integer udg_DecayMistChance=0
  integer udg_DecayMistPercent=0
  unit udg_DragonDummy=null
  unit array udg_HeroSet
  rect gg_rct_Tavern
  rect gg_rct_Center_of_Map
  rect gg_rct_Top
  rect gg_rct_Left
  rect gg_rct_Right
  rect gg_rct_Bottom
  rect gg_rct_Top_Spawn
  rect gg_rct_Right_Spawn
  rect gg_rct_Bottom_Spawn
  rect gg_rct_Left_Spawn
  rect gg_rct_Secrect_Cave_Enter
  rect gg_rct_Secrect_Cave
  rect gg_rct_Forest_Exit
  rect gg_rct_pad
  rect gg_rct_time_stop2
  rect gg_rct_forest_keep
  rect gg_rct_world_tree_cine
  rect gg_rct_Out
  rect gg_rct_Shield_Moo_Cave
  rect gg_rct_keep_out
  rect gg_rct_battle_zone
  rect gg_rct_Mine_Field
  rect gg_rct_Potions
  rect gg_rct_Weapons
  rect gg_rct_Recipes
  rect gg_rct_Armor
  rect gg_rct_Moo_Moo_Square
  rect gg_rct_Desert
  rect gg_rct_Troll_Village
  rect gg_rct_Goblin_Village
  rect gg_rct_movie
  rect gg_rct_Goblin_Village_Cine
  rect gg_rct_naga_shop
  rect gg_rct_naga_front_shop
  rect gg_rct_Troll_Cine
  rect gg_rct_Instant_Revive
  rect gg_rct_Pedro_Negro_Cine
  rect gg_rct_Pedro_Negro_Open_Cine
  rect gg_rct_Desert_Hill
  rect gg_rct_centaur_first_wave
  rect gg_rct_centaur_second_wave
  rect gg_rct_BattleField_cine
  rect gg_rct_Sniper
  rect gg_rct_Summoner_Point
  rect gg_rct_Destroy
  rect gg_rct_goblin_zeplin_cine
  rect gg_rct_Shrine
  rect gg_rct_Goblin_4
  rect gg_rct_Goblin_2
  rect gg_rct_Goblin_3
  rect gg_rct_Goblin_1
  rect gg_rct_Clockwork_Position
  rect gg_rct_Sapper_Position
  rect gg_rct_Robo_Position
  rect gg_rct_Techie_Position
  rect gg_rct_Tinker
  rect gg_rct_Pocket_Factory
  rect gg_rct_Goblin_Unpause
  rect gg_rct_Showdown
  rect gg_rct_Hero_Switch
  rect gg_rct_Desert_Outskirts
  rect gg_rct_Burn_Trees
  rect gg_rct_Burn_Trees_2
  rect gg_rct_CentaurSpawn1
  rect gg_rct_CentaurSpawn2
  rect gg_rct_Tauren_Spawn2
  rect gg_rct_Tauren_Spawn1
  rect gg_rct_BloodBath_Stand1
  rect gg_rct_Hide_BloodUnits
  rect gg_rct_BloodBath_Killer
  rect gg_rct_Region_070
  rect gg_rct_EndingKhan
  rect gg_rct_EndingHeroes
  rect gg_rct_EndingMoo
  camerasetup gg_cam_Camera_001=CreateCameraSetup()
  camerasetup gg_cam_world_tree_cine=CreateCameraSetup()
  camerasetup gg_cam_Warcraft_Movie=CreateCameraSetup()
  camerasetup gg_cam_goblin_village_cine=CreateCameraSetup()
  camerasetup gg_cam_Pedro_Negro_start=CreateCameraSetup()
  camerasetup gg_cam_Pedro_Negro_move=CreateCameraSetup()
  camerasetup gg_cam_Pedro_Negro_View=CreateCameraSetup()
  camerasetup gg_cam_Centaur_cine=CreateCameraSetup()
  camerasetup gg_cam_MooMoo_cine=CreateCameraSetup()
  camerasetup gg_cam_MooMoo_battle_cine=CreateCameraSetup()
  camerasetup gg_cam_Centaur_cine2=CreateCameraSetup()
  camerasetup gg_cam_Moo_Moo_defeat=CreateCameraSetup()
  camerasetup gg_cam_Snipe=CreateCameraSetup()
  camerasetup gg_cam_Sniper_View=CreateCameraSetup()
  camerasetup gg_cam_Summon_Cam=CreateCameraSetup()
  camerasetup gg_cam_Start=CreateCameraSetup()
  camerasetup gg_cam_troll_village_cine1=CreateCameraSetup()
  camerasetup gg_cam_troll_village_cine2=CreateCameraSetup()
  camerasetup gg_cam_troll_village_cine3=CreateCameraSetup()
  camerasetup gg_cam_BloodBath_Death=CreateCameraSetup()
  camerasetup gg_cam_Ending_Cine=CreateCameraSetup()
  camerasetup gg_cam_FaceSlam=CreateCameraSetup()
  sound gg_snd_Levelupcaster
  sound gg_snd_BreathOfFrost1
  sound gg_snd_FlareTarget2
  sound gg_snd_LichKingDream
  sound gg_snd_MetalHeavySliceFlesh1
  sound gg_snd_MetalHeavySliceFlesh2
  sound gg_snd_MetalHeavySliceFlesh3
  sound gg_snd_KeeperOfTheGrovePissed1
  sound gg_snd_KeeperOfTheGrovePissed3
  sound gg_snd_HeroTinkerPissed6
  sound gg_snd_HeroTinkerPissed5
  sound gg_snd_HeroAlchemistPissed6
  sound gg_snd_IronGolemDeath1
  sound gg_snd_IronGolemPissed2
  sound gg_snd_IronGolemPissed3
  sound gg_snd_IronGolemWhat1
  sound gg_snd_IronGolemYes2
  sound gg_snd_GoblinSapperYesAttack3
  sound gg_snd_PandarenBrewmasterYesAttack2
  sound gg_snd_BuildingDeathLargeHuman
  sound gg_snd_Tension
  string gg_snd_Orc2="Sound\\Music\\mp3Music\\Orc2.mp3"
  sound gg_snd_CairneYesAttack4
  sound gg_snd_CairneYesAttack1
  sound gg_snd_D15ATagar06
  sound gg_snd_DraeneiYesAttack2
  sound gg_snd_CentaurReady1
  sound gg_snd_CentaurYesAttack1
  sound gg_snd_CentaurYesAttack3
  sound gg_snd_HeroTaurenChieftainWarcry1
  sound gg_snd_HeroTaurenChieftainWhat3
  sound gg_snd_TaurenDeath1
  sound gg_snd_TaurenReady1
  sound gg_snd_TaurenYesAttack1
  sound gg_snd_TaurenPissed1
  sound gg_snd_WhiteTaurenWarcry1
  sound gg_snd_CentaurArcherDeath
  sound gg_snd_CentaurDeath
  sound gg_snd_TaurenYesAttack3
  sound gg_snd_Warstomp
  sound gg_snd_ArrowAttack1
  sound gg_snd_ArrowImpact
  sound gg_snd_MetalHeavyChopFlesh2
  sound gg_snd_WoodHeavyBashFlesh1
  sound gg_snd_DestroyerMissile
  sound gg_snd_CentaurYes2
  sound gg_snd_CentaurPissed1
  string gg_snd_Doom="Sound\\Music\\mp3Music\\Doom.mp3"
  sound gg_snd_ShadowHunterPissed2
  sound gg_snd_SpiritWolfYesAttack3
  sound gg_snd_CrippleTarget1
  sound gg_snd_RestorationPotion
  sound gg_snd_LightningBolt
  sound gg_snd_ShadowHunterReady1
  sound gg_snd_ShadowHunterYes1
  sound gg_snd_ClockwerkGoblinYesAttack1
  sound gg_snd_GoblinZeppelinPissed2
  sound gg_snd_HeroShadowHunterDeath
  sound gg_snd_ShadowHunterWhat1
  sound gg_snd_ShadowHunterYes2
  sound gg_snd_GhoulPissed3
  sound gg_snd_ShamanPissed1
  sound gg_snd_MetalHeavySliceFlesh101
  sound gg_snd_MetalHeavySliceFlesh201
  sound gg_snd_PossessionMissileLaunch1
  sound gg_snd_CreepAggroWhat1
  sound gg_snd_HeroBladeMasterDeath
  sound gg_snd_HeroBladeMasterPissed1
  sound gg_snd_HeroBladeMasterWarcry1
  sound gg_snd_ReviveHuman
  sound gg_snd_QuestCompleted
  sound gg_snd_QuestNew
  sound gg_snd_CycloneBirth1
  sound gg_snd_FrostArmorTarget1
  sound gg_snd_Submerge1
  sound gg_snd_MonsoonRainLoop
  sound gg_snd_DarkSummoningTarget1
  trigger gg_trg_Map_Initialization_Copy=CreateTrigger()
  trigger gg_trg_No_ally_attack=CreateTrigger()
  trigger gg_trg_Skip=CreateTrigger()
  trigger gg_trg_Modes_off=CreateTrigger()
  trigger gg_trg_Turbo_Mode=CreateTrigger()
  trigger gg_trg_Dual_Heroes=null
  trigger gg_trg_map_ini=CreateTrigger()
  trigger gg_trg_Eyo=CreateTrigger()
  trigger gg_trg_Visibility_all=CreateTrigger()
  trigger gg_trg_Tavern=CreateTrigger()
  trigger gg_trg_Hero_Pick=CreateTrigger()
  trigger gg_trg_Hero_Pick_Copy=CreateTrigger()
  trigger gg_trg_Hero_Pick_Copy_2=CreateTrigger()
  trigger gg_trg_Hero_Pick_Copy_3=CreateTrigger()
  trigger gg_trg_Hero_Pick_Copy_4=CreateTrigger()
  trigger gg_trg_Hero_Pick_Copy_5=CreateTrigger()
  trigger gg_trg_Desert_Winds=CreateTrigger()
  trigger gg_trg_Tips=null
  trigger gg_trg_Instant_Revive=null
  trigger gg_trg_Cheat=null
  trigger gg_trg_Create_Multiboard=CreateTrigger()
  trigger gg_trg_Player_Kills_Update=CreateTrigger()
  trigger gg_trg_Player_Deaths_Update=CreateTrigger()
  trigger gg_trg_Player_Kills_Update_Copy=CreateTrigger()
  trigger gg_trg_Player_leaves=CreateTrigger()
  trigger gg_trg_Define_Colors=CreateTrigger()
  trigger gg_trg_Time_is_20_seconds=CreateTrigger()
  trigger gg_trg_Time_is_45_seconds=CreateTrigger()
  trigger gg_trg_Manual_Hero_Pick=CreateTrigger()
  trigger gg_trg_All_Random_Command=CreateTrigger()
  trigger gg_trg_Repick_Command=CreateTrigger()
  trigger gg_trg_Random_Command=CreateTrigger()
  trigger gg_trg_Help=CreateTrigger()
  trigger gg_trg_Undiscovered_Quests=CreateTrigger()
  trigger gg_trg_Weather=CreateTrigger()
  trigger gg_trg_Weather_On=CreateTrigger()
  trigger gg_trg_Under_Construction=CreateTrigger()
  trigger gg_trg_Construction_complete=CreateTrigger()
  trigger gg_trg_Goblin_1=CreateTrigger()
  trigger gg_trg_Goblin_2=CreateTrigger()
  trigger gg_trg_Goblin_3=CreateTrigger()
  trigger gg_trg_Goblin_4=CreateTrigger()
  trigger gg_trg_Statue_Pray=CreateTrigger()
  trigger gg_trg_Kerchek_Help=CreateTrigger()
  trigger gg_trg_Kerchek_Gone=CreateTrigger()
  trigger gg_trg_Quest_Pedro_Negro=CreateTrigger()
  trigger gg_trg_Quest_Pedro_Negro_Complete=CreateTrigger()
  trigger gg_trg_Quest_Kercheks_Soul=CreateTrigger()
  trigger gg_trg_Quest_Kercheks_Soul_Complete=CreateTrigger()
  trigger gg_trg_Select_Difficulty_Copy_Copy_2=CreateTrigger()
  trigger gg_trg_Button_pressed_in_difficulty_dialog_Copy_Copy_Copy=CreateTrigger()
  trigger gg_trg_Easy_Difficulty_Copy=CreateTrigger()
  trigger gg_trg_Normal_Difficulty_Copy=CreateTrigger()
  trigger gg_trg_Hard_Difficulty_Copy=CreateTrigger()
  trigger gg_trg_ExtraHard_Difficulty_Copy=CreateTrigger()
  trigger gg_trg_Impossible_Difficulty_Copy=CreateTrigger()
  trigger gg_trg_Ending=null
  trigger gg_trg_Bloodbath_Death=CreateTrigger()
  trigger gg_trg_Pause=CreateTrigger()
  trigger gg_trg_Troll_Village=CreateTrigger()
  trigger gg_trg_World_Tree=CreateTrigger()
  trigger gg_trg_Goblin_Village=CreateTrigger()
  trigger gg_trg_Pedro_Negro=CreateTrigger()
  trigger gg_trg_Pedro_Negro_Death=CreateTrigger()
  trigger gg_trg_Ultima_Weapon_Cine=CreateTrigger()
  trigger gg_trg_Ultima_Weapon_Crazy=CreateTrigger()
  trigger gg_trg_Invulnerable=CreateTrigger()
  trigger gg_trg_Vulnerable=CreateTrigger()
  trigger gg_trg_Centaur_Khan=CreateTrigger()
  trigger gg_trg_Stay=CreateTrigger()
  trigger gg_trg_Burn_Trees=CreateTrigger()
  trigger gg_trg_Tauren_Spawns=CreateTrigger()
  trigger gg_trg_Tauren_Spawns2=CreateTrigger()
  trigger gg_trg_Centaur_Spawns=CreateTrigger()
  trigger gg_trg_Centaur_Spawns2=CreateTrigger()
  trigger gg_trg_WayPoints=CreateTrigger()
  trigger gg_trg_Destroyed=CreateTrigger()
  trigger gg_trg_Combine_Items=CreateTrigger()
  trigger gg_trg_Enchanted_Axe=CreateTrigger()
  trigger gg_trg_Enchanted_ON=CreateTrigger()
  trigger gg_trg_Blitz=CreateTrigger()
  trigger gg_trg_Kinetic=CreateTrigger()
  trigger gg_trg_Terra_Upheaval=CreateTrigger()
  trigger gg_trg_Viral_rush=CreateTrigger()
  trigger gg_trg_Emma=CreateTrigger()
  trigger gg_trg_Red_Dynasty=CreateTrigger()
  trigger gg_trg_Ravage=CreateTrigger()
  trigger gg_trg_Hunger=CreateTrigger()
  trigger gg_trg_Incapacitating_Bite=null
  trigger gg_trg_Dynasty=null
  trigger gg_trg_Weapon_Mastery=null
  trigger gg_trg_Shurikentoss=CreateTrigger()
  trigger gg_trg_Thunderstorm=null
  trigger gg_trg_Ancient=CreateTrigger()
  trigger gg_trg_Ancient_ON=CreateTrigger()
  trigger gg_trg_Demi=CreateTrigger()
  trigger gg_trg_Synergy=CreateTrigger()
  trigger gg_trg_Perification=CreateTrigger()
  trigger gg_trg_Hail_Break=CreateTrigger()
  trigger gg_trg_Glacial_Path=CreateTrigger()
  trigger gg_trg_Scapalexis=CreateTrigger()
  trigger gg_trg_Cozi=CreateTrigger()
  trigger gg_trg_Damage_Block=CreateTrigger()
  trigger gg_trg_Cheese=CreateTrigger()
  trigger gg_trg_Cleaving=CreateTrigger()
  trigger gg_trg_Eyes_Cream=null
  trigger gg_trg_Lightning=CreateTrigger()
  trigger gg_trg_Shadow=CreateTrigger()
  trigger gg_trg_Blade_Dance=CreateTrigger()
  trigger gg_trg_Naisha=CreateTrigger()
  trigger gg_trg_Panda=CreateTrigger()
  trigger gg_trg_Minotaur=CreateTrigger()
  trigger gg_trg_Direct=CreateTrigger()
  trigger gg_trg_Pong=CreateTrigger()
  trigger gg_trg_Meteor=CreateTrigger()
  trigger gg_trg_Mark=CreateTrigger()
  trigger gg_trg_Warden=CreateTrigger()
  trigger gg_trg_Poseidon=CreateTrigger()
  trigger gg_trg_Return_of_Tombo=CreateTrigger()
  trigger gg_trg_Forest_Watcher_Control=CreateTrigger()
  trigger gg_trg_Keep_Out=CreateTrigger()
  trigger gg_trg_Step_Pad=CreateTrigger()
  trigger gg_trg_Exit_Forest=CreateTrigger()
  trigger gg_trg_Forest_Watchers=CreateTrigger()
  trigger gg_trg_Exit_Cave=CreateTrigger()
  trigger gg_trg_Enter_Cave=CreateTrigger()
  trigger gg_trg_Explode=CreateTrigger()
  trigger gg_trg_Explode_Copy=CreateTrigger()
  trigger gg_trg_Explode_Copy_2=CreateTrigger()
  trigger gg_trg_Armor_Up=CreateTrigger()
  trigger gg_trg_Frost_Guard=CreateTrigger()
  trigger gg_trg_Ballista=CreateTrigger()
  trigger gg_trg_Mythril_Rod=CreateTrigger()
  trigger gg_trg_Ballista_4sho=CreateTrigger()
  trigger gg_trg_War_Club_4sho=CreateTrigger()
  trigger gg_trg_Mystile_4sho=CreateTrigger()
  trigger gg_trg_Tetra_Element_4sho=CreateTrigger()
  trigger gg_trg_Nature_Staff_4sho=CreateTrigger()
  trigger gg_trg_Trance_4sho=CreateTrigger()
  trigger gg_trg_Regen_4sho=CreateTrigger()
  trigger gg_trg_Band_4sho=CreateTrigger()
  trigger gg_trg_Razorspine_4sho=CreateTrigger()
  trigger gg_trg_Ratmik_4sho=CreateTrigger()
  trigger gg_trg_Sword_of_Mogrin_4sho=CreateTrigger()
  trigger gg_trg_Reaver_4sho=CreateTrigger()
  trigger gg_trg_Sheep_Stick_4sho=CreateTrigger()
  trigger gg_trg_Orb_of_Eternal_4sho=CreateTrigger()
  trigger gg_trg_Helm_of_Deathlord_4sho=CreateTrigger()
  trigger gg_trg_Halberd_4sho=CreateTrigger()
  trigger gg_trg_Axe_of_Mayhem_4sho=CreateTrigger()
  trigger gg_trg_Grim_Batol_4sho=CreateTrigger()
  trigger gg_trg_Wiser_4sho=CreateTrigger()
  trigger gg_trg_Killer7_4sho=CreateTrigger()
  trigger gg_trg_Serpent_Staff_4sho=CreateTrigger()
  trigger gg_trg_Muradin_4sho=CreateTrigger()
  trigger gg_trg_Ziedrich_4sho=CreateTrigger()
  trigger gg_trg_Axe_of_Killmaim=CreateTrigger()
  trigger gg_trg_Radiance=CreateTrigger()
  trigger gg_trg_Ragnarok=CreateTrigger()
  trigger gg_trg_Druid_Claw=CreateTrigger()
  trigger gg_trg_Mystile=CreateTrigger()
  trigger gg_trg_Eternal_Booster=CreateTrigger()
  trigger gg_trg_Gloves_of_Speed=CreateTrigger()
  trigger gg_trg_Mystic_Staff=CreateTrigger()
  trigger gg_trg_Pacaya_1=CreateTrigger()
  trigger gg_trg_Pacaya_2=CreateTrigger()
  trigger gg_trg_Rhokan=CreateTrigger()
  trigger gg_trg_Pacaya_3=CreateTrigger()
  trigger gg_trg_Demonic=CreateTrigger()
  trigger gg_trg_Killer7=CreateTrigger()
  trigger gg_trg_Grim_Batol=CreateTrigger()
  trigger gg_trg_Pacaya_4=CreateTrigger()
  trigger gg_trg_Ratmik=CreateTrigger()
  trigger gg_trg_Trance=CreateTrigger()
  trigger gg_trg_Scales_of_Razor=CreateTrigger()
  trigger gg_trg_Sword_of_Mogrin=CreateTrigger()
  trigger gg_trg_Unholy_Shield=CreateTrigger()
  trigger gg_trg_Axe=CreateTrigger()
  trigger gg_trg_Nature=CreateTrigger()
  trigger gg_trg_Lightning_Staff=CreateTrigger()
  trigger gg_trg_Sheep_Stick=CreateTrigger()
  trigger gg_trg_Bar=CreateTrigger()
  trigger gg_trg_Axe_of_Mayhem=CreateTrigger()
  trigger gg_trg_Lionheart_Seal=CreateTrigger()
  trigger gg_trg_Maul_of_Strength=CreateTrigger()
  trigger gg_trg_Reaver=CreateTrigger()
  trigger gg_trg_Muradins=CreateTrigger()
  trigger gg_trg_Halberdd=CreateTrigger()
  trigger gg_trg_BHeart=CreateTrigger()
  trigger gg_trg_Wiser=CreateTrigger()
  trigger gg_trg_Lariat=CreateTrigger()
  trigger gg_trg_War_Club=CreateTrigger()
  trigger gg_trg_Totem=CreateTrigger()
  trigger gg_trg_Orb_of_Eternal_Power=CreateTrigger()
  trigger gg_trg_Ziedrich=CreateTrigger()
  trigger gg_trg_Minerva_Band=CreateTrigger()
  trigger gg_trg_Ultima=CreateTrigger()
  trigger gg_trg_Tetra_E=CreateTrigger()
  trigger gg_trg_Regeneration=CreateTrigger()
  trigger gg_trg_Uther_Hammer=CreateTrigger()
  trigger gg_trg_Pendant_of_Power=CreateTrigger()
  trigger gg_trg_Helm_of_the_Deathlord=CreateTrigger()
  trigger gg_trg_Acquires_Item=CreateTrigger()
  trigger gg_trg_Frost_Guard2=CreateTrigger()
  trigger gg_trg_Gloves_of_Speed2=CreateTrigger()
  trigger gg_trg_Axe_of_Killmaim2=CreateTrigger()
  trigger gg_trg_Skull_Shield2=CreateTrigger()
  trigger gg_trg_Helm_of_the_Deathlord2=CreateTrigger()
  trigger gg_trg_Orb_of_Eternal_Power2=CreateTrigger()
  trigger gg_trg_Cloak_of_Shadows2=CreateTrigger()
  trigger gg_trg_Eternal_Booster2=CreateTrigger()
  trigger gg_trg_Quatl_Bar2=CreateTrigger()
  trigger gg_trg_Ring_of_Superiority2=CreateTrigger()
  trigger gg_trg_Mystic_Staff2=CreateTrigger()
  trigger gg_trg_Muradiins_Hammer2=CreateTrigger()
  trigger gg_trg_Weather_Set_Chances=CreateTrigger()
  trigger gg_trg_Weather_Changes=null
  trigger gg_trg_Wave_Number=CreateTrigger()
  trigger gg_trg_Level_1=CreateTrigger()
  trigger gg_trg_Level_2=CreateTrigger()
  trigger gg_trg_Level_3=CreateTrigger()
  trigger gg_trg_Level_4=CreateTrigger()
  trigger gg_trg_Level_5=CreateTrigger()
  trigger gg_trg_Level_6=CreateTrigger()
  trigger gg_trg_Level_7=CreateTrigger()
  trigger gg_trg_Level_8=CreateTrigger()
  trigger gg_trg_Level_9=CreateTrigger()
  trigger gg_trg_Level_10=CreateTrigger()
  trigger gg_trg_Level_11=CreateTrigger()
  trigger gg_trg_Level_12=CreateTrigger()
  trigger gg_trg_Level_13=CreateTrigger()
  trigger gg_trg_Level_14=CreateTrigger()
  trigger gg_trg_Level_15=CreateTrigger()
  trigger gg_trg_Level_16=CreateTrigger()
  trigger gg_trg_Level_17=CreateTrigger()
  trigger gg_trg_Level_18=CreateTrigger()
  trigger gg_trg_Level_19=CreateTrigger()
  trigger gg_trg_Level_20b=CreateTrigger()
  trigger gg_trg_Level_21=CreateTrigger()
  trigger gg_trg_Level_22=CreateTrigger()
  trigger gg_trg_Level_23=CreateTrigger()
  trigger gg_trg_Level_24=CreateTrigger()
  trigger gg_trg_Level_25=CreateTrigger()
  trigger gg_trg_Level_26=CreateTrigger()
  trigger gg_trg_Level_27=CreateTrigger()
  trigger gg_trg_Level_28=CreateTrigger()
  trigger gg_trg_Level_29=CreateTrigger()
  trigger gg_trg_Level_30=CreateTrigger()
  trigger gg_trg_Level_31=CreateTrigger()
  trigger gg_trg_Level_32=CreateTrigger()
  trigger gg_trg_Level_33=CreateTrigger()
  trigger gg_trg_Level_34=CreateTrigger()
  trigger gg_trg_Level_35=CreateTrigger()
  trigger gg_trg_YOU_WON_Copy=CreateTrigger()
  trigger gg_trg_Move_Copy=CreateTrigger()
  trigger gg_trg_Creep_Timer=CreateTrigger()
  trigger gg_trg_Dual_Creep_Timer=CreateTrigger()
  trigger gg_trg_Creep_Timer_Extreme=CreateTrigger()
  trigger gg_trg_Timer_Destroy=CreateTrigger()
  trigger gg_trg_Timer_On_Goblin=CreateTrigger()
  trigger gg_trg_Timer_On_Troll=CreateTrigger()
  trigger gg_trg_Player1_Leaves=CreateTrigger()
  trigger gg_trg_Player1_Leaves_Copy=CreateTrigger()
  trigger gg_trg_Player2_Leaves=CreateTrigger()
  trigger gg_trg_Player1_Leaves_Copy_Copy=CreateTrigger()
  trigger gg_trg_Player3_Leaves=CreateTrigger()
  trigger gg_trg_Player1_Leaves_Copy_Copy_2=CreateTrigger()
  trigger gg_trg_Player4_Leaves=CreateTrigger()
  trigger gg_trg_Player1_Leaves_Copy_Copy_3=CreateTrigger()
  trigger gg_trg_Player5_Leaves=CreateTrigger()
  trigger gg_trg_Player1_Leaves_Copy_Copy_4=CreateTrigger()
  trigger gg_trg_Player6_Leaves=CreateTrigger()
  trigger gg_trg_Player1_Leaves_Copy_Copy_5=CreateTrigger()
  trigger gg_trg_Worldwide_Tree_Respawn=CreateTrigger()
  trigger gg_trg_Mine_Field_Revive=null
  trigger gg_trg_Mines_Revive=null
  trigger gg_trg_Lose=CreateTrigger()
  trigger gg_trg_Revive_Hero_Local=CreateTrigger()
  trigger gg_trg_Revive_Hero_Local_Copy=null
  trigger gg_trg_Revive_Hero_Local_Copy_Copy_2=null
  trigger gg_trg_Revive_instant=null
  trigger gg_trg_Revive_instant_Red=null
  trigger gg_trg_Revive_instant_Blue=null
  trigger gg_trg_Revive_instant_Teal=null
  trigger gg_trg_Revive_instant_Purple=null
  trigger gg_trg_Revive_instant_Yellow=null
  trigger gg_trg_Revive_instant_Orange=null
  trigger gg_trg_Shadow_Fury=CreateTrigger()
  trigger gg_trg_Mirror_Assassins=CreateTrigger()
  trigger gg_trg_Move=CreateTrigger()
  trigger gg_trg_Remove=CreateTrigger()
  trigger gg_trg_Attack=CreateTrigger()
  trigger gg_trg_Focused_Fire=CreateTrigger()
  trigger gg_trg_Knocked_Back=CreateTrigger()
  trigger gg_trg_Thunderstorm_Non_Channel=CreateTrigger()
  trigger gg_trg_Osmose=CreateTrigger()
  trigger gg_trg_Start=CreateTrigger()
  trigger gg_trg_cont=CreateTrigger()
  trigger gg_trg_End=CreateTrigger()
  trigger gg_trg_Death_Pulse_Multicasts=CreateTrigger()
  trigger gg_trg_Death_Pulse_Mult=CreateTrigger()
  trigger gg_trg_Blade_Massacre=CreateTrigger()
  trigger gg_trg_Shadow1Movement=CreateTrigger()
  trigger gg_trg_Shadow2Movement=CreateTrigger()
  trigger gg_trg_Shadow3Movement=CreateTrigger()
  trigger gg_trg_Shadow4Movement=CreateTrigger()
  trigger gg_trg_Shadow5Movement=CreateTrigger()
  trigger gg_trg_Blast_Start_Graphic=CreateTrigger()
  trigger gg_trg_Blast_Start=CreateTrigger()
  trigger gg_trg_Aerial_strike=CreateTrigger()
  trigger gg_trg_Aerial_move=CreateTrigger()
  trigger gg_trg_Earth_slayer_cast=CreateTrigger()
  trigger gg_trg_Earth_slayer_charge=CreateTrigger()
  trigger gg_trg_Slam=CreateTrigger()
  trigger gg_trg_Cast=CreateTrigger()
  trigger gg_trg_Charged_Unit_Attacked=CreateTrigger()
  trigger gg_trg_Show=CreateTrigger()
  trigger gg_trg_Rend=CreateTrigger()
  trigger gg_trg_Show_Copy=CreateTrigger()
  trigger gg_trg_Hungeeer=CreateTrigger()
  trigger gg_trg_Hungeeer_move=CreateTrigger()
  trigger gg_trg_Hungeeer_animation=CreateTrigger()
  trigger gg_trg_Hungeeer_move_2=CreateTrigger()
  trigger gg_trg_Hungeeer_target_die=CreateTrigger()
  trigger gg_trg_Shen_daorong=CreateTrigger()
  trigger gg_trg_Shen_daorong_move=CreateTrigger()
  trigger gg_trg_Dragon_Barrage=null
  trigger gg_trg_Dragon_Rush=CreateTrigger()
  trigger gg_trg_Scatter_Shot=CreateTrigger()
  trigger gg_trg_Shot_animation=CreateTrigger()
  trigger gg_trg_Dragoon_Dynasty=CreateTrigger()
  trigger gg_trg_Shuriken_Points=CreateTrigger()
  trigger gg_trg_Shuriken=CreateTrigger()
  trigger gg_trg_Frozen_Field_Setup_Copy=CreateTrigger()
  trigger gg_trg_Frozen_Field_I_Copy=CreateTrigger()
  trigger gg_trg_Frozen_Field_II_Copy=CreateTrigger()
  trigger gg_trg_If_Channelling_stops_Copy=CreateTrigger()
  trigger gg_trg_Hydro_Pump_Setup=CreateTrigger()
  trigger gg_trg_Hydro_Pump_I=CreateTrigger()
  trigger gg_trg_Hydro_Pump_II=CreateTrigger()
  trigger gg_trg_If_Channelling_stops=CreateTrigger()
  trigger gg_trg_Frost_Wave=CreateTrigger()
  gamecache gg_trg_Boomerang_Axes
  trigger gg_trg_NonChannel=CreateTrigger()
  trigger gg_trg_Uppercut=CreateTrigger()
  trigger gg_trg_Poseidons_Wrath=CreateTrigger()
  trigger gg_trg_Poseidon_Effects=CreateTrigger()
  trigger gg_trg_Tidal_Wave=CreateTrigger()
  trigger gg_trg_Wolf_Fist_Points=CreateTrigger()
  trigger gg_trg_Wolf_Fang_Fist=CreateTrigger()
  trigger gg_trg_Tsunami_Non_Channel=CreateTrigger()
  trigger gg_trg_Freeze_Explosion=CreateTrigger()
  trigger gg_trg_Freeze_Explosion_Copy=CreateTrigger()
  trigger gg_trg_Freeze_Explosion_Copy_2=CreateTrigger()
  trigger gg_trg_Freeze_Explosion_Copy_3=CreateTrigger()
  trigger gg_trg_Hex_Wave=CreateTrigger()
  trigger gg_trg_Root_Wave=CreateTrigger()
  trigger gg_trg_Flaming_Wave=CreateTrigger()
  trigger gg_trg_Split_Shot=CreateTrigger()
  trigger gg_trg_Manastrike=CreateTrigger()
  trigger gg_trg_Swift_Attack=null
  trigger gg_trg_Swift_Attack02=null
  trigger gg_trg_End_Swift_Attack=null
  trigger gg_trg_Text_Thingy=null
  trigger gg_trg_Text_Thingy02=null
  trigger gg_trg_Swift_Attack_Copy=CreateTrigger()
  trigger gg_trg_Swift_Attack02_Copy=CreateTrigger()
  trigger gg_trg_End_Swift_Attack_Copy=CreateTrigger()
  trigger gg_trg_Text_Thingy_Copy=CreateTrigger()
  trigger gg_trg_Text_Thingy02_Copy=CreateTrigger()
  gamecache gg_trg_MultiDrain
  trigger gg_trg_Frozen_Chaos=CreateTrigger()
  trigger gg_trg_Slow=CreateTrigger()
  trigger gg_trg_Cyclone=CreateTrigger()
  trigger gg_trg_Ancestral_Spirits=CreateTrigger()
  trigger gg_trg_Spirits_Target=CreateTrigger()
  trigger gg_trg_Mark_of_Flames=CreateTrigger()
  trigger gg_trg_Flames_Explosion=CreateTrigger()
  trigger gg_trg_Tri_Disatser=CreateTrigger()
  trigger gg_trg_Tri_Target=CreateTrigger()
  trigger gg_trg_Drunken_Brawler=CreateTrigger()
  trigger gg_trg_Drunken_Flee=CreateTrigger()
  trigger gg_trg_Flee_Point=CreateTrigger()
  trigger gg_trg_Shadow_Gate=null
  trigger gg_trg_Shadow_Gate_Copy=CreateTrigger()
  trigger gg_trg_Shadow_Bash=CreateTrigger()
  trigger gg_trg_Return_Shadow=CreateTrigger()
  trigger gg_trg_Displace_Shadow=CreateTrigger()
  trigger gg_trg_Shadowless=CreateTrigger()
  trigger gg_trg_Return_to_Body=CreateTrigger()
  trigger gg_trg_Shadow_Stalk=CreateTrigger()
  trigger gg_trg_Break_Shadow_Stalk=CreateTrigger()
  trigger gg_trg_Shadow_Gaze=CreateTrigger()
  trigger gg_trg_Remove_Casters=CreateTrigger()
  trigger gg_trg_Set_Chances=CreateTrigger()
  trigger gg_trg_Passive_Perification=CreateTrigger()
  trigger gg_trg_Passive_Summon=CreateTrigger()
  trigger gg_trg_Passive_Summon_Check=CreateTrigger()
  trigger gg_trg_Passive_Berserk=CreateTrigger()
  trigger gg_trg_Passive_Unstable_Power=CreateTrigger()
  unit gg_unit_ofrt_0001
  unit gg_unit_n028_0298
  unit gg_unit_hwtw_0008
  unit gg_unit_hwtw_0009
  unit gg_unit_hwtw_0010
  unit gg_unit_hwtw_0011
  unit gg_unit_hwtw_0015
  unit gg_unit_hwtw_0016
  unit gg_unit_n02W_0280
  unit gg_unit_n02W_0289
  unit gg_unit_nglm_0042
  unit gg_unit_nglm_0043
  unit gg_unit_nglm_0044
  unit gg_unit_n01M_0045
  unit gg_unit_n01L_0046
  unit gg_unit_e00Q_0282
  unit gg_unit_u00T_0049
  unit gg_unit_u00T_0050
  unit gg_unit_u00T_0051
  unit gg_unit_n01T_0064
  unit gg_unit_Ntin_0226
  unit gg_unit_ncg3_0233
  unit gg_unit_Nalm_0236
  unit gg_unit_n028_0297
  unit gg_unit_o01P_0295
  unit gg_unit_o019_0288
  destructable gg_dest_YTfb_1857
  destructable gg_dest_YTfb_1858
  destructable gg_dest_YTfb_1856
  destructable gg_dest_YTfb_1855
  destructable gg_dest_YTpb_1537
  destructable gg_dest_YTpb_1535
  destructable gg_dest_YTpb_1536
  destructable gg_dest_YTpb_1534
  destructable gg_dest_YTfb_1852
  destructable gg_dest_YTfb_1851
  destructable gg_dest_YTfb_1850
  destructable gg_dest_YTfb_1848
  destructable gg_dest_DTfp_0841
  destructable gg_dest_YTfb_1859
  destructable gg_dest_YTfb_1849
  destructable gg_dest_YTfb_1854
  destructable gg_dest_YTpb_1539
  destructable gg_dest_YTpb_1538
  destructable gg_dest_YTfb_1853
  destructable gg_dest_LOcg_1956
  destructable gg_dest_ZTg1_1962
  destructable gg_dest_YT26_0691
  destructable gg_dest_LTrc_2048
  hashtable udg_typecasting=null 
endglobals

function Unit000045_DropItems takes nothing returns nothing
  local widget trigWidget=null
  local unit trigUnit=null
  local integer itemID=0
  local boolean canDrop=true
  set trigWidget=bj_lastDyingWidget
  if(trigWidget==null)then
    set trigUnit=GetTriggerUnit()
  endif
  if(trigUnit!=null)then
    set canDrop=not IsUnitHidden(trigUnit)
    if(canDrop and GetChangingUnit()!=null)then
      set canDrop=(GetChangingUnitPrevOwner()==Player(12))
    endif
  endif
  if(canDrop)then
    call RandomDistReset()
    call RandomDistAddItem('I049','d')
    set itemID=RandomDistChoose()
    if(trigUnit!=null)then
      call UnitDropItem(trigUnit,itemID)
    else
      call WidgetDropItem(trigWidget,itemID)
    endif
  endif
  set bj_lastDyingWidget=null
  call DestroyTrigger(GetTriggeringTrigger())
endfunction

function Unit000046_DropItems takes nothing returns nothing
  local widget trigWidget=null
  local unit trigUnit=null
  local integer itemID=0
  local boolean canDrop=true
  set trigWidget=bj_lastDyingWidget
  if(trigWidget==null)then
    set trigUnit=GetTriggerUnit()
  endif
  if(trigUnit!=null)then
    set canDrop=not IsUnitHidden(trigUnit)
    if(canDrop and GetChangingUnit()!=null)then
      set canDrop=(GetChangingUnitPrevOwner()==Player(12))
    endif
  endif
  if(canDrop)then
    call RandomDistReset()
    call RandomDistAddItem('I048','d')
    set itemID=RandomDistChoose()
    if(trigUnit!=null)then
      call UnitDropItem(trigUnit,itemID)
    else
      call WidgetDropItem(trigWidget,itemID)
    endif
  endif
  set bj_lastDyingWidget=null
  call DestroyTrigger(GetTriggeringTrigger())
endfunction

function Unit000047_DropItems takes nothing returns nothing
  local widget trigWidget=null
  local unit trigUnit=null
  local integer itemID=0
  local boolean canDrop=true
  set trigWidget=bj_lastDyingWidget
  if(trigWidget==null)then
    set trigUnit=GetTriggerUnit()
  endif
  if(trigUnit!=null)then
    set canDrop=not IsUnitHidden(trigUnit)
    if(canDrop and GetChangingUnit()!=null)then
      set canDrop=(GetChangingUnitPrevOwner()==Player(12))
    endif
  endif
  if(canDrop)then
    call RandomDistReset()
    call RandomDistAddItem('I04S','d')
    set itemID=RandomDistChoose()
    if(trigUnit!=null)then
      call UnitDropItem(trigUnit,itemID)
    else
      call WidgetDropItem(trigWidget,itemID)
    endif
  endif
  set bj_lastDyingWidget=null
  call DestroyTrigger(GetTriggeringTrigger())
endfunction

function Unit000193_DropItems takes nothing returns nothing
  local widget trigWidget=null
  local unit trigUnit=null
  local integer itemID=0
  local boolean canDrop=true
  set trigWidget=bj_lastDyingWidget
  if(trigWidget==null)then
    set trigUnit=GetTriggerUnit()
  endif
  if(trigUnit!=null)then
    set canDrop=not IsUnitHidden(trigUnit)
    if(canDrop and GetChangingUnit()!=null)then
      set canDrop=(GetChangingUnitPrevOwner()==Player(12))
    endif
  endif
  if(canDrop)then
    call RandomDistReset()
    call RandomDistAddItem('I04I','d')
    set itemID=RandomDistChoose()
    if(trigUnit!=null)then
      call UnitDropItem(trigUnit,itemID)
    else
      call WidgetDropItem(trigWidget,itemID)
    endif
  endif
  set bj_lastDyingWidget=null
  call DestroyTrigger(GetTriggeringTrigger())
endfunction

function Unit000280_DropItems takes nothing returns nothing
  local widget trigWidget=null
  local unit trigUnit=null
  local integer itemID=0
  local boolean canDrop=true
  set trigWidget=bj_lastDyingWidget
  if(trigWidget==null)then
    set trigUnit=GetTriggerUnit()
  endif
  if(trigUnit!=null)then
    set canDrop=not IsUnitHidden(trigUnit)
    if(canDrop and GetChangingUnit()!=null)then
      set canDrop=(GetChangingUnitPrevOwner()==Player(12))
    endif
  endif
  if(canDrop)then
    call RandomDistReset()
    call RandomDistAddItem('I04R','d')
    set itemID=RandomDistChoose()
    if(trigUnit!=null)then
      call UnitDropItem(trigUnit,itemID)
    else
      call WidgetDropItem(trigWidget,itemID)
    endif
  endif
  set bj_lastDyingWidget=null
  call DestroyTrigger(GetTriggeringTrigger())
endfunction

function Unit000281_DropItems takes nothing returns nothing
  local widget trigWidget=null
  local unit trigUnit=null
  local integer itemID=0
  local boolean canDrop=true
  set trigWidget=bj_lastDyingWidget
  if(trigWidget==null)then
    set trigUnit=GetTriggerUnit()
  endif
  if(trigUnit!=null)then
    set canDrop=not IsUnitHidden(trigUnit)
    if(canDrop and GetChangingUnit()!=null)then
      set canDrop=(GetChangingUnitPrevOwner()==Player(12))
    endif
  endif
  if(canDrop)then
    call RandomDistReset()
    call RandomDistAddItem('I04Z','d')
    set itemID=RandomDistChoose()
    if(trigUnit!=null)then
      call UnitDropItem(trigUnit,itemID)
    else
      call WidgetDropItem(trigWidget,itemID)
    endif
  endif
  set bj_lastDyingWidget=null
  call DestroyTrigger(GetTriggeringTrigger())
endfunction

function Doodad000163_DropItems takes nothing returns nothing
  local widget trigWidget=null
  local unit trigUnit=null
  local integer itemID=0
  local boolean canDrop=true
  set trigWidget=bj_lastDyingWidget
  if(trigWidget==null)then
    set trigUnit=GetTriggerUnit()
  endif
  if(trigUnit!=null)then
    set canDrop=not IsUnitHidden(trigUnit)
    if(canDrop and GetChangingUnit()!=null)then
      set canDrop=(GetChangingUnitPrevOwner()==Player(12))
    endif
  endif
  if(canDrop)then
    call RandomDistReset()
    call RandomDistAddItem('I051','d')
    set itemID=RandomDistChoose()
    if(trigUnit!=null)then
      call UnitDropItem(trigUnit,itemID)
    else
      call WidgetDropItem(trigWidget,itemID)
    endif
  endif
  set bj_lastDyingWidget=null
  call DestroyTrigger(GetTriggeringTrigger())
endfunction

function Doodad001960_DropItems takes nothing returns nothing
  local widget trigWidget=null
  local unit trigUnit=null
  local integer itemID=0
  local boolean canDrop=true
  set trigWidget=bj_lastDyingWidget
  if(trigWidget==null)then
    set trigUnit=GetTriggerUnit()
  endif
  if(trigUnit!=null)then
    set canDrop=not IsUnitHidden(trigUnit)
    if(canDrop and GetChangingUnit()!=null)then
      set canDrop=(GetChangingUnitPrevOwner()==Player(12))
    endif
  endif
  if(canDrop)then
    call RandomDistReset()
    call RandomDistAddItem('I050','d')
    set itemID=RandomDistChoose()
    if(trigUnit!=null)then
      call UnitDropItem(trigUnit,itemID)
    else
      call WidgetDropItem(trigWidget,itemID)
    endif
  endif
  set bj_lastDyingWidget=null
  call DestroyTrigger(GetTriggeringTrigger())
endfunction

function CSCache takes nothing returns gamecache
  set udg_asetsint=0
  call FlushGameCache(InitGameCache("attachvars.vx"))
  set udg_cscache=InitGameCache("attachvars.vx")
  set udg_typecasting=InitHashtable()
  return udg_cscache
endfunction

function AttachInt takes handle h,string label,integer x returns nothing
  local string k=I2S(GetHandleId(h))
  if x==0 then
    call FlushStoredInteger(udg_cscache,k,label)
  else
    call StoreInteger(udg_cscache,k,label,x)
  endif
endfunction

function AttachReal takes handle h,string label,real x returns nothing
  local string k=I2S(GetHandleId(h))
  if x==0 then
    call FlushStoredReal(udg_cscache,k,label)
  else
    call StoreReal(udg_cscache,k,label,x)
  endif
endfunction

function AttachBoolean takes handle h,string label,boolean x returns nothing
  local string k=I2S(GetHandleId(h))
  if not x then
    call FlushStoredBoolean(udg_cscache,k,label)
  else
    call StoreBoolean(udg_cscache,k,label,x)
  endif
endfunction

function AttachString takes handle h,string label,string x returns nothing
  local string k=I2S(GetHandleId(h))
  if x==""then
    call FlushStoredString(udg_cscache,k,label)
  else
    call StoreString(udg_cscache,k,label,x)
  endif
endfunction

function AttachObject takes handle h,string label,handle x returns nothing
  call AttachInt(h,label,GetHandleId(x))
endfunction

function GetAttachedInt takes handle h,string label returns integer
  local integer r=udg_asetsint
  local integer i
  local integer L
  local string c
  local string num
  if(r>0)then
    if SubString(label,0,1)=="#"then
      set udg_asetsint=r-1
      set i=0
      set num=""
      loop
        set i=i+1
        set c=SubString(label,i,i+1)
        exitwhen(c==";")or(c=="")
        set num=num+c
      endloop
      if c==";"then
        return GetStoredInteger(udg_cscache,I2S(GetHandleId(h))+";"+SubString(label,i+1,StringLength(label)+1),num)
      endif
    endif
  endif
  return GetStoredInteger(udg_cscache,I2S(GetHandleId(h)),label)
endfunction

function GetAttachedUnit takes handle h,string label returns unit
  local integer i = GetAttachedInt(h,label)
  if(i!= null)then
    return i
  endif
  return null  
endfunction

function FromSetElement takes string setn,integer index returns string
  set udg_asetsint=udg_asetsint+1
  return"#"+I2S(index)+";"+setn
endfunction

function AttachedSetAddInt takes handle h,string setn,integer int returns nothing
  local gamecache g=udg_cscache
  local string k=I2S(GetHandleId(h))
  local integer n
  local integer x=GetStoredInteger(g,k,"#setnumberof;"+setn)
  local integer y
  if x==0 then
    set y=GetStoredInteger(g,k,"#totalsets")+1
    call StoreInteger(g,k,"#totalsets",y)
    call StoreInteger(g,k,"#setnumberof;"+setn,y)
    call StoreString(g,k,"#setName;"+I2S(y),setn)
  endif
  set k=k+";"+setn
  if not HaveStoredInteger(g,k,"Pos"+I2S(int))then
    set n=GetStoredInteger(g,k,"n")+1
    call StoreInteger(g,k,"n",n)
    call StoreInteger(g,k,I2S(n),int)
    call StoreInteger(g,k,"Pos"+I2S(int),n)
  endif
  set g=null
endfunction

function AttachedSetAddObject takes handle h,string setn,handle val returns nothing
  call AttachedSetAddInt(h,setn,GetHandleId(val))
endfunction

function AttachedSetHasInt takes handle h,string setn,integer int returns boolean
  return HaveStoredInteger(udg_cscache,I2S(GetHandleId(h))+";"+setn,"Pos"+I2S(int))
endfunction

function AttachedSetHasObject takes handle h,string setn,handle val returns boolean
  return AttachedSetHasInt(h,setn,GetHandleId(val))
endfunction

function GetAttachedSetSize takes handle h,string setn returns integer
  return GetStoredInteger(udg_cscache,I2S(GetHandleId(h))+";"+setn,"n")
endfunction

function AttachedSetRemInt takes handle h,string setn,integer int returns nothing
  local gamecache g=udg_cscache
  local string k=I2S(GetHandleId(h))+";"+setn
  local integer n
  local integer x
  local integer y
  if HaveStoredInteger(g,k,"Pos"+I2S(int))then
    set x=GetStoredInteger(g,k,"Pos"+I2S(int))
    set n=GetStoredInteger(g,k,"n")
    if x!=n then
      set y=GetStoredInteger(g,k,I2S(n))
      call StoreInteger(g,k,I2S(x),y)
      call StoreInteger(g,k,"Pos"+I2S(y),x)
    endif
    call FlushStoredInteger(g,k,"Pos"+I2S(int))
    call FlushStoredInteger(g,k,I2S(n))
    call StoreInteger(g,k,"n",n-1)
  endif
  set g=null
endfunction

function AttachedSetRemObject takes handle h,string setn,handle val returns nothing
  call AttachedSetRemInt(h,setn,GetHandleId(val))
endfunction

function ClearAttachedSet takes handle h,string setn returns nothing
  call FlushStoredMission(udg_cscache,I2S(GetHandleId(h))+";"+setn)
endfunction

function CleanAttachedVars takes handle h returns nothing
  local gamecache g=udg_cscache
  local string k=I2S(GetHandleId(h))
  local integer n=GetStoredInteger(g,k,"#totalsets")
  local integer i=1
  loop
    exitwhen i>n
    call FlushStoredMission(g,k+";"+GetStoredString(g,k,"#setName;"+I2S(i)))
    set i=i+1
  endloop
  call FlushStoredMission(g,k)
  set g=null
endfunction

function MoveUnitToPolarProjection takes unit tomove,real dist,real angle returns nothing
  call SetUnitPosition(tomove,GetUnitX(tomove)+dist*Cos(angle*.017453),GetUnitY(tomove)+dist*Sin(angle*.017453))
endfunction

function Trig_Map_Initialization_Copy_Actions takes nothing returns nothing
  set udg_Total_Heroes=33
  set udg_Random_Count=33
  set udg_Hero_Array[1]='H00B'
  set udg_Hero_Array[2]='H009'
  set udg_Hero_Array[3]='H00N'
  set udg_Hero_Array[4]='N002'
  set udg_Hero_Array[5]='N003'
  set udg_Hero_Array[6]='H00Q'
  set udg_Hero_Array[7]='O01K'
  set udg_Hero_Array[8]='O002'
  set udg_Hero_Array[9]='O004'
  set udg_Hero_Array[10]='O015'
  set udg_Hero_Array[11]='O016'
  set udg_Hero_Array[12]='O001'
  set udg_Hero_Array[13]='O01E'
  set udg_Hero_Array[14]='O00P'
  set udg_Hero_Array[15]='O003'
  set udg_Hero_Array[16]='O00H'
  set udg_Hero_Array[17]='O00M'
  set udg_Hero_Array[18]='O000'
  set udg_Hero_Array[19]='U00I'
  set udg_Hero_Array[20]='N020'
  set udg_Hero_Array[21]='N000'
  set udg_Hero_Array[22]='N01X'
  set udg_Hero_Array[23]='N02J'
  set udg_Hero_Array[24]='E006'
  set udg_Hero_Array[25]='E00D'
  set udg_Hero_Array[26]='E007'
  set udg_Hero_Array[27]='E000'
  set udg_Hero_Array[28]='E004'
  set udg_Hero_Array[29]='E014'
  set udg_Hero_Array[30]='U009'
  set udg_Hero_Array[31]='H005'
  set udg_Hero_Array[32]='O00N'
  set udg_Hero_Array[33]='O01M'
  set bj_forLoopAIndex=1
  set bj_forLoopAIndexEnd=33
  loop
    exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
    set udg_Random_Data[bj_forLoopAIndex]=bj_forLoopAIndex
    set bj_forLoopAIndex=bj_forLoopAIndex+1
  endloop
endfunction

function Trig_No_ally_attack_Conditions takes nothing returns boolean
  return(IsUnitAlly(GetTriggerUnit(),Player(0)))and(IsUnitAlly(GetAttacker(),Player(0)))
endfunction

function Trig_No_ally_attack_Actions takes nothing returns nothing
  set udg_NoAllyAttackPos=GetUnitLoc(GetAttacker())
  call IssueImmediateOrderById(GetAttacker(),851972)
  call CreateNUnitsAtLoc(1,'h01E',Player(12),udg_NoAllyAttackPos,bj_UNIT_FACING)
  call IssueTargetOrderById(bj_lastCreatedUnit,852095,GetAttacker())
  call TriggerSleepAction(1.)
  call RemoveUnit(bj_lastCreatedUnit)
  call RemoveLocation(udg_NoAllyAttackPos)
endfunction

function Trig_Skip_Actions takes nothing returns nothing
  call DisableTrigger(GetTriggeringTrigger())
  set udg_CREEPWAIT=0
  call StartTimerBJ(udg_CREEPTIMER,false,.0)
endfunction

function Trig_Modes_off_Actions takes nothing returns nothing
  call TriggerSleepAction(20.)
  call DisableTrigger(gg_trg_Turbo_Mode)
endfunction

function Trig_Turbo_Mode_Actions takes nothing returns nothing
  set udg_Turbo_Mode=GetRandomLocInRect(gg_rct_Hero_Switch)
  call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,"|cffff8c00Turbo Mode|r - |cffffcc00Creeps move extra fast and time between waves has been removed!|r ")
  call CreateNUnitsAtLoc(1,'o01O',Player(10),udg_Turbo_Mode,bj_UNIT_FACING)
  call DisableTrigger(gg_trg_Creep_Timer)
  call EnableTrigger(gg_trg_Creep_Timer_Extreme)
  call DisableTrigger(gg_trg_Skip)
  call DisableTrigger(GetTriggeringTrigger())
  call RemoveLocation(udg_Turbo_Mode)
endfunction

function Trig_map_ini_Func007002 takes nothing returns nothing
  call AdjustPlayerStateBJ(500,GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD)
endfunction

function Trig_map_ini_Actions takes nothing returns nothing
  call PlayThematicMusic("Sound\\Music\\mp3Music\\Orc2.mp3")
  call SetDestructableInvulnerable(gg_dest_ZTg1_1962,true)
  call SetDoodadAnimationRectBJ("death",'YOf1',gg_rct_Mine_Field)
  call SetDoodadAnimationRectBJ("death",'YOtf',gg_rct_Mine_Field)
  call KillDestructable(gg_dest_LTrc_2048)
  call KillDestructable(gg_dest_YT26_0691)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_map_ini_Func007002)
  call SetPlayerStateBJ(Player(0),PLAYER_STATE_RESOURCE_LUMBER,1)
  call SetPlayerStateBJ(Player(1),PLAYER_STATE_RESOURCE_LUMBER,1)
  call SetPlayerStateBJ(Player(2),PLAYER_STATE_RESOURCE_LUMBER,1)
  call SetPlayerStateBJ(Player(3),PLAYER_STATE_RESOURCE_LUMBER,1)
  call SetPlayerStateBJ(Player(4),PLAYER_STATE_RESOURCE_LUMBER,1)
  call SetPlayerStateBJ(Player(5),PLAYER_STATE_RESOURCE_LUMBER,1)
  call MeleeStartingHeroLimit()
  call MeleeStartingVisibility()
  call SetPlayerFlagBJ(PLAYER_STATE_GIVES_BOUNTY,true,Player(11))
endfunction

function Trig_Eyo_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetEnteringUnit())=='e00K')
endfunction

function Trig_Eyo_Actions takes nothing returns nothing
  call SetUnitVertexColorBJ(GetEnteringUnit(),80.,80.,80.,60.)
endfunction

function Trig_Visibility_all_Func001002 takes nothing returns nothing
  call CreateFogModifierRectBJ(true,GetEnumPlayer(),FOG_OF_WAR_VISIBLE,gg_rct_Moo_Moo_Square)
endfunction

function Trig_Visibility_all_Actions takes nothing returns nothing
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Visibility_all_Func001002)
  call FogModifierStart(bj_lastCreatedFogModifier)
endfunction

function Trig_Tavern_Actions takes nothing returns nothing
  set udg_HeroSet[(1+GetPlayerId(GetOwningPlayer(GetEnteringUnit())))]=GetEnteringUnit()
  set udg_PlayerIcons[(1+GetPlayerId(GetOwningPlayer(GetEnteringUnit())))]=GetEnteringUnit()
  set udg_CenterMoo=GetRectCenter(gg_rct_Center_of_Map)
  call SetUnitPositionLoc(GetTriggerUnit(),udg_CenterMoo)
  call TriggerSleepAction(.5)
  call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),udg_CenterMoo,1.)
  call SelectUnitForPlayerSingle(GetEnteringUnit(),GetOwningPlayer(GetEnteringUnit()))
  call RemoveLocation(udg_CenterMoo)
endfunction

function Trig_Hero_Pick_Actions takes nothing returns nothing
  call ShowUnitHide(gg_unit_hwtw_0008)
  call TriggerExecute(gg_trg_Create_Multiboard)
endfunction

function Trig_Hero_Pick_Copy_Actions takes nothing returns nothing
  call ShowUnitHide(gg_unit_hwtw_0009)
endfunction

function Trig_Hero_Pick_Copy_2_Actions takes nothing returns nothing
  call ShowUnitHide(gg_unit_hwtw_0010)
endfunction

function Trig_Hero_Pick_Copy_3_Actions takes nothing returns nothing
  call ShowUnitHide(gg_unit_hwtw_0011)
endfunction

function Trig_Hero_Pick_Copy_4_Actions takes nothing returns nothing
  call ShowUnitHide(gg_unit_hwtw_0015)
endfunction

function Trig_Hero_Pick_Copy_5_Actions takes nothing returns nothing
  call ShowUnitHide(gg_unit_hwtw_0016)
endfunction

function Trig_Desert_Winds_Conditions takes nothing returns boolean
  return(GetOwningPlayer(GetEnteringUnit())!=Player(11))
endfunction

function Trig_Desert_Winds_Actions takes nothing returns nothing
  set udg_DesertWinds=GetRandomLocInRect(gg_rct_Desert_Outskirts)
  call PlaySoundBJ(gg_snd_CreepAggroWhat1)
  call SetUnitPositionLocFacingLocBJ(GetEnteringUnit(),udg_DesertWinds,udg_DesertWinds)
  call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetEnteringUnit())),12.,"The desert winds are too strong for you to enter.")
  call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetEnteringUnit()),udg_DesertWinds,.5)
  call SelectUnitForPlayerSingle(GetEnteringUnit(),GetOwningPlayer(GetEnteringUnit()))
  call RemoveLocation(udg_DesertWinds)
endfunction

function Trig_Create_Multiboard_Func001002001001001 takes nothing returns boolean
  return(GetPlayerController(GetFilterPlayer())==MAP_CONTROL_USER)
endfunction

function Trig_Create_Multiboard_Func001002001001002 takes nothing returns boolean
  return(GetPlayerSlotState(GetFilterPlayer())==PLAYER_SLOT_STATE_PLAYING)
endfunction

function Trig_Create_Multiboard_Func001002001001 takes nothing returns boolean
  return GetBooleanAnd(Trig_Create_Multiboard_Func001002001001001(),Trig_Create_Multiboard_Func001002001001002())
endfunction

function Trig_Create_Multiboard_Func010001001001 takes nothing returns boolean
  return(GetPlayerSlotState(GetFilterPlayer())==PLAYER_SLOT_STATE_PLAYING)
endfunction

function Trig_Create_Multiboard_Func010001001002 takes nothing returns boolean
  return(GetPlayerController(GetFilterPlayer())==MAP_CONTROL_USER)
endfunction

function Trig_Create_Multiboard_Func010001001 takes nothing returns boolean
  return GetBooleanAnd(Trig_Create_Multiboard_Func010001001001(),Trig_Create_Multiboard_Func010001001002())
endfunction

function Trig_Create_Multiboard_Func010A takes nothing returns nothing
  set udg_Multiboard_Spots[(1+GetPlayerId(GetEnumPlayer()))]=udg_List
  call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,2,udg_List,(udg_Player_Colors[(1+GetPlayerId(GetEnumPlayer()))]+(GetPlayerName(GetEnumPlayer())+"|r")))
  call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,3,udg_List,"0")
  call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,4,udg_List,"0")
  call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,5,udg_List,"0")
  set udg_List=(udg_List+1)
endfunction

function Trig_Create_Multiboard_Actions takes nothing returns nothing
  set udg_Player_Count=CountPlayersInForceBJ(GetPlayersMatching(Condition(function Trig_Create_Multiboard_Func001002001001)))
  call CreateMultiboardBJ(5,(1+udg_Player_Count),"Moo Moo v1.5")
  call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,2,1,"Player Name")
  call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,3,1,"Kills")
  call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,4,1,"Boss Kills")
  call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,5,1,"Deaths")
  set bj_forLoopAIndex=1
  set bj_forLoopAIndexEnd=(1+udg_Player_Count)
  loop
    exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
    call MultiboardSetItemStyleBJ(bj_lastCreatedMultiboard,1,1,true,false)
    call MultiboardSetItemStyleBJ(bj_lastCreatedMultiboard,1,bj_forLoopAIndex,true,false)
    call MultiboardSetItemStyleBJ(bj_lastCreatedMultiboard,2,bj_forLoopAIndex,true,false)
    call MultiboardSetItemStyleBJ(bj_lastCreatedMultiboard,3,bj_forLoopAIndex,true,false)
    call MultiboardSetItemStyleBJ(bj_lastCreatedMultiboard,4,bj_forLoopAIndex,true,false)
    call MultiboardSetItemStyleBJ(bj_lastCreatedMultiboard,5,bj_forLoopAIndex,true,false)
    call MultiboardSetItemWidthBJ(bj_lastCreatedMultiboard,1,bj_forLoopAIndex,2.)
    call MultiboardSetItemWidthBJ(bj_lastCreatedMultiboard,2,bj_forLoopAIndex,8.)
    call MultiboardSetItemWidthBJ(bj_lastCreatedMultiboard,3,bj_forLoopAIndex,3.)
    call MultiboardSetItemWidthBJ(bj_lastCreatedMultiboard,4,bj_forLoopAIndex,8.)
    call MultiboardSetItemWidthBJ(bj_lastCreatedMultiboard,5,bj_forLoopAIndex,4.)
    set bj_forLoopAIndex=bj_forLoopAIndex+1
  endloop
  set udg_List=2
  call ForForce(GetPlayersMatching(Condition(function Trig_Create_Multiboard_Func010001001)),function Trig_Create_Multiboard_Func010A)
  call MultiboardDisplay(bj_lastCreatedMultiboard,true)
endfunction

function Trig_Player_Kills_Update_Conditions takes nothing returns boolean
  return(GetPlayerController(GetOwningPlayer(GetKillingUnit()))==MAP_CONTROL_USER)and(IsPlayerEnemy(GetOwningPlayer(GetDyingUnit()),GetOwningPlayer(GetKillingUnit())))
endfunction

function Trig_Player_Kills_Update_Actions takes nothing returns nothing
  set udg_Kill_Count[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))]=(udg_Kill_Count[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))]+1)
  call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,3,udg_Multiboard_Spots[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))],I2S(udg_Kill_Count[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))]))
endfunction

function Trig_Player_Deaths_Update_Func003001 takes nothing returns boolean
  return(IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO)!=null)
endfunction

function Trig_Player_Deaths_Update_Func003002 takes nothing returns boolean
  return(GetPlayerController(GetOwningPlayer(GetDyingUnit()))==MAP_CONTROL_USER)
endfunction

function Trig_Player_Deaths_Update_Conditions takes nothing returns boolean
  return(GetBooleanAnd(Trig_Player_Deaths_Update_Func003001(),Trig_Player_Deaths_Update_Func003002()))
endfunction

function Trig_Player_Deaths_Update_Actions takes nothing returns nothing
  set udg_Death_Count[(1+GetPlayerId(GetOwningPlayer(GetDyingUnit())))]=(udg_Death_Count[(1+GetPlayerId(GetOwningPlayer(GetDyingUnit())))]+1)
  call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,5,udg_Multiboard_Spots[(1+GetPlayerId(GetOwningPlayer(GetDyingUnit())))],I2S(udg_Death_Count[(1+GetPlayerId(GetOwningPlayer(GetDyingUnit())))]))
endfunction

function Trig_Player_Kills_Update_Copy_Func005001 takes nothing returns boolean
  return(GetUnitTypeId(GetDyingUnit())=='n00D')
endfunction

function Trig_Player_Kills_Update_Copy_Func005002001 takes nothing returns boolean
  return(GetUnitTypeId(GetDyingUnit())=='n008')
endfunction

function Trig_Player_Kills_Update_Copy_Func005002002001 takes nothing returns boolean
  return(GetUnitTypeId(GetDyingUnit())=='n02P')
endfunction

function Trig_Player_Kills_Update_Copy_Func005002002002001 takes nothing returns boolean
  return(GetUnitTypeId(GetDyingUnit())=='n00I')
endfunction

function Trig_Player_Kills_Update_Copy_Func005002002002002001 takes nothing returns boolean
  return(GetUnitTypeId(GetDyingUnit())=='n013')
endfunction

function Trig_Player_Kills_Update_Copy_Func005002002002002002001 takes nothing returns boolean
  return(GetUnitTypeId(GetDyingUnit())=='n018')
endfunction

function Trig_Player_Kills_Update_Copy_Func005002002002002002002001 takes nothing returns boolean
  return(GetUnitTypeId(GetDyingUnit())=='n01Q')
endfunction

function Trig_Player_Kills_Update_Copy_Func005002002002002002002002001 takes nothing returns boolean
  return(GetUnitTypeId(GetDyingUnit())=='n01M')
endfunction

function Trig_Player_Kills_Update_Copy_Func005002002002002002002002002 takes nothing returns boolean
  return(GetUnitTypeId(GetDyingUnit())=='n02K')
endfunction

function Trig_Player_Kills_Update_Copy_Func005002002002002002002002 takes nothing returns boolean
  return GetBooleanOr(Trig_Player_Kills_Update_Copy_Func005002002002002002002002001(),Trig_Player_Kills_Update_Copy_Func005002002002002002002002002())
endfunction

function Trig_Player_Kills_Update_Copy_Func005002002002002002002 takes nothing returns boolean
  return GetBooleanOr(Trig_Player_Kills_Update_Copy_Func005002002002002002002001(),Trig_Player_Kills_Update_Copy_Func005002002002002002002002())
endfunction

function Trig_Player_Kills_Update_Copy_Func005002002002002002 takes nothing returns boolean
  return GetBooleanOr(Trig_Player_Kills_Update_Copy_Func005002002002002002001(),Trig_Player_Kills_Update_Copy_Func005002002002002002002())
endfunction

function Trig_Player_Kills_Update_Copy_Func005002002002002 takes nothing returns boolean
  return GetBooleanOr(Trig_Player_Kills_Update_Copy_Func005002002002002001(),Trig_Player_Kills_Update_Copy_Func005002002002002002())
endfunction

function Trig_Player_Kills_Update_Copy_Func005002002002 takes nothing returns boolean
  return GetBooleanOr(Trig_Player_Kills_Update_Copy_Func005002002002001(),Trig_Player_Kills_Update_Copy_Func005002002002002())
endfunction

function Trig_Player_Kills_Update_Copy_Func005002002 takes nothing returns boolean
  return GetBooleanOr(Trig_Player_Kills_Update_Copy_Func005002002001(),Trig_Player_Kills_Update_Copy_Func005002002002())
endfunction

function Trig_Player_Kills_Update_Copy_Func005002 takes nothing returns boolean
  return GetBooleanOr(Trig_Player_Kills_Update_Copy_Func005002001(),Trig_Player_Kills_Update_Copy_Func005002002())
endfunction

function Trig_Player_Kills_Update_Copy_Conditions takes nothing returns boolean
  return(GetPlayerController(GetOwningPlayer(GetKillingUnit()))==MAP_CONTROL_USER)and(IsUnitIllusion(GetDyingUnit())!=true)and(GetBooleanOr(Trig_Player_Kills_Update_Copy_Func005001(),Trig_Player_Kills_Update_Copy_Func005002()))
endfunction

function Trig_Player_Kills_Update_Copy_Actions takes nothing returns nothing
  set udg_BossKill_Count[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))]=(udg_BossKill_Count[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))]+1)
  call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,4,udg_Multiboard_Spots[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))],I2S(udg_BossKill_Count[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))]))
endfunction

function Trig_Player_leaves_Func001A takes nothing returns nothing
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,("|cffFFFF00"+(GetPlayerName(GetTriggerPlayer())+"|r has left the game.")))
  call RemoveUnit(GetEnumUnit())
  call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,0,udg_Multiboard_Spots[(1+GetPlayerId(GetTriggerPlayer()))],"Gone")
endfunction

function Trig_Player_leaves_Actions takes nothing returns nothing
  call ForGroupBJ(GetUnitsOfPlayerAll(GetTriggerPlayer()),function Trig_Player_leaves_Func001A)
endfunction

function Trig_Define_Colors_Actions takes nothing returns nothing
  set udg_Player_Colors[1]="|c00ff0000"
  set udg_Player_Colors[2]="|c000000ff"
  set udg_Player_Colors[3]="|c0000ffff"
  set udg_Player_Colors[4]="|c00800080"
  set udg_Player_Colors[5]="|c00ffff00"
  set udg_Player_Colors[6]="|c00ff8000"
  set udg_Player_Colors[7]="|c0000ff00"
  set udg_Player_Colors[8]="|c00ff00ff"
endfunction

function Trig_Time_is_20_seconds_Actions takes nothing returns nothing
  call EnableTrigger(gg_trg_Random_Command)
  call EnableTrigger(gg_trg_Repick_Command)
  call DisableTrigger(gg_trg_All_Random_Command)
endfunction

function Trig_Time_is_45_seconds_Actions takes nothing returns nothing
  call DisableTrigger(gg_trg_Repick_Command)
  call DisableTrigger(gg_trg_Random_Command)
endfunction

function Trig_Manual_Hero_Pick_Conditions takes nothing returns boolean
  return(IsUnitType(GetSoldUnit(),UNIT_TYPE_HERO)!=null)
endfunction

function Trig_Manual_Hero_Pick_Func001A takes nothing returns nothing
  call SetPlayerUnitAvailableBJ(GetUnitTypeId(GetSoldUnit()),false,GetEnumPlayer())
endfunction

function Trig_Manual_Hero_Pick_Actions takes nothing returns nothing
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Manual_Hero_Pick_Func001A)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,("A player has chosen "+GetUnitName(GetSoldUnit())))
  call SelectUnitForPlayerSingle(GetSoldUnit(),GetOwningPlayer(GetSoldUnit()))
endfunction

function Trig_All_Random_Command_Func002Func001C takes nothing returns boolean
  return(GetPlayerSlotState(Player(-1+(bj_forLoopAIndex)))==PLAYER_SLOT_STATE_PLAYING)
endfunction

function Trig_All_Random_Command_Actions takes nothing returns nothing
  call DisableTrigger(gg_trg_Random_Command)
  set bj_forLoopAIndex=1
  set bj_forLoopAIndexEnd=6
  loop
    exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
    if(Trig_All_Random_Command_Func002Func001C())then
      set udg_Random_Hero=GetRandomInt(1,udg_Random_Count)
      call CreateNUnitsAtLoc(1,udg_Hero_Array[udg_Random_Data[udg_Random_Hero]],Player(-1+(bj_forLoopAIndex)),GetPlayerStartLocationLoc(Player(-1+(bj_forLoopAIndex))),bj_UNIT_FACING)
      call SelectUnitForPlayerSingle(bj_lastCreatedUnit,GetOwningPlayer(bj_lastCreatedUnit))
      call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,("A player has randomed "+GetUnitName(bj_lastCreatedUnit)))
      call AdjustPlayerStateBJ(-1,Player(-1+(bj_forLoopAIndex)),PLAYER_STATE_RESOURCE_LUMBER)
      set udg_Random_Data[udg_Random_Hero]=udg_Random_Count
      set udg_Random_Count=(udg_Random_Count-1)
    endif
    set bj_forLoopAIndex=bj_forLoopAIndex+1
  endloop
endfunction

function Trig_Repick_Command_Func003001001002 takes nothing returns boolean
  return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)!=null)
endfunction

function Trig_Repick_Command_Conditions takes nothing returns boolean
  return(CountUnitsInGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function Trig_Repick_Command_Func003001001002)))==1)
endfunction

function Trig_Repick_Command_Func002001002 takes nothing returns boolean
  return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)!=null)
endfunction

function Trig_Repick_Command_Func002Func001A takes nothing returns nothing
  call SetPlayerUnitAvailableBJ(GetUnitTypeId(GetEnumUnit()),true,GetEnumPlayer())
endfunction

function Trig_Repick_Command_Func002A takes nothing returns nothing
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Repick_Command_Func002Func001A)
  call RemoveUnit(GetEnumUnit())
endfunction

function Trig_Repick_Command_Func008A takes nothing returns nothing
  call SetPlayerUnitAvailableBJ(GetUnitTypeId(bj_lastCreatedUnit),false,GetEnumPlayer())
endfunction

function Trig_Repick_Command_Actions takes nothing returns nothing
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"A player has repicked")
  call ForGroupBJ(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function Trig_Repick_Command_Func002001002)),function Trig_Repick_Command_Func002A)
  set udg_Random_Hero=GetRandomInt(1,udg_Random_Count)
  call CreateNUnitsAtLoc(1,udg_Hero_Array[udg_Random_Data[udg_Random_Hero]],GetTriggerPlayer(),GetPlayerStartLocationLoc(GetTriggerPlayer()),bj_UNIT_FACING)
  call SelectUnitForPlayerSingle(bj_lastCreatedUnit,GetOwningPlayer(bj_lastCreatedUnit))
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,("A player has randomed "+GetUnitName(bj_lastCreatedUnit)))
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Repick_Command_Func008A)
  set udg_Random_Data[udg_Random_Hero]=udg_Random_Count
  set udg_Random_Count=(udg_Random_Count-1)
endfunction

function Trig_Random_Command_Func001001001002 takes nothing returns boolean
  return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)!=null)
endfunction

function Trig_Random_Command_Conditions takes nothing returns boolean
  return(CountUnitsInGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function Trig_Random_Command_Func001001001002)))==0)
endfunction

function Trig_Random_Command_Func007A takes nothing returns nothing
  call SetPlayerUnitAvailableBJ(GetUnitTypeId(bj_lastCreatedUnit),false,GetEnumPlayer())
endfunction

function Trig_Random_Command_Actions takes nothing returns nothing
  set udg_Random_Hero=GetRandomInt(1,udg_Random_Count)
  call CreateNUnitsAtLoc(1,udg_Hero_Array[udg_Random_Data[udg_Random_Hero]],GetTriggerPlayer(),GetPlayerStartLocationLoc(GetTriggerPlayer()),bj_UNIT_FACING)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,("A player has randomed "+GetUnitName(bj_lastCreatedUnit)))
  call SelectUnitForPlayerSingle(bj_lastCreatedUnit,GetOwningPlayer(bj_lastCreatedUnit))
  call AdjustPlayerStateBJ(-1,GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Random_Command_Func007A)
  set udg_Random_Data[udg_Random_Hero]=udg_Random_Count
  set udg_Random_Count=(udg_Random_Count-1)
endfunction

function Trig_Help_Actions takes nothing returns nothing
  call CreateQuestBJ(2,"Changelog","TRIGSTR_6361","ReplaceableTextures\\CommandButtons\\BTNBlueScrollofPower.BLP")
  call CreateQuestBJ(2,"Credits","|cffffcc00Original Idea|r\nx3pt\nLightningstrike\n|n|cffffcc00Triggers|r\nhunter_demon\n|n|cffffcc00Items|r\nx3pt\n|n|cffffcc00Heros|r\nx3pt\nLightningstrike\nhunter_demon\n|n|cffffcc00Waves + Balancing|r\nx3pt\n|n|cffffcc00Bug Reporter|r\nKuroro-Lucifer\n|n|cffffcc00Beta Testers|r\nNEGRO-CHOP\nmilk_n_cookies\nKuroro-Lucifer\n|n|cffffcc00Special Thanx|r\nwww.wc3sear.ch","ReplaceableTextures\\CommandButtons\\BTNSpiritLink.blp")
  call CreateQuestBJ(2,"Commands","|cffffcc00Turbo Mode|r\nType \"-tm\"\nTurbo Mode removes wait time between waves and makes creeps move extra fast.\n|cffffcc00Random Hero|r\nType \"-random\"\nThis choses a random hero for you and can only be used when the heros can be picked.\n|cffffcc00Repick Hero|r\nType \"-repick\"\nIf you don't like the hero you randomed you may repick for another random hero.\n|cffffcc00Skip|r\nType \"-skip\"\nSkips the waiting period, and starts the next wave immediately.\n|cffffcc00Note|r\nModes can only be chosen within the first 20 seconds of the game.","ReplaceableTextures\\CommandButtons\\BTNControlMagic.blp")
  call CreateQuestBJ(0,"Protect Chief Moo Moo","|cffffcc00Main Objective|r\nThe objective of the game is to destroy all the invaders, and protect Moo Moo.  You can buy him food to heal him and find the hidden Rexxar to upgrade Moo Moo's armor.  Search the area for undiscovered quests and items for they maybe helpful later on in the game.  Be careful as the weather can change the tide of battle","ReplaceableTextures\\CommandButtons\\BTNHeroTaurenChieftain.blp")
endfunction

function Trig_Undiscovered_Quests_Actions takes nothing returns nothing
  call CreateQuestBJ(1,"Centaur Khan","Go kill Centaur Khan and end the threat once and for all, but be aware of his centaurs who are attempting to destroy Thunderbluff.","ReplaceableTextures\\CommandButtons\\BTNCentaurKhan.blp")
  set udg_Centaur_Khan=bj_lastCreatedQuest
  call CreateQuestBJ(1,"Protectors of Ultima","Now that you have taken care of all the waves, go defeat Bloodbath and Arthas and retrieve the two swords of Ultima. Once retrieved combine them and defeat Centaur Khan once and for all.","ReplaceableTextures\\CommandButtons\\BTNSpell_Holy_BlessingOfStrength.blp")
  set udg_Secret_Boss=bj_lastCreatedQuest
  call CreateQuestBJ(3,"Kerchek's Soul","Find Kerchek's soul. He said he lost it somewhere deep in Memory Forest.","ReplaceableTextures\\CommandButtons\\BTNShadowHunter.blp")
  set udg_Kerchek=bj_lastCreatedQuest
  call CreateQuestBJ(3,"Kerchek's Reward","Give the Kerchek's soul back to him at the troll village, he should be pleased to see it.  Don't forget about your reward!","ReplaceableTextures\\CommandButtons\\BTNSpiritLodge.blp")
  set udg_TrollReward=bj_lastCreatedQuest
  call CreateQuestBJ(3,"Pedro Negro","Defeat the insane goblin in his chambers. Careful, it could be booby trapped. When you kill him, talk to Goblin Rebel Leader for your reward.","ReplaceableTextures\\CommandButtons\\BTNJunkGolem.blp")
  set udg_PedroNegro=bj_lastCreatedQuest
  call CreateQuestBJ(3,"Goblin Reward","Return to the Goblin Village and talk to the Goblin Rebel Leader to recieve your reward.","ReplaceableTextures\\CommandButtons\\BTNGoblinZeppelin.blp")
  set udg_GoblinReward=bj_lastCreatedQuest
  call CreateQuestBJ(3,"Goblin Construction","The goblins are building you a training center which could be helpful to level up and fight against those holding the swords of Ultima or even Centaur Khan.","ReplaceableTextures\\CommandButtons\\BTNPocketFactory.blp")
  set udg_GoblinConstruction=bj_lastCreatedQuest
endfunction

function Trig_Weather_Actions takes nothing returns nothing
  call AddWeatherEffectSaveLast(gg_rct_Desert_Hill,'WNcw')
  call TriggerSleepAction(1.)
  call AddWeatherEffectSaveLast(gg_rct_forest_keep,'RAhr')
  call TriggerSleepAction(1.)
  call AddWeatherEffectSaveLast(gg_rct_Troll_Village,'LRaa')
  call TriggerSleepAction(1.)
  call AddWeatherEffectSaveLast(gg_rct_Goblin_Village,'LRma')
  call TriggerSleepAction(1.)
  call AddWeatherEffectSaveLast(gg_rct_movie,'RAlr')
  call TriggerSleepAction(1.)
  call SetSkyModel("Environment\\Sky\\FelwoodSky\\FelwoodSky.mdl")
  call TriggerSleepAction(1.)
  call AddWeatherEffectSaveLast(gg_rct_Desert,'WNcw')
endfunction

function Trig_Weather_On_Actions takes nothing returns nothing
  call EnableWeatherEffect(bj_lastCreatedWeatherEffect,true)
endfunction

function Trig_Under_Construction_Actions takes nothing returns nothing
  set udg_PedroOpenCine=GetRectCenter(gg_rct_Pedro_Negro_Open_Cine)
  call DestructableRestoreLife(gg_dest_ZTg1_1962,GetDestructableMaxLife(bj_lastCreatedDestructable),true)
  call SetUnitPositionLoc(GetEnteringUnit(),udg_PedroOpenCine)
  call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetEnteringUnit())),10.,"Come back when its finished!")
  call RemoveLocation(udg_PedroOpenCine)
endfunction

function Trig_Construction_complete_Actions takes nothing returns nothing
  set udg_PocketFactory=GetRectCenter(gg_rct_Pocket_Factory)
  set udg_TinkCenter=GetRectCenter(gg_rct_Tinker)
  set udg_Shrine=GetRectCenter(gg_rct_Shrine)
  set udg_Goblin1=GetRectCenter(gg_rct_Goblin_1)
  set udg_Goblin2=GetRectCenter(gg_rct_Goblin_2)
  set udg_Goblin3=GetRectCenter(gg_rct_Goblin_3)
  set udg_Goblin4=GetRectCenter(gg_rct_Goblin_4)
  set udg_ClockworkPos=GetRectCenter(gg_rct_Clockwork_Position)
  set udg_TechiePos=GetRectCenter(gg_rct_Techie_Position)
  set udg_SapperPos=GetRectCenter(gg_rct_Sapper_Position)
  set udg_RoboPos=GetRectCenter(gg_rct_Robo_Position)
  call QuestSetCompleted(udg_GoblinConstruction,true)
  call FlashQuestDialogButton()
  call PlaySoundBJ(gg_snd_QuestCompleted)
  call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,"|cffff8c00Quest Updated|r")
  call TriggerSleepAction(5.)
  call DisableTrigger(gg_trg_Under_Construction)
  call ModifyGateBJ(1,gg_dest_ZTg1_1962)
  call CreateDestructableLoc('B000',udg_PocketFactory,GetRandomReal(0,360),1,0)
  call SetUnitPositionLoc(gg_unit_Ntin_0226,udg_TinkCenter)
  call CreateNUnitsAtLoc(1,GetUnitTypeId(udg_Unit_Statue),Player(15),udg_Shrine,bj_UNIT_FACING)
  call SetUnitUseFood(bj_lastCreatedUnit,false)
  call SetUnitInvulnerable(bj_lastCreatedUnit,true)
  call SetUnitVertexColorBJ(bj_lastCreatedUnit,100.,100.,100.,35.)
  call AddSpecialEffectTargetUnitBJ("origin",bj_lastCreatedUnit,"Abilities\\Spells\\Other\\Awaken\\Awaken.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call EnableTrigger(gg_trg_Statue_Pray)
  call EnableTrigger(gg_trg_Goblin_1)
  call EnableTrigger(gg_trg_Goblin_2)
  call EnableTrigger(gg_trg_Goblin_3)
  call EnableTrigger(gg_trg_Goblin_4)
  call CreateNUnitsAtLoc(1,'n02E',Player(15),udg_Goblin1,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02E',Player(15),udg_Goblin2,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02E',Player(15),udg_Goblin3,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02E',Player(15),udg_Goblin4,bj_UNIT_FACING)
  call CreateNUnitsAtLocFacingLocBJ(1,'n02G',Player(15),udg_ClockworkPos,udg_Goblin1)
  call SetUnitInvulnerable(bj_lastCreatedUnit,true)
  call CreateNUnitsAtLocFacingLocBJ(1,'n02F',Player(15),udg_TechiePos,udg_Goblin2)
  call SetUnitInvulnerable(bj_lastCreatedUnit,true)
  call CreateNUnitsAtLocFacingLocBJ(1,'n02H',Player(15),udg_SapperPos,udg_Goblin3)
  call SetUnitInvulnerable(bj_lastCreatedUnit,true)
  call CreateNUnitsAtLocFacingLocBJ(1,'n02I',Player(15),udg_RoboPos,udg_Goblin4)
  call SetUnitInvulnerable(bj_lastCreatedUnit,true)
  call DisableTrigger(GetTriggeringTrigger())
  call RemoveLocation(udg_PocketFactory)
  call RemoveLocation(udg_TinkCenter)
  call RemoveLocation(udg_Shrine)
  call RemoveLocation(udg_Goblin1)
  call RemoveLocation(udg_Goblin2)
  call RemoveLocation(udg_Goblin3)
  call RemoveLocation(udg_Goblin4)
  call RemoveLocation(udg_ClockworkPos)
  call RemoveLocation(udg_TechiePos)
  call RemoveLocation(udg_SapperPos)
  call RemoveLocation(udg_RoboPos)
endfunction

function Trig_Goblin_1_Conditions takes nothing returns boolean
  return(IsUnitType(GetEnteringUnit(),UNIT_TYPE_HERO)!=null)
endfunction

function Trig_Goblin_1_Actions takes nothing returns nothing
  set udg_Goblin1=GetRectCenter(gg_rct_Goblin_1)
  call CreateNUnitsAtLoc(1,'n02G',Player(12),udg_Goblin1,bj_UNIT_FACING)
  call RemoveLocation(udg_Goblin1)
endfunction

function Trig_Goblin_2_Conditions takes nothing returns boolean
  return(IsUnitType(GetEnteringUnit(),UNIT_TYPE_HERO)!=null)
endfunction

function Trig_Goblin_2_Actions takes nothing returns nothing
  set udg_Goblin2=GetRectCenter(gg_rct_Goblin_2)
  call CreateNUnitsAtLoc(1,'n02F',Player(12),udg_Goblin2,bj_UNIT_FACING)
  call RemoveLocation(udg_Goblin2)
endfunction

function Trig_Goblin_3_Conditions takes nothing returns boolean
  return(IsUnitType(GetEnteringUnit(),UNIT_TYPE_HERO)!=null)
endfunction

function Trig_Goblin_3_Actions takes nothing returns nothing
  set udg_Goblin3=GetRectCenter(gg_rct_Goblin_3)
  call CreateNUnitsAtLoc(1,'n02H',Player(12),udg_Goblin3,bj_UNIT_FACING)
  call RemoveLocation(udg_Goblin3)
endfunction

function Trig_Goblin_4_Conditions takes nothing returns boolean
  return(IsUnitType(GetEnteringUnit(),UNIT_TYPE_HERO)!=null)
endfunction

function Trig_Goblin_4_Actions takes nothing returns nothing
  set udg_Goblin4=GetRectCenter(gg_rct_Goblin_4)
  call CreateNUnitsAtLoc(1,'n02I',Player(12),udg_Goblin4,bj_UNIT_FACING)
  call RemoveLocation(udg_Goblin4)
endfunction

function Trig_Statue_Pray_Conditions takes nothing returns boolean
  return(RectContainsUnit(gg_rct_Mine_Field,GetDyingUnit()))
endfunction

function Trig_Statue_Pray_Func004A takes nothing returns nothing
  call SetUnitAnimation(GetEnumUnit(),"Spell")
  call AddSpecialEffectLocBJ(udg_ShrinePoint,"Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
endfunction

function Trig_Statue_Pray_Actions takes nothing returns nothing
  set udg_ShrinePray=GetUnitsInRectOfPlayer(gg_rct_Shrine,Player(15))
  set udg_ShrinePoint=GetRandomLocInRect(gg_rct_Shrine)
  call ForGroupBJ(udg_ShrinePray,function Trig_Statue_Pray_Func004A)
  call RemoveLocation(udg_ShrinePoint)
  set bj_wantDestroyGroup=true
endfunction

function Trig_Kerchek_Help_Conditions takes nothing returns boolean
  return(GetUnitStateSwap(UNIT_STATE_LIFE,gg_unit_ofrt_0001)<=10000.)
endfunction

function Trig_Kerchek_Help_Func004A takes nothing returns nothing
  call SetUnitPositionLoc(GetEnumUnit(),udg_TrollPoint)
  call SetUnitOwner(GetEnumUnit(),Player(10),true)
endfunction

function Trig_Kerchek_Help_Actions takes nothing returns nothing
  set udg_TrollGroup=GetUnitsInRectOfPlayer(gg_rct_Troll_Village,Player(15))
  set udg_TrollPoint=GetRandomLocInRect(gg_rct_Center_of_Map)
  call PauseAllUnitsBJ(true)
  call ForGroupBJ(udg_TrollGroup,function Trig_Kerchek_Help_Func004A)
  call PlaySoundBJ(gg_snd_ShadowHunterWhat1)
  call TriggerSleepAction(2)
  call PauseAllUnitsBJ(false)
  call RemoveLocation(udg_TrollPoint)
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Kerchek_Gone)
endfunction

function Trig_Kerchek_Gone_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(GetUnitsOfPlayerAll(Player(11))))
endfunction

function Trig_Kerchek_Gone_Func003002 takes nothing returns nothing
  call RemoveUnit(GetEnumUnit())
endfunction

function Trig_Kerchek_Gone_Actions takes nothing returns nothing
  call PlaySoundBJ(gg_snd_ShadowHunterYes2)
  call TriggerSleepAction(2)
  call ForGroupBJ(udg_TrollGroup,function Trig_Kerchek_Gone_Func003002)
  call PlaySoundBJ(gg_snd_QuestCompleted)
  call QuestSetCompleted(udg_TrollReward,true)
  call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,"|cffff8c00Quest Updated|r")
  call DisableTrigger(GetTriggeringTrigger())
endfunction

function Trig_Quest_Pedro_Negro_Actions takes nothing returns nothing
  set udg_Unit_Statue=GetKillingUnit()
  call PlaySoundBJ(gg_snd_QuestCompleted)
  call QuestSetCompleted(udg_PedroNegro,true)
  call QuestSetDiscovered(udg_GoblinReward,true)
  call FlashQuestDialogButton()
  call PlaySoundBJ(gg_snd_QuestNew)
  call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,"|cffff8c00Quest Updated|r")
  call EnableTrigger(gg_trg_Quest_Pedro_Negro_Complete)
  call DisableTrigger(GetTriggeringTrigger())
endfunction

function Trig_Quest_Pedro_Negro_Complete_Conditions takes nothing returns boolean
  return(IsUnitType(GetEnteringUnit(),UNIT_TYPE_HERO)!=null)
endfunction

function Trig_Quest_Pedro_Negro_Complete_Func001002001001 takes nothing returns boolean
  return(GetPlayerSlotState(GetFilterPlayer())==PLAYER_SLOT_STATE_PLAYING)
endfunction

function Trig_Quest_Pedro_Negro_Complete_Func001002001002001 takes nothing returns boolean
  return(GetFilterPlayer()!=Player(11))
endfunction

function Trig_Quest_Pedro_Negro_Complete_Func001002001002002001 takes nothing returns boolean
  return(GetFilterPlayer()!=Player(12))
endfunction

function Trig_Quest_Pedro_Negro_Complete_Func001002001002002002 takes nothing returns boolean
  return(GetFilterPlayer()!=Player(15))
endfunction

function Trig_Quest_Pedro_Negro_Complete_Func001002001002002 takes nothing returns boolean
  return GetBooleanAnd(Trig_Quest_Pedro_Negro_Complete_Func001002001002002001(),Trig_Quest_Pedro_Negro_Complete_Func001002001002002002())
endfunction

function Trig_Quest_Pedro_Negro_Complete_Func001002001002 takes nothing returns boolean
  return GetBooleanAnd(Trig_Quest_Pedro_Negro_Complete_Func001002001002001(),Trig_Quest_Pedro_Negro_Complete_Func001002001002002())
endfunction

function Trig_Quest_Pedro_Negro_Complete_Func001002001 takes nothing returns boolean
  return GetBooleanAnd(Trig_Quest_Pedro_Negro_Complete_Func001002001001(),Trig_Quest_Pedro_Negro_Complete_Func001002001002())
endfunction

function Trig_Quest_Pedro_Negro_Complete_Func004002002 takes nothing returns boolean
  return(GetUnitTypeId(GetEnumUnit())=='n01B')
endfunction

function Trig_Quest_Pedro_Negro_Complete_Func013002 takes nothing returns nothing
  call CameraSetupApplyForPlayer(true,gg_cam_goblin_village_cine,GetEnumPlayer(),.0)
endfunction

function Trig_Quest_Pedro_Negro_Complete_Func015A takes nothing returns nothing
  call PlaySoundBJ(gg_snd_GoblinZeppelinPissed2)
  call CreateNUnitsAtLoc(1,'nzep',GetEnumPlayer(),udg_GobZepPoint,bj_UNIT_FACING)
  call IssuePointOrderByIdLoc(bj_lastCreatedUnit,851986,udg_GobVillagePoint)
endfunction

function Trig_Quest_Pedro_Negro_Complete_Func023002 takes nothing returns nothing
  call ResetToGameCameraForPlayer(GetEnumPlayer(),0)
endfunction

function Trig_Quest_Pedro_Negro_Complete_Func024002 takes nothing returns nothing
  call PanCameraToTimedLocForPlayer(GetEnumPlayer(),udg_GobVillagePoint,.5)
endfunction

function Trig_Quest_Pedro_Negro_Complete_Func029002 takes nothing returns nothing
  call ExplodeUnitBJ(GetEnumUnit())
endfunction

function Trig_Quest_Pedro_Negro_Complete_Actions takes nothing returns nothing
  set udg_PlayersInGame=GetPlayersMatching(Condition(function Trig_Quest_Pedro_Negro_Complete_Func001002001))
  set udg_GobZepPoint=GetRandomLocInRect(gg_rct_goblin_zeplin_cine)
  set udg_GobVillagePoint=GetRandomLocInRect(gg_rct_Goblin_Village)
  set udg_MineFieldGroup=GetUnitsInRectMatching(gg_rct_Mine_Field,Condition(function Trig_Quest_Pedro_Negro_Complete_Func004002002))
  call IssueImmediateOrderById(GetEnteringUnit(),851972)
  call PauseAllUnitsBJ(true)
  call CinematicModeBJ(true,bj_FORCE_ALL_PLAYERS)
  call ShowInterfaceForceOff(bj_FORCE_ALL_PLAYERS,2)
  call SetUserControlForceOff(bj_FORCE_ALL_PLAYERS)
  call ForceCinematicSubtitles(true)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Quest_Pedro_Negro_Complete_Func013002)
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,gg_unit_Nalm_0236,"Goblin General",null,"Excellent work! As my personal reward to you heroes, I give each of you your own personal airship. You will be able to travel all over with these babies!",0,8.,true)
  call ForForce(udg_PlayersInGame,function Trig_Quest_Pedro_Negro_Complete_Func015A)
  call TriggerSleepAction(5.)
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,gg_unit_Ntin_0226,"Goblin Rebel Leader",null,"Si, usted lo ha hecho! Oimos su laboratorio estallar de aqui. Para su recompensa limpiare encima de su laboratorio y estructura cualquier cosa que usted desea!",0,8.,true)
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,gg_unit_ncg3_0233,"Babel Goblin",gg_snd_ClockwerkGoblinYesAttack1,"*Bzzt* Yes, you have done it! We heard his lab explode from here. For your reward I will clean up his lab and build you something special!",0,8.,true)
  call CinematicModeBJ(false,bj_FORCE_ALL_PLAYERS)
  call ForceCinematicSubtitles(false)
  call ShowInterfaceForceOn(bj_FORCE_ALL_PLAYERS,1.)
  call SetUserControlForceOn(bj_FORCE_ALL_PLAYERS)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Quest_Pedro_Negro_Complete_Func023002)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Quest_Pedro_Negro_Complete_Func024002)
  call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetEnteringUnit()),udg_GobVillagePoint,0)
  call TriggerSleepAction(1.)
  call PauseAllUnitsBJ(false)
  call DisableTrigger(GetTriggeringTrigger())
  call ForGroupBJ(udg_MineFieldGroup,function Trig_Quest_Pedro_Negro_Complete_Func029002)
  call QuestSetCompleted(udg_GoblinReward,true)
  call PlaySoundBJ(gg_snd_QuestCompleted)
  call QuestSetDiscovered(udg_GoblinConstruction,true)
  call FlashQuestDialogButton()
  call PlaySoundBJ(gg_snd_QuestNew)
  call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,"|cffff8c00Quest Updated|r")
  call RemoveLocation(udg_GobZepPoint)
  call RemoveLocation(udg_GobVillagePoint)
  set bj_wantDestroyGroup=true
  call EnableTrigger(gg_trg_Under_Construction)
  call EnableTrigger(gg_trg_Construction_complete)
endfunction

function Trig_Quest_Kercheks_Soul_Conditions takes nothing returns boolean
  return(GetItemTypeId(GetManipulatedItem())=='I04Q')
endfunction

function Trig_Quest_Kercheks_Soul_Actions takes nothing returns nothing
  call PlaySoundBJ(gg_snd_QuestCompleted)
  call QuestSetCompleted(udg_Kerchek,true)
  call QuestSetDiscovered(udg_TrollReward,true)
  call FlashQuestDialogButton()
  call PlaySoundBJ(gg_snd_QuestNew)
  call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,"|cffff8c00Quest Updated|r")
  call EnableTrigger(gg_trg_Quest_Kercheks_Soul_Complete)
endfunction

function Trig_Quest_Kercheks_Soul_Complete_Conditions takes nothing returns boolean
  return(IsUnitType(GetEnteringUnit(),UNIT_TYPE_HERO))and(UnitHasItemOfTypeBJ(GetEnteringUnit(),'I04Q'))
endfunction

function Trig_Quest_Kercheks_Soul_Complete_Func012002 takes nothing returns nothing
  call CameraSetupApplyForPlayer(true,gg_cam_troll_village_cine2,GetEnumPlayer(),5.)
endfunction

function Trig_Quest_Kercheks_Soul_Complete_Func030002 takes nothing returns nothing
  call ResetToGameCameraForPlayer(GetEnumPlayer(),0)
endfunction

function Trig_Quest_Kercheks_Soul_Complete_Func031002 takes nothing returns nothing
  call PanCameraToTimedLocForPlayer(GetEnumPlayer(),udg_TrollCinePoint,.5)
endfunction

function Trig_Quest_Kercheks_Soul_Complete_Actions takes nothing returns nothing
  set udg_TrollCinePoint=GetRectCenter(gg_rct_Troll_Cine)
  set udg_TrollSickPos=GetUnitLoc(gg_unit_o019_0288)
  call IssueImmediateOrderById(GetEnteringUnit(),851972)
  call PauseAllUnitsBJ(true)
  call CinematicModeBJ(true,bj_FORCE_ALL_PLAYERS)
  call ShowInterfaceForceOff(bj_FORCE_ALL_PLAYERS,2)
  call SetUserControlForceOff(bj_FORCE_ALL_PLAYERS)
  call ForceCinematicSubtitles(true)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Quest_Kercheks_Soul_Complete_Func012002)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetEnteringUnit(),'I04Q'))
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,gg_unit_o019_0288,"Kerchek",null,"Hahahaha! You did it mon! Now, watch this.",0,3.,true)
  call KillUnit(gg_unit_o019_0288)
  call AddSpecialEffectLocBJ(udg_TrollSickPos,"Abilities\\Spells\\Human\\DispelMagic\\DispelMagicTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call PlaySoundBJ(gg_snd_HeroShadowHunterDeath)
  call TriggerSleepAction(2.)
  call AddSpecialEffectLocBJ(udg_TrollSickPos,"Abilities\\Spells\\Items\\AIre\\AIreTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call CreateNUnitsAtLocFacingLocBJ(1,'O00V',Player(15),udg_TrollSickPos,udg_TrollCinePoint)
  call SetUnitScalePercent(bj_lastCreatedUnit,130.,130.,130.)
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,bj_lastCreatedUnit,"Kerchek",null,"Hahaa! Good to be back!",0,4.,true)
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,bj_lastCreatedUnit,"Kerchek",null,"Now, when the time is right, I will come aid you in battle. But do not become dependent on me, I may not always be there.",0,6.,true)
  call CinematicModeBJ(false,bj_FORCE_ALL_PLAYERS)
  call ForceCinematicSubtitles(false)
  call ShowInterfaceForceOn(bj_FORCE_ALL_PLAYERS,1.)
  call SetUserControlForceOn(bj_FORCE_ALL_PLAYERS)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Quest_Kercheks_Soul_Complete_Func030002)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Quest_Kercheks_Soul_Complete_Func031002)
  call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetEnteringUnit()),udg_TrollCinePoint,0)
  call TriggerSleepAction(1.)
  call PauseAllUnitsBJ(false)
  call RemoveLocation(udg_TrollCinePoint)
  call RemoveLocation(udg_TrollSickPos)
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Kerchek_Help)
endfunction

function Trig_Select_Difficulty_Copy_Copy_2_Func001Func014Func001C takes nothing returns boolean
  return(GetGameDifficulty()==MAP_DIFFICULTY_NORMAL)
endfunction

function Trig_Select_Difficulty_Copy_Copy_2_Func001Func014C takes nothing returns boolean
  return(GetGameDifficulty()==MAP_DIFFICULTY_EASY)
endfunction

function Trig_Select_Difficulty_Copy_Copy_2_Func001C takes nothing returns boolean
  return true
endfunction

function Trig_Select_Difficulty_Copy_Copy_2_Actions takes nothing returns nothing
  if(Trig_Select_Difficulty_Copy_Copy_2_Func001C())then
    call DialogClear(udg_DifficultyDialog)
    call DialogSetMessage(udg_DifficultyDialog,"Select Game Difficulty")
    call DialogAddButtonBJ(udg_DifficultyDialog,"Novice")
    set udg_EasyButton=bj_lastCreatedButton
    call DialogAddButtonBJ(udg_DifficultyDialog,"Experienced")
    set udg_NormalButton=bj_lastCreatedButton
    call DialogAddButtonBJ(udg_DifficultyDialog,"Professional")
    set udg_HardButton=bj_lastCreatedButton
    call DialogAddButtonBJ(udg_DifficultyDialog,"Champion")
    set udg_ExtraHardButton=bj_lastCreatedButton
    call DialogAddButtonBJ(udg_DifficultyDialog,"Impossible")
    set udg_ImpossibleButton=bj_lastCreatedButton
    call DialogDisplayBJ(true,udg_DifficultyDialog,Player(0))
  else
    if(Trig_Select_Difficulty_Copy_Copy_2_Func001Func014C())then
      call ConditionalTriggerExecute(gg_trg_Easy_Difficulty_Copy)
    else
      if(Trig_Select_Difficulty_Copy_Copy_2_Func001Func014Func001C())then
        call ConditionalTriggerExecute(gg_trg_Normal_Difficulty_Copy)
      else
        call ConditionalTriggerExecute(gg_trg_Hard_Difficulty_Copy)
      endif
    endif
  endif
endfunction

function Trig_Button_pressed_in_difficulty_dialog_Copy_Copy_Copy_Func001Func002Func002Func002Func002C takes nothing returns boolean
  return(GetClickedButton()==udg_ImpossibleButton)
endfunction

function Trig_Button_pressed_in_difficulty_dialog_Copy_Copy_Copy_Func001Func002Func002Func002C takes nothing returns boolean
  return(GetClickedButton()==udg_ExtraHardButton)
endfunction

function Trig_Button_pressed_in_difficulty_dialog_Copy_Copy_Copy_Func001Func002Func002C takes nothing returns boolean
  return(GetClickedButton()==udg_HardButton)
endfunction

function Trig_Button_pressed_in_difficulty_dialog_Copy_Copy_Copy_Func001Func002C takes nothing returns boolean
  return(GetClickedButton()==udg_NormalButton)
endfunction

function Trig_Button_pressed_in_difficulty_dialog_Copy_Copy_Copy_Func001C takes nothing returns boolean
  return(GetClickedButton()==udg_EasyButton)
endfunction

function Trig_Button_pressed_in_difficulty_dialog_Copy_Copy_Copy_Actions takes nothing returns nothing
  if(Trig_Button_pressed_in_difficulty_dialog_Copy_Copy_Copy_Func001C())then
    call PauseGameOff()
    call TriggerExecute(gg_trg_Easy_Difficulty_Copy)
    call TriggerExecute(gg_trg_Level_1)
    call TriggerExecute(gg_trg_Modes_off)
  else
    if(Trig_Button_pressed_in_difficulty_dialog_Copy_Copy_Copy_Func001Func002C())then
      call PauseGameOff()
      call TriggerExecute(gg_trg_Normal_Difficulty_Copy)
      call TriggerExecute(gg_trg_Level_1)
      call TriggerExecute(gg_trg_Modes_off)
    else
      if(Trig_Button_pressed_in_difficulty_dialog_Copy_Copy_Copy_Func001Func002Func002C())then
        call PauseGameOff()
        call TriggerExecute(gg_trg_Hard_Difficulty_Copy)
        call TriggerExecute(gg_trg_Level_1)
        call TriggerExecute(gg_trg_Modes_off)
      else
        if(Trig_Button_pressed_in_difficulty_dialog_Copy_Copy_Copy_Func001Func002Func002Func002C())then
          call PauseGameOff()
          call TriggerExecute(gg_trg_ExtraHard_Difficulty_Copy)
          call TriggerExecute(gg_trg_Level_1)
          call TriggerExecute(gg_trg_Modes_off)
        else
          if(Trig_Button_pressed_in_difficulty_dialog_Copy_Copy_Copy_Func001Func002Func002Func002Func002C())then
            call PauseGameOff()
            call TriggerExecute(gg_trg_Impossible_Difficulty_Copy)
            call TriggerExecute(gg_trg_Level_1)
            call TriggerExecute(gg_trg_Modes_off)
          endif
        endif
      endif
    endif
  endif
endfunction

function Trig_Easy_Difficulty_Copy_Actions takes nothing returns nothing
  call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,"|cffff0000Novice Difficulty|r")
  set udg_DifficultyLevel=1
  call SetPlayerTechResearchedSwap('R001',0,Player(11))
  call SetPlayerTechResearchedSwap('R002',0,Player(11))
  call SetPlayerTechResearchedSwap('R003',0,Player(11))
  call SetPlayerTechResearchedSwap('R004',0,Player(12))
  call SetPlayerTechResearchedSwap('R005',0,Player(12))
endfunction

function Trig_Normal_Difficulty_Copy_Actions takes nothing returns nothing
  call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,"|cff006699Experienced Difficulty|r")
  set udg_DifficultyLevel=2
  call SetPlayerTechResearchedSwap('R001',1,Player(11))
  call SetPlayerTechResearchedSwap('R002',1,Player(11))
  call SetPlayerTechResearchedSwap('R003',1,Player(11))
  call SetPlayerTechResearchedSwap('R004',1,Player(12))
  call SetPlayerTechResearchedSwap('R005',1,Player(12))
endfunction

function Trig_Hard_Difficulty_Copy_Actions takes nothing returns nothing
  call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,"|cff996666Professional Difficulty|r")
  set udg_DifficultyLevel=3
  call SetPlayerTechResearchedSwap('R001',2,Player(11))
  call SetPlayerTechResearchedSwap('R002',2,Player(11))
  call SetPlayerTechResearchedSwap('R003',2,Player(11))
  call SetPlayerTechResearchedSwap('R004',2,Player(12))
  call SetPlayerTechResearchedSwap('R005',2,Player(12))
endfunction

function Trig_ExtraHard_Difficulty_Copy_Actions takes nothing returns nothing
  call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,"|cffffcc00Champion Difficulty|r")
  set udg_DifficultyLevel=4
  call SetPlayerTechResearchedSwap('R001',3,Player(11))
  call SetPlayerTechResearchedSwap('R002',3,Player(11))
  call SetPlayerTechResearchedSwap('R003',3,Player(11))
  call SetPlayerTechResearchedSwap('R005',3,Player(12))
  call SetPlayerTechResearchedSwap('R004',3,Player(12))
endfunction

function Trig_Impossible_Difficulty_Copy_Actions takes nothing returns nothing
  call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,"|c00000000Impossible Difficulty|r")
  set udg_DifficultyLevel=5
  call SetPlayerTechResearchedSwap('R001',4,Player(11))
  call SetPlayerTechResearchedSwap('R002',4,Player(11))
  call SetPlayerTechResearchedSwap('R003',4,Player(11))
  call SetPlayerTechResearchedSwap('R005',4,Player(12))
  call SetPlayerTechResearchedSwap('R004',4,Player(12))
endfunction

function Trig_Bloodbath_Death_Conditions takes nothing returns boolean
  return(R2I(GetUnitStateSwap(UNIT_STATE_LIFE,gg_unit_n01L_0046))<=25000)
endfunction

function Trig_Bloodbath_Death_Func004002002 takes nothing returns boolean
  return(GetOwningPlayer(GetEnumUnit())!=Player(12))
endfunction

function Trig_Bloodbath_Death_Func018A takes nothing returns nothing
  call SetUnitPositionLoc(GetEnumUnit(),udg_HideBloodUnits)
endfunction

function Trig_Bloodbath_Death_Func022002 takes nothing returns nothing
  call CameraSetupApplyForPlayer(true,gg_cam_BloodBath_Death,GetEnumPlayer(),.0)
endfunction

function Trig_Bloodbath_Death_Func049002 takes nothing returns nothing
  call ResetToGameCameraForPlayer(GetEnumPlayer(),0)
endfunction

function Trig_Bloodbath_Death_Func050002 takes nothing returns nothing
  call PanCameraToTimedLocForPlayer(GetEnumPlayer(),udg_battlezone,.5)
endfunction

function Trig_Bloodbath_Death_Actions takes nothing returns nothing
  call DisableTrigger(GetTriggeringTrigger())
  set udg_BloodBath_Killer=GetAttacker()
  set udg_BloodbathBattleZone=GetUnitsInRectMatching(gg_rct_battle_zone,Condition(function Trig_Bloodbath_Death_Func004002002))
  set udg_HideBloodUnits=GetRectCenter(gg_rct_Hide_BloodUnits)
  set udg_BloodbathKiller=GetRectCenter(gg_rct_BloodBath_Killer)
  set udg_BloodbathStand=GetRectCenter(gg_rct_BloodBath_Stand1)
  set udg_Bloodbath_Killer=GetUnitLoc(udg_BloodBath_Killer)
  set udg_Region70=GetRectCenter(gg_rct_Region_070)
  set udg_battlezone=GetRectCenter(gg_rct_battle_zone)
  call PauseAllUnitsBJ(true)
  call CinematicModeBJ(true,bj_FORCE_ALL_PLAYERS)
  call ShowInterfaceForceOff(bj_FORCE_ALL_PLAYERS,2)
  call SetUserControlForceOff(bj_FORCE_ALL_PLAYERS)
  call ForceCinematicSubtitles(true)
  call CinematicFadeBJ(0,.0,"ReplaceableTextures\\CameraMasks\\Black_mask.blp",0,0,0,0)
  call ForGroupBJ(udg_BloodbathBattleZone,function Trig_Bloodbath_Death_Func018A)
  call SetUnitPositionLocFacingLocBJ(udg_BloodBath_Killer,udg_BloodbathKiller,udg_BloodbathStand)
  call SetUnitPositionLocFacingLocBJ(gg_unit_n01L_0046,udg_BloodbathStand,udg_Bloodbath_Killer)
  call SetUnitAnimation(gg_unit_n01L_0046,"Stand Ready")
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Bloodbath_Death_Func022002)
  call PlaySoundBJ(gg_snd_LightningBolt)
  call UnitRemoveBuffsBJ(2,udg_BloodBath_Killer)
  call UnitRemoveBuffsBJ(2,udg_BloodBathCine)
  call UnitRemoveBuffsBJ(2,gg_unit_n01L_0046)
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,udg_BloodBath_Killer,GetHeroProperName(udg_BloodBath_Killer),null,"Just give up the sword, and maybe I'll spare you're life.",0,.5,true)
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,gg_unit_n01L_0046,"Bloodbath",gg_snd_HeroBladeMasterPissed1,"Snatch the pebble from my hand grasshopper.",0,.5,true)
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,udg_BloodBath_Killer,GetHeroProperName(udg_BloodBath_Killer),null,"What?",0,.0,true)
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,gg_unit_n01L_0046,"Bloodbath",gg_snd_HeroBladeMasterWarcry1,"For the Burning Blade!!!",0,.1,true)
  call AddSpecialEffectLocBJ(udg_BloodbathStand,"Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call SetUnitPositionLocFacingLocBJ(gg_unit_n01L_0046,udg_Region70,udg_Bloodbath_Killer)
  call SetUnitTimeScalePercent(gg_unit_n01L_0046,30.)
  call SetUnitTimeScalePercent(udg_BloodBath_Killer,30.)
  call SetUnitAnimation(gg_unit_n01L_0046,"Attack Slam")
  call TriggerSleepAction(1.)
  call SetUnitAnimation(udg_BloodBath_Killer,"Attack Slam")
  call TriggerSleepAction(1.)
  call PlaySoundBJ(gg_snd_HeroBladeMasterDeath)
  call KillUnit(gg_unit_n01L_0046)
  call SetUnitTimeScalePercent(udg_BloodBath_Killer,100.)
  call PauseUnit(udg_BloodBath_Killer,true)
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,udg_BloodBath_Killer,GetHeroProperName(udg_BloodBath_Killer),gg_snd_Levelupcaster,"The legendary Jagged Edge...",0,3.,true)
  call CinematicModeBJ(false,bj_FORCE_ALL_PLAYERS)
  call ForceCinematicSubtitles(false)
  call ShowInterfaceForceOn(bj_FORCE_ALL_PLAYERS,1.)
  call SetUserControlForceOn(bj_FORCE_ALL_PLAYERS)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Bloodbath_Death_Func049002)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Bloodbath_Death_Func050002)
  call TriggerSleepAction(1.)
  call PauseAllUnitsBJ(false)
  call RemoveLocation(udg_HideBloodUnits)
  call RemoveLocation(udg_BloodbathKiller)
  call RemoveLocation(udg_BloodbathStand)
  call RemoveLocation(udg_Bloodbath_Killer)
  call RemoveLocation(udg_Region70)
  call RemoveLocation(udg_battlezone)
  set bj_wantDestroyGroup=true
endfunction

function Trig_Pause_Actions takes nothing returns nothing
  call PauseGameOn()
endfunction

function Trig_Troll_Village_Conditions takes nothing returns boolean
  return(IsUnitType(GetEnteringUnit(),UNIT_TYPE_HERO)!=null)
endfunction

function Trig_Troll_Village_Func014002 takes nothing returns nothing
  call CameraSetupApplyForPlayer(true,gg_cam_troll_village_cine1,GetEnumPlayer(),.0)
endfunction

function Trig_Troll_Village_Func022002 takes nothing returns nothing
  call CameraSetupApplyForPlayer(true,gg_cam_troll_village_cine2,GetEnumPlayer(),3.)
endfunction

function Trig_Troll_Village_Func031002 takes nothing returns nothing
  call ResetToGameCameraForPlayer(GetEnumPlayer(),0)
endfunction

function Trig_Troll_Village_Func032002 takes nothing returns nothing
  call PanCameraToTimedLocForPlayer(GetEnumPlayer(),udg_TrollCenterMap,.5)
endfunction

function Trig_Troll_Village_Actions takes nothing returns nothing
  set udg_TrollCenterMap=GetRectCenter(gg_rct_Center_of_Map)
  set udg_TrollCineEntering=GetUnitLoc(GetEnteringUnit())
  call IssueImmediateOrderById(GetEnteringUnit(),851972)
  call PauseAllUnitsBJ(true)
  call CinematicModeBJ(true,bj_FORCE_ALL_PLAYERS)
  call ShowInterfaceForceOff(bj_FORCE_ALL_PLAYERS,2)
  call SetUserControlForceOff(bj_FORCE_ALL_PLAYERS)
  call ForceCinematicSubtitles(true)
  call CinematicFadeBJ(1,2.,"ReplaceableTextures\\CameraMasks\\Black_mask.blp",100.,100.,100.,0)
  call TriggerSleepAction(2.)
  call SetUnitAnimation(gg_unit_o019_0288,"Stand -1")
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Troll_Village_Func014002)
  call PlaySoundBJ(gg_snd_ShadowHunterReady1)
  call TriggerSleepAction(3.4)
  call SetUnitAnimation(gg_unit_o019_0288,"Stand -1")
  call PlaySoundBJ(gg_snd_LightningBolt)
  call CinematicFadeBJ(0,.0,"ReplaceableTextures\\CameraMasks\\Black_mask.blp",0,0,0,0)
  call SetUnitAnimation(gg_unit_o019_0288,"Stand -1")
  call TriggerSleepAction(2)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Troll_Village_Func022002)
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,gg_unit_o019_0288,"Head Troll Warrior",gg_snd_Levelupcaster,"Hey mon, names Kerchek. Thank Vol'jin somebady finally came! You gotta help me mon. I wandered alone in that forest one night and some flying green ball stole me soul!",0,15.,true)
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,gg_unit_o019_0288,"Head Troll Warrior",null,"Luckily I am an expert when it comes to souls, so I was able to stay alive by changing myself to this etheral form, but I cannot lead my troops like this. You gotta help me mon, help return my soul to me, and I'll help you not lose your soul.",0,20.,true)
  call TriggerSleepAction(5.)
  call CinematicModeBJ(false,bj_FORCE_ALL_PLAYERS)
  call PlaySoundBJ(gg_snd_ShadowHunterYes1)
  call ForceCinematicSubtitles(false)
  call ShowInterfaceForceOn(bj_FORCE_ALL_PLAYERS,1.)
  call SetUserControlForceOn(bj_FORCE_ALL_PLAYERS)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Troll_Village_Func031002)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Troll_Village_Func032002)
  call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetEnteringUnit()),udg_TrollCineEntering,0)
  call TriggerSleepAction(1.)
  call PauseAllUnitsBJ(false)
  call DisableTrigger(GetTriggeringTrigger())
  call DisableTrigger(gg_trg_Timer_On_Troll)
  call PlaySoundBJ(gg_snd_QuestNew)
  call QuestSetDiscovered(udg_Kerchek,true)
  call FlashQuestDialogButton()
  call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,"|cffff8c00Quest Updated|r")
  call RemoveLocation(udg_TrollCenterMap)
  call RemoveLocation(udg_TrollCineEntering)
  call EnableTrigger(gg_trg_World_Tree)
endfunction

function Trig_World_Tree_Conditions takes nothing returns boolean
  return(IsUnitType(GetEnteringUnit(),UNIT_TYPE_HERO)!=null)
endfunction

function Trig_World_Tree_Func010002 takes nothing returns nothing
  call CameraSetupApplyForPlayer(true,gg_cam_world_tree_cine,GetEnumPlayer(),.0)
endfunction

function Trig_World_Tree_Func027002 takes nothing returns nothing
  call ResetToGameCameraForPlayer(GetEnumPlayer(),0)
endfunction

function Trig_World_Tree_Func028002 takes nothing returns nothing
  call PanCameraToTimedLocForPlayer(GetEnumPlayer(),udg_WorldTreeCenter,.5)
endfunction

function Trig_World_Tree_Actions takes nothing returns nothing
  set udg_WorldTreeCenter=GetRectCenter(gg_rct_world_tree_cine)
  call IssueImmediateOrderById(GetEnteringUnit(),851972)
  call PauseAllUnitsBJ(true)
  call CinematicModeBJ(true,bj_FORCE_ALL_PLAYERS)
  call ShowInterfaceForceOff(bj_FORCE_ALL_PLAYERS,2)
  call SetUserControlForceOff(bj_FORCE_ALL_PLAYERS)
  call ForceCinematicSubtitles(true)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_World_Tree_Func010002)
  call PlaySoundOnUnitBJ(gg_snd_KeeperOfTheGrovePissed1,'d',gg_unit_e00Q_0282)
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,gg_unit_e00Q_0282,"Keeper of the World Tree",gg_snd_Levelupcaster,"Well done! You have found the exit of Memory Forest. As your reward I give the exit to this forest AND, the mysterious Twig of Shadows.",0,6.,true)
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,GetTriggerUnit(),GetHeroProperName(GetTriggerUnit()),null,"Would you by any chance have the soul of a troll warrior with you?",0,5.,true)
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,gg_unit_e00Q_0282,"Keeper of the World Tree",null,"What? Huh? Soul of a troll? What type of sick...oh...unless you mean THIS troll warrior soul.",0,5.,true)
  call PlaySoundBJ(gg_snd_RestorationPotion)
  call CreateItemLoc('I04Q',udg_WorldTreeCenter)
  set udg_WorldTreeItem=GetItemLoc(bj_lastCreatedItem)
  call AddSpecialEffectLocBJ(udg_WorldTreeItem,"Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,gg_unit_e00Q_0282,"Keeper of the World Tree",null,"Peace.",0,2.,true)
  call KillUnit(gg_unit_e00Q_0282)
  call CinematicModeBJ(false,bj_FORCE_ALL_PLAYERS)
  call PlaySoundOnUnitBJ(gg_snd_KeeperOfTheGrovePissed3,'d',gg_unit_e00Q_0282)
  call ForceCinematicSubtitles(false)
  call ShowInterfaceForceOn(bj_FORCE_ALL_PLAYERS,1.)
  call SetUserControlForceOn(bj_FORCE_ALL_PLAYERS)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_World_Tree_Func027002)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_World_Tree_Func028002)
  call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetEnteringUnit()),udg_WorldTreeCenter,0)
  call TriggerSleepAction(1.)
  call PauseAllUnitsBJ(false)
  call RemoveLocation(udg_WorldTreeCenter)
  call RemoveLocation(udg_WorldTreeItem)
  call DisableTrigger(GetTriggeringTrigger())
endfunction

function Trig_Goblin_Village_Conditions takes nothing returns boolean
  return(IsUnitType(GetEnteringUnit(),UNIT_TYPE_HERO)!=null)
endfunction

function Trig_Goblin_Village_Func011002 takes nothing returns nothing
  call CameraSetupApplyForPlayer(true,gg_cam_goblin_village_cine,GetEnumPlayer(),.0)
endfunction

function Trig_Goblin_Village_Func013002 takes nothing returns nothing
  call RotateCameraAroundLocBJ(360.,udg_GoblinClockwork,GetEnumPlayer(),30.)
endfunction

function Trig_Goblin_Village_Func022002 takes nothing returns nothing
  call ResetToGameCameraForPlayer(GetEnumPlayer(),0)
endfunction

function Trig_Goblin_Village_Func023002 takes nothing returns nothing
  call PanCameraToTimedLocForPlayer(GetEnumPlayer(),udg_GoblinEntering,.5)
endfunction

function Trig_Goblin_Village_Actions takes nothing returns nothing
  set udg_GoblinClockwork=GetUnitLoc(gg_unit_ncg3_0233)
  set udg_GoblinEntering=GetUnitLoc(GetEnteringUnit())
  call IssueImmediateOrderById(GetEnteringUnit(),851972)
  call PauseAllUnitsBJ(true)
  call CinematicModeBJ(true,bj_FORCE_ALL_PLAYERS)
  call ShowInterfaceForceOff(bj_FORCE_ALL_PLAYERS,2)
  call SetUserControlForceOff(bj_FORCE_ALL_PLAYERS)
  call ForceCinematicSubtitles(true)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Goblin_Village_Func011002)
  call TriggerSleepAction(1.)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Goblin_Village_Func013002)
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,gg_unit_Ntin_0226,"Goblin Rebel Leader",gg_snd_HeroTinkerPissed6,"Hola, recepcion al puesto avanzado cinco del goblin. ?Si usted tiene tiempo usted importaria el eliminar del goblin enojado en el droid? El se ha trabado en un cuarto por completo de minas y amenaza cada uno en el puesto avanzado. Si usted termina esta busqueda, vuelta y le recompensar?",0,4.,true)
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,gg_unit_Nalm_0236,"Goblin General",gg_snd_HeroAlchemistPissed6,"*Ahem* Hello, welcome to Goblin Outpost five. If you have time would you mind eliminating the mad goblin in the droid? He has locked himself in a room full of mines and threatens everyone in the outpost. If you complete this quest, come back and i will reward you.",0,6.,true)
  call TriggerSleepAction(2)
  call CinematicModeBJ(false,bj_FORCE_ALL_PLAYERS)
  call PlaySoundOnUnitBJ(gg_snd_HeroTinkerPissed5,'d',gg_unit_Ntin_0226)
  call ForceCinematicSubtitles(false)
  call ShowInterfaceForceOn(bj_FORCE_ALL_PLAYERS,1.)
  call SetUserControlForceOn(bj_FORCE_ALL_PLAYERS)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Goblin_Village_Func022002)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Goblin_Village_Func023002)
  call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetEnteringUnit()),udg_GoblinEntering,0)
  call TriggerSleepAction(1.)
  call PauseAllUnitsBJ(false)
  call DisableTrigger(GetTriggeringTrigger())
  call DisableTrigger(gg_trg_Timer_On_Goblin)
  call PlaySoundBJ(gg_snd_QuestNew)
  call QuestSetDiscovered(udg_PedroNegro,true)
  call FlashQuestDialogButton()
  call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,"|cffff8c00Quest Updated|r")
  call RemoveLocation(udg_GoblinClockwork)
  call RemoveLocation(udg_GoblinEntering)
  call EnableTrigger(gg_trg_Pedro_Negro)
endfunction

function Trig_Pedro_Negro_Conditions takes nothing returns boolean
  return(IsUnitType(GetEnteringUnit(),UNIT_TYPE_HERO)!=null)
endfunction

function Trig_Pedro_Negro_Func012002 takes nothing returns nothing
  call CameraSetupApplyForPlayer(true,gg_cam_Pedro_Negro_start,GetEnumPlayer(),.0)
endfunction

function Trig_Pedro_Negro_Func018002 takes nothing returns nothing
  call CameraSetupApplyForPlayer(true,gg_cam_Pedro_Negro_move,GetEnumPlayer(),10.)
endfunction

function Trig_Pedro_Negro_Func022002 takes nothing returns nothing
  call CameraSetupApplyForPlayer(true,gg_cam_Pedro_Negro_View,GetEnumPlayer(),3.)
endfunction

function Trig_Pedro_Negro_Func023002 takes nothing returns nothing
  call PauseUnit(GetEnumUnit(),false)
endfunction

function Trig_Pedro_Negro_Func047002 takes nothing returns nothing
  call ResetToGameCameraForPlayer(GetEnumPlayer(),0)
endfunction

function Trig_Pedro_Negro_Func048002 takes nothing returns nothing
  call PanCameraToTimedLocForPlayer(GetEnumPlayer(),udg_PedroNegro_Unit,.5)
endfunction

function Trig_Pedro_Negro_Actions takes nothing returns nothing
  set udg_PedroNegroCine=GetRectCenter(gg_rct_Pedro_Negro_Cine)
  set udg_PedroNegroGroup=GetUnitsInRectAll(gg_rct_Goblin_Unpause)
  set udg_PedroNegro_Unit=GetUnitLoc(gg_unit_n01T_0064)
  call IssueImmediateOrderById(GetEnteringUnit(),851972)
  call PauseAllUnitsBJ(true)
  call CinematicModeBJ(true,bj_FORCE_ALL_PLAYERS)
  call ShowInterfaceForceOff(bj_FORCE_ALL_PLAYERS,2)
  call SetUserControlForceOff(bj_FORCE_ALL_PLAYERS)
  call ForceCinematicSubtitles(true)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Pedro_Negro_Func012002)
  call PlaySoundAtPointBJ(gg_snd_IronGolemDeath1,'d',udg_PedroNegro_Unit,0)
  call PlaySoundAtPointBJ(gg_snd_IronGolemPissed3,'d',udg_PedroNegro_Unit,0)
  call KillDestructable(gg_dest_ZTg1_1962)
  call PlaySoundAtPointBJ(gg_snd_IronGolemPissed2,'d',udg_PedroNegro_Unit,0)
  call PlaySoundAtPointBJ(gg_snd_IronGolemWhat1,'d',udg_PedroNegro_Unit,0)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Pedro_Negro_Func018002)
  call PlaySoundOnUnitBJ(gg_snd_IronGolemYes2,'d',gg_unit_n01T_0064)
  call SetUnitAnimation(gg_unit_n01T_0064,"Stand 4")
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,gg_unit_n01T_0064,"Pedro Negro",gg_snd_Levelupcaster,"Hehehehehehehe...hahahaHAHAHA!!!",0,1.,true)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Pedro_Negro_Func022002)
  call ForGroupBJ(udg_PedroNegroGroup,function Trig_Pedro_Negro_Func023002)
  call SetUnitAnimation(gg_unit_n01T_0064,"Stand 4")
  call TriggerSleepAction(2)
  call PlaySoundAtPointBJ(gg_snd_GoblinSapperYesAttack3,'d',udg_PedroNegroCine,0)
  call IssuePointOrderByIdLoc(gg_unit_n028_0298,851986,udg_PedroNegroCine)
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,gg_unit_n028_0297,"Pedro's Minion",gg_snd_Levelupcaster,"Do not run, we are your friends!",0,2.,true)
  call IssuePointOrderByIdLoc(gg_unit_n028_0298,852040,udg_PedroNegroCine)
  call IssuePointOrderByIdLoc(gg_unit_n028_0297,851984,udg_PedroNegroCine)
  call TriggerSleepAction(2)
  call IssueTargetOrderById(gg_unit_n01T_0064,851985,gg_unit_n028_0297)
  call TriggerSleepAction(1.)
  call ExplodeUnitBJ(gg_unit_n028_0297)
  call PlaySoundOnUnitBJ(gg_snd_IronGolemYes2,'d',gg_unit_n01T_0064)
  call PlaySoundOnUnitBJ(gg_snd_IronGolemDeath1,'d',gg_unit_n01T_0064)
  call SetDoodadAnimationRectBJ("stand",'YOtf',gg_rct_Mine_Field)
  call SetDoodadAnimationRectBJ("stand",'YOf1',gg_rct_Mine_Field)
  call TransmissionFromUnitWithNameBJ(bj_FORCE_ALL_PLAYERS,gg_unit_n01T_0064,"Pedro Negro",gg_snd_Levelupcaster,"You die HERE!!!",0,2.,true)
  call PlaySoundOnUnitBJ(gg_snd_IronGolemYes2,'d',gg_unit_n01T_0064)
  call TriggerSleepAction(2)
  call CinematicModeBJ(false,bj_FORCE_ALL_PLAYERS)
  call PlaySoundOnUnitBJ(gg_snd_IronGolemYes2,'d',gg_unit_n01T_0064)
  call ForceCinematicSubtitles(false)
  call ShowInterfaceForceOn(bj_FORCE_ALL_PLAYERS,1.)
  call SetUserControlForceOn(bj_FORCE_ALL_PLAYERS)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Pedro_Negro_Func047002)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Pedro_Negro_Func048002)
  call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetEnteringUnit()),udg_PedroNegro_Unit,0)
  call TriggerSleepAction(1.)
  call PauseAllUnitsBJ(false)
  call RemoveLocation(udg_PedroNegro_Unit)
  call RemoveLocation(udg_PedroNegroCine)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
endfunction

function Trig_Pedro_Negro_Death_Func009002 takes nothing returns nothing
  call ExplodeUnitBJ(GetEnumUnit())
endfunction

function Trig_Pedro_Negro_Death_Actions takes nothing returns nothing
  set udg_PedroNegroDeath=GetUnitLoc(GetDyingUnit())
  set udg_PedroNegroDeathGroup=GetUnitsInRectOfPlayer(gg_rct_Mine_Field,Player(12))
  call CreateNUnitsAtLoc(1,'h01A',Player(15),udg_PedroNegroDeath,bj_UNIT_FACING)
  call PlaySoundBJ(gg_snd_BuildingDeathLargeHuman)
  call SetUnitTimeScalePercent(bj_lastCreatedUnit,20.)
  call SetDoodadAnimationRectBJ("death",'YOtf',gg_rct_Mine_Field)
  call PlaySoundBJ(gg_snd_BuildingDeathLargeHuman)
  call SetDoodadAnimationRectBJ("death",'YOf1',gg_rct_Mine_Field)
  call ForGroupBJ(udg_PedroNegroDeathGroup,function Trig_Pedro_Negro_Death_Func009002)
  call TriggerSleepAction(5.)
  call RemoveUnit(bj_lastCreatedUnit)
  call RemoveLocation(udg_PedroNegroDeath)
  set bj_wantDestroyGroup=true
endfunction

function Trig_Ultima_Weapon_Cine_Conditions takes nothing returns boolean
  return(GetItemTypeId(GetManipulatedItem())=='I047')
endfunction

function Trig_Ultima_Weapon_Cine_Func011002 takes nothing returns nothing
  call PanCameraToTimedLocForPlayer(GetEnumPlayer(),udg_UltimateWeaponHolderPos,0)
endfunction

function Trig_Ultima_Weapon_Cine_Func012002 takes nothing returns nothing
  call RotateCameraAroundLocBJ(360.,udg_UltimateWeaponHolderPos,GetEnumPlayer(),10.)
endfunction

function Trig_Ultima_Weapon_Cine_Func031002 takes nothing returns nothing
  call ResetToGameCameraForPlayer(GetEnumPlayer(),0)
endfunction

function Trig_Ultima_Weapon_Cine_Func032002 takes nothing returns nothing
  call PanCameraToTimedLocForPlayer(GetEnumPlayer(),udg_UltimateWeaponHolderPos,.5)
endfunction

function Trig_Ultima_Weapon_Cine_Actions takes nothing returns nothing
  set udg_UltimaWeaponHolder=GetManipulatingUnit()
  set udg_UltimateWeaponHolderPos=GetUnitLoc(udg_UltimaWeaponHolder)
  call PauseAllUnitsBJ(true)
  call CinematicModeBJ(true,bj_FORCE_ALL_PLAYERS)
  call ShowInterfaceForceOff(bj_FORCE_ALL_PLAYERS,2)
  call SetUserControlForceOff(bj_FORCE_ALL_PLAYERS)
  call ForceCinematicSubtitles(true)
  call CinematicFadeBJ(0,3.,"ReplaceableTextures\\CameraMasks\\Black_mask.blp",0,0,0,0)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Ultima_Weapon_Cine_Func011002)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Ultima_Weapon_Cine_Func012002)
  call TerrainDeformationRippleBJ(5.,false,udg_UltimateWeaponHolderPos,1024,1024,150.,1,512)
  call SetUnitAnimation(GetManipulatingUnit(),"Stand Victory")
  call EnableTrigger(gg_trg_Ultima_Weapon_Crazy)
  call PlaySoundBJ(gg_snd_ReviveHuman)
  call AddSpecialEffectTargetUnitBJ("overhead",udg_UltimaWeaponHolder,"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call TriggerSleepAction(6.)
  call DisableTrigger(gg_trg_Ultima_Weapon_Crazy)
  call CreateNUnitsAtLoc(1,'h01H',GetOwningPlayer(udg_UltimaWeaponHolder),udg_UltimateWeaponHolderPos,bj_UNIT_FACING)
  call UnitAddAbility(bj_lastCreatedUnit,'A0N7')
  call IssueImmediateOrderById(bj_lastCreatedUnit,852127)
  call AddSpecialEffectTargetUnitBJ("overhead",udg_UltimaWeaponHolder,"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call PlaySoundBJ(gg_snd_ReviveHuman)
  call CinematicModeBJ(false,bj_FORCE_ALL_PLAYERS)
  call ForceCinematicSubtitles(false)
  call ShowInterfaceForceOn(bj_FORCE_ALL_PLAYERS,2.)
  call SetUserControlForceOn(bj_FORCE_ALL_PLAYERS)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Ultima_Weapon_Cine_Func031002)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Ultima_Weapon_Cine_Func032002)
  call TriggerSleepAction(1.)
  call PauseAllUnitsBJ(false)
  call RemoveLocation(udg_UltimateWeaponHolderPos)
  call DisableTrigger(GetTriggeringTrigger())
endfunction

function Trig_Ultima_Weapon_Crazy_Actions takes nothing returns nothing
  set udg_UltimateWeaponHolderPos=GetUnitLoc(udg_UltimaWeaponHolder)
  set udg_UltimaCineRandom=GetRandomLocInRect(RectFromCenterSizeBJ(udg_UltimateWeaponHolderPos,300.,300.))
  call AddSpecialEffectLocBJ(udg_UltimaCineRandom,"Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectLocBJ(udg_UltimaCineRandom,"Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectLocBJ(udg_UltimaCineRandom,"Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveLocation(udg_UltimateWeaponHolderPos)
  call RemoveLocation(udg_UltimaCineRandom)
endfunction

function Trig_Invulnerable_Actions takes nothing returns nothing
  call SetUnitInvulnerable(gg_unit_n01L_0046,true)
  call SetUnitInvulnerable(gg_unit_n01M_0045,true)
  call SetDestructableInvulnerable(gg_dest_ZTg1_1962,true)
  call DisableTrigger(GetTriggeringTrigger())
endfunction

function Trig_Vulnerable_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(GetUnitsOfPlayerAll(Player(11))))
endfunction

function Trig_Vulnerable_Actions takes nothing returns nothing
  set udg_VulnerablePoint=GetRectCenter(gg_rct_battle_zone)
  set udg_VulnerableShieldMooCave=GetRectCenter(gg_rct_Shield_Moo_Cave)
  call PlaySoundBJ(gg_snd_QuestNew)
  call QuestSetDiscovered(udg_Secret_Boss,true)
  call FlashQuestDialogButton()
  call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,"|cffff8c00Quest Updated|r")
  call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,udg_VulnerablePoint,35.,1,'d','d','d')
  call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,udg_VulnerableShieldMooCave,35.,1,50.,'d',50.)
  call SetUnitInvulnerable(gg_unit_n01L_0046,false)
  call SetUnitInvulnerable(gg_unit_n01M_0045,false)
  call RemoveLocation(udg_VulnerableShieldMooCave)
  call RemoveLocation(udg_VulnerablePoint)
  call DisableTrigger(GetTriggeringTrigger())
endfunction

function Trig_Centaur_Khan_Conditions takes nothing returns boolean
  return(GetItemTypeId(GetManipulatedItem())=='I047')
endfunction

function Trig_Centaur_Khan_Func010002001 takes nothing returns boolean
  return(GetDestructableTypeId(GetEnumDestructable())=='YTfc')
endfunction

function Trig_Centaur_Khan_Func010002 takes nothing returns nothing
  if(Trig_Centaur_Khan_Func010002001())then
    call RemoveDestructable(GetEnumDestructable())
  endif
endfunction

function Trig_Centaur_Khan_Actions takes nothing returns nothing
  set udg_DesertHill=GetRectCenter(gg_rct_Desert_Hill)
  set udg_CenterEndingKhan=GetRectCenter(gg_rct_EndingKhan)
  call PlaySoundBJ(gg_snd_QuestCompleted)
  call QuestSetCompleted(udg_Secret_Boss,true)
  call QuestSetDiscovered(udg_Centaur_Khan,true)
  call FlashQuestDialogButton()
  call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,"|cffff8c00Quest Updated|r")
  call PlaySoundBJ(gg_snd_QuestNew)
  call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,udg_DesertHill,40.,0,20.,20.,'d')
  call EnumDestructablesInRectAll(gg_rct_Showdown,function Trig_Centaur_Khan_Func010002)
  call CreateNUnitsAtLoc(1,'n02K',Player(11),udg_CenterEndingKhan,bj_UNIT_FACING)
  set udg_CentaurKhan=bj_lastCreatedUnit
  call RemoveLocation(udg_CenterEndingKhan)
  call RemoveLocation(udg_DesertHill)
  call EnableTrigger(gg_trg_Burn_Trees)
  call DisableTrigger(gg_trg_Desert_Winds)
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_YOU_WON_Copy)
endfunction

function Trig_Stay_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLeavingUnit())=='n02K')
endfunction

function Trig_Stay_Actions takes nothing returns nothing
  call SetUnitPositionLoc(GetLeavingUnit(),GetRectCenter(gg_rct_EndingKhan))
endfunction

function Trig_Burn_Trees_Func003Func001002 takes nothing returns nothing
  call RemoveDestructable(GetEnumDestructable())
endfunction

function Trig_Burn_Trees_Func003Func002002 takes nothing returns nothing
  call RemoveDestructable(GetEnumDestructable())
endfunction

function Trig_Burn_Trees_Func003Func009002 takes nothing returns nothing
  call RemoveDestructable(GetEnumDestructable())
endfunction

function Trig_Burn_Trees_Func003C takes nothing returns boolean
  return(CountPlayersInForceBJ(udg_PlayersInGame)<=3)
endfunction

function Trig_Burn_Trees_Actions takes nothing returns nothing
  call SetUnitOwner(gg_unit_n02W_0280,Player(11),true)
  call SetUnitOwner(gg_unit_n02W_0289,Player(11),true)
  if(Trig_Burn_Trees_Func003C())then
    call EnumDestructablesInRectAll(gg_rct_Burn_Trees,function Trig_Burn_Trees_Func003Func009002)
    call RemoveUnit(gg_unit_n02W_0289)
    call EnableTrigger(gg_trg_Centaur_Spawns)
    call EnableTrigger(gg_trg_Tauren_Spawns)
    call EnableTrigger(gg_trg_WayPoints)
    call DisableTrigger(GetTriggeringTrigger())
  else
    call EnumDestructablesInRectAll(gg_rct_Burn_Trees,function Trig_Burn_Trees_Func003Func001002)
    call EnumDestructablesInRectAll(gg_rct_Burn_Trees_2,function Trig_Burn_Trees_Func003Func002002)
    call EnableTrigger(gg_trg_Centaur_Spawns)
    call EnableTrigger(gg_trg_Centaur_Spawns2)
    call EnableTrigger(gg_trg_Tauren_Spawns)
    call EnableTrigger(gg_trg_Tauren_Spawns2)
    call EnableTrigger(gg_trg_WayPoints)
    call DisableTrigger(GetTriggeringTrigger())
  endif
endfunction

function Trig_Tauren_Spawns_Actions takes nothing returns nothing
  set udg_TaurenSpawn=GetRectCenter(gg_rct_Tauren_Spawn1)
  call CreateNUnitsAtLoc(3,'n02U',Player(10),udg_TaurenSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(2,'n02V',Player(10),udg_TaurenSpawn,bj_UNIT_FACING)
  call RemoveLocation(udg_TaurenSpawn)
endfunction

function Trig_Tauren_Spawns2_Actions takes nothing returns nothing
  set udg_TaurenSpawn2=GetRectCenter(gg_rct_Tauren_Spawn2)
  call CreateNUnitsAtLoc(3,'n02U',Player(10),udg_TaurenSpawn2,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(2,'n02V',Player(10),udg_TaurenSpawn2,bj_UNIT_FACING)
  call RemoveLocation(udg_TaurenSpawn2)
endfunction

function Trig_Centaur_Spawns_Actions takes nothing returns nothing
  set udg_CentaurSpawn=GetRectCenter(gg_rct_CentaurSpawn1)
  call CreateNUnitsAtLoc(3,'n02S',Player(11),udg_CentaurSpawn,bj_UNIT_FACING)
  call TriggerSleepAction(2)
  call CreateNUnitsAtLoc(2,'n02T',Player(11),udg_CentaurSpawn,bj_UNIT_FACING)
  call RemoveLocation(udg_CentaurSpawn)
endfunction

function Trig_Centaur_Spawns2_Actions takes nothing returns nothing
  set udg_CentaurSpawn2=GetRectCenter(gg_rct_CentaurSpawn2)
  call CreateNUnitsAtLoc(3,'n02S',Player(11),GetRectCenter(gg_rct_CentaurSpawn2),bj_UNIT_FACING)
  call TriggerSleepAction(2)
  call CreateNUnitsAtLoc(2,'n02T',Player(11),GetRectCenter(gg_rct_CentaurSpawn2),bj_UNIT_FACING)
  call RemoveLocation(udg_CentaurSpawn2)
endfunction

function Trig_WayPoints_Actions takes nothing returns nothing
  set udg_WayPointC1=GetUnitsInRectOfPlayer(gg_rct_CentaurSpawn1,Player(11))
  set udg_WayPointC2=GetUnitsInRectOfPlayer(gg_rct_CentaurSpawn2,Player(11))
  set udg_WayPointCB1=GetUnitsInRectOfPlayer(gg_rct_Burn_Trees,Player(11))
  set udg_WayPointCB2=GetUnitsInRectOfPlayer(gg_rct_Burn_Trees_2,Player(11))
  set udg_WayPointT1=GetUnitsInRectOfPlayer(gg_rct_Tauren_Spawn1,Player(10))
  set udg_WayPointT2=GetUnitsInRectOfPlayer(gg_rct_Tauren_Spawn2,Player(10))
  set udg_WayPointTB1=GetUnitsInRectOfPlayer(gg_rct_Burn_Trees,Player(10))
  set udg_WayPointTB2=GetUnitsInRectOfPlayer(gg_rct_Burn_Trees_2,Player(10))
  set udg_WayPointRandom_BT1=GetRandomLocInRect(gg_rct_Burn_Trees)
  set udg_WayPointRandom_BT2=GetRandomLocInRect(gg_rct_Burn_Trees_2)
  set udg_WayPointRandom_Center=GetRandomLocInRect(gg_rct_Center_of_Map)
  set udg_WayPointRandom_DesertHill=GetRandomLocInRect(gg_rct_Desert_Hill)
  call GroupPointOrderByIdLoc(udg_WayPointC1,851983,udg_WayPointRandom_BT1)
  call GroupPointOrderByIdLoc(udg_WayPointCB1,851983,udg_WayPointRandom_Center)
  call GroupPointOrderByIdLoc(udg_WayPointC2,851983,udg_WayPointRandom_BT2)
  call GroupPointOrderByIdLoc(udg_WayPointCB2,851983,udg_WayPointRandom_Center)
  call GroupPointOrderByIdLoc(udg_WayPointT1,851983,udg_WayPointRandom_BT1)
  call GroupPointOrderByIdLoc(udg_WayPointTB1,851983,udg_WayPointRandom_DesertHill)
  call GroupPointOrderByIdLoc(udg_WayPointT2,851983,udg_WayPointRandom_BT2)
  call GroupPointOrderByIdLoc(udg_WayPointTB2,851983,udg_WayPointRandom_DesertHill)
  call RemoveLocation(udg_WayPointRandom_BT1)
  call RemoveLocation(udg_WayPointRandom_BT2)
  call RemoveLocation(udg_WayPointRandom_Center)
  call RemoveLocation(udg_WayPointRandom_DesertHill)
  set bj_wantDestroyGroup=true
endfunction

function Trig_Destroyed_Func001Func001001 takes nothing returns boolean
  return(GetDyingUnit()==gg_unit_n02W_0289)
endfunction

function Trig_Destroyed_Func001C takes nothing returns boolean
  return(GetDyingUnit()==gg_unit_n02W_0280)
endfunction

function Trig_Destroyed_Actions takes nothing returns nothing
  if(Trig_Destroyed_Func001C())then
    call DisableTrigger(gg_trg_Centaur_Spawns)
  else
    if(Trig_Destroyed_Func001Func001001())then
      call DisableTrigger(gg_trg_Centaur_Spawns2)
    endif
  endif
endfunction

function Trig_Combine_Items_Conditions takes nothing returns boolean
  return(GetItemCharges(GetManipulatedItem())>0)
endfunction

function Trig_Combine_Items_Actions takes nothing returns nothing
  local integer ITEMCOUNT
  local integer ITEMLOOP
  local integer CHARGES
  local integer MAXIMUM
  local item NEWITEM
  local unit OURUNIT
  set MAXIMUM=50
  set ITEMCOUNT=0
  set ITEMLOOP=0
  set CHARGES=0
  set NEWITEM=GetManipulatedItem()
  set OURUNIT=GetManipulatingUnit()
  loop
    exitwhen ITEMLOOP>6
    if((GetItemTypeId(NEWITEM))==(GetItemTypeId(UnitItemInSlotBJ(OURUNIT,ITEMLOOP))))then
      if((GetItemCharges(UnitItemInSlotBJ(OURUNIT,ITEMLOOP))+GetItemCharges(NEWITEM))<=MAXIMUM)then
        if not((UnitItemInSlotBJ(OURUNIT,ITEMLOOP))==(NEWITEM))then
          set CHARGES=(GetItemCharges(UnitItemInSlotBJ(OURUNIT,ITEMLOOP)))+GetItemCharges(NEWITEM)
          call SetItemCharges(UnitItemInSlotBJ(OURUNIT,ITEMLOOP),CHARGES)
          call RemoveItem(NEWITEM)
          set ITEMLOOP=7
        endif
      endif
    endif
    if(ITEMLOOP<7)then
      set ITEMLOOP=ITEMLOOP+1
    endif
  endloop
endfunction

function Trig_Enchanted_Axe_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='H009')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0KC',GetLearningUnit())<=1)
endfunction

function Trig_Enchanted_Axe_Actions takes nothing returns nothing
  set udg_Dwarf=GetLearningUnit()
  call UnitAddAbility(GetLearningUnit(),'A0KC')
  call EnableTrigger(gg_trg_Enchanted_ON)
endfunction

function Trig_Enchanted_ON_Actions takes nothing returns nothing
  call UnitAddAbility(udg_Dwarf,'A0KC')
endfunction

function Trig_Blitz_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='O004')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0JW',GetLearningUnit())<=1)
endfunction

function Trig_Blitz_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0JW')
endfunction

function Trig_Kinetic_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='O015')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A06H',GetLearningUnit())<=1)
endfunction

function Trig_Kinetic_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A06H')
endfunction

function Trig_Terra_Upheaval_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='H00N')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0JN',GetLearningUnit())<=1)
endfunction

function Trig_Terra_Upheaval_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0JN')
endfunction

function Trig_Viral_rush_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='H00Q')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0K4',GetLearningUnit())<=1)
endfunction

function Trig_Viral_rush_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0K4')
endfunction

function Trig_Emma_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='O01M')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0N5',GetLearningUnit())<=1)
endfunction

function Trig_Emma_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0N5')
endfunction

function Trig_Red_Dynasty_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='U00I')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0JI',GetLearningUnit())<=1)
endfunction

function Trig_Red_Dynasty_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0JI')
endfunction

function Trig_Ravage_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='O01K')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0LA',GetLearningUnit())<=1)
endfunction

function Trig_Ravage_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0LA')
endfunction

function Trig_Hunger_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='U009')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0NW',GetLearningUnit())<=1)
endfunction

function Trig_Hunger_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0NW')
endfunction

function Trig_Shurikentoss_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='H00B')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0J0',GetLearningUnit())<=1)
endfunction

function Trig_Shurikentoss_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0J0')
endfunction

function Trig_Ancient_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='E006')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0J3',GetLearningUnit())<=1)
endfunction

function Trig_Ancient_Actions takes nothing returns nothing
  set udg_Guardian=GetLearningUnit()
  call UnitAddAbility(GetLearningUnit(),'A0J3')
  call EnableTrigger(gg_trg_Ancient_ON)
endfunction

function Trig_Ancient_ON_Actions takes nothing returns nothing
  call UnitAddAbility(udg_Guardian,'A0J3')
endfunction

function Trig_Demi_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='E000')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0IV',GetLearningUnit())<=1)
endfunction

function Trig_Demi_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0IV')
endfunction

function Trig_Synergy_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='N020')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0K5',GetLearningUnit())<=1)
endfunction

function Trig_Synergy_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0K5')
endfunction

function Trig_Perification_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='H005')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0IU',GetLearningUnit())<=1)
endfunction

function Trig_Perification_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0IU')
endfunction

function Trig_Hail_Break_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='O00N')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0AO',GetLearningUnit())<=1)
endfunction

function Trig_Hail_Break_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0AO')
endfunction

function Trig_Glacial_Path_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='N01X')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0IL',GetLearningUnit())<=1)
endfunction

function Trig_Glacial_Path_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0IL')
endfunction

function Trig_Scapalexis_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='N002')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0NS',GetLearningUnit())<=1)
endfunction

function Trig_Scapalexis_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0NS')
endfunction

function Trig_Cozi_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='N02J')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0L8',GetLearningUnit())<=1)
endfunction

function Trig_Cozi_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0L9')
  call UnitAddAbility(GetLearningUnit(),'A0L8')
endfunction

function Trig_Damage_Block_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='O00M')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0J8',GetLearningUnit())<=1)
endfunction

function Trig_Damage_Block_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0J8')
endfunction

function Trig_Cheese_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='N003')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0JB',GetLearningUnit())<=1)
endfunction

function Trig_Cheese_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0JB')
endfunction

function Trig_Cleaving_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='O016')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0JC',GetLearningUnit())<=1)
endfunction

function Trig_Cleaving_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0JC')
endfunction

function Trig_Lightning_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='O001')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0F9',GetLearningUnit())<=1)
endfunction

function Trig_Lightning_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0F9')
endfunction

function Trig_Shadow_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='E014')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0J7',GetLearningUnit())<=1)
endfunction

function Trig_Shadow_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0J7')
endfunction

function Trig_Blade_Dance_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='O000')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0IF',GetLearningUnit())<=1)
endfunction

function Trig_Blade_Dance_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0IF')
endfunction

function Trig_Naisha_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='E00D')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0HA',GetLearningUnit())<=1)
endfunction

function Trig_Naisha_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0HA')
endfunction

function Trig_Panda_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='N000')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0G1',GetLearningUnit())<=1)
endfunction

function Trig_Panda_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0G1')
endfunction

function Trig_Minotaur_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='O003')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0GQ',GetLearningUnit())<=1)
endfunction

function Trig_Minotaur_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0GQ')
endfunction

function Trig_Direct_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='O002')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A00H',GetLearningUnit())<=1)
endfunction

function Trig_Direct_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A00H')
endfunction

function Trig_Pong_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='O00H')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0FU',GetLearningUnit())<=1)
endfunction

function Trig_Pong_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0FU')
endfunction

function Trig_Meteor_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='O00P')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0FO',GetLearningUnit())<=1)
endfunction

function Trig_Meteor_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0FO')
endfunction

function Trig_Mark_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='E007')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0GK',GetLearningUnit())<=1)
endfunction

function Trig_Mark_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0GK')
endfunction

function Trig_Warden_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='E004')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0ID',GetLearningUnit())<=1)
endfunction

function Trig_Warden_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0ID')
endfunction

function Trig_Poseidon_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetLearningUnit())=='O01E')and(GetHeroLevel(GetLearningUnit())>=25)and(GetUnitAbilityLevelSwapped('A0HX',GetLearningUnit())<=1)
endfunction

function Trig_Poseidon_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0HX')
endfunction

function Trig_Return_of_Tombo_Actions takes nothing returns nothing
  call CreateNUnitsAtLoc(1,'o00F',Player(15),GetDestructableLoc(GetDyingDestructable()),bj_UNIT_FACING)
endfunction

function Trig_Forest_Watcher_Control_Actions takes nothing returns nothing
  call RemoveDestructable(gg_dest_YTpb_1534)
  call RemoveDestructable(gg_dest_YTpb_1535)
  call RemoveDestructable(gg_dest_YTpb_1536)
  call RemoveDestructable(gg_dest_YTpb_1537)
  call RemoveDestructable(gg_dest_YTpb_1538)
  call RemoveDestructable(gg_dest_YTpb_1539)
  call EnableTrigger(gg_trg_Step_Pad)
  call DisableTrigger(gg_trg_Keep_Out)
endfunction

function Trig_Keep_Out_Conditions takes nothing returns boolean
  return(IsUnitType(GetEnteringUnit(),UNIT_TYPE_HERO)!=null)
endfunction

function Trig_Keep_Out_Actions takes nothing returns nothing
  set udg_KeepOutRandom=GetRandomLocInRect(gg_rct_battle_zone)
  call SetUnitPositionLoc(GetEnteringUnit(),udg_KeepOutRandom)
  call RemoveLocation(udg_KeepOutRandom)
endfunction

function Trig_Step_Pad_Conditions takes nothing returns boolean
  return(IsUnitType(GetEnteringUnit(),UNIT_TYPE_HERO)!=null)
endfunction

function Trig_Step_Pad_Actions takes nothing returns nothing
  call KillDestructable(gg_dest_DTfp_0841)
  call CreateNUnitsAtLoc(3,'n027',GetOwningPlayer(GetEnteringUnit()),GetRandomLocInRect(gg_rct_forest_keep),bj_UNIT_FACING)
  call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,"You now have control over the Watchers of the Forest.")
endfunction

function Trig_Exit_Forest_Conditions takes nothing returns boolean
  return(IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO)!=null)
endfunction

function Trig_Exit_Forest_Actions takes nothing returns nothing
  set udg_CenterOfMap=GetRectCenter(gg_rct_Center_of_Map)
  call SetUnitPositionLoc(GetTriggerUnit(),udg_CenterOfMap)
  call TriggerSleepAction(.01)
  call PanCameraToTimedLocForPlayer(GetOwningPlayer(GetTriggerUnit()),udg_CenterOfMap,.5)
  call RemoveLocation(udg_CenterOfMap)
endfunction

function Trig_Forest_Watchers_Func004001 takes nothing returns boolean
  return(GetUnitTypeId(GetLeavingUnit())=='n01K')
endfunction

function Trig_Forest_Watchers_Func004002 takes nothing returns boolean
  return(GetUnitTypeId(GetLeavingUnit())=='n027')
endfunction

function Trig_Forest_Watchers_Conditions takes nothing returns boolean
  return(GetBooleanOr(Trig_Forest_Watchers_Func004001(),Trig_Forest_Watchers_Func004002()))
endfunction

function Trig_Forest_Watchers_Actions takes nothing returns nothing
  set udg_ForestKeepRandom=GetRandomLocInRect(gg_rct_forest_keep)
  call SetUnitPositionLoc(GetLeavingUnit(),udg_ForestKeepRandom)
  call RemoveLocation(udg_ForestKeepRandom)
endfunction

function Trig_Exit_Cave_Actions takes nothing returns nothing
  call DestructableRestoreLife(gg_dest_YT26_0691,GetDestructableMaxLife(bj_lastCreatedDestructable),true)
  call RemoveDestructable(gg_dest_YTfb_1848)
  call RemoveDestructable(gg_dest_YTfb_1849)
  call RemoveDestructable(gg_dest_YTfb_1850)
  call RemoveDestructable(gg_dest_YTfb_1851)
  call RemoveDestructable(gg_dest_YTfb_1852)
  call RemoveDestructable(gg_dest_YTfb_1853)
  call RemoveDestructable(gg_dest_YTfb_1854)
  call RemoveDestructable(gg_dest_YTfb_1855)
  call RemoveDestructable(gg_dest_YTfb_1856)
  call RemoveDestructable(gg_dest_YTfb_1857)
  call RemoveDestructable(gg_dest_YTfb_1858)
  call RemoveDestructable(gg_dest_YTfb_1859)
  call SetDoodadAnimationRectBJ("death",'YOfb',gg_rct_Shield_Moo_Cave)
endfunction

function Trig_Enter_Cave_Conditions takes nothing returns boolean
  return(IsUnitType(GetEnteringUnit(),UNIT_TYPE_HERO)!=null)
endfunction

function Trig_Enter_Cave_Actions takes nothing returns nothing
  set udg_SecretCave=GetRectCenter(gg_rct_Secrect_Cave)
  call SetUnitPositionLoc(GetTriggerUnit(),udg_SecretCave)
  call RemoveLocation(udg_SecretCave)
endfunction

function Trig_Explode_Actions takes nothing returns nothing
  call ExplodeUnitBJ(gg_unit_u00T_0049)
endfunction

function Trig_Explode_Copy_Actions takes nothing returns nothing
  call ExplodeUnitBJ(gg_unit_u00T_0050)
endfunction

function Trig_Explode_Copy_2_Actions takes nothing returns nothing
  call ExplodeUnitBJ(gg_unit_u00T_0051)
endfunction

function Trig_Armor_Up_Conditions takes nothing returns boolean
  return(GetItemTypeId(GetSoldItem())=='I03F')and(GetUnitTypeId(GetSellingUnit())=='h00P')
endfunction

function Trig_Armor_Up_Actions takes nothing returns nothing
  call PlaySoundBJ(gg_snd_Levelupcaster)
  call SetPlayerTechResearchedSwap('R000',(GetPlayerTechCountSimple('R000',Player(10))+1),Player(10))
endfunction

function Trig_Frost_Guard_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I010')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I003')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I001')))
endfunction

function Trig_Frost_Guard_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I010'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I003'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I001'))
  call UnitAddItemByIdSwapped('I01D',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Ballista_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I010')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03X')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03W')))
endfunction

function Trig_Ballista_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I010'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03W'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03X'))
  call UnitAddItemByIdSwapped('I03Y',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Mythril_Rod_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01F')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00Z')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03W')))
endfunction

function Trig_Mythril_Rod_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01F'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03W'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00Z'))
  call UnitAddItemByIdSwapped('I05W',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Ballista_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05E')))
endfunction

function Trig_Ballista_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05E'))
  call UnitAddItemByIdSwapped('I03X',GetManipulatingUnit())
endfunction

function Trig_War_Club_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05T')))
endfunction

function Trig_War_Club_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05T'))
  call UnitAddItemByIdSwapped('I045',GetManipulatingUnit())
endfunction

function Trig_Mystile_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I061')))
endfunction

function Trig_Mystile_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I061'))
  call UnitAddItemByIdSwapped('I060',GetManipulatingUnit())
endfunction

function Trig_Tetra_Element_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I064')))
endfunction

function Trig_Tetra_Element_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I064'))
  call UnitAddItemByIdSwapped('I063',GetManipulatingUnit())
endfunction

function Trig_Nature_Staff_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05K')))
endfunction

function Trig_Nature_Staff_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05K'))
  call UnitAddItemByIdSwapped('I040',GetManipulatingUnit())
endfunction

function Trig_Trance_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05S')))
endfunction

function Trig_Trance_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05S'))
  call UnitAddItemByIdSwapped('I03U',GetManipulatingUnit())
endfunction

function Trig_Regen_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05F')))
endfunction

function Trig_Regen_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05F'))
  call UnitAddItemByIdSwapped('I03M',GetManipulatingUnit())
endfunction

function Trig_Band_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05Z')))
endfunction

function Trig_Band_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05Z'))
  call UnitAddItemByIdSwapped('I037',GetManipulatingUnit())
endfunction

function Trig_Razorspine_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05N')))
endfunction

function Trig_Razorspine_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05N'))
  call UnitAddItemByIdSwapped('I03V',GetManipulatingUnit())
endfunction

function Trig_Ratmik_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05M')))
endfunction

function Trig_Ratmik_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05M'))
  call UnitAddItemByIdSwapped('I03T',GetManipulatingUnit())
endfunction

function Trig_Sword_of_Mogrin_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05R')))
endfunction

function Trig_Sword_of_Mogrin_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05R'))
  call UnitAddItemByIdSwapped('I034',GetManipulatingUnit())
endfunction

function Trig_Reaver_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05Q')))
endfunction

function Trig_Reaver_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05Q'))
  call UnitAddItemByIdSwapped('I03A',GetManipulatingUnit())
endfunction

function Trig_Sheep_Stick_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05P')))
endfunction

function Trig_Sheep_Stick_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05P'))
  call UnitAddItemByIdSwapped('I043',GetManipulatingUnit())
endfunction

function Trig_Orb_of_Eternal_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05L')))
endfunction

function Trig_Orb_of_Eternal_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05L'))
  call UnitAddItemByIdSwapped('I020',GetManipulatingUnit())
endfunction

function Trig_Helm_of_Deathlord_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05H')))
endfunction

function Trig_Helm_of_Deathlord_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05H'))
  call UnitAddItemByIdSwapped('I025',GetManipulatingUnit())
endfunction

function Trig_Halberd_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05G')))
endfunction

function Trig_Halberd_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05G'))
  call UnitAddItemByIdSwapped('I05B',GetManipulatingUnit())
endfunction

function Trig_Axe_of_Mayhem_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05D')))
endfunction

function Trig_Axe_of_Mayhem_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05D'))
  call UnitAddItemByIdSwapped('I03N',GetManipulatingUnit())
endfunction

function Trig_Grim_Batol_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05C')))
endfunction

function Trig_Grim_Batol_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05C'))
  call UnitAddItemByIdSwapped('I03I',GetManipulatingUnit())
endfunction

function Trig_Wiser_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05U')))
endfunction

function Trig_Wiser_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05U'))
  call UnitAddItemByIdSwapped('I04Y',GetManipulatingUnit())
endfunction

function Trig_Killer7_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05I')))
endfunction

function Trig_Killer7_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05I'))
  call UnitAddItemByIdSwapped('I03G',GetManipulatingUnit())
endfunction

function Trig_Serpent_Staff_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05O')))
endfunction

function Trig_Serpent_Staff_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05O'))
  call UnitAddItemByIdSwapped('I030',GetManipulatingUnit())
endfunction

function Trig_Muradin_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05J')))
endfunction

function Trig_Muradin_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05J'))
  call UnitAddItemByIdSwapped('I04K',GetManipulatingUnit())
endfunction

function Trig_Ziedrich_4sho_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05V')))
endfunction

function Trig_Ziedrich_4sho_Actions takes nothing returns nothing
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05V'))
  call UnitAddItemByIdSwapped('I04V',GetManipulatingUnit())
endfunction

function Trig_Axe_of_Killmaim_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I018')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00F')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I000')))
endfunction

function Trig_Axe_of_Killmaim_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00F'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I000'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I018'))
  call UnitAddItemByIdSwapped('I01F',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Radiance_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03D')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I023')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I016')))
endfunction

function Trig_Radiance_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I023'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03D'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I016'))
  call UnitAddItemByIdSwapped('I03J',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Ragnarok_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03J')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04G')))
endfunction

function Trig_Ragnarok_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03J'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04G'))
  call UnitAddItemByIdSwapped('I058',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Druid_Claw_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I050')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I052')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I051')))
endfunction

function Trig_Druid_Claw_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I051'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I050'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I052'))
  call UnitAddItemByIdSwapped('I053',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Mystile_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I060')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I036')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03L')))
endfunction

function Trig_Mystile_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I060'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03L'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I036'))
  call UnitAddItemByIdSwapped('I05Y',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Eternal_Booster_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01J')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01K')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01I')))
endfunction

function Trig_Eternal_Booster_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01I'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01J'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01K'))
  call UnitAddItemByIdSwapped('I01M',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Gloves_of_Speed_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I008')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I005')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00D')))
endfunction

function Trig_Gloves_of_Speed_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I005'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00D'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I008'))
  call UnitAddItemByIdSwapped('I018',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Mystic_Staff_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00I')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01O')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00H')))
endfunction

function Trig_Mystic_Staff_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00I'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01O'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00H'))
  call UnitAddItemByIdSwapped('I01N',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Pacaya_1_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I014')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00Y')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00H')))
endfunction

function Trig_Pacaya_1_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I014'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00Y'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00H'))
  call UnitAddItemByIdSwapped('I02L',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Pacaya_2_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02L')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00H')))
endfunction

function Trig_Pacaya_2_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02L'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00H'))
  call UnitAddItemByIdSwapped('I02N',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Rhokan_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I039')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I041')))
endfunction

function Trig_Rhokan_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I039'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I041'))
  call UnitAddItemByIdSwapped('I055',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Pacaya_3_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02N')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00H')))
endfunction

function Trig_Pacaya_3_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02N'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00H'))
  call UnitAddItemByIdSwapped('I02O',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Demonic_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01N')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02Z')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I030')))
endfunction

function Trig_Demonic_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01N'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I030'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02Z'))
  call UnitAddItemByIdSwapped('I02Y',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Killer7_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02B')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02Z')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03G')))
endfunction

function Trig_Killer7_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02B'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02Z'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03G'))
  call UnitAddItemByIdSwapped('I016',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Grim_Batol_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I012')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01K')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I021')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03I')))
endfunction

function Trig_Grim_Batol_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I021'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I012'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01K'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03I'))
  call UnitAddItemByIdSwapped('I03H',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Pacaya_4_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02O')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00H')))
endfunction

function Trig_Pacaya_4_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02O'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00H'))
  call UnitAddItemByIdSwapped('I02P',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Ratmik_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00G')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00H')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03T')))
endfunction

function Trig_Ratmik_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00G'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00H'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03T'))
  call UnitAddItemByIdSwapped('I03S',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Trance_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00D')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00E')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03U')))
endfunction

function Trig_Trance_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00E'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00D'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03U'))
  call UnitAddItemByIdSwapped('I03Q',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Scales_of_Razor_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00B')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00C')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03V')))
endfunction

function Trig_Scales_of_Razor_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00C'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00B'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03V'))
  call UnitAddItemByIdSwapped('I03R',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Sword_of_Mogrin_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I034')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I032')))
endfunction

function Trig_Sword_of_Mogrin_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I034'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I032'))
  call UnitAddItemByIdSwapped('I033',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Unholy_Shield_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I024')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I002')))
endfunction

function Trig_Unholy_Shield_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I024'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I002'))
  call UnitAddItemByIdSwapped('I02S',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Axe_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01Y')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02B')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03P')))
endfunction

function Trig_Axe_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02B'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01Y'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03P'))
  call UnitAddItemByIdSwapped('I02V',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Nature_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I022')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I040')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03P')))
endfunction

function Trig_Nature_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I040'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I022'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03P'))
  call UnitAddItemByIdSwapped('I042',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Lightning_Staff_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I022')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I015')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01B')))
endfunction

function Trig_Lightning_Staff_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I022'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I015'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01B'))
  call UnitAddItemByIdSwapped('I02J',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Sheep_Stick_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00I')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01I')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I043')))
endfunction

function Trig_Sheep_Stick_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00I'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01I'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I043'))
  call UnitAddItemByIdSwapped('I041',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Bar_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00X')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02A')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02B')))
endfunction

function Trig_Bar_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02B'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00X'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02A'))
  call UnitAddItemByIdSwapped('I02C',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Axe_of_Mayhem_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00X')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03N')))
endfunction

function Trig_Axe_of_Mayhem_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00X'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03N'))
  call UnitAddItemByIdSwapped('I035',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Lionheart_Seal_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00D')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00G')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00B')))
endfunction

function Trig_Lionheart_Seal_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00G'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00D'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00B'))
  call UnitAddItemByIdSwapped('I03B',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Maul_of_Strength_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00J')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I002')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I000')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I010')))
endfunction

function Trig_Maul_of_Strength_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I00J'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I000'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I010'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I002'))
  call UnitAddItemByIdSwapped('I004',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Reaver_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02Z')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02B')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I038')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03A')))
endfunction

function Trig_Reaver_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02Z'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I038'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02B'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03A'))
  call UnitAddItemByIdSwapped('I039',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Muradins_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04F')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I038')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04K')))
endfunction

function Trig_Muradins_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04F'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I038'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04K'))
  call UnitAddItemByIdSwapped('I04L',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Halberdd_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03Y')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05B')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I044')))
endfunction

function Trig_Halberdd_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I05B'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03Y'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I044'))
  call UnitAddItemByIdSwapped('I05A',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_BHeart_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04F')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04G')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04H')))
endfunction

function Trig_BHeart_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04F'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04H'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04G'))
  call UnitAddItemByIdSwapped('I04M',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Wiser_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04Y')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02J')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04H')))
endfunction

function Trig_Wiser_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04Y'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04H'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02J'))
  call UnitAddItemByIdSwapped('I04X',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Lariat_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04G')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I039')))
endfunction

function Trig_Lariat_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I039'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04G'))
  call UnitAddItemByIdSwapped('I04U',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_War_Club_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I000')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I045')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I038')))
endfunction

function Trig_War_Club_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I000'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I038'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I045'))
  call UnitAddItemByIdSwapped('I044',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Totem_Conditions takes nothing returns boolean
  return(IsUnitType(GetManipulatingUnit(),UNIT_TYPE_HERO))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03P')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02U')))
endfunction

function Trig_Totem_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03P'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I02U'))
  call UnitAddItemByIdSwapped('I065',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Orb_of_Eternal_Power_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01M')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I020')))
endfunction

function Trig_Orb_of_Eternal_Power_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01M'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I020'))
  call UnitAddItemByIdSwapped('I01Z',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Ziedrich_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01B')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04D')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04V')))
endfunction

function Trig_Ziedrich_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04D'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01B'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I04V'))
  call UnitAddItemByIdSwapped('I04W',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Minerva_Band_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I031')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I037')))
endfunction

function Trig_Minerva_Band_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I037'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I031'))
  call UnitAddItemByIdSwapped('I036',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Ultima_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I048')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I049')))
endfunction

function Trig_Ultima_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I048'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I049'))
  call UnitAddItemByIdSwapped('I047',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Tetra_E_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01C')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I063')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I026')))
endfunction

function Trig_Tetra_E_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01C'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I026'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I063'))
  call UnitAddItemByIdSwapped('I062',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Regeneration_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I011')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03M')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01E')))
endfunction

function Trig_Regeneration_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01E'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I011'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I03M'))
  call UnitAddItemByIdSwapped('I03L',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Uther_Hammer_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I004')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I021')))
endfunction

function Trig_Uther_Hammer_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I004'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I021'))
  call UnitAddItemByIdSwapped('I02H',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Pendant_of_Power_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I012')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I015')))
endfunction

function Trig_Pendant_of_Power_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I012'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I015'))
  call UnitAddItemByIdSwapped('I02F',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Helm_of_the_Deathlord_Conditions takes nothing returns boolean
  return(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I001')))and(UnitHasItem(GetTriggerUnit(),GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I025')))
endfunction

function Trig_Helm_of_the_Deathlord_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I001'))
  call RemoveItem(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I025'))
  call UnitAddItemByIdSwapped('I01S',GetManipulatingUnit())
  call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
endfunction

function Trig_Acquires_Item_Conditions takes nothing returns boolean
  return(IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO)!=null)
endfunction

function Trig_Acquires_Item_Func003Func001Func014C takes nothing returns boolean
  return(GetItemTypeId(GetItemOfTypeFromUnitBJ(GetTriggerUnit(),udg_ITM_ItemSlot1[bj_forLoopAIndex]))==udg_ITM_ItemSlot1[bj_forLoopAIndex])and(GetItemTypeId(GetItemOfTypeFromUnitBJ(GetTriggerUnit(),udg_ITM_ItemSlot2[bj_forLoopAIndex]))==udg_ITM_ItemSlot2[bj_forLoopAIndex])and(GetItemTypeId(GetItemOfTypeFromUnitBJ(GetTriggerUnit(),udg_ITM_ItemSlot3[bj_forLoopAIndex]))==udg_ITM_ItemSlot3[bj_forLoopAIndex])and(GetItemTypeId(GetItemOfTypeFromUnitBJ(GetTriggerUnit(),udg_ITM_ItemSlot4[bj_forLoopAIndex]))==udg_ITM_ItemSlot4[bj_forLoopAIndex])and(GetItemTypeId(GetItemOfTypeFromUnitBJ(GetTriggerUnit(),udg_ITM_ItemSlot5[bj_forLoopAIndex]))==udg_ITM_ItemSlot5[bj_forLoopAIndex])and(GetItemTypeId(GetItemOfTypeFromUnitBJ(GetTriggerUnit(),udg_ITM_ItemSlot6[bj_forLoopAIndex]))==udg_ITM_ItemSlot6[bj_forLoopAIndex])
endfunction

function Trig_Acquires_Item_Func003Func001C takes nothing returns boolean
  return(Trig_Acquires_Item_Func003Func001Func014C())
endfunction

function Trig_Acquires_Item_Actions takes nothing returns nothing
  set bj_forLoopAIndex=1
  set bj_forLoopAIndexEnd=udg_ITM_MaxItemRecipes
  loop
    exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
    if(Trig_Acquires_Item_Func003Func001C())then
      call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Demon\\DarkPortal\\DarkPortalTarget.mdl")
      call DestroyEffect(bj_lastCreatedEffect)
      call PlaySoundBJ(gg_snd_Levelupcaster)
      call RemoveItem(GetItemOfTypeFromUnitBJ(GetTriggerUnit(),udg_ITM_ItemSlot1[bj_forLoopAIndex]))
      call RemoveItem(GetItemOfTypeFromUnitBJ(GetTriggerUnit(),udg_ITM_ItemSlot2[bj_forLoopAIndex]))
      call RemoveItem(GetItemOfTypeFromUnitBJ(GetTriggerUnit(),udg_ITM_ItemSlot3[bj_forLoopAIndex]))
      call RemoveItem(GetItemOfTypeFromUnitBJ(GetTriggerUnit(),udg_ITM_ItemSlot4[bj_forLoopAIndex]))
      call RemoveItem(GetItemOfTypeFromUnitBJ(GetTriggerUnit(),udg_ITM_ItemSlot5[bj_forLoopAIndex]))
      call RemoveItem(GetItemOfTypeFromUnitBJ(GetTriggerUnit(),udg_ITM_ItemSlot6[bj_forLoopAIndex]))
      call UnitAddItemByIdSwapped(udg_ITM_ReplacementItem[bj_forLoopAIndex],GetTriggerUnit())
      call DisplayTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),("|cff00FFFFGame Message:|r Item Created: "+GetItemName(bj_lastCreatedItem)))
      return
    endif
    set bj_forLoopAIndex=bj_forLoopAIndex+1
  endloop
endfunction

function Trig_Frost_Guard2_Actions takes nothing returns nothing
  set udg_ITM_MaxItemRecipes=0
  set udg_ITM_MaxItemRecipes=(udg_ITM_MaxItemRecipes+1)
  set udg_ITM_ReplacementItem[udg_ITM_MaxItemRecipes]='I01D'
  set udg_ITM_ItemSlot1[udg_ITM_MaxItemRecipes]='I003'
  set udg_ITM_ItemSlot2[udg_ITM_MaxItemRecipes]='I010'
  set udg_ITM_ItemSlot3[udg_ITM_MaxItemRecipes]='I001'
endfunction

function Trig_Gloves_of_Speed2_Actions takes nothing returns nothing
  set udg_ITM_MaxItemRecipes=0
  set udg_ITM_MaxItemRecipes=(udg_ITM_MaxItemRecipes+1)
  set udg_ITM_ReplacementItem[udg_ITM_MaxItemRecipes]='I018'
  set udg_ITM_ItemSlot1[udg_ITM_MaxItemRecipes]='I005'
  set udg_ITM_ItemSlot2[udg_ITM_MaxItemRecipes]='I00D'
  set udg_ITM_ItemSlot3[udg_ITM_MaxItemRecipes]='I008'
endfunction

function Trig_Axe_of_Killmaim2_Actions takes nothing returns nothing
  set udg_ITM_MaxItemRecipes=0
  set udg_ITM_MaxItemRecipes=(udg_ITM_MaxItemRecipes+1)
  set udg_ITM_ReplacementItem[udg_ITM_MaxItemRecipes]='I01F'
  set udg_ITM_ItemSlot1[udg_ITM_MaxItemRecipes]='I018'
  set udg_ITM_ItemSlot2[udg_ITM_MaxItemRecipes]='I000'
  set udg_ITM_ItemSlot3[udg_ITM_MaxItemRecipes]='I00F'
endfunction

function Trig_Skull_Shield2_Actions takes nothing returns nothing
  set udg_ITM_MaxItemRecipes=0
  set udg_ITM_MaxItemRecipes=(udg_ITM_MaxItemRecipes+1)
  set udg_ITM_ReplacementItem[udg_ITM_MaxItemRecipes]='I01Q'
  set udg_ITM_ItemSlot1[udg_ITM_MaxItemRecipes]='I01C'
  set udg_ITM_ItemSlot2[udg_ITM_MaxItemRecipes]='I01E'
endfunction

function Trig_Helm_of_the_Deathlord2_Actions takes nothing returns nothing
  set udg_ITM_MaxItemRecipes=0
  set udg_ITM_MaxItemRecipes=(udg_ITM_MaxItemRecipes+1)
  set udg_ITM_ReplacementItem[udg_ITM_MaxItemRecipes]='I01S'
  set udg_ITM_ItemSlot1[udg_ITM_MaxItemRecipes]='I00X'
  set udg_ITM_ItemSlot2[udg_ITM_MaxItemRecipes]='I001'
endfunction

function Trig_Orb_of_Eternal_Power2_Actions takes nothing returns nothing
  set udg_ITM_MaxItemRecipes=0
  set udg_ITM_MaxItemRecipes=(udg_ITM_MaxItemRecipes+1)
  set udg_ITM_ReplacementItem[udg_ITM_MaxItemRecipes]='I01Z'
  set udg_ITM_ItemSlot1[udg_ITM_MaxItemRecipes]='I01M'
  set udg_ITM_ItemSlot2[udg_ITM_MaxItemRecipes]='I01B'
endfunction

function Trig_Cloak_of_Shadows2_Actions takes nothing returns nothing
  set udg_ITM_MaxItemRecipes=0
  set udg_ITM_MaxItemRecipes=(udg_ITM_MaxItemRecipes+1)
  set udg_ITM_ReplacementItem[udg_ITM_MaxItemRecipes]='I027'
  set udg_ITM_ItemSlot1[udg_ITM_MaxItemRecipes]='I026'
  set udg_ITM_ItemSlot2[udg_ITM_MaxItemRecipes]='I022'
endfunction

function Trig_Eternal_Booster2_Actions takes nothing returns nothing
  set udg_ITM_MaxItemRecipes=0
  set udg_ITM_MaxItemRecipes=(udg_ITM_MaxItemRecipes+1)
  set udg_ITM_ReplacementItem[udg_ITM_MaxItemRecipes]='I01M'
  set udg_ITM_ItemSlot1[udg_ITM_MaxItemRecipes]='I01J'
  set udg_ITM_ItemSlot2[udg_ITM_MaxItemRecipes]='I01I'
  set udg_ITM_ItemSlot3[udg_ITM_MaxItemRecipes]='I01K'
endfunction

function Trig_Quatl_Bar2_Actions takes nothing returns nothing
  set udg_ITM_MaxItemRecipes=0
  set udg_ITM_MaxItemRecipes=(udg_ITM_MaxItemRecipes+1)
  set udg_ITM_ReplacementItem[udg_ITM_MaxItemRecipes]='I02C'
  set udg_ITM_ItemSlot1[udg_ITM_MaxItemRecipes]='I00X'
  set udg_ITM_ItemSlot2[udg_ITM_MaxItemRecipes]='I02B'
  set udg_ITM_ItemSlot3[udg_ITM_MaxItemRecipes]='I02A'
endfunction

function Trig_Ring_of_Superiority2_Actions takes nothing returns nothing
  set udg_ITM_MaxItemRecipes=0
  set udg_ITM_MaxItemRecipes=(udg_ITM_MaxItemRecipes+1)
  set udg_ITM_ReplacementItem[udg_ITM_MaxItemRecipes]='I013'
  set udg_ITM_ItemSlot1[udg_ITM_MaxItemRecipes]='I00B'
  set udg_ITM_ItemSlot2[udg_ITM_MaxItemRecipes]='I012'
  set udg_ITM_ItemSlot3[udg_ITM_MaxItemRecipes]='I011'
endfunction

function Trig_Mystic_Staff2_Actions takes nothing returns nothing
  set udg_ITM_MaxItemRecipes=0
  set udg_ITM_MaxItemRecipes=(udg_ITM_MaxItemRecipes+1)
  set udg_ITM_ReplacementItem[udg_ITM_MaxItemRecipes]='I01N'
  set udg_ITM_ItemSlot1[udg_ITM_MaxItemRecipes]='I00H'
  set udg_ITM_ItemSlot2[udg_ITM_MaxItemRecipes]='I00I'
  set udg_ITM_ItemSlot3[udg_ITM_MaxItemRecipes]='I01O'
endfunction

function Trig_Muradiins_Hammer2_Actions takes nothing returns nothing
  set udg_ITM_MaxItemRecipes=0
  set udg_ITM_MaxItemRecipes=(udg_ITM_MaxItemRecipes+1)
  set udg_ITM_ReplacementItem[udg_ITM_MaxItemRecipes]='I004'
  set udg_ITM_ItemSlot1[udg_ITM_MaxItemRecipes]='I002'
  set udg_ITM_ItemSlot2[udg_ITM_MaxItemRecipes]='I00J'
  set udg_ITM_ItemSlot3[udg_ITM_MaxItemRecipes]='I010'
  set udg_ITM_ItemSlot4[udg_ITM_MaxItemRecipes]='I000'
endfunction

function Trig_Weather_Set_Chances_Actions takes nothing returns nothing
  set udg_WindPercent=1
  set udg_SnowPercent=1
  set udg_AcidRainPercent=1
  set udg_DecayMistPercent=1
endfunction

function Trig_Wave_Number_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(GetUnitsOfPlayerAll(Player(11))))
endfunction

function Trig_Wave_Number_Func017C takes nothing returns boolean
  return(udg_AcidRainPercent==udg_AcidRainChance)
endfunction

function Trig_Wave_Number_Func018C takes nothing returns boolean
  return(udg_SnowPercent==udg_SnowChance)
endfunction

function Trig_Wave_Number_Func019C takes nothing returns boolean
  return(udg_WindPercent==udg_WindChance)
endfunction

function Trig_Wave_Number_Func020C takes nothing returns boolean
  return(udg_DecayMistPercent==udg_DecayMistChance)
endfunction

function Trig_Wave_Number_Actions takes nothing returns nothing
  call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,8.,("|cff006699Wave |r "+I2S((1+GetTriggerExecCount(GetTriggeringTrigger())))))
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveWeatherEffect(udg_HeavyWinds)
  call RemoveWeatherEffect(udg_Snow)
  call RemoveWeatherEffect(udg_AcidRain)
  call RemoveWeatherEffect(udg_DecayMist)
  call UnitRemoveAbility(gg_unit_o01P_0295,'A0PC')
  call UnitRemoveAbility(gg_unit_o01P_0295,'A0PD')
  call UnitRemoveAbility(gg_unit_o01P_0295,'A0PE')
  call UnitRemoveAbility(gg_unit_o01P_0295,'A0PF')
  set bj_wantDestroyGroup=true
  set udg_Weather_Maker=gg_unit_o01P_0295
  set udg_WindChance=GetRandomInt(1,6)
  set udg_SnowChance=GetRandomInt(1,6)
  set udg_AcidRainChance=GetRandomInt(1,6)
  set udg_DecayMistChance=GetRandomInt(1,6)
  if(Trig_Wave_Number_Func017C())then
    call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,8.,"|cff336666Acid Rain|r")
    call PlaySoundBJ(gg_snd_MonsoonRainLoop)
    call UnitAddAbility(gg_unit_o01P_0295,'A0PE')
    call AddWeatherEffectSaveLast(bj_mapInitialPlayableArea,'RAhr')
    set udg_AcidRain=bj_lastCreatedWeatherEffect
  endif
  if(Trig_Wave_Number_Func018C())then
    call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,8.,"|cff006699Freezing Snow|r")
    call PlaySoundBJ(gg_snd_FrostArmorTarget1)
    call UnitAddAbility(gg_unit_o01P_0295,'A0PD')
    call AddWeatherEffectSaveLast(bj_mapInitialPlayableArea,'SNhs')
    set udg_Snow=bj_lastCreatedWeatherEffect
  endif
  if(Trig_Wave_Number_Func019C())then
    call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,8.,"|cff336666Heavy Winds|r")
    call PlaySoundBJ(gg_snd_CycloneBirth1)
    call UnitAddAbility(gg_unit_o01P_0295,'A0PC')
    call AddWeatherEffectSaveLast(bj_mapInitialPlayableArea,'WNcw')
    set udg_HeavyWinds=bj_lastCreatedWeatherEffect
  endif
  if(Trig_Wave_Number_Func020C())then
    call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,8.,"|cff336666Decay Mist|r")
    call PlaySoundBJ(gg_snd_DarkSummoningTarget1)
    call UnitAddAbility(gg_unit_o01P_0295,'A0PF')
    call AddWeatherEffectSaveLast(bj_mapInitialPlayableArea,'FDgh')
    set udg_DecayMist=bj_lastCreatedWeatherEffect
  endif
endfunction

function Trig_Level_1_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call TriggerSleepAction(40.)
  call TriggerExecute(gg_trg_Create_Multiboard)
  call CreateNUnitsAtLoc(20,'n004',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n004',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n004',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n004',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,8.,("|cff006699Wave.|r "+I2S(1)))
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Gnolls (80)|r")
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call EnableTrigger(gg_trg_Level_2)
  call DisableTrigger(GetTriggeringTrigger())
endfunction

function Trig_Level_2_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_2_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Gnoll Warden (80)|r")
  call CreateNUnitsAtLoc(20,'n005',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n005',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n005',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n005',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_3)
endfunction

function Trig_Level_3_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_3_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Gnoll Overseer (80)|r")
  call CreateNUnitsAtLoc(20,'n006',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n006',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n006',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n006',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_4)
endfunction

function Trig_Level_4_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_4_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cff336666Ogre Magi (4) / Stonemaul Ogres (40)|r")
  call CreateNUnitsAtLoc(10,'n007',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02M',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(10,'n007',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02M',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(10,'n007',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02M',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(10,'n007',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02M',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_5)
endfunction

function Trig_Level_5_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_5_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffff0000Ogre Maximus (4)|r")
  call CreateNUnitsAtLoc(1,'n00D',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n00D',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n00D',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n00D',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_6)
endfunction

function Trig_Level_6_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_6_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Fel Stalkers (80)|r")
  call CreateNUnitsAtLoc(20,'n009',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n009',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n009',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n009',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_7)
endfunction

function Trig_Level_7_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_7_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Warlocks (80)|r")
  call CreateNUnitsAtLoc(20,'n00A',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00A',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00A',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00A',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_8)
endfunction

function Trig_Level_8_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_8_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Bloodfiend (80)|r")
  call CreateNUnitsAtLoc(20,'n00B',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00B',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00B',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00B',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_9)
endfunction

function Trig_Level_9_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_9_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cff336666Firelords (4) / Fire Minions (40)|r")
  call CreateNUnitsAtLoc(10,'n00C',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02N',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(10,'n00C',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02N',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(10,'n00C',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02N',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(10,'n00C',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02N',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_10)
endfunction

function Trig_Level_10_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_10_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffff0000Shogun (4)|r")
  call CreateNUnitsAtLoc(1,'n008',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n008',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n008',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n008',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_11)
endfunction

function Trig_Level_11_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_11_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Huntress (80)|r")
  call CreateNUnitsAtLoc(20,'n00E',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00E',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00E',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00E',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_12)
endfunction

function Trig_Level_12_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_12_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Dryad (80)|r")
  call CreateNUnitsAtLoc(20,'n00F',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00F',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00F',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00F',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_13)
endfunction

function Trig_Level_13_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_13_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Spell Breakers (80)|r")
  call CreateNUnitsAtLoc(20,'n00G',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00G',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00G',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00G',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_14)
endfunction

function Trig_Level_14_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_14_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cff336666Thor (4) / Dwarven Marines (40)|r")
  call CreateNUnitsAtLoc(10,'n00H',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02O',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(10,'n00H',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02O',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(10,'n00H',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02O',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(10,'n00H',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02O',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_15)
endfunction

function Trig_Level_15_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_15_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffff0000Mograth the Defender (4)|r")
  call CreateNUnitsAtLoc(1,'n02P',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02P',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02P',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02P',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_16)
endfunction

function Trig_Level_16_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_16_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Succubus (80)|r")
  call CreateNUnitsAtLoc(20,'n00J',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00J',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00J',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00J',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_17)
endfunction

function Trig_Level_17_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_17_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Draenei (60)|r")
  call CreateNUnitsAtLoc(15,'n00K',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(15,'n00K',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(15,'n00K',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(15,'n00K',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_18)
endfunction

function Trig_Level_18_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_18_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Stalkers (?)|r")
  call CreateNUnitsAtLoc(20,'n00L',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00L',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00L',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00L',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_19)
endfunction

function Trig_Level_19_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_19_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Anteron (4) / Ghouls (40)|r")
  call CreateNUnitsAtLoc(10,'z000',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n00Y',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(10,'z000',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n00Y',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(10,'z000',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n00Y',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(10,'z000',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n00Y',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_20b)
endfunction

function Trig_Level_20b_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_20b_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffff0000Azgalor (4)|r")
  call CreateNUnitsAtLoc(1,'n00I',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n00I',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n00I',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n00I',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_21)
endfunction

function Trig_Level_21_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_21_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Hydras (60)|r")
  call CreateNUnitsAtLoc(15,'n011',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(15,'n011',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(15,'n011',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(15,'n011',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_22)
endfunction

function Trig_Level_22_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_22_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Satyrs (80) [Vulnerable to spells]|r")
  call CreateNUnitsAtLoc(20,'n00Z',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00Z',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00Z',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n00Z',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_23)
endfunction

function Trig_Level_23_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_23_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Myrmidons (80) [Spell Immune]|r")
  call CreateNUnitsAtLoc(20,'e00A',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'e00A',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'e00A',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'e00A',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_24)
endfunction

function Trig_Level_24_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_24_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Medusa (4) / Naga Sirens (40)|r")
  call CreateNUnitsAtLoc(10,'n012',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02Q',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(10,'n012',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02Q',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(10,'n012',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02Q',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(10,'n012',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n02Q',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_25)
endfunction

function Trig_Level_25_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_25_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffff0000Night Wing (4)|r")
  call CreateNUnitsAtLoc(1,'n013',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n013',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n013',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n013',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_26)
endfunction

function Trig_Level_26_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_26_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Regenerators (80)|r")
  call CreateNUnitsAtLoc(20,'n014',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n014',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n014',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n014',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_27)
endfunction

function Trig_Level_27_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_27_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Bane (80)|r")
  call CreateNUnitsAtLoc(20,'n015',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n015',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n015',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n015',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_28)
endfunction

function Trig_Level_28_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_28_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Tuskan (80)|r")
  call CreateNUnitsAtLoc(20,'n016',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n016',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n016',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n016',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_29)
endfunction

function Trig_Level_29_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_29_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Stinger (80)|r")
  call CreateNUnitsAtLoc(20,'n017',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n017',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n017',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n017',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_30)
endfunction

function Trig_Level_30_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_30_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffff0000El Gigante (4)|r")
  call CreateNUnitsAtLoc(1,'n018',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n018',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n018',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n018',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_31)
endfunction

function Trig_Level_31_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_31_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Sentry (80)|r")
  call CreateNUnitsAtLoc(20,'n01J',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n01J',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n01J',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n01J',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_32)
endfunction

function Trig_Level_32_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_32_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Frost Necros (48)|r")
  call CreateNUnitsAtLoc(12,'n01N',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(12,'n01N',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(12,'n01N',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(12,'n01N',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_33)
endfunction

function Trig_Level_33_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_33_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Poison Dwellers (80)|r")
  call CreateNUnitsAtLoc(20,'n01O',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n01O',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n01O',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n01O',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_34)
endfunction

function Trig_Level_34_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_34_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffffcc00Golems (80)|r")
  call CreateNUnitsAtLoc(20,'n01P',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n01P',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n01P',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(20,'n01P',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Level_35)
endfunction

function Trig_Level_35_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(udg_Brown_Group))
endfunction

function Trig_Level_35_Actions takes nothing returns nothing
  set udg_TopSpawn=GetRectCenter(gg_rct_Top_Spawn)
  set udg_BottomSpawn=GetRectCenter(gg_rct_Bottom_Spawn)
  set udg_LeftSpawn=GetRectCenter(gg_rct_Left_Spawn)
  set udg_RightSpawn=GetRectCenter(gg_rct_Right_Spawn)
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffff0000Tyrant (4)|r")
  call CreateNUnitsAtLoc(1,'n01Q',Player(11),udg_TopSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n01Q',Player(11),udg_LeftSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n01Q',Player(11),udg_RightSpawn,bj_UNIT_FACING)
  call CreateNUnitsAtLoc(1,'n01Q',Player(11),udg_BottomSpawn,bj_UNIT_FACING)
  set udg_Brown_Group=GetUnitsOfPlayerAll(Player(11))
  call RemoveLocation(udg_TopSpawn)
  call RemoveLocation(udg_BottomSpawn)
  call RemoveLocation(udg_LeftSpawn)
  call RemoveLocation(udg_RightSpawn)
  set bj_wantDestroyGroup=true
  call DisableTrigger(GetTriggeringTrigger())
  call EnableTrigger(gg_trg_Vulnerable)
endfunction

function Trig_YOU_WON_Copy_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(GetUnitsOfPlayerAll(Player(11))))
endfunction

function Trig_YOU_WON_Copy_Func003002 takes nothing returns nothing
  call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,"You've successfully defended Moo Moo! for now...check for updated version.\n\nThe game will end in 1 minute...")
endfunction

function Trig_YOU_WON_Copy_Func006002 takes nothing returns nothing
  call CustomVictoryBJ(GetEnumPlayer(),true,true)
endfunction

function Trig_YOU_WON_Copy_Actions takes nothing returns nothing
  call ForForce(GetPlayersByMapControl(MAP_CONTROL_USER),function Trig_YOU_WON_Copy_Func003002)
  call TriggerSleepAction(60.)
  call ForForce(GetPlayersByMapControl(MAP_CONTROL_USER),function Trig_YOU_WON_Copy_Func006002)
  set bj_wantDestroyGroup=true
endfunction

function Trig_Move_Copy_Actions takes nothing returns nothing
  set udg_CenterOfMap=GetRectCenter(gg_rct_Center_of_Map)
  set udg_Top=GetRectCenter(gg_rct_Top)
  set udg_Right=GetRectCenter(gg_rct_Right)
  set udg_Left=GetRectCenter(gg_rct_Left)
  set udg_Bottom=GetRectCenter(gg_rct_Bottom)
  set udg_TopSpawn_Group=GetUnitsInRectOfPlayer(gg_rct_Top_Spawn,Player(11))
  set udg_RightSpawn_Group=GetUnitsInRectOfPlayer(gg_rct_Right_Spawn,Player(11))
  set udg_BottomSpawn_Group=GetUnitsInRectOfPlayer(gg_rct_Bottom_Spawn,Player(11))
  set udg_LeftSpawn_Group=GetUnitsInRectOfPlayer(gg_rct_Left_Spawn,Player(11))
  set udg_Top_Group=GetUnitsInRectOfPlayer(gg_rct_Top,Player(11))
  set udg_Right_Group=GetUnitsInRectOfPlayer(gg_rct_Right,Player(11))
  set udg_Bottom_Group=GetUnitsInRectOfPlayer(gg_rct_Bottom,Player(11))
  set udg_Left_Group=GetUnitsInRectOfPlayer(gg_rct_Left,Player(11))
  call GroupPointOrderByIdLoc(udg_TopSpawn_Group,851983,udg_Top)
  call GroupPointOrderByIdLoc(udg_LeftSpawn_Group,851983,udg_Left)
  call GroupPointOrderByIdLoc(udg_RightSpawn_Group,851983,udg_Right)
  call GroupPointOrderByIdLoc(udg_BottomSpawn_Group,851983,udg_Bottom)
  call GroupPointOrderByIdLoc(udg_Bottom_Group,851983,udg_CenterOfMap)
  call GroupPointOrderByIdLoc(udg_Left_Group,851983,udg_CenterOfMap)
  call GroupPointOrderByIdLoc(udg_Right_Group,851983,udg_CenterOfMap)
  call GroupPointOrderByIdLoc(udg_Top_Group,851983,udg_CenterOfMap)
  call RemoveLocation(udg_Top)
  call RemoveLocation(udg_Bottom)
  call RemoveLocation(udg_Left)
  call RemoveLocation(udg_Right)
  call RemoveLocation(udg_CenterOfMap)
  set bj_wantDestroyGroup=true
  set bj_wantDestroyGroup=true
  set bj_wantDestroyGroup=true
  set bj_wantDestroyGroup=true
  set bj_wantDestroyGroup=true
  set bj_wantDestroyGroup=true
  set bj_wantDestroyGroup=true
  set bj_wantDestroyGroup=true
endfunction

function Trig_Creep_Timer_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(GetUnitsOfPlayerAll(Player(11))))
endfunction

function Trig_Creep_Timer_Func006002 takes nothing returns nothing
  call AdjustPlayerStateBJ((200+(50*GetTriggerExecCount(GetTriggeringTrigger()))),GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD)
endfunction

function Trig_Creep_Timer_Actions takes nothing returns nothing
  call CreateTimerDialogBJ(udg_CREEPTIMER,"Next Wave in...")
  set udg_CREEPWAIT=45
  call StartTimerBJ(udg_CREEPTIMER,false,45.)
  set udg_CREEPWINDOW=bj_lastCreatedTimerDialog
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Creep_Timer_Func006002)
  call EnableTrigger(gg_trg_Skip)
  call DisableTrigger(gg_trg_Goblin_Village)
  call DisableTrigger(gg_trg_Troll_Village)
endfunction

function Trig_Dual_Creep_Timer_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(GetUnitsOfPlayerAll(Player(11))))
endfunction

function Trig_Dual_Creep_Timer_Func001002 takes nothing returns nothing
  call AdjustPlayerStateBJ((200+(50*GetTriggerExecCount(GetTriggeringTrigger()))),GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD)
endfunction

function Trig_Dual_Creep_Timer_Actions takes nothing returns nothing
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Dual_Creep_Timer_Func001002)
endfunction

function Trig_Creep_Timer_Extreme_Conditions takes nothing returns boolean
  return(IsUnitGroupDeadBJ(GetUnitsOfPlayerAll(Player(11))))
endfunction

function Trig_Creep_Timer_Extreme_Func006002 takes nothing returns nothing
  call AdjustPlayerStateBJ((200+(50*GetTriggerExecCount(GetTriggeringTrigger()))),GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD)
endfunction

function Trig_Creep_Timer_Extreme_Actions takes nothing returns nothing
  call CreateTimerDialogBJ(udg_CREEPTIMER,"Next Wave in...")
  set udg_CREEPWAIT=0
  call StartTimerBJ(udg_CREEPTIMER,false,.0)
  set udg_CREEPWINDOW=bj_lastCreatedTimerDialog
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Creep_Timer_Extreme_Func006002)
  call DisableTrigger(gg_trg_Goblin_Village)
  call DisableTrigger(gg_trg_Troll_Village)
endfunction

function Trig_Timer_Destroy_Actions takes nothing returns nothing
  call DestroyTimerDialog(udg_CREEPWINDOW)
endfunction

function Trig_Timer_On_Goblin_Actions takes nothing returns nothing
  call EnableTrigger(gg_trg_Goblin_Village)
endfunction

function Trig_Timer_On_Troll_Actions takes nothing returns nothing
  call EnableTrigger(gg_trg_Troll_Village)
endfunction

function Trig_Player1_Leaves_Actions takes nothing returns nothing
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(GetPlayerName(Player(0))+" has given up on Moo Moo!"))
  call TriggerExecute(gg_trg_Player1_Leaves_Copy)
endfunction

function Trig_Player1_Leaves_Copy_Conditions takes nothing returns boolean
  return(GetPlayerSlotState(Player(0))!=PLAYER_SLOT_STATE_PLAYING)
endfunction

function Trig_Player1_Leaves_Copy_Func002002 takes nothing returns nothing
  call RemoveUnit(GetEnumUnit())
endfunction

function Trig_Player1_Leaves_Copy_Actions takes nothing returns nothing
  call ForGroupBJ(GetUnitsInRectOfPlayer(bj_mapInitialPlayableArea,Player(0)),function Trig_Player1_Leaves_Copy_Func002002)
endfunction

function Trig_Player2_Leaves_Actions takes nothing returns nothing
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(GetPlayerName(Player(1))+" has given up on Moo Moo!"))
  call TriggerExecute(gg_trg_Player1_Leaves_Copy_Copy)
endfunction

function Trig_Player1_Leaves_Copy_Copy_Conditions takes nothing returns boolean
  return(GetPlayerSlotState(Player(1))!=PLAYER_SLOT_STATE_PLAYING)
endfunction

function Trig_Player1_Leaves_Copy_Copy_Func002002 takes nothing returns nothing
  call RemoveUnit(GetEnumUnit())
endfunction

function Trig_Player1_Leaves_Copy_Copy_Actions takes nothing returns nothing
  call ForGroupBJ(GetUnitsInRectOfPlayer(bj_mapInitialPlayableArea,Player(1)),function Trig_Player1_Leaves_Copy_Copy_Func002002)
endfunction

function Trig_Player3_Leaves_Actions takes nothing returns nothing
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(GetPlayerName(Player(2))+" has given up on Moo Moo!"))
  call TriggerExecute(gg_trg_Player1_Leaves_Copy_Copy_2)
endfunction

function Trig_Player1_Leaves_Copy_Copy_2_Conditions takes nothing returns boolean
  return(GetPlayerSlotState(Player(2))!=PLAYER_SLOT_STATE_PLAYING)
endfunction

function Trig_Player1_Leaves_Copy_Copy_2_Func002002 takes nothing returns nothing
  call RemoveUnit(GetEnumUnit())
endfunction

function Trig_Player1_Leaves_Copy_Copy_2_Actions takes nothing returns nothing
  call ForGroupBJ(GetUnitsInRectOfPlayer(bj_mapInitialPlayableArea,Player(2)),function Trig_Player1_Leaves_Copy_Copy_2_Func002002)
endfunction

function Trig_Player4_Leaves_Actions takes nothing returns nothing
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(GetPlayerName(Player(3))+" has given up on Moo Moo!"))
  call TriggerExecute(gg_trg_Player1_Leaves_Copy_Copy_3)
endfunction

function Trig_Player1_Leaves_Copy_Copy_3_Conditions takes nothing returns boolean
  return(GetPlayerSlotState(Player(3))!=PLAYER_SLOT_STATE_PLAYING)
endfunction

function Trig_Player1_Leaves_Copy_Copy_3_Func002002 takes nothing returns nothing
  call RemoveUnit(GetEnumUnit())
endfunction

function Trig_Player1_Leaves_Copy_Copy_3_Actions takes nothing returns nothing
  call ForGroupBJ(GetUnitsInRectOfPlayer(bj_mapInitialPlayableArea,Player(3)),function Trig_Player1_Leaves_Copy_Copy_3_Func002002)
endfunction

function Trig_Player5_Leaves_Actions takes nothing returns nothing
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(GetPlayerName(Player(4))+" has given up on Moo Moo!"))
  call TriggerExecute(gg_trg_Player1_Leaves_Copy_Copy_4)
endfunction

function Trig_Player1_Leaves_Copy_Copy_4_Conditions takes nothing returns boolean
  return(GetPlayerSlotState(Player(4))!=PLAYER_SLOT_STATE_PLAYING)
endfunction

function Trig_Player1_Leaves_Copy_Copy_4_Func002002 takes nothing returns nothing
  call RemoveUnit(GetEnumUnit())
endfunction

function Trig_Player1_Leaves_Copy_Copy_4_Actions takes nothing returns nothing
  call ForGroupBJ(GetUnitsInRectOfPlayer(bj_mapInitialPlayableArea,Player(4)),function Trig_Player1_Leaves_Copy_Copy_4_Func002002)
endfunction

function Trig_Player6_Leaves_Actions takes nothing returns nothing
  call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(GetPlayerName(Player(5))+" has given up on Moo Moo!"))
  call TriggerExecute(gg_trg_Player1_Leaves_Copy_Copy_5)
endfunction

function Trig_Player1_Leaves_Copy_Copy_5_Conditions takes nothing returns boolean
  return(GetPlayerSlotState(Player(5))!=PLAYER_SLOT_STATE_PLAYING)
endfunction

function Trig_Player1_Leaves_Copy_Copy_5_Func002002 takes nothing returns nothing
  call RemoveUnit(GetEnumUnit())
endfunction

function Trig_Player1_Leaves_Copy_Copy_5_Actions takes nothing returns nothing
  call ForGroupBJ(GetUnitsInRectOfPlayer(bj_mapInitialPlayableArea,Player(5)),function Trig_Player1_Leaves_Copy_Copy_5_Func002002)
endfunction

function Trig_Worldwide_Tree_Respawn_Func001Func001Func004C takes nothing returns boolean
  return(GetDestructableTypeId(GetEnumDestructable())=='ZTtw')or(GetDestructableTypeId(GetEnumDestructable())=='ZTtc')
endfunction

function Trig_Worldwide_Tree_Respawn_Func001Func001C takes nothing returns boolean
  return(IsDestructableDeadBJ(GetEnumDestructable()))and(GetRandomInt(1,'d')>=10)and(Trig_Worldwide_Tree_Respawn_Func001Func001Func004C())
endfunction

function Trig_Worldwide_Tree_Respawn_Func001A takes nothing returns nothing
  if(Trig_Worldwide_Tree_Respawn_Func001Func001C())then
    call DestructableRestoreLife(GetEnumDestructable(),GetDestructableMaxLife(bj_lastCreatedDestructable),true)
  endif
endfunction

function Trig_Worldwide_Tree_Respawn_Actions takes nothing returns nothing
  call EnumDestructablesInRectAll(bj_mapInitialPlayableArea,function Trig_Worldwide_Tree_Respawn_Func001A)
endfunction

function Trig_Lose_Func004002 takes nothing returns nothing
  call CustomDefeatBJ(GetEnumPlayer(),"Defeat!")
endfunction

function Trig_Lose_Actions takes nothing returns nothing
  call DisableTrigger(GetTriggeringTrigger())
  call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,28.,"moo moo...Moo moo?...MOO MOO!!!\n\nThe game will end in 30 seconds...")
  call TriggerSleepAction(30.)
  call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Lose_Func004002)
endfunction

function Trig_Revive_Hero_Local_Conditions takes nothing returns boolean
  return(IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO)!=null)
endfunction

function Trig_Revive_Hero_Local_Actions takes nothing returns nothing
  local timerdialog WINDOW
  local integer HEROWAIT
  local timer OURTIMER
  local unit OURHERO
  set OURHERO=GetDyingUnit()
  set HEROWAIT=(GetHeroLevel(OURHERO)*2)
  set OURTIMER=CreateTimer()
  call StartTimerBJ(OURTIMER,false,(I2R(HEROWAIT)))
  call CreateTimerDialogBJ(OURTIMER,GetHeroProperName(OURHERO))
  set WINDOW=bj_lastCreatedTimerDialog
  call TimerDialogDisplayForPlayerBJ(true,WINDOW,GetOwningPlayer(OURHERO))
  call PolledWait(HEROWAIT)
  call ReviveHeroLoc(OURHERO,GetRectCenter(gg_rct_Center_of_Map),true)
  call PanCameraToTimedLocForPlayer(GetOwningPlayer(OURHERO),GetUnitLoc(OURHERO),.6)
  call DestroyTimerDialog(WINDOW)
endfunction

function Trig_Shadow_Fury_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0ND')
endfunction

function Trig_Shadow_Fury_Func002Func001Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0ND',udg_ShadowFuryCaster)==4)
endfunction

function Trig_Shadow_Fury_Func002Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0ND',udg_ShadowFuryCaster)==3)
endfunction

function Trig_Shadow_Fury_Func002Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0ND',udg_ShadowFuryCaster)==2)
endfunction

function Trig_Shadow_Fury_Func002C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0ND',udg_ShadowFuryCaster)==1)
endfunction

function Trig_Shadow_Fury_Actions takes nothing returns nothing
  set udg_ShadowFuryCaster=GetSpellAbilityUnit()
  if(Trig_Shadow_Fury_Func002C())then
    call UnitAddAbility(udg_ShadowFuryCaster,'A0NI')
    call PolledWait(31.)
    call UnitRemoveAbility(udg_ShadowFuryCaster,'A0NI')
  else
    if(Trig_Shadow_Fury_Func002Func001C())then
      call UnitAddAbility(udg_ShadowFuryCaster,'A0NJ')
      call PolledWait(31.)
      call UnitRemoveAbility(udg_ShadowFuryCaster,'A0NI')
      call UnitRemoveAbility(udg_ShadowFuryCaster,'A0NJ')
    else
      if(Trig_Shadow_Fury_Func002Func001Func001C())then
        call UnitAddAbility(udg_ShadowFuryCaster,'A0NK')
        call PolledWait(31.)
        call UnitRemoveAbility(udg_ShadowFuryCaster,'A0NI')
        call UnitRemoveAbility(udg_ShadowFuryCaster,'A0NJ')
        call UnitRemoveAbility(udg_ShadowFuryCaster,'A0NK')
      else
        if(Trig_Shadow_Fury_Func002Func001Func001Func001C())then
          call UnitAddAbility(udg_ShadowFuryCaster,'A0NM')
          call PolledWait(31.)
          call UnitRemoveAbility(udg_ShadowFuryCaster,'A0NI')
          call UnitRemoveAbility(udg_ShadowFuryCaster,'A0NJ')
          call UnitRemoveAbility(udg_ShadowFuryCaster,'A0NK')
          call UnitRemoveAbility(udg_ShadowFuryCaster,'A0NM')
        endif
      endif
    endif
  endif
endfunction

function Trig_Mirror_Assassins_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0NB')
endfunction

function Trig_Mirror_Assassins_Actions takes nothing returns nothing
  set udg_Caster=GetSpellAbilityUnit()
  call CreateNUnitsAtLoc(1,'h01I',GetOwningPlayer(udg_Caster),PolarProjectionBJ(GetUnitLoc(udg_Caster),275.,0),GetUnitFacing(udg_Caster))
  set udg_MirrorAssasin_LastCreated[1]=GetUnitLoc(bj_lastCreatedUnit)
  call SetUnitMoveSpeed(bj_lastCreatedUnit,GetUnitMoveSpeed(udg_Caster))
  call AddSpecialEffectLocBJ(udg_MirrorAssasin_LastCreated[1],"Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call SetUnitVertexColorBJ(bj_lastCreatedUnit,'d','d','d',35.)
  set udg_MirrorAssassin[1]=bj_lastCreatedUnit
  call CreateNUnitsAtLoc(1,'h01I',GetOwningPlayer(udg_Caster),PolarProjectionBJ(GetUnitLoc(udg_Caster),275.,180.),GetUnitFacing(udg_Caster))
  set udg_MirrorAssasin_LastCreated[2]=GetUnitLoc(bj_lastCreatedUnit)
  call SetUnitMoveSpeed(bj_lastCreatedUnit,GetUnitMoveSpeed(udg_Caster))
  call AddSpecialEffectLocBJ(udg_MirrorAssasin_LastCreated[2],"Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call SetUnitVertexColorBJ(bj_lastCreatedUnit,'d','d','d',35.)
  set udg_MirrorAssassin[2]=bj_lastCreatedUnit
  call CreateNUnitsAtLoc(1,'h01I',GetOwningPlayer(udg_Caster),PolarProjectionBJ(GetUnitLoc(udg_Caster),275.,60.),GetUnitFacing(udg_Caster))
  set udg_MirrorAssasin_LastCreated[3]=GetUnitLoc(bj_lastCreatedUnit)
  call SetUnitMoveSpeed(bj_lastCreatedUnit,GetUnitMoveSpeed(udg_Caster))
  call AddSpecialEffectLocBJ(udg_MirrorAssasin_LastCreated[3],"Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call SetUnitVertexColorBJ(bj_lastCreatedUnit,'d','d','d',35.)
  set udg_MirrorAssassin[3]=bj_lastCreatedUnit
  call CreateNUnitsAtLoc(1,'h01I',GetOwningPlayer(udg_Caster),PolarProjectionBJ(GetUnitLoc(udg_Caster),275.,120.),GetUnitFacing(udg_Caster))
  set udg_MirrorAssasin_LastCreated[4]=GetUnitLoc(bj_lastCreatedUnit)
  call SetUnitMoveSpeed(bj_lastCreatedUnit,GetUnitMoveSpeed(udg_Caster))
  call AddSpecialEffectLocBJ(udg_MirrorAssasin_LastCreated[4],"Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call SetUnitVertexColorBJ(bj_lastCreatedUnit,'d','d','d',35.)
  set udg_MirrorAssassin[4]=bj_lastCreatedUnit
  call CreateNUnitsAtLoc(1,'h01I',GetOwningPlayer(udg_Caster),PolarProjectionBJ(GetUnitLoc(udg_Caster),275.,240.),GetUnitFacing(udg_Caster))
  set udg_MirrorAssasin_LastCreated[5]=GetUnitLoc(bj_lastCreatedUnit)
  call SetUnitMoveSpeed(bj_lastCreatedUnit,GetUnitMoveSpeed(udg_Caster))
  call AddSpecialEffectLocBJ(udg_MirrorAssasin_LastCreated[5],"Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call SetUnitVertexColorBJ(bj_lastCreatedUnit,'d','d','d',35.)
  set udg_MirrorAssassin[5]=bj_lastCreatedUnit
  call CreateNUnitsAtLoc(1,'h01I',GetOwningPlayer(udg_Caster),PolarProjectionBJ(GetUnitLoc(udg_Caster),275.,300.),GetUnitFacing(udg_Caster))
  set udg_MirrorAssasin_LastCreated[6]=GetUnitLoc(bj_lastCreatedUnit)
  call SetUnitMoveSpeed(bj_lastCreatedUnit,GetUnitMoveSpeed(udg_Caster))
  call AddSpecialEffectLocBJ(udg_MirrorAssasin_LastCreated[6],"Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call SetUnitVertexColorBJ(bj_lastCreatedUnit,'d','d','d',35.)
  set udg_MirrorAssassin[6]=bj_lastCreatedUnit
  call RemoveLocation(udg_MirrorAssasin_LastCreated[1])
  call RemoveLocation(udg_MirrorAssasin_LastCreated[2])
  call RemoveLocation(udg_MirrorAssasin_LastCreated[3])
  call RemoveLocation(udg_MirrorAssasin_LastCreated[4])
  call RemoveLocation(udg_MirrorAssasin_LastCreated[5])
  call RemoveLocation(udg_MirrorAssasin_LastCreated[6])
endfunction

function Trig_Move_Actions takes nothing returns nothing
  call IssuePointOrderByIdLoc(udg_MirrorAssassin[1],851986,PolarProjectionBJ(GetUnitLoc(udg_Caster),275.,0))
  call IssuePointOrderByIdLoc(udg_MirrorAssassin[2],851986,PolarProjectionBJ(GetUnitLoc(udg_Caster),275.,180.))
  call IssuePointOrderByIdLoc(udg_MirrorAssassin[3],851986,PolarProjectionBJ(GetUnitLoc(udg_Caster),275.,60.))
  call IssuePointOrderByIdLoc(udg_MirrorAssassin[4],851986,PolarProjectionBJ(GetUnitLoc(udg_Caster),275.,120.))
  call IssuePointOrderByIdLoc(udg_MirrorAssassin[5],851986,PolarProjectionBJ(GetUnitLoc(udg_Caster),275.,240.))
  call IssuePointOrderByIdLoc(udg_MirrorAssassin[6],851986,PolarProjectionBJ(GetUnitLoc(udg_Caster),275.,300.))
endfunction

function Trig_Remove_Conditions takes nothing returns boolean
  return(UnitHasBuffBJ(udg_Caster,'B04I')==false)
endfunction

function Trig_Remove_Actions takes nothing returns nothing
  set udg_MirrorAssasin_LastCreated[1]=GetUnitLoc(udg_MirrorAssassin[1])
  set udg_MirrorAssasin_LastCreated[2]=GetUnitLoc(udg_MirrorAssassin[2])
  set udg_MirrorAssasin_LastCreated[3]=GetUnitLoc(udg_MirrorAssassin[3])
  set udg_MirrorAssasin_LastCreated[4]=GetUnitLoc(udg_MirrorAssassin[4])
  set udg_MirrorAssasin_LastCreated[5]=GetUnitLoc(udg_MirrorAssassin[5])
  set udg_MirrorAssasin_LastCreated[6]=GetUnitLoc(udg_MirrorAssassin[6])
  call AddSpecialEffectLocBJ(udg_MirrorAssasin_LastCreated[1],"Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveUnit(udg_MirrorAssassin[1])
  call AddSpecialEffectLocBJ(udg_MirrorAssasin_LastCreated[2],"Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveUnit(udg_MirrorAssassin[2])
  call AddSpecialEffectLocBJ(udg_MirrorAssasin_LastCreated[3],"Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveUnit(udg_MirrorAssassin[3])
  call AddSpecialEffectLocBJ(udg_MirrorAssasin_LastCreated[4],"Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveUnit(udg_MirrorAssassin[4])
  call AddSpecialEffectLocBJ(udg_MirrorAssasin_LastCreated[5],"Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveUnit(udg_MirrorAssassin[5])
  call AddSpecialEffectLocBJ(udg_MirrorAssasin_LastCreated[6],"Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call RemoveUnit(udg_MirrorAssassin[6])
  call RemoveLocation(udg_MirrorAssasin_LastCreated[1])
  call RemoveLocation(udg_MirrorAssasin_LastCreated[2])
  call RemoveLocation(udg_MirrorAssasin_LastCreated[3])
  call RemoveLocation(udg_MirrorAssasin_LastCreated[4])
  call RemoveLocation(udg_MirrorAssasin_LastCreated[5])
  call RemoveLocation(udg_MirrorAssasin_LastCreated[6])
endfunction

function Trig_Attack_Conditions takes nothing returns boolean
  return(GetAttacker()==udg_Caster)and(UnitHasBuffBJ(udg_Caster,'B04I'))
endfunction

function Trig_Attack_Func001002003 takes nothing returns boolean
  return(IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()),GetOwningPlayer(udg_Caster)))
endfunction

function Trig_Attack_Func002002003 takes nothing returns boolean
  return(IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()),GetOwningPlayer(udg_Caster)))
endfunction

function Trig_Attack_Func003002003 takes nothing returns boolean
  return(IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()),GetOwningPlayer(udg_Caster)))
endfunction

function Trig_Attack_Func004002003 takes nothing returns boolean
  return(IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()),GetOwningPlayer(udg_Caster)))
endfunction

function Trig_Attack_Func005002003 takes nothing returns boolean
  return(IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()),GetOwningPlayer(udg_Caster)))
endfunction

function Trig_Attack_Func006002003 takes nothing returns boolean
  return(IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()),GetOwningPlayer(udg_Caster)))
endfunction

function Trig_Attack_Actions takes nothing returns nothing
  set udg_Mirror_Attack[1]=GetUnitsInRangeOfLocMatching(180.,PolarProjectionBJ(GetUnitLoc(udg_MirrorAssassin[1]),105.,GetUnitFacing(udg_MirrorAssassin[1])),Condition(function Trig_Attack_Func001002003))
  set udg_Mirror_Attack[2]=GetUnitsInRangeOfLocMatching(180.,PolarProjectionBJ(GetUnitLoc(udg_MirrorAssassin[2]),105.,GetUnitFacing(udg_MirrorAssassin[2])),Condition(function Trig_Attack_Func002002003))
  set udg_Mirror_Attack[3]=GetUnitsInRangeOfLocMatching(180.,PolarProjectionBJ(GetUnitLoc(udg_MirrorAssassin[3]),105.,GetUnitFacing(udg_MirrorAssassin[3])),Condition(function Trig_Attack_Func003002003))
  set udg_Mirror_Attack[4]=GetUnitsInRangeOfLocMatching(180.,PolarProjectionBJ(GetUnitLoc(udg_MirrorAssassin[4]),105.,GetUnitFacing(udg_MirrorAssassin[4])),Condition(function Trig_Attack_Func004002003))
  set udg_Mirror_Attack[5]=GetUnitsInRangeOfLocMatching(180.,PolarProjectionBJ(GetUnitLoc(udg_MirrorAssassin[5]),105.,GetUnitFacing(udg_MirrorAssassin[5])),Condition(function Trig_Attack_Func005002003))
  set udg_Mirror_Attack[6]=GetUnitsInRangeOfLocMatching(180.,PolarProjectionBJ(GetUnitLoc(udg_MirrorAssassin[6]),105.,GetUnitFacing(udg_MirrorAssassin[6])),Condition(function Trig_Attack_Func006002003))
  call SetUnitAnimation(udg_MirrorAssassin[1],"attack")
  call UnitDamageTargetBJ(udg_Caster,GroupPickRandomUnit(udg_Mirror_Attack[1]),I2R(GetHeroStatBJ(1,udg_Caster,true)),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
  call AddSpecialEffectLocBJ(PolarProjectionBJ(GetUnitLoc(udg_MirrorAssassin[1]),110.,GetUnitFacing(udg_MirrorAssassin[1])),"Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call SetUnitAnimation(udg_MirrorAssassin[2],"attack")
  call UnitDamageTargetBJ(udg_Caster,GroupPickRandomUnit(udg_Mirror_Attack[2]),I2R(GetHeroStatBJ(1,udg_Caster,true)),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
  call AddSpecialEffectLocBJ(PolarProjectionBJ(GetUnitLoc(udg_MirrorAssassin[2]),110.,GetUnitFacing(udg_MirrorAssassin[2])),"Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call SetUnitAnimation(udg_MirrorAssassin[3],"attack")
  call UnitDamageTargetBJ(udg_Caster,GroupPickRandomUnit(udg_Mirror_Attack[3]),I2R(GetHeroStatBJ(1,udg_Caster,true)),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
  call AddSpecialEffectLocBJ(PolarProjectionBJ(GetUnitLoc(udg_MirrorAssassin[3]),110.,GetUnitFacing(udg_MirrorAssassin[3])),"Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call SetUnitAnimation(udg_MirrorAssassin[4],"attack")
  call UnitDamageTargetBJ(udg_Caster,GroupPickRandomUnit(udg_Mirror_Attack[4]),I2R(GetHeroStatBJ(1,udg_Caster,true)),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
  call AddSpecialEffectLocBJ(PolarProjectionBJ(GetUnitLoc(udg_MirrorAssassin[4]),110.,GetUnitFacing(udg_MirrorAssassin[4])),"Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call SetUnitAnimation(udg_MirrorAssassin[5],"attack")
  call UnitDamageTargetBJ(udg_Caster,GroupPickRandomUnit(udg_Mirror_Attack[5]),I2R(GetHeroStatBJ(1,udg_Caster,true)),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
  call AddSpecialEffectLocBJ(PolarProjectionBJ(GetUnitLoc(udg_MirrorAssassin[5]),110.,GetUnitFacing(udg_MirrorAssassin[5])),"Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call SetUnitAnimation(udg_MirrorAssassin[6],"attack")
  call UnitDamageTargetBJ(udg_Caster,GroupPickRandomUnit(udg_Mirror_Attack[6]),I2R(GetHeroStatBJ(1,udg_Caster,true)),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
  call AddSpecialEffectLocBJ(PolarProjectionBJ(GetUnitLoc(udg_MirrorAssassin[6]),110.,GetUnitFacing(udg_MirrorAssassin[6])),"Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
endfunction

function Trig_Focused_Fire_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0NA')
endfunction

function Trig_Focused_Fire_Actions takes nothing returns nothing
  set udg_FFCasted=GetSpellTargetUnit()
  set udg_FFCaster=GetSpellAbilityUnit()
  call AddSpecialEffectTargetUnitBJ("overhead",udg_FFCasted,"Abilities\\Spells\\Orc\\EtherealForm\\SpiritWalkerChange.mdl")
  call EnableTrigger(gg_trg_Knocked_Back)
  call TriggerSleepAction((.2*I2R(GetUnitAbilityLevelSwapped('A0NA',udg_FFCaster))))
  call DisableTrigger(gg_trg_Knocked_Back)
endfunction

function Trig_Knocked_Back_Actions takes nothing returns nothing
  call SetUnitPositionLoc(udg_FFCasted,PolarProjectionBJ(GetUnitLoc(udg_FFCasted),50.,GetUnitFacing(udg_FFCaster)))
endfunction

function Trig_Thunderstorm_Non_Channel_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0N4')
endfunction

function Trig_Thunderstorm_Non_Channel_Func003Func001Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0N4',GetSpellAbilityUnit())==4)
endfunction

function Trig_Thunderstorm_Non_Channel_Func003Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0N4',GetSpellAbilityUnit())==3)
endfunction

function Trig_Thunderstorm_Non_Channel_Func003Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0N4',GetSpellAbilityUnit())==2)
endfunction

function Trig_Thunderstorm_Non_Channel_Func003C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0N4',GetSpellAbilityUnit())==1)
endfunction

function Trig_Thunderstorm_Non_Channel_Actions takes nothing returns nothing
  set udg_Thunderstorm_Position=GetUnitLoc(GetSpellAbilityUnit())
  set udg_Thunderstorm_Point=GetSpellTargetLoc()
  if(Trig_Thunderstorm_Non_Channel_Func003C())then
    call CreateNUnitsAtLoc(1,'h015',GetOwningPlayer(GetSpellAbilityUnit()),udg_Thunderstorm_Position,bj_UNIT_FACING)
    call UnitAddAbility(bj_lastCreatedUnit,'A03S')
    call SetUnitAbilityLevelSwapped('A03S',bj_lastCreatedUnit,1)
    call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852591,udg_Thunderstorm_Point)
    call TriggerSleepAction(10.)
    call RemoveUnit(bj_lastCreatedUnit)
  else
    if(Trig_Thunderstorm_Non_Channel_Func003Func001C())then
      call CreateNUnitsAtLoc(1,'h015',GetOwningPlayer(GetSpellAbilityUnit()),udg_Thunderstorm_Position,bj_UNIT_FACING)
      call UnitAddAbility(bj_lastCreatedUnit,'A03S')
      call SetUnitAbilityLevelSwapped('A03S',bj_lastCreatedUnit,2)
      call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852591,udg_Thunderstorm_Point)
      call TriggerSleepAction(10.)
      call RemoveUnit(bj_lastCreatedUnit)
    else
      if(Trig_Thunderstorm_Non_Channel_Func003Func001Func001C())then
        call CreateNUnitsAtLoc(1,'h015',GetOwningPlayer(GetSpellAbilityUnit()),udg_Thunderstorm_Position,bj_UNIT_FACING)
        call UnitAddAbility(bj_lastCreatedUnit,'A03S')
        call SetUnitAbilityLevelSwapped('A03S',bj_lastCreatedUnit,3)
        call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852591,udg_Thunderstorm_Point)
        call TriggerSleepAction(10.)
        call RemoveUnit(bj_lastCreatedUnit)
      else
        if(Trig_Thunderstorm_Non_Channel_Func003Func001Func001Func001C())then
          call CreateNUnitsAtLoc(1,'h015',GetOwningPlayer(GetSpellAbilityUnit()),udg_Thunderstorm_Position,bj_UNIT_FACING)
          call UnitAddAbility(bj_lastCreatedUnit,'A03S')
          call SetUnitAbilityLevelSwapped('A03S',bj_lastCreatedUnit,4)
          call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852591,udg_Thunderstorm_Point)
          call TriggerSleepAction(10.)
          call RemoveUnit(bj_lastCreatedUnit)
        endif
      endif
    endif
  endif
  call RemoveLocation(udg_Thunderstorm_Position)
endfunction

function Trig_Osmose_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetKillingUnit())=='O01M')
endfunction

function Trig_Osmose_Actions takes nothing returns nothing
  call SetUnitManaBJ(GetKillingUnit(),(GetUnitStateSwap(UNIT_STATE_MANA,GetKillingUnit())+(75.*I2R(GetUnitAbilityLevelSwapped('A0MY',GetKillingUnit())))))
endfunction

function Trig_Start_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0MT')
endfunction

function Trig_Start_Actions takes nothing returns nothing
  set udg_SoulCaster=GetSpellAbilityUnit()
  set udg_SoulCasterPos=GetUnitLoc(udg_SoulCaster)
  call AddSpecialEffectLocBJ(udg_SoulCasterPos,"Abilities\\Spells\\Undead\\DeathPact\\DeathPactCaster.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call EnableTrigger(gg_trg_cont)
endfunction

function Trig_cont_Actions takes nothing returns nothing
  set udg_SoulAcensionRandom=GetRandomLocInRect(RectFromCenterSizeBJ(udg_SoulCasterPos,800.,800.))
  call CreateNUnitsAtLoc(1,'e01L',GetOwningPlayer(udg_SoulCaster),udg_SoulAcensionRandom,GetRandomReal(0,360))
  call SetUnitAbilityLevelSwapped('A0MU',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0MT',udg_SoulCaster))
  call UnitApplyTimedLifeBJ(2.5,'BTLF',bj_lastCreatedUnit)
  call SetUnitFlyHeight(bj_lastCreatedUnit,900.,400.)
  call PlaySoundAtPointBJ(gg_snd_PossessionMissileLaunch1,'d',udg_SoulCasterPos,0)
  call RemoveLocation(udg_SoulAcensionRandom)
endfunction

function Trig_End_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0MT')
endfunction

function Trig_End_Actions takes nothing returns nothing
  call DisableTrigger(gg_trg_cont)
  call StopSoundBJ(gg_snd_PossessionMissileLaunch1,false)
  call RemoveLocation(udg_SoulCasterPos)
endfunction

function Trig_Death_Pulse_Multicasts_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0ML')
endfunction

function Trig_Death_Pulse_Multicasts_Func002Func001Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0ML',udg_Death_Caster)==4)
endfunction

function Trig_Death_Pulse_Multicasts_Func002Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0ML',udg_Death_Caster)==3)
endfunction

function Trig_Death_Pulse_Multicasts_Func002Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0ML',udg_Death_Caster)==2)
endfunction

function Trig_Death_Pulse_Multicasts_Func002C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0ML',udg_Death_Caster)==1)
endfunction

function Trig_Death_Pulse_Multicasts_Actions takes nothing returns nothing
  set udg_Death_Caster=GetSpellAbilityUnit()
  if(Trig_Death_Pulse_Multicasts_Func002C())then
    call EnableTrigger(gg_trg_Death_Pulse_Mult)
    call TriggerSleepAction(1.)
    call DisableTrigger(gg_trg_Death_Pulse_Mult)
  else
    if(Trig_Death_Pulse_Multicasts_Func002Func001C())then
      call EnableTrigger(gg_trg_Death_Pulse_Mult)
      call TriggerSleepAction(2.)
      call DisableTrigger(gg_trg_Death_Pulse_Mult)
    else
      if(Trig_Death_Pulse_Multicasts_Func002Func001Func001C())then
        call EnableTrigger(gg_trg_Death_Pulse_Mult)
        call TriggerSleepAction(3.)
        call DisableTrigger(gg_trg_Death_Pulse_Mult)
      else
        if(Trig_Death_Pulse_Multicasts_Func002Func001Func001Func001C())then
          call EnableTrigger(gg_trg_Death_Pulse_Mult)
          call TriggerSleepAction(4.)
          call DisableTrigger(gg_trg_Death_Pulse_Mult)
        endif
      endif
    endif
  endif
endfunction

function Trig_Death_Pulse_Mult_Actions takes nothing returns nothing
  set udg_DeathCasterPos=GetUnitLoc(udg_Death_Caster)
  call CreateNUnitsAtLoc(1,'h00Y',GetOwningPlayer(udg_Death_Caster),udg_DeathCasterPos,bj_UNIT_FACING)
  call UnitAddAbility(bj_lastCreatedUnit,'A0MI')
  call IssueImmediateOrderById(bj_lastCreatedUnit,852526)
  call UnitApplyTimedLifeBJ(1.,'BTLF',bj_lastCreatedUnit)
  call RemoveLocation(udg_DeathCasterPos)
endfunction

function Trig_Blade_Massacre_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0LA')
endfunction

function Trig_Blade_Massacre_Func019Func003C takes nothing returns boolean
  return(ModuloInteger(bj_forLoopBIndex,2)==0)
endfunction

function Trig_Blade_Massacre_Actions takes nothing returns nothing
  call PlaySoundBJ(gg_snd_ShamanPissed1)
  call AddSpecialEffectLocBJ(GetUnitLoc(GetSpellAbilityUnit()),"Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl")
  set udg_TargetUnit=GetSpellTargetUnit()
  set udg_CasterUnit=GetTriggerUnit()
  call AttachSoundToUnit(gg_snd_MetalHeavySliceFlesh1,GetTriggerUnit())
  call AttachSoundToUnit(gg_snd_MetalHeavySliceFlesh2,GetTriggerUnit())
  call CreateFogModifierRadiusLocBJ(true,GetTriggerPlayer(),FOG_OF_WAR_VISIBLE,GetUnitLoc(GetSpellTargetUnit()),800.)
  set udg_BMVisibility=bj_lastCreatedFogModifier
  call PauseUnit(GetSpellTargetUnit(),true)
  set bj_forLoopAIndex=1
  set bj_forLoopAIndexEnd=5
  loop
    exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
    call CreateNUnitsAtLoc(1,'o01L',GetTriggerPlayer(),GetUnitLoc(GetTriggerUnit()),GetUnitFacing(GetTriggerUnit()))
    call SetUnitVertexColorBJ(bj_lastCreatedUnit,'d','d','d',(20.*I2R((bj_forLoopAIndex-1))))
    call SetUnitTimeScalePercent(bj_lastCreatedUnit,200.)
    set udg_BladeMasterShadow[bj_forLoopAIndex]=bj_lastCreatedUnit
    set bj_forLoopAIndex=bj_forLoopAIndex+1
  endloop
  call ShowUnitHide(GetTriggerUnit())
  set bj_forLoopBIndex=1
  set bj_forLoopBIndexEnd=8
  loop
    exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
    set bj_forLoopAIndex=1
    set bj_forLoopAIndexEnd=5
    loop
      exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
      call SetUnitAnimationWithRarity(udg_BladeMasterShadow[bj_forLoopAIndex],"attack",RARITY_FREQUENT)
      set bj_forLoopAIndex=bj_forLoopAIndex+1
    endloop
    call StartTimerBJ(udg_Shadow1Timer,true,.07)
    if(Trig_Blade_Massacre_Func019Func003C())then
      call PlaySoundBJ(gg_snd_MetalHeavySliceFlesh1)
    else
      call PlaySoundBJ(gg_snd_MetalHeavySliceFlesh2)
    endif
    call SetUnitAnimation(udg_TargetUnit,"death")
    call AddSpecialEffectTargetUnitBJ("chest",udg_TargetUnit,"Objects\\Spawnmodels\\Human\\HumanBlood\\HumanBloodKnight.mdl")
    call TriggerSleepAction(.35)
    call ResetUnitAnimation(udg_TargetUnit)
    call DisableTrigger(gg_trg_Shadow5Movement)
    call DisableTrigger(gg_trg_Shadow4Movement)
    call DisableTrigger(gg_trg_Shadow3Movement)
    call DisableTrigger(gg_trg_Shadow2Movement)
    call PauseTimerBJ(true,udg_Shadow1Timer)
    set bj_forLoopAIndex=1
    set bj_forLoopAIndexEnd=5
    loop
      exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
      call SetUnitPositionLocFacingLocBJ(udg_BladeMasterShadow[bj_forLoopAIndex],PolarProjectionBJ(GetUnitLoc(udg_TargetUnit),200.,(GetUnitFacing(udg_BladeMasterShadow[bj_forLoopAIndex])+45.)),GetUnitLoc(udg_TargetUnit))
      set bj_forLoopAIndex=bj_forLoopAIndex+1
    endloop
    call TriggerSleepAction(.25)
    set bj_forLoopBIndex=bj_forLoopBIndex+1
  endloop
  call UnitDamageTargetBJ(udg_CasterUnit,udg_TargetUnit,15000.,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL)
  call PauseUnit(udg_TargetUnit,false)
  call SetUnitInvulnerable(udg_TargetUnit,false)
  call CinematicFadeBJ(2,1.,"ReplaceableTextures\\CameraMasks\\DiagonalSlash_mask.blp",100.,0,0,50.)
  call PlaySoundBJ(gg_snd_MetalHeavySliceFlesh1)
  call TriggerSleepAction(.7)
  set bj_forLoopAIndex=1
  set bj_forLoopAIndexEnd=5
  loop
    exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
    call SetUnitAnimation(udg_BladeMasterShadow[bj_forLoopAIndex],"ready")
    set bj_forLoopAIndex=bj_forLoopAIndex+1
  endloop
  call DisableTrigger(gg_trg_Shadow5Movement)
  call DisableTrigger(gg_trg_Shadow4Movement)
  call DisableTrigger(gg_trg_Shadow3Movement)
  call DisableTrigger(gg_trg_Shadow2Movement)
  call PauseTimerBJ(true,udg_Shadow1Timer)
  call SetUnitPositionLocFacingBJ(udg_CasterUnit,GetUnitLoc(udg_BladeMasterShadow[1]),GetUnitFacing(udg_BladeMasterShadow[1]))
  call TriggerSleepAction(.25)
  set bj_forLoopAIndex=1
  set bj_forLoopAIndexEnd=5
  loop
    exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
    call RemoveUnit(udg_BladeMasterShadow[bj_forLoopAIndex])
    set bj_forLoopAIndex=bj_forLoopAIndex+1
  endloop
  call ShowUnitShow(udg_CasterUnit)
endfunction

function Trig_Shadow1Movement_Func002C takes nothing returns boolean
  return(IsTriggerEnabled(gg_trg_Shadow2Movement)==false)
endfunction

function Trig_Shadow1Movement_Actions takes nothing returns nothing
  call SetUnitPositionLocFacingBJ(udg_BladeMasterShadow[1],PolarProjectionBJ(GetUnitLoc(udg_BladeMasterShadow[1]),50.,GetUnitFacing(udg_BladeMasterShadow[1])),GetUnitFacing(udg_BladeMasterShadow[1]))
  if(Trig_Shadow1Movement_Func002C())then
    call StartTimerBJ(udg_Shadow2Timer,true,.07)
    call EnableTrigger(gg_trg_Shadow2Movement)
  endif
endfunction

function Trig_Shadow2Movement_Func002C takes nothing returns boolean
  return(IsTriggerEnabled(gg_trg_Shadow3Movement)==false)
endfunction

function Trig_Shadow2Movement_Actions takes nothing returns nothing
  call SetUnitPositionLocFacingBJ(udg_BladeMasterShadow[2],PolarProjectionBJ(GetUnitLoc(udg_BladeMasterShadow[2]),50.,GetUnitFacing(udg_BladeMasterShadow[2])),GetUnitFacing(udg_BladeMasterShadow[2]))
  if(Trig_Shadow2Movement_Func002C())then
    call StartTimerBJ(udg_Shadow3Timer,true,.07)
    call EnableTrigger(gg_trg_Shadow3Movement)
  endif
endfunction

function Trig_Shadow3Movement_Func002C takes nothing returns boolean
  return(IsTriggerEnabled(gg_trg_Shadow4Movement)==false)
endfunction

function Trig_Shadow3Movement_Actions takes nothing returns nothing
  call SetUnitPositionLocFacingBJ(udg_BladeMasterShadow[3],PolarProjectionBJ(GetUnitLoc(udg_BladeMasterShadow[3]),50.,GetUnitFacing(udg_BladeMasterShadow[3])),GetUnitFacing(udg_BladeMasterShadow[3]))
  if(Trig_Shadow3Movement_Func002C())then
    call StartTimerBJ(udg_Shadow4Timer,true,.07)
    call EnableTrigger(gg_trg_Shadow4Movement)
  endif
endfunction

function Trig_Shadow4Movement_Func002C takes nothing returns boolean
  return(IsTriggerEnabled(gg_trg_Shadow5Movement)==false)
endfunction

function Trig_Shadow4Movement_Actions takes nothing returns nothing
  call SetUnitPositionLocFacingBJ(udg_BladeMasterShadow[4],PolarProjectionBJ(GetUnitLoc(udg_BladeMasterShadow[4]),50.,GetUnitFacing(udg_BladeMasterShadow[4])),GetUnitFacing(udg_BladeMasterShadow[4]))
  if(Trig_Shadow4Movement_Func002C())then
    call StartTimerBJ(udg_Shadow5Timer,true,.07)
    call EnableTrigger(gg_trg_Shadow5Movement)
  endif
endfunction

function Trig_Shadow5Movement_Actions takes nothing returns nothing
  call SetUnitPositionLocFacingBJ(udg_BladeMasterShadow[5],PolarProjectionBJ(GetUnitLoc(udg_BladeMasterShadow[5]),50.,GetUnitFacing(udg_BladeMasterShadow[5])),GetUnitFacing(udg_BladeMasterShadow[5]))
endfunction

function Trig_Blast_Start_Graphic_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0L4')
endfunction

function Trig_Blast_Start_Graphic_Actions takes nothing returns nothing
  local effect udg_blastgraphic
  call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Orc\\Voodoo\\VoodooAuraTarget.mdl")
  set udg_blastgraphic=bj_lastCreatedEffect
  call TriggerSleepAction(.1)
  call DestroyEffect(udg_blastgraphic)
endfunction

function Trig_Blast_Start_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0L4')
endfunction

function Trig_Blast_Start_Actions takes nothing returns nothing
  call CreateNUnitsAtLocFacingLocBJ(1,'e01J',GetTriggerPlayer(),PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()),75.,GetUnitFacing(GetTriggerUnit())),GetSpellTargetLoc())
endfunction

function Trig_Aerial_strike_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0KV')
endfunction

function Trig_Aerial_strike_Actions takes nothing returns nothing
  set udg_Aerial_caster=GetSpellAbilityUnit()
  call PauseUnit(GetSpellAbilityUnit(),true)
  call UnitAddAbility(GetTriggerUnit(),'A0KS')
  call UnitRemoveAbility(GetTriggerUnit(),'A0KS')
  call SetUnitFlyHeight(GetSpellAbilityUnit(),750.,750.)
  call SetUnitInvulnerable(GetSpellAbilityUnit(),true)
  call SetUnitPathing(GetSpellAbilityUnit(),false)
  call SetUnitAnimation(GetSpellAbilityUnit(),"spell slam")
  call TriggerSleepAction(.3)
  call SetUnitFlyHeight(GetSpellAbilityUnit(),.0,2000.)
  call AddSpecialEffectLocBJ(GetUnitLoc(GetSpellAbilityUnit()),"Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call TriggerSleepAction(.45)
  call EnableTrigger(gg_trg_Aerial_move)
  call PauseUnit(GetSpellAbilityUnit(),false)
  call UnitAddAbility(udg_Aerial_caster,'A0KT')
  call UnitAddAbility(GetTriggerUnit(),'A0KS')
  call UnitRemoveAbility(GetTriggerUnit(),'A0KS')
  call SetUnitFlyHeight(GetSpellAbilityUnit(),400.,1000.)
  call SetUnitAnimation(udg_Aerial_caster,"spell")
  call SetUnitInvulnerable(GetSpellAbilityUnit(),false)
  call TerrainDeformationRippleBJ(1.,false,GetUnitLoc(GetSpellAbilityUnit()),500.,500.,100.,1,500.)
  call TriggerSleepAction(.2)
  call SetUnitFlyHeight(udg_Aerial_caster,.0,1000.)
  call TriggerSleepAction(.2)
  call UnitRemoveAbility(udg_Aerial_caster,'A0KT')
  call SetUnitPathing(GetSpellAbilityUnit(),true)
  call ResetUnitAnimation(GetSpellAbilityUnit())
  call DisableTrigger(gg_trg_Aerial_move)
endfunction

function Trig_Aerial_move_Actions takes nothing returns nothing
  call SetUnitPositionLoc(udg_Aerial_caster,PolarProjectionBJ(GetUnitLoc(udg_Aerial_caster),-10.,GetUnitFacing(udg_Aerial_caster)))
endfunction

function Trig_Earth_slayer_cast_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0KR')
endfunction

function Trig_Earth_slayer_cast_Func001Func001Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0KR',GetSpellAbilityUnit())==4)
endfunction

function Trig_Earth_slayer_cast_Func001Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0KR',GetSpellAbilityUnit())==3)
endfunction

function Trig_Earth_slayer_cast_Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0KR',GetSpellAbilityUnit())==2)
endfunction

function Trig_Earth_slayer_cast_Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0KR',GetSpellAbilityUnit())==1)
endfunction

function Trig_Earth_slayer_cast_Actions takes nothing returns nothing
  if(Trig_Earth_slayer_cast_Func001C())then
    call TriggerSleepAction(.45)
    set udg_Earth_slayer_caster=GetSpellAbilityUnit()
    call UnitAddAbility(udg_Earth_slayer_caster,'A0KU')
    call SetUnitPathing(udg_Earth_slayer_caster,false)
    call EnableTrigger(gg_trg_Earth_slayer_charge)
    call TriggerSleepAction(.5)
    call UnitRemoveAbility(udg_Earth_slayer_caster,'A0KU')
    call DisableTrigger(gg_trg_Earth_slayer_charge)
    call SetUnitPathing(udg_Earth_slayer_caster,true)
  else
    if(Trig_Earth_slayer_cast_Func001Func001C())then
      call TriggerSleepAction(.45)
      set udg_Earth_slayer_caster=GetSpellAbilityUnit()
      call UnitAddAbility(udg_Earth_slayer_caster,'A0KW')
      call SetUnitPathing(udg_Earth_slayer_caster,false)
      call EnableTrigger(gg_trg_Earth_slayer_charge)
      call TriggerSleepAction(.5)
      call UnitRemoveAbility(udg_Earth_slayer_caster,'A0KW')
      call DisableTrigger(gg_trg_Earth_slayer_charge)
      call SetUnitPathing(udg_Earth_slayer_caster,true)
    else
      if(Trig_Earth_slayer_cast_Func001Func001Func001C())then
        call TriggerSleepAction(.45)
        set udg_Earth_slayer_caster=GetSpellAbilityUnit()
        call UnitAddAbility(udg_Earth_slayer_caster,'A0KX')
        call SetUnitPathing(udg_Earth_slayer_caster,false)
        call EnableTrigger(gg_trg_Earth_slayer_charge)
        call TriggerSleepAction(.5)
        call UnitRemoveAbility(udg_Earth_slayer_caster,'A0KX')
        call DisableTrigger(gg_trg_Earth_slayer_charge)
        call SetUnitPathing(udg_Earth_slayer_caster,true)
      else
        if(Trig_Earth_slayer_cast_Func001Func001Func001Func001C())then
          call TriggerSleepAction(.45)
          set udg_Earth_slayer_caster=GetSpellAbilityUnit()
          call UnitAddAbility(udg_Earth_slayer_caster,'A0KY')
          call SetUnitPathing(udg_Earth_slayer_caster,false)
          call EnableTrigger(gg_trg_Earth_slayer_charge)
          call TriggerSleepAction(.5)
          call UnitRemoveAbility(udg_Earth_slayer_caster,'A0KY')
          call DisableTrigger(gg_trg_Earth_slayer_charge)
          call SetUnitPathing(udg_Earth_slayer_caster,true)
        endif
      endif
    endif
  endif
endfunction

function Trig_Earth_slayer_charge_Actions takes nothing returns nothing
  call SetUnitPositionLoc(udg_Earth_slayer_caster,PolarProjectionBJ(GetUnitLoc(udg_Earth_slayer_caster),25.,GetUnitFacing(udg_Earth_slayer_caster)))
endfunction

function Trig_Slam_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0KC')
endfunction

function Trig_Slam_Actions takes nothing returns nothing
  set udg_Axe_Target=GetSpellTargetUnit()
  set udg_EnchantedAxe_TargetPos=GetUnitLoc(udg_Axe_Target)
  set udg_EnchantedAxe_CasterPos=GetUnitLoc(GetSpellAbilityUnit())
  call PolledWait((DistanceBetweenPoints(udg_EnchantedAxe_CasterPos,udg_EnchantedAxe_TargetPos)/1000.))
  call CreateNUnitsAtLoc(1,'h01F',GetOwningPlayer(GetSpellAbilityUnit()),udg_EnchantedAxe_TargetPos,bj_UNIT_FACING)
  call IssueImmediateOrderById(bj_lastCreatedUnit,852096)
  call RemoveLocation(udg_EnchantedAxe_CasterPos)
  call RemoveLocation(udg_EnchantedAxe_TargetPos)
endfunction

function Trig_Cast_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0JW')
endfunction

function Trig_Cast_Func026Func001Func001C takes nothing returns boolean
  return(IsUnitAliveBJ(udg_DB_Target))and(bj_forLoopAIndex!=((GetHeroStatBJ(2,udg_DB_Caster,true)/4)+1))
endfunction

function Trig_Cast_Func026Func001C takes nothing returns boolean
  return(Trig_Cast_Func026Func001Func001C())
endfunction

function Trig_Cast_Actions takes nothing returns nothing
  set udg_DB_Caster=GetSpellAbilityUnit()
  set udg_DB_Target=GetSpellTargetUnit()
  set udg_Blitz_CasterPos=GetUnitLoc(udg_DB_Caster)
  call SetUnitExploded(udg_DB_Target,true)
  call TriggerSleepAction(.05)
  call AddSpecialEffectLocBJ(udg_Blitz_CasterPos,"Abilities\\Weapons\\Bolt\\BoltImpact.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call TriggerSleepAction(.1)
  call AddSpecialEffectLocBJ(PolarProjectionBJ(GetUnitLoc(udg_DB_Target),200.,GetUnitFacing(udg_DB_Target)),"Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call TriggerSleepAction(.05)
  call AddSpecialEffectTargetUnitBJ("left hand",udg_DB_Caster,"Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl")
  set udg_DB_Effects[1]=bj_lastCreatedEffect
  call AddSpecialEffectTargetUnitBJ("right hand",udg_DB_Caster,"Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl")
  set udg_DB_Effects[2]=bj_lastCreatedEffect
  call AddSpecialEffectTargetUnitBJ("left foot",udg_DB_Caster,"Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl")
  set udg_DB_Effects[3]=bj_lastCreatedEffect
  call AddSpecialEffectTargetUnitBJ("right foot",udg_DB_Caster,"Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl")
  set udg_DB_Effects[4]=bj_lastCreatedEffect
  call AddSpecialEffectTargetUnitBJ("head",udg_DB_Caster,"Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl")
  set udg_DB_Effects[5]=bj_lastCreatedEffect
  call TriggerSleepAction(.01)
  call TriggerSleepAction(.05)
  call CreateTextTagUnitBJ((I2S((GetHeroStatBJ(2,udg_DB_Caster,true)/4))+(" Hits of "+(I2S(R2I(I2R(GetHeroStatBJ(1,udg_DB_Caster,true))))+" Damage"))),udg_DB_Caster,0,10,.0,.0,100.,.0)
  set udg_DB_FloatingText=bj_lastCreatedTextTag
  set bj_forLoopAIndex=1
  set bj_forLoopAIndexEnd=((GetHeroStatBJ(2,udg_DB_Caster,true)/4)+1)
  loop
    exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
    if(Trig_Cast_Func026Func001C())then
      call SetUnitAnimation(udg_DB_Target,"death")
      call SetUnitAnimation(udg_DB_Caster,"attack")
      call AddSpecialEffectTargetUnitBJ("chest",udg_DB_Target,"Objects\\Spawnmodels\\Human\\HumanBlood\\BloodElfSpellThiefBlood.mdl")
      call DestroyEffect(bj_lastCreatedEffect)
      call UnitDamageTargetBJ(udg_DB_Caster,udg_DB_Target,I2R(GetHeroStatBJ(1,udg_DB_Caster,true)),ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL)
      call SetUnitLifePercentBJ(udg_DB_Caster,(GetUnitLifePercent(udg_DB_Caster)+15.))
      call TriggerSleepAction(.15)
    else
      call ResetUnitAnimation(udg_DB_Target)
      call SetUnitExploded(udg_DB_Target,false)
      call DestroyTextTag(udg_DB_FloatingText)
      set bj_forLoopAIndex=1
      set bj_forLoopAIndexEnd=5
      loop
        exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
        call DestroyEffect(udg_DB_Effects[bj_forLoopAIndex])
        set bj_forLoopAIndex=bj_forLoopAIndex+1
      endloop
    endif
    set bj_forLoopAIndex=bj_forLoopAIndex+1
  endloop
  call RemoveLocation(udg_Blitz_CasterPos)
endfunction

function Trig_Charged_Unit_Attacked_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetTriggerUnit())=='H00N')and(GetUnitAbilityLevelSwapped('A0JN',GetTriggerUnit())==1)
endfunction

function Trig_Charged_Unit_Attacked_Func003C takes nothing returns boolean
  return(udg_PassiveUnstablePercent==udg_PassiveUpheavalChance)
endfunction

function Trig_Charged_Unit_Attacked_Actions takes nothing returns nothing
  set udg_PassiveUpheavalChance=GetRandomInt(1,2)
  set udg_TerraUpheaval_Caster=GetUnitLoc(GetTriggerUnit())
  if(Trig_Charged_Unit_Attacked_Func003C())then
    call CreateNUnitsAtLocFacingLocBJ(1,'e01I',GetOwningPlayer(GetTriggerUnit()),PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()),50.,(GetUnitFacing(GetTriggerUnit())+.0)),udg_TerraUpheaval_Caster)
    call IssuePointOrderByIdLoc(bj_lastCreatedUnit,851986,PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()),800.,(GetUnitFacing(GetTriggerUnit())+.0)))
    call CreateNUnitsAtLocFacingLocBJ(1,'e01I',GetOwningPlayer(GetTriggerUnit()),PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()),50.,(GetUnitFacing(GetTriggerUnit())+90.)),udg_TerraUpheaval_Caster)
    call IssuePointOrderByIdLoc(bj_lastCreatedUnit,851986,PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()),800.,(GetUnitFacing(GetTriggerUnit())+90.)))
    call CreateNUnitsAtLocFacingLocBJ(1,'e01I',GetOwningPlayer(GetTriggerUnit()),PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()),50.,(GetUnitFacing(GetTriggerUnit())+180.)),udg_TerraUpheaval_Caster)
    call IssuePointOrderByIdLoc(bj_lastCreatedUnit,851986,PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()),800.,(GetUnitFacing(GetTriggerUnit())+180.)))
    call CreateNUnitsAtLocFacingLocBJ(1,'e01I',GetOwningPlayer(GetTriggerUnit()),PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()),50.,(GetUnitFacing(GetTriggerUnit())+270.)),udg_TerraUpheaval_Caster)
    call IssuePointOrderByIdLoc(bj_lastCreatedUnit,851986,PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()),800.,(GetUnitFacing(GetTriggerUnit())+270.)))
  endif
  call RemoveLocation(udg_TerraUpheaval_Caster)
endfunction

function Trig_Show_Conditions takes nothing returns boolean
  return(GetLearnedSkill()=='A0JM')
endfunction

function Trig_Show_Func002Func001Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0JM',GetLearningUnit())==4)
endfunction

function Trig_Show_Func002Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0JM',GetLearningUnit())==3)
endfunction

function Trig_Show_Func002Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0JM',GetLearningUnit())==2)
endfunction

function Trig_Show_Func002C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0JM',GetLearningUnit())==1)
endfunction

function Trig_Show_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0EQ')
  if(Trig_Show_Func002C())then
    call SetUnitAbilityLevelSwapped('A0EQ',GetLearningUnit(),1)
  else
    if(Trig_Show_Func002Func001C())then
      call SetUnitAbilityLevelSwapped('A0EQ',GetLearningUnit(),2)
    else
      if(Trig_Show_Func002Func001Func001C())then
        call SetUnitAbilityLevelSwapped('A0EQ',GetLearningUnit(),3)
      else
        if(Trig_Show_Func002Func001Func001Func001C())then
          call SetUnitAbilityLevelSwapped('A0EQ',GetLearningUnit(),4)
        endif
      endif
    endif
  endif
endfunction

function Trig_Rend_Conditions takes nothing returns boolean
  return(GetLearnedSkill()=='A0NX')
endfunction

function Trig_Rend_Func002Func001Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0NX',GetLearningUnit())==4)
endfunction

function Trig_Rend_Func002Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0NX',GetLearningUnit())==3)
endfunction

function Trig_Rend_Func002Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0NX',GetLearningUnit())==2)
endfunction

function Trig_Rend_Func002C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0NX',GetLearningUnit())==1)
endfunction

function Trig_Rend_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0NV')
  if(Trig_Rend_Func002C())then
    call SetUnitAbilityLevelSwapped('A0NV',GetLearningUnit(),1)
  else
    if(Trig_Rend_Func002Func001C())then
      call SetUnitAbilityLevelSwapped('A0NV',GetLearningUnit(),2)
    else
      if(Trig_Rend_Func002Func001Func001C())then
        call SetUnitAbilityLevelSwapped('A0NV',GetLearningUnit(),3)
      else
        if(Trig_Rend_Func002Func001Func001Func001C())then
          call SetUnitAbilityLevelSwapped('A0NV',GetLearningUnit(),4)
        endif
      endif
    endif
  endif
endfunction

function Trig_Show_Copy_Conditions takes nothing returns boolean
  return(GetLearnedSkill()=='A0L9')
endfunction

function Trig_Show_Copy_Actions takes nothing returns nothing
  call UnitAddAbility(GetLearningUnit(),'A0L8')
endfunction

function Trig_Hungeeer_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0JJ')
endfunction

function Trig_Hungeeer_Func009001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0JJ',udg_hungeeer_caster)==1)
endfunction

function Trig_Hungeeer_Func015001 takes nothing returns boolean
  return(IsUnitAliveBJ(udg_hungeeer_target))
endfunction

function Trig_Hungeeer_Actions takes nothing returns nothing
  set udg_hungeeer_caster=GetSpellAbilityUnit()
  set udg_hungeeer_target=GetSpellTargetUnit()
  call PlaySoundOnUnitBJ(gg_snd_GhoulPissed3,'d',udg_hungeeer_caster)
  call TriggerSleepAction(.45)
  call EnableTrigger(gg_trg_Hungeeer_move)
  call EnableTrigger(gg_trg_Hungeeer_animation)
  call EnableTrigger(gg_trg_Hungeeer_target_die)
  call SetUnitPathing(udg_hungeeer_caster,false)
  if(Trig_Hungeeer_Func009001())then
    call UnitAddAbility(udg_hungeeer_caster,'A0JK')
  endif
  call TriggerSleepAction(5.)
  call DisableTrigger(gg_trg_Hungeeer_move)
  call DisableTrigger(gg_trg_Hungeeer_animation)
  call DisableTrigger(gg_trg_Hungeeer_target_die)
  call UnitRemoveAbility(udg_hungeeer_caster,'A0JK')
  if(Trig_Hungeeer_Func015001())then
    call EnableTrigger(gg_trg_Hungeeer_move_2)
  endif
  call TriggerSleepAction(.03)
  call DisableTrigger(gg_trg_Hungeeer_move_2)
  call SetUnitPathing(udg_hungeeer_caster,true)
endfunction

function Trig_Hungeeer_move_Actions takes nothing returns nothing
  set udg_Hungeeer_Facing=GetUnitLoc(udg_hungeeer_target)
  call SetUnitPositionLocFacingLocBJ(udg_hungeeer_caster,PolarProjectionBJ(GetUnitLoc(udg_hungeeer_target),-100.,GetUnitFacing(udg_hungeeer_target)),udg_Hungeeer_Facing)
  call RemoveLocation(udg_Hungeeer_Facing)
endfunction

function Trig_Hungeeer_animation_Actions takes nothing returns nothing
  call SetUnitAnimation(udg_hungeeer_caster,"stand channel")
endfunction

function Trig_Hungeeer_move_2_Actions takes nothing returns nothing
  call SetUnitPositionLoc(udg_hungeeer_caster,PolarProjectionBJ(GetUnitLoc(udg_hungeeer_caster),-20.,GetUnitFacing(udg_hungeeer_caster)))
endfunction

function Trig_Hungeeer_target_die_Conditions takes nothing returns boolean
  return(GetDyingUnit()==udg_hungeeer_target)
endfunction

function Trig_Hungeeer_target_die_Actions takes nothing returns nothing
  call DisableTrigger(gg_trg_Hungeeer_move)
  call DisableTrigger(gg_trg_Hungeeer_animation)
  call UnitRemoveAbility(udg_hungeeer_caster,'A0JK')
  call EnableTrigger(gg_trg_Hungeeer_move_2)
  call TriggerSleepAction(.03)
  call DisableTrigger(gg_trg_Hungeeer_move_2)
  call SetUnitPathing(udg_hungeeer_caster,true)
endfunction

function Trig_Shen_daorong_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetEnteringUnit())=='n02D')
endfunction

function Trig_Shen_daorong_Actions takes nothing returns nothing
  set udg_Shen_daorong=GetEnteringUnit()
endfunction

function Trig_Shen_daorong_move_Actions takes nothing returns nothing
  call SetUnitPositionLocFacingBJ(udg_Shen_daorong,PolarProjectionBJ(GetUnitLoc(udg_Shen_daorong),10.,GetUnitFacing(udg_Shen_daorong)),(GetUnitFacing(udg_Shen_daorong)+10.))
endfunction

function Trig_Dragon_Rush_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0LE')
endfunction

function Trig_Dragon_Rush_Actions takes nothing returns nothing
  call TriggerSleepAction(.5)
  set udg_Dragon_Point=GetSpellTargetLoc()
  set udg_Dragon_rush_caster=GetSpellAbilityUnit()
  set udg_DragonRush_Position=GetUnitLoc(udg_Dragon_rush_caster)
  call ShowUnitHide(udg_Dragon_rush_caster)
  call PauseUnit(udg_Dragon_rush_caster,true)
  call CreateNUnitsAtLoc(1,'h00Y',GetOwningPlayer(udg_Dragon_rush_caster),udg_DragonRush_Position,GetUnitFacing(udg_Dragon_rush_caster))
  call UnitAddAbility(bj_lastCreatedUnit,'A0LG')
  call SetUnitAbilityLevelSwapped('A0LG',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0LE',udg_Dragon_rush_caster))
  call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852488,udg_DragonRush_Position)
  call CreateNUnitsAtLoc(1,'e01K',GetOwningPlayer(udg_Dragon_rush_caster),udg_DragonRush_Position,GetUnitFacing(udg_Dragon_rush_caster))
  set udg_DragonDummy=bj_lastCreatedUnit
  call SetUnitVertexColorBJ(udg_DragonDummy,'d','d','d',60.)
  call IssuePointOrderByIdLoc(udg_DragonDummy,851986,udg_Dragon_Point)
  call PolledWait((DistanceBetweenPoints(udg_DragonRush_Position,udg_Dragon_Point)/550.))
  call RemoveUnit(udg_DragonDummy)
  call SetUnitPositionLoc(udg_Dragon_rush_caster,udg_Dragon_Point)
  call CreateNUnitsAtLoc(1,'h00Y',GetOwningPlayer(udg_Dragon_rush_caster),udg_DragonRush_Position,GetUnitFacing(udg_Dragon_rush_caster))
  call UnitAddAbility(bj_lastCreatedUnit,'A0LG')
  call SetUnitAbilityLevelSwapped('A0LG',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0LE',udg_Dragon_rush_caster))
  call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852488,udg_DragonRush_Position)
  call ShowUnitShow(udg_Dragon_rush_caster)
  call PauseUnit(udg_Dragon_rush_caster,false)
  call SelectUnitForPlayerSingle(udg_Dragon_rush_caster,GetOwningPlayer(udg_Dragon_rush_caster))
  call RemoveLocation(udg_DragonRush_Position)
endfunction

constant function Strafe_Damage takes real level returns real
  return 175*level
endfunction

constant function Strafe_Range takes integer level returns real
  return 1.+.5*level
endfunction

constant function Strafe_MissileCount takes integer level returns integer
  return 1+2*level
endfunction

constant function Strafe_RelativeAngle takes integer level returns real
  return 18.-3.*level
endfunction

function Strafe_Conditions takes nothing returns boolean
  return GetSpellAbilityId()=='A0JD'
endfunction

function Strafe_End takes nothing returns nothing
  local unit m=GetAttachedUnit(GetTriggeringTrigger(),"missile")
  local unit u=GetAttachedUnit(GetTriggeringTrigger(),"caster")
  local integer level=GetUnitAbilityLevel(u,'A0JD')
  if GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE)>0 and IsUnitEnemy(GetTriggerUnit(),GetOwningPlayer(m)) then
    call KillUnit(m)
    call UnitDamageTarget(u,GetTriggerUnit(),Strafe_Damage(level),false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
    call DestroyTrigger(GetTriggeringTrigger())
  endif
  set m=null
  set u=null
endfunction

function Strafe_Path takes nothing returns nothing
  local unit u=GetAttachedUnit(GetTriggeringTrigger(),"caster")
  local integer level=GetUnitAbilityLevel(u,'A0JD')
  local integer i=1
  loop
    exitwhen i>Strafe_MissileCount(level)
    call MoveUnitToPolarProjection(udg_StrafeMissile[i],6.,udg_StrafeAngle[i])
    set i=i+1
  endloop
  set u=null
endfunction

function Strafe_Actions takes nothing returns nothing
  local trigger PathDamage=CreateTrigger()
  local trigger array Range
  local unit u=GetSpellAbilityUnit()
  local location l=GetSpellTargetLoc()
  local location l2=GetUnitLoc(u)
  local real a=AngleBetweenPoints(l2,l)
  local real x=GetUnitX(u)+50*Cos(a*.017453)
  local real y=GetUnitY(u)+50*Sin(a*.017453)
  local real z=57.29582*Atan2(GetLocationY(l)-y,GetLocationX(l)-x)
  local integer i=1
  local integer i2=0
  local integer level=GetUnitAbilityLevel(u,'A0JD')
  local player p=GetOwningPlayer(u)
  call AttachObject(PathDamage,"caster",u)
  call RemoveLocation(l)
  call RemoveLocation(l2)
  set l=null
  set l2=null
  loop
    exitwhen i>Strafe_MissileCount(level)
    set Range[i]=CreateTrigger()
    set i=i+1
  endloop
  set i=1
  call TriggerSleepAction(.3)
  set udg_StrafeMissile[1]=CreateUnit(p,'e01H',x,y,z)
  call SetUnitAnimation(udg_StrafeMissile[1],"birth")
  set udg_StrafeAngle[1]=z
  set i=i+1
  set i2=0
  loop
    exitwhen i>=Strafe_MissileCount(level)
    set udg_StrafeMissile[i]=CreateUnit(p,'e01H',x,y,z+(i2+1)*Strafe_RelativeAngle(level))
    set udg_StrafeAngle[i]=z+(i2+1)*Strafe_RelativeAngle(level)
    set i=i+1
    set udg_StrafeMissile[i]=CreateUnit(p,'e01H',x,y,z-(i2+1)*Strafe_RelativeAngle(level))
    set udg_StrafeAngle[i]=z-(i2+1)*Strafe_RelativeAngle(level)
    set i=i+1
    set i2=i2+1
  endloop
  call TriggerRegisterTimerEventPeriodic(PathDamage,.01)
  call TriggerAddAction(PathDamage,function Strafe_Path)
  set i=1
  loop
    exitwhen i>Strafe_MissileCount(level)
    call TriggerRegisterUnitInRangeSimple(Range[i],35,udg_StrafeMissile[i])
    call TriggerAddAction(Range[i],function Strafe_End)
    call AttachObject(Range[i],"missile",udg_StrafeMissile[i])
    call AttachObject(Range[i],"caster",u)
    set i=i+1
  endloop
  call TriggerSleepAction(Strafe_Range(level))
  set i=1
  loop
    exitwhen i>Strafe_MissileCount(level)
    call KillUnit(udg_StrafeMissile[i])
    call DestroyTrigger(Range[i])
    set i=i+1
  endloop
  call DestroyTrigger(PathDamage)
  set i=1
  call TriggerSleepAction(.33)
  set i=1
  loop
    exitwhen i>Strafe_MissileCount(level)
    call RemoveUnit(udg_StrafeMissile[i])
    set udg_StrafeMissile[i]=null
    set i=i+1
  endloop
  set p=null
  set u=null
endfunction

function Trig_Shot_animation_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0BI')
endfunction

function Trig_Shot_animation_Func001A takes nothing returns nothing
  call SetUnitAnimation(GetEnumUnit(),"Attack - 2")
endfunction

function Trig_Shot_animation_Actions takes nothing returns nothing
  call ForGroupBJ(GetUnitsOfTypeIdAll('N002'),function Trig_Shot_animation_Func001A)
endfunction

function Trig_Dragoon_Dynasty_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0J4')
endfunction

function Trig_Dragoon_Dynasty_Actions takes nothing returns nothing
  set udg_DragoonDynasty_Caster=GetUnitLoc(GetSpellAbilityUnit())
  set udg_Dynasty_Point=GetSpellTargetLoc()
  call CreateNUnitsAtLoc(1,'h01D',GetOwningPlayer(GetTriggerUnit()),udg_DragoonDynasty_Caster,bj_UNIT_FACING)
  set udg_Red_Dragon=bj_lastCreatedUnit
  call PolledWait(.5)
  call IssuePointOrderByIdLoc(bj_lastCreatedUnit,851986,udg_Dynasty_Point)
  call SetUnitAnimationWithRarity(bj_lastCreatedUnit,"Walk - 2",RARITY_RARE)
  call SetUnitFlyHeight(bj_lastCreatedUnit,.0,1200.)
  call PolledWait(.6)
  call AddSpecialEffectLocBJ(udg_Dynasty_Point,"Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call CreateNUnitsAtLoc(1,'h01C',GetOwningPlayer(GetTriggerUnit()),udg_Dynasty_Point,bj_UNIT_FACING)
  call IssueImmediateOrderById(bj_lastCreatedUnit,852526)
  call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852488,udg_Dynasty_Point)
  call UnitApplyTimedLifeBJ(10.,'BTLF',bj_lastCreatedUnit)
  call PolledWait(1.)
  call RemoveLocation(udg_Dynasty_Point)
  call RemoveLocation(udg_DragoonDynasty_Caster)
endfunction

function Trig_Shuriken_Points_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetTriggerUnit())=='H00B')and(GetIssuedOrderId()==852218)
endfunction

function Trig_Shuriken_Points_Actions takes nothing returns nothing
  set udg_Shuriken_Points=GetOrderPointLoc()
endfunction

function Trig_Shuriken_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0J0')
endfunction

function Trig_Shuriken_Actions takes nothing returns nothing
  set udg_MaskedCaster=GetTriggerUnit()
  set udg_MaskedCaster_Position=GetUnitLoc(udg_MaskedCaster)
  call ShowUnitHide(udg_MaskedCaster)
  call PauseUnit(udg_MaskedCaster,true)
  call CreateNUnitsAtLoc(1,'e01G',GetOwningPlayer(udg_MaskedCaster),udg_MaskedCaster_Position,GetUnitFacing(udg_MaskedCaster))
  set udg_Shuriken_Dummy=bj_lastCreatedUnit
  call SetUnitFlyHeight(udg_Shuriken_Dummy,100.,100.)
  call IssuePointOrderByIdLoc(udg_Shuriken_Dummy,851986,PolarProjectionBJ(udg_Shuriken_Points,1800.,GetUnitFacing(udg_MaskedCaster)))
  call PolledWait(6.)
  set udg_Shuriken_Position=GetUnitLoc(udg_Shuriken_Dummy)
  call SetUnitPositionLoc(udg_MaskedCaster,udg_Shuriken_Position)
  call RemoveUnit(udg_Shuriken_Dummy)
  call AddSpecialEffectLocBJ(udg_MaskedCaster_Position,"Abilities\\Spells\\Other\\Silence\\SilenceAreaBirth.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call ShowUnitShow(udg_MaskedCaster)
  call PauseUnit(udg_MaskedCaster,false)
  call RemoveLocation(udg_MaskedCaster_Position)
  call RemoveLocation(udg_Shuriken_Position)
endfunction

function Trig_Frozen_Field_Setup_Copy_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0JX')
endfunction

function Trig_Frozen_Field_Setup_Copy_Actions takes nothing returns nothing
  set udg_CasterHero_Frozen=GetSpellAbilityUnit()
  set udg_CasterPlayer_Frozen=GetOwningPlayer(GetTriggerUnit())
  set udg_CasterPosition_Frozen=GetUnitLoc(GetTriggerUnit())
  call EnableTrigger(gg_trg_Frozen_Field_I_Copy)
  call TriggerSleepAction(.1)
  call EnableTrigger(gg_trg_Frozen_Field_II_Copy)
  call TriggerSleepAction(16.)
  call DisableTrigger(gg_trg_Frozen_Field_I_Copy)
  call DisableTrigger(gg_trg_Frozen_Field_II_Copy)
endfunction

function Trig_Frozen_Field_I_Copy_Func002Func001Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0JX',udg_CasterHero_Frozen)==4)
endfunction

function Trig_Frozen_Field_I_Copy_Func002Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0JX',udg_CasterHero_Frozen)==3)
endfunction

function Trig_Frozen_Field_I_Copy_Func002Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0JX',udg_CasterHero_Frozen)==2)
endfunction

function Trig_Frozen_Field_I_Copy_Func002C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0JX',udg_CasterHero_Frozen)==1)
endfunction

function Trig_Frozen_Field_I_Copy_Actions takes nothing returns nothing
  call CreateNUnitsAtLoc(1,'u01E',udg_CasterPlayer_Frozen,PolarProjectionBJ(udg_CasterPosition_Frozen,GetRandomReal(450.,800.),GetRandomReal(0,360)),bj_UNIT_FACING)
  if(Trig_Frozen_Field_I_Copy_Func002C())then
    call UnitAddAbility(bj_lastCreatedUnit,'A0JY')
  else
    if(Trig_Frozen_Field_I_Copy_Func002Func001C())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0K1')
    else
      if(Trig_Frozen_Field_I_Copy_Func002Func001Func001C())then
        call UnitAddAbility(bj_lastCreatedUnit,'A0JZ')
      else
        if(Trig_Frozen_Field_I_Copy_Func002Func001Func001Func001C())then
          call UnitAddAbility(bj_lastCreatedUnit,'A0K0')
        endif
      endif
    endif
  endif
  set udg_IceCaster1=bj_lastCreatedUnit
  call IssueTargetOrderById(udg_IceCaster1,852226,udg_IceCaster1)
endfunction

function Trig_Frozen_Field_II_Copy_Func002Func001Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0JX',udg_CasterHero_Frozen)==4)
endfunction

function Trig_Frozen_Field_II_Copy_Func002Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0JX',udg_CasterHero_Frozen)==3)
endfunction

function Trig_Frozen_Field_II_Copy_Func002Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0JX',udg_CasterHero_Frozen)==2)
endfunction

function Trig_Frozen_Field_II_Copy_Func002C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0JX',udg_CasterHero_Frozen)==1)
endfunction

function Trig_Frozen_Field_II_Copy_Actions takes nothing returns nothing
  call CreateNUnitsAtLoc(1,'u01E',udg_CasterPlayer_Frozen,PolarProjectionBJ(udg_CasterPosition_Frozen,GetRandomReal(100.,450.),GetRandomReal(0,360)),bj_UNIT_FACING)
  if(Trig_Frozen_Field_II_Copy_Func002C())then
    call UnitAddAbility(bj_lastCreatedUnit,'A0JY')
  else
    if(Trig_Frozen_Field_II_Copy_Func002Func001C())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0K1')
    else
      if(Trig_Frozen_Field_II_Copy_Func002Func001Func001C())then
        call UnitAddAbility(bj_lastCreatedUnit,'A0JZ')
      else
        if(Trig_Frozen_Field_II_Copy_Func002Func001Func001Func001C())then
          call UnitAddAbility(bj_lastCreatedUnit,'A0K0')
        endif
      endif
    endif
  endif
  set udg_IceCaster2=bj_lastCreatedUnit
  call IssueTargetOrderById(udg_IceCaster2,852226,udg_IceCaster2)
endfunction

function Trig_If_Channelling_stops_Copy_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0JX')
endfunction

function Trig_If_Channelling_stops_Copy_Actions takes nothing returns nothing
  call DisableTrigger(gg_trg_Frozen_Field_I_Copy)
  call DisableTrigger(gg_trg_Frozen_Field_II_Copy)
endfunction

function Trig_Hydro_Pump_Setup_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0IN')
endfunction

function Trig_Hydro_Pump_Setup_Actions takes nothing returns nothing
  set udg_CasterHero=GetSpellAbilityUnit()
  set udg_CasterPlayer=GetOwningPlayer(GetTriggerUnit())
  set udg_CasterPosition=GetUnitLoc(GetTriggerUnit())
  call EnableTrigger(gg_trg_Hydro_Pump_I)
  call TriggerSleepAction(.1)
  call EnableTrigger(gg_trg_Hydro_Pump_II)
  call TriggerSleepAction(16.)
  call DisableTrigger(gg_trg_Hydro_Pump_I)
  call DisableTrigger(gg_trg_Hydro_Pump_II)
endfunction

function Trig_Hydro_Pump_I_Func002Func001Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0IN',udg_CasterHero)==4)
endfunction

function Trig_Hydro_Pump_I_Func002Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0IN',udg_CasterHero)==3)
endfunction

function Trig_Hydro_Pump_I_Func002Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0IN',udg_CasterHero)==2)
endfunction

function Trig_Hydro_Pump_I_Func002C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0IN',udg_CasterHero)==1)
endfunction

function Trig_Hydro_Pump_I_Actions takes nothing returns nothing
  call CreateNUnitsAtLoc(1,'u01D',udg_CasterPlayer,PolarProjectionBJ(udg_CasterPosition,GetRandomReal(450.,800.),GetRandomReal(0,360)),bj_UNIT_FACING)
  if(Trig_Hydro_Pump_I_Func002C())then
    call UnitAddAbility(bj_lastCreatedUnit,'A0IO')
  else
    if(Trig_Hydro_Pump_I_Func002Func001C())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0IQ')
    else
      if(Trig_Hydro_Pump_I_Func002Func001Func001C())then
        call UnitAddAbility(bj_lastCreatedUnit,'A0IP')
      else
        if(Trig_Hydro_Pump_I_Func002Func001Func001Func001C())then
          call UnitAddAbility(bj_lastCreatedUnit,'A0IR')
        endif
      endif
    endif
  endif
  set udg_HydroCaster1=bj_lastCreatedUnit
  call IssueTargetOrderById(udg_HydroCaster1,852226,udg_HydroCaster1)
endfunction

function Trig_Hydro_Pump_II_Func002Func001Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0IN',udg_CasterHero)==4)
endfunction

function Trig_Hydro_Pump_II_Func002Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0IN',udg_CasterHero)==3)
endfunction

function Trig_Hydro_Pump_II_Func002Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0IN',udg_CasterHero)==2)
endfunction

function Trig_Hydro_Pump_II_Func002C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0IN',udg_CasterHero)==1)
endfunction

function Trig_Hydro_Pump_II_Actions takes nothing returns nothing
  call CreateNUnitsAtLoc(1,'u01D',udg_CasterPlayer,PolarProjectionBJ(udg_CasterPosition,GetRandomReal(100.,450.),GetRandomReal(0,360)),bj_UNIT_FACING)
  if(Trig_Hydro_Pump_II_Func002C())then
    call UnitAddAbility(bj_lastCreatedUnit,'A0IO')
  else
    if(Trig_Hydro_Pump_II_Func002Func001C())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0IQ')
    else
      if(Trig_Hydro_Pump_II_Func002Func001Func001C())then
        call UnitAddAbility(bj_lastCreatedUnit,'A0IP')
      else
        if(Trig_Hydro_Pump_II_Func002Func001Func001Func001C())then
          call UnitAddAbility(bj_lastCreatedUnit,'A0IR')
        endif
      endif
    endif
  endif
  set udg_HydroCaster2=bj_lastCreatedUnit
  call IssueTargetOrderById(udg_HydroCaster2,852226,udg_HydroCaster2)
endfunction

function Trig_If_Channelling_stops_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0IN')
endfunction

function Trig_If_Channelling_stops_Actions takes nothing returns nothing
  call DisableTrigger(gg_trg_Hydro_Pump_I)
  call DisableTrigger(gg_trg_Hydro_Pump_II)
endfunction

function Trig_Frost_Wave_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0IL')
endfunction

function Trig_Frost_Wave_Func004Func013002003 takes nothing returns boolean
  return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction

function Trig_Frost_Wave_Func004Func014Func001Func001001 takes nothing returns boolean
  return(IsUnitDeadBJ(GetEnumUnit()))
endfunction

function Trig_Frost_Wave_Func004Func014Func001Func002001 takes nothing returns boolean
  return(IsUnitType(GetEnumUnit(),UNIT_TYPE_MECHANICAL)!=null)
endfunction

function Trig_Frost_Wave_Func004Func014Func001Func005001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0IL',GetTriggerUnit())==1)
endfunction

function Trig_Frost_Wave_Func004Func014Func001C takes nothing returns boolean
  return(UnitHasBuffBJ(GetEnumUnit(),'Bfro'))
endfunction

function Trig_Frost_Wave_Func004Func014A takes nothing returns nothing
  if(Trig_Frost_Wave_Func004Func014Func001C())then
  else
    if(Trig_Frost_Wave_Func004Func014Func001Func001001())then
      return
    endif
    if(Trig_Frost_Wave_Func004Func014Func001Func002001())then
      return
    endif
    call CreateNUnitsAtLoc(1,'h00Z',GetOwningPlayer(GetTriggerUnit()),udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],bj_UNIT_FACING)
    call UnitApplyTimedLifeBJ(1.,'BTLF',bj_lastCreatedUnit)
    if(Trig_Frost_Wave_Func004Func014Func001Func005001())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0IM')
    endif
    call IssueTargetOrderById(bj_lastCreatedUnit,852226,GetEnumUnit())
  endif
endfunction

function Trig_Frost_Wave_Actions takes nothing returns nothing
  call PolledWait(.1)
  set udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=GetUnitLoc(GetTriggerUnit())
  set udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=GetUnitFacing(GetTriggerUnit())
  set bj_forLoopAIndex=1
  set bj_forLoopAIndexEnd=7
  loop
    exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
    call DestroyEffect(udg_Effect1[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
    call DestroyEffect(udg_Effect2[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
    call DestroyEffect(udg_Effect3[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
    set udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=PolarProjectionBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],150.,udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
    call AddSpecialEffectLocBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],"Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl")
    set udg_Effect1[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedEffect
    call AddSpecialEffectLocBJ(PolarProjectionBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],100.,(udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+90.)),"Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl")
    set udg_Effect2[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedEffect
    call AddSpecialEffectLocBJ(PolarProjectionBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],100.,(udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+270.)),"Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl")
    set udg_Effect3[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedEffect
    set bj_wantDestroyGroup=true
    set udg_FrostWave_Group=GetUnitsInRangeOfLocMatching(250.,udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],Condition(function Trig_Frost_Wave_Func004Func013002003))
    call ForGroupBJ(udg_FrostWave_Group,function Trig_Frost_Wave_Func004Func014A)
    call PolledWait(.4)
    set bj_forLoopAIndex=bj_forLoopAIndex+1
  endloop
  call RemoveLocation(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
  call PolledWait(.4)
  call DestroyEffect(udg_Effect1[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
  call DestroyEffect(udg_Effect2[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
  call DestroyEffect(udg_Effect3[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction

function BoomerangH2I takes handle h returns integer
  local integer i = GetHandleId(h)
  if(i!=0)then
    return i
  endif
    return 0
endfunction

function BoomerangI2U takes integer i returns unit
  call SaveFogStateHandle(udg_typecasting,0,0,ConvertFogState(i))
  return (LoadUnitHandle(udg_typecasting,0,0))
endfunction

function BoomerangI2G takes integer i returns group
  call SaveFogStateHandle(udg_typecasting,0,0,ConvertFogState(i))
  return (LoadGroupHandle(udg_typecasting,0,0))
endfunction

function GetBoomerangAxesGameCache takes nothing returns gamecache
  return gg_trg_Boomerang_Axes
endfunction

function Initialize_BoomerangAxes_Variables takes nothing returns nothing
  local gamecache g=GetBoomerangAxesGameCache()
  local integer rBoomerangAxesAbility='A0I4'
  local real rBoomerangAxesAngle=18.
  local real rBoomerangAxesDistance=600.
  local real rBoomerangAxesRadius=300.
  local real rBoomerangAxesDamage=700.
  call StoreIntegerBJ(rBoomerangAxesAbility,"Ability","Ability",g)
  call StoreRealBJ(rBoomerangAxesAngle,"Angle","Angle",g)
  call StoreRealBJ(rBoomerangAxesDistance,"Distance","Distance",g)
  call StoreRealBJ(rBoomerangAxesRadius,"Radius","Radius",g)
  call StoreRealBJ(rBoomerangAxesDamage,"Damage","Damage",g)
endfunction

function BoomerangAxesAbility takes nothing returns integer
  return GetStoredInteger(GetBoomerangAxesGameCache(),"Ability","Ability")
endfunction

function BoomerangAxesAngle takes nothing returns real
  return GetStoredReal(GetBoomerangAxesGameCache(),"Angle","Angle")
endfunction

function BoomerangAxesDistance takes nothing returns real
  return GetStoredReal(GetBoomerangAxesGameCache(),"Distance","Distance")
endfunction

function BoomerangAxesRadius takes nothing returns real
  return GetStoredReal(GetBoomerangAxesGameCache(),"Radius","Radius")
endfunction

function BoomerangAxesDamage takes nothing returns real
  return GetStoredReal(GetBoomerangAxesGameCache(),"Damage","Damage")
endfunction

function GetBoomerangAxePoint takes string key,trigger t returns location
  local gamecache g=GetBoomerangAxesGameCache()
  return Location(GetStoredReal(g,key+"X",I2S(BoomerangH2I(t))),GetStoredReal(g,key+"Y",I2S(BoomerangH2I(t))))
endfunction

function BoomerandAbsoluteAngle takes real a returns real
  if(a<0)then
    return a+360
  endif
  return a
endfunction

function Trig_BoomerangAxeGroup takes nothing returns boolean
  local gamecache g=GetBoomerangAxesGameCache()
  local unit b=BoomerangI2U(GetStoredInteger(g,"ounit",I2S(BoomerangH2I(GetTriggeringTrigger()))))
  local unit u=GetFilterUnit()
  return(((IsUnitEnemy(u,GetOwningPlayer(b)))or(GetOwningPlayer(u)==Player(15)))and IsUnitAliveBJ(u))
endfunction

function Trig_BoomerangAxeDoodads takes nothing returns nothing
  local destructable d=GetEnumDestructable()
  if((GetDestructableLife(d)>0)and((GetDestructableTypeId(d)=='ATtr')or(GetDestructableTypeId(d)=='ATtc')or(GetDestructableTypeId(d)=='BTtw')or(GetDestructableTypeId(d)=='BTtc')or(GetDestructableTypeId(d)=='CTtr')or(GetDestructableTypeId(d)=='CTtc')or(GetDestructableTypeId(d)=='DTsh')or(GetDestructableTypeId(d)=='FTtw')or(GetDestructableTypeId(d)=='GTsh')or(GetDestructableTypeId(d)=='ITtw')or(GetDestructableTypeId(d)=='ITtc')or(GetDestructableTypeId(d)=='JTct')or(GetDestructableTypeId(d)=='JTtw')or(GetDestructableTypeId(d)=='KTtw')or(GetDestructableTypeId(d)=='LTlt')or(GetDestructableTypeId(d)=='NTtc')or(GetDestructableTypeId(d)=='NTtw')or(GetDestructableTypeId(d)=='OTtw')or(GetDestructableTypeId(d)=='VTlt')or(GetDestructableTypeId(d)=='WTst')or(GetDestructableTypeId(d)=='WTtw')or(GetDestructableTypeId(d)=='YTft')or(GetDestructableTypeId(d)=='YTst')or(GetDestructableTypeId(d)=='YTct')or(GetDestructableTypeId(d)=='YTwt')or(GetDestructableTypeId(d)=='ZTtw')or(GetDestructableTypeId(d)=='ZTtc')))then
    call KillDestructable(d)
  endif
endfunction

function BoomerangAxesTimer takes nothing returns nothing
  local trigger t=GetTriggeringTrigger()
  local string str=I2S(BoomerangH2I(t))
  local gamecache g=GetBoomerangAxesGameCache()
  local string str2=GetStoredString(g,"other",str)
  local integer dir=GetStoredInteger(g,"direction",str)
  local group grp=BoomerangI2G(GetStoredInteger(g,"group",str))
  local unit b=BoomerangI2U(GetStoredInteger(g,"unit",str))
  local unit ou=BoomerangI2U(GetStoredInteger(g,"ounit",str))
  local location ul=GetUnitLoc(b)
  local integer mo=GetStoredInteger(g,"mode",str)
  local location m=GetBoomerangAxePoint("",t)
  local location s=GetBoomerangAxePoint("s",t)
  local location t1=GetBoomerangAxePoint("t1",t)
  local location t2=GetBoomerangAxePoint("t2",t)
  local location o=GetBoomerangAxePoint("o",t)
  local real a=(360/(2*bj_PI*(BoomerangAxesRadius()/2)))*(30/2)
  local unit trg
  local group gr
  local real a1
  local real dist
  local boolean bool=false
  local location l
  local effect e
  if(mo==1)then
    if(DistanceBetweenPoints(ul,t1)-30>=0)then
      set dist=30
    else
      set dist=DistanceBetweenPoints(ul,t1)
      call StoreIntegerBJ(2,str,"mode",g)
    endif
    set l=PolarProjectionBJ(ul,dist,AngleBetweenPoints(ul,t1))
    call SetUnitPositionLoc(b,l)
  elseif(mo==2)then
    if(dir==1)then
      set a1=BoomerandAbsoluteAngle(AngleBetweenPoints(m,t2)+AngleBetweenPoints(m,t1))-BoomerandAbsoluteAngle(AngleBetweenPoints(m,ul)+a+AngleBetweenPoints(m,t1))
      set bool=(a1>=0)or((a1<-40)and(a1>-360))
    else
      set a1=BoomerandAbsoluteAngle(AngleBetweenPoints(m,t2)-AngleBetweenPoints(m,t1))-BoomerandAbsoluteAngle(AngleBetweenPoints(m,ul)-a-AngleBetweenPoints(m,t1))
      set bool=(a1<=0)or((a1>40)and(a1<360))
    endif
    if(bool)then
      if(dir==1)then
        set l=PolarProjectionBJ(m,BoomerangAxesRadius(),AngleBetweenPoints(m,ul)+a)
      else
        set l=PolarProjectionBJ(m,BoomerangAxesRadius(),AngleBetweenPoints(m,ul)-a)
      endif
    else
      set l=Location(GetLocationX(t2),GetLocationY(t2))
      call StoreIntegerBJ(3,str,"mode",g)
      call StoreIntegerBJ(3,str2,"mode",g)
    endif
    call SetUnitPositionLoc(b,l)
    set bool=false
  elseif(mo==3)then
    if(DistanceBetweenPoints(ul,o)-30>=0)then
      set dist=30
    else
      set bool=true
      set dist=DistanceBetweenPoints(ul,o)
    endif
    set l=PolarProjectionBJ(ul,dist,AngleBetweenPoints(ul,o))
    call SetUnitPositionLoc(b,l)
  endif
  set gr=GetUnitsInRangeOfLocMatching(80.,l,Condition(function Trig_BoomerangAxeGroup))
  loop
    set trg=GroupPickRandomUnit(gr)
    exitwhen trg==null
    if(IsUnitInGroup(trg,grp)==false)then
      call GroupAddUnit(grp,trg)
      call UnitDamageTargetBJ(b,trg,BoomerangAxesDamage(),ATTACK_TYPE_MELEE,DAMAGE_TYPE_NORMAL)
      call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageDeathCaster.mdl",l))
    endif
    call GroupRemoveUnit(gr,trg)
  endloop
  call RemoveLocation(ul)
  call DestroyGroup(gr)
  call EnumDestructablesInCircleBJ(80.,l,function Trig_BoomerangAxeDoodads)
  call RemoveLocation(l)
  if(bool)then
    call FlushStoredInteger(g,"mode",str)
    call FlushStoredInteger(g,"unit",str)
    call FlushStoredInteger(g,"ounit",str)
    call FlushStoredInteger(g,"direction",str)
    call FlushStoredInteger(g,"group",str)
    call FlushStoredString(g,"other",str)
    call FlushStoredReal(g,"X",str)
    call FlushStoredReal(g,"Y",str)
    call FlushStoredReal(g,"sX",str)
    call FlushStoredReal(g,"sY",str)
    call FlushStoredReal(g,"oX",str)
    call FlushStoredReal(g,"oY",str)
    call FlushStoredReal(g,"t1X",str)
    call FlushStoredReal(g,"t1Y",str)
    call FlushStoredReal(g,"t2X",str)
    call FlushStoredReal(g,"t2Y",str)
    call RemoveUnit(b)
    call PauseUnit(ou,false)
    call DestroyGroup(grp)
    call DestroyTimer(GetExpiredTimer())
    call DestroyTrigger(t)
  endif
endfunction

function Trig_Boomerang_Axes_Conditions takes nothing returns boolean
  return GetSpellAbilityId()==BoomerangAxesAbility()
endfunction

function StoreBoomerangAxePoint takes string s,string key,location l returns nothing
  local gamecache g=GetBoomerangAxesGameCache()
  call StoreRealBJ(GetLocationX(l),s,key+"X",g)
  call StoreRealBJ(GetLocationY(l),s,key+"Y",g)
endfunction

function Trig_Boomerang_Axes_Actions takes nothing returns nothing
  local unit u=GetSpellAbilityUnit()
  local location pos=GetUnitLoc(u)
  local timer t1=CreateTimer()
  local timer t2=CreateTimer()
  local trigger tr1=CreateTrigger()
  local trigger tr2=CreateTrigger()
  local gamecache g=GetBoomerangAxesGameCache()
  local integer i=1
  local unit array b
  local location array l
  set l[1]=PolarProjectionBJ(pos,80.,GetUnitFacing(u)-35)
  set l[2]=PolarProjectionBJ(pos,80.,GetUnitFacing(u)+35)
  set l[3]=PolarProjectionBJ(pos,BoomerangAxesDistance(),GetUnitFacing(u)-BoomerangAxesAngle())
  set l[4]=PolarProjectionBJ(pos,BoomerangAxesDistance(),GetUnitFacing(u)+BoomerangAxesAngle())
  set l[5]=PolarProjectionBJ(l[3],BoomerangAxesRadius(),GetUnitFacing(u)-90)
  set l[6]=PolarProjectionBJ(l[3],BoomerangAxesRadius(),GetUnitFacing(u)+90)
  set l[7]=PolarProjectionBJ(l[4],BoomerangAxesRadius(),GetUnitFacing(u)-90)
  set l[8]=PolarProjectionBJ(l[4],BoomerangAxesRadius(),GetUnitFacing(u)+90)
  set l[9]=PolarProjectionBJ(l[3],BoomerangAxesRadius(),GetUnitFacing(u)-90-(AngleBetweenPoints(pos,l[3])-AngleBetweenPoints(pos,l[5])))
  set l[10]=PolarProjectionBJ(l[3],BoomerangAxesRadius(),GetUnitFacing(u)+90+(AngleBetweenPoints(pos,l[3])-AngleBetweenPoints(pos,l[5])))
  set l[11]=PolarProjectionBJ(l[4],BoomerangAxesRadius(),GetUnitFacing(u)-90-(AngleBetweenPoints(pos,l[3])-AngleBetweenPoints(pos,l[5])))
  set l[12]=PolarProjectionBJ(l[4],BoomerangAxesRadius(),GetUnitFacing(u)+90+(AngleBetweenPoints(pos,l[3])-AngleBetweenPoints(pos,l[5])))
  set b[1]=CreateUnitAtLoc(GetOwningPlayer(u),'e01B',l[1],0)
  set b[2]=CreateUnitAtLoc(GetOwningPlayer(u),'e01C',l[2],0)
  call TriggerRegisterTimerExpireEvent(tr1,t1)
  call TriggerRegisterTimerExpireEvent(tr2,t2)
  call TriggerAddAction(tr1,function BoomerangAxesTimer)
  call TriggerAddAction(tr2,function BoomerangAxesTimer)
  call StoreIntegerBJ(1,I2S(BoomerangH2I(tr1)),"direction",g)
  call StoreIntegerBJ(0,I2S(BoomerangH2I(tr2)),"direction",g)
  call StoreIntegerBJ(BoomerangH2I(b[1]),I2S(BoomerangH2I(tr1)),"unit",g)
  call StoreIntegerBJ(BoomerangH2I(b[2]),I2S(BoomerangH2I(tr2)),"unit",g)
  call StoreIntegerBJ(BoomerangH2I(u),I2S(BoomerangH2I(tr1)),"ounit",g)
  call StoreIntegerBJ(BoomerangH2I(u),I2S(BoomerangH2I(tr2)),"ounit",g)
  call StoreIntegerBJ(BoomerangH2I(CreateGroup()),I2S(BoomerangH2I(tr1)),"group",g)
  call StoreIntegerBJ(BoomerangH2I(CreateGroup()),I2S(BoomerangH2I(tr2)),"group",g)
  call StoreIntegerBJ(1,I2S(BoomerangH2I(tr1)),"mode",g)
  call StoreIntegerBJ(1,I2S(BoomerangH2I(tr2)),"mode",g)
  call StoreStringBJ(I2S(BoomerangH2I(tr2)),I2S(BoomerangH2I(tr1)),"other",g)
  call StoreStringBJ(I2S(BoomerangH2I(tr1)),I2S(BoomerangH2I(tr2)),"other",g)
  call StoreBoomerangAxePoint(I2S(BoomerangH2I(tr1)),"s",pos)
  call StoreBoomerangAxePoint(I2S(BoomerangH2I(tr2)),"s",pos)
  call StoreBoomerangAxePoint(I2S(BoomerangH2I(tr1)),"o",l[2])
  call StoreBoomerangAxePoint(I2S(BoomerangH2I(tr2)),"o",l[1])
  call StoreBoomerangAxePoint(I2S(BoomerangH2I(tr1)),"",l[3])
  call StoreBoomerangAxePoint(I2S(BoomerangH2I(tr2)),"",l[4])
  call StoreBoomerangAxePoint(I2S(BoomerangH2I(tr1)),"t1",l[9])
  call StoreBoomerangAxePoint(I2S(BoomerangH2I(tr2)),"t2",l[11])
  call StoreBoomerangAxePoint(I2S(BoomerangH2I(tr1)),"t2",l[10])
  call StoreBoomerangAxePoint(I2S(BoomerangH2I(tr2)),"t1",l[12])
  call StartTimerBJ(t1,true,.03)
  call StartTimerBJ(t2,true,.03)
  call RemoveLocation(pos)
  loop
    exitwhen i>12
    call RemoveLocation(l[i])
    set i=i+1
  endloop
  call TriggerSleepAction(.0)
  call PauseUnit(u,true)
endfunction

function Trig_NonChannel_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A02J')
endfunction

function Trig_NonChannel_Func002Func001Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A02J',GetSpellAbilityUnit())==4)
endfunction

function Trig_NonChannel_Func002Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A02J',GetSpellAbilityUnit())==3)
endfunction

function Trig_NonChannel_Func002Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A02J',GetSpellAbilityUnit())==2)
endfunction

function Trig_NonChannel_Func002C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A02J',GetSpellAbilityUnit())==1)
endfunction

function Trig_NonChannel_Actions takes nothing returns nothing
  set udg_FallingRocks_Caster=GetUnitLoc(GetSpellAbilityUnit())
  if(Trig_NonChannel_Func002C())then
    call CreateNUnitsAtLoc(1,'h015',GetOwningPlayer(GetSpellAbilityUnit()),udg_FallingRocks_Caster,bj_UNIT_FACING)
    call UnitAddAbility(bj_lastCreatedUnit,'A0I2')
    call IssueImmediateOrderById(bj_lastCreatedUnit,852183)
    call TriggerSleepAction(11.)
    call RemoveUnit(bj_lastCreatedUnit)
  else
    if(Trig_NonChannel_Func002Func001C())then
      call CreateNUnitsAtLoc(1,'h015',GetOwningPlayer(GetSpellAbilityUnit()),udg_FallingRocks_Caster,bj_UNIT_FACING)
      call UnitAddAbility(bj_lastCreatedUnit,'A0I3')
      call IssueImmediateOrderById(bj_lastCreatedUnit,852183)
      call TriggerSleepAction(11.)
      call RemoveUnit(bj_lastCreatedUnit)
    else
      if(Trig_NonChannel_Func002Func001Func001C())then
        call CreateNUnitsAtLoc(1,'h015',GetOwningPlayer(GetSpellAbilityUnit()),udg_FallingRocks_Caster,bj_UNIT_FACING)
        call UnitAddAbility(bj_lastCreatedUnit,'A0I1')
        call IssueImmediateOrderById(bj_lastCreatedUnit,852183)
        call TriggerSleepAction(11.)
        call RemoveUnit(bj_lastCreatedUnit)
      else
        if(Trig_NonChannel_Func002Func001Func001Func001C())then
          call CreateNUnitsAtLoc(1,'h015',GetOwningPlayer(GetSpellAbilityUnit()),udg_FallingRocks_Caster,bj_UNIT_FACING)
          call UnitAddAbility(bj_lastCreatedUnit,'A0I0')
          call IssueImmediateOrderById(bj_lastCreatedUnit,852183)
          call TriggerSleepAction(11.)
          call RemoveUnit(bj_lastCreatedUnit)
        endif
      endif
    endif
  endif
  call RemoveLocation(udg_FallingRocks_Caster)
endfunction

function Trig_Uppercut_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0I6')
endfunction

function Trig_Uppercut_Func023Func001Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0I6',GetSpellAbilityUnit())==4)
endfunction

function Trig_Uppercut_Func023Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0I6',GetSpellAbilityUnit())==3)
endfunction

function Trig_Uppercut_Func023Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0I6',GetSpellAbilityUnit())==2)
endfunction

function Trig_Uppercut_Func023C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0I6',GetSpellAbilityUnit())==1)
endfunction

function Trig_Uppercut_Actions takes nothing returns nothing
  set udg_Uppercut_Unit=GetSpellTargetUnit()
  set udg_UppercutUnit_Position=GetUnitLoc(udg_Uppercut_Unit)
  call UnitAddAbility(udg_Uppercut_Unit,'A0HY')
  call UnitRemoveAbility(udg_Uppercut_Unit,'A0HY')
  call AddSpecialEffectTargetUnitBJ("chest",udg_Uppercut_Unit,"Abilities\\Spells\\Items\\AIda\\AIdaCaster.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call SetUnitFlyHeight(udg_Uppercut_Unit,700.,700.)
  call PlaySoundOnUnitBJ(gg_snd_CrippleTarget1,'d',udg_Uppercut_Unit)
  call SetUnitInvulnerable(udg_Uppercut_Unit,true)
  call PauseUnit(udg_Uppercut_Unit,true)
  call SetUnitPathing(udg_Uppercut_Unit,false)
  call PolledWait(1.)
  call SetUnitFlyHeight(udg_Uppercut_Unit,.0,700.)
  call DestroyEffect(bj_lastCreatedEffect)
  call PolledWait(.9)
  call SetUnitInvulnerable(udg_Uppercut_Unit,false)
  call PauseUnit(udg_Uppercut_Unit,false)
  call SetUnitPathing(udg_Uppercut_Unit,true)
  call AddSpecialEffectLocBJ(udg_UppercutUnit_Position,"Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call TerrainDeformationRippleBJ(2.,false,udg_UppercutUnit_Position,50.,200.,50.,1,512)
  set udg_Uppercut_Point=GetUnitLoc(udg_Uppercut_Unit)
  if(Trig_Uppercut_Func023C())then
    call CreateNUnitsAtLoc(1,'h019',GetOwningPlayer(GetTriggerUnit()),udg_Uppercut_Point,bj_UNIT_FACING)
    call UnitAddAbility(bj_lastCreatedUnit,'A0I7')
    call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
    call IssueImmediateOrderById(bj_lastCreatedUnit,852096)
    call RemoveLocation(udg_Uppercut_Point)
  else
    if(Trig_Uppercut_Func023Func001C())then
      call CreateNUnitsAtLoc(1,'h019',GetOwningPlayer(GetTriggerUnit()),udg_Uppercut_Point,bj_UNIT_FACING)
      call UnitAddAbility(bj_lastCreatedUnit,'A0I8')
      call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
      call IssueImmediateOrderById(bj_lastCreatedUnit,852096)
      call RemoveLocation(udg_Uppercut_Point)
    else
      if(Trig_Uppercut_Func023Func001Func001C())then
        call CreateNUnitsAtLoc(1,'h019',GetOwningPlayer(GetTriggerUnit()),udg_Uppercut_Point,bj_UNIT_FACING)
        call UnitAddAbility(bj_lastCreatedUnit,'A0I9')
        call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
        call IssueImmediateOrderById(bj_lastCreatedUnit,852096)
        call RemoveLocation(udg_Uppercut_Point)
      else
        if(Trig_Uppercut_Func023Func001Func001Func001C())then
          call CreateNUnitsAtLoc(1,'h019',GetOwningPlayer(GetTriggerUnit()),udg_Uppercut_Point,bj_UNIT_FACING)
          call UnitAddAbility(bj_lastCreatedUnit,'A0IA')
          call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
          call IssueImmediateOrderById(bj_lastCreatedUnit,852096)
          call RemoveLocation(udg_Uppercut_Point)
        endif
      endif
    endif
  endif
  call RemoveLocation(udg_UppercutUnit_Position)
endfunction

function Trig_Poseidons_Wrath_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0HX')
endfunction

function Trig_Poseidons_Wrath_Func019001003001 takes nothing returns boolean
  return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(udg_Poseidon_Caster)))
endfunction

function Trig_Poseidons_Wrath_Func019001003002001 takes nothing returns boolean
  return(IsUnitType(GetFilterUnit(),UNIT_TYPE_FLYING)==false)
endfunction

function Trig_Poseidons_Wrath_Func019001003002002001 takes nothing returns boolean
  return(IsUnitDeadBJ(GetFilterUnit())==false)
endfunction

function Trig_Poseidons_Wrath_Func019001003002002002 takes nothing returns boolean
  return(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false)
endfunction

function Trig_Poseidons_Wrath_Func019001003002002 takes nothing returns boolean
  return GetBooleanAnd(Trig_Poseidons_Wrath_Func019001003002002001(),Trig_Poseidons_Wrath_Func019001003002002002())
endfunction

function Trig_Poseidons_Wrath_Func019001003002 takes nothing returns boolean
  return GetBooleanAnd(Trig_Poseidons_Wrath_Func019001003002001(),Trig_Poseidons_Wrath_Func019001003002002())
endfunction

function Trig_Poseidons_Wrath_Func019001003 takes nothing returns boolean
  return GetBooleanAnd(Trig_Poseidons_Wrath_Func019001003001(),Trig_Poseidons_Wrath_Func019001003002())
endfunction

function Trig_Poseidons_Wrath_Func021A takes nothing returns nothing
  call UnitAddAbility(GetEnumUnit(),'A0HY')
  call UnitRemoveAbility(GetEnumUnit(),'A0HY')
  call SetUnitFlyHeight(GetEnumUnit(),2000.,2000.)
  call SetUnitInvulnerable(GetEnumUnit(),true)
  call PauseUnit(GetEnumUnit(),true)
  call SetUnitPathing(GetEnumUnit(),false)
endfunction

function Trig_Poseidons_Wrath_Func024A takes nothing returns nothing
  call SetUnitFlyHeight(GetEnumUnit(),.0,2000.)
endfunction

function Trig_Poseidons_Wrath_Func027A takes nothing returns nothing
  call SetUnitInvulnerable(GetEnumUnit(),false)
  call PauseUnit(GetEnumUnit(),false)
  call SetUnitPathing(GetEnumUnit(),true)
  call AddSpecialEffectLocBJ(GetUnitLoc(GetEnumUnit()),"Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call TerrainDeformationRippleBJ(2.,false,GetUnitLoc(GetEnumUnit()),200.,200.,50.,1,512)
  set udg_Poseidon_Point=GetUnitLoc(GetEnumUnit())
  call CreateNUnitsAtLoc(1,'h017',GetOwningPlayer(GetTriggerUnit()),udg_Poseidon_Point,bj_UNIT_FACING)
  call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
  call IssueImmediateOrderById(bj_lastCreatedUnit,852096)
  call GroupRemoveUnit(udg_Poseidon_Group,GetEnumUnit())
  call RemoveLocation(udg_Poseidon_Point)
endfunction

function Trig_Poseidons_Wrath_Actions takes nothing returns nothing
  set udg_Poseidon_Caster=GetSpellAbilityUnit()
  set udg_Poseidon_Surface_Unit=GetSpellTargetUnit()
  call ShowUnitHide(udg_Poseidon_Caster)
  call AddSpecialEffectLocBJ(GetUnitLoc(GetSpellAbilityUnit()),"Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call TerrainDeformationRippleBJ(2.,false,GetUnitLoc(GetSpellAbilityUnit()),300.,300.,50.,1,512)
  call PolledWait(2.75)
  call CreateNUnitsAtLoc(1,'h018',GetOwningPlayer(udg_Poseidon_Caster),GetUnitLoc(udg_Poseidon_Surface_Unit),270.)
  call PolledWait(.25)
  call SetUnitPositionLoc(udg_Poseidon_Caster,GetUnitLoc(udg_Poseidon_Surface_Unit))
  call ShowUnitShow(udg_Poseidon_Caster)
  call SetUnitAnimation(udg_Poseidon_Caster,"morph swim alternate")
  call SelectUnitAddForPlayer(udg_Poseidon_Caster,GetOwningPlayer(GetTriggerUnit()))
  set bj_forLoopAIndex=1
  set bj_forLoopAIndexEnd=20
  loop
    exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
    call AddSpecialEffectLocBJ(PolarProjectionBJ(GetUnitLoc(udg_Poseidon_Caster),GetRandomReal(100.,500.),GetRandomReal(0,360)),"Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl")
    set bj_forLoopAIndex=bj_forLoopAIndex+1
  endloop
  call GroupAddGroup(GetUnitsInRangeOfLocMatching(500.,GetUnitLoc(udg_Poseidon_Caster),Condition(function Trig_Poseidons_Wrath_Func019001003)),udg_Poseidon_Group)
  call ForGroupBJ(udg_Poseidon_Group,function Trig_Poseidons_Wrath_Func021A)
  call PolledWait(2)
  call ForGroupBJ(udg_Poseidon_Group,function Trig_Poseidons_Wrath_Func024A)
  call PolledWait(.9)
  call ForGroupBJ(udg_Poseidon_Group,function Trig_Poseidons_Wrath_Func027A)
endfunction

function Trig_Poseidon_Effects_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetTriggerUnit())=='h018')
endfunction

function Trig_Poseidon_Effects_Actions takes nothing returns nothing
  call SetUnitVertexColorBJ(GetTriggerUnit(),20.,'d','d',65.)
  call SetUnitAnimation(GetTriggerUnit(),"attack slam")
  call AddSpecialEffectTargetUnitBJ("weapon",GetTriggerUnit(),"Abilities\\Weapons\\WaterElementalMissile\\WaterElementalMissile.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("hand right",GetTriggerUnit(),"Abilities\\Weapons\\WaterElementalMissile\\WaterElementalMissile.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("hand left",GetTriggerUnit(),"Abilities\\Weapons\\WaterElementalMissile\\WaterElementalMissile.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call PolledWait(1.25)
  call RemoveUnit(GetTriggerUnit())
endfunction

function Trig_Tidal_Wave_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0HW')
endfunction

function Trig_Tidal_Wave_Func005Func019001003 takes nothing returns boolean
  return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction

function Trig_Tidal_Wave_Func005Func019Func001001 takes nothing returns boolean
  return(IsUnitDeadBJ(GetEnumUnit()))
endfunction

function Trig_Tidal_Wave_Func005Func019Func002001 takes nothing returns boolean
  return(IsUnitType(GetEnumUnit(),UNIT_TYPE_MECHANICAL)!=null)
endfunction

function Trig_Tidal_Wave_Func005Func019A takes nothing returns nothing
  if(Trig_Tidal_Wave_Func005Func019Func001001())then
    return
  endif
  if(Trig_Tidal_Wave_Func005Func019Func002001())then
    return
  endif
  call SetUnitPositionLoc(GetEnumUnit(),PolarProjectionBJ(GetUnitLoc(GetEnumUnit()),75.,udg_Wave_Angle))
  call UnitDamageTargetBJ(GetTriggerUnit(),GetEnumUnit(),(45.*I2R(GetUnitAbilityLevelSwapped('A0HW',GetTriggerUnit()))),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
endfunction

function Trig_Tidal_Wave_Actions takes nothing returns nothing
  call PolledWait(.1)
  set udg_Wave_Point=GetUnitLoc(GetTriggerUnit())
  set udg_Wave_Angle=GetUnitFacing(GetTriggerUnit())
  set bj_forLoopAIndex=1
  set bj_forLoopAIndexEnd=7
  loop
    exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
    call DestroyEffect(udg_Effect01)
    call DestroyEffect(udg_Effect02)
    call DestroyEffect(udg_Effect03)
    set udg_Wave_Point=PolarProjectionBJ(udg_Wave_Point,125.,udg_Wave_Angle)
    call AddSpecialEffectLocBJ(udg_Wave_Point,"Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl")
    call DestroyEffect(bj_lastCreatedEffect)
    set udg_Effect01=bj_lastCreatedEffect
    call AddSpecialEffectLocBJ(udg_Wave_Point,"Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl")
    call DestroyEffect(bj_lastCreatedEffect)
    set udg_Effect02=bj_lastCreatedEffect
    call AddSpecialEffectLocBJ(udg_Wave_Point,"Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl")
    call DestroyEffect(bj_lastCreatedEffect)
    set udg_Effect03=bj_lastCreatedEffect
    set bj_wantDestroyGroup=true
    call ForGroupBJ(GetUnitsInRangeOfLocMatching(225.,udg_Wave_Point,Condition(function Trig_Tidal_Wave_Func005Func019001003)),function Trig_Tidal_Wave_Func005Func019A)
    call PolledWait(.2)
    set bj_forLoopAIndex=bj_forLoopAIndex+1
  endloop
  call RemoveLocation(udg_Wave_Point)
  call PolledWait(.2)
  call DestroyEffect(udg_Effect01)
  call DestroyEffect(udg_Effect02)
  call DestroyEffect(udg_Effect03)
endfunction

function Trig_Wolf_Fist_Points_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetTriggerUnit())=='O00M')and(GetIssuedOrderId()==852218)
endfunction

function Trig_Wolf_Fist_Points_Actions takes nothing returns nothing
  set udg_Wolf_Points=GetOrderPointLoc()
endfunction

function Trig_Wolf_Fang_Fist_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0HG')
endfunction

function Trig_Wolf_Fang_Fist_Func008Func006001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0HG',udg_Orc_Slave)==1)
endfunction

function Trig_Wolf_Fang_Fist_Func008Func007001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0HG',udg_Orc_Slave)==2)
endfunction

function Trig_Wolf_Fang_Fist_Func008Func008001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0HG',udg_Orc_Slave)==3)
endfunction

function Trig_Wolf_Fang_Fist_Func008Func009001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0HG',udg_Orc_Slave)==4)
endfunction

function Trig_Wolf_Fang_Fist_Actions takes nothing returns nothing
  call SetUnitAnimation(udg_Orc_Slave,"Attack - 2")
  set udg_Orc_Slave=GetTriggerUnit()
  set udg_Orc_Slave_Position=GetUnitLoc(udg_Orc_Slave)
  call CreateNUnitsAtLoc(1,'e019',GetOwningPlayer(udg_Orc_Slave),udg_Orc_Slave_Position,GetUnitFacing(udg_Orc_Slave))
  set udg_Wolf_Dummy=bj_lastCreatedUnit
  call IssuePointOrderByIdLoc(udg_Wolf_Dummy,851986,PolarProjectionBJ(udg_Wolf_Points,2000.,GetUnitFacing(udg_Orc_Slave)))
  call SetUnitVertexColorBJ(udg_Wolf_Dummy,'d',30.,30.,60.)
  set bj_forLoopAIndex=1
  set bj_forLoopAIndexEnd=10
  loop
    exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
    set udg_Wolf_Dummy_Position=GetUnitLoc(udg_Wolf_Dummy)
    call CreateNUnitsAtLoc(1,'e01A',GetOwningPlayer(udg_Orc_Slave),udg_Wolf_Dummy_Position,bj_UNIT_FACING)
    call AddSpecialEffectLocBJ(udg_Wolf_Dummy_Position,"Abilities\\Spells\\Human\\FlameStrike\\FlameStrike1.mdl")
    call PlaySoundOnUnitBJ(gg_snd_SpiritWolfYesAttack3,'d',bj_lastCreatedUnit)
    call UnitApplyTimedLifeBJ(5.,'BTLF',bj_lastCreatedUnit)
    if(Trig_Wolf_Fang_Fist_Func008Func006001())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0HK')
    endif
    if(Trig_Wolf_Fang_Fist_Func008Func007001())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0HJ')
    endif
    if(Trig_Wolf_Fang_Fist_Func008Func008001())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0HI')
    endif
    if(Trig_Wolf_Fang_Fist_Func008Func009001())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0HH')
    endif
    call TriggerSleepAction(.5)
    set bj_forLoopAIndex=bj_forLoopAIndex+1
  endloop
  call RemoveUnit(udg_Wolf_Dummy)
  call RemoveLocation(udg_Orc_Slave_Position)
  call RemoveLocation(udg_Wolf_Dummy_Position)
endfunction

function Trig_Tsunami_Non_Channel_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0HO')and(GetUnitTypeId(GetSpellAbilityUnit())=='O01E')
endfunction

function Trig_Tsunami_Non_Channel_Func002Func001Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0HO',GetSpellAbilityUnit())==4)
endfunction

function Trig_Tsunami_Non_Channel_Func002Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0HO',GetSpellAbilityUnit())==3)
endfunction

function Trig_Tsunami_Non_Channel_Func002Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0HO',GetSpellAbilityUnit())==2)
endfunction

function Trig_Tsunami_Non_Channel_Func002C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0HO',GetSpellAbilityUnit())==1)
endfunction

function Trig_Tsunami_Non_Channel_Actions takes nothing returns nothing
  set udg_Tsunami_NonChannel=GetUnitLoc(GetSpellAbilityUnit())
  if(Trig_Tsunami_Non_Channel_Func002C())then
    call CreateNUnitsAtLoc(1,'h015',GetOwningPlayer(GetSpellAbilityUnit()),udg_Tsunami_NonChannel,bj_UNIT_FACING)
    call UnitAddAbility(bj_lastCreatedUnit,'A0HS')
    call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852593,GetSpellTargetLoc())
    call TriggerSleepAction(10.)
    call RemoveUnit(bj_lastCreatedUnit)
  else
    if(Trig_Tsunami_Non_Channel_Func002Func001C())then
      call CreateNUnitsAtLoc(1,'h015',GetOwningPlayer(GetSpellAbilityUnit()),udg_Tsunami_NonChannel,bj_UNIT_FACING)
      call UnitAddAbility(bj_lastCreatedUnit,'A0HR')
      call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852593,GetSpellTargetLoc())
      call TriggerSleepAction(10.)
      call RemoveUnit(bj_lastCreatedUnit)
    else
      if(Trig_Tsunami_Non_Channel_Func002Func001Func001C())then
        call CreateNUnitsAtLoc(1,'h015',GetOwningPlayer(GetSpellAbilityUnit()),udg_Tsunami_NonChannel,bj_UNIT_FACING)
        call UnitAddAbility(bj_lastCreatedUnit,'A0HQ')
        call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852593,GetSpellTargetLoc())
        call TriggerSleepAction(10.)
        call RemoveUnit(bj_lastCreatedUnit)
      else
        if(Trig_Tsunami_Non_Channel_Func002Func001Func001Func001C())then
          call CreateNUnitsAtLoc(1,'h015',GetOwningPlayer(GetSpellAbilityUnit()),udg_Tsunami_NonChannel,bj_UNIT_FACING)
          call UnitAddAbility(bj_lastCreatedUnit,'A0HT')
          call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852593,GetSpellTargetLoc())
          call TriggerSleepAction(10.)
          call RemoveUnit(bj_lastCreatedUnit)
        endif
      endif
    endif
  endif
  call RemoveLocation(udg_Tsunami_NonChannel)
endfunction

function Trig_Freeze_Explosion_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetDyingUnit())=='n01A')
endfunction

function Trig_Freeze_Explosion_Func001Func001Func001001 takes nothing returns boolean
  return(IsUnitDeadBJ(GetEnumUnit()))
endfunction

function Trig_Freeze_Explosion_Func001Func001Func002001 takes nothing returns boolean
  return(IsUnitType(GetEnumUnit(),UNIT_TYPE_MECHANICAL)!=null)
endfunction

function Trig_Freeze_Explosion_Func001Func001C takes nothing returns boolean
  return(UnitHasBuffBJ(GetEnumUnit(),'Bfro'))
endfunction

function Trig_Freeze_Explosion_Func001A takes nothing returns nothing
  if(Trig_Freeze_Explosion_Func001Func001C())then
  else
    if(Trig_Freeze_Explosion_Func001Func001Func001001())then
      return
    endif
    if(Trig_Freeze_Explosion_Func001Func001Func002001())then
      return
    endif
    call CreateNUnitsAtLoc(1,'h016',GetOwningPlayer(GetDyingUnit()),GetUnitLoc(GetDyingUnit()),bj_UNIT_FACING)
    call UnitApplyTimedLifeBJ(1000000000.,'BTLF',bj_lastCreatedUnit)
    call IssueTargetOrderById(bj_lastCreatedUnit,852226,GetEnumUnit())
  endif
endfunction

function Trig_Freeze_Explosion_Actions takes nothing returns nothing
  call ForGroupBJ(GetUnitsInRangeOfLocAll(500.,GetUnitLoc(GetDyingUnit())),function Trig_Freeze_Explosion_Func001A)
endfunction

function Trig_Freeze_Explosion_Copy_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetDyingUnit())=='n01F')
endfunction

function Trig_Freeze_Explosion_Copy_Func001Func001Func001001 takes nothing returns boolean
  return(IsUnitDeadBJ(GetEnumUnit()))
endfunction

function Trig_Freeze_Explosion_Copy_Func001Func001Func002001 takes nothing returns boolean
  return(IsUnitType(GetEnumUnit(),UNIT_TYPE_MECHANICAL)!=null)
endfunction

function Trig_Freeze_Explosion_Copy_Func001Func001C takes nothing returns boolean
  return(UnitHasBuffBJ(GetEnumUnit(),'Bfro'))
endfunction

function Trig_Freeze_Explosion_Copy_Func001A takes nothing returns nothing
  if(Trig_Freeze_Explosion_Copy_Func001Func001C())then
  else
    if(Trig_Freeze_Explosion_Copy_Func001Func001Func001001())then
      return
    endif
    if(Trig_Freeze_Explosion_Copy_Func001Func001Func002001())then
      return
    endif
    call CreateNUnitsAtLoc(1,'h016',GetOwningPlayer(GetDyingUnit()),GetUnitLoc(GetDyingUnit()),bj_UNIT_FACING)
    call UnitApplyTimedLifeBJ(1000000000.,'BTLF',bj_lastCreatedUnit)
    call IssueTargetOrderById(bj_lastCreatedUnit,852226,GetEnumUnit())
  endif
endfunction

function Trig_Freeze_Explosion_Copy_Actions takes nothing returns nothing
  call ForGroupBJ(GetUnitsInRangeOfLocAll(500.,GetUnitLoc(GetDyingUnit())),function Trig_Freeze_Explosion_Copy_Func001A)
endfunction

function Trig_Freeze_Explosion_Copy_2_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetDyingUnit())=='n01G')
endfunction

function Trig_Freeze_Explosion_Copy_2_Func001Func001Func001001 takes nothing returns boolean
  return(IsUnitDeadBJ(GetEnumUnit()))
endfunction

function Trig_Freeze_Explosion_Copy_2_Func001Func001Func002001 takes nothing returns boolean
  return(IsUnitType(GetEnumUnit(),UNIT_TYPE_MECHANICAL)!=null)
endfunction

function Trig_Freeze_Explosion_Copy_2_Func001Func001C takes nothing returns boolean
  return(UnitHasBuffBJ(GetEnumUnit(),'Bfro'))
endfunction

function Trig_Freeze_Explosion_Copy_2_Func001A takes nothing returns nothing
  if(Trig_Freeze_Explosion_Copy_2_Func001Func001C())then
  else
    if(Trig_Freeze_Explosion_Copy_2_Func001Func001Func001001())then
      return
    endif
    if(Trig_Freeze_Explosion_Copy_2_Func001Func001Func002001())then
      return
    endif
    call CreateNUnitsAtLoc(1,'h016',GetOwningPlayer(GetDyingUnit()),GetUnitLoc(GetDyingUnit()),bj_UNIT_FACING)
    call UnitApplyTimedLifeBJ(1000000000.,'BTLF',bj_lastCreatedUnit)
    call IssueTargetOrderById(bj_lastCreatedUnit,852226,GetEnumUnit())
  endif
endfunction

function Trig_Freeze_Explosion_Copy_2_Actions takes nothing returns nothing
  call ForGroupBJ(GetUnitsInRangeOfLocAll(500.,GetUnitLoc(GetDyingUnit())),function Trig_Freeze_Explosion_Copy_2_Func001A)
endfunction

function Trig_Freeze_Explosion_Copy_3_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetDyingUnit())=='n01H')
endfunction

function Trig_Freeze_Explosion_Copy_3_Func001Func001Func001001 takes nothing returns boolean
  return(IsUnitDeadBJ(GetEnumUnit()))
endfunction

function Trig_Freeze_Explosion_Copy_3_Func001Func001Func002001 takes nothing returns boolean
  return(IsUnitType(GetEnumUnit(),UNIT_TYPE_MECHANICAL)!=null)
endfunction

function Trig_Freeze_Explosion_Copy_3_Func001Func001C takes nothing returns boolean
  return(UnitHasBuffBJ(GetEnumUnit(),'Bfro'))
endfunction

function Trig_Freeze_Explosion_Copy_3_Func001A takes nothing returns nothing
  if(Trig_Freeze_Explosion_Copy_3_Func001Func001C())then
  else
    if(Trig_Freeze_Explosion_Copy_3_Func001Func001Func001001())then
      return
    endif
    if(Trig_Freeze_Explosion_Copy_3_Func001Func001Func002001())then
      return
    endif
    call CreateNUnitsAtLoc(1,'h016',GetOwningPlayer(GetDyingUnit()),GetUnitLoc(GetDyingUnit()),bj_UNIT_FACING)
    call UnitApplyTimedLifeBJ(1000000000.,'BTLF',bj_lastCreatedUnit)
    call IssueTargetOrderById(bj_lastCreatedUnit,852226,GetEnumUnit())
  endif
endfunction

function Trig_Freeze_Explosion_Copy_3_Actions takes nothing returns nothing
  call ForGroupBJ(GetUnitsInRangeOfLocAll(500.,GetUnitLoc(GetDyingUnit())),function Trig_Freeze_Explosion_Copy_3_Func001A)
endfunction

function Trig_Hex_Wave_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0MS')
endfunction

function Trig_Hex_Wave_Func004Func012001003 takes nothing returns boolean
  return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction

function Trig_Hex_Wave_Func004Func012Func001Func001001 takes nothing returns boolean
  return(IsUnitDeadBJ(GetEnumUnit()))
endfunction

function Trig_Hex_Wave_Func004Func012Func001Func002001 takes nothing returns boolean
  return(IsUnitType(GetEnumUnit(),UNIT_TYPE_MECHANICAL)!=null)
endfunction

function Trig_Hex_Wave_Func004Func012Func001Func009001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0MS',GetTriggerUnit())==1)
endfunction

function Trig_Hex_Wave_Func004Func012Func001Func010001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0MS',GetTriggerUnit())==2)
endfunction

function Trig_Hex_Wave_Func004Func012Func001Func011001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0MS',GetTriggerUnit())==3)
endfunction

function Trig_Hex_Wave_Func004Func012Func001Func012001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0MS',GetTriggerUnit())==4)
endfunction

function Trig_Hex_Wave_Func004Func012Func001C takes nothing returns boolean
  return(UnitHasBuffBJ(GetEnumUnit(),'BOhx'))
endfunction

function Trig_Hex_Wave_Func004Func012A takes nothing returns nothing
  if(Trig_Hex_Wave_Func004Func012Func001C())then
  else
    if(Trig_Hex_Wave_Func004Func012Func001Func001001())then
      return
    endif
    if(Trig_Hex_Wave_Func004Func012Func001Func002001())then
      return
    endif
    call CreateNUnitsAtLoc(1,'h00Z',GetOwningPlayer(GetTriggerUnit()),udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],bj_UNIT_FACING)
    call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
    call UnitAddAbility(bj_lastCreatedUnit,'A0MR')
    call IssueTargetOrderById(bj_lastCreatedUnit,852502,GetEnumUnit())
    call CreateNUnitsAtLoc(1,'h00Z',GetOwningPlayer(GetTriggerUnit()),udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],bj_UNIT_FACING)
    call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
    if(Trig_Hex_Wave_Func004Func012Func001Func009001())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0MP')
    endif
    if(Trig_Hex_Wave_Func004Func012Func001Func010001())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0MQ')
    endif
    if(Trig_Hex_Wave_Func004Func012Func001Func011001())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0MO')
    endif
    if(Trig_Hex_Wave_Func004Func012Func001Func012001())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0MN')
    endif
    call IssueTargetOrderById(bj_lastCreatedUnit,852226,GetEnumUnit())
  endif
endfunction

function Trig_Hex_Wave_Actions takes nothing returns nothing
  call PolledWait(.1)
  set udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=GetUnitLoc(GetTriggerUnit())
  set udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=GetUnitFacing(GetTriggerUnit())
  set bj_forLoopAIndex=1
  set bj_forLoopAIndexEnd=7
  loop
    exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
    call DestroyEffect(udg_Effect1[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
    call DestroyEffect(udg_Effect2[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
    call DestroyEffect(udg_Effect3[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
    set udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=PolarProjectionBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],150.,udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
    call AddSpecialEffectLocBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl")
    set udg_Effect1[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedEffect
    call AddSpecialEffectLocBJ(PolarProjectionBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],100.,(udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+90.)),"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl")
    set udg_Effect2[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedEffect
    call AddSpecialEffectLocBJ(PolarProjectionBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],100.,(udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+270.)),"Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl")
    set udg_Effect3[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedEffect
    set bj_wantDestroyGroup=true
    call ForGroupBJ(GetUnitsInRangeOfLocMatching(250.,udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],Condition(function Trig_Hex_Wave_Func004Func012001003)),function Trig_Hex_Wave_Func004Func012A)
    call PolledWait(.4)
    set bj_forLoopAIndex=bj_forLoopAIndex+1
  endloop
  call RemoveLocation(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
  call PolledWait(.4)
  call DestroyEffect(udg_Effect1[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
  call DestroyEffect(udg_Effect2[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
  call DestroyEffect(udg_Effect3[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction

function Trig_Root_Wave_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0GR')
endfunction

function Trig_Root_Wave_Func004Func016001003 takes nothing returns boolean
  return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction

function Trig_Root_Wave_Func004Func016Func001Func001001 takes nothing returns boolean
  return(IsUnitDeadBJ(GetEnumUnit()))
endfunction

function Trig_Root_Wave_Func004Func016Func001Func002001 takes nothing returns boolean
  return(IsUnitType(GetEnumUnit(),UNIT_TYPE_MECHANICAL)!=null)
endfunction

function Trig_Root_Wave_Func004Func016Func001Func006001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GR',GetTriggerUnit())==1)
endfunction

function Trig_Root_Wave_Func004Func016Func001Func007001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GR',GetTriggerUnit())==2)
endfunction

function Trig_Root_Wave_Func004Func016Func001Func008001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GR',GetTriggerUnit())==3)
endfunction

function Trig_Root_Wave_Func004Func016Func001Func009001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GR',GetTriggerUnit())==4)
endfunction

function Trig_Root_Wave_Func004Func016Func001C takes nothing returns boolean
  return(UnitHasBuffBJ(GetEnumUnit(),'BEer'))
endfunction

function Trig_Root_Wave_Func004Func016A takes nothing returns nothing
  if(Trig_Root_Wave_Func004Func016Func001C())then
  else
    if(Trig_Root_Wave_Func004Func016Func001Func001001())then
      return
    endif
    if(Trig_Root_Wave_Func004Func016Func001Func002001())then
      return
    endif
    call CreateNUnitsAtLoc(1,'h00Z',GetOwningPlayer(GetTriggerUnit()),udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],bj_UNIT_FACING)
    call UnitApplyTimedLifeBJ(8.,'BTLF',bj_lastCreatedUnit)
    if(Trig_Root_Wave_Func004Func016Func001Func006001())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0GV')
    endif
    if(Trig_Root_Wave_Func004Func016Func001Func007001())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0GS')
    endif
    if(Trig_Root_Wave_Func004Func016Func001Func008001())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0GW')
    endif
    if(Trig_Root_Wave_Func004Func016Func001Func009001())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0GX')
    endif
    call IssueTargetOrderById(bj_lastCreatedUnit,852171,GetEnumUnit())
  endif
endfunction

function Trig_Root_Wave_Actions takes nothing returns nothing
  call PolledWait(.1)
  set udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=GetUnitLoc(GetTriggerUnit())
  set udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=GetUnitFacing(GetTriggerUnit())
  set bj_forLoopAIndex=1
  set bj_forLoopAIndexEnd=7
  loop
    exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
    call DestroyEffect(udg_Effect1[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
    call DestroyEffect(udg_Effect2[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
    call DestroyEffect(udg_Effect3[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
    call DestroyEffect(udg_Effect4[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
    set udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=PolarProjectionBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],150.,udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
    call AddSpecialEffectLocBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],"Abilities\\Spells\\NightElf\\EntanglingRoots\\EntanglingRootsTarget.mdl")
    set udg_Effect1[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedEffect
    call AddSpecialEffectLocBJ(PolarProjectionBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],100.,(udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+90.)),"Abilities\\Spells\\NightElf\\EntanglingRoots\\EntanglingRootsTarget.mdl")
    set udg_Effect2[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedEffect
    call AddSpecialEffectLocBJ(PolarProjectionBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],100.,(udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+270.)),"Abilities\\Spells\\NightElf\\EntanglingRoots\\EntanglingRootsTarget.mdl")
    set udg_Effect3[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedEffect
    call AddSpecialEffectLocBJ(PolarProjectionBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],100.,(udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+360.)),"Abilities\\Spells\\NightElf\\EntanglingRoots\\EntanglingRootsTarget.mdl")
    set udg_Effect4[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedEffect
    set bj_wantDestroyGroup=true
    call ForGroupBJ(GetUnitsInRangeOfLocMatching(250.,udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],Condition(function Trig_Root_Wave_Func004Func016001003)),function Trig_Root_Wave_Func004Func016A)
    call PolledWait(.4)
    set bj_forLoopAIndex=bj_forLoopAIndex+1
  endloop
  call RemoveLocation(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
  call PolledWait(.4)
  call DestroyEffect(udg_Effect1[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
  call DestroyEffect(udg_Effect2[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
  call DestroyEffect(udg_Effect3[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
  call DestroyEffect(udg_Effect4[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction

function Trig_Flaming_Wave_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0GT')
endfunction

function Trig_Flaming_Wave_Func004Func017001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GT',GetTriggerUnit())==1)
endfunction

function Trig_Flaming_Wave_Func004Func019001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GT',GetTriggerUnit())==2)
endfunction

function Trig_Flaming_Wave_Func004Func021001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GT',GetTriggerUnit())==3)
endfunction

function Trig_Flaming_Wave_Func004Func023001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GT',GetTriggerUnit())==4)
endfunction

function Trig_Flaming_Wave_Actions takes nothing returns nothing
  call PolledWait(.1)
  set udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=GetUnitLoc(GetTriggerUnit())
  set udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=GetUnitFacing(GetTriggerUnit())
  set bj_forLoopAIndex=1
  set bj_forLoopAIndexEnd=7
  loop
    exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
    call DestroyEffect(udg_Effect1[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
    call DestroyEffect(udg_Effect2[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
    call DestroyEffect(udg_Effect3[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
    call DestroyEffect(udg_Effect4[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
    set udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=PolarProjectionBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],150.,udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
    call AddSpecialEffectLocBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],"Objects\\Spawnmodels\\Human\\HCancelDeath\\HCancelDeath.mdl")
    call DestroyEffect(bj_lastCreatedEffect)
    call AddSpecialEffectLocBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],"Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl")
    set udg_Effect1[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedEffect
    call AddSpecialEffectLocBJ(PolarProjectionBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],100.,(udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+90.)),"Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl")
    set udg_Effect2[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedEffect
    call AddSpecialEffectLocBJ(PolarProjectionBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],100.,(udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+270.)),"Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl")
    set udg_Effect3[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedEffect
    call AddSpecialEffectLocBJ(PolarProjectionBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],100.,(udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+360.)),"Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl")
    set udg_Effect4[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=bj_lastCreatedEffect
    if(Trig_Flaming_Wave_Func004Func017001())then
      call CreateNUnitsAtLoc(1,'h011',GetOwningPlayer(GetTriggerUnit()),udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],bj_UNIT_FACING)
    endif
    call UnitApplyTimedLifeBJ(15.,'BTLF',bj_lastCreatedUnit)
    if(Trig_Flaming_Wave_Func004Func019001())then
      call CreateNUnitsAtLoc(1,'h012',GetOwningPlayer(GetTriggerUnit()),PolarProjectionBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],110.,(udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+90.)),bj_UNIT_FACING)
    endif
    call UnitApplyTimedLifeBJ(15.,'BTLF',bj_lastCreatedUnit)
    if(Trig_Flaming_Wave_Func004Func021001())then
      call CreateNUnitsAtLoc(1,'h013',GetOwningPlayer(GetTriggerUnit()),PolarProjectionBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],110.,(udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+270.)),bj_UNIT_FACING)
    endif
    call UnitApplyTimedLifeBJ(15.,'BTLF',bj_lastCreatedUnit)
    if(Trig_Flaming_Wave_Func004Func023001())then
      call CreateNUnitsAtLoc(1,'h010',GetOwningPlayer(GetTriggerUnit()),PolarProjectionBJ(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))],110.,(udg_Wave_Angls[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+360.)),bj_UNIT_FACING)
    endif
    call UnitApplyTimedLifeBJ(15.,'BTLF',bj_lastCreatedUnit)
    call PolledWait(.4)
    set bj_forLoopAIndex=bj_forLoopAIndex+1
  endloop
  call RemoveLocation(udg_Wave_Points[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
  call PolledWait(.4)
  call DestroyEffect(udg_Effect1[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
  call DestroyEffect(udg_Effect2[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
  call DestroyEffect(udg_Effect3[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
  call DestroyEffect(udg_Effect4[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))])
endfunction

function Trig_Split_Shot_Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A012',GetDyingUnit())>0)
endfunction

function Trig_Split_Shot_Func002C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A012',GetTriggerUnit())>0)and(GetIssuedOrderId()==852055)
endfunction

function Trig_Split_Shot_Func003C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A012',GetTriggerUnit())>0)and(GetIssuedOrderId()==852056)
endfunction

function Trig_Split_Shot_Actions takes nothing returns nothing
  if(Trig_Split_Shot_Func001C())then
    call UnitRemoveAbility(GetDyingUnit(),'A09J')
  endif
  if(Trig_Split_Shot_Func002C())then
    call UnitAddAbility(GetTriggerUnit(),'A09J')
  endif
  if(Trig_Split_Shot_Func003C())then
    call UnitRemoveAbility(GetTriggerUnit(),'A09J')
  endif
endfunction

function GetManastrikeRawcode takes nothing returns integer
  return'A09B'
endfunction

function GetManastrikeManaBurnedStart takes nothing returns real
  return 100.
endfunction

function GetManastrikeManaBurnedLoop takes nothing returns real
  return 5.
endfunction

function GetManastrikeDuration takes nothing returns integer
  return 8
endfunction

function GetManastrikeArea takes nothing returns real
  return 200.
endfunction

function GetManastrikeHotSpots takes nothing returns integer
  return 30
endfunction

function GetManastrikeHotSpotArea takes nothing returns real
  return 25.
endfunction

function ManastrikeConditions takes nothing returns boolean
  return(GetSpellAbilityId()==GetManastrikeRawcode())
endfunction

function ManastrikeBurnManaStart takes nothing returns nothing
  call SetUnitManaBJ(GetEnumUnit(),(GetUnitStateSwap(UNIT_STATE_MANA,GetEnumUnit())-(GetManastrikeManaBurnedStart()*I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit())))))
endfunction

function ManastrikeBurnManaLoop takes nothing returns nothing
  call SetUnitManaBJ(GetEnumUnit(),(GetUnitStateSwap(UNIT_STATE_MANA,GetEnumUnit())-(GetManastrikeManaBurnedLoop()*I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit())))))
endfunction

function ManastrikeActions takes nothing returns nothing
  local location l=GetSpellTargetLoc()
  local location t
  local integer a=1
  local integer b
  local effect e
  call AddSpecialEffectLocBJ(l,"war3mapImported\\Manastrike.mdx")
  set e=bj_lastCreatedEffect
  call PolledWait(1.5)
  call ForGroupBJ(GetUnitsInRangeOfLocAll(GetManastrikeArea(),l),function ManastrikeBurnManaStart)
  call PolledWait(.5)
  set a=1
  loop
    exitwhen a>GetManastrikeDuration()
    set b=1
    loop
      exitwhen b>GetManastrikeHotSpots()
      set t=PolarProjectionBJ(l,GetRandomReal(0,GetManastrikeArea()),GetRandomReal(0,360))
      call ForGroupBJ(GetUnitsInRangeOfLocAll(GetManastrikeHotSpotArea(),t),function ManastrikeBurnManaLoop)
      call DestroyEffect(AddSpecialEffectLocBJ(t,"Abilities\\Spells\\Undead\\DeathandDecay\\DeathandDecayDamage.mdl"))
      call RemoveLocation(t)
      set b=b+1
    endloop
    call PolledWait(1.)
    set a=a+1
  endloop
  call RemoveLocation(l)
  call DestroyEffect(e)
endfunction

function Trig_Swift_Attack_Copy_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A09H')
endfunction

function Trig_Swift_Attack_Copy_Func003C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A09H',GetSpellAbilityUnit())==1)
endfunction

function Trig_Swift_Attack_Copy_Func004C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A09H',GetSpellAbilityUnit())==2)
endfunction

function Trig_Swift_Attack_Copy_Func005C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A09H',GetSpellAbilityUnit())==3)
endfunction

function Trig_Swift_Attack_Copy_Func006C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A09H',GetSpellAbilityUnit())==4)
endfunction

function Trig_Swift_Attack_Copy_Actions takes nothing returns nothing
  call SelectUnitRemove(GetSpellAbilityUnit())
  set udg_Strike_Counter=0
  if(Trig_Swift_Attack_Copy_Func003C())then
    set udg_Damage=400.
    set udg_How_Many_Times=10
    set udg_Delay_Time=.4
  endif
  if(Trig_Swift_Attack_Copy_Func004C())then
    set udg_Damage=800.
    set udg_How_Many_Times=15
    set udg_Delay_Time=.4
  endif
  if(Trig_Swift_Attack_Copy_Func005C())then
    set udg_Damage=1200.
    set udg_How_Many_Times=20
    set udg_Delay_Time=.4
  endif
  if(Trig_Swift_Attack_Copy_Func006C())then
    set udg_Damage=1600.
    set udg_How_Many_Times=25
    set udg_Delay_Time=.4
  endif
  set udg_Caster=GetSpellAbilityUnit()
  call ShowUnitHide(udg_Caster)
  call CreateNUnitsAtLoc(1,'e00K',GetOwningPlayer(GetSpellAbilityUnit()),GetUnitLoc(GetSpellAbilityUnit()),GetUnitFacing(GetSpellAbilityUnit()))
  set udg_AttackedUnit=GetSpellTargetUnit()
  set udg_AttackDummy=bj_lastCreatedUnit
  call SetUnitTimeScalePercent(udg_AttackDummy,400.)
  call SetUnitColor(udg_AttackDummy,GetPlayerColor(GetOwningPlayer(GetTriggerUnit())))
  call SetUnitVertexColorBJ(udg_AttackDummy,'d','d','d',35.)
  call TriggerSleepAction(.1)
  call SetUnitPositionLocFacingLocBJ(udg_AttackDummy,GetUnitLoc(udg_AttackedUnit),GetUnitLoc(udg_AttackedUnit))
  call SetUnitAnimation(udg_AttackDummy,"attack")
  call PlaySoundAtPointBJ(udg_SliceSound[GetRandomInt(1,3)],'d',GetUnitLoc(udg_AttackDummy),0)
  call UnitDamageTargetBJ(udg_Caster,udg_AttackedUnit,udg_Damage,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL)
  call StartTimerBJ(udg_Swift_Timer,false,.06)
endfunction

function Trig_Swift_Attack02_Copy_Func001001002003001 takes nothing returns boolean
  return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(udg_Caster)))
endfunction

function Trig_Swift_Attack02_Copy_Func001001002003002001 takes nothing returns boolean
  return(IsUnitAliveBJ(GetFilterUnit()))
endfunction

function Trig_Swift_Attack02_Copy_Func001001002003002002 takes nothing returns boolean
  return(GetUnitTypeId(GetFilterUnit())!='n01B')
endfunction

function Trig_Swift_Attack02_Copy_Func001001002003002 takes nothing returns boolean
  return GetBooleanAnd(Trig_Swift_Attack02_Copy_Func001001002003002001(),Trig_Swift_Attack02_Copy_Func001001002003002002())
endfunction

function Trig_Swift_Attack02_Copy_Func001001002003 takes nothing returns boolean
  return GetBooleanAnd(Trig_Swift_Attack02_Copy_Func001001002003001(),Trig_Swift_Attack02_Copy_Func001001002003002())
endfunction

function Trig_Swift_Attack02_Copy_Func001A takes nothing returns nothing
  set udg_AttackedUnit=GetEnumUnit()
  call AddSpecialEffectTargetUnitBJ("origin",udg_AttackDummy,"Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl")
  call SetUnitPositionLocFacingLocBJ(udg_AttackDummy,GetUnitLoc(udg_AttackedUnit),GetUnitLoc(udg_AttackedUnit))
  call SetUnitAnimation(udg_AttackDummy,"attack")
  call PlaySoundAtPointBJ(udg_SliceSound[GetRandomInt(1,3)],'d',GetUnitLoc(udg_AttackDummy),0)
  call UnitDamageTargetBJ(udg_Caster,udg_AttackedUnit,udg_Damage,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL)
endfunction

function Trig_Swift_Attack02_Copy_Func002Func001001001003001 takes nothing returns boolean
  return(IsUnitAliveBJ(GetFilterUnit()))
endfunction

function Trig_Swift_Attack02_Copy_Func002Func001001001003002 takes nothing returns boolean
  return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(udg_Caster)))
endfunction

function Trig_Swift_Attack02_Copy_Func002Func001001001003 takes nothing returns boolean
  return GetBooleanAnd(Trig_Swift_Attack02_Copy_Func002Func001001001003001(),Trig_Swift_Attack02_Copy_Func002Func001001001003002())
endfunction

function Trig_Swift_Attack02_Copy_Func002C takes nothing returns boolean
  return(CountUnitsInGroup(GetUnitsInRangeOfLocMatching(500.,GetUnitLoc(udg_AttackDummy),Condition(function Trig_Swift_Attack02_Copy_Func002Func001001001003)))==0)
endfunction

function Trig_Swift_Attack02_Copy_Func006001 takes nothing returns boolean
  return(udg_How_Many_Times>0)
endfunction

function Trig_Swift_Attack02_Copy_Actions takes nothing returns nothing
  call ForGroupBJ(GetRandomSubGroup(1,GetUnitsInRangeOfLocMatching(500.,GetUnitLoc(udg_AttackedUnit),Condition(function Trig_Swift_Attack02_Copy_Func001001002003))),function Trig_Swift_Attack02_Copy_Func001A)
  if(Trig_Swift_Attack02_Copy_Func002C())then
    call ConditionalTriggerExecute(gg_trg_End_Swift_Attack_Copy)
    return
  endif
  set udg_How_Many_Times=(udg_How_Many_Times-1)
  set udg_Strike_Counter=(udg_Strike_Counter+1)
  if(Trig_Swift_Attack02_Copy_Func006001())then
    call StartTimerBJ(udg_Swift_Timer,false,udg_Delay_Time)
  else
    call TriggerExecute(gg_trg_End_Swift_Attack_Copy)
  endif
endfunction

function Trig_End_Swift_Attack_Copy_Actions takes nothing returns nothing
  call SetUnitPositionLocFacingBJ(udg_Caster,GetUnitLoc(udg_AttackDummy),GetUnitFacing(udg_AttackDummy))
  call RemoveUnit(udg_AttackDummy)
  call ShowUnitShow(udg_Caster)
  call SelectUnitForPlayerSingle(udg_Caster,GetOwningPlayer(udg_Caster))
  call ConditionalTriggerExecute(gg_trg_Text_Thingy_Copy)
endfunction

function Trig_Text_Thingy_Copy_Actions takes nothing returns nothing
  call CreateTextTagUnitBJ((I2S(udg_Strike_Counter)+" Hits!"),udg_Caster,10.,12.5,'d',.0,.0,0)
  set udg_Hit_Text=bj_lastCreatedTextTag
  set udg_Shakoof=.0
  call EnableTrigger(gg_trg_Text_Thingy02_Copy)
  call TriggerSleepAction(4.)
  call DisableTrigger(gg_trg_Text_Thingy02_Copy)
  call DestroyTextTag(udg_Hit_Text)
endfunction

function Trig_Text_Thingy02_Copy_Actions takes nothing returns nothing
  call SetTextTagVelocityBJ(udg_Hit_Text,35.,90)
  set udg_Shakoof=(udg_Shakoof+.26)
  call SetTextTagColorBJ(udg_Hit_Text,'d',.0,.0,udg_Shakoof)
endfunction

function getOmniDrain_Abilcode takes nothing returns integer
  return'A0EX'
endfunction

function getOmniDrain_caster takes nothing returns integer
  return'h00R'
endfunction

function getOmniDrain_buff takes nothing returns integer
  return'B026'
endfunction

function getOmniDrain_DummyLightningFX_Abilcode takes nothing returns integer
  return'A0EY'
endfunction

function getOmniDrain_DummyCheck_Abilcode takes nothing returns integer
  return'A0EZ'
endfunction

function getOmniDrain_CapTargets takes nothing returns integer
  return 2+GetUnitAbilityLevelSwapped(getOmniDrain_Abilcode(),GetTriggerUnit())
endfunction

function GetOmniDrain_dmgReturnFactor takes nothing returns real
  return .5
endfunction

function CastAbility takes integer abil,integer level,string order,unit caster,unit target,location loc,real h returns nothing
  call CreateNUnitsAtLoc(1,getOmniDrain_caster(),GetOwningPlayer(caster),loc,bj_UNIT_FACING)
  call SetUnitPathing(bj_lastCreatedUnit,false)
  call SetUnitPositionLoc(bj_lastCreatedUnit,loc)
  if h>40 then
    call SetUnitFlyHeight(bj_lastCreatedUnit,h,10000.)
  endif
  call UnitAddAbility(bj_lastCreatedUnit,abil)
  call SetUnitAbilityLevelSwapped(abil,bj_lastCreatedUnit,level)
  call UnitApplyTimedLifeBJ(1.,'BTLF',bj_lastCreatedUnit)
  call IssueTargetOrder(bj_lastCreatedUnit,order,target)
endfunction

function H2I takes handle h returns integer
  return (GetHandleId(h))
endfunction

function I2U takes integer i returns unit
  call SaveFogStateHandle(udg_typecasting,0,0,ConvertFogState(i))
  return (LoadUnitHandle(udg_typecasting,0,0))
endfunction

function I2T takes integer t returns trigger
  call SaveFogStateHandle(udg_typecasting,0,0,ConvertFogState(t))
  return (LoadTriggerHandle(udg_typecasting,0,0))
endfunction

function I2G takes integer g returns group
  call SaveFogStateHandle(udg_typecasting,0,0,ConvertFogState(g))
  return (LoadGroupHandle(udg_typecasting,0,0))
endfunction

function Trig_MultiDrain_InitConditions takes nothing returns boolean
  return(GetSpellAbilityId()==getOmniDrain_Abilcode())
endfunction

function GetMultiDrainGameCache takes nothing returns gamecache
  return gg_trg_MultiDrain
endfunction

function Trig_MultiDrain_RemoveCasters takes nothing returns nothing
  call RemoveUnit(GetEnumUnit())
endfunction

function Trig_MultiDrain_TargetDmgCondition takes nothing returns boolean
  local gamecache g=GetMultiDrainGameCache()
  local unit dummy=I2U(GetStoredInteger(g,"dummy",I2S(H2I(GetTriggeringTrigger()))))
  return(GetEventDamageSource()==dummy)
endfunction

function Trig_MultiDrain_TargetDmgActions takes nothing returns nothing
  local gamecache g=GetMultiDrainGameCache()
  local unit caster=I2U(GetStoredInteger(g,"caster",I2S(H2I(GetTriggeringTrigger()))))
  call SetWidgetLife(caster,(GetUnitStateSwap(UNIT_STATE_LIFE,caster)+GetEventDamage()*GetOmniDrain_dmgReturnFactor()))
endfunction

function Trig_MultiDrain_DmgEvent_Child takes nothing returns nothing
  local gamecache g=GetMultiDrainGameCache()
  local unit caster=GetTriggerUnit()
  local trigger t=I2T(GetStoredInteger(g,"t",I2S(H2I(caster))))
  local trigger u=CreateTrigger()
  local real dmg=GetStoredReal(g,"dmg",I2S(H2I(t)))
  local integer spell=GetStoredInteger(g,"spell",I2S(H2I(t)))
  local location loc=GetUnitLoc(caster)
  local group dummycasters=I2G(GetStoredInteger(g,"dummycasters",I2S(H2I(t))))
  local unit target=GetEnumUnit()
  local unit dummy
  call CreateNUnitsAtLoc(1,getOmniDrain_caster(),GetOwningPlayer(caster),loc,bj_UNIT_FACING)
  call UnitAddAbility(bj_lastCreatedUnit,getOmniDrain_DummyLightningFX_Abilcode())
  call SetUnitAbilityLevelSwapped(getOmniDrain_DummyLightningFX_Abilcode(),bj_lastCreatedUnit,GetUnitAbilityLevelSwapped(getOmniDrain_Abilcode(),caster))
  call UnitApplyTimedLifeBJ(10.,'BTLF',bj_lastCreatedUnit)
  call SetUnitPathing(bj_lastCreatedUnit,false)
  call SetUnitPositionLoc(bj_lastCreatedUnit,loc)
  call IssueTargetOrderById(bj_lastCreatedUnit,852487,target)
  set dummy=bj_lastCreatedUnit
  call StoreIntegerBJ(H2I(dummy),I2S(H2I(u)),"dummy",g)
  call StoreIntegerBJ(H2I(caster),I2S(H2I(u)),"caster",g)
  call GroupAddUnit(dummycasters,dummy)
  call TriggerRegisterUnitEvent(u,target,EVENT_UNIT_DAMAGED)
  call TriggerAddCondition(u,Condition(function Trig_MultiDrain_TargetDmgCondition))
  call TriggerAddAction(u,function Trig_MultiDrain_TargetDmgActions)
  call PolledWait(.5)
  loop
    call TriggerSleepAction(.1)
    exitwhen UnitHasBuffBJ(dummy,getOmniDrain_buff())==false
  endloop
  call GroupRemoveUnit(dummycasters,dummy)
  call FlushStoredInteger(g,"dummy",I2S(H2I(u)))
  call FlushStoredInteger(g,"caster",I2S(H2I(u)))
  call DestroyTrigger(u)
  call RemoveLocation(loc)
  set loc=null
endfunction

function Trig_MultiDrain_DmgEvent takes nothing returns nothing
  call ExecuteFunc("Trig_MultiDrain_DmgEvent_Child")
endfunction

function Trig_MultiDrain_AddEvent takes nothing returns nothing
  local gamecache g=GetMultiDrainGameCache()
  local trigger t=I2T(GetStoredInteger(g,"t",I2S(H2I(GetTriggerUnit()))))
  call TriggerRegisterUnitEvent(t,GetEnumUnit(),EVENT_UNIT_DAMAGED)
endfunction

function Trig_MultiDrain_AddGroupCondition takes nothing returns boolean
  local gamecache g=GetMultiDrainGameCache()
  local unit dummycaster=I2U(GetStoredInteger(g,"dummycaster",I2S(H2I(GetTriggeringTrigger()))))
  return(GetEventDamageSource()==dummycaster)
endfunction

function Trig_MultiDrain_AddGroupActions takes nothing returns nothing
  local gamecache g=GetMultiDrainGameCache()
  local group targets=I2G(GetStoredInteger(g,"targets",I2S(H2I(GetTriggeringTrigger()))))
  call GroupAddUnit(targets,GetTriggerUnit())
endfunction

function Trig_MultiDrain_InitActions takes nothing returns nothing
  local gamecache g=GetMultiDrainGameCache()
  local unit caster=GetSpellAbilityUnit()
  local unit target=GetSpellTargetUnit()
  local unit dummycaster
  local location loc=GetUnitLoc(caster)
  local location targetloc=GetUnitLoc(target)
  local group targets=CreateGroup()
  local group tempgroup
  local group dummycasters=CreateGroup()
  local trigger t=CreateTrigger()
  local integer spell=GetSpellAbilityId()
  local trigger endcast=CreateTrigger()
  local boolean isendcast=false
  local effect fx=AddSpecialEffectTargetUnitBJ("chest",caster,"Abilities\\Spells\\Other\\Drain\\DrainCaster.mdl")
  call CastAbility(getOmniDrain_DummyCheck_Abilcode(),1,"forkedlightning",caster,target,loc,0)
  set dummycaster=bj_lastCreatedUnit
  set targets=GetUnitsInRangeOfLocAll(1500.,loc)
  call StoreIntegerBJ(H2I(t),I2S(H2I(GetTriggerUnit())),"t",g)
  call ForGroupBJ(targets,function Trig_MultiDrain_AddEvent)
  call GroupClear(targets)
  call TriggerAddCondition(t,Condition(function Trig_MultiDrain_AddGroupCondition))
  call TriggerAddAction(t,function Trig_MultiDrain_AddGroupActions)
  call TriggerRegisterUnitEvent(endcast,caster,EVENT_UNIT_SPELL_ENDCAST)
  call StoreIntegerBJ(H2I(caster),I2S(H2I(t)),"caster",g)
  call StoreIntegerBJ(H2I(target),I2S(H2I(t)),"target",g)
  call StoreIntegerBJ(H2I(dummycaster),I2S(H2I(t)),"dummycaster",g)
  call StoreIntegerBJ(H2I(targets),I2S(H2I(t)),"targets",g)
  call StoreIntegerBJ(H2I(dummycasters),I2S(H2I(t)),"dummycasters",g)
  call StoreIntegerBJ(spell,I2S(H2I(t)),"spell",g)
  call StoreBooleanBJ(isendcast,I2S(H2I(t)),"endcast",g)
  call PolledWait(.4)
  call GroupRemoveUnit(targets,target)
  set tempgroup=GetRandomSubGroup(getOmniDrain_CapTargets()-1,targets)
  call DestroyGroup(targets)
  set targets=tempgroup
  call GroupAddUnit(targets,target)
  call ForGroupBJ(targets,function Trig_MultiDrain_DmgEvent)
  loop
    call TriggerSleepAction(.1)
    exitwhen GetTriggerEvalCount(endcast)>0 or CountUnitsInGroup(dummycasters)==0 or GetUnitCurrentOrder(caster)!=852487
  endloop
  call PauseUnit(caster,true)
  call PauseUnit(caster,false)
  call ForGroupBJ(dummycasters,function Trig_MultiDrain_RemoveCasters)
  call RemoveLocation(loc)
  call RemoveLocation(targetloc)
  call DestroyEffect(fx)
  call PolledWait(.1)
  call FlushStoredInteger(g,"caster",I2S(H2I(t)))
  call FlushStoredInteger(g,"t",I2S(H2I(caster)))
  call FlushStoredInteger(g,"target",I2S(H2I(t)))
  call FlushStoredInteger(g,"spell",I2S(H2I(t)))
  call FlushStoredInteger(g,"targets",I2S(H2I(t)))
  call FlushStoredBoolean(g,"endcast",I2S(H2I(t)))
  call FlushStoredInteger(g,"dummycaster",I2S(H2I(t)))
  call FlushStoredInteger(g,"dummycasters",I2S(H2I(t)))
  call DestroyTrigger(t)
  call DestroyTrigger(endcast)
  call GroupClear(targets)
  call DestroyGroup(targets)
  call DestroyGroup(tempgroup)
  call DestroyGroup(dummycasters)
  set t=null
  set endcast=null
  set targets=null
  set dummycasters=null
  set loc=null
endfunction

function GetFCSpellRawcode takes nothing returns integer
  return'A0AO'
endfunction

function GetFCDummyRawcode takes nothing returns integer
  return'u00R'
endfunction

function GetFCDummySpellRawcode takes nothing returns integer
  return'A0AN'
endfunction

function GetFCBuffRawcode takes nothing returns integer
  return'B019'
endfunction

function GetFCOrder takes nothing returns string
  return"frostnova"
endfunction

function GetFCClose takes nothing returns real
  return 175.
endfunction

function GetFCDuration takes nothing returns real
  return 7.
endfunction

function GetFCStartingPointOffset takes nothing returns real
  return 50.
endfunction

function GetFCStartingDistanceOffset takes nothing returns real
  return 125.
endfunction

function GetFCPointOffset takes nothing returns real
  return 8.
endfunction

function GetFCDistanceOffset takes nothing returns real
  return .25
endfunction

function GetFCDegreesOffset takes nothing returns real
  return 5.
endfunction

function FCH2I takes handle h returns integer
  return GetHandleId(h)
endfunction

function FCCache takes nothing returns gamecache
  return(InitGameCache("FC.w3v"))
endfunction

function FCSetHandleInt takes handle subject,string name,integer value returns nothing
  if value==0 then
    call FlushStoredInteger(FCCache(),I2S(FCH2I(subject)),name)
  else
    call StoreInteger(FCCache(),I2S(FCH2I(subject)),name,value)
  endif
endfunction

function FCSetHandleReal takes handle subject,string name,real value returns nothing
  if value==0 then
    call FlushStoredReal(FCCache(),I2S(FCH2I(subject)),name)
  else
    call StoreReal(FCCache(),I2S(FCH2I(subject)),name,value)
  endif
endfunction

function FCSetHandleHandle takes handle subject,string name,handle value returns nothing
  call FCSetHandleInt(subject,name,FCH2I(value))
endfunction

function FCGetHandleInt takes handle subject,string name returns integer
  return GetStoredInteger(FCCache(),I2S(FCH2I(subject)),name)
endfunction

function FCGetHandleReal takes handle subject,string name returns real
  return GetStoredReal(FCCache(),I2S(FCH2I(subject)),name)
endfunction

function FCGetHandleHandle takes handle subject,string name returns integer
  return GetStoredInteger(FCCache(),I2S(FCH2I(subject)),name)
endfunction

function FCFlushHandleLocals takes handle subject returns nothing
  call FlushStoredMission(FCCache(),I2S(FCH2I(subject)))
endfunction

function FCGetHandleUnit takes nothing returns unit
  local integer i=FCGetHandleHandle(GetExpiredTimer(),"dummy")
  call SaveFogStateHandle(udg_typecasting,0,0,ConvertFogState(i))
  return (LoadUnitHandle(udg_typecasting,0,0))
endfunction

function FCConditions takes nothing returns boolean
  return(GetSpellAbilityId()==GetFCSpellRawcode())
endfunction

function FCHasBuff takes nothing returns boolean
  return(UnitHasBuffBJ(GetFilterUnit(),GetFCBuffRawcode())==false)
endfunction

function FCIssueOrder takes nothing returns nothing
  call IssueTargetOrder(FCGetHandleUnit(),GetFCOrder(),GetEnumUnit())
endfunction

function FCMove takes nothing returns nothing
  local timer t=GetExpiredTimer()
  local unit u=FCGetHandleUnit()
  local real angle=FCGetHandleReal(t,"angle")
  local real distance=FCGetHandleReal(t,"distance")
  local real direction=FCGetHandleReal(t,"direction")
  local real X=FCGetHandleReal(t,"X")
  local real Y=FCGetHandleReal(t,"Y")
  call FCSetHandleHandle(GetExpiredTimer(),"dummy",u)
  call FCSetHandleReal(t,"distance",(distance+GetFCDistanceOffset()))
  call FCSetHandleReal(t,"direction",(direction+GetFCDegreesOffset()))
  call FCSetHandleReal(t,"X",GetLocationX(PolarProjectionBJ(Location(X,Y),GetFCPointOffset(),angle)))
  call FCSetHandleReal(t,"Y",GetLocationY(PolarProjectionBJ(Location(X,Y),GetFCPointOffset(),angle)))
  call SetUnitPositionLoc(u,PolarProjectionBJ(Location(X,Y),distance,direction))
  call ForGroupBJ(GetUnitsInRangeOfLocMatching(GetFCClose(),GetUnitLoc(u),Condition(function FCHasBuff)),function FCIssueOrder)
endfunction

function FCActions takes nothing returns nothing
  local real angle=AngleBetweenPoints(GetUnitLoc(GetTriggerUnit()),GetSpellTargetLoc())
  local real distance=GetFCStartingDistanceOffset()
  local real direction=.0
  local unit u
  local timer t=CreateTimer()
  call CreateNUnitsAtLoc(1,GetFCDummyRawcode(),GetOwningPlayer(GetTriggerUnit()),PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()),GetFCStartingPointOffset(),angle),angle)
  set u=bj_lastCreatedUnit
  call SetUnitAbilityLevelSwapped(GetFCDummySpellRawcode(),u,GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit()))
  set direction=angle
  call FCSetHandleHandle(t,"dummy",u)
  call FCSetHandleReal(t,"angle",angle)
  call FCSetHandleReal(t,"distance",distance)
  call FCSetHandleReal(t,"direction",direction)
  call FCSetHandleReal(t,"X",GetLocationX(GetUnitLoc(u)))
  call FCSetHandleReal(t,"Y",GetLocationY(GetUnitLoc(u)))
  call TimerStart(t,.01,true,function FCMove)
  call PolledWait(GetFCDuration())
  call FCFlushHandleLocals(t)
  call DestroyTimer(t)
  call KillUnit(u)
  call PolledWait(3.)
  call RemoveUnit(u)
endfunction

function GetSlowSpellRawcode takes nothing returns integer
  return'A00B'
endfunction

function GetSlowDummyRawcode takes nothing returns integer
  return'u005'
endfunction

function GetSlowDummySpellRawcode takes nothing returns integer
  return'A00A'
endfunction

function GetSlowBuffRawcode takes nothing returns integer
  return'Bslo'
endfunction

function GetSlowOrder takes nothing returns string
  return"slow"
endfunction

function GetSlowClose takes nothing returns real
  return 100.
endfunction

function GetSlowDuration takes nothing returns real
  return 12.
endfunction

function GetSlowStartingPointOffset takes nothing returns real
  return .0
endfunction

function GetSlowStartingDistanceOffset takes nothing returns real
  return 50.
endfunction

function GetSlowPointOffset takes nothing returns real
  return .0
endfunction

function GetSlowDistanceOffset takes nothing returns real
  return .25
endfunction

function GetSlowDegreesOffset takes nothing returns real
  return 1.8
endfunction

function SlowH2I takes handle h returns integer
  return GetHandleId(h)
endfunction

function SlowCache takes nothing returns gamecache
  return(InitGameCache("Slow.w3v"))
endfunction

function SlowSetHandleInt takes handle subject,string name,integer value returns nothing
  if value==0 then
    call FlushStoredInteger(SlowCache(),I2S(SlowH2I(subject)),name)
  else
    call StoreInteger(SlowCache(),I2S(SlowH2I(subject)),name,value)
  endif
endfunction

function SlowSetHandleReal takes handle subject,string name,real value returns nothing
  if value==0 then
    call FlushStoredReal(SlowCache(),I2S(SlowH2I(subject)),name)
  else
    call StoreReal(SlowCache(),I2S(SlowH2I(subject)),name,value)
  endif
endfunction

function SlowSetHandleHandle takes handle subject,string name,handle value returns nothing
  call SlowSetHandleInt(subject,name,SlowH2I(value))
endfunction

function SlowGetHandleInt takes handle subject,string name returns integer
  return GetStoredInteger(SlowCache(),I2S(SlowH2I(subject)),name)
endfunction

function SlowGetHandleReal takes handle subject,string name returns real
  return GetStoredReal(SlowCache(),I2S(SlowH2I(subject)),name)
endfunction

function SlowGetHandleHandle takes handle subject,string name returns unit
  local integer i = GetStoredInteger(SlowCache(),I2S(SlowH2I(subject)),name)
  call SaveFogStateHandle(udg_typecasting,0,0,ConvertFogState(i))
  return (LoadUnitHandle(udg_typecasting,0,0))
endfunction

function SlowFlushHandleLocals takes handle subject returns nothing
  call FlushStoredMission(SlowCache(),I2S(SlowH2I(subject)))
endfunction

function SlowGetHandleUnit takes nothing returns unit
  return SlowGetHandleHandle(GetExpiredTimer(),"dummy")
endfunction

function SlowConditions takes nothing returns boolean
  return(GetSpellAbilityId()==GetSlowSpellRawcode())
endfunction

function SlowHasBuff takes nothing returns boolean
  return(UnitHasBuffBJ(GetFilterUnit(),GetSlowBuffRawcode())==false)
endfunction

function SlowIssueOrder takes nothing returns nothing
  call IssueTargetOrder(SlowGetHandleUnit(),GetSlowOrder(),GetEnumUnit())
endfunction

function SlowMove takes nothing returns nothing
  local timer t=GetExpiredTimer()
  local unit u=SlowGetHandleUnit()
  local real angle=SlowGetHandleReal(t,"angle")
  local real distance=SlowGetHandleReal(t,"distance")
  local real direction=SlowGetHandleReal(t,"direction")
  local real X=SlowGetHandleReal(t,"X")
  local real Y=SlowGetHandleReal(t,"Y")
  call SlowSetHandleHandle(GetExpiredTimer(),"dummy",u)
  call SlowSetHandleReal(t,"distance",(distance+GetSlowDistanceOffset()))
  call SlowSetHandleReal(t,"direction",(direction+GetSlowDegreesOffset()))
  call SlowSetHandleReal(t,"X",GetLocationX(PolarProjectionBJ(Location(X,Y),GetSlowPointOffset(),angle)))
  call SlowSetHandleReal(t,"Y",GetLocationY(PolarProjectionBJ(Location(X,Y),GetSlowPointOffset(),angle)))
  call SetUnitPositionLoc(u,PolarProjectionBJ(Location(X,Y),distance,direction))
  call ForGroupBJ(GetUnitsInRangeOfLocMatching(GetSlowClose(),GetUnitLoc(u),Condition(function SlowHasBuff)),function SlowIssueOrder)
endfunction

function SlowActions takes nothing returns nothing
  local real angle=AngleBetweenPoints(GetUnitLoc(GetTriggerUnit()),GetSpellTargetLoc())
  local real distance=GetSlowStartingDistanceOffset()
  local real direction=.0
  local unit u
  local timer t=CreateTimer()
  call CreateNUnitsAtLoc(1,GetSlowDummyRawcode(),GetOwningPlayer(GetTriggerUnit()),PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()),GetSlowStartingPointOffset(),angle),angle)
  set u=bj_lastCreatedUnit
  call SetUnitAbilityLevelSwapped(GetSlowDummySpellRawcode(),u,GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit()))
  set direction=angle
  call SlowSetHandleHandle(t,"dummy",u)
  call SlowSetHandleReal(t,"angle",angle)
  call SlowSetHandleReal(t,"distance",distance)
  call SlowSetHandleReal(t,"direction",direction)
  call SlowSetHandleReal(t,"X",GetLocationX(GetUnitLoc(u)))
  call SlowSetHandleReal(t,"Y",GetLocationY(GetUnitLoc(u)))
  call TimerStart(t,.01,true,function SlowMove)
  call PolledWait(GetSlowDuration())
  call SlowFlushHandleLocals(t)
  call DestroyTimer(t)
  call KillUnit(u)
  call PolledWait(3.)
  call RemoveUnit(u)
endfunction

function GetCycloneSpellRawcode takes nothing returns integer
  return'A0AE'
endfunction

function GetCycloneDummyRawcode takes nothing returns integer
  return'u00O'
endfunction

function GetCycloneDummySpellRawcode takes nothing returns integer
  return'A0AD'
endfunction

function GetCycloneBuffRawcode takes nothing returns integer
  return'Bcyc'
endfunction

function GetCycloneOrder takes nothing returns string
  return"cyclone"
endfunction

function GetCycloneClose takes nothing returns real
  return 100.
endfunction

function GetCycloneDuration takes nothing returns real
  return 8.
endfunction

function GetCycloneStartingPointOffset takes nothing returns real
  return .0
endfunction

function GetCycloneStartingDistanceOffset takes nothing returns real
  return 100.
endfunction

function GetCyclonePointOffset takes nothing returns real
  return .0
endfunction

function GetCycloneDistanceOffset takes nothing returns real
  return 1.
endfunction

function GetCycloneDegreesOffset takes nothing returns real
  return 6.
endfunction

function CycloneH2I takes handle h returns integer
  return GetHandleId(h)
endfunction

function CycloneCache takes nothing returns gamecache
  return(InitGameCache("Cyclone.w3v"))
endfunction

function CycloneSetHandleInt takes handle subject,string name,integer value returns nothing
  if value==0 then
    call FlushStoredInteger(CycloneCache(),I2S(CycloneH2I(subject)),name)
  else
    call StoreInteger(CycloneCache(),I2S(CycloneH2I(subject)),name,value)
  endif
endfunction

function CycloneSetHandleReal takes handle subject,string name,real value returns nothing
  if value==0 then
    call FlushStoredReal(CycloneCache(),I2S(CycloneH2I(subject)),name)
  else
    call StoreReal(CycloneCache(),I2S(CycloneH2I(subject)),name,value)
  endif
endfunction

function CycloneSetHandleHandle takes handle subject,string name,handle value returns nothing
  call CycloneSetHandleInt(subject,name,CycloneH2I(value))
endfunction

function CycloneGetHandleInt takes handle subject,string name returns integer
  return GetStoredInteger(CycloneCache(),I2S(CycloneH2I(subject)),name)
endfunction

function CycloneGetHandleReal takes handle subject,string name returns real
  return GetStoredReal(CycloneCache(),I2S(CycloneH2I(subject)),name)
endfunction

function CycloneGetHandleHandle takes handle subject,string name returns unit
  local integer i = GetStoredInteger(CycloneCache(),I2S(CycloneH2I(subject)),name)
  call SaveFogStateHandle(udg_typecasting,0,0,ConvertFogState(i))
  return (LoadUnitHandle(udg_typecasting,0,0))
endfunction

function CycloneFlushHandleLocals takes handle subject returns nothing
  call FlushStoredMission(CycloneCache(),I2S(CycloneH2I(subject)))
endfunction

function CycloneGetHandleUnit takes nothing returns unit
  return CycloneGetHandleHandle(GetExpiredTimer(),"dummy")
endfunction

function CycloneConditions takes nothing returns boolean
  return(GetSpellAbilityId()==GetCycloneSpellRawcode())
endfunction

function CycloneHasBuff takes nothing returns boolean
  return(UnitHasBuffBJ(GetFilterUnit(),GetCycloneBuffRawcode())==false)
endfunction

function CycloneIssueOrder takes nothing returns nothing
  call IssueTargetOrder(CycloneGetHandleUnit(),GetCycloneOrder(),GetEnumUnit())
endfunction

function CycloneMove takes nothing returns nothing
  local timer t=GetExpiredTimer()
  local unit u=CycloneGetHandleUnit()
  local real angle=CycloneGetHandleReal(t,"angle")
  local real distance=CycloneGetHandleReal(t,"distance")
  local real direction=CycloneGetHandleReal(t,"direction")
  local real X=CycloneGetHandleReal(t,"X")
  local real Y=CycloneGetHandleReal(t,"Y")
  call CycloneSetHandleHandle(GetExpiredTimer(),"dummy",u)
  call CycloneSetHandleReal(t,"distance",(distance+GetCycloneDistanceOffset()))
  call CycloneSetHandleReal(t,"direction",(direction+GetCycloneDegreesOffset()))
  call CycloneSetHandleReal(t,"X",GetLocationX(PolarProjectionBJ(Location(X,Y),GetCyclonePointOffset(),angle)))
  call CycloneSetHandleReal(t,"Y",GetLocationY(PolarProjectionBJ(Location(X,Y),GetCyclonePointOffset(),angle)))
  call SetUnitPositionLoc(u,PolarProjectionBJ(Location(X,Y),distance,direction))
  call ForGroupBJ(GetUnitsInRangeOfLocMatching(GetCycloneClose(),GetUnitLoc(u),Condition(function CycloneHasBuff)),function CycloneIssueOrder)
endfunction

function CycloneActions takes nothing returns nothing
  local real angle=AngleBetweenPoints(GetUnitLoc(GetTriggerUnit()),GetSpellTargetLoc())
  local real distance=GetCycloneStartingDistanceOffset()
  local real direction=.0
  local unit u
  local timer t=CreateTimer()
  call CreateNUnitsAtLoc(1,GetCycloneDummyRawcode(),GetOwningPlayer(GetTriggerUnit()),PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()),GetCycloneStartingPointOffset(),angle),angle)
  set u=bj_lastCreatedUnit
  call SetUnitAbilityLevelSwapped(GetCycloneDummySpellRawcode(),u,GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit()))
  set direction=angle
  call CycloneSetHandleHandle(t,"dummy",u)
  call CycloneSetHandleReal(t,"angle",angle)
  call CycloneSetHandleReal(t,"distance",distance)
  call CycloneSetHandleReal(t,"direction",direction)
  call CycloneSetHandleReal(t,"X",GetLocationX(GetUnitLoc(u)))
  call CycloneSetHandleReal(t,"Y",GetLocationY(GetUnitLoc(u)))
  call TimerStart(t,.01,true,function CycloneMove)
  call PolledWait(GetCycloneDuration())
  call CycloneFlushHandleLocals(t)
  call DestroyTimer(t)
  call KillUnit(u)
  call PolledWait(3.)
  call RemoveUnit(u)
endfunction

function Trig_Ancestral_Spirits_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0HA')
endfunction

function Trig_Ancestral_Spirits_Actions takes nothing returns nothing
  set udg_Ancestral_Spirit=GetTriggerUnit()
  set udg_Ancestral_Target=GetUnitLoc(udg_AncestralSpirt_Target)
  call ShowUnitHide(udg_Ancestral_Spirit)
  call PauseUnit(udg_Ancestral_Spirit,true)
  call SetUnitInvulnerable(udg_AncestralSpirt_Target,true)
  call TriggerSleepAction(.5)
  call CreateNUnitsAtLocFacingLocBJ(1,'e015',GetOwningPlayer(udg_Ancestral_Spirit),PolarProjectionBJ(udg_Ancestral_Target,500.,90.),udg_Ancestral_Target)
  call AddSpecialEffectTargetUnitBJ("hand right",bj_lastCreatedUnit,"Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("head",bj_lastCreatedUnit,"Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("hand left",bj_lastCreatedUnit,"Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("chest",bj_lastCreatedUnit,"Objects\\Spawnmodels\\Undead\\UCancelDeath\\UCancelDeath.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  set udg_Quad_Orcs[1]=bj_lastCreatedUnit
  call TriggerSleepAction(.25)
  call CreateNUnitsAtLocFacingLocBJ(1,'e016',GetOwningPlayer(udg_Ancestral_Spirit),PolarProjectionBJ(udg_Ancestral_Target,110.,180.),udg_Ancestral_Target)
  call AddSpecialEffectTargetUnitBJ("hand left",bj_lastCreatedUnit,"Abilities\\Spells\\Other\\Incinerate\\IncinerateBuff.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("head",bj_lastCreatedUnit,"Abilities\\Spells\\Other\\Incinerate\\IncinerateBuff.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("hand right",bj_lastCreatedUnit,"Abilities\\Spells\\Other\\Incinerate\\IncinerateBuff.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("chest",bj_lastCreatedUnit,"Abilities\\Spells\\Orc\\EtherealForm\\SpiritWalkerChange.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  set udg_Quad_Orcs[2]=bj_lastCreatedUnit
  call TriggerSleepAction(.25)
  call CreateNUnitsAtLocFacingLocBJ(1,'e017',GetOwningPlayer(udg_Ancestral_Spirit),PolarProjectionBJ(udg_Ancestral_Target,500.,270.),udg_Ancestral_Target)
  call AddSpecialEffectTargetUnitBJ("hand right",bj_lastCreatedUnit,"Abilities\\Spells\\Orc\\Purge\\PurgeBuffTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("hand left",bj_lastCreatedUnit,"Abilities\\Spells\\Orc\\Purge\\PurgeBuffTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("head",bj_lastCreatedUnit,"Abilities\\Spells\\Orc\\Purge\\PurgeBuffTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("chest",bj_lastCreatedUnit,"Abilities\\Spells\\Orc\\LightningShield\\LightningShieldTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  set udg_Quad_Orcs[3]=bj_lastCreatedUnit
  call TriggerSleepAction(.25)
  call CreateNUnitsAtLocFacingLocBJ(1,'e018',GetOwningPlayer(udg_Ancestral_Spirit),PolarProjectionBJ(udg_Ancestral_Target,110.,360.),udg_Ancestral_Target)
  call AddSpecialEffectTargetUnitBJ("hand right",bj_lastCreatedUnit,"Abilities\\Spells\\Human\\FlameStrike\\FlameStrikeDamageTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("hand left",bj_lastCreatedUnit,"Abilities\\Spells\\Human\\FlameStrike\\FlameStrikeDamageTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("head",bj_lastCreatedUnit,"Abilities\\Spells\\Human\\FlameStrike\\FlameStrikeDamageTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("chest",bj_lastCreatedUnit,"Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  set udg_Quad_Orcs[4]=bj_lastCreatedUnit
  call TriggerSleepAction(.25)
  call PlaySoundBJ(gg_snd_ShadowHunterPissed2)
  call TriggerSleepAction(1.75)
  call SetUnitInvulnerable(udg_AncestralSpirt_Target,false)
  call IssueTargetOrderById(udg_Quad_Orcs[1],852502,udg_Drunk_Target)
  call IssueImmediateOrderById(udg_Quad_Orcs[2],852127)
  call IssueTargetOrderById(udg_Quad_Orcs[3],852119,udg_Drunk_Target)
  call IssueImmediateOrderById(udg_Quad_Orcs[4],852128)
  call AddSpecialEffectLocBJ(udg_Ancestral_Target,"Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectLocBJ(udg_Ancestral_Target,"Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectLocBJ(udg_Ancestral_Target,"Abilities\\Spells\\Orc\\EarthQuake\\EarthQuakeTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectLocBJ(udg_Ancestral_Target,"Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call PlaySoundBJ(gg_snd_BuildingDeathLargeHuman)
  call TriggerSleepAction(1.)
  call RemoveUnit(udg_Quad_Orcs[1])
  call RemoveUnit(udg_Quad_Orcs[2])
  call RemoveUnit(udg_Quad_Orcs[3])
  call RemoveUnit(udg_Quad_Orcs[4])
  call SetUnitPositionLoc(udg_Ancestral_Spirit,PolarProjectionBJ(udg_Ancestral_Target,150.,GetRandomReal(0,360)))
  call PauseUnit(udg_Ancestral_Spirit,false)
  call ShowUnitShow(udg_Ancestral_Spirit)
  call RemoveLocation(udg_Ancestral_Target)
endfunction

function Trig_Spirits_Target_Conditions takes nothing returns boolean
  return(GetIssuedOrderId()==852171)
endfunction

function Trig_Spirits_Target_Actions takes nothing returns nothing
  set udg_AncestralSpirt_Target=GetOrderTargetUnit()
endfunction

function Trig_Mark_of_Flames_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0GK')
endfunction

function Trig_Mark_of_Flames_Actions takes nothing returns nothing
  set udg_Fire_Panda=GetTriggerUnit()
  set udg_Fire_Points=GetSpellTargetLoc()
  set udg_Flame_Ang=.0
  set udg_Flame_Dis=2000.
  set bj_forLoopAIndex=1
  set bj_forLoopAIndexEnd=20
  loop
    exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
    call CreateNUnitsAtLoc(1,'h00V',GetOwningPlayer(udg_Fire_Panda),PolarProjectionBJ(udg_Fire_Points,600.,udg_Flame_Ang),bj_UNIT_FACING)
    call UnitApplyTimedLifeBJ(7.,'BTLF',bj_lastCreatedUnit)
    set udg_Flame_Ang=(udg_Flame_Ang+18.)
    call TriggerSleepAction(.05)
    set bj_forLoopAIndex=bj_forLoopAIndex+1
  endloop
  set bj_forLoopAIndex=1
  set bj_forLoopAIndexEnd=11
  loop
    exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
    call CreateNUnitsAtLoc(1,'h00V',GetOwningPlayer(udg_Fire_Panda),PolarProjectionBJ(udg_Fire_Points,udg_Flame_Dis,45.),bj_UNIT_FACING)
    call UnitApplyTimedLifeBJ(4.,'BTLF',bj_lastCreatedUnit)
    call CreateNUnitsAtLoc(1,'h00V',GetOwningPlayer(udg_Fire_Panda),PolarProjectionBJ(udg_Fire_Points,udg_Flame_Dis,135.),bj_UNIT_FACING)
    call UnitApplyTimedLifeBJ(4.,'BTLF',bj_lastCreatedUnit)
    set udg_Flame_Dis=(udg_Flame_Dis-100.)
    call TriggerSleepAction(.05)
    set bj_forLoopAIndex=bj_forLoopAIndex+1
  endloop
  set udg_Flame_Dis=2000.
endfunction

function Trig_Flames_Explosion_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0GK')
endfunction

function Trig_Flames_Explosion_Actions takes nothing returns nothing
  call TerrainDeformationRippleBJ(5.,false,udg_Fire_Points,500.,600.,99.,1,512)
  set bj_forLoopAIndex=1
  set bj_forLoopAIndexEnd=30
  loop
    exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
    call AddSpecialEffectLocBJ(OffsetLocation(udg_Fire_Points,GetRandomReal(-500.,500.),GetRandomReal(-500.,500.)),"Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl")
    call DestroyEffect(bj_lastCreatedEffect)
    call AddSpecialEffectLocBJ(OffsetLocation(udg_Fire_Points,GetRandomReal(-500.,500.),GetRandomReal(-500.,500.)),"Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl")
    call DestroyEffect(bj_lastCreatedEffect)
    call AddSpecialEffectLocBJ(OffsetLocation(udg_Fire_Points,GetRandomReal(-500.,500.),GetRandomReal(-500.,500.)),"Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl")
    call DestroyEffect(bj_lastCreatedEffect)
    set bj_forLoopAIndex=bj_forLoopAIndex+1
  endloop
  call CreateNUnitsAtLoc(1,'h00V',GetOwningPlayer(udg_Fire_Panda),udg_Fire_Points,bj_UNIT_FACING)
  call UnitAddAbility(bj_lastCreatedUnit,'A0G5')
  call ExplodeUnitBJ(bj_lastCreatedUnit)
endfunction

function Trig_Tri_Disatser_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0G1')
endfunction

function Trig_Tri_Disatser_Actions takes nothing returns nothing
  set udg_Drunk_Panda=GetTriggerUnit()
  set udg_Drunken_Panda_Position=GetUnitLoc(udg_Drunk_Target)
  call ShowUnitHide(udg_Drunk_Panda)
  call PauseUnit(udg_Drunk_Panda,true)
  call SetUnitInvulnerable(udg_Drunk_Target,true)
  call TriggerSleepAction(.5)
  call CreateNUnitsAtLocFacingLocBJ(1,'e010',GetOwningPlayer(udg_Drunk_Panda),PolarProjectionBJ(udg_Drunken_Panda_Position,500.,90.),udg_Drunken_Panda_Position)
  call AddSpecialEffectTargetUnitBJ("hand right",bj_lastCreatedUnit,"Abilities\\Weapons\\ZigguratMissile\\ZigguratMissile.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("head",bj_lastCreatedUnit,"Abilities\\Weapons\\ZigguratMissile\\ZigguratMissile.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("hand left",bj_lastCreatedUnit,"Abilities\\Weapons\\ZigguratMissile\\ZigguratMissile.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("chest",bj_lastCreatedUnit,"Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  set udg_Drunk_Tri_Pandas[1]=bj_lastCreatedUnit
  call TriggerSleepAction(.25)
  call CreateNUnitsAtLocFacingLocBJ(1,'e011',GetOwningPlayer(udg_Drunk_Panda),PolarProjectionBJ(udg_Drunken_Panda_Position,500.,225.),udg_Drunken_Panda_Position)
  call AddSpecialEffectTargetUnitBJ("hand left",bj_lastCreatedUnit,"Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("head",bj_lastCreatedUnit,"Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("hand right",bj_lastCreatedUnit,"Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("chest",bj_lastCreatedUnit,"Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  set udg_Drunk_Tri_Pandas[2]=bj_lastCreatedUnit
  call TriggerSleepAction(.25)
  call CreateNUnitsAtLocFacingLocBJ(1,'e012',GetOwningPlayer(udg_Drunk_Panda),PolarProjectionBJ(udg_Drunken_Panda_Position,500.,315.),udg_Drunken_Panda_Position)
  call AddSpecialEffectTargetUnitBJ("hand right",bj_lastCreatedUnit,"Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("hand left",bj_lastCreatedUnit,"Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("head",bj_lastCreatedUnit,"Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectTargetUnitBJ("chest",bj_lastCreatedUnit,"Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  set udg_Drunk_Tri_Pandas[3]=bj_lastCreatedUnit
  call TriggerSleepAction(.25)
  call PlaySoundBJ(gg_snd_PandarenBrewmasterYesAttack2)
  call TriggerSleepAction(1.75)
  call SetUnitInvulnerable(udg_Drunk_Target,false)
  call SetUnitPositionLoc(udg_Drunk_Tri_Pandas[1],PolarProjectionBJ(udg_Drunken_Panda_Position,300.,270.))
  call SetUnitPositionLoc(udg_Drunk_Tri_Pandas[2],PolarProjectionBJ(udg_Drunken_Panda_Position,300.,45.))
  call SetUnitPositionLoc(udg_Drunk_Tri_Pandas[3],PolarProjectionBJ(udg_Drunken_Panda_Position,300.,135.))
  call CreateNUnitsAtLoc(1,'h00U',GetOwningPlayer(udg_Drunk_Panda),udg_Drunken_Panda_Position,bj_UNIT_FACING)
  call SetUnitTimeScalePercent(bj_lastCreatedUnit,20.)
  call IssueTargetOrderById(bj_lastCreatedUnit,851985,udg_Drunk_Target)
  call AddSpecialEffectLocBJ(udg_Drunken_Panda_Position,"Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectLocBJ(udg_Drunken_Panda_Position,"Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call AddSpecialEffectLocBJ(udg_Drunken_Panda_Position,"Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call PlaySoundBJ(gg_snd_BuildingDeathLargeHuman)
  call TriggerSleepAction(1.)
  call RemoveUnit(udg_Drunk_Tri_Pandas[1])
  call RemoveUnit(udg_Drunk_Tri_Pandas[2])
  call RemoveUnit(udg_Drunk_Tri_Pandas[3])
  call SetUnitPositionLoc(udg_Drunk_Panda,PolarProjectionBJ(udg_Drunken_Panda_Position,300.,GetRandomReal(0,360)))
  call PauseUnit(udg_Drunk_Panda,false)
  call ShowUnitShow(udg_Drunk_Panda)
  call RemoveLocation(udg_Drunken_Panda_Position)
endfunction

function Trig_Tri_Target_Conditions takes nothing returns boolean
  return(GetIssuedOrderId()==852171)
endfunction

function Trig_Tri_Target_Actions takes nothing returns nothing
  set udg_Drunk_Target=GetOrderTargetUnit()
endfunction

function Trig_Drunken_Brawler_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0HB')
endfunction

function Trig_Drunken_Brawler_Func004001003 takes nothing returns boolean
  return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(udg_Drunk_Panda)))
endfunction

function Trig_Drunken_Brawler_Func004002 takes nothing returns nothing
  call GroupAddUnit(udg_Drunken_Group,GetEnumUnit())
endfunction

function Trig_Drunken_Brawler_Func007Func001001 takes nothing returns boolean
  return(IsUnitDeadBJ(udg_Drunk_Panda))
endfunction

function Trig_Drunken_Brawler_Func007Func010001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0FZ',udg_Drunk_Panda)==1)
endfunction

function Trig_Drunken_Brawler_Func007Func011001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0FZ',udg_Drunk_Panda)==2)
endfunction

function Trig_Drunken_Brawler_Func007Func012001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0FZ',udg_Drunk_Panda)==3)
endfunction

function Trig_Drunken_Brawler_Func007Func013001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0FZ',udg_Drunk_Panda)==4)
endfunction

function Trig_Drunken_Brawler_Actions takes nothing returns nothing
  call GroupRemoveGroup(udg_Drunken_Group,udg_Drunken_Group)
  set udg_Drunk_Panda=GetTriggerUnit()
  set udg_Drunk_Points=GetUnitLoc(GetTriggerUnit())
  call ForGroupBJ(GetUnitsInRangeOfLocMatching(300.,udg_Drunk_Points,Condition(function Trig_Drunken_Brawler_Func004001003)),function Trig_Drunken_Brawler_Func004002)
  call PauseUnit(udg_Drunk_Panda,true)
  call SetUnitTimeScalePercent(udg_Drunk_Panda,300.)
  set bj_forLoopAIndex=1
  set bj_forLoopAIndexEnd=CountUnitsInGroup(udg_Drunken_Group)
  loop
    exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
    if(Trig_Drunken_Brawler_Func007Func001001())then
      return
    endif
    set udg_Drunk_Target=GroupPickRandomUnit(udg_Drunken_Group)
    call SetUnitPositionLocFacingLocBJ(udg_Drunk_Panda,PolarProjectionBJ(GetUnitLoc(udg_Drunk_Target),180.,GetRandomReal(0,360)),GetUnitLoc(udg_Drunk_Target))
    call AddSpecialEffectTargetUnitBJ("origin",udg_Drunk_Panda,"Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl")
    call DestroyEffect(bj_lastCreatedEffect)
    call CreateNUnitsAtLoc(1,'h00T',GetOwningPlayer(udg_Drunk_Panda),GetUnitLoc(udg_Drunk_Target),bj_UNIT_FACING)
    call SetUnitAnimation(udg_Drunk_Panda,"attack")
    call AddSpecialEffectTargetUnitBJ("chest",udg_Drunk_Target,"Abilities\\Spells\\Other\\StrongDrink\\BrewmasterMissile.mdl")
    call DestroyEffect(bj_lastCreatedEffect)
    if(Trig_Drunken_Brawler_Func007Func010001())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0FW')
    endif
    if(Trig_Drunken_Brawler_Func007Func011001())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0FX')
    endif
    if(Trig_Drunken_Brawler_Func007Func012001())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0FY')
    endif
    if(Trig_Drunken_Brawler_Func007Func013001())then
      call UnitAddAbility(bj_lastCreatedUnit,'A0HC')
    endif
    call IssueTargetOrderById(bj_lastCreatedUnit,851985,udg_Drunk_Target)
    call GroupRemoveUnit(udg_Drunken_Group,udg_Drunk_Target)
    call TriggerSleepAction(.7)
    set bj_forLoopAIndex=bj_forLoopAIndex+1
  endloop
  call PauseUnit(udg_Drunk_Panda,false)
  call SetUnitTimeScalePercent(udg_Drunk_Panda,100.)
endfunction

function Trig_Drunken_Flee_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0G0')
endfunction

function Trig_Drunken_Flee_Func002001003 takes nothing returns boolean
  return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(udg_Drunk_Panda)))
endfunction

function Trig_Drunken_Flee_Func002A takes nothing returns nothing
  call CreateNUnitsAtLoc(1,'h00T',GetOwningPlayer(udg_Drunk_Panda),udg_Drunk_Points,bj_UNIT_FACING)
  call IssueTargetOrderById(bj_lastCreatedUnit,852585,GetEnumUnit())
endfunction

function Trig_Drunken_Flee_Actions takes nothing returns nothing
  set udg_Drunk_Panda=GetTriggerUnit()
  call ForGroupBJ(GetUnitsInRangeOfLocMatching(350.,udg_Drunk_Points,Condition(function Trig_Drunken_Flee_Func002001003)),function Trig_Drunken_Flee_Func002A)
  call GroupRemoveGroup(udg_Drunken_Group,udg_Drunken_Group)
endfunction

function Trig_Flee_Point_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0G0')
endfunction

function Trig_Flee_Point_Actions takes nothing returns nothing
  set udg_Drunk_Points=GetUnitLoc(GetTriggerUnit())
endfunction

function Trig_Shadow_Gate_Copy_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0GD')
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func007001003001 takes nothing returns boolean
  return(IsUnitAliveBJ(GetFilterUnit()))
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func007001003002001 takes nothing returns boolean
  return(IsUnitType(GetFilterUnit(),UNIT_TYPE_GROUND)!=null)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func007001003002002001 takes nothing returns boolean
  return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)==false)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func007001003002002002001 takes nothing returns boolean
  return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func007001003002002002002 takes nothing returns boolean
  return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func007001003002002002 takes nothing returns boolean
  return GetBooleanAnd(Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func007001003002002002001(),Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func007001003002002002002())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func007001003002002 takes nothing returns boolean
  return GetBooleanAnd(Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func007001003002002001(),Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func007001003002002002())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func007001003002 takes nothing returns boolean
  return GetBooleanAnd(Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func007001003002001(),Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func007001003002002())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func007001003 takes nothing returns boolean
  return GetBooleanAnd(Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func007001003001(),Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func007001003002())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func007A takes nothing returns nothing
  call AddSpecialEffectLocBJ(GetUnitLoc(GetEnumUnit()),"Abilities\\Spells\\Items\\AIso\\AIsoTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call PauseUnit(GetEnumUnit(),true)
  call SetUnitInvulnerable(GetEnumUnit(),true)
  call GroupAddUnit(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],GetEnumUnit())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func009A takes nothing returns nothing
  call SetUnitInvulnerable(GetEnumUnit(),false)
  call UnitDamageTargetBJ(GetTriggerUnit(),GetEnumUnit(),(.5*GetUnitStateSwap(UNIT_STATE_MAX_LIFE,GetEnumUnit())),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
  call AddSpecialEffectTargetUnitBJ("overhead",GetEnumUnit(),"Objects\\Spawnmodels\\Undead\\UndeadDissipate\\UndeadDissipate.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call SetUnitInvulnerable(GetEnumUnit(),true)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func010Func001Func015C takes nothing returns boolean
  return(IsUnitType(GetEnumUnit(),UNIT_TYPE_HERO)==false)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func010Func001C takes nothing returns boolean
  return(IsUnitDeadBJ(GetEnumUnit()))and(Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func010Func001Func015C())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func010A takes nothing returns nothing
  if(Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func010Func001C())then
    set udg_TempPoint=GetUnitLoc(GetEnumUnit())
    call CreateNUnitsAtLoc(1,GetUnitTypeId(GetEnumUnit()),GetOwningPlayer(GetTriggerUnit()),udg_TempPoint,bj_UNIT_FACING)
    call RemoveLocation(udg_TempPoint)
    call GroupAddUnit(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],bj_lastCreatedUnit)
    call UnitAddType(bj_lastCreatedUnit,UNIT_TYPE_SUMMONED)
    call PauseUnit(bj_lastCreatedUnit,true)
    call SetUnitExploded(bj_lastCreatedUnit,true)
    call UnitApplyTimedLifeBJ(45.,'Brai',bj_lastCreatedUnit)
    call SetUnitUseFood(bj_lastCreatedUnit,false)
    call SetUnitVertexColorBJ(bj_lastCreatedUnit,.1,.1,.1,35.)
    call UnitAddAbility(bj_lastCreatedUnit,'A0G8')
    call UnitAddAbility(bj_lastCreatedUnit,'A0GA')
  endif
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func014Func001Func007C takes nothing returns boolean
  return(IsUnitType(GetEnumUnit(),UNIT_TYPE_HERO)==false)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func014Func001C takes nothing returns boolean
  return(IsUnitDeadBJ(GetEnumUnit()))and(Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func014Func001Func007C())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func014A takes nothing returns nothing
  if(Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func014Func001C())then
    call RemoveUnit(GetEnumUnit())
    call GroupRemoveUnit(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],GetEnumUnit())
  else
    call SetUnitInvulnerable(GetEnumUnit(),false)
    call PauseUnit(GetEnumUnit(),false)
    call GroupRemoveUnit(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],GetEnumUnit())
  endif
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GD',GetTriggerUnit())==4)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func008001003001 takes nothing returns boolean
  return(IsUnitAliveBJ(GetFilterUnit()))
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func008001003002001 takes nothing returns boolean
  return(IsUnitType(GetFilterUnit(),UNIT_TYPE_GROUND)!=null)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func008001003002002001 takes nothing returns boolean
  return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)==false)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func008001003002002002001 takes nothing returns boolean
  return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func008001003002002002002 takes nothing returns boolean
  return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func008001003002002002 takes nothing returns boolean
  return GetBooleanAnd(Trig_Shadow_Gate_Copy_Func001Func001Func001Func008001003002002002001(),Trig_Shadow_Gate_Copy_Func001Func001Func001Func008001003002002002002())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func008001003002002 takes nothing returns boolean
  return GetBooleanAnd(Trig_Shadow_Gate_Copy_Func001Func001Func001Func008001003002002001(),Trig_Shadow_Gate_Copy_Func001Func001Func001Func008001003002002002())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func008001003002 takes nothing returns boolean
  return GetBooleanAnd(Trig_Shadow_Gate_Copy_Func001Func001Func001Func008001003002001(),Trig_Shadow_Gate_Copy_Func001Func001Func001Func008001003002002())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func008001003 takes nothing returns boolean
  return GetBooleanAnd(Trig_Shadow_Gate_Copy_Func001Func001Func001Func008001003001(),Trig_Shadow_Gate_Copy_Func001Func001Func001Func008001003002())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func008A takes nothing returns nothing
  call AddSpecialEffectLocBJ(GetUnitLoc(GetEnumUnit()),"Abilities\\Spells\\Items\\AIso\\AIsoTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call PauseUnit(GetEnumUnit(),true)
  call SetUnitInvulnerable(GetEnumUnit(),true)
  call GroupAddUnit(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],GetEnumUnit())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func010A takes nothing returns nothing
  call SetUnitInvulnerable(GetEnumUnit(),false)
  call UnitDamageTargetBJ(GetTriggerUnit(),GetEnumUnit(),(.4*GetUnitStateSwap(UNIT_STATE_MAX_LIFE,GetEnumUnit())),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
  call AddSpecialEffectTargetUnitBJ("overhead",GetEnumUnit(),"Objects\\Spawnmodels\\Undead\\UndeadDissipate\\UndeadDissipate.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call SetUnitInvulnerable(GetEnumUnit(),true)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func011Func001Func015C takes nothing returns boolean
  return(IsUnitType(GetEnumUnit(),UNIT_TYPE_HERO)==false)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func011Func001C takes nothing returns boolean
  return(IsUnitDeadBJ(GetEnumUnit()))and(Trig_Shadow_Gate_Copy_Func001Func001Func001Func011Func001Func015C())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func011A takes nothing returns nothing
  if(Trig_Shadow_Gate_Copy_Func001Func001Func001Func011Func001C())then
    set udg_TempPoint=GetUnitLoc(GetEnumUnit())
    call CreateNUnitsAtLoc(1,GetUnitTypeId(GetEnumUnit()),GetOwningPlayer(GetTriggerUnit()),udg_TempPoint,bj_UNIT_FACING)
    call RemoveLocation(udg_TempPoint)
    call GroupAddUnit(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],bj_lastCreatedUnit)
    call UnitAddType(bj_lastCreatedUnit,UNIT_TYPE_SUMMONED)
    call PauseUnit(bj_lastCreatedUnit,true)
    call SetUnitExploded(bj_lastCreatedUnit,true)
    call UnitApplyTimedLifeBJ(45.,'Brai',bj_lastCreatedUnit)
    call SetUnitUseFood(bj_lastCreatedUnit,false)
    call SetUnitVertexColorBJ(bj_lastCreatedUnit,.1,.1,.1,35.)
    call UnitAddAbility(bj_lastCreatedUnit,'A0G8')
    call UnitAddAbility(bj_lastCreatedUnit,'A0GA')
  endif
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func015Func001Func007C takes nothing returns boolean
  return(IsUnitType(GetEnumUnit(),UNIT_TYPE_HERO)==false)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func015Func001C takes nothing returns boolean
  return(IsUnitDeadBJ(GetEnumUnit()))and(Trig_Shadow_Gate_Copy_Func001Func001Func001Func015Func001Func007C())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001Func015A takes nothing returns nothing
  if(Trig_Shadow_Gate_Copy_Func001Func001Func001Func015Func001C())then
    call RemoveUnit(GetEnumUnit())
    call GroupRemoveUnit(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],GetEnumUnit())
  else
    call SetUnitInvulnerable(GetEnumUnit(),false)
    call PauseUnit(GetEnumUnit(),false)
    call GroupRemoveUnit(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],GetEnumUnit())
  endif
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GD',GetTriggerUnit())==3)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func008001003001 takes nothing returns boolean
  return(IsUnitAliveBJ(GetFilterUnit()))
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func008001003002001 takes nothing returns boolean
  return(IsUnitType(GetFilterUnit(),UNIT_TYPE_GROUND)!=null)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func008001003002002001 takes nothing returns boolean
  return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)==false)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func008001003002002002001 takes nothing returns boolean
  return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func008001003002002002002 takes nothing returns boolean
  return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func008001003002002002 takes nothing returns boolean
  return GetBooleanAnd(Trig_Shadow_Gate_Copy_Func001Func001Func008001003002002002001(),Trig_Shadow_Gate_Copy_Func001Func001Func008001003002002002002())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func008001003002002 takes nothing returns boolean
  return GetBooleanAnd(Trig_Shadow_Gate_Copy_Func001Func001Func008001003002002001(),Trig_Shadow_Gate_Copy_Func001Func001Func008001003002002002())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func008001003002 takes nothing returns boolean
  return GetBooleanAnd(Trig_Shadow_Gate_Copy_Func001Func001Func008001003002001(),Trig_Shadow_Gate_Copy_Func001Func001Func008001003002002())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func008001003 takes nothing returns boolean
  return GetBooleanAnd(Trig_Shadow_Gate_Copy_Func001Func001Func008001003001(),Trig_Shadow_Gate_Copy_Func001Func001Func008001003002())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func008A takes nothing returns nothing
  call AddSpecialEffectLocBJ(GetUnitLoc(GetEnumUnit()),"Abilities\\Spells\\Items\\AIso\\AIsoTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call PauseUnit(GetEnumUnit(),true)
  call SetUnitInvulnerable(GetEnumUnit(),true)
  call GroupAddUnit(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],GetEnumUnit())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func010A takes nothing returns nothing
  call SetUnitInvulnerable(GetEnumUnit(),false)
  call UnitDamageTargetBJ(GetTriggerUnit(),GetEnumUnit(),(.3*GetUnitStateSwap(UNIT_STATE_MAX_LIFE,GetEnumUnit())),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
  call AddSpecialEffectTargetUnitBJ("overhead",GetEnumUnit(),"Objects\\Spawnmodels\\Undead\\UndeadDissipate\\UndeadDissipate.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call SetUnitInvulnerable(GetEnumUnit(),true)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func011Func001Func015C takes nothing returns boolean
  return(IsUnitType(GetEnumUnit(),UNIT_TYPE_HERO)==false)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func011Func001C takes nothing returns boolean
  return(IsUnitDeadBJ(GetEnumUnit()))and(Trig_Shadow_Gate_Copy_Func001Func001Func011Func001Func015C())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func011A takes nothing returns nothing
  if(Trig_Shadow_Gate_Copy_Func001Func001Func011Func001C())then
    set udg_TempPoint=GetUnitLoc(GetEnumUnit())
    call CreateNUnitsAtLoc(1,GetUnitTypeId(GetEnumUnit()),GetOwningPlayer(GetTriggerUnit()),udg_TempPoint,bj_UNIT_FACING)
    call RemoveLocation(udg_TempPoint)
    call GroupAddUnit(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],bj_lastCreatedUnit)
    call UnitAddType(bj_lastCreatedUnit,UNIT_TYPE_SUMMONED)
    call PauseUnit(bj_lastCreatedUnit,true)
    call SetUnitExploded(bj_lastCreatedUnit,true)
    call UnitApplyTimedLifeBJ(45.,'Brai',bj_lastCreatedUnit)
    call SetUnitUseFood(bj_lastCreatedUnit,false)
    call SetUnitVertexColorBJ(bj_lastCreatedUnit,.1,.1,.1,35.)
    call UnitAddAbility(bj_lastCreatedUnit,'A0G8')
    call UnitAddAbility(bj_lastCreatedUnit,'A0GA')
  endif
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func015Func001Func007C takes nothing returns boolean
  return(IsUnitType(GetEnumUnit(),UNIT_TYPE_HERO)==false)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func015Func001C takes nothing returns boolean
  return(IsUnitDeadBJ(GetEnumUnit()))and(Trig_Shadow_Gate_Copy_Func001Func001Func015Func001Func007C())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001Func015A takes nothing returns nothing
  if(Trig_Shadow_Gate_Copy_Func001Func001Func015Func001C())then
    call RemoveUnit(GetEnumUnit())
    call GroupRemoveUnit(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],GetEnumUnit())
  else
    call SetUnitInvulnerable(GetEnumUnit(),false)
    call PauseUnit(GetEnumUnit(),false)
    call GroupRemoveUnit(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],GetEnumUnit())
  endif
endfunction

function Trig_Shadow_Gate_Copy_Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GD',GetTriggerUnit())==2)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func008001003001 takes nothing returns boolean
  return(IsUnitAliveBJ(GetFilterUnit()))
endfunction

function Trig_Shadow_Gate_Copy_Func001Func008001003002001 takes nothing returns boolean
  return(IsUnitType(GetFilterUnit(),UNIT_TYPE_GROUND)!=null)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func008001003002002001 takes nothing returns boolean
  return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)==false)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func008001003002002002001 takes nothing returns boolean
  return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction

function Trig_Shadow_Gate_Copy_Func001Func008001003002002002002 takes nothing returns boolean
  return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func008001003002002002 takes nothing returns boolean
  return GetBooleanAnd(Trig_Shadow_Gate_Copy_Func001Func008001003002002002001(),Trig_Shadow_Gate_Copy_Func001Func008001003002002002002())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func008001003002002 takes nothing returns boolean
  return GetBooleanAnd(Trig_Shadow_Gate_Copy_Func001Func008001003002002001(),Trig_Shadow_Gate_Copy_Func001Func008001003002002002())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func008001003002 takes nothing returns boolean
  return GetBooleanAnd(Trig_Shadow_Gate_Copy_Func001Func008001003002001(),Trig_Shadow_Gate_Copy_Func001Func008001003002002())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func008001003 takes nothing returns boolean
  return GetBooleanAnd(Trig_Shadow_Gate_Copy_Func001Func008001003001(),Trig_Shadow_Gate_Copy_Func001Func008001003002())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func008A takes nothing returns nothing
  call AddSpecialEffectLocBJ(GetUnitLoc(GetEnumUnit()),"Abilities\\Spells\\Items\\AIso\\AIsoTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call PauseUnit(GetEnumUnit(),true)
  call SetUnitInvulnerable(GetEnumUnit(),true)
  call GroupAddUnit(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],GetEnumUnit())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func010A takes nothing returns nothing
  call SetUnitInvulnerable(GetEnumUnit(),false)
  call UnitDamageTargetBJ(GetTriggerUnit(),GetEnumUnit(),(.2*GetUnitStateSwap(UNIT_STATE_MAX_LIFE,GetEnumUnit())),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
  call AddSpecialEffectTargetUnitBJ("overhead",GetEnumUnit(),"Objects\\Spawnmodels\\Undead\\UndeadDissipate\\UndeadDissipate.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call SetUnitInvulnerable(GetEnumUnit(),true)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func011Func001Func015C takes nothing returns boolean
  return(IsUnitType(GetEnumUnit(),UNIT_TYPE_HERO)==false)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func011Func001C takes nothing returns boolean
  return(IsUnitDeadBJ(GetEnumUnit()))and(Trig_Shadow_Gate_Copy_Func001Func011Func001Func015C())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func011A takes nothing returns nothing
  if(Trig_Shadow_Gate_Copy_Func001Func011Func001C())then
    set udg_TempPoint=GetUnitLoc(GetEnumUnit())
    call CreateNUnitsAtLoc(1,GetUnitTypeId(GetEnumUnit()),GetOwningPlayer(GetTriggerUnit()),udg_TempPoint,bj_UNIT_FACING)
    call RemoveLocation(udg_TempPoint)
    call GroupAddUnit(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],bj_lastCreatedUnit)
    call UnitAddType(bj_lastCreatedUnit,UNIT_TYPE_SUMMONED)
    call PauseUnit(bj_lastCreatedUnit,true)
    call SetUnitExploded(bj_lastCreatedUnit,true)
    call UnitApplyTimedLifeBJ(45.,'Brai',bj_lastCreatedUnit)
    call SetUnitUseFood(bj_lastCreatedUnit,false)
    call SetUnitVertexColorBJ(bj_lastCreatedUnit,.1,.1,.1,35.)
    call UnitAddAbility(bj_lastCreatedUnit,'A0G8')
    call UnitAddAbility(bj_lastCreatedUnit,'A0GA')
  endif
endfunction

function Trig_Shadow_Gate_Copy_Func001Func015Func001Func007C takes nothing returns boolean
  return(IsUnitType(GetEnumUnit(),UNIT_TYPE_HERO)==false)
endfunction

function Trig_Shadow_Gate_Copy_Func001Func015Func001C takes nothing returns boolean
  return(IsUnitDeadBJ(GetEnumUnit()))and(Trig_Shadow_Gate_Copy_Func001Func015Func001Func007C())
endfunction

function Trig_Shadow_Gate_Copy_Func001Func015A takes nothing returns nothing
  if(Trig_Shadow_Gate_Copy_Func001Func015Func001C())then
    call RemoveUnit(GetEnumUnit())
    call GroupRemoveUnit(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],GetEnumUnit())
  else
    call SetUnitInvulnerable(GetEnumUnit(),false)
    call PauseUnit(GetEnumUnit(),false)
    call GroupRemoveUnit(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],GetEnumUnit())
  endif
endfunction

function Trig_Shadow_Gate_Copy_Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GD',GetTriggerUnit())==1)
endfunction

function Trig_Shadow_Gate_Copy_Actions takes nothing returns nothing
  if(Trig_Shadow_Gate_Copy_Func001C())then
    set udg_GatePoint[GetUnitUserData(GetTriggerUnit())]=GetSpellTargetLoc()
    set bj_forLoopAIndex=1
    set bj_forLoopAIndexEnd=8
    loop
      exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
      set udg_TempPoint=GetSpellTargetLoc()
      call CreateNUnitsAtLoc(1,'h00X',GetOwningPlayer(GetTriggerUnit()),udg_TempPoint,GetRandomReal(0,360))
      call RemoveLocation(udg_TempPoint)
      call UnitApplyTimedLifeBJ(12.,'BTLF',bj_lastCreatedUnit)
      set bj_forLoopAIndex=bj_forLoopAIndex+1
    endloop
    set udg_Gate_Ang=.0
    set bj_forLoopAIndex=1
    set bj_forLoopAIndexEnd=12
    loop
      exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
      call AddSpecialEffectLocBJ(PolarProjectionBJ(GetSpellTargetLoc(),275.,udg_Gate_Ang),"Abilities\\Spells\\Human\\Banish\\BanishTarget.mdl")
      call DestroyEffect(bj_lastCreatedEffect)
      call AddSpecialEffectLocBJ(PolarProjectionBJ(GetSpellTargetLoc(),275.,udg_Gate_Ang),"Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl")
      call DestroyEffect(bj_lastCreatedEffect)
      set udg_Gate_Ang=(udg_Gate_Ang+30.)
      set bj_forLoopAIndex=bj_forLoopAIndex+1
    endloop
    call TerrainDeformationCraterBJ(6.,true,GetSpellTargetLoc(),225.,400.)
    set bj_wantDestroyGroup=true
    call ForGroupBJ(GetUnitsInRangeOfLocMatching(175.,GetSpellTargetLoc(),Condition(function Trig_Shadow_Gate_Copy_Func001Func008001003)),function Trig_Shadow_Gate_Copy_Func001Func008A)
    call PolledWait(6.)
    call ForGroupBJ(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],function Trig_Shadow_Gate_Copy_Func001Func010A)
    call ForGroupBJ(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],function Trig_Shadow_Gate_Copy_Func001Func011A)
    call PolledWait(1.)
    call TerrainDeformationCraterBJ(5.,true,udg_GatePoint[GetUnitUserData(GetTriggerUnit())],225.,-400.)
    call PolledWait(3.)
    call ForGroupBJ(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],function Trig_Shadow_Gate_Copy_Func001Func015A)
  else
    if(Trig_Shadow_Gate_Copy_Func001Func001C())then
      set udg_GatePoint[GetUnitUserData(GetTriggerUnit())]=GetSpellTargetLoc()
      set bj_forLoopAIndex=1
      set bj_forLoopAIndexEnd=8
      loop
        exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
        set udg_TempPoint=GetSpellTargetLoc()
        call CreateNUnitsAtLoc(1,'h00X',GetOwningPlayer(GetTriggerUnit()),udg_TempPoint,GetRandomReal(0,360))
        call RemoveLocation(udg_TempPoint)
        call UnitApplyTimedLifeBJ(12.,'BTLF',bj_lastCreatedUnit)
        set bj_forLoopAIndex=bj_forLoopAIndex+1
      endloop
      set udg_Gate_Ang=.0
      set bj_forLoopAIndex=1
      set bj_forLoopAIndexEnd=12
      loop
        exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
        call AddSpecialEffectLocBJ(PolarProjectionBJ(GetSpellTargetLoc(),350.,udg_Gate_Ang),"Abilities\\Spells\\Human\\Banish\\BanishTarget.mdl")
        call DestroyEffect(bj_lastCreatedEffect)
        call AddSpecialEffectLocBJ(PolarProjectionBJ(GetSpellTargetLoc(),350.,udg_Gate_Ang),"Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl")
        call DestroyEffect(bj_lastCreatedEffect)
        set udg_Gate_Ang=(udg_Gate_Ang+30.)
        set bj_forLoopAIndex=bj_forLoopAIndex+1
      endloop
      call TerrainDeformationCraterBJ(6.,true,GetSpellTargetLoc(),300.,400.)
      set bj_wantDestroyGroup=true
      call ForGroupBJ(GetUnitsInRangeOfLocMatching(250.,GetSpellTargetLoc(),Condition(function Trig_Shadow_Gate_Copy_Func001Func001Func008001003)),function Trig_Shadow_Gate_Copy_Func001Func001Func008A)
      call PolledWait(6.)
      call ForGroupBJ(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],function Trig_Shadow_Gate_Copy_Func001Func001Func010A)
      call ForGroupBJ(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],function Trig_Shadow_Gate_Copy_Func001Func001Func011A)
      call PolledWait(1.)
      call TerrainDeformationCraterBJ(5.,true,udg_GatePoint[GetUnitUserData(GetTriggerUnit())],300.,-400.)
      call PolledWait(3.)
      call ForGroupBJ(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],function Trig_Shadow_Gate_Copy_Func001Func001Func015A)
    else
      if(Trig_Shadow_Gate_Copy_Func001Func001Func001C())then
        set udg_GatePoint[GetUnitUserData(GetTriggerUnit())]=GetSpellTargetLoc()
        set bj_forLoopAIndex=1
        set bj_forLoopAIndexEnd=8
        loop
          exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
          set udg_TempPoint=GetSpellTargetLoc()
          call CreateNUnitsAtLoc(1,'h00X',GetOwningPlayer(GetTriggerUnit()),udg_TempPoint,GetRandomReal(0,360))
          call RemoveLocation(udg_TempPoint)
          call UnitApplyTimedLifeBJ(12.,'BTLF',bj_lastCreatedUnit)
          set bj_forLoopAIndex=bj_forLoopAIndex+1
        endloop
        set udg_Gate_Ang=.0
        set bj_forLoopAIndex=1
        set bj_forLoopAIndexEnd=12
        loop
          exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
          call AddSpecialEffectLocBJ(PolarProjectionBJ(GetSpellTargetLoc(),425.,udg_Gate_Ang),"Abilities\\Spells\\Human\\Banish\\BanishTarget.mdl")
          call DestroyEffect(bj_lastCreatedEffect)
          call AddSpecialEffectLocBJ(PolarProjectionBJ(GetSpellTargetLoc(),425.,udg_Gate_Ang),"Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl")
          call DestroyEffect(bj_lastCreatedEffect)
          set udg_Gate_Ang=(udg_Gate_Ang+30.)
          set bj_forLoopAIndex=bj_forLoopAIndex+1
        endloop
        call TerrainDeformationCraterBJ(6.,true,GetSpellTargetLoc(),375.,400.)
        set bj_wantDestroyGroup=true
        call ForGroupBJ(GetUnitsInRangeOfLocMatching(325.,GetSpellTargetLoc(),Condition(function Trig_Shadow_Gate_Copy_Func001Func001Func001Func008001003)),function Trig_Shadow_Gate_Copy_Func001Func001Func001Func008A)
        call PolledWait(6.)
        call ForGroupBJ(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],function Trig_Shadow_Gate_Copy_Func001Func001Func001Func010A)
        call ForGroupBJ(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],function Trig_Shadow_Gate_Copy_Func001Func001Func001Func011A)
        call PolledWait(1.)
        call TerrainDeformationCraterBJ(5.,true,udg_GatePoint[GetUnitUserData(GetTriggerUnit())],375.,-400.)
        call PolledWait(3.)
        call ForGroupBJ(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],function Trig_Shadow_Gate_Copy_Func001Func001Func001Func015A)
      else
        if(Trig_Shadow_Gate_Copy_Func001Func001Func001Func001C())then
          set udg_GatePoint[GetUnitUserData(GetTriggerUnit())]=GetSpellTargetLoc()
          set bj_forLoopAIndex=1
          set bj_forLoopAIndexEnd=8
          loop
            exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
            set udg_TempPoint=GetSpellTargetLoc()
            call CreateNUnitsAtLoc(1,'h00X',GetOwningPlayer(GetTriggerUnit()),udg_TempPoint,GetRandomReal(0,360))
            call RemoveLocation(udg_TempPoint)
            call UnitApplyTimedLifeBJ(12.,'BTLF',bj_lastCreatedUnit)
            set bj_forLoopAIndex=bj_forLoopAIndex+1
          endloop
          set udg_Gate_Ang=.0
          set bj_forLoopAIndex=1
          set bj_forLoopAIndexEnd=12
          loop
            exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
            call AddSpecialEffectLocBJ(PolarProjectionBJ(GetSpellTargetLoc(),500.,udg_Gate_Ang),"Abilities\\Spells\\Human\\Banish\\BanishTarget.mdl")
            call DestroyEffect(bj_lastCreatedEffect)
            call AddSpecialEffectLocBJ(PolarProjectionBJ(GetSpellTargetLoc(),500.,udg_Gate_Ang),"Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl")
            call DestroyEffect(bj_lastCreatedEffect)
            set udg_Gate_Ang=(udg_Gate_Ang+30.)
            set bj_forLoopAIndex=bj_forLoopAIndex+1
          endloop
          call TerrainDeformationCraterBJ(6.,true,GetSpellTargetLoc(),450.,400.)
          set bj_wantDestroyGroup=true
          call ForGroupBJ(GetUnitsInRangeOfLocMatching(400.,GetSpellTargetLoc(),Condition(function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func007001003)),function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func007A)
          call PolledWait(6.)
          call ForGroupBJ(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func009A)
          call ForGroupBJ(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func010A)
          call PolledWait(1.)
          call TerrainDeformationCraterBJ(5.,true,udg_GatePoint[GetUnitUserData(GetTriggerUnit())],450.,-400.)
          call PolledWait(3.)
          call ForGroupBJ(udg_Shadow_Gate[GetUnitUserData(GetTriggerUnit())],function Trig_Shadow_Gate_Copy_Func001Func001Func001Func001Func014A)
        endif
      endif
    endif
  endif
endfunction

function Trig_Shadow_Bash_Func004C takes nothing returns boolean
  return(UnitHasBuffBJ(GetTriggerUnit(),'B02S')==false)and(IsUnitEnemy(GetTriggerUnit(),GetOwningPlayer(GetAttacker())))and(IsUnitType(GetTriggerUnit(),UNIT_TYPE_MECHANICAL)==false)
endfunction

function Trig_Shadow_Bash_Conditions takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GB',GetAttacker())>0)and(Trig_Shadow_Bash_Func004C())
endfunction

function Trig_Shadow_Bash_Func001001 takes nothing returns boolean
  return(UnitHasBuffBJ(GetTriggerUnit(),'B02R'))
endfunction

function Trig_Shadow_Bash_Func002C takes nothing returns boolean
  return(GetRandomInt(0,'d')<=udg_BashNumber)
endfunction

function Trig_Shadow_Bash_Actions takes nothing returns nothing
  if(Trig_Shadow_Bash_Func001001())then
    set udg_BashNumber=22
  else
    set udg_BashNumber=15
  endif
  if(Trig_Shadow_Bash_Func002C())then
    call PolledWait(.2)
    set udg_TempPoint=GetUnitLoc(GetTriggerUnit())
    call CreateNUnitsAtLoc(1,'h00W',Player(15),udg_TempPoint,bj_UNIT_FACING)
    call RemoveLocation(udg_TempPoint)
    call SetUnitExploded(bj_lastCreatedUnit,true)
    call UnitApplyTimedLifeBJ(15.,'BTLF',bj_lastCreatedUnit)
    call SetUnitVertexColorBJ(bj_lastCreatedUnit,.5,.5,.5,35.)
    call SetUnitMoveSpeed(bj_lastCreatedUnit,(GetUnitDefaultMoveSpeed(bj_lastCreatedUnit)-45.))
    set bj_forLoopAIndex=1
    set bj_forLoopAIndexEnd=(10+(6*GetUnitAbilityLevelSwapped('A0GB',GetAttacker())))
    loop
      exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
      set udg_ShadowBashDis[GetUnitUserData(GetAttacker())]=(udg_ShadowBashDis[GetUnitUserData(GetAttacker())]+50.)
      call SetUnitPositionLoc(bj_lastCreatedUnit,PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()),udg_ShadowBashDis[GetUnitUserData(GetAttacker())],GetUnitFacing(GetAttacker())))
      call AddSpecialEffectLocBJ(GetUnitLoc(bj_lastCreatedUnit),"Abilities\\Spells\\Undead\\DeathandDecay\\DeathandDecayTarget.mdl")
      call DestroyEffect(bj_lastCreatedEffect)
      set bj_forLoopAIndex=bj_forLoopAIndex+1
    endloop
    set udg_ShadowBashDis[GetUnitUserData(GetAttacker())]=.0
    call IssueTargetOrderById(bj_lastCreatedUnit,852226,GetTriggerUnit())
    set udg_TempPoint=GetUnitLoc(GetTriggerUnit())
    call CreateNUnitsAtLoc(1,'h00Y',GetOwningPlayer(GetAttacker()),udg_TempPoint,bj_UNIT_FACING)
    call RemoveLocation(udg_TempPoint)
    call UnitApplyTimedLifeBJ(15.,'BTLF',bj_lastCreatedUnit)
    call UnitAddAbility(bj_lastCreatedUnit,'A0G9')
    call SetUnitAbilityLevelSwapped('A0G9',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0GB',GetAttacker()))
    call IssueTargetOrderById(bj_lastCreatedUnit,852662,GetTriggerUnit())
  endif
endfunction

function Trig_Return_Shadow_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0G7')
endfunction

function Trig_Return_Shadow_Actions takes nothing returns nothing
  call AddSpecialEffectTargetUnitBJ("origin",GetSpellTargetUnit(),"Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
  call UnitRemoveAbility(GetSpellTargetUnit(),'B02S')
  call RemoveUnit(GetTriggerUnit())
endfunction

function Trig_Displace_Shadow_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0GC')
endfunction

function Trig_Displace_Shadow_Func003Func001C takes nothing returns boolean
  return(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())<=200.)
endfunction

function Trig_Displace_Shadow_Func003Func002Func001C takes nothing returns boolean
  return(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())<=400.)
endfunction

function Trig_Displace_Shadow_Func003Func002Func002Func001Func001C takes nothing returns boolean
  return(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())<=800.)
endfunction

function Trig_Displace_Shadow_Func003Func002Func002Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GC',GetTriggerUnit())==4)
endfunction

function Trig_Displace_Shadow_Func003Func002Func002Func002C takes nothing returns boolean
  return(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())<=600.)
endfunction

function Trig_Displace_Shadow_Func003Func002Func002C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GC',GetTriggerUnit())==3)
endfunction

function Trig_Displace_Shadow_Func003Func002C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GC',GetTriggerUnit())==2)
endfunction

function Trig_Displace_Shadow_Func003C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GC',GetTriggerUnit())==1)
endfunction

function Trig_Displace_Shadow_Func006Func001Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GC',GetTriggerUnit())==4)
endfunction

function Trig_Displace_Shadow_Func006Func001Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GC',GetTriggerUnit())==3)
endfunction

function Trig_Displace_Shadow_Func006Func001C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GC',GetTriggerUnit())==2)
endfunction

function Trig_Displace_Shadow_Func006C takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0GC',GetTriggerUnit())==1)
endfunction

function Trig_Displace_Shadow_Actions takes nothing returns nothing
  call KillUnit(udg_Shadow[GetUnitUserData(GetTriggerUnit())])
  if(Trig_Displace_Shadow_Func003C())then
    if(Trig_Displace_Shadow_Func003Func001C())then
      call SetWidgetLife(GetTriggerUnit(),1.)
    else
      call SetWidgetLife(GetTriggerUnit(),(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())-200.))
    endif
  else
    if(Trig_Displace_Shadow_Func003Func002C())then
      if(Trig_Displace_Shadow_Func003Func002Func001C())then
        call SetWidgetLife(GetTriggerUnit(),1.)
      else
        call SetWidgetLife(GetTriggerUnit(),(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())-400.))
      endif
    else
      if(Trig_Displace_Shadow_Func003Func002Func002C())then
        if(Trig_Displace_Shadow_Func003Func002Func002Func002C())then
          call SetWidgetLife(GetTriggerUnit(),1.)
        else
          call SetWidgetLife(GetTriggerUnit(),(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())-600.))
        endif
      else
        if(Trig_Displace_Shadow_Func003Func002Func002Func001C())then
          if(Trig_Displace_Shadow_Func003Func002Func002Func001Func001C())then
            call SetWidgetLife(GetTriggerUnit(),1.)
          else
            call SetWidgetLife(GetTriggerUnit(),(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())-800.))
          endif
        endif
      endif
    endif
  endif
  set udg_TempPoint=PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()),75.,(180.+GetUnitFacing(GetTriggerUnit())))
  if(Trig_Displace_Shadow_Func006C())then
    call CreateNUnitsAtLoc(1,'u015',GetOwningPlayer(GetTriggerUnit()),udg_TempPoint,bj_UNIT_FACING)
  else
    if(Trig_Displace_Shadow_Func006Func001C())then
      call CreateNUnitsAtLoc(1,'u016',GetOwningPlayer(GetTriggerUnit()),udg_TempPoint,bj_UNIT_FACING)
    else
      if(Trig_Displace_Shadow_Func006Func001Func001C())then
        call CreateNUnitsAtLoc(1,'u017',GetOwningPlayer(GetTriggerUnit()),udg_TempPoint,bj_UNIT_FACING)
      else
        if(Trig_Displace_Shadow_Func006Func001Func001Func001C())then
          call CreateNUnitsAtLoc(1,'u010',GetOwningPlayer(GetTriggerUnit()),udg_TempPoint,bj_UNIT_FACING)
        endif
      endif
    endif
  endif
  set udg_Shadow[GetUnitUserData(GetTriggerUnit())]=bj_lastCreatedUnit
  call SetUnitUserData(bj_lastCreatedUnit,GetUnitUserData(GetTriggerUnit()))
  call SetUnitVertexColorBJ(bj_lastCreatedUnit,.1,.1,.1,35.)
  call SetUnitAbilityLevelSwapped('A0GJ',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0GC',GetTriggerUnit()))
  call SetUnitAbilityLevelSwapped('A0GF',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0GC',GetTriggerUnit()))
  call AddSpecialEffectLocBJ(GetUnitLoc(bj_lastCreatedUnit),"Abilities\\Spells\\Undead\\DeathPact\\DeathPactTarget.mdl")
  call DestroyEffect(bj_lastCreatedEffect)
endfunction

function Trig_Shadowless_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0GF')
endfunction

function Trig_Shadowless_Func001C takes nothing returns boolean
  return(UnitHasBuffBJ(GetSpellTargetUnit(),'B02S'))
endfunction

function Trig_Shadowless_Actions takes nothing returns nothing
  if(Trig_Shadowless_Func001C())then
    call UnitDamageTargetBJ(GetTriggerUnit(),GetSpellTargetUnit(),(30.+(200.*I2R(GetUnitAbilityLevelSwapped('A0GF',GetTriggerUnit())))),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
    call AddSpecialEffectTargetUnitBJ("origin",GetSpellTargetUnit(),"Abilities\\Spells\\Undead\\DeathPact\\DeathPactTarget.mdl")
    call DestroyEffect(bj_lastCreatedEffect)
  else
    call AddSpecialEffectTargetUnitBJ("origin",GetSpellTargetUnit(),"Abilities\\Spells\\Items\\SpellShieldAmulet\\SpellShieldCaster.mdl")
    call DestroyEffect(bj_lastCreatedEffect)
  endif
endfunction

function Trig_Return_to_Body_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0GJ')
endfunction

function Trig_Return_to_Body_Func001C takes nothing returns boolean
  return(GetUnitTypeId(GetSpellTargetUnit())=='E014')
endfunction

function Trig_Return_to_Body_Actions takes nothing returns nothing
  if(Trig_Return_to_Body_Func001C())then
    call AddSpecialEffectLocBJ(GetUnitLoc(GetSpellTargetUnit()),"Objects\\Spawnmodels\\Undead\\UndeadDissipate\\UndeadDissipate.mdl")
    call DestroyEffect(bj_lastCreatedEffect)
    call SetWidgetLife(GetSpellTargetUnit(),(GetUnitStateSwap(UNIT_STATE_LIFE,GetSpellTargetUnit())+(.0+(150.*I2R(GetUnitAbilityLevelSwapped('A0G7',GetTriggerUnit()))))))
    call PolledWait(.5)
    call RemoveUnit(GetTriggerUnit())
  endif
endfunction

function Trig_Shadow_Stalk_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0GG')
endfunction

function Trig_Shadow_Stalk_Actions takes nothing returns nothing
  set udg_StalkCheck[GetUnitUserData(GetTriggerUnit())]=true
  call PolledWait(30.)
  set udg_StalkCheck[GetUnitUserData(GetTriggerUnit())]=false
endfunction

function Trig_Break_Shadow_Stalk_Func009C takes nothing returns boolean
  return(udg_StalkCheck[GetUnitUserData(GetAttacker())])
endfunction

function Trig_Break_Shadow_Stalk_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetAttacker())=='u017')and(Trig_Break_Shadow_Stalk_Func009C())
endfunction

function Trig_Break_Shadow_Stalk_Actions takes nothing returns nothing
  set udg_StalkCheck[GetUnitUserData(GetAttacker())]=false
  set udg_TempPoint=GetUnitLoc(GetTriggerUnit())
  call CreateNUnitsAtLoc(1,'h00Y',GetOwningPlayer(GetAttacker()),udg_TempPoint,bj_UNIT_FACING)
  call RemoveLocation(udg_TempPoint)
  call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
  call UnitAddAbility(bj_lastCreatedUnit,'A0GH')
  call IssueTargetOrderById(bj_lastCreatedUnit,852662,GetTriggerUnit())
endfunction

function Trig_Shadow_Gaze_Conditions takes nothing returns boolean
  return(GetSpellAbilityId()=='A0GE')
endfunction

function Trig_Shadow_Gaze_Func002001003001 takes nothing returns boolean
  return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)==false)
endfunction

function Trig_Shadow_Gaze_Func002001003002001 takes nothing returns boolean
  return(IsUnitAliveBJ(GetFilterUnit()))
endfunction

function Trig_Shadow_Gaze_Func002001003002002001 takes nothing returns boolean
  return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction

function Trig_Shadow_Gaze_Func002001003002002002 takes nothing returns boolean
  return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false)
endfunction

function Trig_Shadow_Gaze_Func002001003002002 takes nothing returns boolean
  return GetBooleanAnd(Trig_Shadow_Gaze_Func002001003002002001(),Trig_Shadow_Gaze_Func002001003002002002())
endfunction

function Trig_Shadow_Gaze_Func002001003002 takes nothing returns boolean
  return GetBooleanAnd(Trig_Shadow_Gaze_Func002001003002001(),Trig_Shadow_Gaze_Func002001003002002())
endfunction

function Trig_Shadow_Gaze_Func002001003 takes nothing returns boolean
  return GetBooleanAnd(Trig_Shadow_Gaze_Func002001003001(),Trig_Shadow_Gaze_Func002001003002())
endfunction

function Trig_Shadow_Gaze_Func002Func001Func013C takes nothing returns boolean
  return(GetUnitFacing(GetTriggerUnit())<=(GetUnitFacing(GetEnumUnit())+140.))and(GetUnitFacing(GetTriggerUnit())>=(GetUnitFacing(GetEnumUnit())-140.))
endfunction

function Trig_Shadow_Gaze_Func002Func001C takes nothing returns boolean
  return(Trig_Shadow_Gaze_Func002Func001Func013C())
endfunction

function Trig_Shadow_Gaze_Func002A takes nothing returns nothing
  if(Trig_Shadow_Gaze_Func002Func001C())then
    call UnitDamageTargetBJ(GetTriggerUnit(),GetEnumUnit(),(40.+(60.*I2R(GetUnitAbilityLevelSwapped('A0GE',GetTriggerUnit())))),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
    call AddSpecialEffectTargetUnitBJ("origin",GetEnumUnit(),"Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl")
    call DestroyEffect(bj_lastCreatedEffect)
  else
    call UnitDamageTargetBJ(GetTriggerUnit(),GetEnumUnit(),((40.+(60.*I2R(GetUnitAbilityLevelSwapped('A0GE',GetTriggerUnit()))))+(.0+(25.*I2R(GetUnitAbilityLevelSwapped('A0GE',GetTriggerUnit()))))),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
    call AddSpecialEffectTargetUnitBJ("origin",GetEnumUnit(),"Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl")
    call DestroyEffect(bj_lastCreatedEffect)
    set udg_TempPoint=GetUnitLoc(GetEnumUnit())
    call CreateNUnitsAtLoc(1,'h00Y',GetOwningPlayer(GetTriggerUnit()),udg_TempPoint,bj_UNIT_FACING)
    call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
    call RemoveLocation(udg_TempPoint)
    call UnitAddAbility(bj_lastCreatedUnit,'A0G6')
    call IssueTargetOrderById(bj_lastCreatedUnit,852095,GetEnumUnit())
  endif
endfunction

function Trig_Shadow_Gaze_Actions takes nothing returns nothing
  set bj_wantDestroyGroup=true
  call ForGroupBJ(GetUnitsInRangeOfLocMatching(250.,GetSpellTargetLoc(),Condition(function Trig_Shadow_Gaze_Func002001003)),function Trig_Shadow_Gaze_Func002A)
endfunction

function Trig_Remove_Casters_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetTriggerUnit())=='h00Y')
endfunction

function Trig_Remove_Casters_Actions takes nothing returns nothing
  call RemoveUnit(GetTriggerUnit())
endfunction

function Trig_Set_Chances_Actions takes nothing returns nothing
  set udg_PassiveSummonPercent=1
  set udg_PassiveBerserkPercent=1
  set udg_PassiveUnstablePercent=1
  set udg_PassivePerificationPercent=1
  set udg_PassiveUpheavalPercent=1
endfunction

function Trig_Passive_Perification_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetAttacker())=='H005')
endfunction

function Trig_Passive_Perification_Func001001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0IU',GetAttacker())==1)
endfunction

function Trig_Passive_Perification_Func002C takes nothing returns boolean
  return(udg_PassivePerificationPercent==udg_PassivePerificationChance)and(GetUnitAbilityLevelSwapped('A0IU',GetAttacker())==1)
endfunction

function Trig_Passive_Perification_Actions takes nothing returns nothing
  if(Trig_Passive_Perification_Func001001())then
    set udg_PassivePerificationChance=GetRandomInt(1,12)
  endif
  if(Trig_Passive_Perification_Func002C())then
    call CreateNUnitsAtLoc(1,'h01B',GetOwningPlayer(GetAttacker()),GetUnitLoc(GetAttacker()),bj_UNIT_FACING)
    call IssueTargetOrderById(bj_lastCreatedUnit,852092,GetAttacker())
    call TriggerSleepAction(2.)
    call RemoveUnit(bj_lastCreatedUnit)
  endif
endfunction

function Trig_Passive_Summon_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetAttacker())=='H00Q')
endfunction

function Trig_Passive_Summon_Func001001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0F5',GetAttacker())==1)
endfunction

function Trig_Passive_Summon_Func002001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0F5',GetAttacker())==2)
endfunction

function Trig_Passive_Summon_Func003001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0F5',GetAttacker())==3)
endfunction

function Trig_Passive_Summon_Func004001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0F5',GetAttacker())==4)
endfunction

function Trig_Passive_Summon_Func005C takes nothing returns boolean
  return(udg_PassiveSummonPercent==udg_PassiveSummonChance)
endfunction

function Trig_Passive_Summon_Actions takes nothing returns nothing
  if(Trig_Passive_Summon_Func001001())then
    set udg_PassiveSummonChance=GetRandomInt(1,17)
  endif
  if(Trig_Passive_Summon_Func002001())then
    set udg_PassiveSummonChance=GetRandomInt(1,8)
  endif
  if(Trig_Passive_Summon_Func003001())then
    set udg_PassiveSummonChance=GetRandomInt(1,6)
  endif
  if(Trig_Passive_Summon_Func004001())then
    set udg_PassiveSummonChance=GetRandomInt(1,4)
  endif
  if(Trig_Passive_Summon_Func005C())then
    call AddSpecialEffectTargetUnitBJ("chest",GetAttacker(),"Abilities\\Spells\\Undead\\DeathPact\\DeathPactTarget.mdl")
    call CreateNUnitsAtLoc(1,'h00S',GetOwningPlayer(GetAttacker()),GetUnitLoc(GetAttacker()),bj_UNIT_FACING)
    call UnitApplyTimedLifeBJ(25.,'BTLF',bj_lastCreatedUnit)
  endif
endfunction

function Trig_Passive_Summon_Check_Func001Func001Func001001 takes nothing returns boolean
  return(GetUnitTypeId(bj_lastCreatedUnit)=='h00S')
endfunction

function Trig_Passive_Summon_Check_Func001Func001C takes nothing returns boolean
  return(GetUnitTypeId(GetEnumUnit())=='h00S')and(CountUnitsInGroup(GetUnitsOfTypeIdAll('h00S'))>=10)
endfunction

function Trig_Passive_Summon_Check_Func001A takes nothing returns nothing
  if(Trig_Passive_Summon_Check_Func001Func001C())then
    if(Trig_Passive_Summon_Check_Func001Func001Func001001())then
      call RemoveUnit(bj_lastCreatedUnit)
    endif
  endif
endfunction

function Trig_Passive_Summon_Check_Actions takes nothing returns nothing
  call ForGroupBJ(GetUnitsInRectAll(bj_mapInitialPlayableArea),function Trig_Passive_Summon_Check_Func001A)
endfunction

function Trig_Passive_Berserk_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetAttacker())=='N020')
endfunction

function Trig_Passive_Berserk_Func001001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0EC',GetAttacker())==1)
endfunction

function Trig_Passive_Berserk_Func002001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0EC',GetAttacker())==2)
endfunction

function Trig_Passive_Berserk_Func003001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0EC',GetAttacker())==3)
endfunction

function Trig_Passive_Berserk_Func004001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0EC',GetAttacker())==4)
endfunction

function Trig_Passive_Berserk_Func005Func001Func006Func001C takes nothing returns boolean
  return(udg_PassiveBerserkPercent==udg_PassiveBerserkChance)and(GetUnitAbilityLevelSwapped('A0EC',GetAttacker())==4)
endfunction

function Trig_Passive_Berserk_Func005Func001Func006C takes nothing returns boolean
  return(udg_PassiveBerserkPercent==udg_PassiveBerserkChance)and(GetUnitAbilityLevelSwapped('A0EC',GetAttacker())==3)
endfunction

function Trig_Passive_Berserk_Func005Func001C takes nothing returns boolean
  return(udg_PassiveBerserkPercent==udg_PassiveBerserkChance)and(GetUnitAbilityLevelSwapped('A0EC',GetAttacker())==2)
endfunction

function Trig_Passive_Berserk_Func005C takes nothing returns boolean
  return(udg_PassiveBerserkPercent==udg_PassiveBerserkChance)and(GetUnitAbilityLevelSwapped('A0EC',GetAttacker())==1)
endfunction

function Trig_Passive_Berserk_Actions takes nothing returns nothing
  if(Trig_Passive_Berserk_Func001001())then
    set udg_PassiveBerserkChance=GetRandomInt(1,10)
  endif
  if(Trig_Passive_Berserk_Func002001())then
    set udg_PassiveBerserkChance=GetRandomInt(1,10)
  endif
  if(Trig_Passive_Berserk_Func003001())then
    set udg_PassiveBerserkChance=GetRandomInt(1,10)
  endif
  if(Trig_Passive_Berserk_Func004001())then
    set udg_PassiveBerserkChance=GetRandomInt(1,10)
  endif
  if(Trig_Passive_Berserk_Func005C())then
    call AddSpecialEffectTargetUnitBJ("Feet",GetAttacker(),"Abilities\\Spells\\Items\\AIam\\AIamTarget.mdl")
    call CreateNUnitsAtLoc(1,'e00T',GetOwningPlayer(GetAttacker()),GetUnitLoc(GetAttacker()),bj_UNIT_FACING)
    call IssueTargetOrderById(bj_lastCreatedUnit,852101,GetAttacker())
    call TriggerSleepAction(.1)
    call RemoveUnit(bj_lastCreatedUnit)
  else
    if(Trig_Passive_Berserk_Func005Func001C())then
      call AddSpecialEffectTargetUnitBJ("",GetAttacker(),"Abilities\\Spells\\Items\\AIam\\AIamTarget.mdl")
      call CreateNUnitsAtLoc(1,'e00S',GetOwningPlayer(GetAttacker()),GetUnitLoc(GetAttacker()),bj_UNIT_FACING)
      call IssueTargetOrderById(bj_lastCreatedUnit,852101,GetAttacker())
      call TriggerSleepAction(.1)
      call RemoveUnit(bj_lastCreatedUnit)
    else
      if(Trig_Passive_Berserk_Func005Func001Func006C())then
        call AddSpecialEffectTargetUnitBJ("",GetAttacker(),"Abilities\\Spells\\Items\\AIam\\AIamTarget.mdl")
        call CreateNUnitsAtLoc(1,'e00U',GetOwningPlayer(GetAttacker()),GetUnitLoc(GetAttacker()),bj_UNIT_FACING)
        call IssueTargetOrderById(bj_lastCreatedUnit,852101,GetAttacker())
        call TriggerSleepAction(.1)
        call RemoveUnit(bj_lastCreatedUnit)
      else
        if(Trig_Passive_Berserk_Func005Func001Func006Func001C())then
          call AddSpecialEffectTargetUnitBJ("",GetAttacker(),"Abilities\\Spells\\Items\\AIam\\AIamTarget.mdl")
          call CreateNUnitsAtLoc(1,'e00V',GetOwningPlayer(GetAttacker()),GetUnitLoc(GetAttacker()),bj_UNIT_FACING)
          call IssueTargetOrderById(bj_lastCreatedUnit,852101,GetAttacker())
          call TriggerSleepAction(.1)
          call RemoveUnit(bj_lastCreatedUnit)
        endif
      endif
    endif
  endif
endfunction

function Trig_Passive_Unstable_Power_Conditions takes nothing returns boolean
  return(GetUnitTypeId(GetAttacker())=='O00H')
endfunction

function Trig_Passive_Unstable_Power_Func001001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0DV',GetAttacker())==1)
endfunction

function Trig_Passive_Unstable_Power_Func002001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0DV',GetAttacker())==2)
endfunction

function Trig_Passive_Unstable_Power_Func003001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0DV',GetAttacker())==3)
endfunction

function Trig_Passive_Unstable_Power_Func004001 takes nothing returns boolean
  return(GetUnitAbilityLevelSwapped('A0DV',GetAttacker())==4)
endfunction

function Trig_Passive_Unstable_Power_Func005Func001Func002Func002C takes nothing returns boolean
  return(udg_PassiveUnstablePercent==udg_PassiveUnstableChance)and(GetUnitAbilityLevelSwapped('A0DV',GetAttacker())==4)
endfunction

function Trig_Passive_Unstable_Power_Func005Func001Func002C takes nothing returns boolean
  return(udg_PassiveUnstablePercent==udg_PassiveUnstableChance)and(GetUnitAbilityLevelSwapped('A0DV',GetAttacker())==3)
endfunction

function Trig_Passive_Unstable_Power_Func005Func001C takes nothing returns boolean
  return(udg_PassiveUnstablePercent==udg_PassiveUnstableChance)and(GetUnitAbilityLevelSwapped('A0DV',GetAttacker())==2)
endfunction

function Trig_Passive_Unstable_Power_Func005C takes nothing returns boolean
  return(udg_PassiveUnstablePercent==udg_PassiveUnstableChance)and(GetUnitAbilityLevelSwapped('A0DV',GetAttacker())==1)
endfunction

function Trig_Passive_Unstable_Power_Actions takes nothing returns nothing
  if(Trig_Passive_Unstable_Power_Func001001())then
    set udg_PassiveUnstableChance=GetRandomInt(1,10)
  endif
  if(Trig_Passive_Unstable_Power_Func002001())then
    set udg_PassiveUnstableChance=GetRandomInt(1,10)
  endif
  if(Trig_Passive_Unstable_Power_Func003001())then
    set udg_PassiveUnstableChance=GetRandomInt(1,10)
  endif
  if(Trig_Passive_Unstable_Power_Func004001())then
    set udg_PassiveUnstableChance=GetRandomInt(1,10)
  endif
  if(Trig_Passive_Unstable_Power_Func005C())then
    call AddSpecialEffectTargetUnitBJ("head",GetAttacker(),"Abilities\\Spells\\Orc\\Disenchant\\DisenchantSpecialArt.mdl")
    call CreateNUnitsAtLoc(1,'e00X',GetOwningPlayer(GetAttacker()),GetUnitLoc(GetAttacker()),bj_UNIT_FACING)
    call IssueImmediateOrderById(bj_lastCreatedUnit,852164)
    call TriggerSleepAction(.1)
    call RemoveUnit(bj_lastCreatedUnit)
  else
    if(Trig_Passive_Unstable_Power_Func005Func001C())then
      call AddSpecialEffectTargetUnitBJ("head",GetAttacker(),"Abilities\\Spells\\Orc\\Disenchant\\DisenchantSpecialArt.mdl")
      call CreateNUnitsAtLoc(1,'e00Y',GetOwningPlayer(GetAttacker()),GetUnitLoc(GetAttacker()),bj_UNIT_FACING)
      call IssueImmediateOrderById(bj_lastCreatedUnit,852164)
      call TriggerSleepAction(.1)
      call RemoveUnit(bj_lastCreatedUnit)
    else
      if(Trig_Passive_Unstable_Power_Func005Func001Func002C())then
        call AddSpecialEffectTargetUnitBJ("head",GetAttacker(),"Abilities\\Spells\\Orc\\Disenchant\\DisenchantSpecialArt.mdl")
        call CreateNUnitsAtLoc(1,'e00R',GetOwningPlayer(GetAttacker()),GetUnitLoc(GetAttacker()),bj_UNIT_FACING)
        call IssueImmediateOrderById(bj_lastCreatedUnit,852164)
        call TriggerSleepAction(.1)
        call RemoveUnit(bj_lastCreatedUnit)
      else
        if(Trig_Passive_Unstable_Power_Func005Func001Func002Func002C())then
          call AddSpecialEffectTargetUnitBJ("head",GetAttacker(),"Abilities\\Spells\\Orc\\Disenchant\\DisenchantSpecialArt.mdl")
          call CreateNUnitsAtLoc(1,'e00Z',GetOwningPlayer(GetAttacker()),GetUnitLoc(GetAttacker()),bj_UNIT_FACING)
          call IssueImmediateOrderById(bj_lastCreatedUnit,852164)
          call TriggerSleepAction(.1)
          call RemoveUnit(bj_lastCreatedUnit)
        endif
      endif
    endif
  endif
endfunction

function InitCustomTeams takes nothing returns nothing
  call SetPlayerTeam(Player(0),0)
  call SetPlayerTeam(Player(1),0)
  call SetPlayerTeam(Player(2),0)
  call SetPlayerTeam(Player(3),0)
  call SetPlayerTeam(Player(4),0)
  call SetPlayerTeam(Player(5),0)
  call SetPlayerTeam(Player(10),0)
  call SetPlayerAllianceStateAllyBJ(Player(0),Player(1),true)
  call SetPlayerAllianceStateAllyBJ(Player(0),Player(2),true)
  call SetPlayerAllianceStateAllyBJ(Player(0),Player(3),true)
  call SetPlayerAllianceStateAllyBJ(Player(0),Player(4),true)
  call SetPlayerAllianceStateAllyBJ(Player(0),Player(5),true)
  call SetPlayerAllianceStateAllyBJ(Player(0),Player(10),true)
  call SetPlayerAllianceStateAllyBJ(Player(1),Player(0),true)
  call SetPlayerAllianceStateAllyBJ(Player(1),Player(2),true)
  call SetPlayerAllianceStateAllyBJ(Player(1),Player(3),true)
  call SetPlayerAllianceStateAllyBJ(Player(1),Player(4),true)
  call SetPlayerAllianceStateAllyBJ(Player(1),Player(5),true)
  call SetPlayerAllianceStateAllyBJ(Player(1),Player(10),true)
  call SetPlayerAllianceStateAllyBJ(Player(2),Player(0),true)
  call SetPlayerAllianceStateAllyBJ(Player(2),Player(1),true)
  call SetPlayerAllianceStateAllyBJ(Player(2),Player(3),true)
  call SetPlayerAllianceStateAllyBJ(Player(2),Player(4),true)
  call SetPlayerAllianceStateAllyBJ(Player(2),Player(5),true)
  call SetPlayerAllianceStateAllyBJ(Player(2),Player(10),true)
  call SetPlayerAllianceStateAllyBJ(Player(3),Player(0),true)
  call SetPlayerAllianceStateAllyBJ(Player(3),Player(1),true)
  call SetPlayerAllianceStateAllyBJ(Player(3),Player(2),true)
  call SetPlayerAllianceStateAllyBJ(Player(3),Player(4),true)
  call SetPlayerAllianceStateAllyBJ(Player(3),Player(5),true)
  call SetPlayerAllianceStateAllyBJ(Player(3),Player(10),true)
  call SetPlayerAllianceStateAllyBJ(Player(4),Player(0),true)
  call SetPlayerAllianceStateAllyBJ(Player(4),Player(1),true)
  call SetPlayerAllianceStateAllyBJ(Player(4),Player(2),true)
  call SetPlayerAllianceStateAllyBJ(Player(4),Player(3),true)
  call SetPlayerAllianceStateAllyBJ(Player(4),Player(5),true)
  call SetPlayerAllianceStateAllyBJ(Player(4),Player(10),true)
  call SetPlayerAllianceStateAllyBJ(Player(5),Player(0),true)
  call SetPlayerAllianceStateAllyBJ(Player(5),Player(1),true)
  call SetPlayerAllianceStateAllyBJ(Player(5),Player(2),true)
  call SetPlayerAllianceStateAllyBJ(Player(5),Player(3),true)
  call SetPlayerAllianceStateAllyBJ(Player(5),Player(4),true)
  call SetPlayerAllianceStateAllyBJ(Player(5),Player(10),true)
  call SetPlayerAllianceStateAllyBJ(Player(10),Player(0),true)
  call SetPlayerAllianceStateAllyBJ(Player(10),Player(1),true)
  call SetPlayerAllianceStateAllyBJ(Player(10),Player(2),true)
  call SetPlayerAllianceStateAllyBJ(Player(10),Player(3),true)
  call SetPlayerAllianceStateAllyBJ(Player(10),Player(4),true)
  call SetPlayerAllianceStateAllyBJ(Player(10),Player(5),true)
  call SetPlayerAllianceStateVisionBJ(Player(0),Player(1),true)
  call SetPlayerAllianceStateVisionBJ(Player(0),Player(2),true)
  call SetPlayerAllianceStateVisionBJ(Player(0),Player(3),true)
  call SetPlayerAllianceStateVisionBJ(Player(0),Player(4),true)
  call SetPlayerAllianceStateVisionBJ(Player(0),Player(5),true)
  call SetPlayerAllianceStateVisionBJ(Player(0),Player(10),true)
  call SetPlayerAllianceStateVisionBJ(Player(1),Player(0),true)
  call SetPlayerAllianceStateVisionBJ(Player(1),Player(2),true)
  call SetPlayerAllianceStateVisionBJ(Player(1),Player(3),true)
  call SetPlayerAllianceStateVisionBJ(Player(1),Player(4),true)
  call SetPlayerAllianceStateVisionBJ(Player(1),Player(5),true)
  call SetPlayerAllianceStateVisionBJ(Player(1),Player(10),true)
  call SetPlayerAllianceStateVisionBJ(Player(2),Player(0),true)
  call SetPlayerAllianceStateVisionBJ(Player(2),Player(1),true)
  call SetPlayerAllianceStateVisionBJ(Player(2),Player(3),true)
  call SetPlayerAllianceStateVisionBJ(Player(2),Player(4),true)
  call SetPlayerAllianceStateVisionBJ(Player(2),Player(5),true)
  call SetPlayerAllianceStateVisionBJ(Player(2),Player(10),true)
  call SetPlayerAllianceStateVisionBJ(Player(3),Player(0),true)
  call SetPlayerAllianceStateVisionBJ(Player(3),Player(1),true)
  call SetPlayerAllianceStateVisionBJ(Player(3),Player(2),true)
  call SetPlayerAllianceStateVisionBJ(Player(3),Player(4),true)
  call SetPlayerAllianceStateVisionBJ(Player(3),Player(5),true)
  call SetPlayerAllianceStateVisionBJ(Player(3),Player(10),true)
  call SetPlayerAllianceStateVisionBJ(Player(4),Player(0),true)
  call SetPlayerAllianceStateVisionBJ(Player(4),Player(1),true)
  call SetPlayerAllianceStateVisionBJ(Player(4),Player(2),true)
  call SetPlayerAllianceStateVisionBJ(Player(4),Player(3),true)
  call SetPlayerAllianceStateVisionBJ(Player(4),Player(5),true)
  call SetPlayerAllianceStateVisionBJ(Player(4),Player(10),true)
  call SetPlayerAllianceStateVisionBJ(Player(5),Player(0),true)
  call SetPlayerAllianceStateVisionBJ(Player(5),Player(1),true)
  call SetPlayerAllianceStateVisionBJ(Player(5),Player(2),true)
  call SetPlayerAllianceStateVisionBJ(Player(5),Player(3),true)
  call SetPlayerAllianceStateVisionBJ(Player(5),Player(4),true)
  call SetPlayerAllianceStateVisionBJ(Player(5),Player(10),true)
  call SetPlayerAllianceStateVisionBJ(Player(10),Player(0),true)
  call SetPlayerAllianceStateVisionBJ(Player(10),Player(1),true)
  call SetPlayerAllianceStateVisionBJ(Player(10),Player(2),true)
  call SetPlayerAllianceStateVisionBJ(Player(10),Player(3),true)
  call SetPlayerAllianceStateVisionBJ(Player(10),Player(4),true)
  call SetPlayerAllianceStateVisionBJ(Player(10),Player(5),true)
  call SetPlayerTeam(Player(11),1)
endfunction

function main takes nothing returns nothing
  local weathereffect we
  local destructable d
  local trigger t
  local real life
  local integer itemID
  local player p
  local unit u
  local integer unitID
  local integer i
  local trigger m
  call SetCameraBounds(-7424.+GetCameraMargin(CAMERA_MARGIN_LEFT),-7680.+GetCameraMargin(CAMERA_MARGIN_BOTTOM),7424.-GetCameraMargin(CAMERA_MARGIN_RIGHT),7168.-GetCameraMargin(CAMERA_MARGIN_TOP),-7424.+GetCameraMargin(CAMERA_MARGIN_LEFT),7168.-GetCameraMargin(CAMERA_MARGIN_TOP),7424.-GetCameraMargin(CAMERA_MARGIN_RIGHT),-7680.+GetCameraMargin(CAMERA_MARGIN_BOTTOM))
  call SetDayNightModels("Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl","Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl")
  call SetTerrainFogEx(0,3000.,5000.,.5,.0,.0,.0)
  call NewSoundEnvironment("Default")
  call SetAmbientDaySound("SunkenRuinsDay")
  call SetAmbientNightSound("SunkenRuinsNight")
  call SetMapMusic("Music",true,0)
  set gg_snd_Levelupcaster=CreateSound("Abilities\\Spells\\Other\\Levelup\\Levelupcaster.wav",false,false,false,20,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_Levelupcaster,"LevelUp")
  call SetSoundDuration(gg_snd_Levelupcaster,2728)
  call SetSoundChannel(gg_snd_Levelupcaster,7)
  set gg_snd_BreathOfFrost1=CreateSound("war3mapImported\\BreathOfFrost1.wav",false,false,false,10,10,"")
  call SetSoundChannel(gg_snd_BreathOfFrost1,0)
  call SetSoundVolume(gg_snd_BreathOfFrost1,127)
  call SetSoundPitch(gg_snd_BreathOfFrost1,1.)
  set gg_snd_FlareTarget2=CreateSound("war3mapImported\\FlareTarget2.wav",false,false,false,10,10,"")
  call SetSoundChannel(gg_snd_FlareTarget2,0)
  call SetSoundVolume(gg_snd_FlareTarget2,127)
  call SetSoundPitch(gg_snd_FlareTarget2,1.)
  set gg_snd_LichKingDream=CreateSound("war3mapImported\\LichKingDream.wav",false,false,false,10,10,"")
  call SetSoundChannel(gg_snd_LichKingDream,0)
  call SetSoundVolume(gg_snd_LichKingDream,127)
  call SetSoundPitch(gg_snd_LichKingDream,1.)
  set gg_snd_MetalHeavySliceFlesh1=CreateSound("war3mapImported\\MetalHeavySliceFlesh1.wav",false,false,false,10,10,"")
  call SetSoundChannel(gg_snd_MetalHeavySliceFlesh1,0)
  call SetSoundVolume(gg_snd_MetalHeavySliceFlesh1,127)
  call SetSoundPitch(gg_snd_MetalHeavySliceFlesh1,1.)
  set gg_snd_MetalHeavySliceFlesh2=CreateSound("war3mapImported\\MetalHeavySliceFlesh2.wav",false,false,false,10,10,"")
  call SetSoundChannel(gg_snd_MetalHeavySliceFlesh2,0)
  call SetSoundVolume(gg_snd_MetalHeavySliceFlesh2,127)
  call SetSoundPitch(gg_snd_MetalHeavySliceFlesh2,1.)
  set gg_snd_MetalHeavySliceFlesh3=CreateSound("war3mapImported\\MetalHeavySliceFlesh3.wav",false,false,false,10,10,"")
  call SetSoundChannel(gg_snd_MetalHeavySliceFlesh3,0)
  call SetSoundVolume(gg_snd_MetalHeavySliceFlesh3,127)
  call SetSoundPitch(gg_snd_MetalHeavySliceFlesh3,1.)
  set gg_snd_KeeperOfTheGrovePissed1=CreateSound("Units\\NightElf\\HeroKeeperOfTheGrove\\KeeperOfTheGrovePissed1.wav",false,false,false,10,10,"HeroAcksEAX")
  call SetSoundParamsFromLabel(gg_snd_KeeperOfTheGrovePissed1,"HeroKeeperOfTheGrovePissed")
  call SetSoundDuration(gg_snd_KeeperOfTheGrovePissed1,3940)
  call SetSoundChannel(gg_snd_KeeperOfTheGrovePissed1,7)
  set gg_snd_KeeperOfTheGrovePissed3=CreateSound("Units\\NightElf\\HeroKeeperOfTheGrove\\KeeperOfTheGrovePissed3.wav",false,false,false,10,10,"HeroAcksEAX")
  call SetSoundParamsFromLabel(gg_snd_KeeperOfTheGrovePissed3,"HeroKeeperOfTheGrovePissed")
  call SetSoundDuration(gg_snd_KeeperOfTheGrovePissed3,2316)
  call SetSoundChannel(gg_snd_KeeperOfTheGrovePissed3,7)
  set gg_snd_HeroTinkerPissed6=CreateSound("Units\\Creeps\\HeroTinker\\HeroTinkerPissed6.wav",false,false,false,10,10,"HeroAcksEAX")
  call SetSoundParamsFromLabel(gg_snd_HeroTinkerPissed6,"HeroTinkerPissed")
  call SetSoundDuration(gg_snd_HeroTinkerPissed6,8280)
  call SetSoundChannel(gg_snd_HeroTinkerPissed6,7)
  set gg_snd_HeroTinkerPissed5=CreateSound("Units\\Creeps\\HeroTinker\\HeroTinkerPissed5.wav",false,false,false,10,10,"HeroAcksEAX")
  call SetSoundParamsFromLabel(gg_snd_HeroTinkerPissed5,"HeroTinkerPissed")
  call SetSoundDuration(gg_snd_HeroTinkerPissed5,4338)
  call SetSoundChannel(gg_snd_HeroTinkerPissed5,7)
  set gg_snd_HeroAlchemistPissed6=CreateSound("Units\\Creeps\\HEROGoblinALCHEMIST\\HeroAlchemistPissed6.wav",false,false,false,10,10,"HeroAcksEAX")
  call SetSoundParamsFromLabel(gg_snd_HeroAlchemistPissed6,"HEROGoblinALCHEMISTPissed")
  call SetSoundDuration(gg_snd_HeroAlchemistPissed6,10867)
  call SetSoundChannel(gg_snd_HeroAlchemistPissed6,7)
  set gg_snd_IronGolemDeath1=CreateSound("Units\\Creeps\\IronGolem\\IronGolemDeath1.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_IronGolemDeath1,"IronGolemDeath")
  call SetSoundDuration(gg_snd_IronGolemDeath1,3992)
  call SetSoundChannel(gg_snd_IronGolemDeath1,7)
  set gg_snd_IronGolemPissed2=CreateSound("Units\\Creeps\\IronGolem\\IronGolemPissed2.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_IronGolemPissed2,"IronGolemPissed")
  call SetSoundDuration(gg_snd_IronGolemPissed2,1939)
  call SetSoundChannel(gg_snd_IronGolemPissed2,7)
  set gg_snd_IronGolemPissed3=CreateSound("Units\\Creeps\\IronGolem\\IronGolemPissed3.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_IronGolemPissed3,"IronGolemPissed")
  call SetSoundDuration(gg_snd_IronGolemPissed3,2759)
  call SetSoundChannel(gg_snd_IronGolemPissed3,7)
  set gg_snd_IronGolemWhat1=CreateSound("Units\\Creeps\\IronGolem\\IronGolemWhat1.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_IronGolemWhat1,"IronGolemWhat")
  call SetSoundDuration(gg_snd_IronGolemWhat1,2003)
  call SetSoundChannel(gg_snd_IronGolemWhat1,7)
  set gg_snd_IronGolemYes2=CreateSound("Units\\Creeps\\IronGolem\\IronGolemYes2.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_IronGolemYes2,"IronGolemYes")
  call SetSoundDuration(gg_snd_IronGolemYes2,2000)
  call SetSoundChannel(gg_snd_IronGolemYes2,7)
  set gg_snd_GoblinSapperYesAttack3=CreateSound("Units\\Creeps\\GoblinSapper\\GoblinSapperYesAttack3.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_GoblinSapperYesAttack3,"GoblinSapperYesAttack")
  call SetSoundDuration(gg_snd_GoblinSapperYesAttack3,2026)
  call SetSoundChannel(gg_snd_GoblinSapperYesAttack3,7)
  set gg_snd_PandarenBrewmasterYesAttack2=CreateSound("Units\\Creeps\\PandarenBrewmaster\\PandarenBrewmasterYesAttack2.wav",false,false,true,10,10,"HeroAcksEAX")
  call SetSoundParamsFromLabel(gg_snd_PandarenBrewmasterYesAttack2,"PandarenBrewmasterYesAttack")
  call SetSoundDuration(gg_snd_PandarenBrewmasterYesAttack2,2711)
  set gg_snd_BuildingDeathLargeHuman=CreateSound("Sound\\Buildings\\Death\\BuildingDeathLargeHuman.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_BuildingDeathLargeHuman,"DeathHumanLargeBuilding")
  call SetSoundDuration(gg_snd_BuildingDeathLargeHuman,3460)
  set gg_snd_Tension=CreateSound("Sound\\Music\\mp3Music\\Tension.mp3",false,false,false,10,10,"")
  call SetSoundDuration(gg_snd_Tension,19540)
  call SetSoundChannel(gg_snd_Tension,0)
  call SetSoundVolume(gg_snd_Tension,127)
  call SetSoundPitch(gg_snd_Tension,1.)
  set gg_snd_CairneYesAttack4=CreateSound("Units\\Orc\\Cairne\\CairneYesAttack4.wav",false,false,true,10,10,"HeroAcksEAX")
  call SetSoundParamsFromLabel(gg_snd_CairneYesAttack4,"CairneYesAttack")
  call SetSoundDuration(gg_snd_CairneYesAttack4,1858)
  set gg_snd_CairneYesAttack1=CreateSound("Units\\Orc\\Cairne\\CairneYesAttack1.wav",false,false,true,10,10,"HeroAcksEAX")
  call SetSoundParamsFromLabel(gg_snd_CairneYesAttack1,"CairneYesAttack")
  call SetSoundDuration(gg_snd_CairneYesAttack1,1503)
  set gg_snd_D15ATagar06=CreateSound("Sound\\Dialogue\\OrcExpCamp\\OrcQuest15Ax\\D15ATagar06.mp3",false,false,false,10,10,"")
  call SetSoundParamsFromLabel(gg_snd_D15ATagar06,"D15ATagar06")
  call SetSoundDuration(gg_snd_D15ATagar06,21055)
  set gg_snd_DraeneiYesAttack2=CreateSound("Units\\Other\\Dranai\\DraeneiYesAttack2.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_DraeneiYesAttack2,"DraeneiYesAttack")
  call SetSoundDuration(gg_snd_DraeneiYesAttack2,1376)
  set gg_snd_CentaurReady1=CreateSound("Units\\Creeps\\Centaur\\CentaurReady1.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_CentaurReady1,"CentaurReady")
  call SetSoundDuration(gg_snd_CentaurReady1,1358)
  set gg_snd_CentaurYesAttack1=CreateSound("Units\\Creeps\\Centaur\\CentaurYesAttack1.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_CentaurYesAttack1,"CentaurYesAttack")
  call SetSoundDuration(gg_snd_CentaurYesAttack1,1320)
  set gg_snd_CentaurYesAttack3=CreateSound("Units\\Creeps\\Centaur\\CentaurYesAttack3.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_CentaurYesAttack3,"CentaurYesAttack")
  call SetSoundDuration(gg_snd_CentaurYesAttack3,1775)
  set gg_snd_HeroTaurenChieftainWarcry1=CreateSound("Units\\Orc\\HeroTaurenChieftain\\HeroTaurenChieftainWarcry1.wav",false,false,true,10,10,"HeroAcksEAX")
  call SetSoundParamsFromLabel(gg_snd_HeroTaurenChieftainWarcry1,"HeroTaurenChieftainWarcry")
  call SetSoundDuration(gg_snd_HeroTaurenChieftainWarcry1,2879)
  set gg_snd_HeroTaurenChieftainWhat3=CreateSound("Units\\Orc\\HeroTaurenChieftain\\HeroTaurenChieftainWhat3.wav",false,false,true,10,10,"HeroAcksEAX")
  call SetSoundParamsFromLabel(gg_snd_HeroTaurenChieftainWhat3,"HeroTaurenChieftainWhat")
  call SetSoundDuration(gg_snd_HeroTaurenChieftainWhat3,1627)
  set gg_snd_TaurenDeath1=CreateSound("Units\\Orc\\Tauren\\TaurenDeath1.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_TaurenDeath1,"TaurenDeath")
  call SetSoundDuration(gg_snd_TaurenDeath1,3377)
  set gg_snd_TaurenReady1=CreateSound("Units\\Orc\\Tauren\\TaurenReady1.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_TaurenReady1,"TaurenReady")
  call SetSoundDuration(gg_snd_TaurenReady1,2717)
  set gg_snd_TaurenYesAttack1=CreateSound("Units\\Orc\\Tauren\\TaurenYesAttack1.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_TaurenYesAttack1,"TaurenYesAttack")
  call SetSoundDuration(gg_snd_TaurenYesAttack1,2206)
  set gg_snd_TaurenPissed1=CreateSound("Units\\Orc\\Tauren\\TaurenPissed1.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_TaurenPissed1,"TaurenPissed")
  call SetSoundDuration(gg_snd_TaurenPissed1,3030)
  set gg_snd_WhiteTaurenWarcry1=CreateSound("Units\\Orc\\SpiritWalker\\WhiteTaurenWarcry1.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_WhiteTaurenWarcry1,"SpiritWalkerWarcry")
  call SetSoundDuration(gg_snd_WhiteTaurenWarcry1,2833)
  set gg_snd_CentaurArcherDeath=CreateSound("Units\\Creeps\\CentaurArcher\\CentaurArcherDeath.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_CentaurArcherDeath,"CentaurArcherDeath")
  call SetSoundDuration(gg_snd_CentaurArcherDeath,2076)
  set gg_snd_CentaurDeath=CreateSound("Units\\Creeps\\Centaur\\CentaurDeath.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_CentaurDeath,"CentaurDeath")
  call SetSoundDuration(gg_snd_CentaurDeath,2006)
  set gg_snd_TaurenYesAttack3=CreateSound("Units\\Orc\\Tauren\\TaurenYesAttack3.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_TaurenYesAttack3,"TaurenYesAttack")
  call SetSoundDuration(gg_snd_TaurenYesAttack3,1294)
  set gg_snd_Warstomp=CreateSound("Units\\Orc\\Tauren\\Warstomp.wav",false,false,true,10,10,"SpellsEAX")
  call SetSoundParamsFromLabel(gg_snd_Warstomp,"Pulverize")
  call SetSoundDuration(gg_snd_Warstomp,2163)
  set gg_snd_ArrowAttack1=CreateSound("Abilities\\Weapons\\Arrow\\ArrowAttack1.wav",false,false,true,10,10,"MissilesEAX")
  call SetSoundParamsFromLabel(gg_snd_ArrowAttack1,"ArrowLaunch")
  call SetSoundDuration(gg_snd_ArrowAttack1,672)
  set gg_snd_ArrowImpact=CreateSound("Abilities\\Weapons\\Arrow\\ArrowImpact.wav",false,false,true,10,10,"MissilesEAX")
  call SetSoundParamsFromLabel(gg_snd_ArrowImpact,"ArrowHit")
  call SetSoundDuration(gg_snd_ArrowImpact,665)
  set gg_snd_MetalHeavyChopFlesh2=CreateSound("Sound\\Units\\Combat\\MetalHeavyChopFlesh2.wav",false,false,true,10,10,"CombatSoundsEAX")
  call SetSoundParamsFromLabel(gg_snd_MetalHeavyChopFlesh2,"MetalHeavyChopFlesh")
  call SetSoundDuration(gg_snd_MetalHeavyChopFlesh2,758)
  set gg_snd_WoodHeavyBashFlesh1=CreateSound("Sound\\Units\\Combat\\WoodHeavyBashFlesh1.wav",false,false,true,10,10,"CombatSoundsEAX")
  call SetSoundParamsFromLabel(gg_snd_WoodHeavyBashFlesh1,"WoodHeavyBashFlesh")
  call SetSoundDuration(gg_snd_WoodHeavyBashFlesh1,1051)
  set gg_snd_DestroyerMissile=CreateSound("Abilities\\Weapons\\AvengerMissile\\DestroyerMissile.wav",false,false,true,10,10,"MissilesEAX")
  call SetSoundParamsFromLabel(gg_snd_DestroyerMissile,"DestroyerMissileLaunch")
  call SetSoundDuration(gg_snd_DestroyerMissile,817)
  set gg_snd_CentaurYes2=CreateSound("Units\\Creeps\\Centaur\\CentaurYes2.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_CentaurYes2,"CentaurYes")
  call SetSoundDuration(gg_snd_CentaurYes2,907)
  set gg_snd_CentaurPissed1=CreateSound("Units\\Creeps\\Centaur\\CentaurPissed1.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_CentaurPissed1,"CentaurPissed")
  call SetSoundDuration(gg_snd_CentaurPissed1,4271)
  set gg_snd_ShadowHunterPissed2=CreateSound("Units\\Orc\\HeroShadowHunter\\ShadowHunterPissed2.wav",false,false,true,10,10,"HeroAcksEAX")
  call SetSoundParamsFromLabel(gg_snd_ShadowHunterPissed2,"HeroShadowHunterPissed")
  call SetSoundDuration(gg_snd_ShadowHunterPissed2,1789)
  set gg_snd_SpiritWolfYesAttack3=CreateSound("Units\\Orc\\Spiritwolf\\SpiritWolfYesAttack3.wav",false,true,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_SpiritWolfYesAttack3,"SpiritWolfYesAttack")
  call SetSoundDuration(gg_snd_SpiritWolfYesAttack3,995)
  set gg_snd_CrippleTarget1=CreateSound("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget1.wav",false,true,true,10,10,"SpellsEAX")
  call SetSoundParamsFromLabel(gg_snd_CrippleTarget1,"Cripple")
  call SetSoundDuration(gg_snd_CrippleTarget1,2316)
  set gg_snd_RestorationPotion=CreateSound("Abilities\\Spells\\Items\\AIre\\RestorationPotion.wav",false,false,true,10,10,"SpellsEAX")
  call SetSoundParamsFromLabel(gg_snd_RestorationPotion,"RestorationPotion")
  call SetSoundDuration(gg_snd_RestorationPotion,3158)
  set gg_snd_LightningBolt=CreateSound("Abilities\\Spells\\Orc\\LightningBolt\\LightningBolt.wav",false,false,true,10,10,"SpellsEAX")
  call SetSoundParamsFromLabel(gg_snd_LightningBolt,"LightningBolt")
  call SetSoundDuration(gg_snd_LightningBolt,2136)
  set gg_snd_ShadowHunterReady1=CreateSound("Units\\Orc\\HeroShadowHunter\\ShadowHunterReady1.wav",false,false,true,10,10,"HeroAcksEAX")
  call SetSoundParamsFromLabel(gg_snd_ShadowHunterReady1,"HeroShadowHunterReady")
  call SetSoundDuration(gg_snd_ShadowHunterReady1,2992)
  set gg_snd_ShadowHunterYes1=CreateSound("Units\\Orc\\HeroShadowHunter\\ShadowHunterYes1.wav",false,false,true,10,10,"HeroAcksEAX")
  call SetSoundParamsFromLabel(gg_snd_ShadowHunterYes1,"HeroShadowHunterYes")
  call SetSoundDuration(gg_snd_ShadowHunterYes1,1400)
  set gg_snd_ClockwerkGoblinYesAttack1=CreateSound("Units\\Creeps\\HeroTinkerRobot\\ClockwerkGoblinYesAttack1.wav",false,false,true,10,10,"HeroAcksEAX")
  call SetSoundParamsFromLabel(gg_snd_ClockwerkGoblinYesAttack1,"ClockwerkGoblinYesAttack")
  call SetSoundDuration(gg_snd_ClockwerkGoblinYesAttack1,1416)
  set gg_snd_GoblinZeppelinPissed2=CreateSound("Units\\Creeps\\GoblinZeppelin\\GoblinZeppelinPissed2.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_GoblinZeppelinPissed2,"GoblinZeppelinPissed")
  call SetSoundDuration(gg_snd_GoblinZeppelinPissed2,2604)
  set gg_snd_HeroShadowHunterDeath=CreateSound("Units\\Orc\\HeroShadowHunter\\HeroShadowHunterDeath.wav",false,false,true,10,10,"HeroAcksEAX")
  call SetSoundParamsFromLabel(gg_snd_HeroShadowHunterDeath,"HeroShadowHunterDeath")
  call SetSoundDuration(gg_snd_HeroShadowHunterDeath,2217)
  set gg_snd_ShadowHunterWhat1=CreateSound("Units\\Orc\\HeroShadowHunter\\ShadowHunterWhat1.wav",false,false,true,10,10,"HeroAcksEAX")
  call SetSoundParamsFromLabel(gg_snd_ShadowHunterWhat1,"HeroShadowHunterWhat")
  call SetSoundDuration(gg_snd_ShadowHunterWhat1,1811)
  set gg_snd_ShadowHunterYes2=CreateSound("Units\\Orc\\HeroShadowHunter\\ShadowHunterYes2.wav",false,false,true,10,10,"HeroAcksEAX")
  call SetSoundParamsFromLabel(gg_snd_ShadowHunterYes2,"HeroShadowHunterYes")
  call SetSoundDuration(gg_snd_ShadowHunterYes2,1707)
  set gg_snd_GhoulPissed3=CreateSound("Units\\Undead\\Ghoul\\GhoulPissed3.wav",false,true,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_GhoulPissed3,"GhoulPissed")
  call SetSoundDuration(gg_snd_GhoulPissed3,2441)
  set gg_snd_ShamanPissed1=CreateSound("Units\\Orc\\Shaman\\ShamanPissed1.wav",false,false,true,10,10,"DefaultEAXON")
  call SetSoundParamsFromLabel(gg_snd_ShamanPissed1,"ShamanPissed")
  call SetSoundDuration(gg_snd_ShamanPissed1,5608)
  set gg_snd_MetalHeavySliceFlesh101=CreateSound("Sound\\Units\\Combat\\MetalHeavySliceFlesh1.wav",false,true,true,10,10,"CombatSoundsEAX")
  call SetSoundParamsFromLabel(gg_snd_MetalHeavySliceFlesh101,"MetalHeavySliceFlesh")
  call SetSoundDuration(gg_snd_MetalHeavySliceFlesh101,1104)
  set gg_snd_MetalHeavySliceFlesh201=CreateSound("Sound\\Units\\Combat\\MetalHeavySliceFlesh2.wav",false,true,true,10,10,"CombatSoundsEAX")
  call SetSoundParamsFromLabel(gg_snd_MetalHeavySliceFlesh201,"MetalHeavySliceFlesh")
  call SetSoundDuration(gg_snd_MetalHeavySliceFlesh201,946)
  set gg_snd_PossessionMissileLaunch1=CreateSound("Abilities\\Spells\\Undead\\Possession\\PossessionMissileLaunch1.wav",false,true,true,10,10,"SpellsEAX")
  call SetSoundParamsFromLabel(gg_snd_PossessionMissileLaunch1,"PossessionMissileLaunch")
  call SetSoundDuration(gg_snd_PossessionMissileLaunch1,1335)
  set gg_snd_CreepAggroWhat1=CreateSound("Sound\\Interface\\CreepAggroWhat1.wav",false,false,false,10,10,"")
  call SetSoundParamsFromLabel(gg_snd_CreepAggroWhat1,"CreepAggro")
  call SetSoundDuration(gg_snd_CreepAggroWhat1,1236)
  set gg_snd_HeroBladeMasterDeath=CreateSound("Units\\Orc\\HeroBladeMaster\\HeroBladeMasterDeath.wav",false,false,true,10,10,"HeroAcksEAX")
  call SetSoundParamsFromLabel(gg_snd_HeroBladeMasterDeath,"HeroBladeMasterDeath")
  call SetSoundDuration(gg_snd_HeroBladeMasterDeath,2349)
  set gg_snd_HeroBladeMasterPissed1=CreateSound("Units\\Orc\\HeroBladeMaster\\HeroBladeMasterPissed1.wav",false,false,true,10,10,"HeroAcksEAX")
  call SetSoundParamsFromLabel(gg_snd_HeroBladeMasterPissed1,"HeroBladeMasterPissed")
  call SetSoundDuration(gg_snd_HeroBladeMasterPissed1,2235)
  set gg_snd_HeroBladeMasterWarcry1=CreateSound("Units\\Orc\\HeroBladeMaster\\HeroBladeMasterWarcry1.wav",false,false,true,10,10,"HeroAcksEAX")
  call SetSoundParamsFromLabel(gg_snd_HeroBladeMasterWarcry1,"HeroBladeMasterWarcry")
  call SetSoundDuration(gg_snd_HeroBladeMasterWarcry1,2136)
  set gg_snd_ReviveHuman=CreateSound("Abilities\\Spells\\Human\\ReviveHuman\\ReviveHuman.wav",false,false,true,10,10,"SpellsEAX")
  call SetSoundParamsFromLabel(gg_snd_ReviveHuman,"ReviveHuman")
  call SetSoundDuration(gg_snd_ReviveHuman,3196)
  set gg_snd_QuestCompleted=CreateSound("Sound\\Interface\\QuestCompleted.wav",false,false,false,10,10,"")
  call SetSoundParamsFromLabel(gg_snd_QuestCompleted,"QuestCompleted")
  call SetSoundDuration(gg_snd_QuestCompleted,5155)
  set gg_snd_QuestNew=CreateSound("Sound\\Interface\\QuestNew.wav",false,false,false,10,10,"")
  call SetSoundParamsFromLabel(gg_snd_QuestNew,"QuestNew")
  call SetSoundDuration(gg_snd_QuestNew,3750)
  set gg_snd_CycloneBirth1=CreateSound("Abilities\\Spells\\NightElf\\Cyclone\\CycloneBirth1.wav",false,false,true,10,10,"SpellsEAX")
  call SetSoundParamsFromLabel(gg_snd_CycloneBirth1,"CycloneBirth")
  call SetSoundDuration(gg_snd_CycloneBirth1,3228)
  set gg_snd_FrostArmorTarget1=CreateSound("Abilities\\Spells\\Undead\\FrostArmor\\FrostArmorTarget1.wav",false,false,true,10,10,"SpellsEAX")
  call SetSoundParamsFromLabel(gg_snd_FrostArmorTarget1,"FrostArmor")
  call SetSoundDuration(gg_snd_FrostArmorTarget1,2995)
  set gg_snd_Submerge1=CreateSound("Abilities\\Spells\\Other\\Submerge\\Submerge1.wav",false,false,true,10,10,"SpellsEAX")
  call SetSoundParamsFromLabel(gg_snd_Submerge1,"SubmergeSound")
  call SetSoundDuration(gg_snd_Submerge1,1524)
  set gg_snd_MonsoonRainLoop=CreateSound("Abilities\\Spells\\Other\\Monsoon\\MonsoonRainLoop.wav",false,false,true,10,10,"SpellsEAX")
  call SetSoundParamsFromLabel(gg_snd_MonsoonRainLoop,"MonsoonLoop")
  call SetSoundDuration(gg_snd_MonsoonRainLoop,1622)
  set gg_snd_DarkSummoningTarget1=CreateSound("Abilities\\Spells\\Undead\\DarkSummoning\\DarkSummoningTarget1.wav",false,false,true,10,10,"SpellsEAX")
  call SetSoundParamsFromLabel(gg_snd_DarkSummoningTarget1,"DarkSummoningTarget")
  call SetSoundDuration(gg_snd_DarkSummoningTarget1,3320)
  set gg_rct_Tavern=Rect(-7456.,6336.,-6336.,7200.)
  set gg_rct_Center_of_Map=Rect(-832.,-1280.,-64.,-512.)
  set gg_rct_Top=Rect(-992.,704.,224.,2944.)
  set gg_rct_Left=Rect(-4640.,-1216.,-2944.,-128.)
  set gg_rct_Right=Rect(1632.,-1120.,3776.,-96.)
  set gg_rct_Bottom=Rect(-928.,-4576.,192.,-2944.)
  set gg_rct_Top_Spawn=Rect(-1024.,2976.,224.,3936.)
  set gg_rct_Right_Spawn=Rect(3776.,-1248.,4736.,-32.)
  set gg_rct_Bottom_Spawn=Rect(-1024.,-5536.,224.,-4576.)
  set gg_rct_Left_Spawn=Rect(-5408.,-1248.,-4640.,-32.)
  set gg_rct_Secrect_Cave_Enter=Rect(-7264.,-6304.,-7136.,-6016.)
  set gg_rct_Secrect_Cave=Rect(2880.,-7008.,3264.,-6912.)
  set gg_rct_Forest_Exit=Rect(-4672.,-7456.,-4448.,-7232.)
  set gg_rct_pad=Rect(-6656.,-5440.,-6528.,-5312.)
  set gg_rct_time_stop2=Rect(2464.,-7328.,3616.,-6208.)
  set gg_rct_forest_keep=Rect(-7552.,-7808.,-3296.,-3232.)
  set gg_rct_world_tree_cine=Rect(-4960.,-7648.,-4736.,-7136.)
  set gg_rct_Out=Rect(-3488.,-3584.,2528.,1632.)
  set gg_rct_Shield_Moo_Cave=Rect(1184.,-7552.,4864.,-4128.)
  set gg_rct_keep_out=Rect(-6848.,-5536.,-6464.,-5216.)
  set gg_rct_battle_zone=Rect(-6432.,-5504.,-5760.,-4992.)
  set gg_rct_Mine_Field=Rect(-4640.,4576.,-2848.,6112.)
  set gg_rct_Potions=Rect(-1952.,128.,-1536.,480.)
  set gg_rct_Weapons=Rect(96.,-320.,896.,480.)
  set gg_rct_Recipes=Rect(64.,-2432.,896.,-1472.)
  set gg_rct_Armor=Rect(-1952.,-2272.,-1472.,-1248.)
  set gg_rct_Moo_Moo_Square=Rect(-2016.,-2656.,928.,672.)
  set gg_rct_Desert=Rect(3488.,1184.,7520.,7296.)
  set gg_rct_Troll_Village=Rect(-7136.,-2816.,-5792.,-1728.)
  set gg_rct_Goblin_Village=Rect(-6944.,2496.,-5568.,3680.)
  set gg_rct_movie=Rect(6272.,-7392.,6944.,-6720.)
  set gg_rct_Goblin_Village_Cine=Rect(-6048.,2848.,-5728.,3136.)
  set gg_rct_naga_shop=Rect(-3680.,1856.,-3072.,2400.)
  set gg_rct_naga_front_shop=Rect(-4384.,1632.,-3936.,2208.)
  set gg_rct_Troll_Cine=Rect(-6240.,-2656.,-5792.,-2208.)
  set gg_rct_Instant_Revive=Rect(1568.,-2656.,2016.,-2272.)
  set gg_rct_Pedro_Negro_Cine=Rect(-4032.,4608.,-3424.,4800.)
  set gg_rct_Pedro_Negro_Open_Cine=Rect(-4032.,4064.,-3424.,4352.)
  set gg_rct_Desert_Hill=Rect(5312.,3936.,5728.,4288.)
  set gg_rct_centaur_first_wave=Rect(-896.,-4928.,128.,-4704.)
  set gg_rct_centaur_second_wave=Rect(-736.,-5472.,64.,-4992.)
  set gg_rct_BattleField_cine=Rect(-1152.,-3648.,192.,-1184.)
  set gg_rct_Sniper=Rect(-1056.,-5440.,-800.,-5184.)
  set gg_rct_Summoner_Point=Rect(5440.,1632.,5888.,1952.)
  set gg_rct_Destroy=Rect(4832.,864.,6080.,2016.)
  set gg_rct_goblin_zeplin_cine=Rect(-7392.,4960.,-6752.,5472.)
  set gg_rct_Shrine=Rect(-3968.,5664.,-3488.,6080.)
  set gg_rct_Goblin_4=Rect(-3296.,5376.,-3104.,5568.)
  set gg_rct_Goblin_2=Rect(-3296.,4928.,-3104.,5120.)
  set gg_rct_Goblin_3=Rect(-4352.,5376.,-4160.,5568.)
  set gg_rct_Goblin_1=Rect(-4352.,4928.,-4160.,5120.)
  set gg_rct_Clockwork_Position=Rect(-4576.,4960.,-4448.,5088.)
  set gg_rct_Sapper_Position=Rect(-4576.,5408.,-4448.,5536.)
  set gg_rct_Robo_Position=Rect(-3040.,5408.,-2912.,5536.)
  set gg_rct_Techie_Position=Rect(-3040.,4960.,-2912.,5088.)
  set gg_rct_Tinker=Rect(-3328.,5728.,-3072.,5984.)
  set gg_rct_Pocket_Factory=Rect(-4448.,5728.,-4192.,5984.)
  set gg_rct_Goblin_Unpause=Rect(-4800.,4224.,-2720.,6304.)
  set gg_rct_Showdown=Rect(2528.,320.,8032.,7392.)
  set gg_rct_Hero_Switch=Rect(-6240.,5952.,-5824.,7072.)
  set gg_rct_Desert_Outskirts=Rect(2240.,2592.,2528.,7168.)
  set gg_rct_Burn_Trees=Rect(4032.,-224.,4992.,288.)
  set gg_rct_Burn_Trees_2=Rect(64.,2880.,800.,3616.)
  set gg_rct_CentaurSpawn1=Rect(4896.,3200.,5280.,3584.)
  set gg_rct_CentaurSpawn2=Rect(3936.,4192.,4288.,4512.)
  set gg_rct_Tauren_Spawn2=Rect(-544.,-800.,-192.,-480.)
  set gg_rct_Tauren_Spawn1=Rect(-224.,-1120.,128.,-800.)
  set gg_rct_BloodBath_Stand1=Rect(-6144.,-5440.,-6016.,-5312.)
  set gg_rct_Hide_BloodUnits=Rect(-6144.,-4448.,-5888.,-4160.)
  set gg_rct_BloodBath_Killer=Rect(-6144.,-5152.,-6016.,-5024.)
  set gg_rct_Region_070=Rect(-6144.,-5248.,-6016.,-5152.)
  set gg_rct_EndingKhan=Rect(5536.,4384.,5792.,4672.)
  set gg_rct_EndingHeroes=Rect(4960.,3968.,5248.,4224.)
  set gg_rct_EndingMoo=Rect(5216.,4192.,5472.,4384.)
  call CameraSetupSetField(gg_cam_Camera_001,CAMERA_FIELD_ZOFFSET,.0,.0)
  call CameraSetupSetField(gg_cam_Camera_001,CAMERA_FIELD_ROTATION,90.,.0)
  call CameraSetupSetField(gg_cam_Camera_001,CAMERA_FIELD_ANGLE_OF_ATTACK,304.,.0)
  call CameraSetupSetField(gg_cam_Camera_001,CAMERA_FIELD_TARGET_DISTANCE,1500.,.0)
  call CameraSetupSetField(gg_cam_Camera_001,CAMERA_FIELD_ROLL,.0,.0)
  call CameraSetupSetField(gg_cam_Camera_001,CAMERA_FIELD_FIELD_OF_VIEW,70.,.0)
  call CameraSetupSetField(gg_cam_Camera_001,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_Camera_001,-644.7,-869.9,.0)
  call CameraSetupSetField(gg_cam_world_tree_cine,CAMERA_FIELD_ZOFFSET,.0,.0)
  call CameraSetupSetField(gg_cam_world_tree_cine,CAMERA_FIELD_ROTATION,11.,.0)
  call CameraSetupSetField(gg_cam_world_tree_cine,CAMERA_FIELD_ANGLE_OF_ATTACK,347.,.0)
  call CameraSetupSetField(gg_cam_world_tree_cine,CAMERA_FIELD_TARGET_DISTANCE,1815.,.0)
  call CameraSetupSetField(gg_cam_world_tree_cine,CAMERA_FIELD_ROLL,.0,.0)
  call CameraSetupSetField(gg_cam_world_tree_cine,CAMERA_FIELD_FIELD_OF_VIEW,70.,.0)
  call CameraSetupSetField(gg_cam_world_tree_cine,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_world_tree_cine,-4062.5,-7156.8,.0)
  call CameraSetupSetField(gg_cam_Warcraft_Movie,CAMERA_FIELD_ZOFFSET,.0,.0)
  call CameraSetupSetField(gg_cam_Warcraft_Movie,CAMERA_FIELD_ROTATION,87.5,.0)
  call CameraSetupSetField(gg_cam_Warcraft_Movie,CAMERA_FIELD_ANGLE_OF_ATTACK,355.,.0)
  call CameraSetupSetField(gg_cam_Warcraft_Movie,CAMERA_FIELD_TARGET_DISTANCE,1239.7,.0)
  call CameraSetupSetField(gg_cam_Warcraft_Movie,CAMERA_FIELD_ROLL,.0,.0)
  call CameraSetupSetField(gg_cam_Warcraft_Movie,CAMERA_FIELD_FIELD_OF_VIEW,120.,.0)
  call CameraSetupSetField(gg_cam_Warcraft_Movie,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_Warcraft_Movie,6735.7,-6206.5,.0)
  call CameraSetupSetField(gg_cam_goblin_village_cine,CAMERA_FIELD_ZOFFSET,.0,.0)
  call CameraSetupSetField(gg_cam_goblin_village_cine,CAMERA_FIELD_ROTATION,133.,.0)
  call CameraSetupSetField(gg_cam_goblin_village_cine,CAMERA_FIELD_ANGLE_OF_ATTACK,345.,.0)
  call CameraSetupSetField(gg_cam_goblin_village_cine,CAMERA_FIELD_TARGET_DISTANCE,1650.,.0)
  call CameraSetupSetField(gg_cam_goblin_village_cine,CAMERA_FIELD_ROLL,.0,.0)
  call CameraSetupSetField(gg_cam_goblin_village_cine,CAMERA_FIELD_FIELD_OF_VIEW,76.,.0)
  call CameraSetupSetField(gg_cam_goblin_village_cine,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_goblin_village_cine,-6393.1,3603.5,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_start,CAMERA_FIELD_ZOFFSET,.0,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_start,CAMERA_FIELD_ROTATION,90.,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_start,CAMERA_FIELD_ANGLE_OF_ATTACK,1.,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_start,CAMERA_FIELD_TARGET_DISTANCE,1500.,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_start,CAMERA_FIELD_ROLL,360.,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_start,CAMERA_FIELD_FIELD_OF_VIEW,70.,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_start,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_Pedro_Negro_start,-3680.9,5164.,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_move,CAMERA_FIELD_ZOFFSET,.0,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_move,CAMERA_FIELD_ROTATION,90.,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_move,CAMERA_FIELD_ANGLE_OF_ATTACK,351.,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_move,CAMERA_FIELD_TARGET_DISTANCE,1500.,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_move,CAMERA_FIELD_ROLL,360.,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_move,CAMERA_FIELD_FIELD_OF_VIEW,70.,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_move,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_Pedro_Negro_move,-3709.9,6357.,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_View,CAMERA_FIELD_ZOFFSET,.0,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_View,CAMERA_FIELD_ROTATION,90.,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_View,CAMERA_FIELD_ANGLE_OF_ATTACK,351.,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_View,CAMERA_FIELD_TARGET_DISTANCE,1500.,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_View,CAMERA_FIELD_ROLL,360.,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_View,CAMERA_FIELD_FIELD_OF_VIEW,70.,.0)
  call CameraSetupSetField(gg_cam_Pedro_Negro_View,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_Pedro_Negro_View,-3709.9,6021.,.0)
  call CameraSetupSetField(gg_cam_Centaur_cine,CAMERA_FIELD_ZOFFSET,80.,.0)
  call CameraSetupSetField(gg_cam_Centaur_cine,CAMERA_FIELD_ROTATION,47.,.0)
  call CameraSetupSetField(gg_cam_Centaur_cine,CAMERA_FIELD_ANGLE_OF_ATTACK,339.,.0)
  call CameraSetupSetField(gg_cam_Centaur_cine,CAMERA_FIELD_TARGET_DISTANCE,2923.1,.0)
  call CameraSetupSetField(gg_cam_Centaur_cine,CAMERA_FIELD_ROLL,.0,.0)
  call CameraSetupSetField(gg_cam_Centaur_cine,CAMERA_FIELD_FIELD_OF_VIEW,47.,.0)
  call CameraSetupSetField(gg_cam_Centaur_cine,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_Centaur_cine,5536.4,4155.1,.0)
  call CameraSetupSetField(gg_cam_MooMoo_cine,CAMERA_FIELD_ZOFFSET,.0,.0)
  call CameraSetupSetField(gg_cam_MooMoo_cine,CAMERA_FIELD_ROTATION,90.,.0)
  call CameraSetupSetField(gg_cam_MooMoo_cine,CAMERA_FIELD_ANGLE_OF_ATTACK,333.,.0)
  call CameraSetupSetField(gg_cam_MooMoo_cine,CAMERA_FIELD_TARGET_DISTANCE,2415.8,.0)
  call CameraSetupSetField(gg_cam_MooMoo_cine,CAMERA_FIELD_ROLL,.0,.0)
  call CameraSetupSetField(gg_cam_MooMoo_cine,CAMERA_FIELD_FIELD_OF_VIEW,41.,.0)
  call CameraSetupSetField(gg_cam_MooMoo_cine,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_MooMoo_cine,-439.1,-1309.9,.0)
  call CameraSetupSetField(gg_cam_MooMoo_battle_cine,CAMERA_FIELD_ZOFFSET,.0,.0)
  call CameraSetupSetField(gg_cam_MooMoo_battle_cine,CAMERA_FIELD_ROTATION,254.,.0)
  call CameraSetupSetField(gg_cam_MooMoo_battle_cine,CAMERA_FIELD_ANGLE_OF_ATTACK,332.,.0)
  call CameraSetupSetField(gg_cam_MooMoo_battle_cine,CAMERA_FIELD_TARGET_DISTANCE,2415.8,.0)
  call CameraSetupSetField(gg_cam_MooMoo_battle_cine,CAMERA_FIELD_ROLL,.0,.0)
  call CameraSetupSetField(gg_cam_MooMoo_battle_cine,CAMERA_FIELD_FIELD_OF_VIEW,65.,.0)
  call CameraSetupSetField(gg_cam_MooMoo_battle_cine,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_MooMoo_battle_cine,-375.1,-3011.2,.0)
  call CameraSetupSetField(gg_cam_Centaur_cine2,CAMERA_FIELD_ZOFFSET,80.,.0)
  call CameraSetupSetField(gg_cam_Centaur_cine2,CAMERA_FIELD_ROTATION,47.,.0)
  call CameraSetupSetField(gg_cam_Centaur_cine2,CAMERA_FIELD_ANGLE_OF_ATTACK,339.,.0)
  call CameraSetupSetField(gg_cam_Centaur_cine2,CAMERA_FIELD_TARGET_DISTANCE,1815.,.0)
  call CameraSetupSetField(gg_cam_Centaur_cine2,CAMERA_FIELD_ROLL,.0,.0)
  call CameraSetupSetField(gg_cam_Centaur_cine2,CAMERA_FIELD_FIELD_OF_VIEW,47.,.0)
  call CameraSetupSetField(gg_cam_Centaur_cine2,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_Centaur_cine2,5609.1,4454.5,.0)
  call CameraSetupSetField(gg_cam_Moo_Moo_defeat,CAMERA_FIELD_ZOFFSET,84.,.0)
  call CameraSetupSetField(gg_cam_Moo_Moo_defeat,CAMERA_FIELD_ROTATION,248.,.0)
  call CameraSetupSetField(gg_cam_Moo_Moo_defeat,CAMERA_FIELD_ANGLE_OF_ATTACK,336.,.0)
  call CameraSetupSetField(gg_cam_Moo_Moo_defeat,CAMERA_FIELD_TARGET_DISTANCE,1127.,.0)
  call CameraSetupSetField(gg_cam_Moo_Moo_defeat,CAMERA_FIELD_ROLL,.0,.0)
  call CameraSetupSetField(gg_cam_Moo_Moo_defeat,CAMERA_FIELD_FIELD_OF_VIEW,76.,.0)
  call CameraSetupSetField(gg_cam_Moo_Moo_defeat,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_Moo_Moo_defeat,-451.2,-1054.1,.0)
  call CameraSetupSetField(gg_cam_Snipe,CAMERA_FIELD_ZOFFSET,.0,.0)
  call CameraSetupSetField(gg_cam_Snipe,CAMERA_FIELD_ROTATION,254.,.0)
  call CameraSetupSetField(gg_cam_Snipe,CAMERA_FIELD_ANGLE_OF_ATTACK,332.,.0)
  call CameraSetupSetField(gg_cam_Snipe,CAMERA_FIELD_TARGET_DISTANCE,478.,.0)
  call CameraSetupSetField(gg_cam_Snipe,CAMERA_FIELD_ROLL,.0,.0)
  call CameraSetupSetField(gg_cam_Snipe,CAMERA_FIELD_FIELD_OF_VIEW,65.,.0)
  call CameraSetupSetField(gg_cam_Snipe,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_Snipe,-1008.7,-5450.6,.0)
  call CameraSetupSetField(gg_cam_Sniper_View,CAMERA_FIELD_ZOFFSET,158.,.0)
  call CameraSetupSetField(gg_cam_Sniper_View,CAMERA_FIELD_ROTATION,72.,.0)
  call CameraSetupSetField(gg_cam_Sniper_View,CAMERA_FIELD_ANGLE_OF_ATTACK,359.,.0)
  call CameraSetupSetField(gg_cam_Sniper_View,CAMERA_FIELD_TARGET_DISTANCE,649.,.0)
  call CameraSetupSetField(gg_cam_Sniper_View,CAMERA_FIELD_ROLL,.0,.0)
  call CameraSetupSetField(gg_cam_Sniper_View,CAMERA_FIELD_FIELD_OF_VIEW,20.,.0)
  call CameraSetupSetField(gg_cam_Sniper_View,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_Sniper_View,-998.3,-5384.5,.0)
  call CameraSetupSetField(gg_cam_Summon_Cam,CAMERA_FIELD_ZOFFSET,.0,.0)
  call CameraSetupSetField(gg_cam_Summon_Cam,CAMERA_FIELD_ROTATION,90.,.0)
  call CameraSetupSetField(gg_cam_Summon_Cam,CAMERA_FIELD_ANGLE_OF_ATTACK,304.,.0)
  call CameraSetupSetField(gg_cam_Summon_Cam,CAMERA_FIELD_TARGET_DISTANCE,1815.,.0)
  call CameraSetupSetField(gg_cam_Summon_Cam,CAMERA_FIELD_ROLL,.0,.0)
  call CameraSetupSetField(gg_cam_Summon_Cam,CAMERA_FIELD_FIELD_OF_VIEW,58.,.0)
  call CameraSetupSetField(gg_cam_Summon_Cam,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_Summon_Cam,5739.4,1309.8,.0)
  call CameraSetupSetField(gg_cam_Start,CAMERA_FIELD_ZOFFSET,.0,.0)
  call CameraSetupSetField(gg_cam_Start,CAMERA_FIELD_ROTATION,90.,.0)
  call CameraSetupSetField(gg_cam_Start,CAMERA_FIELD_ANGLE_OF_ATTACK,304.,.0)
  call CameraSetupSetField(gg_cam_Start,CAMERA_FIELD_TARGET_DISTANCE,1815.,.0)
  call CameraSetupSetField(gg_cam_Start,CAMERA_FIELD_ROLL,.0,.0)
  call CameraSetupSetField(gg_cam_Start,CAMERA_FIELD_FIELD_OF_VIEW,58.,.0)
  call CameraSetupSetField(gg_cam_Start,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_Start,-6783.9,6753.8,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine1,CAMERA_FIELD_ZOFFSET,83.,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine1,CAMERA_FIELD_ROTATION,179.,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine1,CAMERA_FIELD_ANGLE_OF_ATTACK,348.,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine1,CAMERA_FIELD_TARGET_DISTANCE,100.,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine1,CAMERA_FIELD_ROLL,.0,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine1,CAMERA_FIELD_FIELD_OF_VIEW,70.,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine1,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_troll_village_cine1,-6100.7,-2398.5,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine2,CAMERA_FIELD_ZOFFSET,340.,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine2,CAMERA_FIELD_ROTATION,22.,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine2,CAMERA_FIELD_ANGLE_OF_ATTACK,329.,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine2,CAMERA_FIELD_TARGET_DISTANCE,387.,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine2,CAMERA_FIELD_ROLL,.0,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine2,CAMERA_FIELD_FIELD_OF_VIEW,70.,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine2,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_troll_village_cine2,-6566.3,-2666.9,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine3,CAMERA_FIELD_ZOFFSET,83.,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine3,CAMERA_FIELD_ROTATION,78.,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine3,CAMERA_FIELD_ANGLE_OF_ATTACK,349.,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine3,CAMERA_FIELD_TARGET_DISTANCE,202.,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine3,CAMERA_FIELD_ROLL,.0,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine3,CAMERA_FIELD_FIELD_OF_VIEW,70.,.0)
  call CameraSetupSetField(gg_cam_troll_village_cine3,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_troll_village_cine3,-6100.7,-2398.5,.0)
  call CameraSetupSetField(gg_cam_BloodBath_Death,CAMERA_FIELD_ZOFFSET,.0,.0)
  call CameraSetupSetField(gg_cam_BloodBath_Death,CAMERA_FIELD_ROTATION,176.,.0)
  call CameraSetupSetField(gg_cam_BloodBath_Death,CAMERA_FIELD_ANGLE_OF_ATTACK,339.8,.0)
  call CameraSetupSetField(gg_cam_BloodBath_Death,CAMERA_FIELD_TARGET_DISTANCE,1024.5,.0)
  call CameraSetupSetField(gg_cam_BloodBath_Death,CAMERA_FIELD_ROLL,.0,.0)
  call CameraSetupSetField(gg_cam_BloodBath_Death,CAMERA_FIELD_FIELD_OF_VIEW,70.,.0)
  call CameraSetupSetField(gg_cam_BloodBath_Death,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_BloodBath_Death,-6311.2,-5142.6,.0)
  call CameraSetupSetField(gg_cam_Ending_Cine,CAMERA_FIELD_ZOFFSET,.0,.0)
  call CameraSetupSetField(gg_cam_Ending_Cine,CAMERA_FIELD_ROTATION,104.2,.0)
  call CameraSetupSetField(gg_cam_Ending_Cine,CAMERA_FIELD_ANGLE_OF_ATTACK,311.2,.0)
  call CameraSetupSetField(gg_cam_Ending_Cine,CAMERA_FIELD_TARGET_DISTANCE,2196.2,.0)
  call CameraSetupSetField(gg_cam_Ending_Cine,CAMERA_FIELD_ROLL,.0,.0)
  call CameraSetupSetField(gg_cam_Ending_Cine,CAMERA_FIELD_FIELD_OF_VIEW,70.,.0)
  call CameraSetupSetField(gg_cam_Ending_Cine,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_Ending_Cine,5437.2,4441.1,.0)
  call CameraSetupSetField(gg_cam_FaceSlam,CAMERA_FIELD_ZOFFSET,.0,.0)
  call CameraSetupSetField(gg_cam_FaceSlam,CAMERA_FIELD_ROTATION,97.5,.0)
  call CameraSetupSetField(gg_cam_FaceSlam,CAMERA_FIELD_ANGLE_OF_ATTACK,134.6,.0)
  call CameraSetupSetField(gg_cam_FaceSlam,CAMERA_FIELD_TARGET_DISTANCE,100.,.0)
  call CameraSetupSetField(gg_cam_FaceSlam,CAMERA_FIELD_ROLL,.0,.0)
  call CameraSetupSetField(gg_cam_FaceSlam,CAMERA_FIELD_FIELD_OF_VIEW,70.,.0)
  call CameraSetupSetField(gg_cam_FaceSlam,CAMERA_FIELD_FARZ,5000.,.0)
  call CameraSetupSetDestPosition(gg_cam_FaceSlam,5446.1,4517.1,.0)
  call SetPlayerTechMaxAllowed(Player(11),'Rume',0)
  call SetPlayerTechMaxAllowed(Player(11),'Rura',0)
  call SetPlayerTechMaxAllowed(Player(11),'Ruar',0)
  call SetPlayerTechMaxAllowed(Player(11),'Ruac',0)
  call SetPlayerTechMaxAllowed(Player(11),'Rugf',0)
  call SetPlayerTechMaxAllowed(Player(11),'Ruwb',0)
  call SetPlayerTechMaxAllowed(Player(11),'Rusf',0)
  call SetPlayerTechMaxAllowed(Player(11),'Rune',0)
  call SetPlayerTechMaxAllowed(Player(11),'Ruba',0)
  call SetPlayerTechMaxAllowed(Player(11),'Rufb',0)
  call SetPlayerTechMaxAllowed(Player(11),'Rusl',0)
  call SetPlayerTechMaxAllowed(Player(11),'Rucr',0)
  call SetPlayerTechMaxAllowed(Player(11),'Rupc',0)
  call SetPlayerTechMaxAllowed(Player(11),'Rusm',0)
  call SetPlayerTechMaxAllowed(Player(11),'Rubu',0)
  call SetPlayerTechMaxAllowed(Player(11),'Rusp',0)
  call SetPlayerTechMaxAllowed(Player(11),'Ruex',0)
  call SetPlayerTechMaxAllowed(Player(11),'Rupm',0)
  set gg_dest_DTfp_0841=CreateDestructable('DTfp',-6592.,-5376.,270.,1.,0)
  set gg_dest_LOcg_1956=CreateDestructable('LOcg',2816.,-3136.,169.,1.083,0)
  set d=CreateDestructable('LTbr',-992.,4576.,250.,1.397,0)
  set t=CreateTrigger()
  call TriggerRegisterDeathEvent(t,d)
  call TriggerAddAction(t,function SaveDyingWidget)
  call TriggerAddAction(t,function Doodad000163_DropItems)
  set d=CreateDestructable('LTex',-3232.,4384.,212.,1.379,0)
  set t=CreateTrigger()
  call TriggerRegisterDeathEvent(t,d)
  call TriggerAddAction(t,function SaveDyingWidget)
  call TriggerAddAction(t,function Doodad001960_DropItems)
  set gg_dest_LTrc_2048=CreateDestructable('LTrc',-3712.,1984.,154.,1.,1)
  set gg_dest_YT26_0691=CreateDestructable('YT26',3904.,-3712.,90.,1.,0)
  set gg_dest_YTfb_1849=CreateDestructable('YTfb',2592.,-4256.,270.,1.,0)
  set gg_dest_YTfb_1857=CreateDestructable('YTfb',3104.,-4256.,270.,1.,0)
  set gg_dest_YTfb_1858=CreateDestructable('YTfb',3168.,-4256.,270.,1.,0)
  set gg_dest_YTfb_1852=CreateDestructable('YTfb',2784.,-4256.,270.,1.,0)
  set gg_dest_YTfb_1851=CreateDestructable('YTfb',2720.,-4256.,270.,1.,0)
  set gg_dest_YTfb_1850=CreateDestructable('YTfb',2656.,-4256.,270.,1.,0)
  set gg_dest_YTfb_1855=CreateDestructable('YTfb',2976.,-4256.,270.,1.,0)
  set gg_dest_YTfb_1856=CreateDestructable('YTfb',3040.,-4256.,270.,1.,0)
  set gg_dest_YTfb_1859=CreateDestructable('YTfb',3232.,-4256.,270.,1.,0)
  set gg_dest_YTfb_1848=CreateDestructable('YTfb',2528.,-4256.,270.,1.,0)
  set gg_dest_YTfb_1854=CreateDestructable('YTfb',2912.,-4256.,270.,1.,0)
  set gg_dest_YTfb_1853=CreateDestructable('YTfb',2848.,-4256.,270.,1.,0)
  set gg_dest_YTpb_1539=CreateDestructable('YTpb',-6496.,-5536.,270.,1.,0)
  set gg_dest_YTpb_1534=CreateDestructable('YTpb',-6496.,-5216.,270.,1.,0)
  set gg_dest_YTpb_1536=CreateDestructable('YTpb',-6496.,-5344.,270.,1.,0)
  set gg_dest_YTpb_1537=CreateDestructable('YTpb',-6496.,-5408.,270.,1.,0)
  set gg_dest_YTpb_1535=CreateDestructable('YTpb',-6496.,-5280.,270.,1.,0)
  set gg_dest_YTpb_1538=CreateDestructable('YTpb',-6496.,-5472.,270.,1.,0)
  set gg_dest_ZTg1_1962=CreateDestructable('ZTg1',-3712.,4608.,270.,.9,0)
  call CreateItem('I052',1699.4,-1721.9)
  set p=Player(12)
  set gg_unit_n02W_0280=CreateUnit(p,'n02W',5600.,3424.,270.)
  set gg_unit_n02W_0289=CreateUnit(p,'n02W',4448.,4256.,270.)
  set p=Player(15)
  set u=CreateUnit(p,'o007',-3392.,2048.,270.)
  set u=CreateUnit(p,'o00E',-1728.,320.,270.)
  set u=CreateUnit(p,'n00N',-6592.,6976.,270.)
  call SetUnitColor(u,ConvertPlayerColor(12))
  set u=CreateUnit(p,'n001',-7232.,6976.,270.)
  call SetUnitColor(u,ConvertPlayerColor(12))
  set u=CreateUnit(p,'n00X',-6592.,6592.,270.)
  call SetUnitColor(u,ConvertPlayerColor(12))
  set u=CreateUnit(p,'o008',704.,320.,270.)
  set u=CreateUnit(p,'o00O',384.,192.,270.)
  set u=CreateUnit(p,'h00P',2880.,1856.,270.)
  set u=CreateUnit(p,'o009',-1728.,-2112.,270.)
  set u=CreateUnit(p,'o005',-1728.,-1408.,270.)
  set u=CreateUnit(p,'ncp3',-4544.,-7360.,270.)
  set u=CreateUnit(p,'nfoh',-6400.,-2304.,270.)
  set u=CreateUnit(p,'n01U',-6208.,3136.,270.)
  set p=Player(0)
  set gg_unit_hwtw_0008=CreateUnit(p,'hwtw',-6976.,6912.,270.)
  set p=Player(1)
  set gg_unit_hwtw_0009=CreateUnit(p,'hwtw',-6848.,6912.,270.)
  set p=Player(2)
  set gg_unit_hwtw_0010=CreateUnit(p,'hwtw',-6976.,6784.,270.)
  set p=Player(3)
  set gg_unit_hwtw_0011=CreateUnit(p,'hwtw',-6848.,6784.,270.)
  set p=Player(4)
  set gg_unit_hwtw_0015=CreateUnit(p,'hwtw',-6976.,6656.,270.)
  set p=Player(5)
  set gg_unit_hwtw_0016=CreateUnit(p,'hwtw',-6848.,6656.,270.)
  set p=Player(10)
  set gg_unit_ofrt_0001=CreateUnit(p,'ofrt',-448.,-960.,270.)
  set p=Player(12)
  set u=CreateUnit(p,'n02R',6582.6,-7116.3,287.83)
  set t=CreateTrigger()
  call TriggerRegisterUnitEvent(t,u,EVENT_UNIT_DEATH)
  call TriggerRegisterUnitEvent(t,u,EVENT_UNIT_CHANGE_OWNER)
  call TriggerAddAction(t,function Unit000281_DropItems)
  set gg_unit_nglm_0042=CreateUnit(p,'nglm',-6022.8,-4507.4,29.609)
  set gg_unit_nglm_0043=CreateUnit(p,'nglm',-6142.6,-4507.4,273.656)
  set gg_unit_nglm_0044=CreateUnit(p,'nglm',-5908.5,-4502.3,233.895)
  set gg_unit_n01M_0045=CreateUnit(p,'n01M',3040.2,-5429.6,250.)
  call IssueImmediateOrder(gg_unit_n01M_0045,"")
  call IssueImmediateOrderById(gg_unit_n01M_0045,852150)
  set t=CreateTrigger()
  call TriggerRegisterUnitEvent(t,gg_unit_n01M_0045,EVENT_UNIT_DEATH)
  call TriggerRegisterUnitEvent(t,gg_unit_n01M_0045,EVENT_UNIT_CHANGE_OWNER)
  call TriggerAddAction(t,function Unit000045_DropItems)
  set gg_unit_n01L_0046=CreateUnit(p,'n01L',-6063.6,-5397.3,70.38)
  call SetUnitAcquireRange(gg_unit_n01L_0046,200.)
  call IssueImmediateOrder(gg_unit_n01L_0046,"")
  call IssueImmediateOrderById(gg_unit_n01L_0046,852150)
  call IssueImmediateOrder(gg_unit_n01L_0046,"")
  set t=CreateTrigger()
  call TriggerRegisterUnitEvent(t,gg_unit_n01L_0046,EVENT_UNIT_DEATH)
  call TriggerRegisterUnitEvent(t,gg_unit_n01L_0046,EVENT_UNIT_CHANGE_OWNER)
  call TriggerAddAction(t,function Unit000046_DropItems)
  set u=CreateUnit(p,'n01R',-5977.3,-4092.8,121.798)
  set u=CreateUnit(p,'n01R',-6132.6,-4025.5,169.184)
  set u=CreateUnit(p,'n01R',-6828.,-4726.1,265.32)
  set gg_unit_n01T_0064=CreateUnit(p,'n01T',-3731.5,5340.1,270.)
  call SetUnitAcquireRange(gg_unit_n01T_0064,200.)
  set t=CreateTrigger()
  call TriggerRegisterUnitEvent(t,gg_unit_n01T_0064,EVENT_UNIT_DEATH)
  call TriggerRegisterUnitEvent(t,gg_unit_n01T_0064,EVENT_UNIT_CHANGE_OWNER)
  call TriggerAddAction(t,function Unit000193_DropItems)
  set u=CreateUnit(p,'nglm',-3788.5,4914.6,327.337)
  set u=CreateUnit(p,'nglm',-3860.4,5036.3,41.365)
  set u=CreateUnit(p,'nglm',-3878.1,4905.8,201.858)
  set u=CreateUnit(p,'nglm',-3961.7,4955.6,358.682)
  set u=CreateUnit(p,'nglm',-3668.4,5564.5,175.951)
  set u=CreateUnit(p,'nglm',-3549.5,5668.6,14.096)
  set u=CreateUnit(p,'nglm',-3427.1,5772.7,290.356)
  set u=CreateUnit(p,'nglm',-3301.,5858.2,61.163)
  set u=CreateUnit(p,'nglm',-3171.4,5951.1,96.188)
  set u=CreateUnit(p,'nglm',-3988.9,5256.,204.407)
  set u=CreateUnit(p,'nglm',-4075.4,5170.5,117.063)
  set u=CreateUnit(p,'nglm',-4190.6,5070.1,354.177)
  set u=CreateUnit(p,'nglm',-4331.1,4962.3,75.149)
  set u=CreateUnit(p,'nglm',-4442.8,4854.5,27.412)
  set u=CreateUnit(p,'nglm',-3690.,5114.7,33.366)
  set u=CreateUnit(p,'nglm',-3627.4,4918.,274.623)
  set u=CreateUnit(p,'nglm',-3801.8,5103.6,32.806)
  set u=CreateUnit(p,'nglm',-3232.7,5148.6,.747)
  set u=CreateUnit(p,'nglm',-3259.6,4971.8,51.132)
  set u=CreateUnit(p,'nglm',-3963.7,5453.,298.793)
  set u=CreateUnit(p,'nglm',-4050.2,5560.8,12.019)
  set u=CreateUnit(p,'nglm',-4133.,5672.3,187.685)
  set u=CreateUnit(p,'nglm',-4219.5,5772.7,326.831)
  set u=CreateUnit(p,'nglm',-4309.5,5873.,121.139)
  set u=CreateUnit(p,'nglm',-3844.9,5553.4,8.745)
  set u=CreateUnit(p,'nglm',-3924.1,5646.3,106.757)
  set u=CreateUnit(p,'nglm',-3999.8,5735.5,257.429)
  set u=CreateUnit(p,'nglm',-4053.8,5847.,219.294)
  set u=CreateUnit(p,'nglm',-4158.2,5951.1,10.393)
  set u=CreateUnit(p,'nglm',-3502.7,5267.1,214.833)
  set u=CreateUnit(p,'nglm',-3427.1,5189.1,303.254)
  set u=CreateUnit(p,'nglm',-3333.4,5103.6,239.257)
  set u=CreateUnit(p,'nglm',-3243.4,4999.5,93.76)
  set u=CreateUnit(p,'nglm',-3171.4,4899.1,129.401)
  set u=CreateUnit(p,'nglm',-3538.7,5438.1,16.469)
  set u=CreateUnit(p,'nglm',-3423.5,5538.5,128.665)
  set u=CreateUnit(p,'nglm',-3315.4,5616.5,141.354)
  set u=CreateUnit(p,'nglm',-3196.6,5720.6,94.233)
  set u=CreateUnit(p,'nglm',-3084.9,5824.7,285.961)
  set u=CreateUnit(p,'nglm',-3855.7,5137.,272.315)
  set u=CreateUnit(p,'nglm',-3949.3,5047.8,280.753)
  set u=CreateUnit(p,'nglm',-4025.,4928.9,44.507)
  set u=CreateUnit(p,'nglm',-4125.8,4824.8,180.181)
  set u=CreateUnit(p,'nglm',-4250.6,4939.8,84.839)
  set u=CreateUnit(p,'nglm',-4053.8,5360.1,280.248)
  set u=CreateUnit(p,'nglm',-4133.,5464.1,58.054)
  set u=CreateUnit(p,'nglm',-4237.5,5557.1,331.643)
  set u=CreateUnit(p,'nglm',-4320.3,5661.2,121.886)
  set u=CreateUnit(p,'nglm',-4421.2,5780.1,351.024)
  set u=CreateUnit(p,'nglm',-3757.2,4993.8,278.556)
  set u=CreateUnit(p,'nglm',-3710.4,4916.3,287.609)
  set u=CreateUnit(p,'nglm',-3468.4,4977.1,191.739)
  set u=CreateUnit(p,'nglm',-3910.4,5230.2,263.383)
  set u=CreateUnit(p,'nglm',-3960.1,4843.4,188.784)
  set u=CreateUnit(p,'nglm',-3891.7,4962.3,294.322)
  set u=CreateUnit(p,'nglm',-4050.,5246.9,316.811)
  set u=CreateUnit(p,'n029',-5316.7,-4963.2,209.43)
  set t=CreateTrigger()
  call TriggerRegisterUnitEvent(t,u,EVENT_UNIT_DEATH)
  call TriggerRegisterUnitEvent(t,u,EVENT_UNIT_CHANGE_OWNER)
  call TriggerAddAction(t,function Unit000280_DropItems)
  set u=CreateUnit(p,'nglm',-4140.2,5248.5,8.756)
  set u=CreateUnit(p,'nglm',-4160.4,5033.8,217.657)
  set u=CreateUnit(p,'nglm',-4140.6,4875.,95.826)
  set u=CreateUnit(p,'nglm',-4230.3,5345.2,16.799)
  set u=CreateUnit(p,'nglm',-4334.7,5449.3,244.937)
  set u=CreateUnit(p,'nglm',-4424.8,5594.2,19.578)
  set u=CreateUnit(p,'nglm',-4269.9,5133.3,59.262)
  set u=CreateUnit(p,'nglm',-4359.9,5222.5,125.874)
  set u=CreateUnit(p,'nglm',-4424.8,5330.3,29.444)
  set u=CreateUnit(p,'nglm',-4388.7,5036.7,166.865)
  set u=CreateUnit(p,'nglm',-4460.8,5148.2,139.289)
  set u=CreateUnit(p,'nglm',-4493.2,4943.7,347.563)
  set u=CreateUnit(p,'nglm',-4486.,5456.7,46.572)
  set u=CreateUnit(p,'nglm',-4522.,5241.1,174.172)
  set u=CreateUnit(p,'nglm',-3453.7,5361.9,113.789)
  set u=CreateUnit(p,'nglm',-3367.2,5443.7,43.408)
  set u=CreateUnit(p,'nglm',-3244.8,5529.2,343.663)
  set u=CreateUnit(p,'nglm',-3122.3,5640.7,177.786)
  set u=CreateUnit(p,'nglm',-3352.8,5272.7,162.152)
  set u=CreateUnit(p,'nglm',-3234.,5358.2,143.211)
  set u=CreateUnit(p,'nglm',-3140.3,5458.6,73.731)
  set u=CreateUnit(p,'nglm',-3273.6,5172.4,119.821)
  set u=CreateUnit(p,'nglm',-3143.9,5283.9,139.487)
  set u=CreateUnit(p,'nglm',-3165.5,5083.1,334.72)
  set u=CreateUnit(p,'nglm',-3043.1,5544.1,275.26)
  set u=CreateUnit(p,'nglm',-3025.1,5767.1,165.569)
  set u=CreateUnit(p,'nglm',-3050.3,5384.2,167.777)
  set u=CreateUnit(p,'nglm',-3071.9,5176.1,90.761)
  set u=CreateUnit(p,'nglm',-3122.3,4971.6,245.025)
  set u=CreateUnit(p,'nglm',-3842.3,5708.7,160.208)
  set u=CreateUnit(p,'nglm',-3730.6,5652.9,228.962)
  set u=CreateUnit(p,'nglm',-3633.4,5749.6,177.457)
  set u=CreateUnit(p,'nglm',-3536.1,5857.4,9.416)
  set u=CreateUnit(p,'nglm',-3392.1,5957.7,76.852)
  set u=CreateUnit(p,'nglm',-3709.,5816.5,140.937)
  set u=CreateUnit(p,'nglm',-3637.,5924.3,76.841)
  set u=CreateUnit(p,'nglm',-3899.9,5809.,179.797)
  set u=CreateUnit(p,'nglm',-3766.6,5902.,137.981)
  set u=CreateUnit(p,'nglm',-3950.3,5916.8,324.008)
  set u=CreateUnit(p,'nglm',-4058.4,6017.2,136.597)
  set u=CreateUnit(p,'nglm',-3084.3,4817.4,175.171)
  set u=CreateUnit(p,'nglm',-4376.4,5968.4,155.791)
  set u=CreateUnit(p,'nglm',-4221.5,6016.7,304.353)
  set u=CreateUnit(p,'nglm',-3094.6,6004.2,338.807)
  set u=CreateUnit(p,'nglm',-2982.9,5937.3,58.229)
  set u=CreateUnit(p,'nglm',-3825.7,5993.1,100.297)
  set u=CreateUnit(p,'nglm',-3494.4,6015.4,146.232)
  set u=CreateUnit(p,'nglm',-3660.,6007.9,11.723)
  set u=CreateUnit(p,'nglm',-3292.9,6029.2,147.166)
  set u=CreateUnit(p,'nglm',-3305.8,5501.4,98.364)
  set u=CreateUnit(p,'nglm',-3964.3,5149.3,122.941)
  set u=CreateUnit(p,'nglm',-4054.4,5056.3,343.795)
  set u=CreateUnit(p,'nglm',-4166.,4944.8,53.34)
  set u=CreateUnit(p,'nglm',-4281.3,4829.6,305.66)
  set u=CreateUnit(p,'nglm',-4374.4,4856.3,235.576)
  set u=CreateUnit(p,'nglm',-3561.9,5013.5,89.431)
  set u=CreateUnit(p,'nglm',-3474.5,5048.9,24.566)
  set u=CreateUnit(p,'nglm',-3402.5,4967.1,345.399)
  set u=CreateUnit(p,'nglm',-3319.6,4870.5,331.643)
  set u=CreateUnit(p,'nglm',-3079.2,4906.1,62.185)
  set u=CreateUnit(p,'nglm',-3552.8,4921.3,13.623)
  set u=CreateUnit(p,'nglm',-3550.6,5555.2,211.274)
  set u=CreateUnit(p,'nglm',-3439.,5655.6,62.998)
  set u=CreateUnit(p,'nglm',-3287.7,5744.8,317.251)
  set u=CreateUnit(p,'nglm',-3197.6,5822.9,329.929)
  set u=CreateUnit(p,'nglm',-4184.5,5856.3,318.591)
  set u=CreateUnit(p,'nglm',-4105.3,5770.8,38.146)
  set u=CreateUnit(p,'nglm',-4022.4,5659.3,48.924)
  set u=CreateUnit(p,'nglm',-3943.2,5551.5,216.712)
  set u=CreateUnit(p,'nglm',-3677.8,5018.2,73.27)
  set u=CreateUnit(p,'nglm',-4263.8,5949.2,65.437)
  set u=CreateUnit(p,'nglm',-3234.3,5269.,26.346)
  set u=CreateUnit(p,'nglm',-4224.8,5447.4,228.402)
  set u=CreateUnit(p,'nglm',-3602.6,5188.9,167.766)
  set u=CreateUnit(p,'n01R',-7078.8,-3547.1,140.78)
  set u=CreateUnit(p,'n01R',-5457.9,-3851.,146.54)
  set u=CreateUnit(p,'n01R',-5440.8,-4054.1,207.956)
  set u=CreateUnit(p,'nglm',-3397.2,5140.8,221.14)
  set u=CreateUnit(p,'nglm',-3345.5,5217.9,62.888)
  set u=CreateUnit(p,'nglm',-3299.4,5311.2,71.095)
  set u=CreateUnit(p,'nglm',-3336.3,5377.6,92.782)
  set u=CreateUnit(p,'nglm',-3413.2,5268.4,44.287)
  set u=CreateUnit(p,'nglm',-3529.9,5123.6,65.162)
  set u=CreateUnit(p,'nglm',-3441.7,5468.8,169.876)
  set u=CreateUnit(p,'nglm',-3544.8,5711.3,197.991)
  set u=CreateUnit(p,'nglm',-3626.3,5685.1,315.878)
  set u=CreateUnit(p,'nglm',-3780.8,5816.9,203.627)
  set u=CreateUnit(p,'nglm',-4016.8,5451.8,237.598)
  set u=CreateUnit(p,'nglm',-4130.1,5350.7,216.185)
  set u=CreateUnit(p,'nglm',-4207.5,5183.2,168.92)
  set u=CreateUnit(p,'nglm',-4140.7,5098.3,81.334)
  set u=CreateUnit(p,'nglm',-4400.4,4933.1,267.547)
  set u=CreateUnit(p,'nglm',-4309.7,5187.8,181.082)
  set u=CreateUnit(p,'nglm',-4306.7,5235.5,34.894)
  set u=CreateUnit(p,'nglm',-4341.3,5313.,324.469)
  set u=CreateUnit(p,'nglm',-4385.3,5377.7,202.199)
  set u=CreateUnit(p,'nglm',-4417.7,5451.8,229.413)
  set u=CreateUnit(p,'nglm',-4467.5,5522.,292.091)
  set u=CreateUnit(p,'nglm',-4505.4,5663.4,163.042)
  set u=CreateUnit(p,'nglm',-4413.3,5220.5,54.593)
  set u=CreateUnit(p,'nglm',-4333.7,5106.3,196.365)
  set u=CreateUnit(p,'nglm',-4270.7,5012.6,192.157)
  set u=CreateUnit(p,'nglm',-4215.6,4887.2,263.812)
  set u=CreateUnit(p,'nglm',-4203.2,4814.1,20.93)
  set u=CreateUnit(p,'nglm',-4068.9,4984.6,58.625)
  set u=CreateUnit(p,'nglm',-4476.9,5052.9,259.835)
  set u=CreateUnit(p,'nglm',-4314.6,5534.6,83.982)
  set u=CreateUnit(p,'nglm',-4346.1,5805.4,313.131)
  set u=CreateUnit(p,'nglm',-4466.9,5955.5,127.456)
  set u=CreateUnit(p,'nglm',-4214.2,5662.,231.61)
  set u=CreateUnit(p,'nglm',-4098.6,5510.7,81.29)
  set u=CreateUnit(p,'nglm',-3947.1,5339.5,162.339)
  set u=CreateUnit(p,'nglm',-3569.1,5330.5,303.858)
  set u=CreateUnit(p,'nglm',-3748.3,5553.9,219.272)
  set u=CreateUnit(p,'nglm',-3742.,5156.5,222.755)
  set u=CreateUnit(p,'nglm',-3859.1,5207.6,189.146)
  set u=CreateUnit(p,'nglm',-3687.8,5207.6,246.299)
  set u=CreateUnit(p,'nglm',-3443.,4906.4,50.407)
  set u=CreateUnit(p,'nglm',-3378.6,4841.6,293.212)
  set u=CreateUnit(p,'nglm',-3382.4,4886.7,60.58)
  set u=CreateUnit(p,'nglm',-3246.9,4837.8,353.463)
  set u=CreateUnit(p,'nglm',-3329.9,4984.6,20.578)
  set u=CreateUnit(p,'nglm',-3227.3,5098.,308.165)
  set u=CreateUnit(p,'nglm',-3162.1,5135.5,52.747)
  set u=CreateUnit(p,'nglm',-3391.8,5048.9,351.815)
  set u=CreateUnit(p,'nglm',-3025.5,5264.,259.197)
  set u=CreateUnit(p,'nglm',-3050.3,5008.6,274.557)
  set u=CreateUnit(p,'nglm',-3169.5,4819.1,42.035)
  set u=CreateUnit(p,'nglm',-3082.9,5077.5,291.212)
  set u=CreateUnit(p,'nglm',-3174.2,5578.1,19.699)
  set u=CreateUnit(p,'nglm',-3334.9,5682.1,171.293)
  set u=CreateUnit(p,'nglm',-3366.4,5842.3,258.483)
  set u=CreateUnit(p,'nglm',-3446.9,5885.,186.477)
  set u=CreateUnit(p,'nglm',-3550.3,5944.6,105.417)
  set u=CreateUnit(p,'nglm',-3854.1,5928.2,264.79)
  set u=CreateUnit(p,'nglm',-3949.,5988.7,87.311)
  set u=CreateUnit(p,'nglm',-4285.5,5702.3,17.809)
  set u=CreateUnit(p,'nglm',-4412.9,5697.3,127.028)
  set u=CreateUnit(p,'nglm',-4025.3,4856.7,36.179)
  set u=CreateUnit(p,'nglm',-4082.6,4887.2,41.464)
  set gg_unit_n028_0297=CreateUnit(p,'n028',-3572.1,5157.2,240.)
  set gg_unit_n028_0298=CreateUnit(p,'n028',-3911.8,5166.4,290.)
  set u=CreateUnit(p,'n01R',-6657.4,-6004.2,146.54)
  set u=CreateUnit(p,'n01R',-6637.9,-6159.2,146.54)
  set p=Player(15)
  set u=CreateUnit(p,'u019',686.9,-1846.9,200.)
  set u=CreateUnit(p,'u01A',715.3,-1993.1,180.)
  set u=CreateUnit(p,'n01E',2464.1,1862.6,238.14)
  set u=CreateUnit(p,'u01B',605.7,-2084.1,90.)
  set u=CreateUnit(p,'n01K',-4645.7,-7190.4,202.913)
  set u=CreateUnit(p,'n01K',-6034.5,-6321.7,83.356)
  set u=CreateUnit(p,'n01K',-4820.2,-4661.2,323.51)
  set u=CreateUnit(p,'nnsw',-3568.2,1694.3,34.026)
  set gg_unit_u00T_0049=CreateUnit(p,'u00T',-6138.1,-4524.1,290.12)
  set gg_unit_u00T_0050=CreateUnit(p,'u00T',-6026.3,-4514.5,202.79)
  set gg_unit_u00T_0051=CreateUnit(p,'u00T',-5905.1,-4519.3,17.33)
  set u=CreateUnit(p,'otbr',-6958.5,-2096.6,35.9)
  set u=CreateUnit(p,'necr',-6787.2,-2396.9,330.149)
  set u=CreateUnit(p,'otbr',-6717.7,-2767.7,42.36)
  set u=CreateUnit(p,'otbr',-6539.3,-1949.5,34.806)
  set u=CreateUnit(p,'otbk',-6291.8,-2634.5,237.081)
  set u=CreateUnit(p,'otbk',-6669.4,-2261.6,67.92)
  set u=CreateUnit(p,'ohun',-6334.5,-2079.3,264.899)
  set u=CreateUnit(p,'u00W',5984.8,-2854.2,99.8)
  set u=CreateUnit(p,'odoc',-6801.1,-2483.3,242.89)
  set u=CreateUnit(p,'odoc',-6156.7,-2119.8,221.535)
  call SetUnitState(u,UNIT_STATE_MANA,0)
  set u=CreateUnit(p,'odoc',-6427.8,-1928.4,347.354)
  call SetUnitState(u,UNIT_STATE_MANA,0)
  set u=CreateUnit(p,'ohun',-6581.2,-2663.5,113.36)
  set gg_unit_Ntin_0226=CreateUnit(p,'Ntin',-6032.3,2942.4,300.)
  set u=CreateUnit(p,'ngsp',-6224.5,2639.,262.021)
  set u=CreateUnit(p,'ngsp',-6705.3,3033.8,137.85)
  set u=CreateUnit(p,'nzep',-6460.2,3570.4,237.62)
  set u=CreateUnit(p,'nzep',-6309.5,2866.3,130.302)
  set u=CreateUnit(p,'ncg3',-6332.9,3463.7,349.299)
  set u=CreateUnit(p,'ncg3',-6269.,3450.9,271.656)
  set gg_unit_ncg3_0233=CreateUnit(p,'ncg3',-5999.1,3060.1,230.)
  set u=CreateUnit(p,'ncg3',-6321.1,3393.,352.782)
  set u=CreateUnit(p,'ngsp',-6399.2,3582.,185.719)
  set gg_unit_Nalm_0236=CreateUnit(p,'Nalm',-5899.1,3119.9,290.)
  set u=CreateUnit(p,'u018',461.6,-2078.7,50.)
  set gg_unit_e00Q_0282=CreateUnit(p,'e00Q',-4752.8,-7154.2,227.24)
  call SetUnitAcquireRange(gg_unit_e00Q_0282,200.)
  set t=CreateTrigger()
  call TriggerRegisterUnitEvent(t,gg_unit_e00Q_0282,EVENT_UNIT_DEATH)
  call TriggerRegisterUnitEvent(t,gg_unit_e00Q_0282,EVENT_UNIT_CHANGE_OWNER)
  call TriggerAddAction(t,function Unit000047_DropItems)
  set u=CreateUnit(p,'nnsw',-3033.6,2243.9,32.356)
  set u=CreateUnit(p,'nnsw',-3286.7,2463.6,335.379)
  set u=CreateUnit(p,'nnsu',-3391.4,1772.3,259.022)
  set u=CreateUnit(p,'nnsu',-3312.7,1515.7,150.045)
  set u=CreateUnit(p,'n01V',-4030.,2292.1,78.92)
  set gg_unit_o019_0288=CreateUnit(p,'o019',-6151.8,-2408.2,.0)
  set p=Player(0)
  set u=CreateUnit(p,'n01D',-1216.,320.,270.)
  set p=Player(1)
  set u=CreateUnit(p,'n01D',-960.,320.,270.)
  set p=Player(2)
  set u=CreateUnit(p,'n01D',-1216.,64.,270.)
  set p=Player(3)
  set u=CreateUnit(p,'n01D',-960.,64.,270.)
  set p=Player(4)
  set u=CreateUnit(p,'n01D',-1216.,-192.,270.)
  set p=Player(5)
  set u=CreateUnit(p,'n01D',-960.,-192.,270.)
  set p=Player(10)
  set gg_unit_o01P_0295=CreateUnit(p,'o01P',-5962.5,4292.4,30.)
  call InitBlizzard()
  set i=0
  set i=0
  loop
    exitwhen(i>6)
    set udg_Respawn_Hero_Timer[i]=CreateTimer()
    set udg_DifficultyVote[i]=0
    set udg_Mirror_Attack[i]=CreateGroup()
    set i=i+1
  endloop
  set udg_DifficultyDialog=DialogCreate()
  set i=0
  loop
    exitwhen(i>25)
    set udg_Shadow_Gate[i]=CreateGroup()
    set i=i+1
  endloop
  set i=0
  loop
    exitwhen(i>1)
    set udg_ShadowBashDis[i]=0
    set udg_StalkCheck[i]=false
    set udg_Wave_Angls[i]=0
    set udg_StrafeAngle[i]=0
    set udg_Random_Data[i]=0
    set udg_Death_Count[i]=0
    set udg_Kill_Count[i]=0
    set udg_Multiboard_Spots[i]=0
    set udg_Player_Colors[i]=""
    set udg_BossKill_Count[i]=0
    set i=i+1
  endloop
  set udg_CinematicDialog=DialogCreate()
  set i=0
  loop
    exitwhen(i>12)
    set udg_ChargedDefenseLevel[i]=0
    set i=i+1
  endloop
  call CSCache()
  call TriggerAddAction(gg_trg_Map_Initialization_Copy,function Trig_Map_Initialization_Copy_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_No_ally_attack,EVENT_PLAYER_UNIT_ATTACKED)
  call TriggerAddCondition(gg_trg_No_ally_attack,Condition(function Trig_No_ally_attack_Conditions))
  call TriggerAddAction(gg_trg_No_ally_attack,function Trig_No_ally_attack_Actions)
  call TriggerRegisterPlayerChatEvent(gg_trg_Skip,Player(0),"-skip",true)
  call TriggerAddAction(gg_trg_Skip,function Trig_Skip_Actions)
  call DisableTrigger(gg_trg_Modes_off)
  call TriggerAddAction(gg_trg_Modes_off,function Trig_Modes_off_Actions)
  call TriggerRegisterPlayerChatEvent(gg_trg_Turbo_Mode,Player(0),"-tm",true)
  call TriggerAddAction(gg_trg_Turbo_Mode,function Trig_Turbo_Mode_Actions)
  call TriggerAddAction(gg_trg_map_ini,function Trig_map_ini_Actions)
  call TriggerRegisterEnterRectSimple(gg_trg_Eyo,gg_rct_Center_of_Map)
  call TriggerAddCondition(gg_trg_Eyo,Condition(function Trig_Eyo_Conditions))
  call TriggerAddAction(gg_trg_Eyo,function Trig_Eyo_Actions)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Visibility_all,2)
  call TriggerAddAction(gg_trg_Visibility_all,function Trig_Visibility_all_Actions)
  call TriggerRegisterEnterRectSimple(gg_trg_Tavern,gg_rct_Tavern)
  call TriggerAddAction(gg_trg_Tavern,function Trig_Tavern_Actions)
  call TriggerRegisterPlayerStateEvent(gg_trg_Hero_Pick,Player(0),PLAYER_STATE_RESOURCE_LUMBER,EQUAL,.0)
  call TriggerAddAction(gg_trg_Hero_Pick,function Trig_Hero_Pick_Actions)
  call TriggerRegisterPlayerStateEvent(gg_trg_Hero_Pick_Copy,Player(1),PLAYER_STATE_RESOURCE_LUMBER,EQUAL,.0)
  call TriggerAddAction(gg_trg_Hero_Pick_Copy,function Trig_Hero_Pick_Copy_Actions)
  call TriggerRegisterPlayerStateEvent(gg_trg_Hero_Pick_Copy_2,Player(2),PLAYER_STATE_RESOURCE_LUMBER,EQUAL,.0)
  call TriggerAddAction(gg_trg_Hero_Pick_Copy_2,function Trig_Hero_Pick_Copy_2_Actions)
  call TriggerRegisterPlayerStateEvent(gg_trg_Hero_Pick_Copy_3,Player(3),PLAYER_STATE_RESOURCE_LUMBER,EQUAL,.0)
  call TriggerAddAction(gg_trg_Hero_Pick_Copy_3,function Trig_Hero_Pick_Copy_3_Actions)
  call TriggerRegisterPlayerStateEvent(gg_trg_Hero_Pick_Copy_4,Player(4),PLAYER_STATE_RESOURCE_LUMBER,EQUAL,.0)
  call TriggerAddAction(gg_trg_Hero_Pick_Copy_4,function Trig_Hero_Pick_Copy_4_Actions)
  call TriggerRegisterPlayerStateEvent(gg_trg_Hero_Pick_Copy_5,Player(5),PLAYER_STATE_RESOURCE_LUMBER,EQUAL,.0)
  call TriggerAddAction(gg_trg_Hero_Pick_Copy_5,function Trig_Hero_Pick_Copy_5_Actions)
  call TriggerRegisterEnterRectSimple(gg_trg_Desert_Winds,gg_rct_Desert)
  call TriggerAddCondition(gg_trg_Desert_Winds,Condition(function Trig_Desert_Winds_Conditions))
  call TriggerAddAction(gg_trg_Desert_Winds,function Trig_Desert_Winds_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Create_Multiboard,1.)
  call TriggerAddAction(gg_trg_Create_Multiboard,function Trig_Create_Multiboard_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Player_Kills_Update,EVENT_PLAYER_UNIT_DEATH)
  call TriggerAddCondition(gg_trg_Player_Kills_Update,Condition(function Trig_Player_Kills_Update_Conditions))
  call TriggerAddAction(gg_trg_Player_Kills_Update,function Trig_Player_Kills_Update_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Player_Deaths_Update,EVENT_PLAYER_UNIT_DEATH)
  call TriggerAddCondition(gg_trg_Player_Deaths_Update,Condition(function Trig_Player_Deaths_Update_Conditions))
  call TriggerAddAction(gg_trg_Player_Deaths_Update,function Trig_Player_Deaths_Update_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Player_Kills_Update_Copy,EVENT_PLAYER_UNIT_DEATH)
  call TriggerAddCondition(gg_trg_Player_Kills_Update_Copy,Condition(function Trig_Player_Kills_Update_Copy_Conditions))
  call TriggerAddAction(gg_trg_Player_Kills_Update_Copy,function Trig_Player_Kills_Update_Copy_Actions)
  call TriggerRegisterPlayerEventLeave(gg_trg_Player_leaves,Player(0))
  call TriggerRegisterPlayerEventLeave(gg_trg_Player_leaves,Player(1))
  call TriggerRegisterPlayerEventLeave(gg_trg_Player_leaves,Player(2))
  call TriggerRegisterPlayerEventLeave(gg_trg_Player_leaves,Player(3))
  call TriggerRegisterPlayerEventLeave(gg_trg_Player_leaves,Player(4))
  call TriggerRegisterPlayerEventLeave(gg_trg_Player_leaves,Player(5))
  call TriggerAddAction(gg_trg_Player_leaves,function Trig_Player_leaves_Actions)
  call TriggerAddAction(gg_trg_Define_Colors,function Trig_Define_Colors_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Time_is_20_seconds,20.)
  call TriggerAddAction(gg_trg_Time_is_20_seconds,function Trig_Time_is_20_seconds_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Time_is_45_seconds,45.)
  call TriggerAddAction(gg_trg_Time_is_45_seconds,function Trig_Time_is_45_seconds_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Manual_Hero_Pick,EVENT_PLAYER_UNIT_SELL)
  call TriggerAddCondition(gg_trg_Manual_Hero_Pick,Condition(function Trig_Manual_Hero_Pick_Conditions))
  call TriggerAddAction(gg_trg_Manual_Hero_Pick,function Trig_Manual_Hero_Pick_Actions)
  call TriggerRegisterPlayerChatEvent(gg_trg_All_Random_Command,Player(0),"-ar",true)
  call TriggerAddAction(gg_trg_All_Random_Command,function Trig_All_Random_Command_Actions)
  call DisableTrigger(gg_trg_Repick_Command)
  call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Command,Player(0),"-repick",true)
  call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Command,Player(1),"-repick",true)
  call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Command,Player(2),"-repick",true)
  call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Command,Player(3),"-repick",true)
  call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Command,Player(4),"-repick",true)
  call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Command,Player(5),"-repick",true)
  call TriggerAddCondition(gg_trg_Repick_Command,Condition(function Trig_Repick_Command_Conditions))
  call TriggerAddAction(gg_trg_Repick_Command,function Trig_Repick_Command_Actions)
  call DisableTrigger(gg_trg_Random_Command)
  call TriggerRegisterPlayerChatEvent(gg_trg_Random_Command,Player(0),"-random",true)
  call TriggerRegisterPlayerChatEvent(gg_trg_Random_Command,Player(1),"-random",true)
  call TriggerRegisterPlayerChatEvent(gg_trg_Random_Command,Player(2),"-random",true)
  call TriggerRegisterPlayerChatEvent(gg_trg_Random_Command,Player(3),"-random",true)
  call TriggerRegisterPlayerChatEvent(gg_trg_Random_Command,Player(4),"-random",true)
  call TriggerRegisterPlayerChatEvent(gg_trg_Random_Command,Player(5),"-random",true)
  call TriggerAddCondition(gg_trg_Random_Command,Condition(function Trig_Random_Command_Conditions))
  call TriggerAddAction(gg_trg_Random_Command,function Trig_Random_Command_Actions)
  call TriggerAddAction(gg_trg_Help,function Trig_Help_Actions)
  call TriggerAddAction(gg_trg_Undiscovered_Quests,function Trig_Undiscovered_Quests_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Weather,1.)
  call TriggerAddAction(gg_trg_Weather,function Trig_Weather_Actions)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Weather_On,1.)
  call TriggerAddAction(gg_trg_Weather_On,function Trig_Weather_On_Actions)
  call DisableTrigger(gg_trg_Under_Construction)
  call TriggerRegisterEnterRectSimple(gg_trg_Under_Construction,gg_rct_Mine_Field)
  call TriggerAddAction(gg_trg_Under_Construction,function Trig_Under_Construction_Actions)
  call DisableTrigger(gg_trg_Construction_complete)
  call TriggerRegisterGameStateEventTimeOfDay(gg_trg_Construction_complete,EQUAL,12)
  call TriggerAddAction(gg_trg_Construction_complete,function Trig_Construction_complete_Actions)
  call DisableTrigger(gg_trg_Goblin_1)
  call TriggerRegisterEnterRectSimple(gg_trg_Goblin_1,gg_rct_Goblin_1)
  call TriggerAddCondition(gg_trg_Goblin_1,Condition(function Trig_Goblin_1_Conditions))
  call TriggerAddAction(gg_trg_Goblin_1,function Trig_Goblin_1_Actions)
  call DisableTrigger(gg_trg_Goblin_2)
  call TriggerRegisterEnterRectSimple(gg_trg_Goblin_2,gg_rct_Goblin_2)
  call TriggerAddCondition(gg_trg_Goblin_2,Condition(function Trig_Goblin_2_Conditions))
  call TriggerAddAction(gg_trg_Goblin_2,function Trig_Goblin_2_Actions)
  call DisableTrigger(gg_trg_Goblin_3)
  call TriggerRegisterEnterRectSimple(gg_trg_Goblin_3,gg_rct_Goblin_3)
  call TriggerAddCondition(gg_trg_Goblin_3,Condition(function Trig_Goblin_3_Conditions))
  call TriggerAddAction(gg_trg_Goblin_3,function Trig_Goblin_3_Actions)
  call DisableTrigger(gg_trg_Goblin_4)
  call TriggerRegisterEnterRectSimple(gg_trg_Goblin_4,gg_rct_Goblin_4)
  call TriggerAddCondition(gg_trg_Goblin_4,Condition(function Trig_Goblin_4_Conditions))
  call TriggerAddAction(gg_trg_Goblin_4,function Trig_Goblin_4_Actions)
  call DisableTrigger(gg_trg_Statue_Pray)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Statue_Pray,EVENT_PLAYER_UNIT_DEATH)
  call TriggerAddCondition(gg_trg_Statue_Pray,Condition(function Trig_Statue_Pray_Conditions))
  call TriggerAddAction(gg_trg_Statue_Pray,function Trig_Statue_Pray_Actions)
  call DisableTrigger(gg_trg_Kerchek_Help)
  call TriggerRegisterUnitEvent(gg_trg_Kerchek_Help,gg_unit_ofrt_0001,EVENT_UNIT_DAMAGED)
  call TriggerAddCondition(gg_trg_Kerchek_Help,Condition(function Trig_Kerchek_Help_Conditions))
  call TriggerAddAction(gg_trg_Kerchek_Help,function Trig_Kerchek_Help_Actions)
  call DisableTrigger(gg_trg_Kerchek_Gone)
  call TriggerRegisterPlayerUnitEventSimple(gg_trg_Kerchek_Gone,Player(11),EVENT_PLAYER_UNIT_DEATH)
  call TriggerAddCondition(gg_trg_Kerchek_Gone,Condition(function Trig_Kerchek_Gone_Conditions))
  call TriggerAddAction(gg_trg_Kerchek_Gone,function Trig_Kerchek_Gone_Actions)
  call TriggerRegisterUnitEvent(gg_trg_Quest_Pedro_Negro,gg_unit_n01T_0064,EVENT_UNIT_DEATH)
  call TriggerAddAction(gg_trg_Quest_Pedro_Negro,function Trig_Quest_Pedro_Negro_Actions)
  call DisableTrigger(gg_trg_Quest_Pedro_Negro_Complete)
  call TriggerRegisterEnterRectSimple(gg_trg_Quest_Pedro_Negro_Complete,gg_rct_Goblin_Village_Cine)
  call TriggerAddCondition(gg_trg_Quest_Pedro_Negro_Complete,Condition(function Trig_Quest_Pedro_Negro_Complete_Conditions))
  call TriggerAddAction(gg_trg_Quest_Pedro_Negro_Complete,function Trig_Quest_Pedro_Negro_Complete_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Quest_Kercheks_Soul,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Quest_Kercheks_Soul,Condition(function Trig_Quest_Kercheks_Soul_Conditions))
  call TriggerAddAction(gg_trg_Quest_Kercheks_Soul,function Trig_Quest_Kercheks_Soul_Actions)
  call DisableTrigger(gg_trg_Quest_Kercheks_Soul_Complete)
  call TriggerRegisterEnterRectSimple(gg_trg_Quest_Kercheks_Soul_Complete,gg_rct_Troll_Cine)
  call TriggerAddCondition(gg_trg_Quest_Kercheks_Soul_Complete,Condition(function Trig_Quest_Kercheks_Soul_Complete_Conditions))
  call TriggerAddAction(gg_trg_Quest_Kercheks_Soul_Complete,function Trig_Quest_Kercheks_Soul_Complete_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Select_Difficulty_Copy_Copy_2,1.)
  call TriggerAddAction(gg_trg_Select_Difficulty_Copy_Copy_2,function Trig_Select_Difficulty_Copy_Copy_2_Actions)
  call TriggerRegisterDialogEvent(gg_trg_Button_pressed_in_difficulty_dialog_Copy_Copy_Copy,udg_DifficultyDialog)
  call TriggerAddAction(gg_trg_Button_pressed_in_difficulty_dialog_Copy_Copy_Copy,function Trig_Button_pressed_in_difficulty_dialog_Copy_Copy_Copy_Actions)
  call DisableTrigger(gg_trg_Easy_Difficulty_Copy)
  call TriggerAddAction(gg_trg_Easy_Difficulty_Copy,function Trig_Easy_Difficulty_Copy_Actions)
  call DisableTrigger(gg_trg_Normal_Difficulty_Copy)
  call TriggerAddAction(gg_trg_Normal_Difficulty_Copy,function Trig_Normal_Difficulty_Copy_Actions)
  call DisableTrigger(gg_trg_Hard_Difficulty_Copy)
  call TriggerAddAction(gg_trg_Hard_Difficulty_Copy,function Trig_Hard_Difficulty_Copy_Actions)
  call DisableTrigger(gg_trg_ExtraHard_Difficulty_Copy)
  call TriggerAddAction(gg_trg_ExtraHard_Difficulty_Copy,function Trig_ExtraHard_Difficulty_Copy_Actions)
  call DisableTrigger(gg_trg_Impossible_Difficulty_Copy)
  call TriggerAddAction(gg_trg_Impossible_Difficulty_Copy,function Trig_Impossible_Difficulty_Copy_Actions)
  call TriggerRegisterUnitEvent(gg_trg_Bloodbath_Death,gg_unit_n01L_0046,EVENT_UNIT_ATTACKED)
  call TriggerAddCondition(gg_trg_Bloodbath_Death,Condition(function Trig_Bloodbath_Death_Conditions))
  call TriggerAddAction(gg_trg_Bloodbath_Death,function Trig_Bloodbath_Death_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Pause,1.)
  call TriggerAddAction(gg_trg_Pause,function Trig_Pause_Actions)
  call TriggerRegisterEnterRectSimple(gg_trg_Troll_Village,gg_rct_Troll_Cine)
  call TriggerAddCondition(gg_trg_Troll_Village,Condition(function Trig_Troll_Village_Conditions))
  call TriggerAddAction(gg_trg_Troll_Village,function Trig_Troll_Village_Actions)
  call DisableTrigger(gg_trg_World_Tree)
  call TriggerRegisterEnterRectSimple(gg_trg_World_Tree,gg_rct_world_tree_cine)
  call TriggerAddCondition(gg_trg_World_Tree,Condition(function Trig_World_Tree_Conditions))
  call TriggerAddAction(gg_trg_World_Tree,function Trig_World_Tree_Actions)
  call TriggerRegisterEnterRectSimple(gg_trg_Goblin_Village,gg_rct_Goblin_Village_Cine)
  call TriggerAddCondition(gg_trg_Goblin_Village,Condition(function Trig_Goblin_Village_Conditions))
  call TriggerAddAction(gg_trg_Goblin_Village,function Trig_Goblin_Village_Actions)
  call DisableTrigger(gg_trg_Pedro_Negro)
  call TriggerRegisterEnterRectSimple(gg_trg_Pedro_Negro,gg_rct_Pedro_Negro_Open_Cine)
  call TriggerAddCondition(gg_trg_Pedro_Negro,Condition(function Trig_Pedro_Negro_Conditions))
  call TriggerAddAction(gg_trg_Pedro_Negro,function Trig_Pedro_Negro_Actions)
  call TriggerRegisterUnitEvent(gg_trg_Pedro_Negro_Death,gg_unit_n01T_0064,EVENT_UNIT_DEATH)
  call TriggerAddAction(gg_trg_Pedro_Negro_Death,function Trig_Pedro_Negro_Death_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Ultima_Weapon_Cine,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Ultima_Weapon_Cine,Condition(function Trig_Ultima_Weapon_Cine_Conditions))
  call TriggerAddAction(gg_trg_Ultima_Weapon_Cine,function Trig_Ultima_Weapon_Cine_Actions)
  call DisableTrigger(gg_trg_Ultima_Weapon_Crazy)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Ultima_Weapon_Crazy,.5)
  call TriggerAddAction(gg_trg_Ultima_Weapon_Crazy,function Trig_Ultima_Weapon_Crazy_Actions)
  call TriggerAddAction(gg_trg_Invulnerable,function Trig_Invulnerable_Actions)
  call DisableTrigger(gg_trg_Vulnerable)
  call TriggerRegisterPlayerUnitEventSimple(gg_trg_Vulnerable,Player(11),EVENT_PLAYER_UNIT_DEATH)
  call TriggerAddCondition(gg_trg_Vulnerable,Condition(function Trig_Vulnerable_Conditions))
  call TriggerAddAction(gg_trg_Vulnerable,function Trig_Vulnerable_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Centaur_Khan,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Centaur_Khan,Condition(function Trig_Centaur_Khan_Conditions))
  call TriggerAddAction(gg_trg_Centaur_Khan,function Trig_Centaur_Khan_Actions)
  call TriggerRegisterLeaveRectSimple(gg_trg_Stay,gg_rct_Desert)
  call TriggerAddCondition(gg_trg_Stay,Condition(function Trig_Stay_Conditions))
  call TriggerAddAction(gg_trg_Stay,function Trig_Stay_Actions)
  call DisableTrigger(gg_trg_Burn_Trees)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Burn_Trees,2)
  call TriggerAddAction(gg_trg_Burn_Trees,function Trig_Burn_Trees_Actions)
  call DisableTrigger(gg_trg_Tauren_Spawns)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Tauren_Spawns,25.)
  call TriggerAddAction(gg_trg_Tauren_Spawns,function Trig_Tauren_Spawns_Actions)
  call DisableTrigger(gg_trg_Tauren_Spawns2)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Tauren_Spawns2,25.)
  call TriggerAddAction(gg_trg_Tauren_Spawns2,function Trig_Tauren_Spawns2_Actions)
  call DisableTrigger(gg_trg_Centaur_Spawns)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Centaur_Spawns,15.)
  call TriggerAddAction(gg_trg_Centaur_Spawns,function Trig_Centaur_Spawns_Actions)
  call DisableTrigger(gg_trg_Centaur_Spawns2)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Centaur_Spawns2,15.)
  call TriggerAddAction(gg_trg_Centaur_Spawns2,function Trig_Centaur_Spawns2_Actions)
  call DisableTrigger(gg_trg_WayPoints)
  call TriggerRegisterTimerEventPeriodic(gg_trg_WayPoints,.3)
  call TriggerAddAction(gg_trg_WayPoints,function Trig_WayPoints_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Destroyed,EVENT_PLAYER_UNIT_DEATH)
  call TriggerAddAction(gg_trg_Destroyed,function Trig_Destroyed_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Combine_Items,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Combine_Items,Condition(function Trig_Combine_Items_Conditions))
  call TriggerAddAction(gg_trg_Combine_Items,function Trig_Combine_Items_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Enchanted_Axe,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Enchanted_Axe,Condition(function Trig_Enchanted_Axe_Conditions))
  call TriggerAddAction(gg_trg_Enchanted_Axe,function Trig_Enchanted_Axe_Actions)
  call DisableTrigger(gg_trg_Enchanted_ON)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Enchanted_ON,.5)
  call TriggerAddAction(gg_trg_Enchanted_ON,function Trig_Enchanted_ON_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Blitz,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Blitz,Condition(function Trig_Blitz_Conditions))
  call TriggerAddAction(gg_trg_Blitz,function Trig_Blitz_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Kinetic,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Kinetic,Condition(function Trig_Kinetic_Conditions))
  call TriggerAddAction(gg_trg_Kinetic,function Trig_Kinetic_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Terra_Upheaval,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Terra_Upheaval,Condition(function Trig_Terra_Upheaval_Conditions))
  call TriggerAddAction(gg_trg_Terra_Upheaval,function Trig_Terra_Upheaval_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Viral_rush,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Viral_rush,Condition(function Trig_Viral_rush_Conditions))
  call TriggerAddAction(gg_trg_Viral_rush,function Trig_Viral_rush_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Emma,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Emma,Condition(function Trig_Emma_Conditions))
  call TriggerAddAction(gg_trg_Emma,function Trig_Emma_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Red_Dynasty,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Red_Dynasty,Condition(function Trig_Red_Dynasty_Conditions))
  call TriggerAddAction(gg_trg_Red_Dynasty,function Trig_Red_Dynasty_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Ravage,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Ravage,Condition(function Trig_Ravage_Conditions))
  call TriggerAddAction(gg_trg_Ravage,function Trig_Ravage_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Hunger,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Hunger,Condition(function Trig_Hunger_Conditions))
  call TriggerAddAction(gg_trg_Hunger,function Trig_Hunger_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Shurikentoss,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Shurikentoss,Condition(function Trig_Shurikentoss_Conditions))
  call TriggerAddAction(gg_trg_Shurikentoss,function Trig_Shurikentoss_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Ancient,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Ancient,Condition(function Trig_Ancient_Conditions))
  call TriggerAddAction(gg_trg_Ancient,function Trig_Ancient_Actions)
  call DisableTrigger(gg_trg_Ancient_ON)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Ancient_ON,.5)
  call TriggerAddAction(gg_trg_Ancient_ON,function Trig_Ancient_ON_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Demi,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Demi,Condition(function Trig_Demi_Conditions))
  call TriggerAddAction(gg_trg_Demi,function Trig_Demi_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Synergy,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Synergy,Condition(function Trig_Synergy_Conditions))
  call TriggerAddAction(gg_trg_Synergy,function Trig_Synergy_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Perification,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Perification,Condition(function Trig_Perification_Conditions))
  call TriggerAddAction(gg_trg_Perification,function Trig_Perification_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Hail_Break,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Hail_Break,Condition(function Trig_Hail_Break_Conditions))
  call TriggerAddAction(gg_trg_Hail_Break,function Trig_Hail_Break_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Glacial_Path,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Glacial_Path,Condition(function Trig_Glacial_Path_Conditions))
  call TriggerAddAction(gg_trg_Glacial_Path,function Trig_Glacial_Path_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Scapalexis,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Scapalexis,Condition(function Trig_Scapalexis_Conditions))
  call TriggerAddAction(gg_trg_Scapalexis,function Trig_Scapalexis_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Cozi,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Cozi,Condition(function Trig_Cozi_Conditions))
  call TriggerAddAction(gg_trg_Cozi,function Trig_Cozi_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Damage_Block,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Damage_Block,Condition(function Trig_Damage_Block_Conditions))
  call TriggerAddAction(gg_trg_Damage_Block,function Trig_Damage_Block_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Cheese,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Cheese,Condition(function Trig_Cheese_Conditions))
  call TriggerAddAction(gg_trg_Cheese,function Trig_Cheese_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Cleaving,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Cleaving,Condition(function Trig_Cleaving_Conditions))
  call TriggerAddAction(gg_trg_Cleaving,function Trig_Cleaving_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Lightning,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Lightning,Condition(function Trig_Lightning_Conditions))
  call TriggerAddAction(gg_trg_Lightning,function Trig_Lightning_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Shadow,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Shadow,Condition(function Trig_Shadow_Conditions))
  call TriggerAddAction(gg_trg_Shadow,function Trig_Shadow_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Blade_Dance,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Blade_Dance,Condition(function Trig_Blade_Dance_Conditions))
  call TriggerAddAction(gg_trg_Blade_Dance,function Trig_Blade_Dance_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Naisha,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Naisha,Condition(function Trig_Naisha_Conditions))
  call TriggerAddAction(gg_trg_Naisha,function Trig_Naisha_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Panda,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Panda,Condition(function Trig_Panda_Conditions))
  call TriggerAddAction(gg_trg_Panda,function Trig_Panda_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Minotaur,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Minotaur,Condition(function Trig_Minotaur_Conditions))
  call TriggerAddAction(gg_trg_Minotaur,function Trig_Minotaur_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Direct,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Direct,Condition(function Trig_Direct_Conditions))
  call TriggerAddAction(gg_trg_Direct,function Trig_Direct_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Pong,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Pong,Condition(function Trig_Pong_Conditions))
  call TriggerAddAction(gg_trg_Pong,function Trig_Pong_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Meteor,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Meteor,Condition(function Trig_Meteor_Conditions))
  call TriggerAddAction(gg_trg_Meteor,function Trig_Meteor_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Mark,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Mark,Condition(function Trig_Mark_Conditions))
  call TriggerAddAction(gg_trg_Mark,function Trig_Mark_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Warden,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Warden,Condition(function Trig_Warden_Conditions))
  call TriggerAddAction(gg_trg_Warden,function Trig_Warden_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Poseidon,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Poseidon,Condition(function Trig_Poseidon_Conditions))
  call TriggerAddAction(gg_trg_Poseidon,function Trig_Poseidon_Actions)
  call TriggerRegisterDeathEvent(gg_trg_Return_of_Tombo,gg_dest_LOcg_1956)
  call TriggerAddAction(gg_trg_Return_of_Tombo,function Trig_Return_of_Tombo_Actions)
  call TriggerRegisterUnitEvent(gg_trg_Forest_Watcher_Control,gg_unit_n01L_0046,EVENT_UNIT_DEATH)
  call TriggerAddAction(gg_trg_Forest_Watcher_Control,function Trig_Forest_Watcher_Control_Actions)
  call TriggerRegisterEnterRectSimple(gg_trg_Keep_Out,gg_rct_keep_out)
  call TriggerAddCondition(gg_trg_Keep_Out,Condition(function Trig_Keep_Out_Conditions))
  call TriggerAddAction(gg_trg_Keep_Out,function Trig_Keep_Out_Actions)
  call DisableTrigger(gg_trg_Step_Pad)
  call TriggerRegisterEnterRectSimple(gg_trg_Step_Pad,gg_rct_pad)
  call TriggerAddCondition(gg_trg_Step_Pad,Condition(function Trig_Step_Pad_Conditions))
  call TriggerAddAction(gg_trg_Step_Pad,function Trig_Step_Pad_Actions)
  call TriggerRegisterEnterRectSimple(gg_trg_Exit_Forest,gg_rct_Forest_Exit)
  call TriggerAddCondition(gg_trg_Exit_Forest,Condition(function Trig_Exit_Forest_Conditions))
  call TriggerAddAction(gg_trg_Exit_Forest,function Trig_Exit_Forest_Actions)
  call TriggerRegisterLeaveRectSimple(gg_trg_Forest_Watchers,gg_rct_forest_keep)
  call TriggerAddCondition(gg_trg_Forest_Watchers,Condition(function Trig_Forest_Watchers_Conditions))
  call TriggerAddAction(gg_trg_Forest_Watchers,function Trig_Forest_Watchers_Actions)
  call TriggerRegisterUnitEvent(gg_trg_Exit_Cave,gg_unit_n01M_0045,EVENT_UNIT_DEATH)
  call TriggerAddAction(gg_trg_Exit_Cave,function Trig_Exit_Cave_Actions)
  call TriggerRegisterEnterRectSimple(gg_trg_Enter_Cave,gg_rct_Secrect_Cave_Enter)
  call TriggerAddCondition(gg_trg_Enter_Cave,Condition(function Trig_Enter_Cave_Conditions))
  call TriggerAddAction(gg_trg_Enter_Cave,function Trig_Enter_Cave_Actions)
  call TriggerRegisterUnitEvent(gg_trg_Explode,gg_unit_nglm_0043,EVENT_UNIT_DEATH)
  call TriggerAddAction(gg_trg_Explode,function Trig_Explode_Actions)
  call TriggerRegisterUnitEvent(gg_trg_Explode_Copy,gg_unit_nglm_0042,EVENT_UNIT_DEATH)
  call TriggerAddAction(gg_trg_Explode_Copy,function Trig_Explode_Copy_Actions)
  call TriggerRegisterUnitEvent(gg_trg_Explode_Copy_2,gg_unit_nglm_0044,EVENT_UNIT_DEATH)
  call TriggerAddAction(gg_trg_Explode_Copy_2,function Trig_Explode_Copy_2_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Armor_Up,EVENT_PLAYER_UNIT_SELL_ITEM)
  call TriggerAddCondition(gg_trg_Armor_Up,Condition(function Trig_Armor_Up_Conditions))
  call TriggerAddAction(gg_trg_Armor_Up,function Trig_Armor_Up_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Frost_Guard,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Frost_Guard,Condition(function Trig_Frost_Guard_Conditions))
  call TriggerAddAction(gg_trg_Frost_Guard,function Trig_Frost_Guard_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Ballista,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Ballista,Condition(function Trig_Ballista_Conditions))
  call TriggerAddAction(gg_trg_Ballista,function Trig_Ballista_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Mythril_Rod,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Mythril_Rod,Condition(function Trig_Mythril_Rod_Conditions))
  call TriggerAddAction(gg_trg_Mythril_Rod,function Trig_Mythril_Rod_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Ballista_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Ballista_4sho,Condition(function Trig_Ballista_4sho_Conditions))
  call TriggerAddAction(gg_trg_Ballista_4sho,function Trig_Ballista_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_War_Club_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_War_Club_4sho,Condition(function Trig_War_Club_4sho_Conditions))
  call TriggerAddAction(gg_trg_War_Club_4sho,function Trig_War_Club_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Mystile_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Mystile_4sho,Condition(function Trig_Mystile_4sho_Conditions))
  call TriggerAddAction(gg_trg_Mystile_4sho,function Trig_Mystile_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Tetra_Element_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Tetra_Element_4sho,Condition(function Trig_Tetra_Element_4sho_Conditions))
  call TriggerAddAction(gg_trg_Tetra_Element_4sho,function Trig_Tetra_Element_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Nature_Staff_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Nature_Staff_4sho,Condition(function Trig_Nature_Staff_4sho_Conditions))
  call TriggerAddAction(gg_trg_Nature_Staff_4sho,function Trig_Nature_Staff_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Trance_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Trance_4sho,Condition(function Trig_Trance_4sho_Conditions))
  call TriggerAddAction(gg_trg_Trance_4sho,function Trig_Trance_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Regen_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Regen_4sho,Condition(function Trig_Regen_4sho_Conditions))
  call TriggerAddAction(gg_trg_Regen_4sho,function Trig_Regen_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Band_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Band_4sho,Condition(function Trig_Band_4sho_Conditions))
  call TriggerAddAction(gg_trg_Band_4sho,function Trig_Band_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Razorspine_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Razorspine_4sho,Condition(function Trig_Razorspine_4sho_Conditions))
  call TriggerAddAction(gg_trg_Razorspine_4sho,function Trig_Razorspine_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Ratmik_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Ratmik_4sho,Condition(function Trig_Ratmik_4sho_Conditions))
  call TriggerAddAction(gg_trg_Ratmik_4sho,function Trig_Ratmik_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Sword_of_Mogrin_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Sword_of_Mogrin_4sho,Condition(function Trig_Sword_of_Mogrin_4sho_Conditions))
  call TriggerAddAction(gg_trg_Sword_of_Mogrin_4sho,function Trig_Sword_of_Mogrin_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Reaver_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Reaver_4sho,Condition(function Trig_Reaver_4sho_Conditions))
  call TriggerAddAction(gg_trg_Reaver_4sho,function Trig_Reaver_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Sheep_Stick_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Sheep_Stick_4sho,Condition(function Trig_Sheep_Stick_4sho_Conditions))
  call TriggerAddAction(gg_trg_Sheep_Stick_4sho,function Trig_Sheep_Stick_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Orb_of_Eternal_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Orb_of_Eternal_4sho,Condition(function Trig_Orb_of_Eternal_4sho_Conditions))
  call TriggerAddAction(gg_trg_Orb_of_Eternal_4sho,function Trig_Orb_of_Eternal_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Helm_of_Deathlord_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Helm_of_Deathlord_4sho,Condition(function Trig_Helm_of_Deathlord_4sho_Conditions))
  call TriggerAddAction(gg_trg_Helm_of_Deathlord_4sho,function Trig_Helm_of_Deathlord_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Halberd_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Halberd_4sho,Condition(function Trig_Halberd_4sho_Conditions))
  call TriggerAddAction(gg_trg_Halberd_4sho,function Trig_Halberd_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Axe_of_Mayhem_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Axe_of_Mayhem_4sho,Condition(function Trig_Axe_of_Mayhem_4sho_Conditions))
  call TriggerAddAction(gg_trg_Axe_of_Mayhem_4sho,function Trig_Axe_of_Mayhem_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Grim_Batol_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Grim_Batol_4sho,Condition(function Trig_Grim_Batol_4sho_Conditions))
  call TriggerAddAction(gg_trg_Grim_Batol_4sho,function Trig_Grim_Batol_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Wiser_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Wiser_4sho,Condition(function Trig_Wiser_4sho_Conditions))
  call TriggerAddAction(gg_trg_Wiser_4sho,function Trig_Wiser_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Killer7_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Killer7_4sho,Condition(function Trig_Killer7_4sho_Conditions))
  call TriggerAddAction(gg_trg_Killer7_4sho,function Trig_Killer7_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Serpent_Staff_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Serpent_Staff_4sho,Condition(function Trig_Serpent_Staff_4sho_Conditions))
  call TriggerAddAction(gg_trg_Serpent_Staff_4sho,function Trig_Serpent_Staff_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Muradin_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Muradin_4sho,Condition(function Trig_Muradin_4sho_Conditions))
  call TriggerAddAction(gg_trg_Muradin_4sho,function Trig_Muradin_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Ziedrich_4sho,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Ziedrich_4sho,Condition(function Trig_Ziedrich_4sho_Conditions))
  call TriggerAddAction(gg_trg_Ziedrich_4sho,function Trig_Ziedrich_4sho_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Axe_of_Killmaim,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Axe_of_Killmaim,Condition(function Trig_Axe_of_Killmaim_Conditions))
  call TriggerAddAction(gg_trg_Axe_of_Killmaim,function Trig_Axe_of_Killmaim_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Radiance,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Radiance,Condition(function Trig_Radiance_Conditions))
  call TriggerAddAction(gg_trg_Radiance,function Trig_Radiance_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Ragnarok,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Ragnarok,Condition(function Trig_Ragnarok_Conditions))
  call TriggerAddAction(gg_trg_Ragnarok,function Trig_Ragnarok_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Druid_Claw,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Druid_Claw,Condition(function Trig_Druid_Claw_Conditions))
  call TriggerAddAction(gg_trg_Druid_Claw,function Trig_Druid_Claw_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Mystile,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Mystile,Condition(function Trig_Mystile_Conditions))
  call TriggerAddAction(gg_trg_Mystile,function Trig_Mystile_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Eternal_Booster,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Eternal_Booster,Condition(function Trig_Eternal_Booster_Conditions))
  call TriggerAddAction(gg_trg_Eternal_Booster,function Trig_Eternal_Booster_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Gloves_of_Speed,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Gloves_of_Speed,Condition(function Trig_Gloves_of_Speed_Conditions))
  call TriggerAddAction(gg_trg_Gloves_of_Speed,function Trig_Gloves_of_Speed_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Mystic_Staff,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Mystic_Staff,Condition(function Trig_Mystic_Staff_Conditions))
  call TriggerAddAction(gg_trg_Mystic_Staff,function Trig_Mystic_Staff_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Pacaya_1,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Pacaya_1,Condition(function Trig_Pacaya_1_Conditions))
  call TriggerAddAction(gg_trg_Pacaya_1,function Trig_Pacaya_1_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Pacaya_2,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Pacaya_2,Condition(function Trig_Pacaya_2_Conditions))
  call TriggerAddAction(gg_trg_Pacaya_2,function Trig_Pacaya_2_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Rhokan,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Rhokan,Condition(function Trig_Rhokan_Conditions))
  call TriggerAddAction(gg_trg_Rhokan,function Trig_Rhokan_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Pacaya_3,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Pacaya_3,Condition(function Trig_Pacaya_3_Conditions))
  call TriggerAddAction(gg_trg_Pacaya_3,function Trig_Pacaya_3_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Demonic,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Demonic,Condition(function Trig_Demonic_Conditions))
  call TriggerAddAction(gg_trg_Demonic,function Trig_Demonic_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Killer7,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Killer7,Condition(function Trig_Killer7_Conditions))
  call TriggerAddAction(gg_trg_Killer7,function Trig_Killer7_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Grim_Batol,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Grim_Batol,Condition(function Trig_Grim_Batol_Conditions))
  call TriggerAddAction(gg_trg_Grim_Batol,function Trig_Grim_Batol_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Pacaya_4,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Pacaya_4,Condition(function Trig_Pacaya_4_Conditions))
  call TriggerAddAction(gg_trg_Pacaya_4,function Trig_Pacaya_4_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Ratmik,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Ratmik,Condition(function Trig_Ratmik_Conditions))
  call TriggerAddAction(gg_trg_Ratmik,function Trig_Ratmik_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Trance,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Trance,Condition(function Trig_Trance_Conditions))
  call TriggerAddAction(gg_trg_Trance,function Trig_Trance_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Scales_of_Razor,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Scales_of_Razor,Condition(function Trig_Scales_of_Razor_Conditions))
  call TriggerAddAction(gg_trg_Scales_of_Razor,function Trig_Scales_of_Razor_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Sword_of_Mogrin,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Sword_of_Mogrin,Condition(function Trig_Sword_of_Mogrin_Conditions))
  call TriggerAddAction(gg_trg_Sword_of_Mogrin,function Trig_Sword_of_Mogrin_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Unholy_Shield,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Unholy_Shield,Condition(function Trig_Unholy_Shield_Conditions))
  call TriggerAddAction(gg_trg_Unholy_Shield,function Trig_Unholy_Shield_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Axe,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Axe,Condition(function Trig_Axe_Conditions))
  call TriggerAddAction(gg_trg_Axe,function Trig_Axe_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Nature,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Nature,Condition(function Trig_Nature_Conditions))
  call TriggerAddAction(gg_trg_Nature,function Trig_Nature_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Lightning_Staff,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Lightning_Staff,Condition(function Trig_Lightning_Staff_Conditions))
  call TriggerAddAction(gg_trg_Lightning_Staff,function Trig_Lightning_Staff_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Sheep_Stick,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Sheep_Stick,Condition(function Trig_Sheep_Stick_Conditions))
  call TriggerAddAction(gg_trg_Sheep_Stick,function Trig_Sheep_Stick_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Bar,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Bar,Condition(function Trig_Bar_Conditions))
  call TriggerAddAction(gg_trg_Bar,function Trig_Bar_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Axe_of_Mayhem,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Axe_of_Mayhem,Condition(function Trig_Axe_of_Mayhem_Conditions))
  call TriggerAddAction(gg_trg_Axe_of_Mayhem,function Trig_Axe_of_Mayhem_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Lionheart_Seal,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Lionheart_Seal,Condition(function Trig_Lionheart_Seal_Conditions))
  call TriggerAddAction(gg_trg_Lionheart_Seal,function Trig_Lionheart_Seal_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Maul_of_Strength,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Maul_of_Strength,Condition(function Trig_Maul_of_Strength_Conditions))
  call TriggerAddAction(gg_trg_Maul_of_Strength,function Trig_Maul_of_Strength_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Reaver,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Reaver,Condition(function Trig_Reaver_Conditions))
  call TriggerAddAction(gg_trg_Reaver,function Trig_Reaver_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Muradins,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Muradins,Condition(function Trig_Muradins_Conditions))
  call TriggerAddAction(gg_trg_Muradins,function Trig_Muradins_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Halberdd,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Halberdd,Condition(function Trig_Halberdd_Conditions))
  call TriggerAddAction(gg_trg_Halberdd,function Trig_Halberdd_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_BHeart,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_BHeart,Condition(function Trig_BHeart_Conditions))
  call TriggerAddAction(gg_trg_BHeart,function Trig_BHeart_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Wiser,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Wiser,Condition(function Trig_Wiser_Conditions))
  call TriggerAddAction(gg_trg_Wiser,function Trig_Wiser_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Lariat,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Lariat,Condition(function Trig_Lariat_Conditions))
  call TriggerAddAction(gg_trg_Lariat,function Trig_Lariat_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_War_Club,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_War_Club,Condition(function Trig_War_Club_Conditions))
  call TriggerAddAction(gg_trg_War_Club,function Trig_War_Club_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Totem,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Totem,Condition(function Trig_Totem_Conditions))
  call TriggerAddAction(gg_trg_Totem,function Trig_Totem_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Orb_of_Eternal_Power,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Orb_of_Eternal_Power,Condition(function Trig_Orb_of_Eternal_Power_Conditions))
  call TriggerAddAction(gg_trg_Orb_of_Eternal_Power,function Trig_Orb_of_Eternal_Power_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Ziedrich,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Ziedrich,Condition(function Trig_Ziedrich_Conditions))
  call TriggerAddAction(gg_trg_Ziedrich,function Trig_Ziedrich_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Minerva_Band,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Minerva_Band,Condition(function Trig_Minerva_Band_Conditions))
  call TriggerAddAction(gg_trg_Minerva_Band,function Trig_Minerva_Band_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Ultima,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Ultima,Condition(function Trig_Ultima_Conditions))
  call TriggerAddAction(gg_trg_Ultima,function Trig_Ultima_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Tetra_E,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Tetra_E,Condition(function Trig_Tetra_E_Conditions))
  call TriggerAddAction(gg_trg_Tetra_E,function Trig_Tetra_E_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Regeneration,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Regeneration,Condition(function Trig_Regeneration_Conditions))
  call TriggerAddAction(gg_trg_Regeneration,function Trig_Regeneration_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Uther_Hammer,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Uther_Hammer,Condition(function Trig_Uther_Hammer_Conditions))
  call TriggerAddAction(gg_trg_Uther_Hammer,function Trig_Uther_Hammer_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Pendant_of_Power,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Pendant_of_Power,Condition(function Trig_Pendant_of_Power_Conditions))
  call TriggerAddAction(gg_trg_Pendant_of_Power,function Trig_Pendant_of_Power_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Helm_of_the_Deathlord,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Helm_of_the_Deathlord,Condition(function Trig_Helm_of_the_Deathlord_Conditions))
  call TriggerAddAction(gg_trg_Helm_of_the_Deathlord,function Trig_Helm_of_the_Deathlord_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Acquires_Item,EVENT_PLAYER_UNIT_PICKUP_ITEM)
  call TriggerAddCondition(gg_trg_Acquires_Item,Condition(function Trig_Acquires_Item_Conditions))
  call TriggerAddAction(gg_trg_Acquires_Item,function Trig_Acquires_Item_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Frost_Guard2,.1)
  call TriggerAddAction(gg_trg_Frost_Guard2,function Trig_Frost_Guard2_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Gloves_of_Speed2,.1)
  call TriggerAddAction(gg_trg_Gloves_of_Speed2,function Trig_Gloves_of_Speed2_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Axe_of_Killmaim2,.1)
  call TriggerAddAction(gg_trg_Axe_of_Killmaim2,function Trig_Axe_of_Killmaim2_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Skull_Shield2,.1)
  call TriggerAddAction(gg_trg_Skull_Shield2,function Trig_Skull_Shield2_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Helm_of_the_Deathlord2,.1)
  call TriggerAddAction(gg_trg_Helm_of_the_Deathlord2,function Trig_Helm_of_the_Deathlord2_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Orb_of_Eternal_Power2,.1)
  call TriggerAddAction(gg_trg_Orb_of_Eternal_Power2,function Trig_Orb_of_Eternal_Power2_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Cloak_of_Shadows2,.1)
  call TriggerAddAction(gg_trg_Cloak_of_Shadows2,function Trig_Cloak_of_Shadows2_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Eternal_Booster2,.1)
  call TriggerAddAction(gg_trg_Eternal_Booster2,function Trig_Eternal_Booster2_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Quatl_Bar2,.1)
  call TriggerAddAction(gg_trg_Quatl_Bar2,function Trig_Quatl_Bar2_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Ring_of_Superiority2,.1)
  call TriggerAddAction(gg_trg_Ring_of_Superiority2,function Trig_Ring_of_Superiority2_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Mystic_Staff2,.1)
  call TriggerAddAction(gg_trg_Mystic_Staff2,function Trig_Mystic_Staff2_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Muradiins_Hammer2,.1)
  call TriggerAddAction(gg_trg_Muradiins_Hammer2,function Trig_Muradiins_Hammer2_Actions)
  call TriggerAddAction(gg_trg_Weather_Set_Chances,function Trig_Weather_Set_Chances_Actions)
  call TriggerRegisterTimerExpireEvent(gg_trg_Wave_Number,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Wave_Number,Condition(function Trig_Wave_Number_Conditions))
  call TriggerAddAction(gg_trg_Wave_Number,function Trig_Wave_Number_Actions)
  call DisableTrigger(gg_trg_Level_1)
  call TriggerAddAction(gg_trg_Level_1,function Trig_Level_1_Actions)
  call DisableTrigger(gg_trg_Level_2)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_2,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_2,Condition(function Trig_Level_2_Conditions))
  call TriggerAddAction(gg_trg_Level_2,function Trig_Level_2_Actions)
  call DisableTrigger(gg_trg_Level_3)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_3,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_3,Condition(function Trig_Level_3_Conditions))
  call TriggerAddAction(gg_trg_Level_3,function Trig_Level_3_Actions)
  call DisableTrigger(gg_trg_Level_4)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_4,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_4,Condition(function Trig_Level_4_Conditions))
  call TriggerAddAction(gg_trg_Level_4,function Trig_Level_4_Actions)
  call DisableTrigger(gg_trg_Level_5)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_5,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_5,Condition(function Trig_Level_5_Conditions))
  call TriggerAddAction(gg_trg_Level_5,function Trig_Level_5_Actions)
  call DisableTrigger(gg_trg_Level_6)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_6,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_6,Condition(function Trig_Level_6_Conditions))
  call TriggerAddAction(gg_trg_Level_6,function Trig_Level_6_Actions)
  call DisableTrigger(gg_trg_Level_7)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_7,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_7,Condition(function Trig_Level_7_Conditions))
  call TriggerAddAction(gg_trg_Level_7,function Trig_Level_7_Actions)
  call DisableTrigger(gg_trg_Level_8)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_8,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_8,Condition(function Trig_Level_8_Conditions))
  call TriggerAddAction(gg_trg_Level_8,function Trig_Level_8_Actions)
  call DisableTrigger(gg_trg_Level_9)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_9,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_9,Condition(function Trig_Level_9_Conditions))
  call TriggerAddAction(gg_trg_Level_9,function Trig_Level_9_Actions)
  call DisableTrigger(gg_trg_Level_10)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_10,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_10,Condition(function Trig_Level_10_Conditions))
  call TriggerAddAction(gg_trg_Level_10,function Trig_Level_10_Actions)
  call DisableTrigger(gg_trg_Level_11)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_11,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_11,Condition(function Trig_Level_11_Conditions))
  call TriggerAddAction(gg_trg_Level_11,function Trig_Level_11_Actions)
  call DisableTrigger(gg_trg_Level_12)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_12,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_12,Condition(function Trig_Level_12_Conditions))
  call TriggerAddAction(gg_trg_Level_12,function Trig_Level_12_Actions)
  call DisableTrigger(gg_trg_Level_13)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_13,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_13,Condition(function Trig_Level_13_Conditions))
  call TriggerAddAction(gg_trg_Level_13,function Trig_Level_13_Actions)
  call DisableTrigger(gg_trg_Level_14)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_14,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_14,Condition(function Trig_Level_14_Conditions))
  call TriggerAddAction(gg_trg_Level_14,function Trig_Level_14_Actions)
  call DisableTrigger(gg_trg_Level_15)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_15,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_15,Condition(function Trig_Level_15_Conditions))
  call TriggerAddAction(gg_trg_Level_15,function Trig_Level_15_Actions)
  call DisableTrigger(gg_trg_Level_16)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_16,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_16,Condition(function Trig_Level_16_Conditions))
  call TriggerAddAction(gg_trg_Level_16,function Trig_Level_16_Actions)
  call DisableTrigger(gg_trg_Level_17)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_17,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_17,Condition(function Trig_Level_17_Conditions))
  call TriggerAddAction(gg_trg_Level_17,function Trig_Level_17_Actions)
  call DisableTrigger(gg_trg_Level_18)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_18,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_18,Condition(function Trig_Level_18_Conditions))
  call TriggerAddAction(gg_trg_Level_18,function Trig_Level_18_Actions)
  call DisableTrigger(gg_trg_Level_19)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_19,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_19,Condition(function Trig_Level_19_Conditions))
  call TriggerAddAction(gg_trg_Level_19,function Trig_Level_19_Actions)
  call DisableTrigger(gg_trg_Level_20b)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_20b,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_20b,Condition(function Trig_Level_20b_Conditions))
  call TriggerAddAction(gg_trg_Level_20b,function Trig_Level_20b_Actions)
  call DisableTrigger(gg_trg_Level_21)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_21,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_21,Condition(function Trig_Level_21_Conditions))
  call TriggerAddAction(gg_trg_Level_21,function Trig_Level_21_Actions)
  call DisableTrigger(gg_trg_Level_22)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_22,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_22,Condition(function Trig_Level_22_Conditions))
  call TriggerAddAction(gg_trg_Level_22,function Trig_Level_22_Actions)
  call DisableTrigger(gg_trg_Level_23)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_23,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_23,Condition(function Trig_Level_23_Conditions))
  call TriggerAddAction(gg_trg_Level_23,function Trig_Level_23_Actions)
  call DisableTrigger(gg_trg_Level_24)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_24,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_24,Condition(function Trig_Level_24_Conditions))
  call TriggerAddAction(gg_trg_Level_24,function Trig_Level_24_Actions)
  call DisableTrigger(gg_trg_Level_25)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_25,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_25,Condition(function Trig_Level_25_Conditions))
  call TriggerAddAction(gg_trg_Level_25,function Trig_Level_25_Actions)
  call DisableTrigger(gg_trg_Level_26)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_26,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_26,Condition(function Trig_Level_26_Conditions))
  call TriggerAddAction(gg_trg_Level_26,function Trig_Level_26_Actions)
  call DisableTrigger(gg_trg_Level_27)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_27,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_27,Condition(function Trig_Level_27_Conditions))
  call TriggerAddAction(gg_trg_Level_27,function Trig_Level_27_Actions)
  call DisableTrigger(gg_trg_Level_28)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_28,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_28,Condition(function Trig_Level_28_Conditions))
  call TriggerAddAction(gg_trg_Level_28,function Trig_Level_28_Actions)
  call DisableTrigger(gg_trg_Level_29)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_29,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_29,Condition(function Trig_Level_29_Conditions))
  call TriggerAddAction(gg_trg_Level_29,function Trig_Level_29_Actions)
  call DisableTrigger(gg_trg_Level_30)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_30,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_30,Condition(function Trig_Level_30_Conditions))
  call TriggerAddAction(gg_trg_Level_30,function Trig_Level_30_Actions)
  call DisableTrigger(gg_trg_Level_31)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_31,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_31,Condition(function Trig_Level_31_Conditions))
  call TriggerAddAction(gg_trg_Level_31,function Trig_Level_31_Actions)
  call DisableTrigger(gg_trg_Level_32)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_32,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_32,Condition(function Trig_Level_32_Conditions))
  call TriggerAddAction(gg_trg_Level_32,function Trig_Level_32_Actions)
  call DisableTrigger(gg_trg_Level_33)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_33,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_33,Condition(function Trig_Level_33_Conditions))
  call TriggerAddAction(gg_trg_Level_33,function Trig_Level_33_Actions)
  call DisableTrigger(gg_trg_Level_34)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_34,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_34,Condition(function Trig_Level_34_Conditions))
  call TriggerAddAction(gg_trg_Level_34,function Trig_Level_34_Actions)
  call DisableTrigger(gg_trg_Level_35)
  call TriggerRegisterTimerExpireEvent(gg_trg_Level_35,udg_CREEPTIMER)
  call TriggerAddCondition(gg_trg_Level_35,Condition(function Trig_Level_35_Conditions))
  call TriggerAddAction(gg_trg_Level_35,function Trig_Level_35_Actions)
  call DisableTrigger(gg_trg_YOU_WON_Copy)
  call TriggerRegisterPlayerUnitEventSimple(gg_trg_YOU_WON_Copy,Player(11),EVENT_PLAYER_UNIT_DEATH)
  call TriggerAddCondition(gg_trg_YOU_WON_Copy,Condition(function Trig_YOU_WON_Copy_Conditions))
  call TriggerAddAction(gg_trg_YOU_WON_Copy,function Trig_YOU_WON_Copy_Actions)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Move_Copy,1.5)
  call TriggerAddAction(gg_trg_Move_Copy,function Trig_Move_Copy_Actions)
  call TriggerRegisterPlayerUnitEventSimple(gg_trg_Creep_Timer,Player(11),EVENT_PLAYER_UNIT_DEATH)
  call TriggerAddCondition(gg_trg_Creep_Timer,Condition(function Trig_Creep_Timer_Conditions))
  call TriggerAddAction(gg_trg_Creep_Timer,function Trig_Creep_Timer_Actions)
  call DisableTrigger(gg_trg_Dual_Creep_Timer)
  call TriggerRegisterPlayerUnitEventSimple(gg_trg_Dual_Creep_Timer,Player(11),EVENT_PLAYER_UNIT_DEATH)
  call TriggerAddCondition(gg_trg_Dual_Creep_Timer,Condition(function Trig_Dual_Creep_Timer_Conditions))
  call TriggerAddAction(gg_trg_Dual_Creep_Timer,function Trig_Dual_Creep_Timer_Actions)
  call DisableTrigger(gg_trg_Creep_Timer_Extreme)
  call TriggerRegisterPlayerUnitEventSimple(gg_trg_Creep_Timer_Extreme,Player(11),EVENT_PLAYER_UNIT_DEATH)
  call TriggerAddCondition(gg_trg_Creep_Timer_Extreme,Condition(function Trig_Creep_Timer_Extreme_Conditions))
  call TriggerAddAction(gg_trg_Creep_Timer_Extreme,function Trig_Creep_Timer_Extreme_Actions)
  call TriggerRegisterTimerExpireEvent(gg_trg_Timer_Destroy,udg_CREEPTIMER)
  call TriggerAddAction(gg_trg_Timer_Destroy,function Trig_Timer_Destroy_Actions)
  call TriggerRegisterTimerExpireEvent(gg_trg_Timer_On_Goblin,udg_CREEPTIMER)
  call TriggerAddAction(gg_trg_Timer_On_Goblin,function Trig_Timer_On_Goblin_Actions)
  call TriggerRegisterTimerExpireEvent(gg_trg_Timer_On_Troll,udg_CREEPTIMER)
  call TriggerAddAction(gg_trg_Timer_On_Troll,function Trig_Timer_On_Troll_Actions)
  call TriggerRegisterPlayerEventLeave(gg_trg_Player1_Leaves,Player(0))
  call TriggerAddAction(gg_trg_Player1_Leaves,function Trig_Player1_Leaves_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Player1_Leaves_Copy,1.)
  call TriggerAddCondition(gg_trg_Player1_Leaves_Copy,Condition(function Trig_Player1_Leaves_Copy_Conditions))
  call TriggerAddAction(gg_trg_Player1_Leaves_Copy,function Trig_Player1_Leaves_Copy_Actions)
  call TriggerRegisterPlayerEventLeave(gg_trg_Player2_Leaves,Player(1))
  call TriggerAddAction(gg_trg_Player2_Leaves,function Trig_Player2_Leaves_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Player1_Leaves_Copy_Copy,1.)
  call TriggerAddCondition(gg_trg_Player1_Leaves_Copy_Copy,Condition(function Trig_Player1_Leaves_Copy_Copy_Conditions))
  call TriggerAddAction(gg_trg_Player1_Leaves_Copy_Copy,function Trig_Player1_Leaves_Copy_Copy_Actions)
  call TriggerRegisterPlayerEventLeave(gg_trg_Player3_Leaves,Player(2))
  call TriggerAddAction(gg_trg_Player3_Leaves,function Trig_Player3_Leaves_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Player1_Leaves_Copy_Copy_2,1.)
  call TriggerAddCondition(gg_trg_Player1_Leaves_Copy_Copy_2,Condition(function Trig_Player1_Leaves_Copy_Copy_2_Conditions))
  call TriggerAddAction(gg_trg_Player1_Leaves_Copy_Copy_2,function Trig_Player1_Leaves_Copy_Copy_2_Actions)
  call TriggerRegisterPlayerEventLeave(gg_trg_Player4_Leaves,Player(3))
  call TriggerAddAction(gg_trg_Player4_Leaves,function Trig_Player4_Leaves_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Player1_Leaves_Copy_Copy_3,1.)
  call TriggerAddCondition(gg_trg_Player1_Leaves_Copy_Copy_3,Condition(function Trig_Player1_Leaves_Copy_Copy_3_Conditions))
  call TriggerAddAction(gg_trg_Player1_Leaves_Copy_Copy_3,function Trig_Player1_Leaves_Copy_Copy_3_Actions)
  call TriggerRegisterPlayerEventLeave(gg_trg_Player5_Leaves,Player(4))
  call TriggerAddAction(gg_trg_Player5_Leaves,function Trig_Player5_Leaves_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Player1_Leaves_Copy_Copy_4,1.)
  call TriggerAddCondition(gg_trg_Player1_Leaves_Copy_Copy_4,Condition(function Trig_Player1_Leaves_Copy_Copy_4_Conditions))
  call TriggerAddAction(gg_trg_Player1_Leaves_Copy_Copy_4,function Trig_Player1_Leaves_Copy_Copy_4_Actions)
  call TriggerRegisterPlayerEventLeave(gg_trg_Player6_Leaves,Player(5))
  call TriggerAddAction(gg_trg_Player6_Leaves,function Trig_Player6_Leaves_Actions)
  call TriggerRegisterTimerEventSingle(gg_trg_Player1_Leaves_Copy_Copy_5,1.)
  call TriggerAddCondition(gg_trg_Player1_Leaves_Copy_Copy_5,Condition(function Trig_Player1_Leaves_Copy_Copy_5_Conditions))
  call TriggerAddAction(gg_trg_Player1_Leaves_Copy_Copy_5,function Trig_Player1_Leaves_Copy_Copy_5_Actions)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Worldwide_Tree_Respawn,120.)
  call TriggerAddAction(gg_trg_Worldwide_Tree_Respawn,function Trig_Worldwide_Tree_Respawn_Actions)
  call TriggerRegisterUnitEvent(gg_trg_Lose,gg_unit_ofrt_0001,EVENT_UNIT_DEATH)
  call TriggerAddAction(gg_trg_Lose,function Trig_Lose_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Revive_Hero_Local,EVENT_PLAYER_UNIT_DEATH)
  call TriggerAddCondition(gg_trg_Revive_Hero_Local,Condition(function Trig_Revive_Hero_Local_Conditions))
  call TriggerAddAction(gg_trg_Revive_Hero_Local,function Trig_Revive_Hero_Local_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Shadow_Fury,EVENT_PLAYER_UNIT_SPELL_CAST)
  call TriggerAddCondition(gg_trg_Shadow_Fury,Condition(function Trig_Shadow_Fury_Conditions))
  call TriggerAddAction(gg_trg_Shadow_Fury,function Trig_Shadow_Fury_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Mirror_Assassins,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Mirror_Assassins,Condition(function Trig_Mirror_Assassins_Conditions))
  call TriggerAddAction(gg_trg_Mirror_Assassins,function Trig_Mirror_Assassins_Actions)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Move,.25)
  call TriggerAddAction(gg_trg_Move,function Trig_Move_Actions)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Remove,.1)
  call TriggerAddCondition(gg_trg_Remove,Condition(function Trig_Remove_Conditions))
  call TriggerAddAction(gg_trg_Remove,function Trig_Remove_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Attack,EVENT_PLAYER_UNIT_ATTACKED)
  call TriggerAddCondition(gg_trg_Attack,Condition(function Trig_Attack_Conditions))
  call TriggerAddAction(gg_trg_Attack,function Trig_Attack_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Focused_Fire,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Focused_Fire,Condition(function Trig_Focused_Fire_Conditions))
  call TriggerAddAction(gg_trg_Focused_Fire,function Trig_Focused_Fire_Actions)
  call DisableTrigger(gg_trg_Knocked_Back)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Knocked_Back,.05)
  call TriggerAddAction(gg_trg_Knocked_Back,function Trig_Knocked_Back_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Thunderstorm_Non_Channel,EVENT_PLAYER_UNIT_SPELL_CAST)
  call TriggerAddCondition(gg_trg_Thunderstorm_Non_Channel,Condition(function Trig_Thunderstorm_Non_Channel_Conditions))
  call TriggerAddAction(gg_trg_Thunderstorm_Non_Channel,function Trig_Thunderstorm_Non_Channel_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Osmose,EVENT_PLAYER_UNIT_DEATH)
  call TriggerAddCondition(gg_trg_Osmose,Condition(function Trig_Osmose_Conditions))
  call TriggerAddAction(gg_trg_Osmose,function Trig_Osmose_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Start,EVENT_PLAYER_UNIT_SPELL_CHANNEL)
  call TriggerAddCondition(gg_trg_Start,Condition(function Trig_Start_Conditions))
  call TriggerAddAction(gg_trg_Start,function Trig_Start_Actions)
  call DisableTrigger(gg_trg_cont)
  call TriggerRegisterTimerEventPeriodic(gg_trg_cont,.1)
  call TriggerAddAction(gg_trg_cont,function Trig_cont_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_End,EVENT_PLAYER_UNIT_SPELL_ENDCAST)
  call TriggerAddCondition(gg_trg_End,Condition(function Trig_End_Conditions))
  call TriggerAddAction(gg_trg_End,function Trig_End_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Death_Pulse_Multicasts,EVENT_PLAYER_UNIT_SPELL_CAST)
  call TriggerAddCondition(gg_trg_Death_Pulse_Multicasts,Condition(function Trig_Death_Pulse_Multicasts_Conditions))
  call TriggerAddAction(gg_trg_Death_Pulse_Multicasts,function Trig_Death_Pulse_Multicasts_Actions)
  call DisableTrigger(gg_trg_Death_Pulse_Mult)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Death_Pulse_Mult,1.)
  call TriggerAddAction(gg_trg_Death_Pulse_Mult,function Trig_Death_Pulse_Mult_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Blade_Massacre,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Blade_Massacre,Condition(function Trig_Blade_Massacre_Conditions))
  call TriggerAddAction(gg_trg_Blade_Massacre,function Trig_Blade_Massacre_Actions)
  call TriggerRegisterTimerExpireEvent(gg_trg_Shadow1Movement,udg_Shadow1Timer)
  call TriggerAddAction(gg_trg_Shadow1Movement,function Trig_Shadow1Movement_Actions)
  call DisableTrigger(gg_trg_Shadow2Movement)
  call TriggerRegisterTimerExpireEvent(gg_trg_Shadow2Movement,udg_Shadow2Timer)
  call TriggerAddAction(gg_trg_Shadow2Movement,function Trig_Shadow2Movement_Actions)
  call DisableTrigger(gg_trg_Shadow3Movement)
  call TriggerRegisterTimerExpireEvent(gg_trg_Shadow3Movement,udg_Shadow3Timer)
  call TriggerAddAction(gg_trg_Shadow3Movement,function Trig_Shadow3Movement_Actions)
  call DisableTrigger(gg_trg_Shadow4Movement)
  call TriggerRegisterTimerExpireEvent(gg_trg_Shadow4Movement,udg_Shadow4Timer)
  call TriggerAddAction(gg_trg_Shadow4Movement,function Trig_Shadow4Movement_Actions)
  call DisableTrigger(gg_trg_Shadow5Movement)
  call TriggerRegisterTimerExpireEvent(gg_trg_Shadow5Movement,udg_Shadow5Timer)
  call TriggerAddAction(gg_trg_Shadow5Movement,function Trig_Shadow5Movement_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Blast_Start_Graphic,EVENT_PLAYER_UNIT_SPELL_CHANNEL)
  call TriggerAddCondition(gg_trg_Blast_Start_Graphic,Condition(function Trig_Blast_Start_Graphic_Conditions))
  call TriggerAddAction(gg_trg_Blast_Start_Graphic,function Trig_Blast_Start_Graphic_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Blast_Start,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Blast_Start,Condition(function Trig_Blast_Start_Conditions))
  call TriggerAddAction(gg_trg_Blast_Start,function Trig_Blast_Start_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Aerial_strike,EVENT_PLAYER_UNIT_SPELL_CAST)
  call TriggerAddCondition(gg_trg_Aerial_strike,Condition(function Trig_Aerial_strike_Conditions))
  call TriggerAddAction(gg_trg_Aerial_strike,function Trig_Aerial_strike_Actions)
  call DisableTrigger(gg_trg_Aerial_move)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Aerial_move,.01)
  call TriggerAddAction(gg_trg_Aerial_move,function Trig_Aerial_move_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Earth_slayer_cast,EVENT_PLAYER_UNIT_SPELL_CAST)
  call TriggerAddCondition(gg_trg_Earth_slayer_cast,Condition(function Trig_Earth_slayer_cast_Conditions))
  call TriggerAddAction(gg_trg_Earth_slayer_cast,function Trig_Earth_slayer_cast_Actions)
  call DisableTrigger(gg_trg_Earth_slayer_charge)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Earth_slayer_charge,.02)
  call TriggerAddAction(gg_trg_Earth_slayer_charge,function Trig_Earth_slayer_charge_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Slam,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Slam,Condition(function Trig_Slam_Conditions))
  call TriggerAddAction(gg_trg_Slam,function Trig_Slam_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Cast,EVENT_PLAYER_UNIT_SPELL_CAST)
  call TriggerAddCondition(gg_trg_Cast,Condition(function Trig_Cast_Conditions))
  call TriggerAddAction(gg_trg_Cast,function Trig_Cast_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Charged_Unit_Attacked,EVENT_PLAYER_UNIT_ATTACKED)
  call TriggerAddCondition(gg_trg_Charged_Unit_Attacked,Condition(function Trig_Charged_Unit_Attacked_Conditions))
  call TriggerAddAction(gg_trg_Charged_Unit_Attacked,function Trig_Charged_Unit_Attacked_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Show,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Show,Condition(function Trig_Show_Conditions))
  call TriggerAddAction(gg_trg_Show,function Trig_Show_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Rend,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Rend,Condition(function Trig_Rend_Conditions))
  call TriggerAddAction(gg_trg_Rend,function Trig_Rend_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Show_Copy,EVENT_PLAYER_HERO_SKILL)
  call TriggerAddCondition(gg_trg_Show_Copy,Condition(function Trig_Show_Copy_Conditions))
  call TriggerAddAction(gg_trg_Show_Copy,function Trig_Show_Copy_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Hungeeer,EVENT_PLAYER_UNIT_SPELL_CAST)
  call TriggerAddCondition(gg_trg_Hungeeer,Condition(function Trig_Hungeeer_Conditions))
  call TriggerAddAction(gg_trg_Hungeeer,function Trig_Hungeeer_Actions)
  call DisableTrigger(gg_trg_Hungeeer_move)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Hungeeer_move,.05)
  call TriggerAddAction(gg_trg_Hungeeer_move,function Trig_Hungeeer_move_Actions)
  call DisableTrigger(gg_trg_Hungeeer_animation)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Hungeeer_animation,1.)
  call TriggerAddAction(gg_trg_Hungeeer_animation,function Trig_Hungeeer_animation_Actions)
  call DisableTrigger(gg_trg_Hungeeer_move_2)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Hungeeer_move_2,.01)
  call TriggerAddAction(gg_trg_Hungeeer_move_2,function Trig_Hungeeer_move_2_Actions)
  call DisableTrigger(gg_trg_Hungeeer_target_die)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Hungeeer_target_die,EVENT_PLAYER_UNIT_DEATH)
  call TriggerAddCondition(gg_trg_Hungeeer_target_die,Condition(function Trig_Hungeeer_target_die_Conditions))
  call TriggerAddAction(gg_trg_Hungeeer_target_die,function Trig_Hungeeer_target_die_Actions)
  call TriggerRegisterEnterRectSimple(gg_trg_Shen_daorong,bj_mapInitialPlayableArea)
  call TriggerAddCondition(gg_trg_Shen_daorong,Condition(function Trig_Shen_daorong_Conditions))
  call TriggerAddAction(gg_trg_Shen_daorong,function Trig_Shen_daorong_Actions)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Shen_daorong_move,.03)
  call TriggerAddAction(gg_trg_Shen_daorong_move,function Trig_Shen_daorong_move_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Dragon_Rush,EVENT_PLAYER_UNIT_SPELL_CAST)
  call TriggerAddCondition(gg_trg_Dragon_Rush,Condition(function Trig_Dragon_Rush_Conditions))
  call TriggerAddAction(gg_trg_Dragon_Rush,function Trig_Dragon_Rush_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Scatter_Shot,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Scatter_Shot,Condition(function Strafe_Conditions))
  call TriggerAddAction(gg_trg_Scatter_Shot,function Strafe_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Shot_animation,EVENT_PLAYER_UNIT_SPELL_CAST)
  call TriggerAddCondition(gg_trg_Shot_animation,Condition(function Trig_Shot_animation_Conditions))
  call TriggerAddAction(gg_trg_Shot_animation,function Trig_Shot_animation_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Dragoon_Dynasty,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Dragoon_Dynasty,Condition(function Trig_Dragoon_Dynasty_Conditions))
  call TriggerAddAction(gg_trg_Dragoon_Dynasty,function Trig_Dragoon_Dynasty_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Shuriken_Points,EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER)
  call TriggerAddCondition(gg_trg_Shuriken_Points,Condition(function Trig_Shuriken_Points_Conditions))
  call TriggerAddAction(gg_trg_Shuriken_Points,function Trig_Shuriken_Points_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Shuriken,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Shuriken,Condition(function Trig_Shuriken_Conditions))
  call TriggerAddAction(gg_trg_Shuriken,function Trig_Shuriken_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Frozen_Field_Setup_Copy,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Frozen_Field_Setup_Copy,Condition(function Trig_Frozen_Field_Setup_Copy_Conditions))
  call TriggerAddAction(gg_trg_Frozen_Field_Setup_Copy,function Trig_Frozen_Field_Setup_Copy_Actions)
  call DisableTrigger(gg_trg_Frozen_Field_I_Copy)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Frozen_Field_I_Copy,.2)
  call TriggerAddAction(gg_trg_Frozen_Field_I_Copy,function Trig_Frozen_Field_I_Copy_Actions)
  call DisableTrigger(gg_trg_Frozen_Field_II_Copy)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Frozen_Field_II_Copy,.2)
  call TriggerAddAction(gg_trg_Frozen_Field_II_Copy,function Trig_Frozen_Field_II_Copy_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_If_Channelling_stops_Copy,EVENT_PLAYER_UNIT_SPELL_ENDCAST)
  call TriggerAddCondition(gg_trg_If_Channelling_stops_Copy,Condition(function Trig_If_Channelling_stops_Copy_Conditions))
  call TriggerAddAction(gg_trg_If_Channelling_stops_Copy,function Trig_If_Channelling_stops_Copy_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Hydro_Pump_Setup,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Hydro_Pump_Setup,Condition(function Trig_Hydro_Pump_Setup_Conditions))
  call TriggerAddAction(gg_trg_Hydro_Pump_Setup,function Trig_Hydro_Pump_Setup_Actions)
  call DisableTrigger(gg_trg_Hydro_Pump_I)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Hydro_Pump_I,.2)
  call TriggerAddAction(gg_trg_Hydro_Pump_I,function Trig_Hydro_Pump_I_Actions)
  call DisableTrigger(gg_trg_Hydro_Pump_II)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Hydro_Pump_II,.2)
  call TriggerAddAction(gg_trg_Hydro_Pump_II,function Trig_Hydro_Pump_II_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_If_Channelling_stops,EVENT_PLAYER_UNIT_SPELL_ENDCAST)
  call TriggerAddCondition(gg_trg_If_Channelling_stops,Condition(function Trig_If_Channelling_stops_Conditions))
  call TriggerAddAction(gg_trg_If_Channelling_stops,function Trig_If_Channelling_stops_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Frost_Wave,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Frost_Wave,Condition(function Trig_Frost_Wave_Conditions))
  call TriggerAddAction(gg_trg_Frost_Wave,function Trig_Frost_Wave_Actions)
  set t=CreateTrigger()
  set i=0
  set gg_trg_Boomerang_Axes=InitGameCache("BoomerangAxes.w3v")
  call Initialize_BoomerangAxes_Variables()
  loop
    exitwhen i>11
    if(GetPlayerSlotState(Player(i))==PLAYER_SLOT_STATE_PLAYING)then
      call TriggerRegisterPlayerUnitEventSimple(t,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT)
    endif
    set i=i+1
  endloop
  call TriggerAddCondition(t,Condition(function Trig_Boomerang_Axes_Conditions))
  call TriggerAddAction(t,function Trig_Boomerang_Axes_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_NonChannel,EVENT_PLAYER_UNIT_SPELL_CAST)
  call TriggerAddCondition(gg_trg_NonChannel,Condition(function Trig_NonChannel_Conditions))
  call TriggerAddAction(gg_trg_NonChannel,function Trig_NonChannel_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Uppercut,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Uppercut,Condition(function Trig_Uppercut_Conditions))
  call TriggerAddAction(gg_trg_Uppercut,function Trig_Uppercut_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Poseidons_Wrath,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Poseidons_Wrath,Condition(function Trig_Poseidons_Wrath_Conditions))
  call TriggerAddAction(gg_trg_Poseidons_Wrath,function Trig_Poseidons_Wrath_Actions)
  call TriggerRegisterEnterRectSimple(gg_trg_Poseidon_Effects,bj_mapInitialPlayableArea)
  call TriggerAddCondition(gg_trg_Poseidon_Effects,Condition(function Trig_Poseidon_Effects_Conditions))
  call TriggerAddAction(gg_trg_Poseidon_Effects,function Trig_Poseidon_Effects_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Tidal_Wave,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Tidal_Wave,Condition(function Trig_Tidal_Wave_Conditions))
  call TriggerAddAction(gg_trg_Tidal_Wave,function Trig_Tidal_Wave_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Wolf_Fist_Points,EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER)
  call TriggerAddCondition(gg_trg_Wolf_Fist_Points,Condition(function Trig_Wolf_Fist_Points_Conditions))
  call TriggerAddAction(gg_trg_Wolf_Fist_Points,function Trig_Wolf_Fist_Points_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Wolf_Fang_Fist,EVENT_PLAYER_UNIT_SPELL_FINISH)
  call TriggerAddCondition(gg_trg_Wolf_Fang_Fist,Condition(function Trig_Wolf_Fang_Fist_Conditions))
  call TriggerAddAction(gg_trg_Wolf_Fang_Fist,function Trig_Wolf_Fang_Fist_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Tsunami_Non_Channel,EVENT_PLAYER_UNIT_SPELL_CAST)
  call TriggerAddCondition(gg_trg_Tsunami_Non_Channel,Condition(function Trig_Tsunami_Non_Channel_Conditions))
  call TriggerAddAction(gg_trg_Tsunami_Non_Channel,function Trig_Tsunami_Non_Channel_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Freeze_Explosion,EVENT_PLAYER_UNIT_DEATH)
  call TriggerAddCondition(gg_trg_Freeze_Explosion,Condition(function Trig_Freeze_Explosion_Conditions))
  call TriggerAddAction(gg_trg_Freeze_Explosion,function Trig_Freeze_Explosion_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Freeze_Explosion_Copy,EVENT_PLAYER_UNIT_DEATH)
  call TriggerAddCondition(gg_trg_Freeze_Explosion_Copy,Condition(function Trig_Freeze_Explosion_Copy_Conditions))
  call TriggerAddAction(gg_trg_Freeze_Explosion_Copy,function Trig_Freeze_Explosion_Copy_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Freeze_Explosion_Copy_2,EVENT_PLAYER_UNIT_DEATH)
  call TriggerAddCondition(gg_trg_Freeze_Explosion_Copy_2,Condition(function Trig_Freeze_Explosion_Copy_2_Conditions))
  call TriggerAddAction(gg_trg_Freeze_Explosion_Copy_2,function Trig_Freeze_Explosion_Copy_2_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Freeze_Explosion_Copy_3,EVENT_PLAYER_UNIT_DEATH)
  call TriggerAddCondition(gg_trg_Freeze_Explosion_Copy_3,Condition(function Trig_Freeze_Explosion_Copy_3_Conditions))
  call TriggerAddAction(gg_trg_Freeze_Explosion_Copy_3,function Trig_Freeze_Explosion_Copy_3_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Hex_Wave,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Hex_Wave,Condition(function Trig_Hex_Wave_Conditions))
  call TriggerAddAction(gg_trg_Hex_Wave,function Trig_Hex_Wave_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Root_Wave,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Root_Wave,Condition(function Trig_Root_Wave_Conditions))
  call TriggerAddAction(gg_trg_Root_Wave,function Trig_Root_Wave_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Flaming_Wave,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Flaming_Wave,Condition(function Trig_Flaming_Wave_Conditions))
  call TriggerAddAction(gg_trg_Flaming_Wave,function Trig_Flaming_Wave_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Split_Shot,EVENT_PLAYER_UNIT_ISSUED_ORDER)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Split_Shot,EVENT_PLAYER_UNIT_DEATH)
  call TriggerAddAction(gg_trg_Split_Shot,function Trig_Split_Shot_Actions)
  call Preload("war3mapImported\\Manastrike.mdx")
  call Preload("Abilities\\Spells\\Undead\\DeathandDecay\\DeathandDecayDamage.mdl")
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Manastrike,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Manastrike,Condition(function ManastrikeConditions))
  call TriggerAddAction(gg_trg_Manastrike,function ManastrikeActions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Swift_Attack_Copy,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Swift_Attack_Copy,Condition(function Trig_Swift_Attack_Copy_Conditions))
  call TriggerAddAction(gg_trg_Swift_Attack_Copy,function Trig_Swift_Attack_Copy_Actions)
  call TriggerRegisterTimerExpireEvent(gg_trg_Swift_Attack02_Copy,udg_Swift_Timer)
  call TriggerAddAction(gg_trg_Swift_Attack02_Copy,function Trig_Swift_Attack02_Copy_Actions)
  call TriggerAddAction(gg_trg_End_Swift_Attack_Copy,function Trig_End_Swift_Attack_Copy_Actions)
  call TriggerAddAction(gg_trg_Text_Thingy_Copy,function Trig_Text_Thingy_Copy_Actions)
  call DisableTrigger(gg_trg_Text_Thingy02_Copy)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Text_Thingy02_Copy,.01)
  call TriggerAddAction(gg_trg_Text_Thingy02_Copy,function Trig_Text_Thingy02_Copy_Actions)
  set m=CreateTrigger()
  set gg_trg_MultiDrain=InitGameCache("MultiDrain.w3v")
  call TriggerRegisterAnyUnitEventBJ(m,EVENT_PLAYER_UNIT_SPELL_CAST)
  call TriggerAddCondition(m,Condition(function Trig_MultiDrain_InitConditions))
  call TriggerAddAction(m,function Trig_MultiDrain_InitActions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Frozen_Chaos,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Frozen_Chaos,Condition(function FCConditions))
  call TriggerAddAction(gg_trg_Frozen_Chaos,function FCActions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Slow,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Slow,Condition(function SlowConditions))
  call TriggerAddAction(gg_trg_Slow,function SlowActions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Cyclone,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Cyclone,Condition(function CycloneConditions))
  call TriggerAddAction(gg_trg_Cyclone,function CycloneActions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Ancestral_Spirits,EVENT_PLAYER_UNIT_SPELL_FINISH)
  call TriggerAddCondition(gg_trg_Ancestral_Spirits,Condition(function Trig_Ancestral_Spirits_Conditions))
  call TriggerAddAction(gg_trg_Ancestral_Spirits,function Trig_Ancestral_Spirits_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Spirits_Target,EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER)
  call TriggerAddCondition(gg_trg_Spirits_Target,Condition(function Trig_Spirits_Target_Conditions))
  call TriggerAddAction(gg_trg_Spirits_Target,function Trig_Spirits_Target_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Mark_of_Flames,EVENT_PLAYER_UNIT_SPELL_CHANNEL)
  call TriggerAddCondition(gg_trg_Mark_of_Flames,Condition(function Trig_Mark_of_Flames_Conditions))
  call TriggerAddAction(gg_trg_Mark_of_Flames,function Trig_Mark_of_Flames_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Flames_Explosion,EVENT_PLAYER_UNIT_SPELL_FINISH)
  call TriggerAddCondition(gg_trg_Flames_Explosion,Condition(function Trig_Flames_Explosion_Conditions))
  call TriggerAddAction(gg_trg_Flames_Explosion,function Trig_Flames_Explosion_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Tri_Disatser,EVENT_PLAYER_UNIT_SPELL_FINISH)
  call TriggerAddCondition(gg_trg_Tri_Disatser,Condition(function Trig_Tri_Disatser_Conditions))
  call TriggerAddAction(gg_trg_Tri_Disatser,function Trig_Tri_Disatser_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Tri_Target,EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER)
  call TriggerAddCondition(gg_trg_Tri_Target,Condition(function Trig_Tri_Target_Conditions))
  call TriggerAddAction(gg_trg_Tri_Target,function Trig_Tri_Target_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Drunken_Brawler,EVENT_PLAYER_UNIT_SPELL_FINISH)
  call TriggerAddCondition(gg_trg_Drunken_Brawler,Condition(function Trig_Drunken_Brawler_Conditions))
  call TriggerAddAction(gg_trg_Drunken_Brawler,function Trig_Drunken_Brawler_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Drunken_Flee,EVENT_PLAYER_UNIT_SPELL_FINISH)
  call TriggerAddCondition(gg_trg_Drunken_Flee,Condition(function Trig_Drunken_Flee_Conditions))
  call TriggerAddAction(gg_trg_Drunken_Flee,function Trig_Drunken_Flee_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Flee_Point,EVENT_PLAYER_UNIT_SPELL_CAST)
  call TriggerAddCondition(gg_trg_Flee_Point,Condition(function Trig_Flee_Point_Conditions))
  call TriggerAddAction(gg_trg_Flee_Point,function Trig_Flee_Point_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Shadow_Gate_Copy,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Shadow_Gate_Copy,Condition(function Trig_Shadow_Gate_Copy_Conditions))
  call TriggerAddAction(gg_trg_Shadow_Gate_Copy,function Trig_Shadow_Gate_Copy_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Shadow_Bash,EVENT_PLAYER_UNIT_ATTACKED)
  call TriggerAddCondition(gg_trg_Shadow_Bash,Condition(function Trig_Shadow_Bash_Conditions))
  call TriggerAddAction(gg_trg_Shadow_Bash,function Trig_Shadow_Bash_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Return_Shadow,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Return_Shadow,Condition(function Trig_Return_Shadow_Conditions))
  call TriggerAddAction(gg_trg_Return_Shadow,function Trig_Return_Shadow_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Displace_Shadow,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Displace_Shadow,Condition(function Trig_Displace_Shadow_Conditions))
  call TriggerAddAction(gg_trg_Displace_Shadow,function Trig_Displace_Shadow_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Shadowless,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Shadowless,Condition(function Trig_Shadowless_Conditions))
  call TriggerAddAction(gg_trg_Shadowless,function Trig_Shadowless_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Return_to_Body,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Return_to_Body,Condition(function Trig_Return_to_Body_Conditions))
  call TriggerAddAction(gg_trg_Return_to_Body,function Trig_Return_to_Body_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Shadow_Stalk,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Shadow_Stalk,Condition(function Trig_Shadow_Stalk_Conditions))
  call TriggerAddAction(gg_trg_Shadow_Stalk,function Trig_Shadow_Stalk_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Break_Shadow_Stalk,EVENT_PLAYER_UNIT_ATTACKED)
  call TriggerAddCondition(gg_trg_Break_Shadow_Stalk,Condition(function Trig_Break_Shadow_Stalk_Conditions))
  call TriggerAddAction(gg_trg_Break_Shadow_Stalk,function Trig_Break_Shadow_Stalk_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Shadow_Gaze,EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trg_Shadow_Gaze,Condition(function Trig_Shadow_Gaze_Conditions))
  call TriggerAddAction(gg_trg_Shadow_Gaze,function Trig_Shadow_Gaze_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Remove_Casters,EVENT_PLAYER_UNIT_DEATH)
  call TriggerAddCondition(gg_trg_Remove_Casters,Condition(function Trig_Remove_Casters_Conditions))
  call TriggerAddAction(gg_trg_Remove_Casters,function Trig_Remove_Casters_Actions)
  call TriggerAddAction(gg_trg_Set_Chances,function Trig_Set_Chances_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Passive_Perification,EVENT_PLAYER_UNIT_ATTACKED)
  call TriggerAddCondition(gg_trg_Passive_Perification,Condition(function Trig_Passive_Perification_Conditions))
  call TriggerAddAction(gg_trg_Passive_Perification,function Trig_Passive_Perification_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Passive_Summon,EVENT_PLAYER_UNIT_ATTACKED)
  call TriggerAddCondition(gg_trg_Passive_Summon,Condition(function Trig_Passive_Summon_Conditions))
  call TriggerAddAction(gg_trg_Passive_Summon,function Trig_Passive_Summon_Actions)
  call TriggerRegisterTimerEventPeriodic(gg_trg_Passive_Summon_Check,.5)
  call TriggerAddAction(gg_trg_Passive_Summon_Check,function Trig_Passive_Summon_Check_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Passive_Berserk,EVENT_PLAYER_UNIT_ATTACKED)
  call TriggerAddCondition(gg_trg_Passive_Berserk,Condition(function Trig_Passive_Berserk_Conditions))
  call TriggerAddAction(gg_trg_Passive_Berserk,function Trig_Passive_Berserk_Actions)
  call TriggerRegisterAnyUnitEventBJ(gg_trg_Passive_Unstable_Power,EVENT_PLAYER_UNIT_ATTACKED)
  call TriggerAddCondition(gg_trg_Passive_Unstable_Power,Condition(function Trig_Passive_Unstable_Power_Conditions))
  call TriggerAddAction(gg_trg_Passive_Unstable_Power,function Trig_Passive_Unstable_Power_Actions)
  call ConditionalTriggerExecute(gg_trg_Map_Initialization_Copy)
  call ConditionalTriggerExecute(gg_trg_map_ini)
  call ConditionalTriggerExecute(gg_trg_Define_Colors)
  call ConditionalTriggerExecute(gg_trg_Help)
  call ConditionalTriggerExecute(gg_trg_Undiscovered_Quests)
  call ConditionalTriggerExecute(gg_trg_Invulnerable)
  call ConditionalTriggerExecute(gg_trg_Weather_Set_Chances)
  call ConditionalTriggerExecute(gg_trg_Set_Chances)
endfunction

function config takes nothing returns nothing
  call SetMapName("Moo Moo v1.5")
  call SetMapDescription("Join up to 5 friends in an epic battle to protect Thunderbluff from the evil centaur raiders!  Choose over 30 different heros and make them stronger with over 150 items to choose from.")
  call SetPlayers(8)
  call SetTeams(8)
  call SetGamePlacement(MAP_PLACEMENT_TEAMS_TOGETHER)
  call DefineStartLocation(0,-6912.,6720.)
  call DefineStartLocation(1,-6912.,6720.)
  call DefineStartLocation(2,-6912.,6720.)
  call DefineStartLocation(3,-6912.,6720.)
  call DefineStartLocation(4,-6912.,6720.)
  call DefineStartLocation(5,-6912.,6720.)
  call DefineStartLocation(6,-448.,-960.)
  call DefineStartLocation(7,-6912.,6720.)
  call SetPlayerStartLocation(Player(0),0)
  call ForcePlayerStartLocation(Player(0),0)
  call SetPlayerColor(Player(0),ConvertPlayerColor(0))
  call SetPlayerRacePreference(Player(0),RACE_PREF_NIGHTELF)
  call SetPlayerRaceSelectable(Player(0),false)
  call SetPlayerController(Player(0),MAP_CONTROL_USER)
  call SetPlayerStartLocation(Player(1),1)
  call ForcePlayerStartLocation(Player(1),1)
  call SetPlayerColor(Player(1),ConvertPlayerColor(1))
  call SetPlayerRacePreference(Player(1),RACE_PREF_NIGHTELF)
  call SetPlayerRaceSelectable(Player(1),false)
  call SetPlayerController(Player(1),MAP_CONTROL_USER)
  call SetPlayerStartLocation(Player(2),2)
  call ForcePlayerStartLocation(Player(2),2)
  call SetPlayerColor(Player(2),ConvertPlayerColor(2))
  call SetPlayerRacePreference(Player(2),RACE_PREF_NIGHTELF)
  call SetPlayerRaceSelectable(Player(2),false)
  call SetPlayerController(Player(2),MAP_CONTROL_USER)
  call SetPlayerStartLocation(Player(3),3)
  call ForcePlayerStartLocation(Player(3),3)
  call SetPlayerColor(Player(3),ConvertPlayerColor(3))
  call SetPlayerRacePreference(Player(3),RACE_PREF_NIGHTELF)
  call SetPlayerRaceSelectable(Player(3),false)
  call SetPlayerController(Player(3),MAP_CONTROL_USER)
  call SetPlayerStartLocation(Player(4),4)
  call ForcePlayerStartLocation(Player(4),4)
  call SetPlayerColor(Player(4),ConvertPlayerColor(4))
  call SetPlayerRacePreference(Player(4),RACE_PREF_NIGHTELF)
  call SetPlayerRaceSelectable(Player(4),false)
  call SetPlayerController(Player(4),MAP_CONTROL_USER)
  call SetPlayerStartLocation(Player(5),5)
  call ForcePlayerStartLocation(Player(5),5)
  call SetPlayerColor(Player(5),ConvertPlayerColor(5))
  call SetPlayerRacePreference(Player(5),RACE_PREF_NIGHTELF)
  call SetPlayerRaceSelectable(Player(5),false)
  call SetPlayerController(Player(5),MAP_CONTROL_USER)
  call SetPlayerStartLocation(Player(10),6)
  call ForcePlayerStartLocation(Player(10),6)
  call SetPlayerColor(Player(10),ConvertPlayerColor(10))
  call SetPlayerRacePreference(Player(10),RACE_PREF_NIGHTELF)
  call SetPlayerRaceSelectable(Player(10),false)
  call SetPlayerController(Player(10),MAP_CONTROL_COMPUTER)
  call SetPlayerStartLocation(Player(11),7)
  call ForcePlayerStartLocation(Player(11),7)
  call SetPlayerColor(Player(11),ConvertPlayerColor(11))
  call SetPlayerRacePreference(Player(11),RACE_PREF_NIGHTELF)
  call SetPlayerRaceSelectable(Player(11),false)
  call SetPlayerController(Player(11),MAP_CONTROL_COMPUTER)
  call InitCustomTeams()
  call SetStartLocPrioCount(0,5)
  call SetStartLocPrio(0,0,1,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(0,1,2,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(0,2,3,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(0,3,4,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(0,4,5,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrioCount(1,5)
  call SetStartLocPrio(1,0,0,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(1,1,2,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(1,2,3,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(1,3,4,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(1,4,5,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrioCount(2,5)
  call SetStartLocPrio(2,0,0,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(2,1,1,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(2,2,3,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(2,3,4,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(2,4,5,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrioCount(3,5)
  call SetStartLocPrio(3,0,0,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(3,1,1,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(3,2,2,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(3,3,4,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(3,4,5,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrioCount(4,5)
  call SetStartLocPrio(4,0,0,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(4,1,1,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(4,2,2,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(4,3,3,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(4,4,5,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrioCount(5,5)
  call SetStartLocPrio(5,0,0,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(5,1,1,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(5,2,2,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(5,3,3,MAP_LOC_PRIO_HIGH)
  call SetStartLocPrio(5,4,4,MAP_LOC_PRIO_HIGH)
endfunction
