Actor DirSmallChildCount : Inventory
{	Inventory.MaxAmount 20	}

Actor DirMediumChildCount : Inventory
{	Inventory.MaxAmount 10	}

Actor DirLargeChildCount : Inventory
{	Inventory.MaxAmount 5	}

Actor FreezeDirector : Inventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
}

Actor RemoveDirector : Inventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
}

Actor LargeCooldown : CustomInventory
{
	+ALWAYSPICKUP
	+AUTOACTIVATE
	Inventory.MaxAmount 0
	States
	{
	Use:
		TNT1 A 0 ACS_NamedExecuteAlways("WOC DIRECTOR COOLDOWN", 0, 0, random(8400,10500)) //A_SetUserArray("user_cooldown",0,random(8400,10600))
		TNT1 A 0 ACS_NamedExecuteAlways("WOC DIRECTOR COOLDOWN", 0, 2, 0)
		Stop
	}
}

Actor MediumCooldown : CustomInventory
{
	+ALWAYSPICKUP
	+AUTOACTIVATE
	Inventory.MaxAmount 0
	States
	{
	Use:
		TNT1 A 0 ACS_NamedExecuteAlways("WOC DIRECTOR COOLDOWN", 0, 0, random(4200,8400)) //A_SetUserArray("user_cooldown",0,random(4200,8400))
		TNT1 A 0 ACS_NamedExecuteAlways("WOC DIRECTOR COOLDOWN", 0, 2, 0)
		Stop
	}
}

Actor SmallCooldown : CustomInventory
{
	+ALWAYSPICKUP
	+AUTOACTIVATE
	Inventory.MaxAmount 0
	States
	{
	Use:
		TNT1 A 0 ACS_NamedExecuteAlways("WOC DIRECTOR COOLDOWN", 0, 1, random(2100,4200))//A_SetUserArray("user_cooldown",1,random(2100,4200))
		TNT1 A 0 ACS_NamedExecuteAlways("WOC DIRECTOR COOLDOWN", 0, 3, 0)
		Stop
	}
}

Actor CooldownEnable1 : CustomInventory
{
	+ALWAYSPICKUP
	+AUTOACTIVATE
	Inventory.MaxAmount 0
	States
	{
	Use:
		TNT1 A 0 ACS_NamedExecuteAlways("WOC DIRECTOR COOLDOWN", 0, 2, 1) //A_SetUserArray("user_cooldown",2,1)
		Stop
	}
}

Actor CooldownEnable2 : CustomInventory
{
	+ALWAYSPICKUP
	+AUTOACTIVATE
	Inventory.MaxAmount 0
	States
	{
	Use:
		TNT1 A 0 ACS_NamedExecuteAlways("WOC DIRECTOR COOLDOWN", 0, 3, 1) //A_SetUserArray("user_cooldown",3,1)
		Stop
	}
}

Actor CooldownDisable1 : CustomInventory
{
	+ALWAYSPICKUP
	+AUTOACTIVATE
	Inventory.MaxAmount 0
	States
	{
	Use:
		TNT1 A 0 ACS_NamedExecuteAlways("WOC DIRECTOR COOLDOWN", 0, 0, 0) //A_SetUserArray(user_cooldown,0,0)
		TNT1 A 0 ACS_NamedExecuteAlways("WOC DIRECTOR COOLDOWN", 0, 2, 0) //A_SetUserArray(user_cooldown,2,0)
		Stop
	}
}

Actor CooldownDisable2 : CustomInventory
{
	+ALWAYSPICKUP
	+AUTOACTIVATE
	Inventory.MaxAmount 0
	States
	{
	Use:
		TNT1 A 0 ACS_NamedExecuteAlways("WOC DIRECTOR COOLDOWN", 0, 1, 0) //A_SetUserArray(user_cooldown,1,0)
		TNT1 A 0 ACS_NamedExecuteAlways("WOC DIRECTOR COOLDOWN", 0, 3, 0) //A_SetUserArray(user_cooldown,3,0)
		Stop
	}
}

Actor SmallSpawnToken : Inventory
{
	Inventory.MaxAmount 20
	Inventory.InterHubAmount 20
}

Actor PFirstTimeToken : Inventory
{	Inventory.MaxAmount 1	}

Actor PFirstTimeToken2 : Inventory
{	Inventory.MaxAmount 1	}

