REM Batezek

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

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,10)
ADD_CREATURE_TO_POOL(FLY,5)
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,GARDEN,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,TORTURE,1,0)
ROOM_AVAILABLE(PLAYER0,TEMPLE,1,0)
ROOM_AVAILABLE(PLAYER0,GRAVEYARD,1,0)

TRAP_AVAILABLE(ALL_PLAYERS,ALARM,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,STEEL,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(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(PLAYER1,POWER_SIGHT,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SPEED,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CHICKEN,1,0)

CREATE_PARTY(ONE)
	ADD_TO_PARTY(ONE,THIEF,2,400,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(ONE,THIEF,2,400,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(ONE,ARCHER,2,400,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(ONE,ARCHER,2,400,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(TWO)
	ADD_TO_PARTY(TWO,ARCHER,2,600,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(TWO,ARCHER,2,600,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(TWO,DWARFA,2,600,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(TWO,DWARFA,2,600,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(TWO,DWARFA,2,600,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(TWO,DWARFA,2,600,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(THREE)
	ADD_TO_PARTY(THREE,BARBARIAN,3,500,STEAL_GOLD,0)
	ADD_TO_PARTY(THREE,BARBARIAN,3,500,STEAL_GOLD,0)
	ADD_TO_PARTY(THREE,BARBARIAN,3,500,STEAL_GOLD,0)	
	ADD_TO_PARTY(THREE,THIEF,3,500,STEAL_GOLD,0)
		
CREATE_PARTY(FOUR)
	ADD_TO_PARTY(FOUR,WITCH,3,550,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,WITCH,3,550,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,DWARFA,3,550,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,DWARFA,3,550,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,DWARFA,4,650,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FOUR,DWARFA,4,650,ATTACK_ENEMIES,0)

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

CREATE_PARTY(SIX)
	ADD_TO_PARTY(SIX,THIEF,4,500,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(SIX,THIEF,4,500,ATTACK_DUNGEON_HEART,0)	
	ADD_TO_PARTY(SIX,THIEF,4,500,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(SIX,THIEF,4,500,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(SIX,WIZARD,5,600,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(SIX,WIZARD,5,600,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(SEVEN)
	ADD_TO_PARTY(SEVEN,GIANT,5,1750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SEVEN,GIANT,5,1750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SEVEN,SAMURAI,5,1850,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SEVEN,SAMURAI,5,1850,ATTACK_ENEMIES,0)

CREATE_PARTY(DEFENDA)
	ADD_TO_PARTY(DEFENDA,ARCHER,5,800,ATTACK_ENEMIES,0)															
	ADD_TO_PARTY(DEFENDA,ARCHER,5,800,ATTACK_ENEMIES,0)	
	ADD_TO_PARTY(DEFENDA,ARCHER,5,800,ATTACK_ENEMIES,0)		
	ADD_TO_PARTY(DEFENDA,ARCHER,5,800,ATTACK_ENEMIES,0)		

CREATE_PARTY(DEFENDB)
	ADD_TO_PARTY(DEFENDB,ARCHER,6,900,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFENDB,ARCHER,6,900,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFENDB,WIZARD,7,920,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFENDB,WIZARD,7,920,ATTACK_ENEMIES,0)

CREATE_PARTY(DEFENDC)
	ADD_TO_PARTY(DEFENDC,ARCHER,7,900,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFENDC,ARCHER,7,900,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFENDC,ARCHER,7,900,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFENDC,ARCHER,7,900,ATTACK_ENEMIES,0)

CREATE_PARTY(DEFENDD)
	ADD_TO_PARTY(DEFENDD,ARCHER,7,900,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFENDD,ARCHER,7,900,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFENDD,WITCH,7,1100,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFENDD,WITCH,7,1100,ATTACK_ENEMIES,0)

CREATE_PARTY(KNIGHT)
	ADD_TO_PARTY(KNIGHT,BARBARIAN,9,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(KNIGHT,BARBARIAN,9,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(KNIGHT,BARBARIAN,9,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(KNIGHT,KNIGHT,10,5000,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(DEFENDER)
	ADD_TO_PARTY(DEFENDER,GIANT,8,1200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFENDER,GIANT,8,1200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFENDER,GIANT,8,1200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFENDER,GIANT,8,1200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DEFENDER,GIANT,8,1200,ATTACK_ENEMIES,0)

CREATE_PARTY(MISSIONA)
	ADD_TO_PARTY(MISSIONA,THIEF,9,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(MISSIONA,DWARFA,10,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(MISSIONA,THIEF,9,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(MISSIONA,DWARFA,10,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(MISSIONA,THIEF,9,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(MISSIONA,DWARFA,10,1500,ATTACK_ENEMIES,0)

CREATE_PARTY(MISSIONB)
	ADD_TO_PARTY(MISSIONB,BARBARIAN,9,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(MISSIONB,GIANT,10,1200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(MISSIONB,BARBARIAN,9,1700,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(MISSIONB,BARBARIAN,9,1700,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(MISSIONB,GIANT,10,2000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(MISSIONB,BARBARIAN,9,1500,ATTACK_ENEMIES,0)

CREATE_PARTY(MISSIONC)
	ADD_TO_PARTY(MISSIONC,SAMURAI,9,2000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(MISSIONC,SAMURAI,9,2000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(MISSIONC,SAMURAI,9,2000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(MISSIONC,SAMURAI,9,2000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(MISSIONC,SAMURAI,9,2000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(MISSIONC,WITCH,10,2200,ATTACK_ENEMIES,0)

DISPLAY_OBJECTIVE(909,PLAYER0)

SET_TIMER(PLAYER_GOOD,TIMER0)
SET_TIMER(PLAYER_GOOD,TIMER3)

IF(PLAYER_GOOD,TIMER0 >= 8000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,-1,DUNGEON,PLAYER0,1,250)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 11000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,-2,DUNGEON,PLAYER0,1,250)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 16000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,-3,DUNGEON,PLAYER0,1,250)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 19000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,-1,DUNGEON,PLAYER0,1,250)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 22000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,FIVE,-2,DUNGEON,PLAYER0,1,250)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 27000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,SIX,-3,DUNGEON,PLAYER0,1,250)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 30000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDA,-1,DUNGEON,PLAYER0,1,250)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 35000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDB,-3,DUNGEON,PLAYER0,1,250)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 38000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDC,-2,DUNGEON,PLAYER0,1,250)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 41000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDA,-1,DUNGEON,PLAYER0,1,250)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 45000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,-2,DUNGEON,PLAYER0,1,250)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,-2,DUNGEON,PLAYER0,1,250)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 49000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,FIVE,-3,DUNGEON,PLAYER0,1,250)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,-3,DUNGEON,PLAYER0,1,250)
ENDIF

IF_ACTION_POINT(1,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDA,-2,1)
ENDIF

IF_ACTION_POINT(2,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDB,-3,1)
ENDIF

IF_ACTION_POINT(3,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDC,4,1)
ENDIF

IF_ACTION_POINT(5,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDD,6,1)
ENDIF

IF_ACTION_POINT(7,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDD,-1,1)
ENDIF

IF_ACTION_POINT(8,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDER,-5,1)
	SET_TIMER(PLAYER_GOOD,TIMER1)
ENDIF

IF(PLAYER_GOOD,TIMER1 >= 5500)
	NEXT_COMMAND_REUSABLE
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SIX,-5,1)
	NEXT_COMMAND_REUSABLE
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SEVEN,-4,1)
	NEXT_COMMAND_REUSABLE
	SET_TIMER(PLAYER_GOOD,TIMER1)
ENDIF

IF_ACTION_POINT(9,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDB,-4,1)
ENDIF

IF_ACTION_POINT(10,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDER,11,1)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 60000)
	IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
		DISPLAY_OBJECTIVE(910,PLAYER0)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDER,-1,1)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDER,-3,1)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDER,-4,1)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDA,-4,1)
		SET_TIMER(PLAYER0,TIMER5)
		IF(PLAYER0,TIMER5 >= 500)
			ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,MISSIONA,1,DUNGEON,PLAYER0,5,500)
			ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,MISSIONB,2,DUNGEON,PLAYER0,5,500)
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MISSIONC,-2,1)
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MISSIONC,-3,1)
			IF(PLAYER0,TIMER5 >= 750)
				ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDER,-6,1)
				ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDD,-6,1)
				ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDB,-6,1)
				ADD_PARTY_TO_LEVEL(PLAYER_GOOD,KNIGHT,-6,1)
				IF(PLAYER_GOOD,KNIGHT == 0)
					WIN_GAME
				ENDIF
			ENDIF
		ENDIF
	ENDIF
ENDIF

IF(PLAYER_GOOD,TIMER3 >= 40000)
	SET_FLAG(PLAYER0,FLAG5,1)
ENDIF

IF_ACTION_POINT(12,PLAYER0)
	IF(PLAYER0,FLAG5 == 0)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDER,-4,1)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,-4,1)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,-4,1)
		SET_TIMER(PLAYER0,TIMER4)
		RESET_ACTION_POINT(12)
	ENDIF
ENDIF

IF_ACTION_POINT(12,PLAYER0)
	IF(PLAYER0,FLAG5 == 0)
		IF(PLAYER0,TIMER4 >= 750)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DEFENDER,-4,1)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,-4,1)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,-4,1)
			NEXT_COMMAND_REUSABLE
			SET_TIMER(PLAYER0,TIMER4)
			NEXT_COMMAND_REUSABLE
			RESET_ACTION_POINT(12)
		ENDIF
	ENDIF
ENDIF

IF(PLAYER0,GAME_TURN >= 30000)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,BARBARIAN,2,8,10,1000)
ENDIF

IF(PLAYER0,GAME_TURN >= 45000)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,MONK,2,8,8,1200)
ENDIF

IF(PLAYER0,SCAVENGER >= 1)
	ROOM_AVAILABLE(PLAYER0,SCAVENGER,1,1)
ENDIF

IF(PLAYER0,GRAVEYARD >= 1)
	ROOM_AVAILABLE(PLAYER0,GRAVEYARD,1,1)
ENDIF

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

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