LEVEL_VERSION(1)
RUN_AFTER_VICTORY(1)
SET_GENERATE_SPEED(300)
START_MONEY(ALL_PLAYERS,5000)
MAX_CREATURES(ALL_PLAYERS,30)
SET_GAME_RULE(ImpWorkExperience,250)
SET_GAME_RULE(AlliesShareCta,1)
SET_GAME_RULE(AlliesShareVision,1)
SET_GAME_RULE(AlliesShareDrop,1)
SET_GAME_RULE(MapCreatureLimit,1000)




QUICK_OBJECTIVE(1,"Welcome Keeper to this Skirmish,you can choose freely how you would like to play this map with those Specials.You will get a Different Color and Ally everytime you restart.Have Fun",1)




ADD_CREATURE_TO_POOL(TROLL,30)
ADD_CREATURE_TO_POOL(SPIDER,30)
ADD_CREATURE_TO_POOL(TENTACLE,30)
ADD_CREATURE_TO_POOL(SORCEROR,30)
ADD_CREATURE_TO_POOL(ORC,30)
ADD_CREATURE_TO_POOL(BILE_DEMON,30)
ADD_CREATURE_TO_POOL(DRAGON,30)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,30)
ADD_CREATURE_TO_POOL(GHOST,30)
ADD_CREATURE_TO_POOL(SKELETON,30)
ADD_CREATURE_TO_POOL(VAMPIRE,30)
ADD_CREATURE_TO_POOL(HORNY,30)
ADD_CREATURE_TO_POOL(THIEF,30)
ADD_CREATURE_TO_POOL(DWARFA,30)
ADD_CREATURE_TO_POOL(ARCHER,30)
ADD_CREATURE_TO_POOL(BARBARIAN,30)
ADD_CREATURE_TO_POOL(MONK,30)
ADD_CREATURE_TO_POOL(FAIRY,30)
ADD_CREATURE_TO_POOL(WITCH,30)
ADD_CREATURE_TO_POOL(WIZARD,30)
ADD_CREATURE_TO_POOL(GIANT,30)
ADD_CREATURE_TO_POOL(SAMURAI,30)

CREATURE_AVAILABLE(ALL_PLAYERS,DEMONSPAWN,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,TROLL,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,TENTACLE,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,ORC,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,BILE_DEMON,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,DRAGON,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,DARK_MISTRESS,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,GHOST,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,SKELETON,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,VAMPIRE,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,HORNY,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,THIEF,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,DWARFA,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,ARCHER,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,BARBARIAN,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,MONK,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,FAIRY,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,WITCH,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,WIZARD,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,GIANT,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,SAMURAI,1,0)

ROOM_AVAILABLE(ALL_PLAYERS,TREASURE,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,LAIR,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,GARDEN,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,TRAINING,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,RESEARCH,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,GUARD_POST,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,WORKSHOP,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,PRISON,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TORTURE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,BARRACKS,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TEMPLE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,GRAVEYARD,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,SCAVENGER,1,0)

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SIGHT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SPEED,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_OBEY,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_LIGHTNING,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CHICKEN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DISEASE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DESTROY_WALLS,1,0)

TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,LAVA,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,BOULDER,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,WORD_OF_POWER,1,0)

DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,1,0)


SET_TIMER(PLAYER0,TIMER1)
IF(PLAYER0,TIMER1 >= 33)
	ZOOM_TO_LOCATION(PLAYER0,1)
ENDIF




SET_BOX_TOOLTIP(1,"1 v 7, Good luck you will need it.")

