REM PLAY Level 28

SET_GENERATE_SPEED(800)

MAX_CREATURES(PLAYER0,60)

START_MONEY(PLAYER0,10000)

ADD_CREATURE_TO_POOL(TROLL,5)
ADD_CREATURE_TO_POOL(SORCEROR,3)
ADD_CREATURE_TO_POOL(BILE_DEMON,7)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,15)
ADD_CREATURE_TO_POOL(TENTACLE,15)
ADD_CREATURE_TO_POOL(HELL_HOUND,10)
ADD_CREATURE_TO_POOL(DRAGON,20)
ADD_CREATURE_TO_POOL(VAMPIRE,3)
ADD_CREATURE_TO_POOL(ORC,20)

		CREATURE_AVAILABLE(ALL_PLAYERS,TROLL,1,1)
		CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,1)
		CREATURE_AVAILABLE(ALL_PLAYERS,BILE_DEMON,1,1)
		CREATURE_AVAILABLE(ALL_PLAYERS,DARK_MISTRESS,1,1)
		CREATURE_AVAILABLE(ALL_PLAYERS,TENTACLE,1,1)
		CREATURE_AVAILABLE(ALL_PLAYERS,HELL_HOUND,1,1)
		CREATURE_AVAILABLE(ALL_PLAYERS,DRAGON,1,1)
		CREATURE_AVAILABLE(ALL_PLAYERS,VAMPIRE,1,1)
		CREATURE_AVAILABLE(ALL_PLAYERS,ORC,1,1)
			
	REM Room_Availability

		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,BARRACKS,1,0)
		ROOM_AVAILABLE(ALL_PLAYERS,GUARD_POST,1,0)
		ROOM_AVAILABLE(ALL_PLAYERS,BRIDGE,1,0)
		ROOM_AVAILABLE(ALL_PLAYERS,PRISON,1,0)
		ROOM_AVAILABLE(ALL_PLAYERS,TORTURE,1,0)
		ROOM_AVAILABLE(ALL_PLAYERS,SCAVENGER,1,0)
		ROOM_AVAILABLE(ALL_PLAYERS,TEMPLE,1,0)
		ROOM_AVAILABLE(ALL_PLAYERS,GRAVEYARD,1,0)
		

	REM Spells
		
		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_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_PROTECT,1,0)
		MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
		MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1,0)


	REM  doors & traps

		DOOR_AVAILABLE(ALL_PLAYERS,WOOD,1,0)
		TRAP_AVAILABLE(ALL_PLAYERS,ALARM,1,0)
		DOOR_AVAILABLE(ALL_PLAYERS,BRACED,1,0)
		TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,1,0)
		TRAP_AVAILABLE(ALL_PLAYERS,LAVA,1,0)
		DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
		TRAP_AVAILABLE(ALL_PLAYERS,BOULDER,1,0)
		DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,1,0)
		TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)
		TRAP_AVAILABLE(ALL_PLAYERS,WORD_OF_POWER,1,0)
		

	REM  research order	

								 

REM :::::::::::::::::::::::::::::::::::::::SCRIPT E BIT::::::::::::::::::::::::::::::::::::::::::::::

REM		Flag List
REM		player0,flag0			~ says which of the phases we're in



REM		List of action points

REM		ap1		~		entrance to hero dungeon
REM		ap2		~		
REM		ap3		~		
REM		AP4		~		
REM		ap5		~		
REM		ap6		~		

REM		Timer List

REM 	player_GOOD,timer0 	~	   gap after invading before you are crushed
REM		player0,timer1	~	   
REM		player0,timer2	~	   
REM		player0,timer3	~	   



