REM ****************************************************************************
REM  Campaigns Consolidation Project for KeeperFX strategy game.
REM ****************************************************************************
REM  Script for Level Mistle
REM  Campaign: DK Original
REM  Authors:  based on Bullfrog script
REM            KeeperFX CCP Team
REM  Date:     17 Dec 1996 - 07 Sep 2014
REM  Copying and copyrights:
REM    This program is free software; you can redistribute it and/or modify
REM    it under the terms of the GNU General Public License as published by
REM    the Free Software Foundation; either version 2 of the License, or
REM    (at your option) any later version.
REM ****************************************************************************
LEVEL_VERSION(1)

REM Nothing new for the player

SET_GENERATE_SPEED(500)

COMPUTER_PLAYER(PLAYER1,2)

START_MONEY(PLAYER0,3000)
START_MONEY(PLAYER1,800000)

MAX_CREATURES(PLAYER0,30)
MAX_CREATURES(PLAYER1,32)

ADD_CREATURE_TO_POOL(TROLL,5)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,2)
ADD_CREATURE_TO_POOL(SKELETON,20)
ADD_CREATURE_TO_POOL(SPIDER,10)

REM Creature availability
CREATURE_AVAILABLE(PLAYER0,TROLL,1,0)
CREATURE_AVAILABLE(PLAYER0,DEMONSPAWN,1,0)
CREATURE_AVAILABLE(PLAYER0,DARK_MISTRESS,1,0)
CREATURE_AVAILABLE(PLAYER0,BILE_DEMON,1,0)
CREATURE_AVAILABLE(PLAYER1,SORCEROR,1,0)
CREATURE_AVAILABLE(PLAYER1,SPIDER,1,0)
CREATURE_AVAILABLE(PLAYER1,SKELETON,1,0)

REM Room availability
ROOM_AVAILABLE(ALL_PLAYERS,GUARD_POST,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TREASURE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,RESEARCH,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,WORKSHOP,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,GARDEN,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,LAIR,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,GRAVEYARD,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,PRISON,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TORTURE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,SCAVENGER,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,BARRACKS,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TEMPLE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,BRIDGE,1,0)

ROOM_AVAILABLE(PLAYER1,TRAINING,1,1)
ROOM_AVAILABLE(PLAYER1,TREASURE,1,1)

REM Spells availability
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SIGHT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(PLAYER1,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SPEED,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)

MAGIC_AVAILABLE(PLAYER1,POWER_SIGHT,1,1)
MAGIC_AVAILABLE(PLAYER1,POWER_CALL_TO_ARMS,1,1)
MAGIC_AVAILABLE(PLAYER1,POWER_SPEED,1,1)
MAGIC_AVAILABLE(PLAYER1,POWER_PROTECT,1,1)
MAGIC_AVAILABLE(PLAYER1,POWER_HEAL_CREATURE,1,1)
MAGIC_AVAILABLE(PLAYER1,POWER_LIGHTNING,1,1)
REM Spellbooks for POWER_LIGHTNING, POWER_HEAL_CREATURE, POWER_PROTECT and POWER_DESTROY_WALL
REM can be found in the hero areas on map, so PLAYER0 doesn't need them 

REM Doors and traps availability
DOOR_AVAILABLE(ALL_PLAYERS,WOOD,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,BRACED,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,1,0)

TRAP_AVAILABLE(ALL_PLAYERS,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)

CREATE_PARTY(WIZZIES)
	ADD_TO_PARTY(WIZZIES,WIZARD,2,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WIZZIES,WIZARD,2,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WIZZIES,WIZARD,2,500,ATTACK_ENEMIES,0)

CREATE_PARTY(THIEVES)
	ADD_TO_PARTY(THIEVES,THIEF,4,500,STEAL_GOLD,0)
	ADD_TO_PARTY(THIEVES,THIEF,4,500,STEAL_GOLD,0)
	ADD_TO_PARTY(THIEVES,THIEF,4,500,STEAL_GOLD,0)
	ADD_TO_PARTY(THIEVES,THIEF,4,500,STEAL_GOLD,0)