IF(PLAYER0,BOX1_ACTIVATED == 1)
			ALLY_PLAYERS(PLAYER1,PLAYER2,3)
			ALLY_PLAYERS(PLAYER1,PLAYER3,3)
			ALLY_PLAYERS(PLAYER1,PLAYER4,3)
			ALLY_PLAYERS(PLAYER1,PLAYER5,3)
			ALLY_PLAYERS(PLAYER1,PLAYER6,3)
			ALLY_PLAYERS(PLAYER1,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER2,PLAYER1,3)
			ALLY_PLAYERS(PLAYER2,PLAYER3,3)
			ALLY_PLAYERS(PLAYER2,PLAYER4,3)
			ALLY_PLAYERS(PLAYER2,PLAYER5,3)
			ALLY_PLAYERS(PLAYER2,PLAYER6,3)
			ALLY_PLAYERS(PLAYER2,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER3,PLAYER1,3)
			ALLY_PLAYERS(PLAYER3,PLAYER2,3)
			ALLY_PLAYERS(PLAYER3,PLAYER4,3)
			ALLY_PLAYERS(PLAYER3,PLAYER5,3)
			ALLY_PLAYERS(PLAYER3,PLAYER6,3)
			ALLY_PLAYERS(PLAYER3,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER4,PLAYER1,3)
			ALLY_PLAYERS(PLAYER4,PLAYER2,3)
			ALLY_PLAYERS(PLAYER4,PLAYER3,3)
			ALLY_PLAYERS(PLAYER4,PLAYER4,3)
			ALLY_PLAYERS(PLAYER4,PLAYER5,3)
			ALLY_PLAYERS(PLAYER4,PLAYER6,3)
			ALLY_PLAYERS(PLAYER4,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER5,PLAYER1,3)
			ALLY_PLAYERS(PLAYER5,PLAYER2,3)
			ALLY_PLAYERS(PLAYER5,PLAYER3,3)
			ALLY_PLAYERS(PLAYER5,PLAYER4,3)
			ALLY_PLAYERS(PLAYER5,PLAYER6,3)
			ALLY_PLAYERS(PLAYER5,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER6,PLAYER1,3)
			ALLY_PLAYERS(PLAYER6,PLAYER2,3)
			ALLY_PLAYERS(PLAYER6,PLAYER3,3)
			ALLY_PLAYERS(PLAYER6,PLAYER4,3)
			ALLY_PLAYERS(PLAYER6,PLAYER5,3)
			ALLY_PLAYERS(PLAYER6,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER_GOOD,PLAYER1,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER2,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER3,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER4,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER5,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER6,3)

			RANDOMISE_FLAG(PLAYER0,FLAG0,8)

			CHANGE_SLAB_TYPE(75,9,WATER,MATCH)
			CHANGE_SLAB_TYPE(75,10,WATER,MATCH)

			COMPUTER_PLAYER(PLAYER1,0)
			COMPUTER_PLAYER(PLAYER2,0)
			COMPUTER_PLAYER(PLAYER3,0)
			COMPUTER_PLAYER(PLAYER4,0)
			COMPUTER_PLAYER(PLAYER5,0)
			COMPUTER_PLAYER(PLAYER6,0)
			COMPUTER_PLAYER(PLAYER_GOOD,0)

			MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
			MAGIC_AVAILABLE(ALL_PLAYERS,POWER_POSSESS,1,1)
			MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)


			SET_OBJECT_CONFIGURATION(SPECBOX_CUSTOM,DestroyOnLiquid,1)
			SET_OBJECT_CONFIGURATION(SPECBOX_CUSTOM,Genre,Furniture)
			SET_OBJECT_CONFIGURATION(SPECBOX_CUSTOM,UpdateFunction,Update_Power_Sight)
			SET_OBJECT_CONFIGURATION(SPECBOX_CUSTOM,MaximumSize,0)
			
			SET_TIMER(PLAYER0,TIMER0)
			SET_FLAG(PLAYER0,FLAG5,1)
			IF(PLAYER0,ALL_DUNGEONS_DESTROYED == 1)
				WIN_GAME
		ENDIF
ENDIF


SET_BOX_TOOLTIP(2,"2 v 6, You will get a Random Ally.")


IF(PLAYER0,BOX2_ACTIVATED == 1)
	RANDOMISE_FLAG(PLAYER0,FLAG0,8)
	RANDOMISE_FLAG(PLAYER0,FLAG2,8)
	CHANGE_SLAB_TYPE(75,9,WATER,MATCH)
	CHANGE_SLAB_TYPE(75,10,WATER,MATCH)
	SET_TIMER(PLAYER0,TIMER0)
	SET_OBJECT_CONFIGURATION(SPECBOX_CUSTOM,DestroyOnLiquid,1)
	SET_OBJECT_CONFIGURATION(SPECBOX_CUSTOM,Genre,Furniture)
	SET_OBJECT_CONFIGURATION(SPECBOX_CUSTOM,UpdateFunction,Update_Power_Sight)
	SET_OBJECT_CONFIGURATION(SPECBOX_CUSTOM,MaximumSize,0)
	COMPUTER_PLAYER(PLAYER1,0)
	COMPUTER_PLAYER(PLAYER2,0)
	COMPUTER_PLAYER(PLAYER3,0)
	COMPUTER_PLAYER(PLAYER4,0)
	COMPUTER_PLAYER(PLAYER5,0)
	COMPUTER_PLAYER(PLAYER6,0)
	COMPUTER_PLAYER(PLAYER_GOOD,0)

	MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
	MAGIC_AVAILABLE(ALL_PLAYERS,POWER_POSSESS,1,1)
	MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)

	SET_FLAG(PLAYER0,FLAG5,1)

	IF(PLAYER0,ALL_DUNGEONS_DESTROYED == 1)
		WIN_GAME
	ENDIF
