REM PLAY Level 132

SET_GENERATE_SPEED(500)
MAX_CREATURES(PLAYER0,20)
START_MONEY(PLAYER0,15000)


ADD_CREATURE_TO_POOL(HELL_HOUND,20)
ADD_CREATURE_TO_POOL(TENTACLE,20)
ADD_CREATURE_TO_POOL(SORCEROR,20)
ADD_CREATURE_TO_POOL(BILE_DEMON,20)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,20)
ADD_CREATURE_TO_POOL(DRAGON,20)
ADD_CREATURE_TO_POOL(VAMPIRE,20)
ADD_CREATURE_TO_POOL(ORC,20)
ADD_CREATURE_TO_POOL(BUG,20)
ADD_CREATURE_TO_POOL(FLY,20)
ADD_CREATURE_TO_POOL(SPIDER,20)
ADD_CREATURE_TO_POOL(TROLL,20)


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

ROOM_AVAILABLE(PLAYER0,TREASURE,1,1)
ROOM_AVAILABLE(PLAYER0,LAIR,1,1)

ROOM_AVAILABLE(PLAYER0,TRAINING,1,1)
ROOM_AVAILABLE(PLAYER0,RESEARCH,1,1)
ROOM_AVAILABLE(PLAYER0,WORKSHOP,1,0)
ROOM_AVAILABLE(PLAYER0,BARRACKS,1,0)
ROOM_AVAILABLE(PLAYER0,GUARD_POST,1,0)
ROOM_AVAILABLE(PLAYER0,PRISON,0,0)
ROOM_AVAILABLE(PLAYER0,TORTURE,1,0)
ROOM_AVAILABLE(PLAYER0,SCAVENGER,0,0)
ROOM_AVAILABLE(PLAYER0,TEMPLE,1,0)
ROOM_AVAILABLE(PLAYER0,GRAVEYARD,0,0)
ROOM_AVAILABLE(PLAYER0,BRIDGE,1,0)


TRAP_AVAILABLE(ALL_PLAYERS,ALARM,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)
		
MAGIC_AVAILABLE(PLAYER0,POWER_HAND,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_SLAP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_SPEED,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_LIGHTNING,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CONCEAL,1,0)




CREATE_PARTY(ONE)
	ADD_TO_PARTY(ONE,THIEF,2,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,THIEF,2,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,ARCHER,4,750,ATTACK_ENEMIES,0)		

