REM	Level 'Return to Skybird Trill'
REM	Level 416
REM	v1.1 written by Diety Demon, Created on 21 Apr 2009
REM	v2.0 updated to use pot file by dayokay Dec2020, with some text changes

DEAD_CREATURES_RETURN_TO_POOL(0)

SET_GENERATE_SPEED(72)

COMPUTER_PLAYER(PLAYER1,0)
ALLY_PLAYERS(PLAYER_GOOD,PLAYER1)

MAX_CREATURES(PLAYER0,9)
MAX_CREATURES(PLAYER1,50)

START_MONEY(PLAYER0,9000)
START_MONEY(PLAYER1,9999999)

ADD_CREATURE_TO_POOL(TENTACLE,4)
ADD_CREATURE_TO_POOL(SPIDER,4)
ADD_CREATURE_TO_POOL(SORCEROR,12)
ADD_CREATURE_TO_POOL(DEMONSPAWN,5)
ADD_CREATURE_TO_POOL(DRAGON,2)
ADD_CREATURE_TO_POOL(TROLL,9)
ADD_CREATURE_TO_POOL(ORC,6)
ADD_CREATURE_TO_POOL(HELL_HOUND,1)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,4)
ADD_CREATURE_TO_POOL(BILE_DEMON,6)

ADD_CREATURE_TO_POOL(WIZARD,50)
ADD_CREATURE_TO_POOL(BARBARIAN,50)
ADD_CREATURE_TO_POOL(ARCHER,50)
ADD_CREATURE_TO_POOL(MONK,50)
ADD_CREATURE_TO_POOL(DWARFA,50)
ADD_CREATURE_TO_POOL(KNIGHT,10)
ADD_CREATURE_TO_POOL(AVATAR,1)
ADD_CREATURE_TO_POOL(WITCH,50)
ADD_CREATURE_TO_POOL(GIANT,50)
ADD_CREATURE_TO_POOL(FAIRY,50)
ADD_CREATURE_TO_POOL(THIEF,50)
ADD_CREATURE_TO_POOL(SAMURAI,50)

CREATURE_AVAILABLE(PLAYER0,TENTACLE,1,1)
CREATURE_AVAILABLE(PLAYER0,SPIDER,1,1)
CREATURE_AVAILABLE(PLAYER0,SORCEROR,1,1)
CREATURE_AVAILABLE(PLAYER0,DEMONSPAWN,1,1)
CREATURE_AVAILABLE(PLAYER0,DRAGON,1,1)
CREATURE_AVAILABLE(PLAYER0,TROLL,1,1)
CREATURE_AVAILABLE(PLAYER0,ORC,1,1)
CREATURE_AVAILABLE(PLAYER0,HELL_HOUND,1,1)
CREATURE_AVAILABLE(PLAYER0,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(PLAYER0,BILE_DEMON,1,1)

ROOM_AVAILABLE(PLAYER0,TREASURE,1,0)
ROOM_AVAILABLE(PLAYER0,LAIR,1,0)
ROOM_AVAILABLE(PLAYER0,GARDEN,1,0)
ROOM_AVAILABLE(PLAYER0,RESEARCH,1,0)
ROOM_AVAILABLE(PLAYER0,WORKSHOP,1,0)
ROOM_AVAILABLE(PLAYER0,BARRACKS,1,0)

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

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

MAGIC_AVAILABLE(PLAYER0,POWER_SPEED,1,0)

REM	"There is, and only should be, one reason for the trouble of you returning to this holy saint of a land, my lord. Four powerful magical beings plan on creating a Dungeon Keeper to service them. Don't expect this to be anything like your last visit. This is the perfect chance to show the punishment for those heroes who still wish to defy you in your rule. Go for it master."
DISPLAY_OBJECTIVE(40,PLAYER0)

IF(PLAYER0,GAME_TURN>=240)
	REM	A powerful curse forbids most of your powers, placed by these four. Yet another reason to kill them. As a result of thier stuckup additudes, they all work sepperately, thus making it easier for you to slay them all."
	DISPLAY_INFORMATION(41)
ENDIF

IF(PLAYER0,GAME_TURN>=2000)
	REM	"Why not take a trip down memory lane, it might hold some useful memories.",PLAYER0)
	DISPLAY_INFORMATION(42)