ENDIF

IF(PLAYER0,FLAG2 == 1)
	ALLY_PLAYERS(PLAYER0,PLAYER1,3)
	ALLY_PLAYERS(PLAYER1,PLAYER0,3)

			ALLY_PLAYERS(PLAYER2,PLAYER3,3)
			ALLY_PLAYERS(PLAYER2,PLAYER4,3)
			ALLY_PLAYERS(PLAYER2,PLAYER5,3)
			ALLY_PLAYERS(PLAYER2,PLAYER6,3)
			ALLY_PLAYERS(PLAYER2,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER3,PLAYER2,3)
			ALLY_PLAYERS(PLAYER3,PLAYER4,3)
			ALLY_PLAYERS(PLAYER3,PLAYER5,3)
			ALLY_PLAYERS(PLAYER3,PLAYER6,3)
			ALLY_PLAYERS(PLAYER3,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER4,PLAYER2,3)
			ALLY_PLAYERS(PLAYER4,PLAYER3,3)
			ALLY_PLAYERS(PLAYER4,PLAYER5,3)
			ALLY_PLAYERS(PLAYER4,PLAYER6,3)
			ALLY_PLAYERS(PLAYER4,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER5,PLAYER2,3)
			ALLY_PLAYERS(PLAYER5,PLAYER3,3)
			ALLY_PLAYERS(PLAYER5,PLAYER4,3)
			ALLY_PLAYERS(PLAYER5,PLAYER6,3)
			ALLY_PLAYERS(PLAYER5,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER6,PLAYER2,3)
			ALLY_PLAYERS(PLAYER6,PLAYER3,3)
			ALLY_PLAYERS(PLAYER6,PLAYER4,3)
			ALLY_PLAYERS(PLAYER6,PLAYER5,3)
			ALLY_PLAYERS(PLAYER6,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER_GOOD,PLAYER2,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER3,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER4,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER5,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER6,3)
ENDIF

IF(PLAYER0,FLAG2 == 2)
	ALLY_PLAYERS(PLAYER0,PLAYER2,3)
	ALLY_PLAYERS(PLAYER2,PLAYER0,3)

			ALLY_PLAYERS(PLAYER1,PLAYER3,3)
			ALLY_PLAYERS(PLAYER1,PLAYER4,3)
			ALLY_PLAYERS(PLAYER1,PLAYER5,3)
			ALLY_PLAYERS(PLAYER1,PLAYER6,3)
			ALLY_PLAYERS(PLAYER1,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER3,PLAYER1,3)
			ALLY_PLAYERS(PLAYER3,PLAYER4,3)
			ALLY_PLAYERS(PLAYER3,PLAYER5,3)
			ALLY_PLAYERS(PLAYER3,PLAYER6,3)
			ALLY_PLAYERS(PLAYER3,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER4,PLAYER1,3)
			ALLY_PLAYERS(PLAYER4,PLAYER3,3)
			ALLY_PLAYERS(PLAYER4,PLAYER5,3)
			ALLY_PLAYERS(PLAYER4,PLAYER6,3)
			ALLY_PLAYERS(PLAYER4,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER5,PLAYER1,3)
			ALLY_PLAYERS(PLAYER5,PLAYER3,3)
			ALLY_PLAYERS(PLAYER5,PLAYER4,3)
			ALLY_PLAYERS(PLAYER5,PLAYER6,3)
			ALLY_PLAYERS(PLAYER5,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER6,PLAYER1,3)
			ALLY_PLAYERS(PLAYER6,PLAYER3,3)
			ALLY_PLAYERS(PLAYER6,PLAYER4,3)
			ALLY_PLAYERS(PLAYER6,PLAYER5,3)
			ALLY_PLAYERS(PLAYER6,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER_GOOD,PLAYER1,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER3,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER4,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER5,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER6,3)
ENDIF

