REM ********************************************
REM  Burdened Imps' Level Pack for KeeperFX
REM  Script for Level 224, Silversong Fall
REM  Version 1.00
REM ********************************************

REM Basic stuff

SET_GENERATE_SPEED(500)
MAX_CREATURES(PLAYER0,18)
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,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,0,0)
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,0,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(ALL_PLAYERS,POWER_IMP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_OBEY,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SIGHT,0,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_LIGHTNING,0,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_DISEASE,0,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CHICKEN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DESTROY_WALLS,0,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_ARMAGEDDON,0,0)

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

REM Hero groups

CREATE_PARTY(SEARCH_ONE)
    ADD_TO_PARTY(SEARCH_ONE,THIEF,10,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(SEARCH_ONE,ARCHER,10,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(SEARCH_ONE,ARCHER,10,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(SEARCH_ONE,BARBARIAN,10,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(SEARCH_ONE,BARBARIAN,10,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(SEARCH_ONE,GIANT,10,400,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(SEARCH_TWO)
    ADD_TO_PARTY(SEARCH_TWO,WIZARD,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(SEARCH_TWO,BARBARIAN,10,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(SEARCH_TWO,BARBARIAN,10,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(SEARCH_TWO,SAMURAI,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(SEARCH_TWO,MONK,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(SEARCH_TWO,GIANT,10,400,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(KNIGHT)
    ADD_TO_PARTY(KNIGHT,WIZARD,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(KNIGHT,ARCHER,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(KNIGHT,ARCHER,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(KNIGHT,MONK,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(KNIGHT,SAMURAI,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(KNIGHT,GIANT,10,800,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(TOME)
    ADD_TO_PARTY(TOME,WIZARD,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(TOME,WIZARD,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(TOME,WIZARD,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(TOME,WIZARD,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(TOME,WITCH,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(TOME,WITCH,10,800,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(REVENGE_ONE)
    ADD_TO_PARTY(REVENGE_ONE,KNIGHT,10,1600,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_ONE,SAMURAI,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_ONE,SAMURAI,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_ONE,SAMURAI,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_ONE,GIANT,10,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_ONE,ARCHER,10,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_ONE,ARCHER,10,400,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(REVENGE_TWO)
    ADD_TO_PARTY(REVENGE_TWO,WIZARD,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_TWO,WIZARD,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_TWO,WIZARD,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_TWO,WITCH,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_TWO,WITCH,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_TWO,GIANT,10,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_TWO,GIANT,10,400,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(REVENGE_THREE)
    ADD_TO_PARTY(REVENGE_THREE,MONK,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_THREE,MONK,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_THREE,MONK,10,800,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_THREE,BARBARIAN,10,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_THREE,BARBARIAN,10,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_THREE,DWARFA,10,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_THREE,DWARFA,10,400,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(REVENGE_FOUR)
    ADD_TO_PARTY(REVENGE_FOUR,THIEF,10,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_FOUR,ARCHER,10,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_FOUR,ARCHER,10,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_FOUR,BARBARIAN,10,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_FOUR,BARBARIAN,10,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_FOUR,BARBARIAN,10,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(REVENGE_FOUR,GIANT,10,400,ATTACK_DUNGEON_HEART,0)

REM Win/Lose conditions/Objectives

DISPLAY_OBJECTIVE(60,ALL_PLAYERS)
REM QUICK_OBJECTIVE(0,"The village of Silversong has been deserted. Rumors are that the people have fled underground, hiding from their enemies above. Little do they know that there is more below the ground than they are led to believe. Pay them a little visit and make them understand that this is your domain. In other words, destroy their heart and eradicate every hero alive.",PLAYER0)

IF(PLAYER0,DUNGEON_DESTROYED == 1)
    LOSE_GAME
ENDIF

IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
    IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
        SET_FLAG(PLAYER_GOOD,FLAG1,1)
    ENDIF
ENDIF

IF(PLAYER_GOOD,FLAG1 == 1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,REVENGE_ONE,-1,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,REVENGE_TWO,-2,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,REVENGE_THREE,-3,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,REVENGE_FOUR,-4,1)
    SET_FLAG(PLAYER_GOOD,FLAG2,1)
    DISPLAY_OBJECTIVE(61,ALL_PLAYERS)
    REM QUICK_OBJECTIVE(1,"Heroes have come to take their revenge. There's quite a bunch of them. Good luck, Keeper. You might need it.",PLAYER0)
ENDIF

IF(PLAYER_GOOD,FLAG2 == 1)
    IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
        DISPLAY_OBJECTIVE(62,ALL_PLAYERS)
        REM QUICK_OBJECTIVE(2,"Well done, Keeper. Another piece of land added to your ever growing domain.",PLAYER0)
        WIN_GAME
    ENDIF
ENDIF

IF_ACTION_POINT(1,PLAYER0)
    SET_TIMER(PLAYER0,TIMER0)
    DISPLAY_INFORMATION(63,ALL_PLAYERS)
    REM QUICK_INFORMATION(3,"Just that you know, someone has undoubtly heard the destruction of this door. The heroes might be aware of your presence.")
ENDIF

IF(PLAYER0,TIMER0 >= 10000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SEARCH_ONE,-4,1)
    DISPLAY_INFORMATION(64,ALL_PLAYERS)
    REM QUICK_INFORMATION(4,"Beware, a party of heroes is on its way to find your dungeon heart.")
ENDIF

IF(PLAYER0,TIMER0 >= 20000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SEARCH_TWO,-4,1)
    DISPLAY_INFORMATION(65,ALL_PLAYERS)
    REM QUICK_INFORMATION(5,"Another try has been initiated to invade and destroy your dungeon. So you know.")
ENDIF

IF(PLAYER_GOOD,KNIGHT == 1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,KNIGHT,-4,1)
    DISPLAY_INFORMATION(66,ALL_PLAYERS)
    REM QUICK_INFORMATION(6,"Heads up, Keeper. More incoming heroes.")
ENDIF

IF_ACTION_POINT(2,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,TOME,-2,1)
    DISPLAY_INFORMATION(67,ALL_PLAYERS)
    REM QUICK_INFORMATION(7,"A few wizards did not agree on you taking their tome of wall shattering. They are after revenge, Keeper.")
ENDIF