rem CREATE_TEXT(0,127"THE GOOD FORCES OF THIS LAND LAY SLUMBERING, UNAWARE OF YOUR ARRIVAL. PLAN AN EARLY ATTACK ON THE HEROES CASTLE, DELAY TOO LONG, AND YOU WILL LOSE THE ADVANTAGE OF SURPRISE."
rem CREATE_TEXT(1,128"BEWARE, YOU MAY ENCOUNTER HERO PATROLS WHILST YOU EXPLORE THIS LAND. IT IS IMPERITIVE THAT NONE OF THEIR NUMBER ARE PERMITTED TO ESCAPE AND REVEAL YOUR PRESENCE.")
rem CREATE_TEXT(2,129"TIME IS RUNNING OUT. ATTACK AND DESTROY THE HEROES DUNGEON SOON, BEFORE MORE HELP CAN BE CALLED."
rem CREATE_TEXT(4,130"HERO RIENFORCEMENTS HAVE ARRIVED, FIGHT FOR YOUR LIFE.")
rem CREATE_TEXT(5,131"MAKE SURE THAT YOUR ASSAULT ON THE HERO CASTLE DEALS A FINAL BLOW TO THE HERO FORCES OF THE LAND. KILL ALL OF THE HEROES AND THEN DESTROY THE DUNGEON HEART.")

 DISPLAY_OBJECTIVE(127,PLAYER0)



CREATE_PARTY(ONE)
	ADD_TO_PARTY(ONE,THIEF,2,300,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,THIEF,2,300,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,THIEF,2,300,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,ARCHER,4,400,ATTACK_ENEMIES,0)

CREATE_PARTY(TWO)
	ADD_TO_PARTY(TWO,ARCHER,3,400,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,ARCHER,3,400,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,ARCHER,3,400,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,BARBARIAN,4,500,ATTACK_ENEMIES,0)

CREATE_PARTY(THREE)
	ADD_TO_PARTY(THREE,DWARFA,4,300,ATTACK_ROOMS,0)
	ADD_TO_PARTY(THREE,DWARFA,4,300,ATTACK_ROOMS,0)
	ADD_TO_PARTY(THREE,DWARFA,4,300,ATTACK_ROOMS,0)
	ADD_TO_PARTY(THREE,DWARFA,4,300,ATTACK_ROOMS,0)
	ADD_TO_PARTY(THREE,DWARFA,4,300,ATTACK_ROOMS,0)


CREATE_PARTY(FOUR)
	ADD_TO_PARTY(FOUR,WITCH,5,750,STEAL_SPELLS,0)
	ADD_TO_PARTY(FOUR,WITCH,5,750,STEAL_SPELLS,0)
	ADD_TO_PARTY(FOUR,WITCH,5,750,STEAL_SPELLS,0)
	ADD_TO_PARTY(FOUR,THIEF,5,500,STEAL_GOLD,0)

CREATE_PARTY(FIVE)
	ADD_TO_PARTY(FIVE,BARBARIAN,5,1000,DEFEND_PARTY,0)
	ADD_TO_PARTY(FIVE,FAIRY,5,1000,STEAL_SPELLS,0)
	ADD_TO_PARTY(FIVE,BARBARIAN,5,1000,DEFEND_PARTY,0)
	ADD_TO_PARTY(FIVE,FAIRY,5,1000,STEAL_SPELLS,0)
	ADD_TO_PARTY(FIVE,BARBARIAN,5,1000,DEFEND_PARTY,0)
	ADD_TO_PARTY(FIVE,FAIRY,7,1000,STEAL_SPELLS,0)


CREATE_PARTY(FINALONE)
	ADD_TO_PARTY(FINALONE,BARBARIAN,5,1000,DEFEND_PARTY,0)
	ADD_TO_PARTY(FINALONE,GIANT,7,1500,DEFEND_PARTY,0)
	ADD_TO_PARTY(FINALONE,BARBARIAN,5,1000,DEFEND_PARTY,0)
	ADD_TO_PARTY(FINALONE,GIANT,7,1500,DEFEND_PARTY,0)
	ADD_TO_PARTY(FINALONE,FAIRY,7,1500,DEFEND_PARTY,0)
	ADD_TO_PARTY(FINALONE,FAIRY,7,1500,DEFEND_PARTY,0)

CREATE_PARTY(FINAL)
	ADD_TO_PARTY(FINAL,FAIRY,9,1200,DEFEND_PARTY,0)
	ADD_TO_PARTY(FINAL,FAIRY,9,1200,DEFEND_PARTY,0)
	ADD_TO_PARTY(FINAL,FAIRY,9,1200,DEFEND_PARTY,0)
	ADD_TO_PARTY(FINAL,FAIRY,9,1200,DEFEND_PARTY,0)
	ADD_TO_PARTY(FINAL,FAIRY,6,1200,DEFEND_PARTY,0)
	ADD_TO_PARTY(FINAL,FAIRY,6,1200,DEFEND_PARTY,0)
	ADD_TO_PARTY(FINAL,KNIGHT,7,1200,DEFEND_PARTY,0)

CREATE_PARTY(ARCHER)
	ADD_TO_PARTY(ONE,ARCHER,6,400,ATTACK_ENEMIES,0)


IF(PLAYER0,TOTAL_GOLD_MINED >= 12000)
	DISPLAY_INFORMATION(128,PLAYER0)
ENDIF

IF(PLAYER0,TOTAL_GOLD_MINED >= 15000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,-1,DUNGEON,0,2,250)
ENDIF

IF(PLAYER0,TOTAL_GOLD_MINED >= 25000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,-2,DUNGEON,0,3,250)
	SET_TIMER(PLAYER_GOOD,TIMER6)
		IF(PLAYER_GOOD,TIMER6 >= 5000)
		ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,-2,DUNGEON,0,4,300)
		ENDIF
ENDIF

IF(PLAYER0,TOTAL_GOLD_MINED >= 35000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,-2,DUNGEON,0,5,250)
	SET_TIMER(PLAYER_GOOD,TIMER7)
		IF(PLAYER_GOOD,TIMER7 >= 1500)
		ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,-2,DUNGEON,0,6,250)
			IF(PLAYER_GOOD,DWARFA == 0)
			DISPLAY_INFORMATION(129,PLAYER0)
			SET_FLAG(PLAYER0,FLAG5,1)
			ENDIF
		ENDIF
