REM ****************************************************************************
REM  Campaigns Consolidation Project for KeeperFX strategy game.
REM ****************************************************************************
REM  Script for DD Level Netzcaro
REM  Campaign: Deeper Dungeons
REM  Authors:  based on Bullfrog script
REM            KeeperFX CCP Team
REM  Date:     17 Dec 1996 - 9 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)

SET_GENERATE_SPEED(500)

START_MONEY(PLAYER0,10000)

MAX_CREATURES(PLAYER0,20)

ADD_CREATURE_TO_POOL(SORCEROR,10)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,20)
ADD_CREATURE_TO_POOL(ORC,20)

CREATURE_AVAILABLE(PLAYER0,SORCEROR,1,0)
CREATURE_AVAILABLE(PLAYER0,DARK_MISTRESS,1,0)
CREATURE_AVAILABLE(PLAYER0,ORC,1,0)

ROOM_AVAILABLE(ALL_PLAYERS,TREASURE,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,LAIR,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,TRAINING,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,RESEARCH,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,WORKSHOP,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,BARRACKS,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,GUARD_POST,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TORTURE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TEMPLE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,GRAVEYARD,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,GARDEN,1,1)
ROOM_AVAILABLE(PLAYER0,WORKSHOP,3,0)
ROOM_AVAILABLE(PLAYER0,PRISON,3,0)

TRAP_AVAILABLE(ALL_PLAYERS,ALARM,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,LAVA,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,7)
TRAP_AVAILABLE(ALL_PLAYERS,BOULDER,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,WORD_OF_POWER,1,0)

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(PLAYER1,POWER_SIGHT,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_OBEY,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SPEED,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CHICKEN,1,0)

CREATE_PARTY(WAITB)
	ADD_TO_PARTY(WAITB,DWARFA,6,750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITB,ARCHER,6,850,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITB,ARCHER,6,750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITB,WIZARD,7,1250,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITB,ARCHER,6,850,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITB,WIZARD,7,1250,ATTACK_ENEMIES,0)

CREATE_PARTY(WAITC)
	ADD_TO_PARTY(WAITC,WITCH,7,1550,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITC,WITCH,7,1550,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITC,WITCH,7,1550,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITC,WITCH,7,1550,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITC,MONK,8,1850,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITC,MONK,8,1750,ATTACK_ENEMIES,0)

CREATE_PARTY(WAITD)
	ADD_TO_PARTY(WAITD,SAMURAI,6,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITD,SAMURAI,6,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITD,SAMURAI,6,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITD,SAMURAI,6,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITD,SAMURAI,6,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITD,SAMURAI,6,1000,ATTACK_ENEMIES,0)

CREATE_PARTY(WAITE)
	ADD_TO_PARTY(WAITE,BARBARIAN,7,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITE,BARBARIAN,7,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITE,ARCHER,5,1250,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITE,ARCHER,5,1250,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WAITE,ARCHER,5,1250,ATTACK_ENEMIES,0)

CREATE_PARTY(FINALA)
	ADD_TO_PARTY(FINALA,SAMURAI,7,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FINALA,WITCH,7,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FINALA,THIEF,7,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FINALA,DWARFA,7,1500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FINALA,DWARFA,7,1500,ATTACK_ENEMIES,0)

CREATE_PARTY(FINALB)
	ADD_TO_PARTY(FINALB,BARBARIAN,8,2000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FINALB,BARBARIAN,8,2000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FINALB,BARBARIAN,8,2000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FINALB,FAIRY,8,2000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FINALB,FAIRY,8,2000,ATTACK_ENEMIES,0)

CREATE_PARTY(FINALC)
	ADD_TO_PARTY(FINALC,GIANT,8,2200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FINALC,GIANT,8,2200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FINALC,DWARFA,8,2200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FINALC,GIANT,8,2200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FINALC,DWARFA,8,2200,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(FINALC,DWARFA,8,2200,ATTACK_ENEMIES,0)

CREATE_PARTY(LANDLORD)
	ADD_TO_PARTY(LANDLORD,KNIGHT,10,5000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(LANDLORD,SAMURAI,10,2500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(LANDLORD,SAMURAI,10,2500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(LANDLORD,SAMURAI,10,2500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(LANDLORD,SAMURAI,10,2500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(LANDLORD,SAMURAI,10,2500,ATTACK_ENEMIES,0)

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

REM "The once strong hero fortress of this realm has grown rotten and weak. Tear down it's walls and let your creatures feast on the heroes within."
DISPLAY_OBJECTIVE(904)

REM Actions when reaching Action Points

IF_ACTION_POINT(2,PLAYER0)
	REM "This realm will be a test of your cunning and deviousness. Your dungeon has been fortified with seven steel doors to aid you in your conquest."
	DISPLAY_INFORMATION(905,2)
ENDIF

IF(PLAYER0,GAME_TURN >= 25000)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,FAIRY,14,5,4,1000)
ENDIF

IF_ACTION_POINT(3,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WAITB,4,1)
ENDIF

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

IF(PLAYER0,TIMER4 >= 500)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WAITC,5,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WAITD,6,1)
ENDIF

IF_ACTION_POINT(7,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WAITE,-1,1)
ENDIF

IF_SLAB_OWNER(79,48,PLAYER0)
	REM "Congratulations Keeper. This vial has given your researchers a much needed boost. You can now construct Bridges that enable you to traverse water and fire."
	DISPLAY_OBJECTIVE(906,1)
	ROOM_AVAILABLE(PLAYER0,BRIDGE,1,1)
ENDIF

REM Continuous sending of party WAITB until AP1 reached

SET_TIMER(PLAYER2,TIMER4)

IF(PLAYER2,TIMER4 >= 6000)
	IF(PLAYER2,FLAG4 == 0)
		NEXT_COMMAND_REUSABLE
		ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,WAITB,12,DUNGEON,0,3,500)
		NEXT_COMMAND_REUSABLE
		SET_TIMER(PLAYER2,TIMER4)
	ENDIF
ENDIF

IF_ACTION_POINT(1,PLAYER0)
	SET_FLAG(PLAYER2,FLAG4,1)
ENDIF

REM Continuous sending of party WAITC until AP3 reached

IF(PLAYER2,TIMER3 >= 8000)
	IF(PLAYER2,FLAG3 == 0)
		NEXT_COMMAND_REUSABLE
		ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,WAITC,13,DUNGEON,0,3,500)
		NEXT_COMMAND_REUSABLE
		SET_TIMER(PLAYER2,TIMER3)
	ENDIF
ENDIF

IF_ACTION_POINT(3,PLAYER0)
	SET_FLAG(PLAYER2,FLAG3,1)
ENDIF

REM When almost reached hero heart

IF_ACTION_POINT(8,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FINALA,9,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FINALB,10,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FINALC,11,1)
	SET_TIMER(PLAYER_GOOD,TIMER6)
ENDIF

IF(PLAYER_GOOD,TIMER6 >= 250)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,LANDLORD,PLAYER_GOOD,1)
ENDIF

IF(PLAYER_GOOD,TIMER6 >= 400)
	IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
		IF_CONTROLS(PLAYER_GOOD,KNIGHT <= 0)
			WIN_GAME
		ENDIF
	ENDIF
ENDIF

REM ***  End of File  **********************************************************
