LEVEL_VERSION(1)
RUN_AFTER_VICTORY(1)
SET_GENERATE_SPEED(500)
START_MONEY(ALL_PLAYERS,5000)
MAX_CREATURES(PLAYER0,30)
MAX_CREATURES(PLAYER1,30)
MAX_CREATURES(PLAYER2,20)
MAX_CREATURES(PLAYER3,20)
MAX_CREATURES(PLAYER4,25)
MAX_CREATURES(PLAYER5,25)
MAX_CREATURES(PLAYER6,25)
MAX_CREATURES(PLAYER_GOOD,25)
SET_GAME_RULE(MapCreatureLimit,1000)
SET_GAME_RULE(AlliesShareCta,1)
SET_GAME_RULE(AlliesShareDrop,1)
SET_GAME_RULE(AlliesShareVision,1)
SET_GAME_RULE(GemEffectiveness,25)
SET_GAME_RULE(PrisonSkeletonChance,0)
SET_GAME_RULE(BodiesForVampire,50)
SET_CREATURE_PROPERTY(IMP,NO_IMPRISONMENT,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,PLAYER5,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,PLAYER5,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,PLAYER5,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,PLAYER5,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)

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)


QUICK_OBJECTIVE(1,"Welcome Keeper.This Realm is full of Old Magic and Curses... establish your Dungeon and Qonquer alongside your Bloodbrother to find the secrets that stands between you and World domination!")


ADD_CREATURE_TO_POOL(FLY,20)
ADD_CREATURE_TO_POOL(BUG,20)
ADD_CREATURE_TO_POOL(DEMONSPAWN,20)
ADD_CREATURE_TO_POOL(TROLL,20)
ADD_CREATURE_TO_POOL(SPIDER,20)
ADD_CREATURE_TO_POOL(TENTACLE,20)
ADD_CREATURE_TO_POOL(SORCEROR,20)
ADD_CREATURE_TO_POOL(ORC,20)
ADD_CREATURE_TO_POOL(BILE_DEMON,20)
ADD_CREATURE_TO_POOL(DRAGON,20)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,20)
ADD_CREATURE_TO_POOL(VAMPIRE,20)
ADD_CREATURE_TO_POOL(HORNY,20)
ADD_CREATURE_TO_POOL(THIEF,20)
ADD_CREATURE_TO_POOL(DWARFA,20)
ADD_CREATURE_TO_POOL(ARCHER,20)
ADD_CREATURE_TO_POOL(BARBARIAN,20)
ADD_CREATURE_TO_POOL(MONK,20)
ADD_CREATURE_TO_POOL(FAIRY,20)
ADD_CREATURE_TO_POOL(WITCH,20)
ADD_CREATURE_TO_POOL(WIZARD,20)
ADD_CREATURE_TO_POOL(GIANT,20)
ADD_CREATURE_TO_POOL(SAMURAI,20)

CREATURE_AVAILABLE(PLAYER2,FLY,1,0)
CREATURE_AVAILABLE(PLAYER3,FLY,1,0)
CREATURE_AVAILABLE(PLAYER2,BUG,1,0)
CREATURE_AVAILABLE(PLAYER3,BUG,1,0)
CREATURE_AVAILABLE(PLAYER2,DEMONSPAWN,1,0)
CREATURE_AVAILABLE(PLAYER3,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,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,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)

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,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)
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_CAVE_IN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(PLAYER4,POWER_LIGHTNING,1,0)
MAGIC_AVAILABLE(PLAYER5,POWER_LIGHTNING,1,0)
MAGIC_AVAILABLE(PLAYER6,POWER_LIGHTNING,1,0)
MAGIC_AVAILABLE(PLAYER_GOOD,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,POISON_GAS,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)

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

IF(PLAYER0,FLAG0 == 0)
	IF_ACTION_POINT(1,PLAYER0)
		QUICK_INFORMATION(2,"You managed to find a hidden Treasure before your Blue Brother.Only one of you can go ahead and claim it.Be wise and sure whomst of you may go.")
		SET_FLAG(PLAYER0,FLAG0,1)
	ENDIF
	IF_ACTION_POINT(1,PLAYER1)
		QUICK_INFORMATION(3,"You managed to find a hidden Treasure before your Red Brother.Only one of you can go ahead and claim it.Be wise and sure whomst of you may go.")
		SET_FLAG(PLAYER0,FLAG0,1)
	ENDIF

