
SET_GENERATE_SPEED(600)

MAX_CREATURES(PLAYER0,15)

START_MONEY(PLAYER0,30000)


ADD_CREATURE_TO_POOL(SORCEROR,10)
ADD_CREATURE_TO_POOL(DRAGON,15)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,15)
ADD_CREATURE_TO_POOL(BILE_DEMON,15)
ADD_CREATURE_TO_POOL(DEMONSPAWN,5)
ADD_CREATURE_TO_POOL(SPIDER,5)
ADD_CREATURE_TO_POOL(ORC,20)
ADD_CREATURE_TO_POOL(TROLL,6)
ADD_CREATURE_TO_POOL(TENTACLE,6)
ADD_CREATURE_TO_POOL(HELL_HOUND,15)

CREATURE_AVAILABLE(ALL_PLAYERS,TROLL,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,TENTACLE,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DEMONSPAWN,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,BILE_DEMON,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,HELL_HOUND,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DRAGON,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,ORC,1,1)
	

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


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


TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,BOULDER,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,WORD_OF_POWER,1,0)


RESEARCH(ALL_PLAYERS,ROOM,BRIDGE,3000)
RESEARCH(PLAYER0,MAGIC,POWER_SIGHT,5000)
RESEARCH(ALL_PLAYERS,ROOM,GUARD_POST,5000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_CALL_TO_ARMS,5000)
RESEARCH(ALL_PLAYERS,ROOM,WORKSHOP,15000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_HOLD_AUDIENCE,15000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_SPEED,10000)
RESEARCH(ALL_PLAYERS,ROOM,PRISON,20000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_CONCEAL,15000)
RESEARCH(ALL_PLAYERS,ROOM,BARRACKS,15000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_PROTECT,15000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_HEAL_CREATURE,15000)
RESEARCH(ALL_PLAYERS,ROOM,TORTURE,20000)
RESEARCH(ALL_PLAYERS,ROOM,TEMPLE,25000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_LIGHTNING,25000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_OBEY,15000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_CHICKEN,25000)
RESEARCH(PLAYER0,MAGIC,POWER_DISEASE,50000)
RESEARCH(PLAYER0,MAGIC,POWER_DESTROY_WALLS,300000)


DISPLAY_OBJECTIVE(102,PLAYER0)


CREATE_PARTY(ZERO)
	ADD_TO_PARTY(ZERO,DWARFA,2,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ZERO,DWARFA,3,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ZERO,DWARFA,2,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ZERO,DWARFA,1,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ZERO,DWARFA,1,0,ATTACK_ENEMIES,0)

CREATE_PARTY(ONE)
	ADD_TO_PARTY(ONE,ARCHER,4,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,BARBARIAN,8,2000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,ARCHER,4,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,ARCHER,4,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,ARCHER,4,0,ATTACK_ENEMIES,0)

CREATE_PARTY(TWO)
	ADD_TO_PARTY(TWO,WIZARD,4,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,WIZARD,9,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,WIZARD,4,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,WIZARD,4,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,WIZARD,4,0,ATTACK_ENEMIES,0)