IF(PLAYER0,FLAG2 == 3)
	ALLY_PLAYERS(PLAYER0,PLAYER3,3)
	ALLY_PLAYERS(PLAYER3,PLAYER0,3)

			ALLY_PLAYERS(PLAYER1,PLAYER2,3)
			ALLY_PLAYERS(PLAYER1,PLAYER4,3)
			ALLY_PLAYERS(PLAYER1,PLAYER5,3)
			ALLY_PLAYERS(PLAYER1,PLAYER6,3)
			ALLY_PLAYERS(PLAYER1,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER2,PLAYER1,3)
			ALLY_PLAYERS(PLAYER2,PLAYER4,3)
			ALLY_PLAYERS(PLAYER2,PLAYER5,3)
			ALLY_PLAYERS(PLAYER2,PLAYER6,3)
			ALLY_PLAYERS(PLAYER2,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER4,PLAYER1,3)
			ALLY_PLAYERS(PLAYER4,PLAYER2,3)
			ALLY_PLAYERS(PLAYER4,PLAYER5,3)
			ALLY_PLAYERS(PLAYER4,PLAYER6,3)
			ALLY_PLAYERS(PLAYER4,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER5,PLAYER1,3)
			ALLY_PLAYERS(PLAYER5,PLAYER2,3)
			ALLY_PLAYERS(PLAYER5,PLAYER4,3)
			ALLY_PLAYERS(PLAYER5,PLAYER6,3)
			ALLY_PLAYERS(PLAYER5,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER6,PLAYER1,3)
			ALLY_PLAYERS(PLAYER6,PLAYER2,3)
			ALLY_PLAYERS(PLAYER6,PLAYER4,3)
			ALLY_PLAYERS(PLAYER6,PLAYER5,3)
			ALLY_PLAYERS(PLAYER6,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER_GOOD,PLAYER1,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER2,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER4,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER5,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER6,3)
ENDIF

IF(PLAYER0,FLAG2 == 4)
	ALLY_PLAYERS(PLAYER0,PLAYER4,3)
	ALLY_PLAYERS(PLAYER4,PLAYER0,3)

			ALLY_PLAYERS(PLAYER1,PLAYER2,3)
			ALLY_PLAYERS(PLAYER1,PLAYER3,3)
			ALLY_PLAYERS(PLAYER1,PLAYER5,3)
			ALLY_PLAYERS(PLAYER1,PLAYER6,3)
			ALLY_PLAYERS(PLAYER1,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER2,PLAYER1,3)
			ALLY_PLAYERS(PLAYER2,PLAYER3,3)
			ALLY_PLAYERS(PLAYER2,PLAYER5,3)
			ALLY_PLAYERS(PLAYER2,PLAYER6,3)
			ALLY_PLAYERS(PLAYER2,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER3,PLAYER1,3)
			ALLY_PLAYERS(PLAYER3,PLAYER2,3)
			ALLY_PLAYERS(PLAYER3,PLAYER5,3)
			ALLY_PLAYERS(PLAYER3,PLAYER6,3)
			ALLY_PLAYERS(PLAYER3,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER5,PLAYER1,3)
			ALLY_PLAYERS(PLAYER5,PLAYER2,3)
			ALLY_PLAYERS(PLAYER5,PLAYER3,3)
			ALLY_PLAYERS(PLAYER5,PLAYER6,3)
			ALLY_PLAYERS(PLAYER5,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER6,PLAYER1,3)
			ALLY_PLAYERS(PLAYER6,PLAYER2,3)
			ALLY_PLAYERS(PLAYER6,PLAYER3,3)
			ALLY_PLAYERS(PLAYER6,PLAYER5,3)
			ALLY_PLAYERS(PLAYER6,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER_GOOD,PLAYER1,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER2,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER3,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER5,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER6,3)
ENDIF

IF(PLAYER0,FLAG2 == 5)
	ALLY_PLAYERS(PLAYER0,PLAYER5,3)
	ALLY_PLAYERS(PLAYER5,PLAYER0,3)

			ALLY_PLAYERS(PLAYER1,PLAYER2,3)
			ALLY_PLAYERS(PLAYER1,PLAYER3,3)
			ALLY_PLAYERS(PLAYER1,PLAYER4,3)
			ALLY_PLAYERS(PLAYER1,PLAYER6,3)
			ALLY_PLAYERS(PLAYER1,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER2,PLAYER1,3)
			ALLY_PLAYERS(PLAYER2,PLAYER3,3)
			ALLY_PLAYERS(PLAYER2,PLAYER4,3)
			ALLY_PLAYERS(PLAYER2,PLAYER6,3)
			ALLY_PLAYERS(PLAYER2,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER3,PLAYER1,3)
			ALLY_PLAYERS(PLAYER3,PLAYER2,3)
			ALLY_PLAYERS(PLAYER3,PLAYER4,3)
			ALLY_PLAYERS(PLAYER3,PLAYER6,3)
			ALLY_PLAYERS(PLAYER3,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER4,PLAYER1,3)
			ALLY_PLAYERS(PLAYER4,PLAYER2,3)
			ALLY_PLAYERS(PLAYER4,PLAYER3,3)
			ALLY_PLAYERS(PLAYER4,PLAYER6,3)
			ALLY_PLAYERS(PLAYER4,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER6,PLAYER1,3)
			ALLY_PLAYERS(PLAYER6,PLAYER2,3)
			ALLY_PLAYERS(PLAYER6,PLAYER3,3)
			ALLY_PLAYERS(PLAYER6,PLAYER4,3)
			ALLY_PLAYERS(PLAYER6,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER_GOOD,PLAYER1,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER2,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER3,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER4,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER6,3)
