Actor MCLargeMobRunnerHexen : MCLargeMobRunner
{
	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:
	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,32666)
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_Jump(256,1,2,3,4)
		TNT1 A 0 A_SpawnItemEx("FireDemonQueen",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("Bormereth",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("Demon5",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("DarkPatriarch",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>=3+ACS_NamedExecuteWithResult("WOC PLAYERCOUNT")/4 + ACS_ExecuteWithResult(WOC_DECORATE, STATS, GLOBALLEVEL)/16,"Vanish")
		Goto Wanderbout
	}
}

Actor MCSquadMobRunnerHexen : MCSquadMobRunner
{
	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)
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_Jump(256,1,2,3,4,5,6,7,8)
		TNT1 A 0 A_SpawnItemEx("IceGuy",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("BishopDirector",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("Wraith",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("CentaurLeader",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("Demon3",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("Demon4",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("ChainmailEttin",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("FireDemonCommander",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>=11 + ACS_NamedExecuteWithResult("WOC PLAYERCOUNT") + ACS_ExecuteWithResult(WOC_DECORATE, STATS, GLOBALLEVEL)/4,"Vanish")
		Goto Wanderbout
	}
}

Actor MCMediumMobRunnerHexen : MCMediumMobRunner
{
	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)
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_Jump(256,1,2,3,4,5,6,7,8)
		TNT1 A 0 A_SpawnItemEx("IceGuy",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("BishopDirector",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("Wraith",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("CentaurLeader",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("Demon3",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("Demon4",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("ChainmailEttin",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("FireDemonCommander",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>=6+ACS_NamedExecuteWithResult("WOC PLAYERCOUNT")/2 + ACS_ExecuteWithResult(WOC_DECORATE, STATS, GLOBALLEVEL)/8,"Vanish")
		Goto Wanderbout
	}
}

Actor MCHordeMobRunnerHexen : MCHordeMobRunner
{
	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)
		TNT1 A 0 A_SpawnItemEx("NewFireDemon",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("NewEttin",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("Centaur",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("NewDemon1",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("NewDemon2",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
	}
}

Actor MCSmallMobRunnerHexen : MCSmallMobRunner
{
	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,32669)
		TNT1 A 0 A_FaceTarget
		TNT1 A 0 A_Jump(256,1,2,3,4,5)
		TNT1 A 0 A_SpawnItemEx("NewFireDemon",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("NewEttin",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("Centaur",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("FireDemonLeader",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS|SXF_CLEARCALLERTID)
		Goto CountUp
		TNT1 A 0 A_SpawnItemEx("HexenDemonDirector",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>=6+ACS_NamedExecuteWithResult("WOC PLAYERCOUNT") + ACS_ExecuteWithResult(WOC_DECORATE, STATS, GLOBALLEVEL)/5,"Vanish")
		Goto Wanderbout
	}
}

Actor HexenDemonDirector : RandomSpawner
{
	DropItem "NewDemon1"
	DropItem "NewDemon2"
}

Actor BishopDirector : RandomSpawner
{
	DropItem "NewBishop" 255 135
	DropItem "Priest" 255 55
	DropItem "Disciple" 255 40
	DropItem "Vampire" 255 25
}