REM Level from "Evil Keeper" campaign CD
REM Copyright 1997 Digital Media
REM LEVEL 20 (FINAL)

SET_GENERATE_SPEED(500)
MAX_CREATURES(PLAYER0,25)
START_MONEY(PLAYER0,20000)

REM Creatures pool and availability

ADD_CREATURE_TO_POOL(TROLL,5)
ADD_CREATURE_TO_POOL(SKELETON,5)
ADD_CREATURE_TO_POOL(HELL_HOUND,5)
ADD_CREATURE_TO_POOL(TENTACLE,5)
ADD_CREATURE_TO_POOL(SORCEROR,10)
ADD_CREATURE_TO_POOL(BILE_DEMON,15)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,15)
ADD_CREATURE_TO_POOL(DRAGON,12)
ADD_CREATURE_TO_POOL(VAMPIRE,5)
ADD_CREATURE_TO_POOL(ORC,10)
ADD_CREATURE_TO_POOL(HORNY,1)

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

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,BRIDGE,1,0)
ROOM_AVAILABLE(PLAYER0,WORKSHOP,1,1)
ROOM_AVAILABLE(PLAYER0,BARRACKS,1,0)
ROOM_AVAILABLE(PLAYER0,GUARD_POST,1,0)
ROOM_AVAILABLE(PLAYER0,PRISON,1,1)
ROOM_AVAILABLE(PLAYER0,TORTURE,1,1)
ROOM_AVAILABLE(PLAYER0,SCAVENGER,1,0)
ROOM_AVAILABLE(PLAYER0,TEMPLE,1,0)
ROOM_AVAILABLE(PLAYER0,GRAVEYARD,1,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)
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)
DOOR_AVAILABLE(ALL_PLAYERS,WOOD,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,BRACED,1,0)

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SIGHT,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SPEED,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_LIGHTNING,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DESTROY_WALLS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CHICKEN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DISEASE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_ARMAGEDDON,1,0)

REM Definition of hero partys

CREATE_PARTY(DIEBE)
    ADD_TO_PARTY(DIEBE,THIEF,6,600,STEAL_GOLD,0)
    ADD_TO_PARTY(DIEBE,THIEF,6,600,STEAL_GOLD,0)
    ADD_TO_PARTY(DIEBE,THIEF,6,600,STEAL_GOLD,0)
    ADD_TO_PARTY(DIEBE,THIEF,6,600,STEAL_GOLD,0)
    ADD_TO_PARTY(DIEBE,ARCHER,5,500,DEFEND_PARTY,0)
    ADD_TO_PARTY(DIEBE,ARCHER,5,500,DEFEND_PARTY,0)

