REM ********************************************
REM  Burdened Imps' Level Pack for KeeperFX
REM  Script for Level 223, Raven's Claw
REM  Version 1.00
REM ********************************************

REM Basic stuff

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

SET_CREATURE_MAX_LEVEL(PLAYER0,THIEF,10)

ADD_CREATURE_TO_POOL(FLY,20)
ADD_CREATURE_TO_POOL(BUG,20)
ADD_CREATURE_TO_POOL(DEMONSPAWN,20)
ADD_CREATURE_TO_POOL(SPIDER,20)
ADD_CREATURE_TO_POOL(SORCEROR,20)
ADD_CREATURE_TO_POOL(TROLL,20)
ADD_CREATURE_TO_POOL(BILE_DEMON,20)
ADD_CREATURE_TO_POOL(ORC,20)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,20)
ADD_CREATURE_TO_POOL(DRAGON,20)
ADD_CREATURE_TO_POOL(HELL_HOUND,20)
ADD_CREATURE_TO_POOL(TENTACLE,20)
ADD_CREATURE_TO_POOL(SKELETON,20)
ADD_CREATURE_TO_POOL(GHOST,20)
ADD_CREATURE_TO_POOL(VAMPIRE,20)

CREATURE_AVAILABLE(PLAYER0,FLY,1,1)
CREATURE_AVAILABLE(PLAYER0,BUG,1,1)
CREATURE_AVAILABLE(PLAYER0,DEMONSPAWN,0,0)
CREATURE_AVAILABLE(PLAYER0,SPIDER,1,1)
CREATURE_AVAILABLE(PLAYER0,SORCEROR,1,1)
CREATURE_AVAILABLE(PLAYER0,TROLL,1,1)
CREATURE_AVAILABLE(PLAYER0,BILE_DEMON,1,1)
CREATURE_AVAILABLE(PLAYER0,ORC,1,1)
CREATURE_AVAILABLE(PLAYER0,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(PLAYER0,DRAGON,1,1)
CREATURE_AVAILABLE(PLAYER0,HELL_HOUND,1,1)
CREATURE_AVAILABLE(PLAYER0,TENTACLE,1,1)
CREATURE_AVAILABLE(PLAYER0,SKELETON,0,0)
CREATURE_AVAILABLE(PLAYER0,GHOST,0,0)
CREATURE_AVAILABLE(PLAYER0,VAMPIRE,0,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,BRIDGE,1,0)
ROOM_AVAILABLE(PLAYER0,GUARD_POST,1,0)
ROOM_AVAILABLE(PLAYER0,PRISON,1,0)
ROOM_AVAILABLE(PLAYER0,TORTURE,1,0)
ROOM_AVAILABLE(PLAYER0,TEMPLE,1,0)
ROOM_AVAILABLE(PLAYER0,GRAVEYARD,0,0)
ROOM_AVAILABLE(PLAYER0,SCAVENGER,0,0)

TRAP_AVAILABLE(PLAYER0,ALARM,1,0)
TRAP_AVAILABLE(PLAYER0,POISON_GAS,1,0)
TRAP_AVAILABLE(PLAYER0,LIGHTNING,1,0)
TRAP_AVAILABLE(PLAYER0,LAVA,1,0)
TRAP_AVAILABLE(PLAYER0,BOULDER,1,0)
TRAP_AVAILABLE(PLAYER0,WORD_OF_POWER,1,0)
DOOR_AVAILABLE(PLAYER0,WOOD,0,0)
DOOR_AVAILABLE(PLAYER0,BRACED,1,0)
DOOR_AVAILABLE(PLAYER0,STEEL,1,0)
DOOR_AVAILABLE(PLAYER0,MAGIC,1,0)

MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_OBEY,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_SIGHT,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_HOLD_AUDIENCE,0,0)
MAGIC_AVAILABLE(PLAYER0,POWER_LIGHTNING,0,0)
MAGIC_AVAILABLE(PLAYER0,POWER_SPEED,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(PLAYER0,POWER_DISEASE,0,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CHICKEN,0,0)
MAGIC_AVAILABLE(PLAYER0,POWER_DESTROY_WALLS,0,0)
MAGIC_AVAILABLE(PLAYER0,POWER_ARMAGEDDON,0,0)

IF(PLAYER0,BRIDGE >= 1)
    ROOM_AVAILABLE(PLAYER0,BRIDGE,1,1)
ENDIF
IF(PLAYER0,WORKSHOP >= 1)
    ROOM_AVAILABLE(PLAYER0,WORKSHOP,1,1)
ENDIF
IF(PLAYER0,BARRACKS >= 1)
    ROOM_AVAILABLE(PLAYER0,BARRACKS,1,1)
ENDIF
IF(PLAYER0,PRISON >= 1)
    ROOM_AVAILABLE(PLAYER0,PRISON,1,1)
ENDIF
IF(PLAYER0,TORTURE >= 1)
    ROOM_AVAILABLE(PLAYER0,TORTURE,1,1)
ENDIF
IF(PLAYER0,GRAVEYARD >= 1)
    ROOM_AVAILABLE(PLAYER0,GRAVEYARD,1,1)
ENDIF
IF(PLAYER0,SCAVENGER >= 1)
    ROOM_AVAILABLE(PLAYER0,SCAVENGER,1,1)
ENDIF
IF(PLAYER0,TEMPLE >= 1)
    ROOM_AVAILABLE(PLAYER0,TEMPLE,1,1)
ENDIF
IF(PLAYER0,SCAVENGER >= 1)
    ROOM_AVAILABLE(PLAYER0,SCAVENGER,1,1)
ENDIF
IF(PLAYER0,GUARD_POST >= 1)
    ROOM_AVAILABLE(PLAYER0,GUARD_POST,1,1)
ENDIF

REM ----------------------- Hero groups

CREATE_PARTY(SLEEP_ONE)
    ADD_TO_PARTY(SLEEP_ONE,GHOST,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SLEEP_ONE,GHOST,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SLEEP_ONE,GHOST,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SLEEP_ONE,GHOST,9,0,ATTACK_ENEMIES,0)

CREATE_PARTY(SLEEP_TWO)
    ADD_TO_PARTY(SLEEP_TWO,GHOST,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SLEEP_TWO,GHOST,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SLEEP_TWO,GHOST,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SLEEP_TWO,GHOST,9,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SLEEP_TWO,GHOST,9,0,ATTACK_ENEMIES,0)

CREATE_PARTY(COURT_ONE)
    ADD_TO_PARTY(COURT_ONE,SKELETON,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(COURT_ONE,SKELETON,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(COURT_ONE,SKELETON,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(COURT_ONE,SKELETON,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(COURT_ONE,SKELETON,9,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(COURT_ONE,SKELETON,9,0,ATTACK_ENEMIES,0)

CREATE_PARTY(COURT_TWO)
    ADD_TO_PARTY(COURT_TWO,SKELETON,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(COURT_TWO,SKELETON,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(COURT_TWO,SKELETON,9,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(COURT_TWO,SKELETON,9,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(COURT_TWO,SKELETON,9,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(COURT_TWO,SKELETON,10,0,ATTACK_ENEMIES,0)

CREATE_PARTY(LIBRARY)
    ADD_TO_PARTY(LIBRARY,GHOST,9,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(LIBRARY,GHOST,9,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(LIBRARY,GHOST,10,0,ATTACK_ENEMIES,0)

CREATE_PARTY(TOWER)
    ADD_TO_PARTY(TOWER,SKELETON,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TOWER,SKELETON,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TOWER,SKELETON,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TOWER,SKELETON,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TOWER,SKELETON,9,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TOWER,SKELETON,9,0,ATTACK_ENEMIES,0)

CREATE_PARTY(HALLWAY_ONE)
    ADD_TO_PARTY(HALLWAY_ONE,SKELETON,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HALLWAY_ONE,SKELETON,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HALLWAY_ONE,SKELETON,9,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HALLWAY_ONE,SKELETON,9,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HALLWAY_ONE,SKELETON,10,0,ATTACK_ENEMIES,0)

CREATE_PARTY(HALLWAY_TWO)
    ADD_TO_PARTY(HALLWAY_TWO,SKELETON,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HALLWAY_TWO,SKELETON,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HALLWAY_TWO,SKELETON,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HALLWAY_TWO,SKELETON,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HALLWAY_TWO,SKELETON,8,0,ATTACK_ENEMIES,0)

CREATE_PARTY(CAVE_ENT)
    ADD_TO_PARTY(CAVE_ENT,SKELETON,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(CAVE_ENT,SKELETON,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(CAVE_ENT,SKELETON,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(CAVE_ENT,SKELETON,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(CAVE_ENT,SKELETON,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(CAVE_ENT,SKELETON,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(CAVE_ENT,SKELETON,10,0,ATTACK_ENEMIES,0)

CREATE_PARTY(VAMPIRE)
    ADD_TO_PARTY(VAMPIRE,SKELETON,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(VAMPIRE,SKELETON,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(VAMPIRE,SKELETON,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(VAMPIRE,SKELETON,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(VAMPIRE,SKELETON,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(VAMPIRE,GHOST,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(VAMPIRE,GHOST,10,0,ATTACK_ENEMIES,0)

CREATE_PARTY(TOWER_ONE)
    ADD_TO_PARTY(TOWER_ONE,SKELETON,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TOWER_ONE,SKELETON,8,0,ATTACK_ENEMIES,0)

CREATE_PARTY(TOWER_TWO)
    ADD_TO_PARTY(TOWER_TWO,SKELETON,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TOWER_TWO,SKELETON,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TOWER_TWO,SKELETON,8,0,ATTACK_ENEMIES,0)

CREATE_PARTY(TOWER_THREE)
    ADD_TO_PARTY(TOWER_THREE,SKELETON,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TOWER_THREE,SKELETON,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TOWER_THREE,SKELETON,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(TOWER_THREE,SKELETON,10,0,ATTACK_ENEMIES,0)

CREATE_PARTY(SORC_ONE)
    ADD_TO_PARTY(SORC_ONE,FLY,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SORC_ONE,FLY,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SORC_ONE,FLY,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SORC_ONE,FLY,10,0,ATTACK_ENEMIES,0)

CREATE_PARTY(SORC_TWO)
    ADD_TO_PARTY(SORC_TWO,SPIDER,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SORC_TWO,SPIDER,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SORC_TWO,SPIDER,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SORC_TWO,SPIDER,10,0,ATTACK_ENEMIES,0)

REM ----------------------- Win/Lose conditions/Objectives

DISPLAY_OBJECTIVE(51,ALL_PLAYERS)
REM QUICK_OBJECTIVE(0,"Four distinct mages are currently researching ways of becoming a Keeper such as yourself. If they would succeed there would be four more keepers threatening your land. Flush them out while they are still simple mortals. They are holed up in a cave called the Raven's Claw, past an ancient monastery.",PLAYER0)

IF(PLAYER_GOOD,VAMPIRE == 0)
    SET_FLAG(PLAYER0,FLAG1,1)
    DISPLAY_INFORMATION(53,ALL_PLAYERS)
    REM QUICK_INFORMATION(3,"Von Lichstein. His bloodsucking days are quite over. A masterful victory.")
ENDIF

IF(PLAYER_GOOD,WITCH == 0)
    SET_FLAG(PLAYER0,FLAG2,1)
    DISPLAY_INFORMATION(54,ALL_PLAYERS)
    REM QUICK_INFORMATION(4,"Shakara, voodoo witch extraordinaire. She also majored in the summoning of various types of demons. It is almost a shame to see such a talent wasted... Almost.")
ENDIF

IF(PLAYER_GOOD,WIZARD == 0)
    SET_FLAG(PLAYER0,FLAG3,1)
    DISPLAY_INFORMATION(55,ALL_PLAYERS)
    REM QUICK_INFORMATION(5,"Tovus the Dread, a powerful wizard. Now known as Tovus the Dead. He bled before he could have fled. Well done.")
ENDIF

IF(PLAYER_GOOD,SORCEROR == 0)
    SET_FLAG(PLAYER0,FLAG4,1)
    DISPLAY_INFORMATION(56,ALL_PLAYERS)
    REM QUICK_INFORMATION(6,"Xaan, once a warlock of great stature. Now he lies on the floor in his own pool of blood. And his 'stature' died with him. That old fool.")
ENDIF

IF(PLAYER0,FLAG1 == 1)
    IF(PLAYER0,FLAG2 == 1)
        IF(PLAYER0,FLAG3 == 1)
            IF(PLAYER0,FLAG4 == 1)
                DISPLAY_OBJECTIVE(52,ALL_PLAYERS)
REM QUICK_OBJECTIVE(1,"All mages have been most efficiently removed. This will save you some time in the future for more important things. Like torturing your prisoners. Or slapping your imps. Or see a skeleton play with a group of hellhounds. Or play with your gold. Or flirt with a mistress. Well done.",PLAYER0)
                WIN_GAME
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF(PLAYER0,DUNGEON_DESTROYED == 1)
    LOSE_GAME
ENDIF

IF_ACTION_POINT(1,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SLEEP_ONE,1,1)
ENDIF

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

IF_ACTION_POINT(3,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,COURT_ONE,3,1)
    DISPLAY_INFORMATION(57,ALL_PLAYERS)
    REM QUICK_INFORMATION(2,"Quite the haunted place, Keeper. Such fun your minions must have!")
ENDIF

IF_ACTION_POINT(4,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,LIBRARY,4,1)
ENDIF

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

IF_ACTION_POINT(6,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,COURT_TWO,6,1)
ENDIF

IF_ACTION_POINT(7,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,CAVE_ENT,7,1)
ENDIF

IF_ACTION_POINT(8,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,VAMPIRE,8,1)
ENDIF

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

IF_ACTION_POINT(10,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,VAMPIRE,10,1)
ENDIF

IF_ACTION_POINT(11,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,VAMPIRE,11,1)
ENDIF

IF_ACTION_POINT(12,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,VAMPIRE,12,1)
ENDIF

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

IF_ACTION_POINT(14,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HALLWAY_ONE,14,1)
ENDIF

IF_ACTION_POINT(15,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HALLWAY_TWO,15,1)
ENDIF

IF_ACTION_POINT(16,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,VAMPIRE,16,1)
ENDIF

IF_ACTION_POINT(17,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TOWER_ONE,17,1)
ENDIF

IF_ACTION_POINT(18,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TOWER_TWO,18,1)
ENDIF

IF_ACTION_POINT(19,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TOWER_THREE,19,1)
ENDIF

IF_ACTION_POINT(20,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,CAVE_ENT,20,1)
ENDIF

IF_ACTION_POINT(21,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SORC_ONE,21,1)
ENDIF

IF_ACTION_POINT(22,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SORC_TWO,22,1)
ENDIF
