
SET_GENERATE_SPEED(500)

MAX_CREATURES(ALL_PLAYERS,10)

START_MONEY(ALL_PLAYERS,10000)


ADD_CREATURE_TO_POOL(DEMONSPAWN,10)
ADD_CREATURE_TO_POOL(SPIDER,10)
ADD_CREATURE_TO_POOL(BUG,10)
ADD_CREATURE_TO_POOL(FLY,5)

		
CREATURE_AVAILABLE(ALL_PLAYERS,DEMONSPAWN,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,FLY,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,BUG,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,1)
	

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)

		
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(ALL_PLAYERS,POWER_SIGHT,1,0)

DOOR_AVAILABLE(ALL_PLAYERS,WOOD,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,ALARM,1,0)


DISPLAY_OBJECTIVE(2,PLAYER0)


CREATE_PARTY(ONE)
	ADD_TO_PARTY(ONE,DWARFA,1,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,THIEF,3,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,THIEF,1,500,ATTACK_ENEMIES,0)

CREATE_PARTY(TWO)
	ADD_TO_PARTY(TWO,THIEF,2,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,THIEF,2,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,ARCHER,1,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,ARCHER,3,500,ATTACK_ENEMIES,0)

CREATE_PARTY(THREE)
	ADD_TO_PARTY(THREE,DWARFA,3,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(THREE,DWARFA,3,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(THREE,BARBARIAN,5,1500,ATTACK_ENEMIES,0)

CREATE_PARTY(FOUR)
	ADD_TO_PARTY(FOUR,THIEF,3,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,THIEF,3,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,BARBARIAN,5,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,ARCHER,3,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,ARCHER,3,500,ATTACK_ENEMIES,0)

CREATE_PARTY(KNIGHTY)
	ADD_TO_PARTY(KNIGHTY,KNIGHT,10,3000,ATTACK_ENEMIES,0)


IF(PLAYER0,ENTRANCE > 0)
	DISPLAY_INFORMATION(5,PLAYER0)
	SET_TIMER(PLAYER0,TIMER0)
ENDIF



IF(PLAYER0,TIMER0 > 9000)
	DISPLAY_INFORMATION(3,PLAYER0)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,1,DUNGEON,0,2,1000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,2,DUNGEON,0,2,1000)
ENDIF


IF(PLAYER_GOOD,TOTAL_CREATURES==0)
	IF(PLAYER0,TIMER0 > 9100)
		SET_TIMER(PLAYER0,TIMER1)
	ENDIF
ENDIF


IF(PLAYER0,TIMER1 > 2000)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,1,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,2,1)
ENDIF


IF(PLAYER0,TIMER1 > 5000)
	IF(PLAYER_GOOD,TOTAL_CREATURES==0)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,-1,1)
		SET_TIMER(PLAYER0,TIMER2)
	ENDIF
ENDIF


IF(PLAYER0,TIMER2 > 2000)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,-1,1)
ENDIF


IF(PLAYER0,TIMER2 > 2100)
	IF(PLAYER_GOOD,TOTAL_CREATURES==0)
		SET_TIMER(PLAYER0,TIMER3)
		SET_FLAG(PLAYER0,FLAG0,1)
		DISPLAY_OBJECTIVE(4,PLAYER0)
	ENDIF
ENDIF


IF(PLAYER0,TIMER3 > 1000)
	SET_FLAG(PLAYER0,FLAG0,2)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,KNIGHTY,-1,1)
ENDIF


IF(PLAYER0,FLAG0==2)
	IF(PLAYER_GOOD,TOTAL_CREATURES==0)
		DISPLAY_OBJECTIVE(6,PLAYER0)
		WIN_GAME
	ENDIF
ENDIF


