REM ****************************************************
REM Abandoned Sanctum
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 SET_CREATURE_MAX_LEVEL(ALL_PLAYERS,SKELETON,6)
rem SET_CREATURE_MAX_LEVEL(ALL_PLAYERS,VAMPIRE,6)
rem SET_CREATURE_MAX_LEVEL(ALL_PLAYERS,HELL_HOUND,6)
rem SET_CREATURE_MAX_LEVEL(ALL_PLAYERS,DEMONSPAWN,6)
rem SET_CREATURE_MAX_LEVEL(ALL_PLAYERS,TROLL,6)
rem SET_CREATURE_MAX_LEVEL(ALL_PLAYERS,SORCEROR,6)
rem SET_CREATURE_MAX_LEVEL(ALL_PLAYERS,ORC,6)
rem SET_CREATURE_MAX_LEVEL(ALL_PLAYERS,BILE_DEMON,6)
rem SET_CREATURE_MAX_LEVEL(ALL_PLAYERS,DARK_MISTRESS,6)
rem SET_CREATURE_MAX_LEVEL(ALL_PLAYERS,WIZARD,6)
rem SET_CREATURE_MAX_LEVEL(ALL_PLAYERS,BUG,6)
rem SET_CREATURE_MAX_LEVEL(ALL_PLAYERS,FLY,6)
rem SET_CREATURE_MAX_LEVEL(ALL_PLAYERS,SPIDER,6)

ROOM_AVAILABLE(ALL_PLAYERS,TREASURE,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,RESEARCH,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TORTURE,1,0)
IF(PLAYER0,PRISON>0)
	ROOM_AVAILABLE(PLAYER0,PRISON,1,0)
	TUTORIAL_FLASH_BUTTON(11,100)
ENDIF
IF(PLAYER0,TRAINING>0)
	ROOM_AVAILABLE(PLAYER0,TRAINING,1,0)
	TUTORIAL_FLASH_BUTTON(10,100)
ENDIF
IF(PLAYER0,DARK_MISTRESS>3)
	NEXT_COMMAND_REUSABLE
	CREATURE_AVAILABLE(ALL_PLAYERS,DARK_MISTRESS,0,0)
ENDIF
IF(PLAYER0,DARK_MISTRESS<4)
	NEXT_COMMAND_REUSABLE
	CREATURE_AVAILABLE(ALL_PLAYERS,DARK_MISTRESS,1,0)
ENDIF

START_MONEY(ALL_PLAYERS,10101)

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)

TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,BRACED,1,8)

ADD_CREATURE_TO_POOL(SORCEROR,​4)
ADD_CREATURE_TO_POOL(TROLL,​3)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,​3)
ADD_CREATURE_TO_POOL(ORC,3)
ADD_CREATURE_TO_POOL(DEMONSPAWN,​3)

CREATURE_AVAILABLE(ALL_PLAYERS,ORC,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,TROLL,1,0)
CREATURE_AVAILABLE(ALL_PLAYERS,DEMONSPAWN,1,0)
MAX_CREATURES(PLAYER0,39)

REVEAL_MAP_LOCATION(PLAYER0,3,25)
REVEAL_MAP_LOCATION(PLAYER0,4,15)
REVEAL_MAP_LOCATION(PLAYER0,5,25)
REVEAL_MAP_LOCATION(PLAYER0,6,25)
REVEAL_MAP_LOCATION(PLAYER0,7,5)

