REM ********************************************
REM  Burdened Imps' Level Pack for KeeperFX
REM  Script for Level 227, Dreamweave Caverns
REM  Version 1.00
REM ********************************************

SET_GENERATE_SPEED(400)
MAX_CREATURES(PLAYER0,20)
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,0,0)
CREATURE_AVAILABLE(PLAYER0,BUG,0,0)
CREATURE_AVAILABLE(PLAYER0,DEMONSPAWN,0,0)
CREATURE_AVAILABLE(PLAYER0,SPIDER,1,1)
CREATURE_AVAILABLE(PLAYER0,SORCEROR,0,0)
CREATURE_AVAILABLE(PLAYER0,TROLL,1,1)
CREATURE_AVAILABLE(PLAYER0,BILE_DEMON,0,0)
CREATURE_AVAILABLE(PLAYER0,ORC,1,1)
CREATURE_AVAILABLE(PLAYER0,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(PLAYER0,DRAGON,0,0)
CREATURE_AVAILABLE(PLAYER0,HELL_HOUND,0,0)
CREATURE_AVAILABLE(PLAYER0,TENTACLE,0,0)
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,1)
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,0,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,0,0)

MAGIC_AVAILABLE(PLAYER0,POWER_IMP,0,0)
MAGIC_AVAILABLE(PLAYER0,POWER_OBEY,0,0)
MAGIC_AVAILABLE(PLAYER0,POWER_SIGHT,0,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CALL_TO_ARMS,0,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CAVE_IN,0,0)
MAGIC_AVAILABLE(PLAYER0,POWER_HEAL_CREATURE,0,0)
MAGIC_AVAILABLE(PLAYER0,POWER_HOLD_AUDIENCE,0,0)
MAGIC_AVAILABLE(PLAYER0,POWER_LIGHTNING,0,0)
MAGIC_AVAILABLE(PLAYER0,POWER_SPEED,0,0)
MAGIC_AVAILABLE(PLAYER0,POWER_PROTECT,0,0)
MAGIC_AVAILABLE(PLAYER0,POWER_CONCEAL,0,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,PRISON >= 1)
    ROOM_AVAILABLE(PLAYER0,PRISON,1,1)
ENDIF
IF(PLAYER0,TORTURE >= 1)
    ROOM_AVAILABLE(PLAYER0,TORTURE,1,1)
ENDIF
IF(PLAYER0,TEMPLE >= 1)
    ROOM_AVAILABLE(PLAYER0,TEMPLE,1,1)
ENDIF
IF(PLAYER0,GRAVEYARD >= 1)
    ROOM_AVAILABLE(PLAYER0,GRAVEYARD,1,1)
ENDIF

CREATE_PARTY(HEART_ONE)
    ADD_TO_PARTY(HEART_ONE,KNIGHT,10,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HEART_ONE,MONK,10,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HEART_ONE,MONK,10,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HEART_ONE,BARBARIAN,10,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HEART_ONE,BARBARIAN,10,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HEART_ONE,BARBARIAN,10,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HEART_ONE,BARBARIAN,10,400,ATTACK_ENEMIES,0)

CREATE_PARTY(HEART_TWO)
    ADD_TO_PARTY(HEART_TWO,SAMURAI,10,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HEART_TWO,GIANT,10,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HEART_TWO,GIANT,10,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HEART_TWO,FAIRY,10,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HEART_TWO,FAIRY,10,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HEART_TWO,AVATAR,10,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HEART_TWO,AVATAR,10,400,ATTACK_ENEMIES,0)

CREATE_PARTY(CAVE_ONE)
    ADD_TO_PARTY(CAVE_ONE,ARCHER,10,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(CAVE_ONE,ARCHER,10,400,ATTACK_ENEMIES,0)

CREATE_PARTY(CAVE_TWO)
    ADD_TO_PARTY(CAVE_TWO,ARCHER,10,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(CAVE_TWO,ARCHER,10,400,ATTACK_ENEMIES,0)

CREATE_PARTY(CAVE_THREE)
    ADD_TO_PARTY(CAVE_THREE,ARCHER,10,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(CAVE_THREE,ARCHER,10,400,ATTACK_ENEMIES,0)

CREATE_PARTY(CAVE_FOUR)
    ADD_TO_PARTY(CAVE_FOUR,ARCHER,10,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(CAVE_FOUR,ARCHER,10,400,ATTACK_ENEMIES,0)

CREATE_PARTY(CAVE_FIVE)
    ADD_TO_PARTY(CAVE_FIVE,DWARFA,4,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(CAVE_FIVE,DWARFA,4,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(CAVE_FIVE,THIEF,4,400,ATTACK_ENEMIES,0)

CREATE_PARTY(CAVE_SIX)
    ADD_TO_PARTY(CAVE_SIX,DWARFA,4,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(CAVE_SIX,THIEF,4,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(CAVE_SIX,THIEF,4,400,ATTACK_ENEMIES,0)

CREATE_PARTY(CAVE_SEVEN)
    ADD_TO_PARTY(CAVE_SEVEN,ARCHER,4,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(CAVE_SEVEN,DWARFA,4,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(CAVE_SEVEN,DWARFA,4,400,ATTACK_ENEMIES,0)

IF_ACTION_POINT(1,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HEART_ONE,-1,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HEART_TWO,-1,1)
ENDIF

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

IF_ACTION_POINT(3,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,CAVE_TWO,3,1)
ENDIF

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

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

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

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

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

DISPLAY_OBJECTIVE(90,ALL_PLAYERS)
REM QUICK_OBJECTIVE(0,"Four wizards have cast a spell of fear over your servants, Keeper. Twelve imps fled into the northern part of these caves. Find at least eight of them and make sure they live. Oh, your servants took your spellbooks as well. Time to do a thorough search.",PLAYER0)

IF(PLAYER0,IMP >= 8)
    DISPLAY_OBJECTIVE(91,ALL_PLAYERS)
REM QUICK_OBJECTIVE(1,"An imp was carrying your Create Imp spell in its backpack. You are back in business. Pay the wizards a little visit, one that they will not survive, and level their dungeon for good measure.",PLAYER0)
    MAGIC_AVAILABLE(PLAYER0,POWER_IMP,1,1)
ENDIF

IF(PLAYER0,DUNGEON_DESTROYED == 1)
    LOSE_GAME
ENDIF

IF(PLAYER_GOOD,WIZARD == 0)
    IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
        DISPLAY_OBJECTIVE(92,ALL_PLAYERS)
        REM QUICK_OBJECTIVE(2,"Revenge is ever so sweet, don't you agree, Keeper? A marvelous victory.",PLAYER0)
        WIN_GAME
    ENDIF
ENDIF
