REM ****************************************************
REM Ziggurat Blitz Massacre
REM
REM Assmist Isle Campaign by Kix
REM
REM v2.0 for DAT file objectives (by dayokay)
REM 14-Nov-2020
REM ****************************************************

LEVEL_VERSION(1)
REM ********************************************
REM	aps: 1 small east room; 2 south empty room; 3 monastery; 4 west corridor; 5 insect lair; 6 dungeon heart; 7 imp generator; 8 before heart
REM hgs: 1 small east room; 2 south lava area; 3 corridor; 4 first tunnel; 5 second tunnel; 6 third tunnel; 7 forth tunnel; 8 fifth tunnel; 9 sixth tunnel; 10 seventh tunnel
REM
REM ********************************************
COMPUTER_PLAYER(PLAYER3,0)
ALLY_PLAYERS(PLAYER0,PLAYER3,1)
START_MONEY(PLAYER0,0)
START_MONEY(PLAYER3,2000000)

SET_FLAG(PLAYER0,FLAG7,2)

IF(PLAYER0,CREATURES_ANNOYED>0)
REM	QUICK_INFORMATION(8,"You failed to keep the vampires happy, don't count on them joining you in the next realm.",ALL_PLAYERS)
	DISPLAY_INFORMATION(56,ALL_PLAYERS)
	SET_FLAG(PLAYER0,FLAG7,0)
ENDIF


ROOM_AVAILABLE(PLAYER0,GARDEN,1,0)
ROOM_AVAILABLE(PLAYER0,TREASURE,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_POSSESS,0,0)
MAGIC_AVAILABLE(PLAYER3,POWER_DISEASE,1,1)
MAGIC_AVAILABLE(PLAYER3,POWER_HOLD_AUDIENCE,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_HOLD_AUDIENCE,1,0)
MAGIC_AVAILABLE(PLAYER3,POWER_SPEED,1,1)
MAGIC_AVAILABLE(PLAYER3,POWER_HEAL_CREATURE,1,1)

SET_CREATURE_MAX_LEVEL(PLAYER0,VAMPIRE,2)

