REM	Level Name : Reaver Verrukt 1.53.0
REM	Author: Duke Ragereaver, Created on 05 Mar 2011
REM	v 2.0 additional messages and conversion to pot file usage by dayokay Dec2020

COMPUTER_PLAYER(PLAYER1,7)
COMPUTER_PLAYER(PLAYER2,0)

ALLY_PLAYERS(PLAYER0,PLAYER1)
ALLY_PLAYERS(PLAYER2,PLAYER_GOOD)

START_MONEY(PLAYER0,10000)
START_MONEY(PLAYER1,200000)
START_MONEY(PLAYER2,100000)

SET_GENERATE_SPEED(650)
ADD_CREATURE_TO_POOL(TROLL,15)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,30)
ADD_CREATURE_TO_POOL(BILE_DEMON,15)
ADD_CREATURE_TO_POOL(ORC,30)
ADD_CREATURE_TO_POOL(DRAGON,9)
ADD_CREATURE_TO_POOL(TENTACLE,20)
ADD_CREATURE_TO_POOL(HELL_HOUND,15)
ADD_CREATURE_TO_POOL(GHOST,3)
ADD_CREATURE_TO_POOL(FLY,3)
ADD_CREATURE_TO_POOL(ARCHER,4)
ADD_CREATURE_TO_POOL(BARBARIAN,4)
ADD_CREATURE_TO_POOL(THIEF,5)
ADD_CREATURE_TO_POOL(DWARFA,5)
ADD_CREATURE_TO_POOL(MONK,2)
ADD_CREATURE_TO_POOL(KNIGHT,2)
ADD_CREATURE_TO_POOL(FAIRY,2)
ADD_CREATURE_TO_POOL(GIANT,2)
ADD_CREATURE_TO_POOL(SORCEROR,4)

MAX_CREATURES(PLAYER0,1)
MAX_CREATURES(PLAYER1,15)
MAX_CREATURES(PLAYER2,32)


REM Blue Keeper

CREATURE_AVAILABLE(PLAYER1,ARCHER,1,1)
CREATURE_AVAILABLE(PLAYER1,BARBARIAN,1,1)
CREATURE_AVAILABLE(PLAYER1,DWARFA,1,1)
CREATURE_AVAILABLE(PLAYER1,MONK,1,1)
CREATURE_AVAILABLE(PLAYER1,THIEF,1,1)
CREATURE_AVAILABLE(PLAYER1,KNIGHT,1,1)
CREATURE_AVAILABLE(PLAYER1,GIANT,1,1)
CREATURE_AVAILABLE(PLAYER1,FAIRY,1,1)

SET_CREATURE_MAX_LEVEL(PLAYER1,ARCHER,7)
SET_CREATURE_MAX_LEVEL(PLAYER1,BARBARIAN,7)
SET_CREATURE_MAX_LEVEL(PLAYER1,DWARFA,7)
SET_CREATURE_MAX_LEVEL(PLAYER1,MONK,7)
SET_CREATURE_MAX_LEVEL(PLAYER1,KNIGHT,7)
SET_CREATURE_MAX_LEVEL(PLAYER1,THIEF,7)
SET_CREATURE_MAX_LEVEL(PLAYER1,FAIRY,7)
SET_CREATURE_MAX_LEVEL(PLAYER1,GIANT,7)


REM Green Keeper