ENDIF

IF(PLAYER0,FLAG2 == 6)
	ALLY_PLAYERS(PLAYER0,PLAYER6,3)
	ALLY_PLAYERS(PLAYER6,PLAYER0,3)

			ALLY_PLAYERS(PLAYER1,PLAYER2,3)
			ALLY_PLAYERS(PLAYER1,PLAYER3,3)
			ALLY_PLAYERS(PLAYER1,PLAYER4,3)
			ALLY_PLAYERS(PLAYER1,PLAYER5,3)
			ALLY_PLAYERS(PLAYER1,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER2,PLAYER1,3)
			ALLY_PLAYERS(PLAYER2,PLAYER3,3)
			ALLY_PLAYERS(PLAYER2,PLAYER4,3)
			ALLY_PLAYERS(PLAYER2,PLAYER5,3)
			ALLY_PLAYERS(PLAYER2,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER3,PLAYER1,3)
			ALLY_PLAYERS(PLAYER3,PLAYER2,3)
			ALLY_PLAYERS(PLAYER3,PLAYER4,3)
			ALLY_PLAYERS(PLAYER3,PLAYER5,3)
			ALLY_PLAYERS(PLAYER3,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER4,PLAYER1,3)
			ALLY_PLAYERS(PLAYER4,PLAYER2,3)
			ALLY_PLAYERS(PLAYER4,PLAYER3,3)
			ALLY_PLAYERS(PLAYER4,PLAYER5,3)
			ALLY_PLAYERS(PLAYER4,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER5,PLAYER1,3)
			ALLY_PLAYERS(PLAYER5,PLAYER2,3)
			ALLY_PLAYERS(PLAYER5,PLAYER3,3)
			ALLY_PLAYERS(PLAYER5,PLAYER4,3)
			ALLY_PLAYERS(PLAYER5,PLAYER_GOOD,3)

			ALLY_PLAYERS(PLAYER_GOOD,PLAYER1,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER2,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER3,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER4,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER5,3)
ENDIF

IF(PLAYER0,FLAG2 == 7)
	ALLY_PLAYERS(PLAYER0,PLAYER_GOOD,3)
	ALLY_PLAYERS(PLAYER_GOOD,PLAYER0,3)

			ALLY_PLAYERS(PLAYER1,PLAYER2,3)
			ALLY_PLAYERS(PLAYER1,PLAYER3,3)
			ALLY_PLAYERS(PLAYER1,PLAYER4,3)
			ALLY_PLAYERS(PLAYER1,PLAYER5,3)
			ALLY_PLAYERS(PLAYER1,PLAYER6,3)

			ALLY_PLAYERS(PLAYER2,PLAYER1,3)
			ALLY_PLAYERS(PLAYER2,PLAYER3,3)
			ALLY_PLAYERS(PLAYER2,PLAYER4,3)
			ALLY_PLAYERS(PLAYER2,PLAYER5,3)
			ALLY_PLAYERS(PLAYER2,PLAYER6,3)

			ALLY_PLAYERS(PLAYER3,PLAYER1,3)
			ALLY_PLAYERS(PLAYER3,PLAYER2,3)
			ALLY_PLAYERS(PLAYER3,PLAYER4,3)
			ALLY_PLAYERS(PLAYER3,PLAYER5,3)
			ALLY_PLAYERS(PLAYER3,PLAYER6,3)

			ALLY_PLAYERS(PLAYER4,PLAYER1,3)
			ALLY_PLAYERS(PLAYER4,PLAYER2,3)
			ALLY_PLAYERS(PLAYER4,PLAYER3,3)
			ALLY_PLAYERS(PLAYER4,PLAYER5,3)
			ALLY_PLAYERS(PLAYER4,PLAYER6,3)

			ALLY_PLAYERS(PLAYER5,PLAYER1,3)
			ALLY_PLAYERS(PLAYER5,PLAYER2,3)
			ALLY_PLAYERS(PLAYER5,PLAYER3,3)
			ALLY_PLAYERS(PLAYER5,PLAYER4,3)
			ALLY_PLAYERS(PLAYER5,PLAYER6,3)

			ALLY_PLAYERS(PLAYER6,PLAYER1,3)
			ALLY_PLAYERS(PLAYER6,PLAYER2,3)
			ALLY_PLAYERS(PLAYER6,PLAYER3,3)
			ALLY_PLAYERS(PLAYER6,PLAYER4,3)
			ALLY_PLAYERS(PLAYER6,PLAYER5,3)