ENDIF

IF(PLAYER0,GAME_TURN>=3600)
	REM	Your majasty, I've received word that the Witch of Summonings awaits for you. As rude as it would be not to visit her, she holds the resorces you require, so lets make the visit short and simple.
	DISPLAY_INFORMATION(43)
ENDIF

IF_ACTION_POINT(18,PLAYER0)
	REM	"I hope this isn't her only defense against you. Someone of your ability can pass through this easily, now it is time to deal with the menace."
	DISPLAY_INFORMATION(44)
ENDIF

IF_ACTION_POINT(8,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DWARFA,8,2,1,0)
ENDIF

IF_ACTION_POINT(9,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,FLY,9,10,1,0)
ENDIF

IF_ACTION_POINT(10,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,BUG,10,5,1,0)
ENDIF

IF_ACTION_POINT(11,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,BUG,11,10,1,0)
ENDIF

IF_ACTION_POINT(12,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SPIDER,12,5,1,0)
ENDIF

IF_ACTION_POINT(13,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SPIDER,13,10,1,0)
ENDIF

IF_ACTION_POINT(14,PLAYER0)
	SET_TIMER(PLAYER0,TIMER0)
ENDIF

IF(PLAYER0,TIMER0>=24)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,FLY,15,1,1,0)
ENDIF

IF(PLAYER0,TIMER0>=48)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,BUG,15,1,1,0)
ENDIF

IF(PLAYER0,TIMER0>=72)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SPIDER,15,1,1,0)
ENDIF

IF(PLAYER0,TIMER0>=94)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,TROLL,15,1,1,0)
ENDIF

IF(PLAYER0,TIMER0>=118)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DRAGON,15,1,1,0)
ENDIF

IF(PLAYER0,TIMER0>=142)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,ORC,15,1,1,0)
ENDIF

IF_ACTION_POINT(17,PLAYER0)
	REM	"You've found some orcs. These will go well with your army, to crush those who are against you."
	DISPLAY_INFORMATION(45)
ENDIF

IF(PLAYER_GOOD,WITCH==1)
	IF(PLAYER_GOOD,BILE_DEMON==0)
		NEXT_COMMAND_REUSABLE
		ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,BILE_DEMON,16,1,1,0)
		IF(PLAYER_GOOD,GAME_TURN > 200)
			REM "The Witch of Summonings can call forth Bile Demons at will. Maybe she is stronger than we thought? "
			DISPLAY_OBJECTIVE(46,16)
		ENDIF
	ENDIF
ENDIF

IF_ACTION_POINT(16,PLAYER0)
	REM	"Here is the Witch of Summonings. Isn't she happy to see you? Why don't you repay the compliment. Remember what you've been told on how to treat a woman."
	DISPLAY_OBJECTIVE(47,16)
ENDIF

IF(PLAYER_GOOD,WITCH==0)
	REM	Now the Witch of Summonings has fallen to her demise. Take her spells as a treat, and head for the east. You'll need the gold, and there is someone you have to get rid of as well."
	DISPLAY_OBJECTIVE(48,16)
ENDIF

IF_ACTION_POINT(19,PLAYER0)
	REM	"Because of these do-gooders, keeping your former wealth will come difficult. But the heroes would say to have faith. Now take thier faith and toss it in the lava or boulder trap because it will get someone of your power nowhere, just use sheer force to break down their doors and make them know the real meaning of fear. The Monk of Might should be your perfect victom. He is nearby, awaiting to face you. And faith won't get you what power shall in this case."
	DISPLAY_OBJECTIVE(49,19)
ENDIF

IF_ACTION_POINT(20,PLAYER0)
	REM	"Correct me if I'm wrong, which I doubt, but wasn't there a third way in?"
	DISPLAY_INFORMATION(50)
ENDIF

IF_ACTION_POINT(6,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,GIANT,7,7,1,0)
ENDIF

IF_ACTION_POINT(5,PLAYER0)
	REM	"Which way is the Monk of Cowardness hiding in. Choose wisely, and such decision making is why this job is worthy of your talants."
	DISPLAY_INFORMATION(51)
ENDIF

