
SET_GENERATE_SPEED(600)

MAX_CREATURES(ALL_PLAYERS,20)


START_MONEY(PLAYER0,20000)
START_MONEY(PLAYER2,10000)


COMPUTER_PLAYER(PLAYER2,7)


ADD_CREATURE_TO_POOL(BILE_DEMON,15)
ADD_CREATURE_TO_POOL(DEMONSPAWN,10)
ADD_CREATURE_TO_POOL(SPIDER,10)
ADD_CREATURE_TO_POOL(FLY,5)
ADD_CREATURE_TO_POOL(SORCEROR,10)
ADD_CREATURE_TO_POOL(ORC,15)
ADD_CREATURE_TO_POOL(TROLL,5)


CREATURE_AVAILABLE(ALL_PLAYERS,BILE_DEMON,1,1)		
CREATURE_AVAILABLE(ALL_PLAYERS,DEMONSPAWN,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,FLY,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,ORC,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,TROLL,1,1)
	

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(PLAYER0,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)


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)
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_CAVE_IN,1,0)


DOOR_AVAILABLE(ALL_PLAYERS,WOOD,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)


RESEARCH(ALL_PLAYERS,ROOM,BRIDGE,3000)
RESEARCH(ALL_PLAYERS,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,MAGIC,POWER_CAVE_IN,25000)
RESEARCH(ALL_PLAYERS,MAGIC,POWER_LIGHTNING,25000)



DISPLAY_OBJECTIVE(23,PLAYER0)


CREATE_PARTY(TUN)
	ADD_TO_PARTY(TUN,DWARFA,2,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TUN,DWARFA,4,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TUN,DWARFA,2,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TUN,DWARFA,2,500,ATTACK_ENEMIES,0)

CREATE_PARTY(TUN2)
	ADD_TO_PARTY(TUN2,DWARFA,3,500,ATTACK_ENEMIES,2)
	ADD_TO_PARTY(TUN2,DWARFA,3,500,ATTACK_ENEMIES,2)
	ADD_TO_PARTY(TUN2,DWARFA,3,500,ATTACK_ENEMIES,2)


CREATE_PARTY(ONE)
	ADD_TO_PARTY(ONE,DWARFA,6,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,BARBARIAN,9,2500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,DWARFA,6,500,ATTACK_ENEMIES,0)

CREATE_PARTY(TWO)
	ADD_TO_PARTY(TWO,DWARFA,6,500,ATTACK_ENEMIES,2)
	ADD_TO_PARTY(TWO,BARBARIAN,9,2500,ATTACK_ENEMIES,2)
	ADD_TO_PARTY(TWO,DWARFA,6,500,ATTACK_ENEMIES,2)


CREATE_PARTY(KNIGHT)
	ADD_TO_PARTY(KNIGHT,KNIGHT,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(KNIGHT,KNIGHT,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(KNIGHT,KNIGHT,10,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(KNIGHT,GIANT,9,0,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(KNIGHT,GIANT,9,0,ATTACK_ENEMIES,0)


IF(PLAYER0, GAME_TURN > 19000)
	DISPLAY_INFORMATION(66,PLAYER0)
ENDIF


IF(PLAYER0,PRISON > 0)
ROOM_AVAILABLE(PLAYER0,PRISON,1,1)
ENDIF



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



IF(PLAYER0,TIMER0 > 5000)
	DISPLAY_OBJECTIVE(24,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER2,ORC,PLAYER2,5,5,0)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,TUN2,1,DUNGEON,2,4,1000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,TUN,2,DUNGEON,0,4,1000)
ENDIF


IF(PLAYER0,TIMER0 > 10000)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,-2,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,-1,1)
ENDIF


IF(PLAYER0,TIMER0 > 15000)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,-2,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,-1,1)
ENDIF


IF(PLAYER0,TIMER0 > 20000)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,-2,3)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,-1,3)
ENDIF

IF(PLAYER0,TIMER0 > 26000)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,-2,3)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,-1,3)
ENDIF


IF(PLAYER0, ALL_DUNGEONS_DESTROYED == 1)
	DISPLAY_OBJECTIVE(25,PLAYER0)
	SET_TIMER(PLAYER0,TIMER1)
ENDIF


IF(PLAYER0,TIMER1 > 1000)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,KNIGHT,-1,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,KNIGHT,-2,1)
ENDIF


IF(PLAYER0, ALL_DUNGEONS_DESTROYED == 1)
	IF(PLAYER_GOOD,KNIGHT==0)
		IF(PLAYER0,TIMER1 > 1050)
			DISPLAY_OBJECTIVE(26,PLAYER0)
			WIN_GAME
		ENDIF
	ENDIF
ENDIF



