REM Generic Script Base 30.7.96

REM Level 107

REM Higher Game Functions
	REM NEUTRAL_ENTRANCE_LEVEL(0)
	SET_GENERATE_SPEED(500)



	MAX_CREATURES(PLAYER0,20)
	MAX_CREATURES(PLAYER1,20)
	MAX_CREATURES(PLAYER2,20)
	MAX_CREATURES(PLAYER3,20)


		REM Player0
			START_MONEY(PLAYER0,3000)


		REM Player1
			START_MONEY(PLAYER1,3000)
	

		REM Player2
			START_MONEY(PLAYER2,3000)
			START_MONEY(PLAYER3,3000)

 REM     Computer Player stuff
		REM COMPUTER_PLAYER(PLAYER1)
		COMPUTER_PLAYER(PLAYER1, 0)

		REM COMPUTER_SPEED(PLAYER1,5,10)
		REM player, speed (0 fastest), dig_speed (1, slowest)

		REM COMPUTER_DESIRE(PLAYER1,5,5,5,5)
		REM player, gold, creatures, blood, building 1-10

		REM COMPUTER_PLAYER(PLAYER2)
		COMPUTER_PLAYER(PLAYER2, 0)
		REM COMPUTER_SPEED(PLAYER2,5,10)
		REM COMPUTER_DESIRE(PLAYER2,5,5,5,5)

		REM COMPUTER_PLAYER(PLAYER3)
		COMPUTER_PLAYER(PLAYER3, 0)
		REM COMPUTER_SPEED(PLAYER3,5,10)
		REM COMPUTER_DESIRE(PLAYER3,5,5,5,5)