Actor DirectorIsLeaving : Inventory
{	Inventory.MaxAmount 1	}


Actor MCLargeMobRunner
{
	var int user_boss[2];
	//[0] = Cyberdemon or Spider Mastermind?
	//[1] = Have we chosen to spawn the big baddies above?
	var int user_dlimit;
	var int user_dlimitb;
	var int user_x[3];
	var int user_y[3];
	Monster
	//+DONTTHRUST
	-SOLID
	+NEVERTARGET
	-COUNTKILL
	+CANTSEEK
	+FLOORHUGGER
	+NORADIUSDMG
	+THRUACTORS
	+NOBLOOD
	-TELESTOMP
	+FORCEPAIN
	+LOOKALLAROUND
	+NOTARGETSWITCH
	+NONSHOOTABLE
	-SHOOTABLE
	-CANUSEWALLS
	-CANPUSHWALLS
	-ACTIVATEMCROSS
	+NOBLOCKMONST
	+NOTRIGGER
	+NOBLOCKMAP
	+NOTELESTOMP
	+FRIGHTENED
	MaxDropOffHeight 128
	MaxStepHeight 128
	Speed 15
	Radius 100
	Height 56
	Health 1000000
	DamageFactor "Normal", 0.0
	DamageFactor "DirectorKiller", 32767
	Species "Director"
	RenderStyle None
	States
	{
	Spawn:
		TNT1 A 0 //NoDelay //ACS_NamedExecuteAlways("DirectorLimiter",0,3,0)
//Chooses between spider mastermind and cyberdemon.
		TNT1 A 0 A_SetUserArray("user_boss",0,random(0,1))
		TNT1 A 0 A_SetUserVar("user_dlimit",0)
		TNT1 A 0 A_SetUserVar("user_dlimitb",0)
		TNT1 A 0 //A_GiveInventory("CooldownEnable1",1)
		TNT1 A 0 A_Jump(256,"Idle")
	Idle:
		TNT1 AAAAA 1 A_Look
	See:
		TNT1 A 0 A_SetUserArray("user_x",0,x)
		TNT1 A 0 A_SetUserArray("user_y",0,y)
	Wanderbout:
		TNT1 A 1 A_Chase("","")
		TNT1 AAAAAAAAAAAAAAAAAAAA 1 A_Wander
		TNT1 A 0 A_SetUserArray("user_x",1,x)
		TNT1 A 0 A_SetUserArray("user_y",1,y)
		TNT1 A 0 A_JumpIf((user_x[0]==user_x[1])&&(user_y[0]==user_y[1]),"Stuck")
	Mobmaking:
		TNT1 A 0 A_CheckSight(1)
		Goto Wanderbout
		TNT1 A 0 A_CheckRange(2048,1)
		Goto Wanderbout
		TNT1 A 0 A_JumpIf(user_boss[1]==1,"BossCheck")
		TNT1 A 0 A_Jump(64,"BossCheck")
		Goto ArchvileSpawn
	BossCheck:
		TNT1 A 0 A_SetUserArray("user_boss",1,1)
	SC1:
		TNT1 A 0 A_UnsetSolid
		TNT1 A 1 A_Chase("","")
		TNT1 A 0 A_CheckSight(1)
		Loop
		TNT1 A 0 A_CheckRange(2048,1)
		Loop
		TNT1 A 0 A_JumpIf(user_boss[0]==1,"CyberdemonSpawn")
		Goto SpiderMasterMindSpawn
	CyberdemonSpawn:
		TNT1 A 0 Thing_ChangeTID(0,32666)
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_SpawnItemEx("Cyberdemon",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		TNT1 A 0 A_JumpIf(tid!=0,"See") //Means the actor failed to spawn.
		Goto CountUpBoss //One-hit wonder. We really don't need these things spawning more than one.
	SpiderMasterMindSpawn:
		TNT1 A 0 Thing_ChangeTID(0,32666)
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_SpawnItemEx("SpiderMastermind",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		TNT1 A 0 A_JumpIf(tid!=0,"See")
		Goto CountUpBoss
	ArchvileSpawn:
		TNT1 A 0 Thing_ChangeTID(0,32666)
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_SpawnItemEx("Archvile",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		TNT1 A 0 A_JumpIf(tid!=0,"See")
		Goto CountUp
	CountUp:
		TNT1 A 0 A_SetUserVar("user_dlimit",user_dlimit+1)
		TNT1 A 0 A_JumpIf(user_dlimit>=5+ACS_NamedExecuteWithResult("WOC PLAYERCOUNT")/2 + ACS_ExecuteWithResult(WOC_DECORATE, STATS, GLOBALLEVEL)/10,"Vanish")
		Goto See
	CountUpBoss:
		TNT1 A 0 A_SetUserVar("user_dlimitb",user_dlimitb+1)
		TNT1 A 0 A_JumpIf(user_dlimitb>=1+ACS_NamedExecuteWithResult("WOC PLAYERCOUNT")/5 + ACS_ExecuteWithResult(WOC_DECORATE, STATS, GLOBALLEVEL)/50,"Vanish")
		Goto See
	Vanish:
		TNT1 A 0 A_GiveInventory("LargeCooldown",1)
		TNT1 A 0 A_DropItem("NewMana3",1,4)
		TNT1 AAA 0 A_DropItem("NewMana3",1,128)
		TNT1 AAAA 0 A_DropItem("NewMana3",1,128)
		TNT1 AAA 0 A_DropItem("NewMana3",1,128)
		TNT1 AAA 0 A_DropItem("NewMana3",1,128)
		TNT1 AA 0 A_DropItem("ArmorRandomSpawner",1,64)
		TNT1 A 0 A_DropItem("NewArtiSuperHealth",1,66)
		TNT1 AAAAAAAAA 0 A_DropItem("PurplePotionRandomSpawner",1,164)
		TNT1 AA 0 A_DropItem("GenericPowerupSpawner",1,192)
		TNT1 A 35 //A_Log("Large Monsters Done")//ACS_NamedExecuteAlways("DirectorLimiter",0,4,0)
		Stop
	Stuck:
		TNT1 A 0 A_GiveInventory("CooldownDisable1",1)
		TNT1 A 0 A_JumpIf(user_dlimit > 0, "Vanish")
		Stop
	Death:
		TNT1 A 1 //ACS_NamedExecuteAlways("DirectorLimiter",0,4,0)
		Stop
	}
}


Actor MCMediumMobRunner
{
	Radius 64
	Height 64
	var int user_dlimit;
	var int user_x[2];
	var int user_y[2];
	Monster
	//+DONTTHRUST
	-SOLID
	+NEVERTARGET
	-COUNTKILL
	+CANTSEEK
	+FLOORHUGGER
	+NORADIUSDMG
	+THRUACTORS
	+NOBLOOD
	-TELESTOMP
	+FORCEPAIN
	+LOOKALLAROUND
	+NOTARGETSWITCH
	+NONSHOOTABLE
	-SHOOTABLE
	-CANUSEWALLS
	-CANPUSHWALLS
	-ACTIVATEMCROSS
	+NOBLOCKMONST
	+NOTRIGGER
	+NOBLOCKMAP
	+NOTELESTOMP
	+FRIGHTENED
	MaxDropOffHeight 128
	MaxStepHeight 128
	Speed 15
	Health 1000000
	DamageFactor "Normal", 0.0
	DamageFactor "DirectorKiller", 32767
	Species "Director"
	RenderStyle None
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 //ACS_NamedExecuteAlways("DirectorLimiter",0,3,0)
		TNT1 A 0 A_SetUserVar("user_dlimit",0)
		TNT1 A 0 //A_GiveInventory("CooldownEnable1",1)
		TNT1 A 0 A_Jump(256,"Idle")
	Idle:
		TNT1 AAAAA 1 A_Look
	See:
	Wanderbout:
		TNT1 A 1 A_Chase
		TNT1 AAAAAAAAAAAAAAAAAAAA 1 A_Wander
	Mobmaking:
		TNT1 A 0 A_CheckSight(1)
		Goto Wanderbout
		TNT1 A 0 A_CheckRange(2048,1)
		Goto Wanderbout
		TNT1 A 0 Thing_ChangeTID(0,32667) 
		//The above call is used to check and see if the spawning worked.
		//If it did, its TID is set to 0.
		TNT1 A 0 //A_Log("Medium Monster")
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_Jump(256,1,2,3,4,5,6,7,"Wanderbout")
		TNT1 A 0 A_SpawnItemEx("Fatso",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("Revenant",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("HellKnight",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("BaronofHell",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("PainElemental",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("Cacodemon",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("Arachnotron",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
	CountUp:
		TNT1 A 0 A_JumpIf(tid!=0,"Wanderbout") //Means it didn't work.
		TNT1 A 0 //A_Log("Good")
		TNT1 A 0 A_SetUserVar("user_dlimit",user_dlimit+1)
		TNT1 A 0 A_JumpIf(user_dlimit>=5+ACS_NamedExecuteWithResult("WOC PLAYERCOUNT")/2 + ACS_ExecuteWithResult(WOC_DECORATE, STATS, GLOBALLEVEL)/10,"Vanish")
		Goto Wanderbout
	Vanish:
		TNT1 A 0 //A_Log("Medium Loot")
		TNT1 A 0 A_GiveInventory("MediumCooldown",1)
		TNT1 AAA 0 A_DropItem("NewMana1",1,96)
		TNT1 AAA 0 A_DropItem("NewMana2",1,96)
		TNT1 AA 0 A_DropItem("NewMana3",1,96)
		TNT1 AA 0 A_DropItem("NewMana3",1,96)
		TNT1 A 0 A_DropItem("ArmorRandomSpawner",1,32)
		TNT1 A 0 A_DropItem("NewArtiSuperHealth",1,11)
		TNT1 AAAA 0 A_DropItem("BluePotionRandomSpawner",0,128)
		TNT1 AAA 0 A_DropItem("PurplePotionRandomSpawner",0,64)
		TNT1 A 35 A_DropItem("GenericPowerupSpawner",1,128)
		Stop
	Death:
		TNT1 A 1
		Stop
	}
}

Actor MCSmallMobRunner
{
	Radius 30
	Height 56
	var int user_dlimit;
	var int user_x[2];
	var int user_y[2];
	Monster
	//+DONTTHRUST
	-SOLID
	+NEVERTARGET
	-COUNTKILL
	+CANTSEEK
	+FLOORHUGGER
	+NORADIUSDMG
	+THRUACTORS
	+NOBLOOD
	-TELESTOMP
	+FORCEPAIN
	+LOOKALLAROUND
	+NOTARGETSWITCH
	+NONSHOOTABLE
	-SHOOTABLE
	-CANUSEWALLS
	-CANPUSHWALLS
	-ACTIVATEMCROSS
	+NOBLOCKMONST
	+NOTRIGGER
	+NOBLOCKMAP
	+NOTELESTOMP
	+FRIGHTENED
	MaxDropOffHeight 128
	MaxStepHeight 128
	Speed 15
	Health 1000000
	DamageFactor "Normal", 0.0
	DamageFactor "DirectorKiller", 32767
	Species "Director"
	RenderStyle None
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 //A_GiveInventory("CooldownEnable2",1)//ACS_NamedExecuteAlways("DirectorLimiter",0,1,0)
		TNT1 A 0 A_SetUserVar("user_dlimit",0)
		TNT1 A 0 A_Jump(256,"Idle")
	Idle:
		TNT1 AAAAA 1 A_Look
	See:
	Wanderbout:
		TNT1 A 1 A_Chase
		TNT1 AAAAAAAAAAAAAAAAAAAA 1 A_Wander
	Mobmaking:
		TNT1 A 0 A_CheckSight(1)
		Goto Wanderbout
		TNT1 A 0 A_CheckRange(2048,1)
		Goto Wanderbout
		TNT1 A 0 Thing_ChangeTID(0,32668)
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_Jump(256,1,2,3,4,5,6)
		TNT1 A 0 A_SpawnItemEx("Zombieman",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("ShotgunGuy",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("ChaingunGuy",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("DoomImp",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("LostSoul",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("Demon",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
	CountUp:
		TNT1 A 0 A_JumpIf(tid!=0,"Wanderbout")
		TNT1 A 0 A_SetUserVar("user_dlimit",user_dlimit+1)
		TNT1 A 0 A_JumpIf(user_dlimit>=9+ACS_NamedExecuteWithResult("WOC PLAYERCOUNT") + ACS_ExecuteWithResult(WOC_DECORATE, STATS, GLOBALLEVEL)/5,"Vanish")
		Goto Wanderbout
	Vanish:
		TNT1 A 0 A_GiveInventory("SmallCooldown",1)
		TNT1 A 0 A_DropItem("BasicFlaskRandomSpawner",1,16)
		TNT1 A 0 A_DropItem("BasicFlaskRandomSpawner",1,36)
		TNT1 A 0 A_DropItem("BasicFlaskRandomSpawner",1,76)
		TNT1 A 0 A_DropItem("BasicFlaskRandomSpawner",1,66)
		TNT1 AAA 0 A_DropItem("NewMana1",0,96)
		TNT1 AAA 0 A_DropItem("NewMana2",0,96)
		TNT1 AA 0 A_DropItem("NewMana3",0,32)
		TNT1 A 0 A_DropItem("NewArtiSuperHealth",0,6)
		TNT1 AAA 0 A_DropItem("BluePotionRandomSpawner",0,128)
		TNT1 A 0 A_DropItem("PurplePotionRandomSpawner",0,128)
		TNT1 AA 0 A_DropItem("PurplePotionRandomSpawner",0,64)
		TNT1 A 35 A_DropItem("ArmorRandomSpawner",0,16)
		Stop
	Death:
		TNT1 A 1
		Stop
	}
}

Actor MCHordeMobRunner
{
	Radius 30
	Height 56
	var int user_dlimit;
	var int user_x[2];
	var int user_y[2];
	Monster
	//+DONTTHRUST
	-SOLID
	+NEVERTARGET
	-COUNTKILL
	+CANTSEEK
	+FLOORHUGGER
	+NORADIUSDMG
	+THRUACTORS
	+NOBLOOD
	-TELESTOMP
	+FORCEPAIN
	+LOOKALLAROUND
	+NOTARGETSWITCH
	+NONSHOOTABLE
	-SHOOTABLE
	-CANUSEWALLS
	-CANPUSHWALLS
	-ACTIVATEMCROSS
	+NOBLOCKMONST
	+NOTRIGGER
	+NOBLOCKMAP
	+NOTELESTOMP
	+FRIGHTENED
	MaxDropOffHeight 128
	MaxStepHeight 128
	Speed 15
	Health 1000000
	DamageFactor "Normal", 0.0
	DamageFactor "DirectorKiller", 32767
	Species "Director"
	RenderStyle None
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 //ACS_NamedExecuteAlways("DirectorLimiter",0,3,0)
		TNT1 A 0 A_SetUserVar("user_dlimit",0)
		TNT1 A 0 //A_GiveInventory("CooldownEnable1",1)
		TNT1 A 0 A_Jump(256,"Idle")
	Idle:
		TNT1 AAAAA 1 A_Look
	See:
	Wanderbout:
		TNT1 A 1 A_Chase
		TNT1 AAAAAAAAAAAAAAAAAAAA 1 A_Wander
	Mobmaking:
		TNT1 A 0 A_CheckSight(1)
		Goto Wanderbout
		TNT1 A 0 A_CheckRange(2048,1)
		Goto Wanderbout
		TNT1 A 0 Thing_ChangeTID(0,32669)
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_Jump(256,1,2,3,4,5,6)
		TNT1 A 0 A_SpawnItemEx("Zombieman",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("ShotgunGuy",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("ChaingunGuy",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("DoomImp",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("LostSoul",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("Demon",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
	CountUp:
		TNT1 A 0 A_JumpIf(tid!=0,"Wanderbout") //Means it didn't work.
		TNT1 A 0 //A_Log("Good")
		TNT1 A 0 A_SetUserVar("user_dlimit",user_dlimit+1)
		TNT1 A 0 A_JumpIf(user_dlimit>=27 + 3*ACS_NamedExecuteWithResult("WOC PLAYERCOUNT") + 3*ACS_ExecuteWithResult(WOC_DECORATE, STATS, GLOBALLEVEL)/5,"Vanish")
		Goto Wanderbout
	Vanish:
		TNT1 A 0 A_GiveInventory("MediumCooldown",1)
		TNT1 AAA 0 A_DropItem("NewMana1",1,96)
		TNT1 AAA 0 A_DropItem("NewMana2",1,96)
		TNT1 AA 0 A_DropItem("NewMana3",1,96)
		TNT1 AA 0 A_DropItem("NewMana3",1,96)
		TNT1 A 0 A_DropItem("ArmorRandomSpawner",1,32)
		TNT1 A 0 A_DropItem("NewArtiSuperHealth",1,11)
		TNT1 AAAA 0 A_DropItem("BluePotionRandomSpawner",0,128)
		TNT1 AAA 0 A_DropItem("PurplePotionRandomSpawner",0,64)
		TNT1 A 35 A_DropItem("GenericPowerupSpawner",1,128)
		Stop
	Death:
		TNT1 A 1
		Stop
	}
}

Actor MCSquadMobRunner
{
	Radius 64
	Height 56
	var int user_dlimit;
	var int user_x[2];
	var int user_y[2];
	Monster
	//+DONTTHRUST
	-SOLID
	+NEVERTARGET
	-COUNTKILL
	+CANTSEEK
	+FLOORHUGGER
	+NORADIUSDMG
	+THRUACTORS
	+NOBLOOD
	-TELESTOMP
	+FORCEPAIN
	+LOOKALLAROUND
	+NOTARGETSWITCH
	+NONSHOOTABLE
	-SHOOTABLE
	-CANUSEWALLS
	-CANPUSHWALLS
	-ACTIVATEMCROSS
	+NOBLOCKMONST
	+NOTRIGGER
	+NOBLOCKMAP
	+NOTELESTOMP
	+FRIGHTENED
	MaxDropOffHeight 128
	MaxStepHeight 128
	Speed 15
	Health 1000000
	DamageFactor "Normal", 0.0
	DamageFactor "DirectorKiller", 32767
	Species "Director"
	RenderStyle None
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 //ACS_NamedExecuteAlways("DirectorLimiter",0,3,0)
		TNT1 A 0 A_SetUserVar("user_dlimit",0)
		TNT1 A 0 //A_GiveInventory("CooldownEnable1",1)
		TNT1 A 0 A_Jump(256,"Idle")
	Idle:
		TNT1 AAAAA 1 A_Look
	See:
	Wanderbout:
		TNT1 A 1 A_Chase
		TNT1 AAAAAAAAAAAAAAAAAAAA 1 A_Wander
	Mobmaking:
		TNT1 A 0 A_CheckSight(1)
		Goto Wanderbout
		TNT1 A 0 A_CheckRange(2048,1)
		Goto Wanderbout
		TNT1 A 0 Thing_ChangeTID(0,32670) 
		//The above call is used to check and see if the spawning worked.
		//If it did, its TID is set to 0.
		TNT1 A 0 //A_Log("Medium Monster")
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_Jump(256,1,2,3,4,5,6,7,"Wanderbout")
		TNT1 A 0 A_SpawnItemEx("Fatso",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("Revenant",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("HellKnight",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("BaronofHell",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("PainElemental",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("Cacodemon",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("Arachnotron",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
	CountUp:
		TNT1 A 0 A_JumpIf(tid!=0,"Wanderbout") //Means it didn't work.
		TNT1 A 0 //A_Log("Good")
		TNT1 A 0 A_SetUserVar("user_dlimit",user_dlimit+1)
		TNT1 A 0 A_JumpIf(user_dlimit>=9 + ACS_NamedExecuteWithResult("WOC PLAYERCOUNT") + ACS_ExecuteWithResult(WOC_DECORATE, STATS, GLOBALLEVEL)/5,"Vanish")
		Goto Wanderbout
	Vanish:
		TNT1 A 0 A_GiveInventory("LargeCooldown",1)
		TNT1 A 0 A_DropItem("NewMana3",1,4)
		TNT1 AAA 0 A_DropItem("NewMana3",1,128)
		TNT1 AAAA 0 A_DropItem("NewMana3",1,128)
		TNT1 AAA 0 A_DropItem("NewMana3",1,128)
		TNT1 AAA 0 A_DropItem("NewMana3",1,128)
		TNT1 AA 0 A_DropItem("ArmorRandomSpawner",1,64)
		TNT1 A 0 A_DropItem("NewArtiSuperHealth",1,66)
		TNT1 AAAAAAAAA 0 A_DropItem("PurplePotionRandomSpawner",1,164)
		TNT1 AA 0 A_DropItem("GenericPowerupSpawner",1,192)
		TNT1 A 35 //A_Log("Medium Monsters Done")
		Stop
	Death:
		TNT1 A 1
		Stop
	}
}