IF_ACTION_POINT(4,PLAYER0)
	REM	"Looks like this worthlessness of a dwarf had been hiding behind locked doors thinking he was safe by creating boulder traps. He was stupid enough not to use all of them, this makes everything easier for our part."
	DISPLAY_INFORMATION(52)
ENDIF

IF_ACTION_POINT(2,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,ARCHER,2,3,1,0)
ENDIF

IF_ACTION_POINT(3,PLAYER0)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,ARCHER,3,3,1,0)
ENDIF

IF_ACTION_POINT(22,PLAYER0)
	REM	"Such holy actions by such a holy monk. Now take his holyness and corrupt it with your dark ways. This should be fun, right my lord?"
	DISPLAY_OBJECTIVE(53,22)
ENDIF

IF(PLAYER_GOOD,MONK==0)
	REM	"And now you are granted more power. Such as being able to attract the mistress. And without this monk to get in your way, you may proceed to where an old rival used to be. The Fairy of Lava awaits there. Lets stop by to visit, to tell her how her friends are doing."
	DISPLAY_OBJECTIVE(54,PLAYER0)
	ROOM_AVAILABLE(PLAYER0,BRIDGE,1,0)
	ROOM_AVAILABLE(PLAYER0,TORTURE,1,0)
ENDIF

IF_ACTION_POINT(23,PLAYER0)
	REM	"And now for the Fairy of Lava to face you. Look at her abilities, and then look at her pitifulness to call upon the great spirits to aid her in her 'holy' quest. How brave, noble, and stupid!"	
	DISPLAY_OBJECTIVE(55,23)
ENDIF

IF(PLAYER_GOOD,FAIRY==0)
	REM	"And now with her gone, and the Training Room yours to build, you should go after the Wizard of Allknowing in the northwestern area of this land. His power his great, yet yours is supurb. Show him what he doesn't know, and that is wretched evil doings by someone dark and powerful who will show absolutely no mercy and pay him a visit of agony, something he might look back on."
	DISPLAY_OBJECTIVE(56,23)
	ROOM_AVAILABLE(PLAYER0,TRAINING,1,0)
ENDIF

IF_ACTION_POINT(24,PLAYER0)
	REM	"The mighty Wizard of Allknowing! 'Mighty'? Yeah right, show him who is 'Mighty', and the correction to his flaw of aiding goodness."
	DISPLAY_OBJECTIVE(57,24)
ENDIF

CREATE_PARTY(KNIGHT)
ADD_TO_PARTY(KNIGHT,KNIGHT,10,0,DEFEND_PARTY,0)
ADD_TO_PARTY(KNIGHT,KNIGHT,7,0,DEFEND_PARTY,0)
ADD_TO_PARTY(KNIGHT,KNIGHT,7,0,DEFEND_PARTY,0)
ADD_TO_PARTY(KNIGHT,KNIGHT,4,0,DEFEND_PARTY,0)
ADD_TO_PARTY(KNIGHT,KNIGHT,4,0,DEFEND_PARTY,0)
ADD_TO_PARTY(KNIGHT,KNIGHT,4,0,DEFEND_PARTY,0)
ADD_TO_PARTY(KNIGHT,KNIGHT,4,0,DEFEND_PARTY,0)