ENDIF

SET_BOX_TOOLTIP(3,"2 v 2 v 2 v 2, This is Chaos.")

IF(PLAYER0,BOX3_ACTIVATED == 1)
	RANDOMISE_FLAG(PLAYER0,FLAG0,8)
	RANDOMISE_FLAG(PLAYER0,FLAG3,8)
	CHANGE_SLAB_TYPE(75,9,WATER,MATCH)
	CHANGE_SLAB_TYPE(75,10,WATER,MATCH)
	SET_TIMER(PLAYER0,TIMER0)
	SET_OBJECT_CONFIGURATION(SPECBOX_CUSTOM,DestroyOnLiquid,1)
	SET_OBJECT_CONFIGURATION(SPECBOX_CUSTOM,Genre,Furniture)
	SET_OBJECT_CONFIGURATION(SPECBOX_CUSTOM,UpdateFunction,Update_Power_Sight)
	SET_OBJECT_CONFIGURATION(SPECBOX_CUSTOM,MaximumSize,0)
	COMPUTER_PLAYER(PLAYER1,0)
	COMPUTER_PLAYER(PLAYER2,0)
	COMPUTER_PLAYER(PLAYER3,0)
	COMPUTER_PLAYER(PLAYER4,0)
	COMPUTER_PLAYER(PLAYER5,0)
	COMPUTER_PLAYER(PLAYER6,0)
	COMPUTER_PLAYER(PLAYER_GOOD,0)

	MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
	MAGIC_AVAILABLE(ALL_PLAYERS,POWER_POSSESS,1,1)
	MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)

	SET_FLAG(PLAYER0,FLAG5,1)

	IF(PLAYER0,ALL_DUNGEONS_DESTROYED == 1)
		WIN_GAME
	ENDIF
ENDIF




IF(PLAYER0,FLAG3 == 1)
	ALLY_PLAYERS(PLAYER0,PLAYER1,3)
	ALLY_PLAYERS(PLAYER1,PLAYER0,3)

			ALLY_PLAYERS(PLAYER2,PLAYER3,3)
			ALLY_PLAYERS(PLAYER3,PLAYER2,3)
		
			ALLY_PLAYERS(PLAYER4,PLAYER5,3)
			ALLY_PLAYERS(PLAYER5,PLAYER4,3)

			ALLY_PLAYERS(PLAYER6,PLAYER_GOOD,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER6,3)
ENDIF

IF(PLAYER0,FLAG3 == 2)
	ALLY_PLAYERS(PLAYER0,PLAYER2,3)
	ALLY_PLAYERS(PLAYER2,PLAYER0,3)

			ALLY_PLAYERS(PLAYER1,PLAYER3,3)
			ALLY_PLAYERS(PLAYER3,PLAYER1,3)

			ALLY_PLAYERS(PLAYER4,PLAYER5,3)
			ALLY_PLAYERS(PLAYER5,PLAYER4,3)

			ALLY_PLAYERS(PLAYER6,PLAYER_GOOD,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER6,3)
ENDIF

IF(PLAYER0,FLAG3 == 3)
	ALLY_PLAYERS(PLAYER0,PLAYER3,3)
	ALLY_PLAYERS(PLAYER3,PLAYER0,3)

			ALLY_PLAYERS(PLAYER1,PLAYER2,3)
			ALLY_PLAYERS(PLAYER2,PLAYER1,3)

			ALLY_PLAYERS(PLAYER4,PLAYER5,3)
			ALLY_PLAYERS(PLAYER5,PLAYER4,3)

			ALLY_PLAYERS(PLAYER6,PLAYER_GOOD,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER6,3)
ENDIF

IF(PLAYER0,FLAG3 == 4)
	ALLY_PLAYERS(PLAYER0,PLAYER4,3)
	ALLY_PLAYERS(PLAYER4,PLAYER0,3)

			ALLY_PLAYERS(PLAYER1,PLAYER2,3)
			ALLY_PLAYERS(PLAYER2,PLAYER1,3)

			ALLY_PLAYERS(PLAYER3,PLAYER5,3)
			ALLY_PLAYERS(PLAYER5,PLAYER3,3)

			ALLY_PLAYERS(PLAYER6,PLAYER_GOOD,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER6,3)