CREATE_PARTY(TWO)
	ADD_TO_PARTY(TWO,ARCHER,4,750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,ARCHER,2,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,BARBARIAN,3,700,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(TWO,BARBARIAN,4,700,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(THREE)
	ADD_TO_PARTY(THREE,ARCHER,3,900,STEAL_GOLD,0)
	ADD_TO_PARTY(THREE,ARCHER,4,900,STEAL_GOLD,0)	
	ADD_TO_PARTY(THREE,ARCHER,5,900,STEAL_GOLD,0)
	ADD_TO_PARTY(THREE,ARCHER,5,900,STEAL_GOLD,0)
			
CREATE_PARTY(FOUR)
	ADD_TO_PARTY(FOUR,SAMURAI,2,550,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,SAMURAI,2,550,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,SAMURAI,3,750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,SAMURAI,4,950,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,SAMURAI,4,950,ATTACK_ENEMIES,0)

CREATE_PARTY(FIVE)
	ADD_TO_PARTY(FIVE,FAIRY,4,900,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIVE,FAIRY,4,900,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIVE,FAIRY,4,900,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIVE,FAIRY,4,900,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIVE,FAIRY,4,900,ATTACK_ENEMIES,0)

CREATE_PARTY(SIX)
	ADD_TO_PARTY(SIX,DWARFA,4,500,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(SIX,DWARFA,4,500,ATTACK_DUNGEON_HEART,0)	
	ADD_TO_PARTY(SIX,DWARFA,4,500,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(SIX,DWARFA,4,500,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(SIX,DWARFA,4,500,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(FINAL)
	ADD_TO_PARTY(FINAL,FAIRY,10,5000,attack_dungeon_heart,0)
	ADD_TO_PARTY(FINAL,FAIRY,8,800,DEFEND_PARTY,0)
	ADD_TO_PARTY(FINAL,FAIRY,8,800,DEFEND_PARTY,0)
	ADD_TO_PARTY(FINAL,FAIRY,8,800,DEFEND_PARTY,0)
	ADD_TO_PARTY(FINAL,FAIRY,8,800,DEFEND_PARTY,0)

CREATE_PARTY(DEFEND3)
	ADD_TO_PARTY(DEFEND3,ARCHER,7,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFEND3,ARCHER,7,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFEND3,ARCHER,7,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFEND3,ARCHER,7,1000,ATTACK_ENEMIES,0)

CREATE_PARTY(DEFEND4)
	ADD_TO_PARTY(DEFEND4,ARCHER,7,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFEND4,ARCHER,7,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFEND4,WITCH,7,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFEND4,WITCH,7,1500,ATTACK_ENEMIES,0)

CREATE_PARTY(DEFENDER)
	ADD_TO_PARTY(DEFENDER,GIANT,6,1800,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFENDER,GIANT,6,1800,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFENDER,GIANT,6,1800,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFENDER,GIANT,6,1800,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFENDER,GIANT,6,1800,ATTACK_ENEMIES,0)

CREATE_PARTY(WAITA)
	ADD_TO_PARTY(WAITA,DWARFA,5,750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITA,ARCHER,5,850,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITA,DWARFA,5,750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITA,DWARFA,5,750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITA,ARCHER,5,850,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITA,DWARFA,5,750,ATTACK_ENEMIES,0)

CREATE_PARTY(WAITB)
	ADD_TO_PARTY(WAITB,DWARFA,6,750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITB,ARCHER,6,850,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITB,ARCHER,6,750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITB,WIZARD,7,1250,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITB,ARCHER,6,850,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITB,WIZARD,7,1250,ATTACK_ENEMIES,0)

CREATE_PARTY(WAITC)
	ADD_TO_PARTY(WAITC,WIZARD,7,1550,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITC,WIZARD,7,1550,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITC,WITCH,7,1550,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITC,WITCH,7,1550,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITC,MONK,8,1850,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITC,MONK,8,1750,ATTACK_ENEMIES,0)

CREATE_PARTY(WAITD)
	ADD_TO_PARTY(WAITD,SAMURAI,6,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITD,SAMURAI,6,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITD,SAMURAI,6,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITD,SAMURAI,6,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITD,SAMURAI,6,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITD,SAMURAI,6,1000,ATTACK_ENEMIES,0)

CREATE_PARTY(WAITE)
	ADD_TO_PARTY(WAITE,SAMURAI,9,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITE,SAMURAI,9,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITE,SAMURAI,9,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITE,SAMURAI,9,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITE,SAMURAI,9,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITE,SAMURAI,9,1500,ATTACK_ENEMIES,0)

CREATE_PARTY(KNIGHT)
	ADD_TO_PARTY(KNIGHT,MONK,7,1000,DEFEND_PARTY,0)
	ADD_TO_PARTY(KNIGHT,GIANT,8,1250,DEFEND_PARTY,0)
	ADD_TO_PARTY(KNIGHT,SAMURAI,9,1000,DEFEND_PARTY,0)
	ADD_TO_PARTY(KNIGHT,SAMURAI,9,1000,DEFEND_PARTY,0)
	ADD_TO_PARTY(KNIGHT,SAMURAI,9,1000,DEFEND_PARTY,0)
	ADD_TO_PARTY(KNIGHT,archer,5,1000,ATTACK_DUNGEON_HEART,0)



DISPLAY_OBJECTIVE(918, PLAYER0)

SET_TIMER(PLAYER_GOOD,TIMER3)

IF(PLAYER_GOOD,TIMER3 >= 10000)			  
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,WAITA,15,DUNGEON,0,1,250)
ENDIF

IF(PLAYER_GOOD,TIMER3 >= 25000)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,WAITB,16,DUNGEON,0,1,250)
ENDIF

IF(PLAYER_GOOD,TIMER3 >= 30000)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,WAITC,17,DUNGEON,0,1,250)
ENDIF

IF(PLAYER_GOOD,TIMER3 >= 35000)
ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,WAITD,18,DUNGEON,0,1,250)
ENDIF

IF_ACTION_POINT(1,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,2,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,3,1)
	add_creature_to_level(player_good,archer,3,1,5,750)
ENDIF

IF_ACTION_POINT(2,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,4,1)
ENDIF

IF_ACTION_POINT(3,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,5,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,8,1)
ENDIF

IF_ACTION_POINT(4,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,6,1)
ENDIF

IF_ACTION_POINT(5,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,11,1)
	add_creature_to_level(player_good,samurai,11,1,5,650)
ENDIF


IF_ACTION_POINT(6,PLAYER0)
	IF(PLAYER_GOOD,FLAG0 == 0)
		ADD_PARTY_TO_LEVEL(PLAYER_GooD,FIVE,12,1)
		SET_FLAG(PLAYER_GOOD,FLAG0,1)
	ENDIF
ENDIF

IF_ACTION_POINT(11,PLAYER0)
	IF(PLAYER_GOOD,FLAG0 == 0)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIVE,12,1)
		SET_FLAG(PLAYER_GOOD,FLAG0,1)
	ENDIF
ENDIF

IF_ACTION_POINT(13,PLAYER0)
	SET_TIMER(PLAYER_GOOD,TIMER0)
		IF(PLAYER_GOOD,TIMER0 >= 250)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SIX,14,1)
		ENDIF