CREATE_PARTY(THREE)
	ADD_TO_PARTY(THREE,DWARFA,6,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(THREE,GIANT,9,2500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(THREE,DWARFA,6,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(THREE,DWARFA,6,0,ATTACK_ENEMIES,0)

CREATE_PARTY(FOUR)
	ADD_TO_PARTY(FOUR,FAIRY,6,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,FAIRY,9,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,FAIRY,6,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,FAIRY,6,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,FAIRY,6,0,ATTACK_ENEMIES,0)

CREATE_PARTY(FIVE)
	ADD_TO_PARTY(FIVE,SAMURAI,9,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIVE,DRAGON,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIVE,SAMURAI,9,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIVE,SAMURAI,9,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIVE,SAMURAI,9,0,ATTACK_ENEMIES,0)


CREATE_PARTY(FIN1)
	ADD_TO_PARTY(FIN1,ARCHER,9,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIN1,BARBARIAN,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIN1,ARCHER,9,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIN1,ARCHER,9,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIN1,ARCHER,9,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIN1,ARCHER,9,0,ATTACK_ENEMIES,0)

CREATE_PARTY(FIN2)
	ADD_TO_PARTY(FIN2,WIZARD,9,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIN2,WIZARD,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIN2,WIZARD,9,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIN2,WIZARD,9,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIN2,WITCH,10,0,ATTACK_ENEMIES,0)

CREATE_PARTY(FIN3)
	ADD_TO_PARTY(FIN3,SAMURAI,9,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIN3,DRAGON,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIN3,SAMURAI,9,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIN3,DRAGON,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIN3,SAMURAI,9,0,ATTACK_ENEMIES,0)


CREATE_PARTY(KNIGHT)
	ADD_TO_PARTY(KNIGHT,KNIGHT,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(KNIGHT,AVATAR,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(KNIGHT,KNIGHT,10,0,ATTACK_ENEMIES,0)



IF_ACTION_POINT(1,PLAYER0)
	DISPLAY_INFORMATION(103,PLAYER0)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ZERO,2,DUNGEON,0,3,1000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ZERO,3,DUNGEON,0,3,1000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ZERO,4,DUNGEON,0,3,1000)
ENDIF


IF(PLAYER0,TOTAL_GOLD_MINED > 5000)
	DISPLAY_INFORMATION(104,PLAYER0)
	SET_TIMER(PLAYER0,TIMER0)
	SET_TIMER(PLAYER0,TIMER1)
ENDIF


IF(PLAYER0,TIMER1 >= 4000)
	IF(PLAYER0,TIMER0 <= 24100)
 				NEXT_COMMAND_REUSABLE
				ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,2,1)
 				NEXT_COMMAND_REUSABLE
				ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,3,1)
 				NEXT_COMMAND_REUSABLE
				ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,4,1)
	        		NEXT_COMMAND_REUSABLE
				SET_TIMER(PLAYER0,TIMER1)
	ENDIF
ENDIF

IF(PLAYER0,TIMER1 >= 4000)
	IF(PLAYER0,TIMER0 >= 24150)
			IF(PLAYER0,TIMER0 <= 54150)
 				NEXT_COMMAND_REUSABLE
				ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,2,2)
 				NEXT_COMMAND_REUSABLE
				ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,3,2)
 				NEXT_COMMAND_REUSABLE
				ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,4,1)
	        		NEXT_COMMAND_REUSABLE
				SET_TIMER(PLAYER0,TIMER1)
		ENDIF
	ENDIF
ENDIF



IF(PLAYER0,TIMER0 >= 33000)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,2,1)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIVE,3,1)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIVE,4,1)
ENDIF



IF(PLAYER0, ALL_DUNGEONS_DESTROYED == 1)
	ADD_CREATURE_TO_LEVEL(PLAYER0,HORNY,PLAYER0,3,10,0)
	SET_FLAG(PLAYER0,FLAG0,1)
	DISPLAY_OBJECTIVE(105,PLAYER0)
	SET_TIMER(PLAYER0,TIMER2)
	SET_TIMER(PLAYER0,TIMER3)
ENDIF



IF(PLAYER0,TIMER2 >= 2000)
	IF(PLAYER0,TIMER3 <= 10350)
 			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIN1,2,1)
 			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIN2,3,1)
 			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIN3,4,1)
	        	NEXT_COMMAND_REUSABLE
			SET_TIMER(PLAYER0,TIMER2)
	ENDIF
ENDIF


IF(PLAYER0,TIMER3 > 12000)
	DISPLAY_INFORMATION(106,PLAYER0)
ENDIF

IF(PLAYER0,TIMER3 > 14000)
	SET_FLAG(PLAYER0,FLAG0,2)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,KNIGHT,-1,2)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,KNIGHT,-2,2)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,KNIGHT,-3,2)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,KNIGHT,-4,2)
ENDIF




IF(PLAYER0, ALL_DUNGEONS_DESTROYED == 1)
	IF(PLAYER_GOOD,AVATAR==0)
		IF(PLAYER0,FLAG0==2)
			DISPLAY_OBJECTIVE(107,PLAYER0)
			WIN_GAME
		ENDIF
	ENDIF
ENDIF