REM CREATURE_INBY(TROLL,0)
REM CREATURE_INBY(DEMONSPAWN,1)
REM CREATURE_INBY(FLY,2)
REM CREATURE_INBY(DARK_MISTRESS,2)
REM CREATURE_INBY(SORCEROR,1)
REM CREATURE_INBY(BILE_DEMON,2)
REM CREATURE_INBY(BUG,3)
REM CREATURE_INBY(VAMPIRE,1)
REM CREATURE_INBY(SPIDER,1
REM CREATURE_INBY(HELL_HOUND,0
REM CREATURE_INBY(DRAGON,4)

ADD_CREATURE_TO_POOL(TROLL,1)
ADD_CREATURE_TO_POOL(DEMONSPAWN,2)
ADD_CREATURE_TO_POOL(FLY,3)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,3)
ADD_CREATURE_TO_POOL(SORCEROR,2)
ADD_CREATURE_TO_POOL(BILE_DEMON,3)
ADD_CREATURE_TO_POOL(BUG,4)
ADD_CREATURE_TO_POOL(VAMPIRE,2)
ADD_CREATURE_TO_POOL(SPIDER,2)
ADD_CREATURE_TO_POOL(HELL_HOUND,1)
ADD_CREATURE_TO_POOL(DRAGON,5)



REM Player Properties

REM Player 0



	REM Creature_Availability



		CREATURE_AVAILABLE(PLAYER0,TROLL,1,1)
		CREATURE_AVAILABLE(PLAYER0,DEMONSPAWN,1,1)
		CREATURE_AVAILABLE(PLAYER0,FLY,1,1)
		CREATURE_AVAILABLE(PLAYER0,DARK_MISTRESS,1,1)
		CREATURE_AVAILABLE(PLAYER0,SORCEROR,1,1)
		CREATURE_AVAILABLE(PLAYER0,BILE_DEMON,1,0)
		CREATURE_AVAILABLE(PLAYER0,BUG,1,1)
		CREATURE_AVAILABLE(PLAYER0,VAMPIRE,1,0)
		CREATURE_AVAILABLE(PLAYER0,SPIDER,1,1)
		CREATURE_AVAILABLE(PLAYER0,HELL_HOUND,1,1)
		CREATURE_AVAILABLE(PLAYER0,DRAGON,1,1)



			
	REM Room_Availability

		ROOM_AVAILABLE(PLAYER0,TREASURE,1,1)
		ROOM_AVAILABLE(PLAYER0,RESEARCH,1,1)
		ROOM_AVAILABLE(PLAYER0,PRISON,1,1)
		ROOM_AVAILABLE(PLAYER0,TORTURE,1,1)
		ROOM_AVAILABLE(PLAYER0,TRAINING,1,1)
		ROOM_AVAILABLE(PLAYER0,WORKSHOP,1,1)
		ROOM_AVAILABLE(PLAYER0,BARRACKS,1,1)
		ROOM_AVAILABLE(PLAYER0,GARDEN,1,1)
		ROOM_AVAILABLE(PLAYER0,LAIR,1,1)
		ROOM_AVAILABLE(PLAYER0,TEMPLE,1,1)
		ROOM_AVAILABLE(PLAYER0,GRAVEYARD,1,1)

	REM Spells
		
		MAGIC_AVAILABLE(PLAYER0,POWER_HAND,1,1)
		MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)
		MAGIC_AVAILABLE(PLAYER0,POWER_SLAP,1,1)
		MAGIC_AVAILABLE(PLAYER0,POWER_SIGHT,1,1)
		MAGIC_AVAILABLE(PLAYER0,POWER_CALL_TO_ARMS,1,1)
		MAGIC_AVAILABLE(PLAYER0,POWER_CAVE_IN,1,1)
		MAGIC_AVAILABLE(PLAYER0,POWER_HEAL_CREATURE,1,1)
		MAGIC_AVAILABLE(PLAYER0,POWER_HOLD_AUDIENCE,1,0)
		MAGIC_AVAILABLE(PLAYER0,POWER_LIGHTNING,1,1)
		MAGIC_AVAILABLE(PLAYER0,POWER_CONCEAL,1,1)
		MAGIC_AVAILABLE(PLAYER0,POWER_PROTECT,1,1)
		MAGIC_AVAILABLE(PLAYER0,POWER_SPEED,1,1)

	REM  doors & traps

		REM DOOR_AVAILABLE(PLAYER0,WOODEN,1,3)
		DOOR_AVAILABLE(PLAYER0,WOOD,1,3)
		DOOR_AVAILABLE(PLAYER0,BRACED,1,3)
		DOOR_AVAILABLE(PLAYER0,STEEL,1,3)
		DOOR_AVAILABLE(PLAYER0,MAGIC,1,3)
		TRAP_AVAILABLE(PLAYER0,BOULDER,1,3)
		TRAP_AVAILABLE(PLAYER0,POISON_GAS,1,3)

	REM Creature_Availability


		CREATURE_AVAILABLE(PLAYER1,TROLL,1,1)
		CREATURE_AVAILABLE(PLAYER1,DEMONSPAWN,1,1)
		CREATURE_AVAILABLE(PLAYER1,FLY,1,1)
		CREATURE_AVAILABLE(PLAYER1,DARK_MISTRESS,1,1)
		CREATURE_AVAILABLE(PLAYER1,SORCEROR,1,1)
		CREATURE_AVAILABLE(PLAYER1,BILE_DEMON,1,0)
		CREATURE_AVAILABLE(PLAYER1,BUG,1,1)
		CREATURE_AVAILABLE(PLAYER1,VAMPIRE,1,0)
		CREATURE_AVAILABLE(PLAYER1,SPIDER,1,1)
		CREATURE_AVAILABLE(PLAYER1,HELL_HOUND,1,1)
		CREATURE_AVAILABLE(PLAYER1,DRAGON,1,1)


	REM Room_Availability

		ROOM_AVAILABLE(PLAYER1,TREASURE,1,1)
		ROOM_AVAILABLE(PLAYER1,RESEARCH,1,1)
		ROOM_AVAILABLE(PLAYER1,PRISON,1,1)
		ROOM_AVAILABLE(PLAYER1,TORTURE,1,1)
		ROOM_AVAILABLE(PLAYER1,TRAINING,1,1)
		ROOM_AVAILABLE(PLAYER1,WORKSHOP,1,1)
		ROOM_AVAILABLE(PLAYER1,BARRACKS,1,1)
		ROOM_AVAILABLE(PLAYER1,GARDEN,1,1)
		ROOM_AVAILABLE(PLAYER1,LAIR,1,1)
		ROOM_AVAILABLE(PLAYER1,TEMPLE,1,1)
		ROOM_AVAILABLE(PLAYER1,GRAVEYARD,1,1)

	REM Spells
		
		MAGIC_AVAILABLE(PLAYER1,POWER_HAND,1,1)
		MAGIC_AVAILABLE(PLAYER1,POWER_IMP,1,1)
		MAGIC_AVAILABLE(PLAYER1,POWER_SLAP,1,1)
		MAGIC_AVAILABLE(PLAYER1,POWER_SIGHT,1,1)
		MAGIC_AVAILABLE(PLAYER1,POWER_CALL_TO_ARMS,1,1)
		MAGIC_AVAILABLE(PLAYER1,POWER_CAVE_IN,1,1)
		MAGIC_AVAILABLE(PLAYER1,POWER_HEAL_CREATURE,1,1)
		MAGIC_AVAILABLE(PLAYER1,POWER_HOLD_AUDIENCE,1,0)
		MAGIC_AVAILABLE(PLAYER1,POWER_LIGHTNING,1,1)
		MAGIC_AVAILABLE(PLAYER1,POWER_CONCEAL,1,1)
		MAGIC_AVAILABLE(PLAYER1,POWER_PROTECT,1,1)
		MAGIC_AVAILABLE(PLAYER1,POWER_SPEED,1,1)
	REM  doors & traps

		REM DOOR_AVAILABLE(PLAYER1,WOODEN,1,3)
		DOOR_AVAILABLE(PLAYER1,WOOD,1,4)
		DOOR_AVAILABLE(PLAYER1,BRACED,1,4)
		DOOR_AVAILABLE(PLAYER1,STEEL,1,4)
		DOOR_AVAILABLE(PLAYER1,MAGIC,1,4)
		TRAP_AVAILABLE(PLAYER1,BOULDER,1,4)
		TRAP_AVAILABLE(PLAYER1,POISON_GAS,1,4)


	REM Creature_Availability

		CREATURE_AVAILABLE(PLAYER2,TROLL,1,1)
		CREATURE_AVAILABLE(PLAYER2,DEMONSPAWN,1,1)
		CREATURE_AVAILABLE(PLAYER2,FLY,1,1)
		CREATURE_AVAILABLE(PLAYER2,DARK_MISTRESS,1,1)
		CREATURE_AVAILABLE(PLAYER2,SORCEROR,1,1)
		CREATURE_AVAILABLE(PLAYER2,BILE_DEMON,1,0)
		CREATURE_AVAILABLE(PLAYER2,BUG,1,1)
		CREATURE_AVAILABLE(PLAYER2,VAMPIRE,1,0)
		CREATURE_AVAILABLE(PLAYER2,SPIDER,1,1)
		CREATURE_AVAILABLE(PLAYER2,HELL_HOUND,1,1)
		CREATURE_AVAILABLE(PLAYER2,DRAGON,1,1)

	REM Room_Availability

		ROOM_AVAILABLE(PLAYER2,TREASURE,1,1)
		ROOM_AVAILABLE(PLAYER2,RESEARCH,1,1)
		ROOM_AVAILABLE(PLAYER2,PRISON,1,1)
		ROOM_AVAILABLE(PLAYER2,TORTURE,1,1)
		ROOM_AVAILABLE(PLAYER2,TRAINING,1,1)
		ROOM_AVAILABLE(PLAYER2,WORKSHOP,1,1)
		ROOM_AVAILABLE(PLAYER2,BARRACKS,1,1)
		ROOM_AVAILABLE(PLAYER2,GARDEN,1,1)
		ROOM_AVAILABLE(PLAYER2,LAIR,1,1)
		ROOM_AVAILABLE(PLAYER2,TEMPLE,1,1)
		ROOM_AVAILABLE(PLAYER2,GRAVEYARD,1,1)

	REM Spells
		
		MAGIC_AVAILABLE(PLAYER2,POWER_HAND,1,1)
		MAGIC_AVAILABLE(PLAYER2,POWER_IMP,1,1)
		MAGIC_AVAILABLE(PLAYER2,POWER_SLAP,1,1)
		MAGIC_AVAILABLE(PLAYER2,POWER_SIGHT,1,1)
		MAGIC_AVAILABLE(PLAYER2,POWER_CALL_TO_ARMS,1,1)
		MAGIC_AVAILABLE(PLAYER2,POWER_CAVE_IN,1,1)
		MAGIC_AVAILABLE(PLAYER2,POWER_HEAL_CREATURE,1,1)
		MAGIC_AVAILABLE(PLAYER2,POWER_HOLD_AUDIENCE,1,0)
		MAGIC_AVAILABLE(PLAYER2,POWER_LIGHTNING,1,1)
		MAGIC_AVAILABLE(PLAYER2,POWER_CONCEAL,1,1)
		MAGIC_AVAILABLE(PLAYER2,POWER_PROTECT,1,1)
		MAGIC_AVAILABLE(PLAYER3,POWER_SPEED,1,1)

	REM  doors & traps

		REM DOOR_AVAILABLE(PLAYER2,WOODEN,1,3)
		DOOR_AVAILABLE(PLAYER2,WOOD,1,3)
		DOOR_AVAILABLE(PLAYER2,BRACED,1,3)
		DOOR_AVAILABLE(PLAYER2,STEEL,1,3)
		DOOR_AVAILABLE(PLAYER2,MAGIC,1,3)
		TRAP_AVAILABLE(PLAYER2,BOULDER,1,3)
		TRAP_AVAILABLE(PLAYER2,POISON_GAS,1,3)

	REM Creature_Availability
		CREATURE_AVAILABLE(PLAYER3,TROLL,1,1)
		CREATURE_AVAILABLE(PLAYER3,DEMONSPAWN,1,1)
		CREATURE_AVAILABLE(PLAYER3,FLY,1,1)
		CREATURE_AVAILABLE(PLAYER3,DARK_MISTRESS,1,1)
		CREATURE_AVAILABLE(PLAYER3,SORCEROR,1,1)
		CREATURE_AVAILABLE(PLAYER3,BILE_DEMON,1,0)
		CREATURE_AVAILABLE(PLAYER3,BUG,1,1)
		CREATURE_AVAILABLE(PLAYER3,VAMPIRE,1,0)
		CREATURE_AVAILABLE(PLAYER3,SPIDER,1,1)
		CREATURE_AVAILABLE(PLAYER3,HELL_HOUND,1,1)
		CREATURE_AVAILABLE(PLAYER3,DRAGON,1,1)


	REM Room_Availability
		ROOM_AVAILABLE(PLAYER3,TREASURE,1,1)
		ROOM_AVAILABLE(PLAYER3,PRISON,1,1)
		ROOM_AVAILABLE(PLAYER3,RESEARCH,1,1)
		ROOM_AVAILABLE(PLAYER3,PRISON,1,1)
		ROOM_AVAILABLE(PLAYER3,TORTURE,1,1)
		ROOM_AVAILABLE(PLAYER3,TRAINING,1,1)
		ROOM_AVAILABLE(PLAYER3,WORKSHOP,1,1)
		ROOM_AVAILABLE(PLAYER3,BARRACKS,1,1)
		ROOM_AVAILABLE(PLAYER3,GARDEN,1,1)
		ROOM_AVAILABLE(PLAYER3,LAIR,1,1)
		ROOM_AVAILABLE(PLAYER3,TEMPLE,1,1)
		ROOM_AVAILABLE(PLAYER3,GRAVEYARD,1,1)

	REM Spells
		
		MAGIC_AVAILABLE(PLAYER3,POWER_HAND,1,1)
		MAGIC_AVAILABLE(PLAYER3,POWER_IMP,1,1)
		MAGIC_AVAILABLE(PLAYER3,POWER_SLAP,1,1)
		MAGIC_AVAILABLE(PLAYER3,POWER_SIGHT,1,1)
		MAGIC_AVAILABLE(PLAYER3,POWER_CALL_TO_ARMS,1,1)
		MAGIC_AVAILABLE(PLAYER3,POWER_CAVE_IN,1,1)
		MAGIC_AVAILABLE(PLAYER3,POWER_HEAL_CREATURE,1,1)
		MAGIC_AVAILABLE(PLAYER3,POWER_HOLD_AUDIENCE,1,0)
		MAGIC_AVAILABLE(PLAYER3,POWER_LIGHTNING,1,1)
		MAGIC_AVAILABLE(PLAYER3,POWER_CONCEAL,1,1)
		MAGIC_AVAILABLE(PLAYER3,POWER_PROTECT,1,1)
		MAGIC_AVAILABLE(PLAYER3,POWER_SPEED,1,1)

	REM  doors & traps

		REM DOOR_AVAILABLE(PLAYER3,WOODEN,1,3)
		DOOR_AVAILABLE(PLAYER3,WOOD,1,3)
		DOOR_AVAILABLE(PLAYER3,BRACED,1,3)
		DOOR_AVAILABLE(PLAYER3,STEEL,1,3)
		DOOR_AVAILABLE(PLAYER3,MAGIC,1,3)
		TRAP_AVAILABLE(PLAYER3,BOULDER,1,3)
		TRAP_AVAILABLE(PLAYER3,POISON_GAS,1,3)