CREATE_PARTY(A1)
ADD_TO_PARTY(A1,WIZARD,6,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(A1,FAIRY,3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(A1,FAIRY,3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(A1,MONK,2,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(A1,MONK,2,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(A1,MONK,2,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(C1)
ADD_TO_PARTY(C1,MONK,5,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(C1,MONK,6,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(C1,MONK,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(C1,MONK,2,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(C1,FAIRY,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(C1,FAIRY,5,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(B0)
ADD_TO_PARTY(B0,MONK,2,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(B0,MONK,2,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(B0,MONK,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(B0,MONK,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(B0,MONK,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(B0,MONK,1,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(B1)
ADD_TO_PARTY(B1,MONK,5,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(B1,MONK,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(B1,MONK,3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(B1,MONK,2,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(B1,MONK,2,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(B1,MONK,2,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(B2)
ADD_TO_PARTY(B2,MONK,7,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(B2,MONK,6,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(B2,MONK,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(B2,MONK,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(B2,MONK,3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(B2,MONK,3,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(A2)
ADD_TO_PARTY(A2,FAIRY,9,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(A2,FAIRY,5,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(A2,FAIRY,5,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(A2,MONK,5,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(A2,MONK,4,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(A2,MONK,4,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(A3)
ADD_TO_PARTY(A3,BARBARIAN,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(A3,BARBARIAN,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(A3,WITCH,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(A3,MONK,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(A3,MONK,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(A3,MONK,10,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(H1)
ADD_TO_PARTY(H1,WITCH,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(H1,WITCH,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(H1,MONK,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(H1,MONK,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(H1,MONK,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(H1,MONK,10,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(H2)
ADD_TO_PARTY(H2,FAIRY,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(H2,FAIRY,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(H2,FAIRY,10,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(FIN)
ADD_TO_PARTY(FIN,AVATAR,9,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FIN,KNIGHT,8,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FIN,KNIGHT,8,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FIN,MONK,8,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FIN,MONK,8,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FIN,FAIRY,8,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FIN,WITCH,8,0,ATTACK_DUNGEON_HEART,0)

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

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

REM	QUICK_OBJECTIVE(9,"It has been rumoured that the people of this land have been preparing an once-for-all solution to the ziggurat you two managed to claim and barely control. Break out and see what you can do.",ALL_PLAYERS)
DISPLAY_OBJECTIVE(57,ALL_PLAYERS)

IF(PLAYER0,BATTLES_WON>0)
REM	QUICK_OBJECTIVE(10,"The rumours are true. Although still in preparation, lots of people are prepared to fight you. They are training and learning how to avoid imprisonment. Find their dungeon heart, destroy it and defeat the lord of the land. There should be an imp gate somewhere nearby... look for an altar with green light and examine it.",ALL_PLAYERS)
	DISPLAY_OBJECTIVE(58,ALL_PLAYERS)
ENDIF


IF_ACTION_POINT(7,PLAYER0)
	SET_TIMER(PLAYER0,TIMER7)
REM	QUICK_INFORMATION(15,"Imp gate activated! Imps will now enter your dungeon when they're needed.",7)
	DISPLAY_INFORMATION(59,7)
ENDIF

IF_ACTION_POINT(8,PLAYER0)
REM	QUICK_INFORMATION(6,"Be warned, Keeper. Dungeon heart is not the only thing I can hear behind these doors.",ALL_PLAYERS)
	DISPLAY_INFORMATION(60,8)
ENDIF

IF(PLAYER0,TIMER7>1000)
	IF(PLAYER0,IMP<5)
		NEXT_COMMAND_REUSABLE
		ADD_CREATURE_TO_LEVEL(PLAYER0,IMP,7,1,10,0)
	ENDIF
	NEXT_COMMAND_REUSABLE
	SET_TIMER(PLAYER0,TIMER7)
ENDIF

IF_ACTION_POINT(1,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,MONK,1,11,3,0)
	SET_TIMER(PLAYER0,TIMER1)
REM	QUICK_INFORMATION(13,"People of this land have been alarmed concerning your breakout. Expect some pathetic attempts to fight back.",ALL_PLAYERS)
	DISPLAY_INFORMATION(61,1)
ENDIF
IF(PLAYER0,TIMER1>3400)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,A1,-1,APPROPRIATE_DUNGEON,0,5,4000)
ENDIF
IF(PLAYER0,TIMER1>8500)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,A1,-1,2)
ENDIF
IF(PLAYER0,TIMER1>14850)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,C1,-1,1)
ENDIF

SET_FLAG(PLAYER0,FLAG2,0)
IF_ACTION_POINT(2,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,MONK,2,8,7,0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,MONK,2,16,4,0)
	SET_TIMER(PLAYER0,TIMER2)
ENDIF
IF(PLAYER0,TIMER2>3000)
	IF(PLAYER0,FLAG2<4)
		NEXT_COMMAND_REUSABLE
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,C1,-2,1)
		NEXT_COMMAND_REUSABLE
		SET_TIMER(PLAYER0,TIMER2)
		NEXT_COMMAND_REUSABLE
		ADD_TO_FLAG(PLAYER0,FLAG2,1)
	ENDIF
ENDIF

SET_FLAG(PLAYER0,FLAG3,0)
IF_ACTION_POINT(3,PLAYER0)
	SET_TIMER(PLAYER0,TIMER3)
ENDIF
IF(PLAYER0,TIMER3>3600)
IF(PLAYER0,FLAG3<4)
	NEXT_COMMAND_REUSABLE
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,A1,3,2)
	NEXT_COMMAND_REUSABLE
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,B1,3,2)
	NEXT_COMMAND_REUSABLE
	SET_TIMER(PLAYER0,TIMER3)
	NEXT_COMMAND_REUSABLE
	ADD_TO_FLAG(PLAYER0,FLAG3,1)
ENDIF
ENDIF

IF_ACTION_POINT(4,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,MONK,4,5,10,0)
ENDIF

IF_ACTION_POINT(5,PLAYER0)
	SET_TIMER(PLAYER0,TIMER4)
ENDIF

IF(PLAYER_GOOD,DUNGEON_DESTROYED==0)
	IF(PLAYER0,TIMER4>4300)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,B2,-3,2)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,A2,-3,2)
	ENDIF
	IF(PLAYER0,TIMER4>12000)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,A3,-3,1)
	ENDIF
	IF(PLAYER0,TIMER4>18000)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,A3,-3,2)
	ENDIF
	IF(PLAYER0,TIMER4>24000)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,A3,-3,2)
		ADD_PARTY_TO_LEVEL(PLAYER_GOOD,A3,-1,2)
	ENDIF
ENDIF

IF(PLAYER0,GRAVEYARD>39)
	REM	"You have reclaimed the graveyard, and so your Vampires begin to recover their powers! Their powers will recover further as you reclaim more of their native ground."
	DISPLAY_INFORMATION(62,ALL_PLAYERS)
	SET_CREATURE_MAX_LEVEL(PLAYER0,VAMPIRE,3)
	ADD_GOLD_TO_PLAYER(PLAYER0,8000)
ENDIF
IF(PLAYER0,GRAVEYARD>57)
	REM	"Well done Keeper. Your Vampires' strength continues to recover!"
	DISPLAY_INFORMATION(63,ALL_PLAYERS)
	SET_CREATURE_MAX_LEVEL(PLAYER0,VAMPIRE,4)
	ADD_GOLD_TO_PLAYER(PLAYER0,16000)
ENDIF
IF(PLAYER0,GRAVEYARD>75)
	REM	"Your Vampires' strength is returning. Are you keeping them happy Keeper?"
	DISPLAY_INFORMATION(64,ALL_PLAYERS)
	SET_CREATURE_MAX_LEVEL(PLAYER0,VAMPIRE,5)
	ADD_GOLD_TO_PLAYER(PLAYER0,32000)
ENDIF
IF(PLAYER0,GRAVEYARD>93)
	REM	"Well done Keeper. Your Vampires' strength continues to recover!"
	DISPLAY_INFORMATION(63,ALL_PLAYERS)
	SET_CREATURE_MAX_LEVEL(PLAYER0,VAMPIRE,6)
	ADD_GOLD_TO_PLAYER(PLAYER0,64000)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,GHOST,-1,5,10,0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,GHOST,-2,5,10,0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,GHOST,-3,5,10,0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,GHOST,-4,5,10,0)
ENDIF

IF(PLAYER0,GRAVEYARD>111)
REM	QUICK_INFORMATION(5,"All graveyards taken! Your vampires' power is fully restored.",ALL_PLAYERS)
	DISPLAY_INFORMATION(65,ALL_PLAYERS)
	SET_CREATURE_MAX_LEVEL(PLAYER0,VAMPIRE,7)
	ADD_GOLD_TO_PLAYER(PLAYER0,128000)
ENDIF

IF(PLAYER0,LAIR>47)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FLIES,5,10)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BUGS,5,4)
ENDIF

IF(PLAYER0,VAMPIRE>0)
	SET_TIMER(PLAYER0,TIMER0)
REM	QUICK_INFORMATION(11,"A group of autistic monks on the surface have blessed the ziggurat weakining your vampires, making them unable to train past level 2. Claim back as many graveyards as you can find to fight the blessing!",ALL_PLAYERS)
	DISPLAY_INFORMATION(66,ALL_PLAYERS)
REM	QUICK_INFORMATION(12,"Win the scenario without annoying a single vampire and a couple will gladly join you in the next realm!",ALL_PLAYERS)
	DISPLAY_INFORMATION(67,ALL_PLAYERS)
ENDIF

IF(PLAYER0,TIMER0>5000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,B0,-4,APPROPRIATE_DUNGEON,0,5,4000)
ENDIF

IF(PLAYER0,TIMER0>20000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,B0,-5,APPROPRIATE_DUNGEON,0,5,8000)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,B1,-5,3)
ENDIF

IF(PLAYER0,TIMER0>35000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,B1,-6,APPROPRIATE_DUNGEON,0,5,16000)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,B1,-6,4)
ENDIF

IF(PLAYER0,TIMER0>50000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,B1,-7,APPROPRIATE_DUNGEON,0,10,32000)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,C1,-7,3)
ENDIF

IF(PLAYER0,TIMER0>78000)
	SET_TIMER(PLAYER0,TIMER5)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,B2,-8,APPROPRIATE_DUNGEON,0,10,32000)
	REM "A group of virgin monks atop your dungeon have just begun their consecrations. Unfortunately for you, it is working and your vampires slowly perish."
	DISPLAY_INFORMATION(68,ALL_PLAYERS)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,C1,-8,5)
ENDIF

IF(PLAYER0,TIMER0>80000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,B2,-9,APPROPRIATE_DUNGEON,0,10,32000)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,A2,-9,3)
ENDIF

IF(PLAYER0,TIMER0>95000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,C1,-10,APPROPRIATE_DUNGEON,0,10,32000)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,A2,-10,4)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,B2,-10,4)
ENDIF

IF(PLAYER_GOOD,DUNGEON_DESTROYED==1)
	REM presence of avatar
	PLAY_MESSAGE(PLAYER0,SPEECH,107)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIN,6,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,H1,6,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,H2,6,1)
	IF(PLAYER_GOOD,AVATAR==0)
		rem smell
		PLAY_MESSAGE(PLAYER0,SPEECH,96)
		EXPORT_VARIABLE(PLAYER0,FLAG7,CAMPAIGN_FLAG1)
		IF(PLAYER0,FLAG7>0)
			REM	QUICK_OBJECTIVE(16,"The Ziggurat is full of stench of dead people. And you even managed to transfer a couple of vampires into the next realm! Good job.",ALL_PLAYERS)
			DISPLAY_OBJECTIVE(70,ALL_PLAYERS)
			WIN_GAME
		ENDIF
		IF(PLAYER0,FLAG7==0)
			REM	QUICK_OBJECTIVE(14,"The Ziggurat is full of stench of dead people. Good job.",ALL_PLAYERS)
			DISPLAY_OBJECTIVE(69,ALL_PLAYERS)
			WIN_GAME
		ENDIF
	ENDIF
ENDIF


IF(PLAYER0,TIMER5>3000)
	NEXT_COMMAND_REUSABLE
	SET_TIMER(PLAYER0,TIMER5)
	NEXT_COMMAND_REUSABLE
	KILL_CREATURE(PLAYER0,VAMPIRE,LEAST_EXPERIENCED,1)
ENDIF

NEXT_COMMAND_REUSABLE
SET_CREATURE_TENDENCIES(PLAYER0,IMPRISON,0)

rem ******** kill switch ********
IF_ACTION_POINT(10,PLAYER0)
REM	QUICK_INFORMATION(17,"You've found an ancient acolyte altar. It is said to feast upon a dozen souls of believers situated nearby. The legends say it takes a whole centruy to recharge. And it certainly does look like it hasn't been touched in ages. Useful, right? Walk over it once you feel like it is necessary to kill some monks and priestesses located on your territory.",9)
	DISPLAY_INFORMATION(71,9)
	REVEAL_MAP_LOCATION(PLAYER0,-9,15)
ENDIF

IF_ACTION_POINT(9,PLAYER0)
REM	QUICK_INFORMATION(18,"You touched the acolyte altar and hear distant screams...",9)
	DISPLAY_INFORMATION(72,9)
	PLAY_MESSAGE(PLAYER0,SOUND,205)
	KILL_CREATURE(ALL_PLAYERS,MONK,ON_ENEMY_GROUND,12)
	KILL_CREATURE(ALL_PLAYERS,WITCH,ON_ENEMY_GROUND,12)
ENDIF