CREATURE_AVAILABLE(PLAYER2,TROLL,1,1)
CREATURE_AVAILABLE(PLAYER2,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(PLAYER2,ORC,1,1)
CREATURE_AVAILABLE(PLAYER2,DRAGON,1,1)
CREATURE_AVAILABLE(PLAYER2,BILE_DEMON,1,1)
CREATURE_AVAILABLE(PLAYER2,HELL_HOUND,1,1)
CREATURE_AVAILABLE(PLAYER2,TENTACLE,1,1)
CREATURE_AVAILABLE(PLAYER2,GHOST,1,1)
CREATURE_AVAILABLE(PLAYER2,FLY,1,1)
CREATURE_AVAILABLE(PLAYER2,SORCEROR,1,1)

ROOM_AVAILABLE(PLAYER2,LAIR,1,1)
ROOM_AVAILABLE(PLAYER2,TREASURE,1,1)
ROOM_AVAILABLE(PLAYER2,RESEARCH,1,1)
ROOM_AVAILABLE(PLAYER2,TRAINING,1,1)
ROOM_AVAILABLE(PLAYER2,GARDEN,1,1)
ROOM_AVAILABLE(PLAYER2,TORTURE,1,0)
ROOM_AVAILABLE(PLAYER2,BARRACKS,1,0)
ROOM_AVAILABLE(PLAYER2,TEMPLE,1,0)
ROOM_AVAILABLE(PLAYER2,SCAVENGER,1,0)

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(PLAYER1,POWER_IMP,1,1)
MAGIC_AVAILABLE(PLAYER2,POWER_IMP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SIGHT,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(PLAYER2,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_SPEED,1,0)
MAGIC_AVAILABLE(PLAYER2,POWER_SPEED,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_PROTECT,1,0)

DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
DOOR_AVAILABLE(PLAYER1,MAGIC,1,0)
DOOR_AVAILABLE(PLAYER2,MAGIC,1,0)

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

CREATE_PARTY(DOGS)
	ADD_TO_PARTY(DOGS,HELL_HOUND,5,600,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(DOGS,VAMPIRE,6,1000,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(DOGS,HELL_HOUND,4,600,DEFEND_PARTY,0)
	ADD_TO_PARTY(DOGS,HELL_HOUND,4,600,DEFEND_PARTY,0)
	ADD_TO_PARTY(DOGS,HELL_HOUND,5,600,ATTACK_ENEMIES,0)

CREATE_PARTY(Greyskulls)
	ADD_TO_PARTY(Greyskulls,SKELETON,6,700,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(Greyskulls,SKELETON,8,800,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(Greyskulls,SKELETON,7,700,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(Greyskulls,SKELETON,6,500,DEFEND_PARTY,0)
	ADD_TO_PARTY(Greyskulls,SKELETON,6,500,DEFEND_PARTY,0)
	ADD_TO_PARTY(Greyskulls,GHOST,8,600,STEAL_SPELLS,0)

CREATE_PARTY(FIRST_STRIKE)
	ADD_TO_PARTY(FIRST_STRIKE,BUG,4,200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIRST_STRIKE,SPIDER,5,200,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(FIRST_STRIKE,BUG,4,200,DEFEND_PARTY,0)
	ADD_TO_PARTY(FIRST_STRIKE,BUG,4,200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FIRST_STRIKE,BUG,4,200,ATTACK_ENEMIES,0)

CREATE_PARTY(SECOND_STRIKE)
	ADD_TO_PARTY(SECOND_STRIKE,HELL_HOUND,3,200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SECOND_STRIKE,SORCEROR,5,400,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(SECOND_STRIKE,DRAGON,4,500,DEFEND_PARTY,0)
	ADD_TO_PARTY(SECOND_STRIKE,HELL_HOUND,3,200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SECOND_STRIKE,HELL_HOUND,3,200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SECOND_STRIKE,BILE_DEMON,4,300,DEFEND_PARTY,0)

REM	"Noble one, a massive army serves a Keeper by the name of Urien in this realm. Many of your forces are currently locked in a battle in the west against Urien. While aiding them, do not let our ally down against Urien's advancing onslaught in the north."
DISPLAY_OBJECTIVE(30,PLAYER0)


IF(PLAYER0,TRAINING >= 1)
	SET_TIMER(PLAYER0,TIMER0)
ENDIF

IF(PLAYER0,TIMER0 >= 3500)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DOGS,1,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DOGS,5,1)
ENDIF

IF(PLAYER0,TIMER0 >= 6500)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DOGS,1,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DOGS,4,1)
ENDIF

IF_ACTION_POINT(3,PLAYER0)
	SET_TIMER(PLAYER0,TIMER1)
	SET_FLAG(PLAYER0,FLAG0,3)
ENDIF

IF(PLAYER0,TIMER1 >= 4750)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,Greyskulls,1,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,Greyskulls,2,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,Greyskulls,4,1)
ENDIF

IF_ACTION_POINT(8,PLAYER0)
	SET_FLAG(PLAYER0,FLAG0,1)
	SET_TIMER(PLAYER1,TIMER0)
ENDIF

IF(PLAYER0,FLAG0 == 1)
	IF(PLAYER1,TIMER0 >= 3000)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIRST_STRIKE,5,1)
		NEXT_COMMAND_REUSABLE
		SET_TIMER(PLAYER1,TIMER0)
	ENDIF
ENDIF


IF_ACTION_POINT(9,PLAYER0)
	SET_FLAG(PLAYER0,FLAG0,2)
ENDIF

IF(PLAYER0,FLAG0 == 2)
	IF(PLAYER1,TIMER0 >= 6750)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SECOND_STRIKE,4,1)
		ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DARK_MISTRESS,5,3,6,600)
		NEXT_COMMAND_REUSABLE
		SET_TIMER(PLAYER1,TIMER0)
	ENDIF
ENDIF

IF(PLAYER0,FLAG0 == 3)
	IF(PLAYER1,TIMER0 >= 15000)
		NEXT_COMMAND_REUSABLE
		ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,VAMPIRE,4,1,10,1500)
		NEXT_COMMAND_REUSABLE
		ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,VAMPIRE,5,1,10,1500)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,Greyskulls,4,1)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,Greyskulls,5,1)
		NEXT_COMMAND_REUSABLE
		SET_TIMER(PLAYER1,TIMER0)
	ENDIF
ENDIF

IF_ACTION_POINT(6,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SKELETON,7,6,10,400)
	DISPLAY_INFORMATION(34)
ENDIF


IF(PLAYER1,DUNGEON_DESTROYED == 1)
	DISPLAY_OBJECTIVE(31,PLAYER0)
	LOSE_GAME
ENDIF

IF(PLAYER0,KNIGHT == 0)
	DISPLAY_OBJECTIVE(32,PLAYER0)
	LOSE_GAME
ENDIF

IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
	SET_TIMER(PLAYER_GOOD,TIMER3)
	ROOM_AVAILABLE(PLAYER0,LAIR,1,1)
	ROOM_AVAILABLE(PLAYER0,TREASURE,1,1)
	ROOM_AVAILABLE(PLAYER0,RESEARCH,1,1)
	ROOM_AVAILABLE(PLAYER0,TRAINING,1,1)
	ROOM_AVAILABLE(PLAYER0,GARDEN,1,1)
	ROOM_AVAILABLE(PLAYER0,WORKSHOP,1,0)
	ROOM_AVAILABLE(PLAYER0,BARRACKS,1,0)
	ROOM_AVAILABLE(PLAYER0,TEMPLE,1,1)
	MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)
ENDIF
REM Stop the destroyed hero heart from breaking the aliance.
IF(PLAYER_GOOD,TIMER3 > 80)
	ALLY_PLAYERS(PLAYER2,PLAYER_GOOD)
ENDIF

IF(PLAYER2,DUNGEON_DESTROYED == 1)
	IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
		IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
			REM	"Well done noble one, Urien has fallen and our allies are still breathing."
			DISPLAY_OBJECTIVE(33,PLAYER1)
			WIN_GAME
		ENDIF
	ENDIF
ENDIF