ENDIF

IF(PLAYER0,FLAG3 == 5)
	ALLY_PLAYERS(PLAYER0,PLAYER5,3)
	ALLY_PLAYERS(PLAYER5,PLAYER0,3)

			ALLY_PLAYERS(PLAYER1,PLAYER2,3)
			ALLY_PLAYERS(PLAYER2,PLAYER1,3)

			ALLY_PLAYERS(PLAYER3,PLAYER4,3)
			ALLY_PLAYERS(PLAYER4,PLAYER3,3)

			ALLY_PLAYERS(PLAYER6,PLAYER_GOOD,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER6,3)
ENDIF

IF(PLAYER0,FLAG3 == 6)
	ALLY_PLAYERS(PLAYER0,PLAYER6,3)
	ALLY_PLAYERS(PLAYER6,PLAYER0,3)

			ALLY_PLAYERS(PLAYER1,PLAYER2,3)
			ALLY_PLAYERS(PLAYER2,PLAYER1,3)

			ALLY_PLAYERS(PLAYER3,PLAYER4,3)
			ALLY_PLAYERS(PLAYER4,PLAYER3,3)

			ALLY_PLAYERS(PLAYER5,PLAYER_GOOD,3)
			ALLY_PLAYERS(PLAYER_GOOD,PLAYER5,3)
ENDIF

IF(PLAYER0,FLAG3 == 7)
	ALLY_PLAYERS(PLAYER0,PLAYER_GOOD,3)
	ALLY_PLAYERS(PLAYER_GOOD,PLAYER0,3)

			ALLY_PLAYERS(PLAYER1,PLAYER2,3)
			ALLY_PLAYERS(PLAYER2,PLAYER1,3)

			ALLY_PLAYERS(PLAYER3,PLAYER4,3)
			ALLY_PLAYERS(PLAYER4,PLAYER3,3)

			ALLY_PLAYERS(PLAYER5,PLAYER6,3)
			ALLY_PLAYERS(PLAYER6,PLAYER5,3)
ENDIF

SET_BOX_TOOLTIP(4,"Free for all now THIS is Chaos!")

IF(PLAYER0,BOX4_ACTIVATED == 1)
	RANDOMISE_FLAG(PLAYER0,FLAG0,8)
	CHANGE_SLAB_TYPE(75,9,WATER,MATCH)
	CHANGE_SLAB_TYPE(75,10,WATER,MATCH)
	SET_TIMER(PLAYER0,TIMER0)
	SET_OBJECT_CONFIGURATION(SPECBOX_CUSTOM,DestroyOnLiquid,1)
	SET_OBJECT_CONFIGURATION(SPECBOX_CUSTOM,Genre,Furniture)
	SET_OBJECT_CONFIGURATION(SPECBOX_CUSTOM,UpdateFunction,Update_Power_Sight)
	SET_OBJECT_CONFIGURATION(SPECBOX_CUSTOM,MaximumSize,0)
	COMPUTER_PLAYER(PLAYER1,0)
	COMPUTER_PLAYER(PLAYER2,0)
	COMPUTER_PLAYER(PLAYER3,0)
	COMPUTER_PLAYER(PLAYER4,0)
	COMPUTER_PLAYER(PLAYER5,0)
	COMPUTER_PLAYER(PLAYER6,0)
	COMPUTER_PLAYER(PLAYER_GOOD,0)

	SET_FLAG(PLAYER0,FLAG5,1)

	MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
	MAGIC_AVAILABLE(ALL_PLAYERS,POWER_POSSESS,1,1)
	MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)

	IF(PLAYER0,ALL_DUNGEONS_DESTROYED == 1)
		WIN_GAME
	ENDIF
ENDIF



IF(PLAYER0,FLAG0 == 1)
	SET_PLAYER_COLOR(PLAYER0,RED)
ENDIF

IF(PLAYER0,FLAG0 == 2)
	SET_PLAYER_COLOR(PLAYER0,BLUE)
	SET_PLAYER_COLOR(PLAYER1,RED)
ENDIF

IF(PLAYER0,FLAG0 == 3)
	SET_PLAYER_COLOR(PLAYER0,GREEN)
	SET_PLAYER_COLOR(PLAYER2,RED)
ENDIF

IF(PLAYER0,FLAG0 == 4)
	SET_PLAYER_COLOR(PLAYER0,YELLOW)
	SET_PLAYER_COLOR(PLAYER3,RED)
ENDIF

IF(PLAYER0,FLAG0 == 5)
	SET_PLAYER_COLOR(PLAYER0,PURPLE)
	SET_PLAYER_COLOR(PLAYER4,RED)