ENDIF

IF(PLAYER2,DUNGEON_DESTROYED == 1)
	QUICK_INFORMATION(4,"Now that you Destroyed this Green Goblin,go North and search the hidden blueprints to Erase these foolish Cockroaches... hehe COCKroach get it?")
	ADD_TO_FLAG(PLAYER0,FLAG1,1)
ENDIF

IF(PLAYER3,DUNGEON_DESTROYED == 1)
	QUICK_INFORMATION(5,"Now that you Destroyed this Yellow Peestain,go North and search the hidden blueprints to Squash these Fools like a little Cockatiel... hehe COCKatiel... get it?")
	ADD_TO_FLAG(PLAYER0,FLAG1,1)
ENDIF

IF(PLAYER4,DUNGEON_DESTROYED == 1)
	ADD_TO_FLAG(PLAYER0,FLAG1,1)
ENDIF

IF(PLAYER5,DUNGEON_DESTROYED == 1)
	ADD_TO_FLAG(PLAYER0,FLAG1,1)
ENDIF

IF(PLAYER6,DUNGEON_DESTROYED == 1)
	ADD_TO_FLAG(PLAYER0,FLAG1,1)
ENDIF

IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
	ADD_TO_FLAG(PLAYER0,FLAG1,1)
ENDIF


REM Special Boxes

SET_BOX_TOOLTIP(1,"FARTBOX: A Little Fart for your Ally")
IF(PLAYER0,BOX1_ACTIVATED > 0)
	NEXT_COMMAND_REUSABLE
	PLAY_MESSAGE(PLAYER1,SOUND,94)
ENDIF

IF(PLAYER0,BOX1_ACTIVATED >= 1)
	NEXT_COMMAND_REUSABLE
	SET_FLAG(PLAYER0,BOX1_ACTIVATED,0)
	NEXT_COMMAND_REUSABLE
	ADD_OBJECT_TO_LEVEL(SPECBOX_CUSTOM,2,1,PLAYER0)
ENDIF

SET_BOX_TOOLTIP(2,"SOUND THE ALARM: Sound the Alarm for your Buddy")
IF(PLAYER0,BOX2_ACTIVATED > 0)
	NEXT_COMMAND_REUSABLE
	PLAY_MESSAGE(PLAYER1,SOUND,90)
ENDIF

IF(PLAYER0,BOX2_ACTIVATED >= 1)
	NEXT_COMMAND_REUSABLE
	SET_FLAG(PLAYER0,BOX2_ACTIVATED,0)
	NEXT_COMMAND_REUSABLE
	ADD_OBJECT_TO_LEVEL(SPECBOX_CUSTOM,3,2,PLAYER0)
ENDIF


SET_BOX_TOOLTIP(3,"FARTBOX: A Little Fart for your Ally")
IF(PLAYER1,BOX3_ACTIVATED > 0)
	NEXT_COMMAND_REUSABLE
	PLAY_MESSAGE(PLAYER0,SOUND,95)
ENDIF

IF(PLAYER1,BOX3_ACTIVATED >= 1)
	NEXT_COMMAND_REUSABLE
	SET_FLAG(PLAYER1,BOX3_ACTIVATED,0)
	NEXT_COMMAND_REUSABLE
	ADD_OBJECT_TO_LEVEL(SPECBOX_CUSTOM,4,3,PLAYER1)
ENDIF

SET_BOX_TOOLTIP(4,"SOUND THE ALARM: Sound the Alarm for your Buddy")
IF(PLAYER1,BOX4_ACTIVATED > 0)
	NEXT_COMMAND_REUSABLE
	PLAY_MESSAGE(PLAYER0,SOUND,90)
ENDIF

IF(PLAYER1,BOX4_ACTIVATED >= 1)
	NEXT_COMMAND_REUSABLE
	SET_FLAG(PLAYER1,BOX4_ACTIVATED,0)
	NEXT_COMMAND_REUSABLE
	ADD_OBJECT_TO_LEVEL(SPECBOX_CUSTOM,5,4,PLAYER1)
ENDIF



IF(PLAYER0,FLAG1 >= 6)
	WIN_GAME
ENDIF
