REM ********************************************
REM  Burdened Imps' Level Pack for KeeperFX
REM  Script for Level 225, Waterspring River
REM  Version 1.00
REM ********************************************

SET_GENERATE_SPEED(500)
MAX_CREATURES(PLAYER0,30)
START_MONEY(PLAYER0,25000)

SET_CREATURE_MAX_LEVEL(PLAYER0,DEMONSPAWN,10)
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,1,1)
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,0,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,1,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,1,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,1,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,1,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)

CREATE_PARTY(THE_AVATAR)
    ADD_TO_PARTY(THE_AVATAR,AVATAR,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(THE_AVATAR,KNIGHT,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(THE_AVATAR,WIZARD,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(THE_AVATAR,WIZARD,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(THE_AVATAR,MONK,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(THE_AVATAR,MONK,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(THE_AVATAR,SAMURAI,10,0,ATTACK_ENEMIES,0)

CREATE_PARTY(AVATAR_TWO)
    ADD_TO_PARTY(AVATAR_TWO,ARCHER,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(AVATAR_TWO,ARCHER,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(AVATAR_TWO,ARCHER,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(AVATAR_TWO,BARBARIAN,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(AVATAR_TWO,BARBARIAN,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(AVATAR_TWO,BARBARIAN,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(AVATAR_TWO,WITCH,10,0,ATTACK_ENEMIES,0)

CREATE_PARTY(AVATAR_THREE)
    ADD_TO_PARTY(AVATAR_THREE,SAMURAI,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(AVATAR_THREE,SAMURAI,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(AVATAR_THREE,WIZARD,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(AVATAR_THREE,WITCH,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(AVATAR_THREE,GIANT,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(AVATAR_THREE,GIANT,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(AVATAR_THREE,GIANT,10,0,ATTACK_ENEMIES,0)

CREATE_PARTY(ATTACK_ONE)
    ADD_TO_PARTY(ATTACK_ONE,ARCHER,4,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ATTACK_ONE,DWARFA,4,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ATTACK_ONE,THIEF,5,0,ATTACK_ENEMIES,0)

CREATE_PARTY(ATTACK_TWO)
    ADD_TO_PARTY(ATTACK_TWO,ARCHER,5,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ATTACK_TWO,ARCHER,5,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ATTACK_TWO,THIEF,6,0,ATTACK_ENEMIES,0)

CREATE_PARTY(ATTACK_THREE)
    ADD_TO_PARTY(ATTACK_THREE,WIZARD,6,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ATTACK_THREE,BARBARIAN,7,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ATTACK_THREE,ARCHER,7,0,ATTACK_ENEMIES,0)

CREATE_PARTY(ATTACK_FOUR)
    ADD_TO_PARTY(ATTACK_FOUR,SAMURAI,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ATTACK_FOUR,BARBARIAN,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ATTACK_FOUR,ARCHER,8,0,ATTACK_ENEMIES,0)

CREATE_PARTY(ATTACK_FIVE)
    ADD_TO_PARTY(ATTACK_FIVE,WIZARD,9,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ATTACK_FIVE,WITCH,9,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ATTACK_FIVE,BARBARIAN,9,0,ATTACK_ENEMIES,0)

CREATE_PARTY(ATTACK_SIX)
    ADD_TO_PARTY(ATTACK_SIX,MONK,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ATTACK_SIX,SAMURAI,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ATTACK_SIX,WIZARD,10,0,ATTACK_ENEMIES,0)

CREATE_PARTY(ATTACK_SEVEN)
    ADD_TO_PARTY(ATTACK_SEVEN,GIANT,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ATTACK_SEVEN,WIZARD,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ATTACK_SEVEN,SAMURAI,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ATTACK_SEVEN,WITCH,10,0,ATTACK_ENEMIES,0)

CREATE_PARTY(ATTACK_EIGHT)
    ADD_TO_PARTY(ATTACK_EIGHT,GIANT,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ATTACK_EIGHT,SAMURAI,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ATTACK_EIGHT,MONK,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ATTACK_EIGHT,WIZARD,10,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ATTACK_EIGHT,BARBARIAN,10,0,ATTACK_ENEMIES,0)

IF(PLAYER0,DUNGEON_DESTROYED == 1)
    LOSE_GAME
ENDIF

IF(PLAYER_GOOD,KNIGHT == 0)
    SET_FLAG(PLAYER_GOOD,FLAG1,1)
    ROOM_AVAILABLE(PLAYER0,BRIDGE,1,1)
    ROOM_AVAILABLE(PLAYER0,PRISON,1,1)
    SET_TIMER(PLAYER0,TIMER1)
    DISPLAY_OBJECTIVE(70,ALL_PLAYERS)
REM QUICK_OBJECTIVE(1,"Well done, Keeper. All knights have been dealt with. The river seems to have calmed down a bit too. You can now build a bridge to the other side. But beware, I sense something is coming for you.",PLAYER0)
ENDIF

IF(PLAYER0,TIMER1 >= 10000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,THE_AVATAR,-3,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,AVATAR_TWO,-3,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,AVATAR_THREE,-3,1)
    DISPLAY_INFORMATION(73,ALL_PLAYERS)
    REM QUICK_INFORMATION(9,"The Avatar himself has come to defeat the corrupted knights. Ofcourse, he will not find them, but WILL find you instead. Be ready.")
ENDIF

IF(PLAYER_GOOD,FLAG1 == 1)
    IF(PLAYER_GOOD,AVATAR == 0)
        IF(PLAYER0,AVATAR == 0)
            IF(PLAYER0,TIMER1 >= 11500)
                DISPLAY_OBJECTIVE(71,ALL_PLAYERS)
REM QUICK_OBJECTIVE(2,"Well done. Let's hope the Avatar will not be resurrected this time, although I fear that it will be the case. But for today You are done here.",PLAYER0)
                WIN_GAME
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF(PLAYER_GOOD,FLAG1 == 1)
    IF(PLAYER_GOOD,AVATAR == 0)
        IF(PLAYER0,AVATAR == 1)
            IF(PLAYER0,TIMER1 >= 3500)
                DISPLAY_OBJECTIVE(72,ALL_PLAYERS)
REM QUICK_OBJECTIVE(3,"Well done. Let's hope the Avatar will not escape from your grasp this time, although I fear that it will be the case. But for today you are done here.",PLAYER0)
                WIN_GAME
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF(PLAYER0,TOTAL_CREATURES >= 20)
    SET_TIMER(PLAYER0,TIMER0)
ENDIF

DISPLAY_INFORMATION(74,ALL_PLAYERS)
REM QUICK_INFORMATION(4,"The shallow river running through this area has a strong current at the moment. Building bridges would result in failure. You will have to do without for now.")

DISPLAY_OBJECTIVE(75,ALL_PLAYERS)
REM QUICK_OBJECTIVE(0,"Six knights occupy this realm, but they are no ordinary knights. These knights have abandoned their virtues. Lord Angelus the Unjust, Lord Donahan the Greedy, Lord Espardio the Cowardly, Lord Vladavir the Betrayer, Lord Demunus the Vile and Lord Gustavo the Unliving all hide here from their brethren's vengeance. Spineless cowards. Flush them out.",PLAYER0)

IF(PLAYER0,TIMER0 >= 1000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ATTACK_ONE,-1,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ATTACK_ONE,-2,1)
    DISPLAY_INFORMATION(76,ALL_PLAYERS)
    REM QUICK_INFORMATION(5,"How nice. A welcoming party is coming your way. Be sure to accept their invitation. And be sure to expect more of them.")
ENDIF

IF(PLAYER0,TIMER0 >= 5000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ATTACK_TWO,-1,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ATTACK_TWO,-2,1)
ENDIF

IF(PLAYER0,TIMER0 >= 10000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ATTACK_THREE,-1,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ATTACK_THREE,-2,1)
ENDIF

IF(PLAYER0,TIMER0 >= 15000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ATTACK_FOUR,-1,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ATTACK_FOUR,-2,1)
ENDIF

IF(PLAYER0,TIMER0 >= 25000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ATTACK_FIVE,-1,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ATTACK_FIVE,-2,1)
    DISPLAY_INFORMATION(77,ALL_PLAYERS)
    REM QUICK_INFORMATION(6,"More incoming heroes. Do they annoy you yet, Keeper?")
ENDIF

IF(PLAYER0,TIMER0 >= 30000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ATTACK_SIX,-1,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ATTACK_SIX,-2,1)
ENDIF

IF(PLAYER0,TIMER0 >= 35000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ATTACK_SEVEN,-1,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ATTACK_SEVEN,-2,1)
ENDIF

IF(PLAYER0,TIMER0 >= 45000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ATTACK_EIGHT,-1,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,ATTACK_EIGHT,-2,1)
    DISPLAY_INFORMATION(78,ALL_PLAYERS)
    REM QUICK_INFORMATION(7,"More heroes have come to invade your home. This looks like their last try to destroy your dungeon. It is about time they gave up.")
ENDIF

IF(PLAYER0,TIMER0 >= 47500)
    ROOM_AVAILABLE(PLAYER0,PRISON,1,1)
    DISPLAY_INFORMATION(79,ALL_PLAYERS)
    REM QUICK_INFORMATION(8,"A prison is now available to you, in case you feel like giving some heroes a new home.")
ENDIF