ENDIF

IF(PLAYER0,FLAG5 == 1)
	SET_TIMER(PLAYER0,TIMER5)
ENDIF

CREATE_PARTY(TROOPA)
	ADD_TO_PARTY(TROOPA,ARCHER,3,200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPA,ARCHER,3,200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPA,ARCHER,3,200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPA,ARCHER,3,200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPA,ARCHER,3,200,ATTACK_ENEMIES,0)

CREATE_PARTY(TROOPB)
	ADD_TO_PARTY(TROOPB,THIEF,4,300,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPB,THIEF,4,300,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPB,THIEF,4,300,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPB,THIEF,4,300,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPB,ARCHER,4,300,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPB,ARCHER,4,300,ATTACK_ENEMIES,0)

CREATE_PARTY(TROOPC)
	ADD_TO_PARTY(TROOPC,WIZARD,4,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPC,WIZARD,4,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPC,WIZARD,4,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPC,WITCH,4,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPC,WITCH,4,500,ATTACK_ENEMIES,0)	
	ADD_TO_PARTY(TROOPC,WITCH,4,500,ATTACK_ENEMIES,0)

CREATE_PARTY(TROOPD)
	ADD_TO_PARTY(TROOPD,BARBARIAN,5,750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPD,BARBARIAN,5,750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPD,BARBARIAN,5,750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPD,BARBARIAN,5,750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPD,BARBARIAN,5,750,ATTACK_ENEMIES,0)

CREATE_PARTY(TROOPE)
	ADD_TO_PARTY(TROOPE,GIANT,8,1750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPE,GIANT,8,1750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPE,GIANT,8,1750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPE,GIANT,8,1750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPE,GIANT,8,1750,ATTACK_ENEMIES,0)