REM Player_Good

		CREATURE_AVAILABLE(PLAYER_GOOD,WIZARD,1,1)
		CREATURE_AVAILABLE(PLAYER_GOOD,BARBARIAN,1,1)
		CREATURE_AVAILABLE(PLAYER_GOOD,ARCHER,1,1)                                         
		CREATURE_AVAILABLE(PLAYER_GOOD,DWARFA,1,1)
		CREATURE_AVAILABLE(PLAYER_GOOD,KNIGHT,1,1) 
		CREATURE_AVAILABLE(PLAYER_GOOD,TUNNELLER,1,1)
		CREATURE_AVAILABLE(PLAYER_GOOD,WITCH,1,1)
		CREATURE_AVAILABLE(PLAYER_GOOD,GIANT,1,1)
		CREATURE_AVAILABLE(PLAYER_GOOD,FAIRY,1,1)
		CREATURE_AVAILABLE(PLAYER_GOOD,THIEF,1,1)


	
REM		---------------------------------------------------------------------------------------
	

REM Game Procedure

REM CREATE_PARTY(ONE)
	REM ADD_TO_PARTY(ONE,THIEF,0,250)
	REM ADD_TO_PARTY(ONE,THIEF,0,250)
	REM ADD_TO_PARTY(ONE,THIEF,0,250)
	REM ADD_TO_PARTY(ONE,THIEF,0,250)