ENDIF

IF(PLAYER0,FLAG0 == 6)
	SET_PLAYER_COLOR(PLAYER0,BLACK)
	SET_PLAYER_COLOR(PLAYER5,RED)
ENDIF

IF(PLAYER0,FLAG0 == 7)
	SET_PLAYER_COLOR(PLAYER0,ORANGE)
	SET_PLAYER_COLOR(PLAYER6,RED)
ENDIF

IF(PLAYER0,FLAG0 == 8)
	SET_PLAYER_COLOR(PLAYER0,WHITE)
	SET_PLAYER_COLOR(PLAYER_GOOD,RED)
ENDIF


REM IMP LIMITATION

if(PLAYER0,FLAG5 == 1)
		IF_CONTROLS(PLAYER0,IMP < 50)
		NEXT_COMMAND_REUSABLE
		MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)
		QUICK_INFORMATION(3,"Well Below 50 u can have more Imps...")
		ENDIF

		IF_CONTROLS(PLAYER0,IMP >= 50)
		NEXT_COMMAND_REUSABLE
		MAGIC_AVAILABLE(PLAYER0,POWER_IMP,0,0)
		QUICK_INFORMATION(2,"Enough is Enough you sick Bastard... NO MORE IMPS")
		ENDIF

		IF_CONTROLS(PLAYER1,IMP < 30)
		NEXT_COMMAND_REUSABLE
		MAGIC_AVAILABLE(PLAYER1,POWER_IMP,1,1)
		ENDIF

		IF_CONTROLS(PLAYER1,IMP >= 30)
		NEXT_COMMAND_REUSABLE
		MAGIC_AVAILABLE(PLAYER1,POWER_IMP,0,0)
		ENDIF

		IF_CONTROLS(PLAYER2,IMP < 30)
		NEXT_COMMAND_REUSABLE
		MAGIC_AVAILABLE(PLAYER2,POWER_IMP,1,1)
		ENDIF

		IF_CONTROLS(PLAYER2,IMP >= 30)
		NEXT_COMMAND_REUSABLE
		MAGIC_AVAILABLE(PLAYER2,POWER_IMP,0,0)
		ENDIF

		IF_CONTROLS(PLAYER3,IMP < 30)
		NEXT_COMMAND_REUSABLE
		MAGIC_AVAILABLE(PLAYER3,POWER_IMP,1,1)
		ENDIF

		IF_CONTROLS(PLAYER3,IMP >= 30)
		NEXT_COMMAND_REUSABLE
		MAGIC_AVAILABLE(PLAYER3,POWER_IMP,0,0)
		ENDIF

		IF_CONTROLS(PLAYER4,IMP < 30)
		NEXT_COMMAND_REUSABLE
		MAGIC_AVAILABLE(PLAYER4,POWER_IMP,1,1)
		ENDIF

		IF_CONTROLS(PLAYER4,IMP >= 30)
		NEXT_COMMAND_REUSABLE
		MAGIC_AVAILABLE(PLAYER4,POWER_IMP,0,0)
		ENDIF

		IF_CONTROLS(PLAYER5,IMP < 30)
		NEXT_COMMAND_REUSABLE
		MAGIC_AVAILABLE(PLAYER5,POWER_IMP,1,1)
		ENDIF

		IF_CONTROLS(PLAYER5,IMP >= 30)
		NEXT_COMMAND_REUSABLE
		MAGIC_AVAILABLE(PLAYER5,POWER_IMP,0,0)
		ENDIF

		IF_CONTROLS(PLAYER6,IMP < 30)
		NEXT_COMMAND_REUSABLE
		MAGIC_AVAILABLE(PLAYER6,POWER_IMP,1,1)
		ENDIF

		IF_CONTROLS(PLAYER6,IMP >= 30)
		NEXT_COMMAND_REUSABLE
		MAGIC_AVAILABLE(PLAYER6,POWER_IMP,0,0)
		ENDIF

		IF_CONTROLS(PLAYER_GOOD,IMP < 30)
		NEXT_COMMAND_REUSABLE
		MAGIC_AVAILABLE(PLAYER_GOOD,POWER_IMP,1,1)
		ENDIF

		IF_CONTROLS(PLAYER_GOOD,IMP >= 30)
		NEXT_COMMAND_REUSABLE
		MAGIC_AVAILABLE(PLAYER_GOOD,POWER_IMP,0,0)
		ENDIF
ENDIF

IF(PLAYER0,TIMER0 >= 20)
	CONCEAL_MAP_RECT(ALL_PLAYERS,223,37,18,18,1)
ENDIF