CREATE_PARTY(MIX1)
ADD_TO_PARTY(MIX1,DRAWFROM(BUG,FLY),1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(MIX1,DRAWFROM(BUG,FLY),1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(MIX1,DRAWFROM(BUG,FLY),1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(MIX1,DRAWFROM(BUG,SPIDER),1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(MIX1,SPIDER,2,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(BGS1)
ADD_TO_PARTY(BGS1,SPIDER,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BGS1,SPIDER,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BGS1,SPIDER,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BGS1,BUG,2,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BGS1,BUG,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BGS1,BUG,1,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(FLY1)
ADD_TO_PARTY(FLY1,FLY,2,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FLY1,FLY,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FLY1,FLY,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FLY1,FLY,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FLY1,FLY,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FLY1,FLY,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FLY1,FLY,1,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(MIX2)
ADD_TO_PARTY(MIX2,DRAWFROM(BUG,FLY),3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(MIX2,DRAWFROM(BUG,FLY),3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(MIX2,DRAWFROM(BUG,FLY),3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(MIX2,DRAWFROM(BUG,SPIDER),3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(MIX2,SPIDER,4,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(BGS2)
ADD_TO_PARTY(BGS2,SPIDER,3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BGS2,SPIDER,3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BGS2,SPIDER,3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BGS2,BUG,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BGS2,BUG,3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BGS2,BUG,3,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(FLY2)
ADD_TO_PARTY(FLY2,FLY,4,0,ATTACK_ROOMS,0)
ADD_TO_PARTY(FLY2,FLY,3,0,ATTACK_ROOMS,0)
ADD_TO_PARTY(FLY2,FLY,3,0,ATTACK_ROOMS,0)
ADD_TO_PARTY(FLY2,FLY,3,0,ATTACK_ROOMS,0)
ADD_TO_PARTY(FLY2,FLY,3,0,ATTACK_ROOMS,0)
ADD_TO_PARTY(FLY2,FLY,3,0,ATTACK_ROOMS,0)


CREATE_PARTY(MIX3)
ADD_TO_PARTY(MIX3,DRAWFROM(BUG,FLY),7,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(MIX3,DRAWFROM(BUG,FLY),6,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(MIX3,DRAWFROM(BUG,FLY),8,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(MIX3,DRAWFROM(BUG,SPIDER),8,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(MIX3,SPIDER,7,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(BGS3)
ADD_TO_PARTY(BGS3,SPIDER,8,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BGS3,SPIDER,7,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BGS3,SPIDER,7,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BGS3,BUG,6,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BGS3,BUG,7,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BGS3,BUG,6,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(FLY3)
ADD_TO_PARTY(FLY3,FLY,10,0,ATTACK_ROOMS,0)
ADD_TO_PARTY(FLY3,FLY,8,0,ATTACK_ROOMS,0)
ADD_TO_PARTY(FLY3,FLY,8,0,ATTACK_ROOMS,0)
ADD_TO_PARTY(FLY3,FLY,8,0,ATTACK_ROOMS,0)
ADD_TO_PARTY(FLY3,FLY,8,0,ATTACK_ROOMS,0)
ADD_TO_PARTY(FLY3,FLY,8,0,ATTACK_ROOMS,0)

CREATE_PARTY(BGS4)
ADD_TO_PARTY(BGS4,SPIDER,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BGS4,SPIDER,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BGS4,BUG,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BGS4,BUG,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BGS4,BUG,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BGS4,BUG,10,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(FLY4)
ADD_TO_PARTY(FLY4,FLY,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FLY4,FLY,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FLY4,FLY,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FLY4,FLY,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FLY4,FLY,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FLY4,FLY,10,0,ATTACK_DUNGEON_HEART,0)

rem ### ACTION POINTS
rem ### 1 intro entrance
rem ### 2 south tunnel
rem ### 3 big workshop
rem ### 4 big hatchery
rem ### 5 barracks
rem ### 6 doggos
rem ### 7 small hatchery
rem ### 8 CAT spell
rem ### 10 imp generator
rem ### 11 north trap boxes
rem ###
rem ### guard posts: 20
rem ###
rem ### FLAGS
rem ### flag0 nests progress
rem ### flag1 wave func
rem ### flag2 intrawave counter
rem ###
rem ### TIMERS
rem ### timer0 prog waves
rem ### timer1 intrawave timer
rem ### timer2 workshop timer
rem ### timer3 IMP gen timer
rem ### timer6 limit timer TODO

SET_FLAG(PLAYER0,FLAG0,0)
REM	QUICK_OBJECTIVE(1,"Once an underground imp prison camp below a monastery, this land is now devoid of any people. Not safe, however: there is a reason this region was abandoned...",ALL_PLAYERS)
	DISPLAY_OBJECTIVE(101, ALL_PLAYERS)

ADD_CREATURE_TO_LEVEL(PLAYER0,BARBARIAN,1,IMPORT(PLAYER0,CAMPAIGN_FLAG7),1,0)
IF(PLAYER0,BARBARIAN>0)
REM	QUICK_INFORMATION(11,"Look! Some barbarians have joined you!",1)
	DISPLAY_INFORMATION(87,1)
ENDIF

IF(PLAYER0,TOTAL_CREATURES>3)
	SET_FLAG(PLAYER0,FLAG1,1)
	SET_FLAG(PLAYER0,FLAG2,2)
REM	QUICK_OBJECTIVE(2,"The land is unusable with this many insects crawling around. Your task is to find and case any insect and spider lairs you find. Careful, for they are hidden well and they do like revenge. Flush them out.",ALL_PLAYERS)
	DISPLAY_OBJECTIVE(100, ALL_PLAYERS)
ENDIF

IF(PLAYER0,VAMPIRE>3)
REM	QUICK_INFORMATION(3,"Worms have spread through the bodies of your vampires, killing some. Keeping more than a few vampires is impossible as they're getting eaten 'alive'!",ALL_PLAYERS)
	DISPLAY_INFORMATION(102,ALL_PLAYERS)
	NEXT_COMMAND_REUSABLE
	KILL_CREATURE(PLAYER0,VAMPIRE,LEAST_EXPERIENCED,1)
ENDIF
SET_GENERATE_SPEED(200)
SET_TIMER(PLAYER0,TIMER0)

rem 	########	ACTION POINTS TRIGGERS 		###################################################

IF_ACTION_POINT(10,PLAYER0)
REM	QUICK_INFORMATION(4,"You've found a strange portal that sucked out life from all of your imps. Summoning imps on your own now seems to have stopped working. Imps will now be joining you through the portal.",10)
	DISPLAY_INFORMATION(104,10)
	MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,0,0)
	KILL_CREATURE(PLAYER0,IMP,LEAST_EXPERIENCED,250)
	SET_TIMER(PLAYER0,TIMER3)

ENDIF
IF(PLAYER0,TIMER3>30)
	ADD_CREATURE_TO_LEVEL(PLAYER0,IMP,10,5,10,0)
ENDIF

IF_ACTION_POINT(11,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DRAWFROM(MIX2,FLY2,BGS2),11,2)
ENDIF

IF_ACTION_POINT(7,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DRAWFROM(MIX1,FLY1,BGS1),7,1)
ENDIF

IF_ACTION_POINT(3,PLAYER0)
	SET_TIMER(PLAYER0,TIMER2)
ENDIF

IF_ACTION_POINT(4,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FLY2,4,2)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MIX1,4,1)
ENDIF

IF_ACTION_POINT(6,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FLY3,6,4)
ENDIF

IF_ACTION_POINT(8,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DRAWFROM(MIX1,FLY1,BGS1),8,2)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DRAWFROM(MIX1,FLY1,BGS1),8,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DRAWFROM(MIX1,FLY1,BGS1),DRAWFROM(2,5),2)
ENDIF

rem ################################################################################################
rem 	########	ROOM TRIGGERS  		###################################################

IF(PLAYER0,GARDEN>8)
	ROOM_AVAILABLE(PLAYER0,GARDEN,1,0)
	TUTORIAL_FLASH_BUTTON(7,100)
ENDIF

IF(PLAYER0,ENTRANCE>9)
	ADD_CREATURE_TO_POOL(ORC,3)
	ADD_CREATURE_TO_POOL(BILE_DEMON,​2)
	CREATURE_AVAILABLE(ALL_PLAYERS,BILE_DEMON,1,0)
ENDIF

IF(PLAYER0,WORKSHOP>9)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DRAWFROM(MIX3,BGS3),3,1)
	ROOM_AVAILABLE(PLAYER0,WORKSHOP,1,0)
	TUTORIAL_FLASH_BUTTON(13,100)
ENDIF



IF(PLAYER_GOOD,GUARD_POST<=16)
	ADD_TO_FLAG(PLAYER0,FLAG0,1)
	ADD_GOLD_TO_PLAYER(PLAYER0,2500)
	SET_FLAG(PLAYER0,FLAG1,1)
	ROOM_AVAILABLE(PLAYER0,LAIR,1,0)
	TUTORIAL_FLASH_BUTTON(8,100)
REM	QUICK_INFORMATION(5,"You hear insect noise in the tunnels... they sound angry",2)
	DISPLAY_INFORMATION(105,2)
ENDIF

IF(PLAYER_GOOD,GUARD_POST<=12)
	ADD_TO_FLAG(PLAYER0,FLAG0,1)
	ADD_GOLD_TO_PLAYER(PLAYER0,5000)
	SET_FLAG(PLAYER0,FLAG1,1)
REM	QUICK_INFORMATION(6,"You hear insect noise in the tunnels... as if they seemed even more angry",ALL_PLAYERS)
	DISPLAY_INFORMATION(106,ALL_PLAYERS)
ENDIF

IF(PLAYER_GOOD,GUARD_POST<=8)
	ADD_TO_FLAG(PLAYER0,FLAG0,1)
	ADD_GOLD_TO_PLAYER(PLAYER0,5000)
	SET_FLAG(PLAYER0,FLAG1,1)
REM	QUICK_INFORMATION(7,"More than half of lairs are gone.",ALL_PLAYERS)
	DISPLAY_INFORMATION(107,ALL_PLAYERS)
ENDIF

IF(PLAYER_GOOD,GUARD_POST<=4)
	ADD_TO_FLAG(PLAYER0,FLAG0,1)
	ADD_GOLD_TO_PLAYER(PLAYER0,15000)
	SET_FLAG(PLAYER0,FLAG1,1)
REM	QUICK_INFORMATION(8,"Just a few more lairs to destroy!",ALL_PLAYERS)
	DISPLAY_INFORMATION(108,ALL_PLAYERS)
ENDIF

IF(PLAYER_GOOD,GUARD_POST==0)
	ADD_TO_FLAG(PLAYER0,FLAG0,1)
	ADD_GOLD_TO_PLAYER(PLAYER0,20000)
REM	QUICK_OBJECTIVE(9,"All the lairs are destroyed now. Now try to withstand their attacks.",ALL_PLAYERS)
	DISPLAY_OBJECTIVE(109,ALL_PLAYERS)
ENDIF

rem ################################################################################################
rem 	########	TIMERS  		###################################################

IF(PLAYER0,TIMER1>1500)
	NEXT_COMMAND_REUSABLE
	SET_FLAG(PLAYER0,FLAG1,1)
ENDIF
IF(PLAYER0,FLAG1>0)
	NEXT_COMMAND_REUSABLE
	SET_FLAG(PLAYER0,FLAG1,0)
	IF(PLAYER0,FLAG2<4)
		NEXT_COMMAND_REUSABLE
		NEXT_COMMAND_REUSABLE
		SET_TIMER(PLAYER0,TIMER1)
		NEXT_COMMAND_REUSABLE
		ADD_TO_FLAG(PLAYER0,FLAG2,1)
		IF(PLAYER0,FLAG0<2)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FLY1,5,1)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DRAWFROM(BGS1,MIX1),DRAWFROM(1,2,5,8),1)
		ENDIF
		IF(PLAYER0,FLAG0==2)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FLY1,5,2)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BGS1,DRAWFROM(1,2,5,7,8,4),1)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MIX1,DRAWFROM(1,2,5,7,8,4),1)
		ENDIF
		IF(PLAYER0,FLAG0==3)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FLY2,2,2)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BGS2,1,1)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MIX2,DRAWFROM(1,2,5,7,8,4),1)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DRAWFROM(FLY2,BGS2),5,3)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MIX2,DRAWFROM(1,2,5,7,8,4),2)
		ENDIF
		IF(PLAYER0,FLAG0==4)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FLY3,DRAWFROM(1,2,5,7,8,4),2)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BGS3,DRAWFROM(1,2,5,7,8,4),1)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MIX3,DRAWFROM(1,2,5,7,8,4),1)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DRAWFROM(FLY3,BGS3),DRAWFROM(1,2,5,7,8,4),2)
		ENDIF
		IF(PLAYER0,FLAG0==5)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FLY4,DRAWFROM(1,2,5,7,8,4),2)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BGS4,DRAWFROM(1,2,5,7,8,4),2)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BGS4,DRAWFROM(1,2,5,7,8,4),2)
			NEXT_COMMAND_REUSABLE
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BGS4,DRAWFROM(1,2,5,7,8,4),1)
		ENDIF
	ENDIF
	IF(PLAYER0,FLAG2>=4)
		IF(PLAYER0,FLAG0>=5)
		REM	QUICK_OBJECTIVE(10,"They are here, Keeper. Eliminate every foe, be it bug or not.",ALL_PLAYERS)
			DISPLAY_OBJECTIVE(110,ALL_PLAYERS)
			MAGIC_AVAILABLE(ALL_PLAYERS,POWER_ARMAGEDDON,1,1)
			ADD_GOLD_TO_PLAYER(PLAYER0,100000)
			TUTORIAL_FLASH_BUTTON(​33,​300)
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FLY4,5,4)
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BGS4,DRAWFROM(1,2,4,7,5,8),3)
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BGS4,DRAWFROM(1,2,4,7,5,8),3)
			ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BGS4,DRAWFROM(1,2,4,7,5,8),3)
			IF(PLAYER_GOOD,TOTAL_CREATURES<1)
				REM	QUICK_OBJECTIVE(12,"Finally. This land is now suitable to be added to your domain.",ALL_PLAYERS)
					DISPLAY_OBJECTIVE(111,ALL_PLAYERS)
				WIN_GAME
			ENDIF
		ENDIF
	ENDIF