REM Counting originally started from 0, so the experience levels of these creatures were originally 1 lower than those given here. They were also missing the last 2 paramaters.

CREATE_PARTY(ONE)
	ADD_TO_PARTY(ONE,THIEF,1,250,STEAL_GOLD,0)
	ADD_TO_PARTY(ONE,THIEF,1,250,STEAL_GOLD,0)
	ADD_TO_PARTY(ONE,THIEF,1,250,STEAL_GOLD,0)
	ADD_TO_PARTY(ONE,THIEF,1,250,STEAL_GOLD,0)

CREATE_PARTY(TWO)
	ADD_TO_PARTY(TWO,ARCHER,1,300,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,ARCHER,1,300,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,ARCHER,1,300,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,ARCHER,1,300,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,ARCHER,1,300,ATTACK_ENEMIES,0)


CREATE_PARTY(THREE)
	ADD_TO_PARTY(THREE,DWARFA,2,300,STEAL_GOLD,0)
	ADD_TO_PARTY(THREE,DWARFA,2,300,STEAL_GOLD,0)
	ADD_TO_PARTY(THREE,DWARFA,2,300,STEAL_GOLD,0)
	ADD_TO_PARTY(THREE,WIZARD,3,600,DEFEND_PARTY,0)

CREATE_PARTY(FOUR)
	ADD_TO_PARTY(FOUR,BARBARIAN,2,450,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,BARBARIAN,2,450,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,FAIRY,3,500,DEFEND_PARTY,0)
	ADD_TO_PARTY(FOUR,FAIRY,3,500,DEFEND_PARTY,0)