IF(PLAYER_GOOD,WIZARD==0)
	IF(PLAYER_GOOD,FAIRY==0)
		IF(PLAYER_GOOD,WITCH==0)
			IF(PLAYER_GOOD,MONK==0)
				REM	"And now the four magical beings are defeated, yet they managed to give thier last remaining stength to the Hero Dungeon Keeper in which they tried to create. Unfortunately, he awoke. And now we must finish him off, and take what is rightfully yours, the throne over this land. We shall return it to the glory it shared after your last visit."
				DISPLAY_OBJECTIVE(58,24)
				MAGIC_AVAILABLE(PLAYER1,POWER_IMP,1,1)
				MAGIC_AVAILABLE(PLAYER1,POWER_OBEY,1,1)
				MAGIC_AVAILABLE(PLAYER1,POWER_SIGHT,1,1)
				MAGIC_AVAILABLE(PLAYER1,POWER_CALL_TO_ARMS,1,1)
				MAGIC_AVAILABLE(PLAYER1,POWER_CAVE_IN,1,1)
				MAGIC_AVAILABLE(PLAYER1,POWER_HEAL_CREATURE,1,1)
				MAGIC_AVAILABLE(PLAYER1,POWER_HOLD_AUDIENCE,1,1)
				MAGIC_AVAILABLE(PLAYER1,POWER_LIGHTNING,1,1)
				MAGIC_AVAILABLE(PLAYER1,POWER_SPEED,1,1)
				MAGIC_AVAILABLE(PLAYER1,POWER_PROTECT,1,1)
				MAGIC_AVAILABLE(PLAYER1,POWER_CONCEAL,1,1)
				MAGIC_AVAILABLE(PLAYER0,POWER_CONCEAL,0,0)
				MAGIC_AVAILABLE(PLAYER1,POWER_DISEASE,1,1)
				MAGIC_AVAILABLE(PLAYER1,POWER_CHICKEN,1,1)
				MAGIC_AVAILABLE(PLAYER1,POWER_DESTROY_WALLS,1,1)
				MAGIC_AVAILABLE(PLAYER1,POWER_ARMAGEDDON,1,1)
				CREATURE_AVAILABLE(PLAYER1,WIZARD,1,1)
				CREATURE_AVAILABLE(PLAYER1,BARBARIAN,1,1)
				CREATURE_AVAILABLE(PLAYER1,ARCHER,1,1)
				CREATURE_AVAILABLE(PLAYER1,MONK,1,1)
				CREATURE_AVAILABLE(PLAYER1,DWARFA,1,1)
				CREATURE_AVAILABLE(PLAYER1,AVATAR,1,1)
				CREATURE_AVAILABLE(PLAYER1,KNIGHT,1,1)
				CREATURE_AVAILABLE(PLAYER1,FAIRY,1,1)
				CREATURE_AVAILABLE(PLAYER1,GIANT,1,1)
				CREATURE_AVAILABLE(PLAYER1,WITCH,1,1)
				CREATURE_AVAILABLE(PLAYER1,THIEF,1,1)
				CREATURE_AVAILABLE(PLAYER1,SAMURAI,1,1)
				ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,KNIGHT,1,ACTION_POINT,21,9,0)
				ADD_CREATURE_TO_LEVEL(PLAYER1,KNIGHT,-1,10,1,0)
				ADD_CREATURE_TO_LEVEL(PLAYER1,GIANT,-1,9,4,0)
				ADD_CREATURE_TO_LEVEL(PLAYER1,WIZARD,-1,10,4,0)
				ADD_CREATURE_TO_LEVEL(PLAYER1,DWARFA,-1,10,6,0)
				ROOM_AVAILABLE(PLAYER1,TREASURE,1,1)
				ROOM_AVAILABLE(PLAYER1,LAIR,1,1)
				ROOM_AVAILABLE(PLAYER1,GARDEN,1,1)
				ROOM_AVAILABLE(PLAYER1,TRAINING,1,1)
				ROOM_AVAILABLE(PLAYER1,RESEARCH,1,1)
				ROOM_AVAILABLE(PLAYER1,BRIDGE,1,1)
				ROOM_AVAILABLE(PLAYER1,GUARD_POST,1,1)
				ROOM_AVAILABLE(PLAYER1,WORKSHOP,1,1)
				ROOM_AVAILABLE(PLAYER1,BARRACKS,1,1)
				ROOM_AVAILABLE(PLAYER1,PRISON,1,1)
				ROOM_AVAILABLE(PLAYER1,TORTURE,1,1)
				ROOM_AVAILABLE(PLAYER1,TEMPLE,1,1)
				ROOM_AVAILABLE(PLAYER1,GRAVEYARD,1,1)
				ROOM_AVAILABLE(PLAYER1,SCAVENGER,1,1)
			ENDIF
		ENDIF
	ENDIF
ENDIF

IF(PLAYER1,DUNGEON_DESTROYED==1)
	REM	"And now your goal has been acomplished. Now you may exit this holy land. But first... let us go to the above grounds and bring down order with chaos. This trully is a victory, no one should ever question your great power."
	DISPLAY_OBJECTIVE(59,PLAYER0)
	WIN_GAME
ENDIF