ENDIF

IF(PLAYER0,TIMER0 >= 45000)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDER,-3,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFEND4,-3,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FINAL,-3,1)
		IF(PLAYER_GOOD,KNIGHT == 0)
			WIN_GAME
		ENDIF
ENDIF


IF_ACTION_POINT(21,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WAITD,16,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDER,17,2)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,three,26,1)
		SET_TIMER(PLAYER_GOOD,TIMER5)
			IF(PLAYER_GOOD,TIMER5 >= 650)
				ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WAITC,PLAYER_GOOD,1)
				ADD_PARTY_TO_LEVEL(PLAYER_GOOD,KNIGHT-4,2)
					if(player_good,timer5 >= 1000)
					display_objective(919,player0)
					add_creature_to_level(player_good,avatar,23,1,10,100000)
					add_creature_to_level(player_good,knight,23,8,7,4000)
					add_party_to_level(player_good,wait3,23,1)
					add_party_to_level(player_good,wait3,-4,1)
						if(player_good,avatar == 0)
							IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
							WIN_GAME
							display_objective(172,player0)
						ENDIF
					ENDIF
			ENDIF
endif

IF_ACTION_POINT(22,PLAYER0)
	ROOM_AVAILABLE(PLAYER0,PRISON,1,1)
ENDIF

if_action_point(24,player0)
	if(Player_good,flag4 == 0)
	display_objective(921,player0)
	set_flag(Player_good,flag4,1)
	endif
endif

if_action_point(25,player0)
	if(Player_good,flag4 == 0)
	display_objective(921,player0)
	set_flag(player_good,flag4,1)
	endif
endif


if_action_point(13,player0)
	display_objective(920,player0)
endif
					
IF(PLAYER0,DUNGEON_DESTROYED == 1)
	LOSE_GAME
ENDIF

if(player0,vampire >= 1)
	DISPLAY_INFORMATION(908)
endif


if(player0,workshop >= 1)
	room_available(player0,workshop,1,1)
endif

if(player0,prison >= 1)
	room_available(player0,prison,1,1)
endif

if(player0,torture >= 1)
	room_available(player0,torture,1,1)
endif

if(player0,temple >= 1)
	room_available(player0,temple,1,1)
endif

if(player0,scavenger >= 1)
	room_available(player0,scavenger,1,1)
endif

if(player0,barracks >= 1)
	room_available(player0,workshop,1,1)
endif