CREATE_PARTY(FIVE)
	ADD_TO_PARTY(FIVE,WITCH,4,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIVE,WITCH,4,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIVE,WITCH,4,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIVE,WITCH,4,1000,ATTACK_ENEMIES,0)

CREATE_PARTY(SIX)
	ADD_TO_PARTY(SIX,BARBARIAN,5,1250,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SIX,BARBARIAN,5,1250,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SIX,WIZARD,5,1000,DEFEND_PARTY,0)
	ADD_TO_PARTY(SIX,WIZARD,5,1000,DEFEND_PARTY,0)

CREATE_PARTY(SEVEN)
	ADD_TO_PARTY(SEVEN,FAIRY,6,1500,DEFEND_PARTY,0)
	ADD_TO_PARTY(SEVEN,FAIRY,6,1500,DEFEND_PARTY,0)
	ADD_TO_PARTY(SEVEN,KNIGHT,7,2000,ATTACK_DUNGEON_HEART,0)




IF(PLAYER0,RESEARCH >= 15000)
	MAGIC_AVAILABLE(PLAYER0,POWER_HOLD_AUDIENCE,1,1)
ENDIF

IF(PLAYER1,RESEARCH >= 15000)
	MAGIC_AVAILABLE(PLAYER1,POWER_HOLD_AUDIENCE,1,1)