CREATE_PARTY(TROOPF)
	ADD_TO_PARTY(TROOPF,FAIRY,8,1750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPF,FAIRY,8,1750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPF,FAIRY,8,1750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPF,FAIRY,8,1750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPF,FAIRY,8,1750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TROOPF,FAIRY,8,1750,ATTACK_ENEMIES,0)



IF(PLAYER0,TIMER5 >= 5000)
	IF(PLAYER0,FLAG4 == 0)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,TROOPA,-1,DUNGEON,0,5,300)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,TROOPB,-2,DUNGEON,0,5,300)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,TROOPC,-1,DUNGEON,0,5,300)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,TROOPD,-2,DUNGEON,0,5,300)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,TROOPE,-1,DUNGEON,0,5,300)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,TROOPF,-2,DUNGEON,0,5,300)			
	ENDIF
ENDIF

IF_ACTION_POINT(1,PLAYER0)
	SET_FLAG(PLAYER0,FLAG4,1)
	DISPLAY_OBJECTIVE(131,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FINALONE,5,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FINAL,PLAYER_GOOD,1)
	SET_TIMER(PLAYER2,TIMER2)
	SET_FLAG(PLAYER2,FLAG0,2)
	SET_TIMER(PLAYER_GOOD,TIMER0)
		IF(PLAYER_GOOD,KNIGHT == 0)
			IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
			WIN_GAME
			SET_FLAG(PLAYER2,FLAG2,3)
			ENDIF
		ENDIF
ENDIF


IF(PLAYER2(FLAG2 == 2)
	IF(PLAYER2,TIMER2 >= 2500)
	NEXT_COMMAND_REUSABLE
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,PLAYER_GOOD,1)
	SET_TIMER(PLAYER2,TIMER2)
	ENDIF
ENDIF


IF(PLAYER_GOOD,TIMER0 >= 10000)
	DISPLAY_INFORMATION(130,PLAYER0)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,-1,DUNGEON,0,2,250)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,-1,DUNGEON,0,2,250)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,PLAYER_GOOD,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,PLAYER_GOOD,1)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,FIVE,-2,DUNGEON,0,2,250)
ENDIF

IF(PLAYER0,DUNGEON_DESTROYED == 1)
	LOSE_GAME
ENDIF


CREATE_PARTY(SIX)
	ADD_TO_PARTY(SIX,ARCHER,5,1250,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SIX,ARCHER,5,1250,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SIX,ARCHER,5,1250,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SIX,ARCHER,5,1250,ATTACK_ENEMIES,0)

CREATE_PARTY(SEVEN)
	ADD_TO_PARTY(SEVEN,BARBARIAN,7,2000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SEVEN,BARBARIAN,7,2000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SEVEN,BARBARIAN,7,2000,ATTACK_ENEMIES,0)

IF_ACTION_POINT(2,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SIX,-3,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SEVEN,-4,1)
ENDIF


IF_ACTION_POINT(3,PLAYER0)
	SET_TIMER(PLAYER0,TIMER4)
	IF(PLAYER0,TIMER4 >= 200)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SEVEN,4,1)
	ENDIF
ENDIF

IF_ACTION_POINT(6,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,ARCHER,6,6,6,500)
ENDIF

IF_ACTION_POINT(1,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,ARCHER,1,6,6,500)
ENDIF

IF_ACTION_POINT(7,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,THIEF,7,6,8,500)
ENDIF

IF_ACTION_POINT(2,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,ARCHER,2,4,4,500)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,ARCHER,2,4,6,500)
ENDIF

IF_ACTION_POINT(10,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,ARCHER,10,4,4,500)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,ARCHER,10,4,6,500)
ENDIF

IF_ACTION_POINT(5,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,WIZARD,5,7,8,500)
ENDIF

IF_ACTION_POINT(11,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,WIZARD,11,7,8,500)
ENDIF





























































































