REM ****************************************************************************
REM  Campaigns Consolidation Project for KeeperFX strategy game.
REM ****************************************************************************
REM  Script for DD Level Benetzaron
REM  Campaign: Deeper Dungeons
REM  Authors:  based on Bullfrog script
REM            KeeperFX CCP Team
REM  Date:     17 Dec 1996 - 10 Okt 2019
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 Flags used:
REM   PLAYER0,FLAG0 - Used for triggering main plot parties
REM Timers used:
REM   PLAYER0,TIMER0 - Used for spawning parties after AP3 trigger
REM   PLAYER0,TIMER1 - Used for spawning parties after AP4 trigger
REM   PLAYER0,TIMER2 - Used for spawning parties after AP6 trigger
REM   PLAYER0,TIMER3 - Used for spawning parties after AP7 trigger
REM   PLAYER0,TIMER6 - Final countdown after LANDLORD is spawned

SET_GENERATE_SPEED(500)

START_MONEY(PLAYER0,10000)

MAX_CREATURES(PLAYER0,20)

ADD_CREATURE_TO_POOL(TENTACLE,20)
ADD_CREATURE_TO_POOL(SORCEROR,20)
ADD_CREATURE_TO_POOL(BILE_DEMON,20)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,20)
ADD_CREATURE_TO_POOL(DRAGON,20)
ADD_CREATURE_TO_POOL(VAMPIRE,20)
ADD_CREATURE_TO_POOL(ORC,20)
ADD_CREATURE_TO_POOL(BUG,20)
ADD_CREATURE_TO_POOL(FLY,20)
ADD_CREATURE_TO_POOL(SPIDER,20)

CREATURE_AVAILABLE(PLAYER0,TENTACLE,1,0)
CREATURE_AVAILABLE(PLAYER0,SORCEROR,1,0)
CREATURE_AVAILABLE(PLAYER0,BILE_DEMON,1,0)
CREATURE_AVAILABLE(PLAYER0,DARK_MISTRESS,1,0)
CREATURE_AVAILABLE(PLAYER0,DRAGON,1,0)
CREATURE_AVAILABLE(PLAYER0,VAMPIRE,1,0)
CREATURE_AVAILABLE(PLAYER0,ORC,1,0)
CREATURE_AVAILABLE(PLAYER0,FLY,1,0)
CREATURE_AVAILABLE(PLAYER0,SPIDER,1,0)
CREATURE_AVAILABLE(PLAYER0,BUG,1,0)

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

MAGIC_AVAILABLE(PLAYER0,POWER_HAND,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_SLAP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_SPEED,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_LIGHTNING,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CONCEAL,1,0)

TRAP_AVAILABLE(ALL_PLAYERS,ALARM,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
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)
		
CREATE_PARTY(ONE)
	ADD_TO_PARTY(ONE,THIEF,2,400,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,THIEF,2,400,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,THIEF,2,400,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ONE,ARCHER,3,500,ATTACK_ENEMIES,0)