ENDIF

IF(PLAYER2,RESEARCH >= 15000)
	MAGIC_AVAILABLE(PLAYER2,POWER_HOLD_AUDIENCE,1,1)
ENDIF

IF(PLAYER3,RESEARCH >= 15000)
	MAGIC_AVAILABLE(PLAYER3,POWER_HOLD_AUDIENCE,1,1)
ENDIF

IF(PLAYER0,BATTLES_WON >= 20)
	CREATURE_AVAILABLE(PLAYER0,BILE_DEMON,1,1)
	CREATURE_AVAILABLE(PLAYER0,VAMPIRE,1,1)
ENDIF

IF(PLAYER1,BATTLES_WON >= 20)
	CREATURE_AVAILABLE(PLAYER1,BILE_DEMON,1,1)
	CREATURE_AVAILABLE(PLAYER1,VAMPIRE,1,1)
ENDIF

IF(PLAYER2,BATTLES_WON >= 20)
	CREATURE_AVAILABLE(PLAYER2,BILE_DEMON,1,1)
	CREATURE_AVAILABLE(PLAYER2,VAMPIRE,1,1)
ENDIF

IF(PLAYER3,BATTLES_WON >= 20)
	CREATURE_AVAILABLE(PLAYER3,BILE_DEMON,1,1)
	CREATURE_AVAILABLE(PLAYER3,VAMPIRE,1,1)
ENDIF

