REM ********************************************
REM *                                          *
REM *              Avenger D'Nerzel            *
REM *                                          *
REM ********************************************
SET_GENERATE_SPEED(500)

REM COMPUTER_PLAYER(PLAYER1,0)

MAX_CREATURES(PLAYER0,20)

START_MONEY(PLAYER0,10000)

ADD_CREATURE_TO_POOL(BUG,10)
ADD_CREATURE_TO_POOL(FLY,10)
ADD_CREATURE_TO_POOL(SPIDER,5)
ADD_CREATURE_TO_POOL(SORCEROR,30)
ADD_CREATURE_TO_POOL(DEMONSPAWN,20)
ADD_CREATURE_TO_POOL(DRAGON,20)
ADD_CREATURE_TO_POOL(TROLL,10)
ADD_CREATURE_TO_POOL(ORC,10)
ADD_CREATURE_TO_POOL(HELL_HOUND,10)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,10)
ADD_CREATURE_TO_POOL(BILE_DEMON,20)

CREATURE_AVAILABLE(ALL_PLAYERS,	BUG,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,	DEMONSPAWN,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,	DRAGON,	1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,	TROLL,	1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,	ORC,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,	HELL_HOUND,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,	DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,	BILE_DEMON,1,1)

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

DOOR_AVAILABLE(ALL_PLAYERS,WOOD,0,1)
DOOR_AVAILABLE(ALL_PLAYERS,BRACED,0,1)
DOOR_AVAILABLE(ALL_PLAYERS,STEEL,0,1)
DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,0,1)

TRAP_AVAILABLE(ALL_PLAYERS,BOULDER,0,1)
TRAP_AVAILABLE(ALL_PLAYERS,ALARM,0,1)
TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,0,1)
TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,0,1)
TRAP_AVAILABLE(ALL_PLAYERS,WORD_OF_POWER,0,1)
TRAP_AVAILABLE(ALL_PLAYERS,LAVA,0,1)

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_OBEY,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SIGHT,0,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_LIGHTNING,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_DISEASE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CHICKEN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DESTROY_WALLS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_ARMAGEDDON,1,0)

QUICK_OBJECTIVE(1,"Nerzel, the previous Keeper here, let himself get overrun by the heroes of this land. Hopefully, you'll fare much better.",PLAYER0)

REM CREATE_PARTY(PARTY1)

REM ADD_TO_PARTY(PARTY1,BARBARIAN,3,0,ATTACK_DUNGEON_HEART,0)
REM ADD_TO_PARTY(PARTY1,BARBARIAN,3,0,ATTACK_DUNGEON_HEART,0)
REM ADD_TO_PARTY(PARTY1,BARBARIAN,3,0,ATTACK_DUNGEON_HEART,0)
REM ADD_TO_PARTY(PARTY1,ARCHER,2,0,DEFEND_PARTY,0)
REM ADD_TO_PARTY(PARTY1,ARCHER,2,0,DEFEND_PARTY,0)

REM CREATE_PARTY(PARTY2)

REM ADD_TO_PARTY(PARTY2,KNIGHT,3,0,ATTACK_DUNGEON_HEART,0)
REM ADD_TO_PARTY(PARTY2,KNIGHT,3,0,ATTACK_DUNGEON_HEART,0)
REM ADD_TO_PARTY(PARTY2,KNIGHT,3,0,ATTACK_DUNGEON_HEART,0)
REM ADD_TO_PARTY(PARTY2,MONK,4,0,DEFEND_PARTY,0)
REM ADD_TO_PARTY(PARTY2,MONK,4,0,DEFEND_PARTY,0)

CREATE_PARTY(PARTY3)
ADD_TO_PARTY(PARTY3,KNIGHT,10,0,ATTACK_ENEMIES,0)
ADD_TO_PARTY(PARTY3,KNIGHT,10,0,ATTACK_ENEMIES,0)
ADD_TO_PARTY(PARTY3,MONK,10,0,DEFEND_PARTY,0)
ADD_TO_PARTY(PARTY3,MONK,10,0,DEFEND_PARTY,0)
ADD_TO_PARTY(PARTY3,MONK,10,0,DEFEND_PARTY,0)

SET_TIMER(PLAYER0,TIMER0)
SET_FLAG(PLAYER0,FLAG0,0)

IF(PLAYER0,TIMER0>5000)
	NEXT_COMMAND_REUSABLE
	SET_TIMER(PLAYER0,TIMER0)
	NEXT_COMMAND_REUSABLE
	RESET_ACTION_POINT(1)
	NEXT_COMMAND_REUSABLE
	SET_FLAG(PLAYER0,FLAG0,0)
ENDIF

IF_ACTION_POINT(1,PLAYER0)
	IF(PLAYER_GOOD,DUNGEON_DESTROYED==0)
		IF(PLAYER0,FLAG0==0)
			NEXT_COMMAND_REUSABLE
			SET_FLAG(PLAYER0,FLAG0,1)
			QUICK_OBJECTIVE(2,"Now you've done it. The heroes definitely know a Keeper is here.",PLAYER0)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,BARBARIAN,-1,3,3,0)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,ARCHER,-1,2,3,0)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,BARBARIAN,-2,3,3,0)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,MONK,-2,2,3,0)
		ENDIF
	ENDIF
ENDIF

IF_ACTION_POINT(2,PLAYER0)
	QUICK_OBJECTIVE(3,"To the north lies the hero castle. Tread carefully, Keeper. The castle is mightily reinforced and armed.",PLAYER0)
ENDIF

IF_ACTION_POINT(3,PLAYER0)
	QUICK_OBJECTIVE(4,"Lucky for you, the heroes didn't destroy these rooms. Unlucky for you, that probably means they know you're here.",PLAYER0)
ENDIF

IF_ACTION_POINT(4,PLAYER0)
	QUICK_OBJECTIVE(5,"Some of Nerzel's creatures still live, languishing in the heroes' prisons. They would likely be very grateful to be freed...",PLAYER0)
ENDIF

IF_ACTION_POINT(5,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,PARTY3,-3,1)
	QUICK_OBJECTIVE(6,"Congratulations, Keeper. I think you've finally gotten their attention.",PLAYER0)
ENDIF

IF(PLAYER_GOOD,DUNGEON_DESTROYED==1)

	WIN_GAME

ENDIF