CREATE_PARTY(TWO)
	ADD_TO_PARTY(TWO,ARCHER,3,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,ARCHER,3,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,ARCHER,3,500,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(TWO,ARCHER,3,500,ATTACK_ENEMIES,0)

CREATE_PARTY(THREE)
	ADD_TO_PARTY(THREE,DWARFA,3,400,DEFEND_PARTY,0)
	ADD_TO_PARTY(THREE,DWARFA,3,400,STEAL_GOLD,0)
	ADD_TO_PARTY(THREE,WITCH,5,600,ATTACK_ENEMIES,0)

CREATE_PARTY(FOUR)
	ADD_TO_PARTY(FOUR,BARBARIAN,5,600,DEFEND_PARTY,0)
	ADD_TO_PARTY(FOUR,BARBARIAN,5,600,DEFEND_PARTY,0)
	ADD_TO_PARTY(FOUR,GIANT,5,600,ATTACK_ROOMS,0)
	ADD_TO_PARTY(FOUR,GIANT,5,600,ATTACK_ROOMS,0)

CREATE_PARTY(FIVE)
	ADD_TO_PARTY(FIVE,WITCH,6,1000,STEAL_SPELLS,0)
	ADD_TO_PARTY(FIVE,WITCH,6,1000,STEAL_SPELLS,0)

CREATE_PARTY(MEDMONKS)
	ADD_TO_PARTY(MEDMONKS,MONK,3,1200,STEAL_GOLD,0)
	ADD_TO_PARTY(MEDMONKS,MONK,3,1200,STEAL_GOLD,0)
	ADD_TO_PARTY(MEDMONKS,MONK,3,1200,STEAL_GOLD,0)

CREATE_PARTY(BARBERS)
	ADD_TO_PARTY(BARBERS,BARBARIAN,5,1000,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(BARBERS,BARBARIAN,5,1000,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(BARBERS,BARBARIAN,5,1000,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(BARBERS,BARBARIAN,5,1000,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(BARBERS,BARBARIAN,5,1000,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(BARBERS,BARBARIAN,5,1000,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(MEDWITCH)
	ADD_TO_PARTY(MEDWITCH,WITCH,9,1000,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(MEDWITCH,WITCH,9,1000,ATTACK_ENEMIES,0)

CREATE_PARTY(GIANTS)
	ADD_TO_PARTY(GIANTS,GIANT,7,1500,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(GIANTS,GIANT,7,1500,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(GIANTS,GIANT,7,1500,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(GIANTS,GIANT,7,1500,DEFEND_PARTY,0)
	ADD_TO_PARTY(GIANTS,GIANT,7,1500,DEFEND_PARTY,0)

CREATE_PARTY(ELITEMELEE)
	ADD_TO_PARTY(ELITEMELEE,BARBARIAN,8,1750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ELITEMELEE,BARBARIAN,8,1750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ELITEMELEE,BARBARIAN,8,1750,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(ELITEMELEE,THIEF,9,2000,DEFEND_PARTY,0)
	ADD_TO_PARTY(ELITEMELEE,THIEF,9,2000,DEFEND_PARTY,0)
	ADD_TO_PARTY(ELITEMELEE,GIANT,9,2000,ATTACK_ENEMIES,0)

CREATE_PARTY(SAMMIES)
	ADD_TO_PARTY(SAMMIES,SAMURAI,7,1500,DEFEND_PARTY,0)
	ADD_TO_PARTY(SAMMIES,SAMURAI,7,1500,DEFEND_PARTY,0)
	ADD_TO_PARTY(SAMMIES,SAMURAI,7,1500,DEFEND_PARTY,0)
	ADD_TO_PARTY(SAMMIES,SAMURAI,8,1750,DEFEND_PARTY,0)
	ADD_TO_PARTY(SAMMIES,SAMURAI,8,1750,DEFEND_PARTY,0)
	ADD_TO_PARTY(SAMMIES,WIZARD,10,3500,ATTACK_ENEMIES,0)

CREATE_PARTY(WITCHES)
	ADD_TO_PARTY(WITCHES,WITCH,8,1950,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WITCHES,WITCH,8,1950,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WITCHES,WITCH,8,1950,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WITCHES,WITCH,8,1950,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WITCHES,WITCH,8,1950,ATTACK_ENEMIES,0)
	ADD_TO_PARTY(WITCHES,WITCH,8,1950,ATTACK_ENEMIES,0)

CREATE_PARTY(LANDLORD)
	ADD_TO_PARTY(LANDLORD,KNIGHT,10,2500,ATTACK_DUNGEON_HEART,0)
	ADD_TO_PARTY(LANDLORD,ARCHER,9,1800,DEFEND_PARTY,0)
	ADD_TO_PARTY(LANDLORD,ARCHER,9,1800,DEFEND_PARTY,0)
	ADD_TO_PARTY(LANDLORD,ARCHER,9,1800,DEFEND_PARTY,0)
	ADD_TO_PARTY(LANDLORD,ARCHER,9,1800,DEFEND_PARTY,0)

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

REM "Explore this realm to uncover riches and secrets. Tread carefully Keeper, or you could be burned."
DISPLAY_OBJECTIVE(911,PLAYER0)

IF(PLAYER0,GAME_TURN >= 10000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,10,DUNGEON,0,2,500)
ENDIF

IF(PLAYER0,GAME_TURN >= 20000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,14,DUNGEON,0,5,700)
ENDIF

IF(PLAYER0,GAME_TURN >= 30000)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,15,DUNGEON,0,7,900)
ENDIF

IF(PLAYER0,PRISON >= 1)
	ROOM_AVAILABLE(PLAYER0,PRISON,1,1)
ENDIF

IF(PLAYER0,BRIDGE >= 1)
	ROOM_AVAILABLE(PLAYER0,BRIDGE,1,1)
ENDIF

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

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

IF(PLAYER0,TIMER0 >= 300)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TWO,3,1)
ENDIF

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

IF(PLAYER0,TIMER1 >= 400)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,4,1)
ENDIF

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

IF(PLAYER0,TIMER2 >= 150)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FOUR,6,1)
ENDIF

IF_ACTION_POINT(7,PLAYER0)
	SET_TIMER(PLAYER0,TIMER3)
ENDIF

IF(PLAYER0,TIMER3 >= 100)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIVE,7,1)
ENDIF

IF_ACTION_POINT(8,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,5,1)
ENDIF

IF_ACTION_POINT(9,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MEDMONKS,9,1)
ENDIF

IF_ACTION_POINT(10,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BARBERS,11,1)
ENDIF

IF_ACTION_POINT(12,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MEDWITCH,-1,1)
ENDIF

IF_ACTION_POINT(13,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,GIANTS,13,1)
ENDIF

IF_CONTROLS(PLAYER_GOOD,TOTAL_CREATURES <= 5)
	SET_FLAG(PLAYER0,FLAG0,1)
ENDIF

IF(PLAYER0,FLAG0 >= 1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THREE,7,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIVE,4,1)
	IF_CONTROLS(PLAYER_GOOD,TOTAL_CREATURES <= 5)
		SET_FLAG(PLAYER0,FLAG0,2)
	ENDIF
ENDIF

IF(PLAYER0,FLAG0 >= 2)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BARBERS,2,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MEDWITCH,3,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MEDMONKS,5,1)
	IF_CONTROLS(PLAYER_GOOD,TOTAL_CREATURES <= 5)
		SET_FLAG(PLAYER0,FLAG0,3)
	ENDIF
ENDIF

IF(PLAYER0,FLAG0 >= 3)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,GIANTS,1,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WITCHES,4,1)
	IF_CONTROLS(PLAYER_GOOD,MONK <= 1)
		SET_FLAG(PLAYER0,FLAG0,4)
	ENDIF
ENDIF

IF(PLAYER0,FLAG0 >= 4)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ELITEMELEE,2,1)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SAMMIES,3,1)
	IF_CONTROLS(PLAYER_GOOD,TOTAL_CREATURES <= 5)
		SET_FLAG(PLAYER0,FLAG0,5)
	ENDIF
ENDIF

IF(PLAYER0,FLAG0 >= 5)
	ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,LANDLORD,7,DUNGEON,0,1,250)
	ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,WIZARD,7,5,9,1200)
	SET_TIMER(PLAYER0,TIMER6)
ENDIF

IF(PLAYER0,TIMER6 >= 200)
	IF_CONTROLS(PLAYER_GOOD,KNIGHT <= 0)
		WIN_GAME
	ENDIF
ENDIF

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