CREATE_PARTY(SAMMIES)
	ADD_TO_PARTY(SAMMIES,SAMURAI,6,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SAMMIES,SAMURAI,6,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(SAMMIES,SAMURAI,6,1500,ATTACK_ENEMIES,0)

CREATE_PARTY(LANDLORD)
	ADD_TO_PARTY(LANDLORD,KNIGHT,9,1500,ATTACK_ENEMIES,0)

REM ****************************************************************************

REM "The people of this realm speak of a Dungeon Keeper called Wisel, who is bound to get in your way. When he does, you will have to consign him to history. This will be no mean feat. Resources are scarce because of his activities."
DISPLAY_OBJECTIVE(154,PLAYER0)

IF(PLAYER0,PRISON > 0)
	ROOM_AVAILABLE(ALL_PLAYERS,PRISON,1,1)
ENDIF

IF(PLAYER0,TORTURE > 0)
	ROOM_AVAILABLE(ALL_PLAYERS,TORTURE,1,1)
ENDIF

IF(PLAYER0,LAIR > 0)
	ROOM_AVAILABLE(ALL_PLAYERS,LAIR,1,1)
ENDIF

IF(PLAYER0,GARDEN > 0)
	ROOM_AVAILABLE(ALL_PLAYERS,GARDEN,1,1)
	ADD_CREATURE_TO_POOL(BILE_DEMON,1)
ENDIF

IF(PLAYER0,TRAINING > 0)
	ROOM_AVAILABLE(ALL_PLAYERS,TRAINING,1,1)
	ADD_CREATURE_TO_POOL(DEMONSPAWN,10)
ENDIF

IF(PLAYER0,GRAVEYARD > 0)
	ROOM_AVAILABLE(ALL_PLAYERS,GRAVEYARD,1,1)
ENDIF

IF(PLAYER0,RESEARCH > 0)
	ROOM_AVAILABLE(ALL_PLAYERS,RESEARCH,1,1)
	ADD_CREATURE_TO_POOL(SORCEROR,1)
ENDIF

IF(PLAYER0,TREASURE > 0)
	ROOM_AVAILABLE(ALL_PLAYERS,TREASURE,1,1)
ENDIF

IF(PLAYER0,WORKSHOP > 0)
	ROOM_AVAILABLE(ALL_PLAYERS,WORKSHOP,1,1)
	ADD_CREATURE_TO_POOL(TROLL,1)
ENDIF

IF(PLAYER0,TEMPLE > 0)
	ROOM_AVAILABLE(ALL_PLAYERS,TEMPLE,1,1)
ENDIF

IF(PLAYER0,SAMURAI > 0)
	REM "Your evil has corrupted a Samurai Warrior, he has forsaken honour to join your cause. Should your minions suffer heavy casualties, this Warrior will even call upon his brothers in arms to offer assistance. How kind. How stupid!"
	DISPLAY_INFORMATION(156,ALL_PLAYERS)
ENDIF

IF(PLAYER1,PRISON >= 9)
	SET_CREATURE_TENDENCIES(PLAYER1,IMPRISON,1)
ENDIF

IF_ACTION_POINT(1,PLAYER0)
	REM "This region of the underworld is riddled with tunnels and many heroes explore their labyrinthine ways. No-one said being evil would be easy."
	DISPLAY_INFORMATION(157,ALL_PLAYERS)
ENDIF

IF_ACTION_POINT(2,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WIZZIES,2,1)
ENDIF

IF_ACTION_POINT(3,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SAMMIES,8,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SAMMIES,9,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,LANDLORD,3,1)
ENDIF

IF_ACTION_POINT(4,PLAYER0)
	REM "It is rumoured that two Dragons are held captive somewhere east of here. Were you to find them and free them, they would make powerful servants."
	DISPLAY_INFORMATION(158,ALL_PLAYERS)
ENDIF

IF_ACTION_POINT(5,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THIEVES,5,1)
ENDIF

IF_ACTION_POINT(6,PLAYER0)
	REM "A tunnel to the north leads to the Lord of the Realm's domain. This gate is guarded well. It might be wise to direct the humans' attention towards your subterranean enemy."
	DISPLAY_INFORMATION(159,6)
ENDIF
	
IF_ACTION_POINT(10,PLAYER0)
	REM "These Boulder Traps are ideal for crushing the foe but there are only three of them at your disposal, so use them wisely."
	DISPLAY_INFORMATION(160,10)
	IF_AVAILABLE(PLAYER0,BOULDER >= 1)
		TUTORIAL_FLASH_BUTTON(53,-1)
	ENDIF
ENDIF

IF(PLAYER1,DUNGEON_DESTROYED == 1)
	REM "Wisel is defeated. The land is yours to plunder and despoil for all eternity. Give 'em hell, master."
	DISPLAY_OBJECTIVE(155,PLAYER0)
	WIN_GAME
ENDIF

REM ****************************************************************************