CREATE_PARTY(EINS)
    ADD_TO_PARTY(EINS,THIEF,6,600,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(EINS,THIEF,6,600,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(EINS,THIEF,6,600,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(EINS,ARCHER,5,500,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(EINS,ARCHER,5,500,ATTACK_ENEMIES,0)

CREATE_PARTY(ZWEI)
    ADD_TO_PARTY(ZWEI,ARCHER,7,700,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ZWEI,ARCHER,7,700,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ZWEI,ARCHER,7,700,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ZWEI,ARCHER,7,700,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ZWEI,ARCHER,7,700,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ZWEI,ARCHER,7,700,ATTACK_ENEMIES,0)

CREATE_PARTY(DREI)
    ADD_TO_PARTY(DREI,DWARFA,5,400,DEFEND_PARTY,0)
    ADD_TO_PARTY(DREI,DWARFA,5,400,STEAL_GOLD,0)
    ADD_TO_PARTY(DREI,WITCH,6,600,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(DREI,WITCH,6,600,ATTACK_ENEMIES,0)

CREATE_PARTY(VIER)
    ADD_TO_PARTY(VIER,BARBARIAN,6,600,DEFEND_PARTY,0)
    ADD_TO_PARTY(VIER,BARBARIAN,6,600,DEFEND_PARTY,0)
    ADD_TO_PARTY(VIER,BARBARIAN,6,600,DEFEND_PARTY,0)
    ADD_TO_PARTY(VIER,GIANT,6,600,ATTACK_ROOMS,0)
    ADD_TO_PARTY(VIER,GIANT,6,600,ATTACK_ROOMS,0)
    ADD_TO_PARTY(VIER,GIANT,6,600,ATTACK_ROOMS,0)

CREATE_PARTY(FUENF)
    ADD_TO_PARTY(FUENF,WITCH,7,1000,STEAL_SPELLS,0)
    ADD_TO_PARTY(FUENF,WITCH,7,1000,STEAL_SPELLS,0)
    ADD_TO_PARTY(FUENF,MONK,7,1200,STEAL_GOLD,0)
    ADD_TO_PARTY(FUENF,MONK,7,1200,STEAL_GOLD,0)
    ADD_TO_PARTY(FUENF,MONK,7,1200,STEAL_GOLD,0)
    ADD_TO_PARTY(FUENF,MONK,7,1200,STEAL_GOLD,0)

CREATE_PARTY(SECHS)
    ADD_TO_PARTY(SECHS,MONK,8,1200,STEAL_GOLD,0)
    ADD_TO_PARTY(SECHS,MONK,8,1200,STEAL_GOLD,0)
    ADD_TO_PARTY(SECHS,MONK,8,1200,STEAL_GOLD,0)
    ADD_TO_PARTY(SECHS,MONK,8,1200,STEAL_GOLD,0)
    ADD_TO_PARTY(SECHS,MONK,8,1200,STEAL_GOLD,0)
    ADD_TO_PARTY(SECHS,MONK,8,1200,STEAL_GOLD,0)

CREATE_PARTY(SIEBEN)
    ADD_TO_PARTY(SIEBEN,BARBARIAN,6,1500,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(SIEBEN,BARBARIAN,7,1500,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(SIEBEN,BARBARIAN,6,1500,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(SIEBEN,BARBARIAN,7,1500,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(SIEBEN,BARBARIAN,6,1500,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(SIEBEN,BARBARIAN,7,1500,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(ACHT)
    ADD_TO_PARTY(ACHT,BARBARIAN,6,1000,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(ACHT,BARBARIAN,6,1000,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(ACHT,BARBARIAN,6,1000,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(ACHT,BARBARIAN,6,1000,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(ACHT,BARBARIAN,6,1000,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(ACHT,BARBARIAN,6,1000,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(NEUN)
    ADD_TO_PARTY(NEUN,BARBARIAN,7,1000,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(NEUN,BARBARIAN,7,1000,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(NEUN,BARBARIAN,7,1000,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(NEUN,BARBARIAN,7,1000,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(NEUN,BARBARIAN,7,1000,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(NEUN,BARBARIAN,7,1000,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(ZEHN)
    ADD_TO_PARTY(ZEHN,WITCH,10,2000,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ZEHN,WITCH,10,2000,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ZEHN,WITCH,10,2000,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ZEHN,WITCH,10,2000,ATTACK_ENEMIES,0)

CREATE_PARTY(HARA)
    ADD_TO_PARTY(HARA,SAMURAI,9,2000,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(HARA,SAMURAI,9,2000,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(HARA,SAMURAI,9,2000,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(HARA,SAMURAI,9,2000,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(HARA,SAMURAI,9,2000,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(HARA,SAMURAI,9,2000,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(RITTER)
    ADD_TO_PARTY(RITTER,KNIGHT,10,3500,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(RITTER,ARCHER,10,1800,DEFEND_PARTY,0)
    ADD_TO_PARTY(RITTER,ARCHER,10,1800,DEFEND_PARTY,0)
    ADD_TO_PARTY(RITTER,ARCHER,10,1800,DEFEND_PARTY,0)
    ADD_TO_PARTY(RITTER,ARCHER,10,1800,DEFEND_PARTY,0)
    ADD_TO_PARTY(RITTER,ARCHER,10,1800,DEFEND_PARTY,0)

CREATE_PARTY(AVA)
    ADD_TO_PARTY(AVA,AVATAR,10,5500,ATTACK_DUNGEON_HEART,0)

DISPLAY_OBJECTIVE(132,PLAYER0)

REM General messages

IF(PLAYER0,DARK_MISTRESS >= 1)
    DISPLAY_INFORMATION(67,PLAYER0)
ENDIF

IF(PLAYER0,HORNY >= 1)
    DISPLAY_INFORMATION(83,PLAYER0)
ENDIF

REM Action points

IF_ACTION_POINT(3,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SIEBEN,2,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FUENF,2,1)
ENDIF

IF_ACTION_POINT(5,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,VIER,-9,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SECHS,-10,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FUENF,-8,1)
ENDIF

IF_ACTION_POINT(6,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SECHS,-6,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SIEBEN,-5,1)
ENDIF

IF_ACTION_POINT(1,PLAYER0)
    ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,DIEBE,2,DUNGEON,1,6,100)
    ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,EINS,2,DUNGEON,1,6,100)
    ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ZWEI,2,DUNGEON,1,6,100)
ENDIF

REM Knights with the Avatar

IF_ACTION_POINT(4,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HARA,-1,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,RITTER,-1,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,NEUN,-2,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ZEHN,-2,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,AVA,-2,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ACHT,-1,1)
    IF(PLAYER_GOOD,KNIGHT == 0)
        IF(PLAYER_GOOD,AVATAR == 0)
            DISPLAY_OBJECTIVE(39,PLAYER0)
            SET_TIMER(PLAYER_GOOD,TIMER0)
            SET_FLAG(PLAYER_GOOD,FLAG1,1)
        ENDIF
    ENDIF
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 300)
    DISPLAY_INFORMATION(171,PLAYER0)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 800)
    DISPLAY_OBJECTIVE(136,PLAYER0)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 1200)
    DISPLAY_OBJECTIVE(167,PLAYER0)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 4600)
    DISPLAY_OBJECTIVE(41,PLAYER0)
ENDIF

REM The enemies starts comming

IF(PLAYER_GOOD,TIMER0 >= 7500)
    DISPLAY_INFORMATION(103,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,DREI,2,1)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 9500)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,VIER,-7,1)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 11500)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FUENF,-3,1)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 13000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SECHS,-8,1)
ENDIF

REM Second enemy wave

IF(PLAYER_GOOD,TIMER0 >= 18000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SIEBEN,-4,1)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 20500)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ACHT,-9,1)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 21000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,NEUN,-10,1)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 22000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ZEHN,-5,1)
ENDIF

REM Third enemy wave

IF(PLAYER_GOOD,TIMER0 >= 24500)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SECHS,-6,1)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 25500)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FUENF,-1,1)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 26000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,VIER,-2,1)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 27500)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ACHT,2,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,NEUN,2,1)
ENDIF

IF(PLAYER_GOOD,FLAG1 == 1)
    IF(PLAYER_GOOD,TIMER0 >= 30500)
        ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,AVA,2,DUNGEON,0,1,250)
        ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,HARA,2,DUNGEON,0,1,250)
        SET_FLAG(PLAYER_GOOD,FLAG2,1)
    ENDIF
ENDIF

REM Win conditions

IF(PLAYER_GOOD,FLAG2 == 1)
    IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
        IF(PLAYER_GOOD,KNIGHT == 0)
            IF(PLAYER_GOOD,AVATAR == 0)
                DISPLAY_INFORMATION(172,PLAYER0)
                WIN_GAME
            ENDIF
        ENDIF
    ENDIF
ENDIF

REM Lose conditions

IF(PLAYER0,DUNGEON_DESTROYED == 1)
    DISPLAY_INFORMATION(163,PLAYER0)
    LOSE_GAME
ENDIF
