REM ****************************************************
REM Fervent Asylum
REM
REM Assmist Isle Campaign by Kix
REM
REM v2.0 for DAT file objectives (by dayokay)
REM 17-Oct-2020
REM ****************************************************

LEVEL_VERSION(1)

REM aps:
REM 1 portal
REM 2 south gold pot room
REM 3 first library
REM 4 graveyard
REM 5,6 southwest rooms
REM 7 west hatchery
REM 8 west mine
REM 9 west lava pools
REM 10 east treasure room
REM 11  disease room
REM 12,13  destroy walls rewards
DOOR_AVAILABLE(PLAYER0,STEEL,1,5)
REVEAL_MAP_LOCATION(PLAYER0,12,15)
REVEAL_MAP_LOCATION(PLAYER0,13,15)

CREATE_PARTY(CLOSE1)
ADD_TO_PARTY(CLOSE1,BARBARIAN,2,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE1,GIANT,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE1,MONK,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE1,MONK,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE1,MONK,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE1,MONK,1,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(CLOSE2)
ADD_TO_PARTY(CLOSE2,BARBARIAN,2,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE2,GIANT,2,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE2,GIANT,2,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE2,MONK,2,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE2,MONK,3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE2,MONK,2,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE2,MONK,3,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(CLOSE3)
ADD_TO_PARTY(CLOSE3,MONK,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE3,MONK,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE3,MONK,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE3,MONK,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE3,GIANT,6,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE3,GIANT,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE3,GIANT,4,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(CLOSE4)
ADD_TO_PARTY(CLOSE4,DWARFA,6,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE4,MONK,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE4,MONK,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE4,MONK,5,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE4,GIANT,8,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE4,GIANT,8,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSE4,GIANT,9,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(INTRO1)
ADD_TO_PARTY(INTRO1,ARCHER,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(INTRO1,ARCHER,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(INTRO1,WIZARD,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(INTRO1,WIZARD,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(INTRO1,SAMURAI,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(INTRO1,DWARFA,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(INTRO1,BARBARIAN,1,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(INTRO2)
ADD_TO_PARTY(INTRO2,WITCH,3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(INTRO2,FAIRY,3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(INTRO2,FAIRY,3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(INTRO2,ARCHER,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(INTRO2,WIZARD,3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(INTRO2,SAMURAI,2,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(INTRO2,BARBARIAN,2,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(ONE)
ADD_TO_PARTY(ONE,MONK,3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(ONE,MONK,3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(ONE,ARCHER,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(ONE,ARCHER,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(ONE,SAMURAI,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(ONE,DWARFA,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(ONE,TENTACLE,5,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(TWO)
ADD_TO_PARTY(TWO,ARCHER,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(TWO,ARCHER,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(TWO,ARCHER,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(TWO,SAMURAI,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(TWO,GIANT,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(TWO,GIANT,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(TWO,WITCH,4,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(THREE)
ADD_TO_PARTY(THREE,HELL_HOUND,6,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(THREE,BARBARIAN,5,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(THREE,MONK,2,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(THREE,MONK,2,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(THREE,MONK,2,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(THREE,MONK,2,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(FOUR)
ADD_TO_PARTY(FOUR,THIEF,9,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FOUR,BARBARIAN,8,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FOUR,BARBARIAN,7,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FOUR,BARBARIAN,8,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FOUR,BARBARIAN,7,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FOUR,BARBARIAN,8,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(FIVE)
ADD_TO_PARTY(FIVE,THIEF,9,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FIVE,DWARFA,6,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FIVE,GIANT,8,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FIVE,BARBARIAN,8,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FIVE,BARBARIAN,8,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FIVE,DWARFA,8,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FIVE,GIANT,8,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(SIX)
ADD_TO_PARTY(SIX,WIZARD,9,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SIX,BARBARIAN,8,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SIX,BARBARIAN,8,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SIX,SAMURAI,6,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SIX,SAMURAI,6,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SIX,ARCHER,7,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SIX,ARCHER,7,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(SEVEN)
ADD_TO_PARTY(SEVEN,WIZARD,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SEVEN,WIZARD,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SEVEN,THIEF,9,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SEVEN,WITCH,8,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SEVEN,SAMURAI,8,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SEVEN,SAMURAI,9,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SEVEN,BARBARIAN,8,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(FIN)
ADD_TO_PARTY(FIN,WITCH,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FIN,WIZARD,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FIN,KNIGHT,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FIN,KNIGHT,10,0,ATTACK_DUNGEON_HEART,0))
ADD_TO_PARTY(FIN,AVATAR,10,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(SIDEKICK)
ADD_TO_PARTY(SIDEKICK,SAMURAI,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SIDEKICK,SAMURAI,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SIDEKICK,SAMURAI,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SIDEKICK,BARBARIAN,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SIDEKICK,BARBARIAN,10,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(CLOSEFINAL)
ADD_TO_PARTY(CLOSEFINAL,KNIGHT,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSEFINAL,KNIGHT,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSEFINAL,GIANT,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSEFINAL,GIANT,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSEFINAL,GIANT,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(CLOSEFINAL,GIANT,10,0,ATTACK_DUNGEON_HEART,0)

REM ********************************************
REM flags: flag0=barracks/archers FLAG1=hatchery/BILES flag2=library/WRLWIZ flag3=dragons
REM TODO ONE MORE HATCHERY MAYBE
REM	QUICK_OBJECTIVE(1,"Insufferable heat, lack of portals and the constant danger of being raided by heroes makes this dune treasury a truly forsaken place. Could it be the mysterious scavenger that attracts them?",1)
	DISPLAY_OBJECTIVE(112,1)
REM	QUICK_INFORMATION(3,"This eerie scavenger eye works different from portal or a scavenger room. It attracts creatures from other realms based on the rooms you own. Expanding and claiming those rooms results in summoning higher level creatures. (hint: so do not the sell rooms you claim) Barracks will summon archers, hatchery summons bile demons, library attracks warlocks along with wizards and dragons are attracted by various rooms you claim. The summoning only works if you have less than 30 (non-imp) units.",1)
	DISPLAY_INFORMATION(113,1)

IF(PLAYER0,BARRACKS>=9)
	ADD_TO_FLAG(PLAYER0,FLAG0,1)
	rem fanfare
	PLAY_MESSAGE(PLAYER0,SOUND,84)
ENDIF
IF(PLAYER0,BARRACKS>=18)
	ADD_TO_FLAG(PLAYER0,FLAG0,1)
	PLAY_MESSAGE(PLAYER0,SOUND,84)
ENDIF
IF(PLAYER0,BARRACKS>=27)
	ADD_TO_FLAG(PLAYER0,FLAG0,1)
	PLAY_MESSAGE(PLAYER0,SOUND,84)
	ADD_TO_FLAG(PLAYER0,FLAG3,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,DRAWFROM(5,6),2)
ENDIF
IF(PLAYER0,BARRACKS>=36)
	ADD_TO_FLAG(PLAYER0,FLAG0,1)
	PLAY_MESSAGE(PLAYER0,SOUND,84)
ENDIF

IF(PLAYER0,RESEARCH>=39)
	ADD_TO_FLAG(PLAYER0,FLAG2,1)
	PLAY_MESSAGE(PLAYER0,SOUND,84)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,INTRO1,2,3)
ENDIF
IF(PLAYER0,RESEARCH>=62)
	ADD_TO_FLAG(PLAYER0,FLAG2,1)
	PLAY_MESSAGE(PLAYER0,SOUND,84)
	ROOM_AVAILABLE(PLAYER0,BRIDGE,1,0)
	TUTORIAL_FLASH_BUTTON(18,150)
ENDIF
IF(PLAYER0,RESEARCH>=85)
	ADD_TO_FLAG(PLAYER0,FLAG2,1)
	PLAY_MESSAGE(PLAYER0,SOUND,84)
ENDIF

IF(PLAYER0,GARDEN>=71)
	ADD_TO_FLAG(PLAYER0,FLAG1,1)
	PLAY_MESSAGE(PLAYER0,SOUND,84)
ENDIF
IF(PLAYER0,GARDEN>=97)
	ADD_TO_FLAG(PLAYER0,FLAG1,1)
	PLAY_MESSAGE(PLAYER0,SOUND,84)
	ADD_TO_FLAG(PLAYER0,FLAG3,1)
ENDIF
IF(PLAYER0,GARDEN>=112)
	ADD_TO_FLAG(PLAYER0,FLAG1,1)
	ADD_TO_FLAG(PLAYER0,FLAG1,1)
	PLAY_MESSAGE(PLAYER0,SOUND,84)
ENDIF

SET_TIMER(PLAYER0,TIMER1)
IF(PLAYER0,TIMER1>3000)

	NEXT_COMMAND_REUSABLE
	SET_TIMER(PLAYER0,TIMER1)

	rem ***********************
	REM presence of avatar
	PLAY_MESSAGE(PLAYER0,SPEECH,107)
	REM	QUICK_INFORMATION(2,"One of the heroes' most dangerous insurgents paid a visit to this land. Recruit him and he'll serve you well...",12)
	DISPLAY_INFORMATION(114,12)
	REVEAL_MAP_LOCATION(PLAYER0,12,12)
	REVEAL_MAP_LOCATION(PLAYER0,13,12)

	IF(PLAYER0,IMP<5)
		NEXT_COMMAND_REUSABLE
		ADD_CREATURE_TO_LEVEL(PLAYER0,IMP,1,2,10,0)
	ENDIF

	IF(PLAYER0,TOTAL_CREATURES<30)
		rem magic
		NEXT_COMMAND_REUSABLE
		PLAY_MESSAGE(PLAYER0,SOUND,160)
		IF(PLAYER0,FLAG0==1)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER0,ARCHER,1,1,2,0)
		ENDIF
		IF(PLAYER0,FLAG0==2)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER0,ARCHER,1,1,4,0)
		ENDIF
		IF(PLAYER0,FLAG0==3)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER0,ARCHER,1,1,6,0)
			ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DWARFA,8,20,3,0)
		ENDIF
		IF(PLAYER0,FLAG0==4)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER0,ARCHER,1,1,9,0)
		ENDIF

		IF(PLAYER0,FLAG2==1)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER0,WIZARD,1,1,3,0)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER0,SORCEROR,1,1,3,0)
		ENDIF
		IF(PLAYER0,FLAG2==2)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER0,WIZARD,1,1,5,0)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER0,SORCEROR,1,1,5,0)
		ENDIF
		IF(PLAYER0,FLAG2==3)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER0,WIZARD,1,1,9,0)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER0,SORCEROR,1,1,9,0)
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SIX,9,2)
		ENDIF


		IF(PLAYER0,FLAG1==1)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER0,BILE_DEMON,1,1,1,0)
		ENDIF
		IF(PLAYER0,FLAG1==2)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER0,BILE_DEMON,1,1,3,0)
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,7,2)
		ENDIF
		IF(PLAYER0,FLAG1==3)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER0,BILE_DEMON,1,1,6,0)
		ENDIF`
		IF(PLAYER0,FLAG1==4)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER0,BILE_DEMON,1,1,9,0)
		ENDIF

		IF(PLAYER0,FLAG3==1)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER0,DRAGON,1,1,1,0)
		ENDIF
		IF(PLAYER0,FLAG3==2)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER0,DRAGON,1,1,4,0)
		ENDIF
		IF(PLAYER0,FLAG3==3)
			NEXT_COMMAND_REUSABLE
			ADD_CREATURE_TO_LEVEL(PLAYER0,DRAGON,1,1,8,0)
		ENDIF
	ENDIF`

	rem ***********************

IF(PLAYER_GOOD,DUNGEON_DESTROYED==0)
	IF(PLAYER0,BATTLES_WON<125)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,INTRO1,-2,1)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,CLOSE1,-1,1)
	ENDIF
	IF(PLAYER0,BATTLES_WON>=125)
	IF(PLAYER0,BATTLES_WON<250)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,INTRO2,-2,1)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,CLOSE2,-1,1)
		REM	QUICK_OBJECTIVE(4,"People of this land are sending their troops periodically. As they are still foolishly thinking you are outnumbered they prioritize mobilising their tougher parties to other realms. Find and destroy their dungeon heart before the offense becomes overwhelming and eliminate every foe to win this land.",ALL_PLAYERS)
	DISPLAY_OBJECTIVE(115,ALL_PLAYERS)
	ENDIF
	ENDIF
	IF(PLAYER0,BATTLES_WON>=250)
	IF(PLAYER0,BATTLES_WON<375)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,-2,1)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,CLOSE1,-1,1)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,CLOSE2,-1,1)
	REM	QUICK_INFORMATION(6,"Hint: the gold you have when you win will be transfered to the next realm by the mysterious scavenger.",ALL_PLAYERS)
		DISPLAY_INFORMATION(117,ALL_PLAYERS)
	REM	QUICK_INFORMATION(10,"Hint: steal all the workshops so the dwarven forces recede.",ALL_PLAYERS)
		DISPLAY_INFORMATION(118,ALL_PLAYERS)
	ENDIF
	ENDIF
	IF(PLAYER0,BATTLES_WON>=375)
	IF(PLAYER0,BATTLES_WON<450)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,-2,1)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,CLOSE2,-1,3)

		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,3,3)
		ADD_CREATURE_TO_LEVEL(PLAYER0,BARBARIAN,1,IMPORT(PLAYER0,CAMPAIGN_FLAG7),7,0)
		IF(PLAYER0,BARBARIAN>0)
		REM	QUICK_INFORMATION(8,"Look! The scavenger has summoned a few barbarians from Cloud Temple Ruins!",1)
			DISPLAY_INFORMATION(119,1)
		ENDIF
	ENDIF
	ENDIF
	IF(PLAYER0,BATTLES_WON>=450)
	IF(PLAYER0,BATTLES_WON<575)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,-2,3)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,CLOSE3,-1,1)
	ENDIF
	ENDIF
	IF(PLAYER0,BATTLES_WON>=575)
	IF(PLAYER0,BATTLES_WON<700)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,-2,2)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,CLOSE4,-1,2)
		ADD_TO_FLAG(PLAYER0,FLAG3,1)
	ENDIF
	ENDIF
	IF(PLAYER0,BATTLES_WON>=700)
	IF(PLAYER0,BATTLES_WON<825)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SIX,-2,2)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIVE,-1,2)
		ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,VAMPIRE,10,3,10,0)
	REM	QUICK_INFORMATION(5,"You finally caught their attention. They have begun sending their most forceful troops. Good luck.",ALL_PLAYERS)
		DISPLAY_INFORMATION(120,ALL_PLAYERS)
	ENDIF
	ENDIF
	IF(PLAYER0,BATTLES_WON>=825)
		SET_FLAG(PLAYER0,FLAG7,1)
	ENDIF
ENDIF
ENDIF

IF(PLAYER_GOOD,DUNGEON_DESTROYED==1)
	SET_FLAG(PLAYER0,FLAG7,1)
ENDIF

IF(PLAYER0,FLAG7>0)
REM	QUICK_OBJECTIVE(9,"Final group is here to finish you off. Wreck them. Eliminate every foe in this land to win.",PLAYER_GOOD)
	DISPLAY_OBJECTIVE(121,PLAYER_GOOD)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIN,-2,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SIDEKICK,-2,2)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,CLOSEFINAL,-1,2)
	IF(PLAYER_GOOD,WORKSHOP>0)
		ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DWARFA,1,12,10,0)
		ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DWARFA,-2,12,10,0)
	ENDIF
	IF(PLAYER_GOOD,TOTAL_CREATURES<1)
		SET_FLAG(PLAYER0,CAMPAIGN_FLAG3,0)
		EXPORT_VARIABLE(PLAYER0,MONEY,CAMPAIGN_FLAG3)
		REM	QUICK_OBJECTIVE(7,"The heat is unbearable, the land is devoid of its riches and all the good is dead. Excellent.",ALL_PLAYERS)
		DISPLAY_OBJECTIVE(122,ALL_PLAYERS)
		WIN_GAME
	ENDIF
ENDIF

IF_ACTION_POINT(11,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SEVEN,11,1)
ENDIF