ENDIF

IF(PLAYER0,TIMER2>1536)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BGS2,DRAWFROM(1,2,3,7,8),1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MIX2,DRAWFROM(1,2,3,7,8),1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FLY3,5,1)
ENDIF

IF(PLAYER0,TIMER3>320)
	IF(PLAYER0,IMP<5)
		NEXT_COMMAND_REUSABLE
		ADD_CREATURE_TO_LEVEL(PLAYER0,IMP,10,1,10,0)
		NEXT_COMMAND_REUSABLE
		SET_TIMER(PLAYER0,TIMER3)
	ENDIF
ENDIF

IF(PLAYER0,TIMER0>15000)
	NEXT_COMMAND_REUSABLE
	BONUS_LEVEL_TIME(0)
	NEXT_COMMAND_REUSABLE
	SET_TIMER(PLAYER0,TIMER0)
	NEXT_COMMAND_REUSABLE
	SET_FLAG(PLAYER0,FLAG1,1)
	NEXT_COMMAND_REUSABLE
	SET_FLAG(PLAYER0,FLAG2,0)
ENDIF

rem any fly player gets joins the enemy
NEXT_COMMAND_REUSABLE
CHANGE_CREATURE_OWNER(​PLAYER0,FLY,LEAST_EXPERIENCED,PLAYER_GOOD)

rem ################################################################################################