SET_TIMER(PLAYER_GOOD,TIMER0)
IF_ACTION_POINT(1,ALL_PLAYERS)
	IF(PLAYER_GOOD,TIMER0 >= 6500)
	REM MESSAGE("TIMER1")
	REM ADD_TUNNELLER_TO_LEVEL(PLAYER_GOOD,PLAYER_GOOD,DUNGEON,0,0,250)
	ADD_TUNNELLER_TO_LEVEL(PLAYER_GOOD,2,DUNGEON,0,1,250)
	REM ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,PLAYER_GOOD,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,2,1)
	REM MESSAGE(TUNN+HERO")
		IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
		REM MESSAGE("NO HEROES")
		SET_FLAG(PLAYER_GOOD,FLAG0,1)
		REM MESSAGE("FLAG0 =1")
			IF(PLAYER_GOOD,FLAG0 <= 1)
			REM MESSAGE("FLAG FOUND")
			REM ADD_TUNNELLER_TO_LEVEL([PLAYER_GOOD,PLAYER_GOOD,DUNGEON,0,1,300)
			ADD_TUNNELLER_TO_LEVEL([PLAYER_GOOD,2,DUNGEON,0,2,300)
			REM ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,PLAYER_GOOD,1)
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,2,1)
			REM MESSAGE("TUNN+HEROTWO")
			SET_FLAG(PLAYER_GOOD,FLAG0,2)
			REM MESSAGE("SET FLAG0 =2")
			ENDIF
		ENDIF
	ENDIF
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 20000)
REM MESSAGE("TIMER T0 20000")
	IF(PLAYER_GOOD,FLAG0 == 2)
	REM MESSAGE("PHASE 2")
	REM ADD_TUNNELLER_TO_LEVEL(PLAYER_GOOD,PLAYER_GOOD,DUNGEON,0,2,500)
	ADD_TUNNELLER_TO_LEVEL(PLAYER_GOOD,2,DUNGEON,0,3,500)
	REM ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,PLAYER_GOOD,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,2,1)
		IF(PLAYER_GOOD,TOTAL_CREATURES <= 1)
		REM ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,PLAYER_GOOD,1)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,2,1)
			IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
				SET_FLAG(PLAYER_GOOD,FLAG0,3)
			ENDIF
		ENDIF
	ENDIF
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 30000)
REM MESSAGE("TIMER TO 30000")
	IF(PLAYER_GOOD,FLAG0 == 3)
	REM MESSAGE("PHASE 3")
	REM ADD_TUNNELLER_TO_LEVEL(PLAYER_GOOD,PLAYER_GOOD,DUNGEON,0,3,650)
	ADD_TUNNELLER_TO_LEVEL(PLAYER_GOOD,2,DUNGEON,0,4,650)
	REM ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIVE,PLAYER_GOOD,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIVE,2,1)
		IF(PLAYER_GOOD,TOTAL_CREATURES <= 2)
		REM ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SIX,PLAYER_GOOD,1)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SIX,2,1)
			IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
				SET_FLAG(PLAYER_GOOD,FLAG0,4)
			ENDIF
		ENDIF
	ENDIF
ENDIF

IF(PLAYER_GOOD,FLAG0 == 4)
REM MESSAGE("PHASE 4")
	SET_TIMER(PLAYER_GOOD,TIMER1)
	IF(PLAYER_GOOD,TIMER1 >= 3400)
		REM ADD_TUNNELLER_TO_LEVEL(PLAYER_GOOD,PLAYER_GOOD,DUNGEON,0,4,600)
		NEXT_COMMAND_REUSABLE
		ADD_TUNNELLER_TO_LEVEL(PLAYER_GOOD,2,DUNGEON,0,5,600)
		REM ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SIX,PLAYER_GOOD,1)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SIX,2,1)
		NEXT_COMMAND_REUSABLE
		SET_TIMER(PLAYER_GOOD,TIMER1)
	ENDIF
	IF(PLAYER1,DUNGEON_DESTROYED == 1)
		IF(PLAYER2,DUNGEON_DESTROYED == 1)
			IF(PLAYER3,DUNGEON_DESTROYED == 1)
				REM ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SEVEN,PLAYER_GOOD,1)
				ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SEVEN,2,1)
                    			REM SET_TIMER(PLAYER_GOOD,TIMER2)
                    			REM IF(PLAYER_GOOD,TIMER2 >= 100)
					IF(PLAYER_GOOD,KNIGHT == 0)
						IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
							WIN_GAME
						ENDIF
					ENDIF
				REM ENDIF
			ENDIF
		ENDIF
	ENDIF
ENDIF
					

			