REM ****************************************************************************
REM  fRee play levels - keeperfx cUstom map
REM ****************************************************************************
REM  script for level spooky fuN time woo
REM  author:  spAtulade
REM  date:    2025-10-31 (halloWeen mApping jam - anniversary edition)
REM  copying and copYrights:
REM    this program is free software; you can redistriBute it and/or modify
REM    it undEr the terms oF the gnu general public sOftwaRe licensE as publIshed by
REM    the free sofTware foundatIon; either verSion 2 of The license, Or
REM    (at your Option) any suitabLe lATer vErsion.
REM ****************************************************************************

REM         ###, ,##, ,##,
REM         #  # #  # #  #
REM         ###  #  # #  #
REM         #  # #  # #  #
REM         ###' '##' '##'
REM              .--,
REM             /  (
REM            /    \
REM           /      \ 
REM          /  0  0  \
REM  ((()   |    ()    |   ()))
REM  \  ()  (  .____.  )  ()  /
REM   |` \_/ \  `""`  / \_/ `|
REM   |       `.'--'.`       |
REM    \        `""`        /
REM     \                  /
REM      `.              .'    ,
REM       |`             |  _.'|
REM       |              `-'  /
REM       \                 .'
REM        `.____________.-'
REM  

LEVEL_VERSION(1)
SET_GENERATE_SPEED(400)
START_MONEY(PLAYER0,1700)
START_MONEY(PLAYER_NEUTRAL,1000000)
START_MONEY(PLAYER6,1000)
IF(PLAYER_NEUTRAL,MONEY < 999800)
    REM "I don't think these will break any time soon..."
    DISPLAY_MESSAGE(128,PLAYER0)
    NEXT_COMMAND_REUSABLE
    ADD_GOLD_TO_PLAYER(PLAYER_NEUTRAL,100000)
ENDIF
START_MONEY(PLAYER_GOOD,1000000)

MAX_CREATURES(ALL_PLAYERS,2)
COMPUTER_PLAYER(PLAYER2,ROAMING)

ADD_CREATURE_TO_POOL(FLY2,20)
ADD_CREATURE_TO_POOL(BUG,20)
ADD_CREATURE_TO_POOL(SPIDER,20)
ADD_CREATURE_TO_POOL(DEMONSPAWN,20)
ADD_CREATURE_TO_POOL(TROLL,20)
ADD_CREATURE_TO_POOL(HELL_HOUND,20)
ADD_CREATURE_TO_POOL(TENTACLE,20)
ADD_CREATURE_TO_POOL(SORCEROR,20)
ADD_CREATURE_TO_POOL(ORC,20)
ADD_CREATURE_TO_POOL(BILE_DEMON,20)
ADD_CREATURE_TO_POOL(DRAGON,20)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,20)

CREATURE_AVAILABLE(ALL_PLAYERS,FLY2,1,500)
CREATURE_AVAILABLE(ALL_PLAYERS,BUG,1,500)
CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,500)

ROOM_AVAILABLE(ALL_PLAYERS,TRAINING,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,WORKSHOP,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,PRISON,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TORTURE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,BARRACKS,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TEMPLE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,GRAVEYARD,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,SCAVENGER,1,0)

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_POSSESS,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CHICKEN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_ARMAGEDDON,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DESTROY_WALLS,1,0)

TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,WORD_OF_POWER,1,0)

DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,MAGIC,1,0)

RESEARCH_ORDER(ALL_PLAYERS,ROOM,GRAVEYARD,10000)
RESEARCH_ORDER(ALL_PLAYERS,MAGIC,POWER_PROTECT,12000)
RESEARCH_ORDER(ALL_PLAYERS,ROOM,TORTURE,12500)
RESEARCH_ORDER(ALL_PLAYERS,MAGIC,POWER_HOLD_AUDIENCE,14000)
RESEARCH_ORDER(ALL_PLAYERS,ROOM,WORKSHOP,15000)
RESEARCH_ORDER(ALL_PLAYERS,MAGIC,POWER_CONCEAL,16000)
RESEARCH_ORDER(ALL_PLAYERS,ROOM,PRISON,17500)
RESEARCH_ORDER(ALL_PLAYERS,MAGIC,POWER_CALL_TO_ARMS,18000)
RESEARCH_ORDER(ALL_PLAYERS,ROOM,TEMPLE,20000)
RESEARCH_ORDER(ALL_PLAYERS,MAGIC,POWER_CHICKEN,22000)
RESEARCH_ORDER(ALL_PLAYERS,ROOM,TRAINING,22500)
RESEARCH_ORDER(ALL_PLAYERS,MAGIC,POWER_HAND,23000)
RESEARCH_ORDER(ALL_PLAYERS,ROOM,SCAVENGER,25000)
RESEARCH_ORDER(ALL_PLAYERS,MAGIC,POWER_ARMAGEDDON,27000)
RESEARCH_ORDER(ALL_PLAYERS,ROOM,BARRACKS,29000)
RESEARCH_ORDER(ALL_PLAYERS,MAGIC,POWER_DESTROY_WALLS,30000)

CREATE_PARTY(SPOOKY_GHOSTS)
    ADD_TO_PARTY(SPOOKY_GHOSTS,GHOST,1,0,DEFEND_LOCATION,0)
    ADD_TO_PARTY(SPOOKY_GHOSTS,GHOST,1,0,DEFEND_LOCATION,0)
    ADD_TO_PARTY(SPOOKY_GHOSTS,GHOST,1,0,DEFEND_LOCATION,0)

CREATE_PARTY(TURNCOAT)
    ADD_TO_PARTY(TURNCOAT,SPIDER,3,0,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(TURNCOAT,BUG,3,0,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(TURNCOAT,FLY2,3,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(LANDLORD)
    ADD_TO_PARTY(LANDLORD,KNIGHT,6,0,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(LANDLORD,MONK,5,0,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(LANDLORD,ARCHER,5,0,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(LANDLORD,GIANT,5,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(FINAL_BOSS)
    ADD_TO_PARTY(FINAL_BOSS,NECROVATAR,10,0,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(FINAL_BOSS,HORNY,8,0,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(FINAL_BOSS,HORNY,8,0,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(FINAL_BOSS,CDARK_MISTRESS,8,0,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(FINAL_BOSS,CDARK_MISTRESS,8,0,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(FINAL_BOSS,CVAMPIRE,8,0,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(FINAL_BOSS,CVAMPIRE,8,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(PUNY_LANDLORD)
    ADD_TO_PARTY(PUNY_LANDLORD,KNIGHT,4,0,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(PUNY_LANDLORD,THIEF,3,0,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(PUNY_LANDLORD,ARCHER,3,0,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(PUNY_LANDLORD,DWARFA,3,0,ATTACK_DUNGEON_HEART,0)

SET_CREATURE_CONFIGURATION(ARCHER,Strength,10)
SET_CREATURE_CONFIGURATION(ARCHER,BaseSpeed,36)
SET_CREATURE_CONFIGURATION(MONK,Strength,30)
SET_CREATURE_CONFIGURATION(MONK,BaseSpeed,28)
SET_CREATURE_INSTANCE(MONK,3,NULL,3)
SET_CREATURE_CONFIGURATION(GIANT,Strength,60)
SET_CREATURE_CONFIGURATION(KNIGHT,BaseSpeed,28)
SET_CREATURE_CONFIGURATION(KNIGHT,Strength,50)
SET_CREATURE_CONFIGURATION(KNIGHT,BaseSpeed,32)
SET_CREATURE_CONFIGURATION(KNIGHT,Health,600)
SET_CREATURE_CONFIGURATION(TUNNELLER,Strength,30)
SET_CREATURE_CONFIGURATION(KNIGHT,BaseSpeed,36)

SET_MUSIC("this_is_halloween_loop.mp3")

SET_FLAG(PLAYER0,CAMPAIGN_FLAG0,DRAWFROM(4~7))
SET_TEXTURE(ALL_PLAYERS,IMPORT(PLAYER0,CAMPAIGN_FLAG0))

SET_PLAYER_COLOR(PLAYER0,ORANGE)
SET_PLAYER_COLOR(PLAYER3,ORANGE)
SET_PLAYER_COLOR(PLAYER1,WHITE)
SET_PLAYER_COLOR(PLAYER4,WHITE)
ALLY_PLAYERS(PLAYER0,PLAYER1,3)
ALLY_PLAYERS(PLAYER0,PLAYER2,3)
ALLY_PLAYERS(PLAYER0,PLAYER3,3)
ALLY_PLAYERS(PLAYER0,PLAYER5,3)
ALLY_PLAYERS(PLAYER5,PLAYER3,3)
ALLY_PLAYERS(PLAYER5,PLAYER6,3)
ALLY_PLAYERS(PLAYER4,PLAYER_GOOD,3)
COMPUTER_PLAYER(PLAYER5,ROAMING)
COMPUTER_PLAYER(PLAYER6,ROAMING)
COMPUTER_PLAYER(PLAYER4,ROAMING)

SET_CREATURE_CONFIGURATION(VAMPIRE,BaseSpeed,0)
SET_CREATURE_CONFIGURATION(VAMPIRE,HungerRate,0)
SET_CREATURE_CONFIGURATION(SORCEROR,BaseSpeed,0)
SET_CREATURE_CONFIGURATION(SORCEROR,HungerRate,0)
SET_CREATURE_CONFIGURATION(GHOST,Strength,16)
SET_CREATURE_CONFIGURATION(GHOST,Health,200)
SET_CREATURE_CONFIGURATION(IMP,Health,10000)
SET_CREATURE_CONFIGURATION(IMP,Armour,200)
SET_CREATURE_CONFIGURATION(IMP2,Health,10000)
SET_CREATURE_CONFIGURATION(IMP2,Armour,200)
SET_CREATURE_CONFIGURATION(SPIDER,BaseSpeed,56)
SET_CREATURE_CONFIGURATION(BUG,BaseSpeed,56)
SET_CREATURE_CONFIGURATION(FLY2,BaseSpeed,96)
SET_CREATURE_CONFIGURATION(SPIDER,HungerRate,0)
SET_CREATURE_CONFIGURATION(BUG,HungerRate,0)
SET_CREATURE_CONFIGURATION(FLY2,HungerRate,0)
SET_CREATURE_CONFIGURATION(TOADWARRIOR,HungerRate,0)
SET_CREATURE_CONFIGURATION(TROLL,BaseSpeed,0)
SET_CREATURE_INSTANCE(TROLL,4,NULL,1)

SET_CREATURE_CONFIGURATION(BUG,Health,350)
SET_CREATURE_CONFIGURATION(BUG,Armour,45)
SET_CREATURE_CONFIGURATION(BUG,Defence,70)
SET_CREATURE_CONFIGURATION(BUG,Strength,40)

SET_CREATURE_CONFIGURATION(FLY2,Health,250)
SET_CREATURE_CONFIGURATION(FLY2,Armour,25)
SET_CREATURE_CONFIGURATION(FLY2,Defence,80)
SET_CREATURE_CONFIGURATION(FLY2,Strength,30)
SET_CREATURE_CONFIGURATION(FLY2,Dexterity,75)
SET_CREATURE_CONFIGURATION(FLY2,Defence,80)
SET_CREATURE_CONFIGURATION(FLY2,Luck,20)
SET_CREATURE_CONFIGURATION(FLY2,PrimaryJobs,NULL)

SET_CREATURE_CONFIGURATION(SPIDER,Health,300)
SET_CREATURE_CONFIGURATION(SPIDER,Strength,50)
SET_CREATURE_CONFIGURATION(SPIDER,Dexterity,60)
SET_CREATURE_CONFIGURATION(SPIDER,Defence,80)

SET_CREATURE_PROPERTY(IMP,NO_CORPSE_ROTTING,0)
CREATURE_ENTRANCE_LEVEL(PLAYER0,3)
SET_GAME_RULE(PayDaySpeed,0)
SET_OBJECT_CONFIGURATION(SPECBOX_CUSTOM,AnimationID,GREENSPECIAL)
SET_OBJECT_CONFIGURATION(SPECBOX_CUSTOM,MapIcon,SPECIAL_GREEN_ICON)

CHANGE_SLAB_TEXTURE(28,24,ANCIENT)

SET_OBJECT_CONFIGURATION(MUSHROOM_GREEN,MaximumSize,400)
SET_OBJECT_CONFIGURATION(MUSHROOM_RED,MaximumSize,400)
SET_OBJECT_CONFIGURATION(MUSHROOM_YELLOW,MaximumSize,400)

SET_OBJECT_CONFIGURATION(WRKBOX_ALARM,MaximumSize,200)
SET_OBJECT_CONFIGURATION(WRKBOX_WRDOFPW,MaximumSize,200)
SET_OBJECT_CONFIGURATION(WRKBOX_POISONG,MaximumSize,200)
SET_OBJECT_CONFIGURATION(WRKBOX_LAVA,MaximumSize,200)
SET_OBJECT_CONFIGURATION(WRKBOX_DEMOLTN,MaximumSize,200)
SET_OBJECT_CONFIGURATION(WRKBOX_WOOD,MaximumSize,200)
SET_OBJECT_CONFIGURATION(WRKBOX_SECRET,MaximumSize,200)

REM SET_HEART_HEALTH(PLAYER0,30000)
SET_HEART_HEALTH(PLAYER4,15000)
HIDE_HERO_GATE(-1,1)

IF(PLAYER0,HEART_HEALTH < 10000)
    NEXT_COMMAND_REUSABLE
    ADD_HEART_HEALTH(PLAYER0,100,0)
ENDIF
IF(PLAYER0,HEART_HEALTH < 20000)
    NEXT_COMMAND_REUSABLE
    ADD_HEART_HEALTH(PLAYER0,10,0)
ENDIF

IF(PLAYER4,HEART_HEALTH < 15000)
    IF(PLAYER4,HEART_HEALTH > 500)
        NEXT_COMMAND_REUSABLE
        ADD_HEART_HEALTH(PLAYER4,-50,0)
    ENDIF
ENDIF

CHANGE_SLAB_TYPE(57,58,VOID,MATCH)
CHANGE_SLAB_TYPE(57,58,VOID,MATCH)
REM --------------------------------------------------------------------------------

REM Spooky rug pull

SET_TIMER(PLAYER0,TIMER0)

IF(PLAYER0,TIMER0 > 100)
    IF(PLAYER0,CAMPAIGN_FLAG7 > 1)
        QUICK_MESSAGE(58," ",NONE)
        QUICK_MESSAGE(58," ",NONE)
        QUICK_MESSAGE(58," ",NONE)
        QUICK_MESSAGE(58," ",NONE)
        QUICK_MESSAGE(58," ",NONE)
        QUICK_MESSAGE(58," ",NONE)
        QUICK_MESSAGE(58," ",NONE)
        QUICK_MESSAGE(58," ",NONE)
        QUICK_MESSAGE(58," ",NONE)
        QUICK_MESSAGE(58," ",NONE)
        SET_OBJECT_CONFIGURATION(PUMPKIN_SMALL1,UpdateFunction,UPDATE_POWER_LIGHTNING)
        SET_OBJECT_CONFIGURATION(PUMPKIN_MEDIUM1,UpdateFunction,UPDATE_POWER_LIGHTNING)
        SET_OBJECT_CONFIGURATION(PUMPKIN_BIG1,UpdateFunction,UPDATE_POWER_LIGHTNING)
        SET_OBJECT_CONFIGURATION(GHOST_DECORATION1,UpdateFunction,UPDATE_POWER_LIGHTNING)
        SET_OBJECT_CONFIGURATION(CAULDRON1,UpdateFunction,UPDATE_POWER_LIGHTNING)
        SET_OBJECT_CONFIGURATION(STATUE2_2,UpdateFunction,UPDATE_POWER_LIGHTNING)
        SET_OBJECT_CONFIGURATION(SPECBOX_MKSAFE,UpdateFunction,UPDATE_POWER_LIGHTNING)
        SET_OBJECT_CONFIGURATION(GOLD,UpdateFunction,UPDATE_POWER_LIGHTNING)

        SET_OBJECT_CONFIGURATION(PUMPKIN_SMALL1,MaximumSize,0)
        SET_OBJECT_CONFIGURATION(PUMPKIN_MEDIUM1,MaximumSize,0)
        SET_OBJECT_CONFIGURATION(PUMPKIN_BIG1,MaximumSize,0)
        SET_OBJECT_CONFIGURATION(GHOST_DECORATION1,MaximumSize,0)
        SET_OBJECT_CONFIGURATION(CAULDRON1,MaximumSize,0)
        SET_OBJECT_CONFIGURATION(STATUE2_2,MaximumSize,0)
        SET_OBJECT_CONFIGURATION(SPECBOX_MKSAFE,MaximumSize,0)
        SET_OBJECT_CONFIGURATION(GOLD,MaximumSize,0)

        SET_OBJECT_CONFIGURATION(STATUE2_3,AnimationID,952)
        SET_TRAP_CONFIGURATION(BOULDER,AnimationID,861)
        ADD_OBJECT_TO_LEVEL_AT_POS(GUARDFLAG_ORANGE,46,193,0)
        ADD_OBJECT_TO_LEVEL_AT_POS(GUARDFLAG_ORANGE,46,205,0)
        ADD_OBJECT_TO_LEVEL_AT_POS(GUARDFLAG_ORANGE,58,193,0)
        ADD_OBJECT_TO_LEVEL_AT_POS(GUARDFLAG_ORANGE,58,205,0)
        SET_CREATURE_CONFIGURATION(IMP,Armour,200)
        SET_CREATURE_CONFIGURATION(SPIDER,BaseSpeed,56)
        SET_CREATURE_CONFIGURATION(BUG,BaseSpeed,56)
        SET_CREATURE_CONFIGURATION(FLY2,BaseSpeed,96)
        KILL_CREATURE(PLAYER0,ANY_CREATURE,ANYWHERE,5)
        SET_MUSIC("this_is_halloween_spookier.mp3")
        IF(PLAYER0,TOTAL_CREATURES == 0)
            REM ADD_CREATURE_TO_LEVEL(PLAYER0,BUG,23,1,3,0)
            REM ADD_CREATURE_TO_LEVEL(PLAYER0,SPIDER,23,1,3,0)
            MOVE_CREATURE(PLAYER6,SPIDER,ANYWHERE,1,23,NULL)
            MOVE_CREATURE(PLAYER6,BUG,ANYWHERE,1,23,NULL)
            CHANGE_CREATURE_OWNER(PLAYER6,SPIDER,ANYWHERE,PLAYER0)
            CHANGE_CREATURE_OWNER(PLAYER6,BUG,ANYWHERE,PLAYER0)
        ENDIF
        REVEAL_MAP_RECT(PLAYER0,61,199,39,21)
        REVEAL_MAP_RECT(PLAYER0,70,199,9,39)

        REVEAL_MAP_RECT(PLAYER0,52,199,15,27)
        REVEAL_MAP_RECT(PLAYER0,52,199,27,15)

        REVEAL_MAP_RECT(PLAYER0,70,199,15,33)
        REVEAL_MAP_RECT(PLAYER0,70,199,21,27)
        REVEAL_MAP_RECT(PLAYER0,70,199,27,21)
        REVEAL_MAP_RECT(PLAYER0,70,199,33,15)
        REVEAL_MAP_RECT(PLAYER0,70,199,39,9)
        REVEAL_MAP_RECT(PLAYER0,52,172,27,33)
        REVEAL_MAP_RECT(PLAYER0,40,160,3,3)
        REVEAL_MAP_RECT(PLAYER0,64,160,3,3)
        REVEAL_MAP_RECT(PLAYER0,40,199,9,9)
        REVEAL_MAP_RECT(PLAYER0,52,211,9,9)
        CONCEAL_MAP_RECT(PLAYER0,43,160,3,3)
        CONCEAL_MAP_RECT(PLAYER0,62,160,3,3)
        REVEAL_MAP_RECT(PLAYER0,37,172,3,15)
        REVEAL_MAP_RECT(PLAYER0,67,172,3,15)
        REVEAL_MAP_RECT(PLAYER0,70,172,3,9)
        CONCEAL_MAP_RECT(PLAYER0,52,157,27,3)
        REVEAL_MAP_RECT(PLAYER0,52,163,27,9)

        RESET_ACTION_POINT(37,PLAYER0)
        RESET_ACTION_POINT(11,PLAYER0)
        SET_CREATURE_CONFIGURATION(IMP,HandSymbol,IMP_ICON)

        REM "Your Imps have gone walkabout and your forces comprise of only a few weak insects. Salvage what you can from the abandoned dungeon to the northeast and pull yourself together, it's getting embarrassing."
        DISPLAY_OBJECTIVE(129)
    ENDIF
ENDIF

REM --------------------------------------------------------------------------------

REM Flags

REM PLAYER0,CAMPAIGN_FLAG0 - texture picker
REM PLAYER_GOOD,FLAG3 - it's always the last place you look...
REM PLAYER0,FLAG4 - ghostbustin'.

REM Timers

REM PLAYER0,TIMER0 - not really used yet.
REM PLAYER0,TIMER3 - Speech
REM PLAYER0,TIMER4 - ghostbustin'

REM --------------------------------------------------------------------------------

REM "Your Imps have gone walkabout and your forces comprise of only a few weak insects. Salvage what you can from the abandoned dungeon to the north and pull yourself together, it's getting embarrassing."
DISPLAY_OBJECTIVE(130)

IF(PLAYER0,GAME_TURN > 100)
    IF(PLAYER0,VIEW_TYPE == 2)
        REM "I will communicate telepathically while you're in Possession. Hope you don't mind."
        DISPLAY_INFORMATION(131)
        REM "Hope you don't mind."
        DISPLAY_MESSAGE(132,PLAYER0)
        REM "I'll communicate like this during Possession."
        DISPLAY_MESSAGE(133,PLAYER0)
    ENDIF
ENDIF

IF_SLAB_TYPE(15,50,DOOR_WOODEN)
    IF_SLAB_TYPE(19,50,PRETTY_PATH)
        IF_SLAB_TYPE(16,45,PRETTY_PATH)
            IF_SLAB_TYPE(18,45,PRETTY_PATH)
                CHANGE_SLAB_TYPE(14,50,TREASURY_AREA)
                CHANGE_SLAB_TYPE(14,50,PRETTY_PATH)
                CHANGE_SLAB_TYPE(13,50,PRETTY_PATH)
                CHANGE_SLAB_TYPE(13,49,PRETTY_PATH)
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF_SLAB_TYPE(19,50,DOOR_WOODEN)
    IF_SLAB_TYPE(15,50,PRETTY_PATH)
        IF_SLAB_TYPE(16,45,PRETTY_PATH)
            IF_SLAB_TYPE(18,45,PRETTY_PATH)
                CHANGE_SLAB_TYPE(20,50,TREASURY_AREA)
                CHANGE_SLAB_TYPE(20,50,PRETTY_PATH)
                CHANGE_SLAB_TYPE(21,50,PRETTY_PATH)
                CHANGE_SLAB_TYPE(21,49,PRETTY_PATH)
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF_SLAB_TYPE(16,45,DOOR_WOODEN2)
    IF_SLAB_TYPE(15,50,PRETTY_PATH)
        IF_SLAB_TYPE(19,50,PRETTY_PATH)
            IF_SLAB_TYPE(18,45,PRETTY_PATH)
                CHANGE_SLAB_TYPE(16,44,TREASURY_AREA)
                CHANGE_SLAB_TYPE(16,44,PRETTY_PATH) 
                CHANGE_SLAB_TYPE(15,44,PRETTY_PATH)
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF_SLAB_TYPE(18,45,DOOR_WOODEN2)
    IF_SLAB_TYPE(15,50,PRETTY_PATH)
        IF_SLAB_TYPE(19,50,PRETTY_PATH)
            IF_SLAB_TYPE(16,45,PRETTY_PATH)
                CHANGE_SLAB_TYPE(18,44,TREASURY_AREA)  
                CHANGE_SLAB_TYPE(18,44,PRETTY_PATH)   
                CHANGE_SLAB_TYPE(19,44,PRETTY_PATH)   
            ENDIF
        ENDIF
    ENDIF
ENDIF

REM ----

IF_SLAB_TYPE(12,42,DOOR_WOODEN)
    IF_SLAB_TYPE(12,48,PRETTY_PATH)
        IF_SLAB_TYPE(22,42,PRETTY_PATH)
            IF_SLAB_TYPE(22,48,PRETTY_PATH)
                SET_FLAG(PLAYER_GOOD,FLAG3,1)
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF_SLAB_TYPE(12,48,DOOR_WOODEN)
    IF_SLAB_TYPE(12,42,PRETTY_PATH)
        IF_SLAB_TYPE(22,42,PRETTY_PATH)
            IF_SLAB_TYPE(22,48,PRETTY_PATH)
                SET_FLAG(PLAYER_GOOD,FLAG3,2)
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF_SLAB_TYPE(22,42,DOOR_WOODEN)
    IF_SLAB_TYPE(12,42,PRETTY_PATH)
        IF_SLAB_TYPE(12,48,PRETTY_PATH)
            IF_SLAB_TYPE(22,48,PRETTY_PATH)
                SET_FLAG(PLAYER_GOOD,FLAG3,3)
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF_SLAB_TYPE(22,48,DOOR_WOODEN)
    IF_SLAB_TYPE(12,42,PRETTY_PATH)
        IF_SLAB_TYPE(12,48,PRETTY_PATH)
            IF_SLAB_TYPE(22,42,PRETTY_PATH)
                SET_FLAG(PLAYER_GOOD,FLAG3,4)
            ENDIF
        ENDIF
    ENDIF
ENDIF



IF_SLAB_TYPE(12,42,PRETTY_PATH)
    IF_SLAB_TYPE(12,48,PRETTY_PATH)
        IF_SLAB_TYPE(22,42,PRETTY_PATH)
            IF_SLAB_TYPE(22,48,PRETTY_PATH)
                IF(PLAYER_GOOD,FLAG3 == 1)
                    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SKELETON,4,1,3,200)
                    REM "Intruder! Stay away from the statues!"
                    DISPLAY_MESSAGE(134,SKELETON)
                    SET_FLAG(PLAYER_GOOD,FLAG3,5)
                ENDIF
                IF(PLAYER_GOOD,FLAG3 == 2)
                    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SKELETON,5,1,3,200)
                    DISPLAY_MESSAGE(134,SKELETON)
                    SET_FLAG(PLAYER_GOOD,FLAG3,5)
                ENDIF
                IF(PLAYER_GOOD,FLAG3 == 3)
                    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SKELETON,6,1,3,200)
                    DISPLAY_MESSAGE(134,SKELETON)
                    SET_FLAG(PLAYER_GOOD,FLAG3,5)
                ENDIF
                IF(PLAYER_GOOD,FLAG3 == 4)
                    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SKELETON,7,1,3,200)
                    DISPLAY_MESSAGE(134,SKELETON)
                    SET_FLAG(PLAYER_GOOD,FLAG3,5)
                ENDIF
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF(PLAYER_GOOD,FLAG3 == 5)
    REM "It seems we need to do something with the statues in the abandoned fortress..."
    DISPLAY_OBJECTIVE(135)
    RESET_ACTION_POINT(3,ALL_PLAYERS)
    RESET_ACTION_POINT(8,ALL_PLAYERS)
    RESET_ACTION_POINT(9,ALL_PLAYERS)
ENDIF

IF(PLAYER_GOOD,FLAG3 >= 5)
    IF_ACTION_POINT(3,PLAYER0)
        SET_OBJECT_CONFIGURATION(STATUE2_3,AnimationID,950)
        PLAY_MESSAGE(PLAYER0,SOUND,159)
        ADD_TO_FLAG(PLAYER_GOOD,FLAG3,1)
    ENDIF
    IF_ACTION_POINT(8,PLAYER0)
        SET_OBJECT_CONFIGURATION(STATUE2_4,AnimationID,950)
        PLAY_MESSAGE(PLAYER0,SOUND,159)
        ADD_TO_FLAG(PLAYER_GOOD,FLAG3,1)
    ENDIF
    IF_ACTION_POINT(9,PLAYER0)
        SET_OBJECT_CONFIGURATION(STATUE2_5,AnimationID,950)
        PLAY_MESSAGE(PLAYER0,SOUND,159)
        ADD_TO_FLAG(PLAYER_GOOD,FLAG3,1)
    ENDIF

    IF(PLAYER_GOOD,FLAG3 == 8)
        PLAY_MESSAGE(PLAYER0,SOUND,91)
        CHANGE_SLAB_TYPE(17,41,PRETTY_PATH)
        ADD_TO_FLAG(PLAYER_GOOD,FLAG3,1)
    ENDIF
ENDIF


IF_ACTION_POINT(10,PLAYER0)
    REM "What a cruel joke. Find another way to break him out."
    DISPLAY_MESSAGE(136,PLAYER0)
    REM "What a cruel joke. Find another way to break him out."
    DISPLAY_OBJECTIVE(137,10)
ENDIF

IF(PLAYER0,CAMPAIGN_FLAG7 == 0)
    IF(PLAYER0,BOX0_ACTIVATED == 0)
        IF(PLAYER0,IMP > 0)
            NEXT_COMMAND_REUSABLE
            KILL_CREATURE(PLAYER0,IMP,ANYWHERE,1)
            SET_FLAG(PLAYER2,FLAG0,1)
        ENDIF
    ENDIF
ENDIF

REM If the imp dies
IF(PLAYER2,FLAG0 == 1)
    REM "That's not good...we'll have to find a new plan."
    DISPLAY_MESSAGE(138,PLAYER0)
    REM "That's not good...we'll have to find a new plan."
    DISPLAY_OBJECTIVE(139)
ENDIF

IF(PLAYER5,VAMPIRE == 0)
    NEXT_COMMAND_REUSABLE
    ADD_CREATURE_TO_LEVEL(PLAYER5,VAMPIRE,24,1,6,0)
ENDIF

IF_ACTION_POINT(13,PLAYER0)
    SET_TIMER(PLAYER0,TIMER3)
    REM "Be not afraid. I mean no harm."
    DISPLAY_MESSAGE(140,VAMPIRE)
    IF(PLAYER0,TIMER3>50)
        REM "I see. You've come from that abandoned place."
        DISPLAY_MESSAGE(141,VAMPIRE)
    ENDIF
    IF(PLAYER0,TIMER3>100)
        IF(PLAYER2,FLAG0 == 1)
            REM "You wish to ressurect the one who was held there?"
            DISPLAY_MESSAGE(142,VAMPIRE)
        ENDIF
        IF(PLAYER2,FLAG0 == 0)
            REM "You wish to free the one trapped there?"
            DISPLAY_MESSAGE(143,VAMPIRE)
        ENDIF
    ENDIF
    IF(PLAYER0,TIMER3>150)
        REM "...interesting."
        DISPLAY_MESSAGE(144,VAMPIRE)
    ENDIF
    IF(PLAYER0,TIMER3>200)
        REM "Tell you what, I have a bit of a ghost problem."
        DISPLAY_MESSAGE(145,VAMPIRE)
    ENDIF
    IF(PLAYER0,TIMER3>250)
        REM "Get rid of them, and I'll help you."
        DISPLAY_MESSAGE(146,VAMPIRE)
    ENDIF
    IF(PLAYER0,TIMER3>300)
        REM "Go through this door and defeat the ghosts in each area."
        DISPLAY_MESSAGE(147,VAMPIRE)
        REM "Go through this door and defeat the ghosts in each area."
        DISPLAY_OBJECTIVE(148)
        PLAY_MESSAGE(PLAYER0,SOUND,91)
        SET_DOOR(UNLOCKED,13,26)
        SET_DOOR(UNLOCKED,11,28)

    ENDIF
    IF(PLAYER0,TIMER3>350)
        SET_FLAG(PLAYER0,FLAG4,9)
        DISPLAY_VARIABLE(PLAYER0, FLAG4)
        SET_TIMER(PLAYER1,TIMER0)
        USE_SPELL_ON_PLAYERS_CREATURES(PLAYER0,ANY_CREATURE,SPELL_HEAL,10)
    ENDIF
ENDIF

IF(PLAYER0,FLAG5 < 2)
    IF(PLAYER1,TIMER0 < 400)   
        NEXT_COMMAND_REUSABLE
        SET_FLAG(PLAYER1,FLAG0,0)
    ENDIF
    IF(PLAYER1,TIMER0 > 400)
        IF(PLAYER1,FLAG0 == 0)
            NEXT_COMMAND_REUSABLE
            RESET_ACTION_POINT(22,PLAYER0)
            NEXT_COMMAND_REUSABLE
            SET_FLAG(PLAYER1,FLAG0,1)
        ENDIF
        IF(PLAYER1,FLAG0 == 1)
            IF_ACTION_POINT(22,PLAYER0)
                NEXT_COMMAND_REUSABLE
                USE_SPELL_ON_PLAYERS_CREATURES(PLAYER0,ANY_CREATURE,SPELL_HEAL,10)
                NEXT_COMMAND_REUSABLE
                SET_TIMER(PLAYER1,TIMER0)
            ENDIF
        ENDIF
    ENDIF
ENDIF


IF_ACTION_POINT(14,PLAYER0)
    SET_TIMER(PLAYER0,TIMER3)
    SET_CREATURE_CONFIGURATION(SPIDER,BaseSpeed,0)
    SET_CREATURE_CONFIGURATION(BUG,BaseSpeed,0)
    SET_CREATURE_CONFIGURATION(FLY2,BaseSpeed,0)
    IF(PLAYER0,TIMER3 > 20)
        PLAY_MESSAGE(PLAYER0,SOUND,69)
        CONCEAL_MAP_RECT(PLAYER0,1,70,2,2,1)
        ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_2,4,70,0)
    ENDIF
    IF(PLAYER0,TIMER3 > 30)
        PLAY_MESSAGE(PLAYER0,SOUND,69)
    ENDIF
    IF(PLAYER0,TIMER3 > 60)
        PLAY_MESSAGE(PLAYER0,SOUND,69)
        CONCEAL_MAP_RECT(PLAYER0,4,70,2,2,1)
        ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_2,7,70,0)
    ENDIF
    IF(PLAYER0,TIMER3 > 70)
        PLAY_MESSAGE(PLAYER0,SOUND,69)
    ENDIF
    IF(PLAYER0,TIMER3 > 100)
        PLAY_MESSAGE(PLAYER0,SOUND,69)
        CONCEAL_MAP_RECT(PLAYER0,7,70,2,2,1)
        ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_2,10,70,0)
    ENDIF
    IF(PLAYER0,TIMER3 > 110)
        PLAY_MESSAGE(PLAYER0,SOUND,69)
    ENDIF
    IF(PLAYER0,TIMER3 > 130)
        PLAY_MESSAGE(PLAYER0,SOUND,69)
        CONCEAL_MAP_RECT(PLAYER0,10,70,2,2,1)
        ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_2,13,70,0)
    ENDIF
    IF(PLAYER0,TIMER3 > 140)
        PLAY_MESSAGE(PLAYER0,SOUND,69)
    ENDIF
    IF(PLAYER0,TIMER3 > 160)
        PLAY_MESSAGE(PLAYER0,SOUND,69)
        CONCEAL_MAP_RECT(PLAYER0,13,70,2,2,1)
        ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_2,16,70,0)
    ENDIF
    IF(PLAYER0,TIMER3 > 170)
        PLAY_MESSAGE(PLAYER0,SOUND,69)
    ENDIF
    IF(PLAYER0,TIMER3 > 180)
        PLAY_MESSAGE(PLAYER0,SOUND,69)
        CONCEAL_MAP_RECT(PLAYER0,16,70,2,2,1)
        ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_2,19,70,0)
    ENDIF
    IF(PLAYER0,TIMER3 > 190)
        PLAY_MESSAGE(PLAYER0,SOUND,69)
    ENDIF
    IF(PLAYER0,TIMER3 > 195)
        PLAY_MESSAGE(PLAYER0,SOUND,69)
        CONCEAL_MAP_RECT(PLAYER0,19,70,2,2,1)
        ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_2,22,70,0)
    ENDIF
    IF(PLAYER0,TIMER3 > 205)
        PLAY_MESSAGE(PLAYER0,SOUND,69)
    ENDIF
    IF(PLAYER0,TIMER3 > 210)
        PLAY_MESSAGE(PLAYER0,SOUND,69)
        CONCEAL_MAP_RECT(PLAYER0,22,70,2,2,1)
        ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_2,25,70,0)
    ENDIF
    IF(PLAYER0,TIMER3 > 220)
        PLAY_MESSAGE(PLAYER0,SOUND,69)
    ENDIF
    IF(PLAYER0,TIMER3 > 225)
        CHANGE_SLAB_TYPE(8,23,HARD)
        CHANGE_SLAB_TYPE(7,23,HARD,FLOOR)
        CONCEAL_MAP_RECT(PLAYER0,25,70,2,2,0)
        CONCEAL_MAP_RECT(PLAYER0,28,70,2,2,0)
        CONCEAL_MAP_RECT(PLAYER0,28,67,3,3)
        CHANGE_SLAB_TYPE(9,22,PRETTY_PATH)
    ENDIF
    IF(PLAYER0,TIMER3 > 270)
        SET_CREATURE_CONFIGURATION(SPIDER,BaseSpeed,56)
        SET_CREATURE_CONFIGURATION(BUG,BaseSpeed,56)
        SET_CREATURE_CONFIGURATION(FLY2,BaseSpeed,96)
        REVEAL_MAP_RECT(PLAYER0,16,70,18,2)
        REVEAL_MAP_RECT(PLAYER0,7,70,12,2)
    ENDIF
ENDIF

IF_ACTION_POINT(15,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SPOOKY_GHOSTS,15,1)
    SET_TIMER(PLAYER0,TIMER4)
    IF(PLAYER0,TIMER4 > 10)
        IF(PLAYER_GOOD,GHOST > 0)
            NEXT_COMMAND_REUSABLE
            SET_FLAG(PLAYER0,FLAG4,6)
            NEXT_COMMAND_REUSABLE
            COMPUTE_FLAG(PLAYER0,FLAG4,INCREASE,PLAYER_GOOD,GHOST)
        ENDIF
    ENDIF
    IF(PLAYER0,TIMER4 > 20)
        IF(PLAYER_GOOD,GHOST == 0)
            SET_FLAG(PLAYER0,FLAG4,6)
            SET_DOOR(UNLOCKED,11,26)
        ENDIF
    ENDIF
ENDIF

IF_ACTION_POINT(16,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SPOOKY_GHOSTS,16,1)
    SET_TIMER(PLAYER0,TIMER4)
    IF(PLAYER0,TIMER4 > 10)
        IF(PLAYER_GOOD,GHOST > 0)
            NEXT_COMMAND_REUSABLE
            SET_FLAG(PLAYER0,FLAG4,3)
            NEXT_COMMAND_REUSABLE
            COMPUTE_FLAG(PLAYER0,FLAG4,INCREASE,PLAYER_GOOD,GHOST)
        ENDIF
    ENDIF
    IF(PLAYER0,TIMER4 > 20)
        IF(PLAYER_GOOD,GHOST == 0)
            SET_FLAG(PLAYER0,FLAG4,3)
            SET_DOOR(UNLOCKED,11,24)
            CHANGE_SLAB_TYPE(0,23,PRETTY_PATH)
            ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_2,1,70,0)
            CONCEAL_MAP_RECT(PLAYER0,1,70,3,3,0)
        ENDIF
    ENDIF
ENDIF

IF_ACTION_POINT(17,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SPOOKY_GHOSTS,17,1)
    CHANGE_SLAB_TYPE(10,24,DRAPE_WALL)
    SET_DOOR(LOCKED,11,24)
    SET_TIMER(PLAYER0,TIMER4)
    IF(PLAYER0,TIMER4 > 10)
        IF(PLAYER_GOOD,GHOST > 0)
            NEXT_COMMAND_REUSABLE
            SET_FLAG(PLAYER0,FLAG4,0)
            NEXT_COMMAND_REUSABLE
            COMPUTE_FLAG(PLAYER0,FLAG4,INCREASE,PLAYER_GOOD,GHOST)
        ENDIF
    ENDIF
    IF(PLAYER_GOOD,GHOST == 0)
        IF(PLAYER0,TIMER4 > 20)
            SET_FLAG(PLAYER0,FLAG4,0)
            SET_DOOR(UNLOCKED,11,24)
            SET_TIMER(PLAYER0,TIMER4)
        ENDIF
        IF(PLAYER0,TIMER4 > 60)
            IF(PLAYER0,FLAG5 == 0)
                DISPLAY_VARIABLE(PLAYER0,FLAG4,0,0)
                NEXT_COMMAND_REUSABLE
                COMPUTE_FLAG(PLAYER0,FLAG4,INCREASE,PLAYER0,TIMER4)
                SET_TIMER(PLAYER0,TIMER5)
            ENDIF
        ENDIF
        IF(PLAYER0,TIMER5 > 50)
            SET_FLAG(PLAYER0,FLAG4,3)
            SET_FLAG(PLAYER0,FLAG5,1)
            DISPLAY_VARIABLE(PLAYER0,FLAG4)
            CHANGE_SLAB_TYPE(10,24,PRETTY_PATH)
            SET_DOOR(UNLOCKED,11,24)
        ENDIF
    ENDIF
    CHANGE_SLAB_TYPE(10,20,DRAPE_WALL)
    CHANGE_SLAB_TYPE(9,20,DIRT)
    CHANGE_SLAB_TYPE(9,21,DIRT)
    CHANGE_SLAB_TYPE(9,22,DRAPE_WALL)
    CHANGE_SLAB_TYPE(12,20,PRETTY_PATH)
    CHANGE_SLAB_TYPE(12,23,PRETTY_PATH)
    CHANGE_SLAB_TYPE(12,21,PRETTY_PATH)
    CHANGE_SLAB_TYPE(12,22,PRETTY_PATH)
    CHANGE_SLAB_TYPE(13,20,DRAPE_WALL)
    CHANGE_SLAB_TYPE(13,21,DRAPE_WALL)
    CHANGE_SLAB_TYPE(13,22,DRAPE_WALL)
    CHANGE_SLAB_TYPE(8,23,PRETTY_PATH)
    CHANGE_SLAB_TYPE(8,22,PRETTY_PATH)
    CHANGE_SLAB_TYPE(7,22,PRETTY_PATH)
    CHANGE_SLAB_TYPE(4,21,BARRACK_AREA)
    CHANGE_SLAB_TYPE(4,22,BARRACK_AREA)
    CHANGE_SLAB_TYPE(4,23,BARRACK_AREA)
    CHANGE_SLAB_TYPE(5,21,BARRACK_AREA)
    CHANGE_SLAB_TYPE(5,22,BARRACK_AREA)
    CHANGE_SLAB_TYPE(5,23,BARRACK_AREA)
    CHANGE_SLAB_TYPE(6,21,BARRACK_AREA)
    CHANGE_SLAB_TYPE(6,22,BARRACK_AREA)
    CHANGE_SLAB_TYPE(6,23,BARRACK_AREA)
    ADD_OBJECT_TO_LEVEL_AT_POS(CANDLESTCK,16,71,0)
    ADD_OBJECT_TO_LEVEL_AT_POS(CANDLESTCK,16,63,0)
    ADD_OBJECT_TO_LEVEL_AT_POS(CANDLESTCK,12,67,0)
    ADD_OBJECT_TO_LEVEL_AT_POS(ANVIL,16,67,0)
    CHANGE_SLAB_OWNER(12,22,PLAYER5)
    CHANGE_SLAB_OWNER(8,22,PLAYER5)
    CHANGE_SLAB_OWNER(8,23,PLAYER5)
    CHANGE_SLAB_OWNER(7,22,PLAYER5)
    CHANGE_SLAB_OWNER(6,22,PLAYER5,MATCH)
    CONCEAL_MAP_RECT(PLAYER0,19,67,15,9)
    CONCEAL_MAP_RECT(PLAYER0,28,70,9,3)
    CONCEAL_MAP_RECT(PLAYER0,31,73,3,3)
    CONCEAL_MAP_RECT(PLAYER0,34,64,15,9)
    CONCEAL_MAP_RECT(PLAYER0,34,70,9,9)
    REVEAL_MAP_RECT(PLAYER0,31,76,3,3)
    REVEAL_MAP_RECT(PLAYER0,34,76,3,3)
    RESET_ACTION_POINT(14,PLAYER0)
ENDIF

IF_ACTION_POINT(14,PLAYER0)
    IF(PLAYER0,FLAG5 > 0)
        CHANGE_SLAB_TYPE(12,23,DRAPE_WALL)
        CONCEAL_MAP_RECT(PLAYER0,34,55,15,23)
        CONCEAL_MAP_RECT(PLAYER0,37,67,3,3)
        REVEAL_MAP_RECT(PLAYER0,31,67,9,3)
        REVEAL_MAP_RECT(PLAYER0,37,70,3,3)
        REVEAL_MAP_RECT(PLAYER0,40,70,3,3)
        REVEAL_MAP_RECT(PLAYER0,28,64,3,3)
    ENDIF
ENDIF

IF_ACTION_POINT(18,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SPOOKY_GHOSTS,18,1)
    SET_TIMER(PLAYER0,TIMER4)
    IF(PLAYER0,TIMER4 > 10)
        IF(PLAYER_GOOD,GHOST > 0)
            NEXT_COMMAND_REUSABLE
            SET_FLAG(PLAYER0,FLAG4,0)
            NEXT_COMMAND_REUSABLE
            COMPUTE_FLAG(PLAYER0,FLAG4,INCREASE,PLAYER_GOOD,GHOST)
        ENDIF
    ENDIF
    IF(PLAYER0,TIMER4 > 20)
        IF(PLAYER_GOOD,GHOST == 0)
            SET_FLAG(PLAYER0,FLAG4,0)
            SET_FLAG(PLAYER0,FLAG5,2)
            RESET_ACTION_POINT(13,PLAYER0)
        ENDIF
    ENDIF
ENDIF

IF_ACTION_POINT(13,PLAYER0)
    IF(PLAYER0,FLAG5 == 2)
        SET_TIMER(PLAYER0,TIMER3)
        REM "You've defeated all nine ghosts?"
        DISPLAY_MESSAGE(149,VAMPIRE)
        HIDE_VARIABLE
        IF(PLAYER0,TIMER3>50)
            REM "Great! I'll help you."
            DISPLAY_MESSAGE(150,VAMPIRE)
        ENDIF
        IF(PLAYER0,TIMER3>100)
            IF(PLAYER2,FLAG0 == 1)
                REM "The ressurection spell requires a sacrifice."
                DISPLAY_MESSAGE(151,VAMPIRE)
            ENDIF
            IF(PLAYER2,FLAG0 == 0)
                REM "The releasing spell requires a sacrifice."
                DISPLAY_MESSAGE(152,VAMPIRE)
            ENDIF
        ENDIF
        IF(PLAYER0,TIMER3>150)
            REM "Bring three insects to the temple you just visited."
            DISPLAY_MESSAGE(153,VAMPIRE)
            REM "Sacrifice three insects in the temple you just visited, then see the vampire again."
            DISPLAY_OBJECTIVE(154)
        ENDIF
        IF(PLAYER0,TIMER3>200)
            REM "This will unlock a vault not seen in millennia."
            DISPLAY_MESSAGE(155,VAMPIRE)
        ENDIF
        IF(PLAYER0,TIMER3>250)
            REM "Inside is a powerful artefact you will need."
            DISPLAY_MESSAGE(156,VAMPIRE)
            RESET_ACTION_POINT(19,PLAYER0)
            SET_CREATURE_PROPERTY(SPIDER,NO_CORPSE_ROTTING,1)
            SET_CREATURE_PROPERTY(BUG,NO_CORPSE_ROTTING,1)
            SET_CREATURE_PROPERTY(FLY2,NO_CORPSE_ROTTING,1)
            SET_FLAG(PLAYER0,FLAG5,3)
            DISPLAY_VARIABLE(PLAYER0,FLAG5,6,0)
        ENDIF
    ENDIF
ENDIF

IF(PLAYER0,FLAG5 == 4)
    IF(PLAYER_GOOD,FLAG6 == 0)
        IF_SLAB_TYPE(14,50,PRETTY_PATH)
            SET_FLAG(PLAYER_GOOD,FLAG6,1)
        ENDIF
        IF_SLAB_TYPE(20,50,PRETTY_PATH)
            SET_FLAG(PLAYER_GOOD,FLAG6,2)
        ENDIF
        IF_SLAB_TYPE(16,44,PRETTY_PATH)
            SET_FLAG(PLAYER_GOOD,FLAG6,3)
        ENDIF
        IF_SLAB_TYPE(18,44,PRETTY_PATH)
            SET_FLAG(PLAYER_GOOD,FLAG6,4)
        ENDIF
    ENDIF
ENDIF

IF(PLAYER_GOOD,FLAG6 == 1)
        CHANGE_SLAB_TYPE(14,50,TREASURY_AREA)
        CHANGE_SLAB_TYPE(20,50,TREASURY_AREA)
        CHANGE_SLAB_TYPE(16,44,TREASURY_AREA)
        CHANGE_SLAB_TYPE(18,44,TREASURY_AREA)
        CHANGE_SLAB_TYPE(14,50,PATH)
        CHANGE_SLAB_TYPE(20,50,PATH)
        CHANGE_SLAB_TYPE(16,44,PATH)
        CHANGE_SLAB_TYPE(18,44,PATH)
        CHANGE_SLAB_TYPE(13,50,DRAPE_WALL)
        CHANGE_SLAB_TYPE(13,49,DRAPE_WALL)
        CHANGE_SLAB_TYPE(18,44,PRETTY_PATH)
        CHANGE_SLAB_TYPE(19,44,PRETTY_PATH)
        CONCEAL_MAP_RECT(PLAYER0,37,154,3,3)
ENDIF
IF(PLAYER_GOOD,FLAG6 == 2)
        CHANGE_SLAB_TYPE(14,50,TREASURY_AREA)
        CHANGE_SLAB_TYPE(20,50,TREASURY_AREA)
        CHANGE_SLAB_TYPE(16,44,TREASURY_AREA)
        CHANGE_SLAB_TYPE(18,44,TREASURY_AREA)
        CHANGE_SLAB_TYPE(14,50,PATH)
        CHANGE_SLAB_TYPE(20,50,PATH)
        CHANGE_SLAB_TYPE(16,44,PATH)
        CHANGE_SLAB_TYPE(18,44,PATH)
        CHANGE_SLAB_TYPE(21,50,DRAPE_WALL)
        CHANGE_SLAB_TYPE(21,49,DRAPE_WALL)
        CHANGE_SLAB_TYPE(14,50,PRETTY_PATH)
        CHANGE_SLAB_TYPE(13,50,PRETTY_PATH)
        CHANGE_SLAB_TYPE(13,49,PRETTY_PATH)
        REVEAL_MAP_RECT(PLAYER0,40,151,9,9)
        CONCEAL_MAP_RECT(PLAYER0,67,154,3,3)
ENDIF
IF(PLAYER_GOOD,FLAG6 == 3)
        CHANGE_SLAB_TYPE(14,50,TREASURY_AREA)
        CHANGE_SLAB_TYPE(20,50,TREASURY_AREA)
        CHANGE_SLAB_TYPE(16,44,TREASURY_AREA)
        CHANGE_SLAB_TYPE(18,44,TREASURY_AREA)
        CHANGE_SLAB_TYPE(14,50,PATH)
        CHANGE_SLAB_TYPE(20,50,PATH)
        CHANGE_SLAB_TYPE(16,44,PATH)
        CHANGE_SLAB_TYPE(18,44,PATH)
        CHANGE_SLAB_TYPE(15,44,DRAPE_WALL)
        CHANGE_SLAB_TYPE(20,50,PRETTY_PATH)
        CHANGE_SLAB_TYPE(21,50,PRETTY_PATH)
        CHANGE_SLAB_TYPE(21,49,PRETTY_PATH)
        REVEAL_MAP_RECT(PLAYER0,64,151,9,9)
ENDIF
IF(PLAYER_GOOD,FLAG6 == 4)
        CHANGE_SLAB_TYPE(14,50,TREASURY_AREA)
        CHANGE_SLAB_TYPE(20,50,TREASURY_AREA)
        CHANGE_SLAB_TYPE(16,44,TREASURY_AREA)
        CHANGE_SLAB_TYPE(18,44,TREASURY_AREA)
        CHANGE_SLAB_TYPE(14,50,PATH)
        CHANGE_SLAB_TYPE(20,50,PATH)
        CHANGE_SLAB_TYPE(16,44,PATH)
        CHANGE_SLAB_TYPE(18,44,PATH)
        CHANGE_SLAB_TYPE(19,44,DRAPE_WALL)
        CHANGE_SLAB_TYPE(16,44,PRETTY_PATH)
        CHANGE_SLAB_TYPE(15,44,PRETTY_PATH)
ENDIF

IF(PLAYER0,FLAG5 == 5)
    CHANGE_SLAB_TYPE(15,44,DRAPE_WALL)
    CHANGE_SLAB_TYPE(19,44,DRAPE_WALL)
    CHANGE_SLAB_TYPE(13,49,DRAPE_WALL)
    CHANGE_SLAB_TYPE(13,50,DRAPE_WALL)
    CHANGE_SLAB_TYPE(14,50,DRAPE_WALL)
    CHANGE_SLAB_TYPE(21,49,DRAPE_WALL)
    CHANGE_SLAB_TYPE(21,50,DRAPE_WALL)
    CHANGE_SLAB_TYPE(20,50,DRAPE_WALL)
    CHANGE_SLAB_TYPE(DRAWFROM(14,20),DRAWFROM(46,48),PRETTY_PATH)
    CONCEAL_MAP_RECT(PLAYER0,37,154,3,3)
    CONCEAL_MAP_RECT(PLAYER0,67,154,3,3)
ENDIF

IF(PLAYER0,FLAG5 == 6)
    CHANGE_SLAB_TYPE(17,50,LAVA)
    CHANGE_SLAB_TYPE(17,50,DRAPE_WALL)
    CHANGE_SLAB_TYPE(17,49,PRETTY_PATH)
    CHANGE_SLAB_TYPE(10,46,LAVA)
    CHANGE_SLAB_TYPE(10,46,PRETTY_PATH)
    CHANGE_SLAB_TYPE(24,45,LAVA)
    CHANGE_SLAB_TYPE(24,45,PRETTY_PATH)
    CHANGE_SLAB_TYPE(12,42,DRAPE_WALL)
    CHANGE_SLAB_TYPE(12,48,DRAPE_WALL)
    CHANGE_SLAB_TYPE(22,42,DRAPE_WALL)
    CHANGE_SLAB_TYPE(22,48,DRAPE_WALL)
    CHANGE_SLAB_TYPE(10,44,PRETTY_PATH)
    CHANGE_SLAB_TYPE(10,47,PRETTY_PATH)
    CHANGE_SLAB_TYPE(24,44,PRETTY_PATH)
    CHANGE_SLAB_TYPE(24,47,PRETTY_PATH)
    ADD_OBJECT_TO_LEVEL_AT_POS(TEMPLE_STATUE,46,151,0)
    ADD_OBJECT_TO_LEVEL_AT_POS(TEMPLE_STATUE,58,151,0)
    ADD_OBJECT_TO_LEVEL_AT_POS(TEMPLE_STATUE,52,148,0)
    CHANGE_SLAB_TYPE(14,46,DRAPE_WALL)
    CHANGE_SLAB_TYPE(14,48,DRAPE_WALL)
    CHANGE_SLAB_TYPE(20,46,DRAPE_WALL)
    CHANGE_SLAB_TYPE(20,48,DRAPE_WALL)
    CHANGE_SLAB_TYPE(14,DRAWFROM(46,48),PRETTY_PATH)
    CHANGE_SLAB_TYPE(20,DRAWFROM(46,48),PRETTY_PATH)
    CHANGE_SLAB_TYPE(16,42,DRAPE_WALL)
    CHANGE_SLAB_TYPE(18,42,DRAPE_WALL)
    CHANGE_SLAB_TYPE(17,43,PRETTY_PATH)
    CHANGE_SLAB_TYPE(17,44,PRETTY_PATH)
    CHANGE_SLAB_TYPE(16,44,PRETTY_PATH) 
    CHANGE_SLAB_TYPE(18,44,PRETTY_PATH) 
ENDIF

IF(PLAYER0,FLAG5 == 3)
    IF_ACTION_POINT(19,PLAYER0)
        KILL_CREATURE(PLAYER0,ANY_CREATURE,AT_ACTION_POINT[19],1)
        CREATE_EFFECT_AT_POS(38,16,82,2)
        RESET_ACTION_POINT(19,PLAYER0)
        CHANGE_SLAB_TEXTURE(5,27,GYPSUM)
        ADD_TO_FLAG(PLAYER0,FLAG5,1)
    ENDIF
ENDIF
IF(PLAYER0,FLAG5 == 4)
    IF_ACTION_POINT(19,PLAYER0)
        KILL_CREATURE(PLAYER0,ANY_CREATURE,AT_ACTION_POINT[19],1)
        CREATE_EFFECT_AT_POS(38,16,82,2)
        RESET_ACTION_POINT(19,PLAYER0)
        CHANGE_SLAB_TEXTURE(5,27,SWAMP_SERPENT)
        ADD_TO_FLAG(PLAYER0,FLAG5,1)
    ENDIF
ENDIF
IF(PLAYER0,FLAG5 == 5)
    RESET_ACTION_POINT(25,PLAYER0)
    IF_ACTION_POINT(25,PLAYER0)
        REM " One more sacrifice and the path is revealed."
        DISPLAY_MESSAGE(157,PLAYER3)
    ENDIF
    IF_ACTION_POINT(19,PLAYER0)
        KILL_CREATURE(PLAYER0,ANY_CREATURE,AT_ACTION_POINT[19],1)
        CREATE_EFFECT_AT_POS(38,16,82,2)
        CHANGE_SLAB_TEXTURE(5,27,LAVA_CAVERN)
        ADD_TO_FLAG(PLAYER0,FLAG5,1)
    ENDIF
ENDIF

IF(PLAYER0,FLAG5 == 6)
    RESET_ACTION_POINT(13,PLAYER0)
    PLAY_MESSAGE(PLAYER0,SOUND,91)
    CHANGE_SLAB_TYPE(19,22,WATER)
    CHANGE_SLAB_TYPE(18,22,WATER)
    CHANGE_SLAB_TYPE(20,22,WATER)
    SET_CREATURE_PROPERTY(SPIDER,NO_CORPSE_ROTTING,0)
    SET_CREATURE_PROPERTY(BUG,NO_CORPSE_ROTTING,0)
    SET_CREATURE_PROPERTY(FLY2,NO_CORPSE_ROTTING,0)
    IF_ACTION_POINT(13,PLAYER0)
        SET_TIMER(PLAYER0,TIMER3)
        REM "You've done it! Look! The door has revealed itself!"
        DISPLAY_MESSAGE(158,VAMPIRE)
        HIDE_VARIABLE
        IF(PLAYER0,TIMER3>50)
            REM "The path to the vault is full of tricks and traps."
            DISPLAY_MESSAGE(159,VAMPIRE)
        ENDIF
        IF(PLAYER0,TIMER3>100)
            REM "Keep your wits about you, and remember:"
            DISPLAY_MESSAGE(160,VAMPIRE)
        ENDIF
        IF(PLAYER0,TIMER3>150)
            REM "'When you hit a dead end, keep on going.'"
            DISPLAY_MESSAGE(161,VAMPIRE)
        ENDIF
        IF(PLAYER0,TIMER3>200)
            REM "'And when your path in uncertain, follow the stars.'"
            DISPLAY_MESSAGE(162,VAMPIRE)
            REM "The secret path is revealed! 'When you hit a dead end, keep on going, and when your path in uncertain, follow the stars.'"
            DISPLAY_OBJECTIVE(163)
        ENDIF
    ENDIF
ENDIF

IF(PLAYER0,FLAG5 >= 6)
    IF(PLAYER0,FLAG5 < 8)
        IF(PLAYER1,TIMER0 < 400)   
            NEXT_COMMAND_REUSABLE
            SET_FLAG(PLAYER1,FLAG0,0)
        ENDIF
        IF(PLAYER1,TIMER0 > 400)
            IF(PLAYER1,FLAG0 == 0)
                NEXT_COMMAND_REUSABLE
                RESET_ACTION_POINT(22,PLAYER0)
                NEXT_COMMAND_REUSABLE
                SET_FLAG(PLAYER1,FLAG0,1)
            ENDIF
            IF(PLAYER1,FLAG0 == 1)
                IF_ACTION_POINT(22,PLAYER0)
                    NEXT_COMMAND_REUSABLE
                    USE_SPELL_ON_PLAYERS_CREATURES(PLAYER0,ANY_CREATURE,SPELL_HEAL,10)
                    NEXT_COMMAND_REUSABLE
                    SET_TIMER(PLAYER1,TIMER0)
                ENDIF
            ENDIF
        ENDIF
    ENDIF
ENDIF


IF_ACTION_POINT(20,PLAYER0)
    CHANGE_SLAB_TEXTURE(25,13,LILAC_STONE)
    CHANGE_SLAB_TEXTURE(25,12,LILAC_STONE)
    CHANGE_SLAB_TEXTURE(24,12,LILAC_STONE)
    CHANGE_SLAB_TEXTURE(24,11,LILAC_STONE)
    CHANGE_SLAB_TEXTURE(23,11,LILAC_STONE)
    CHANGE_SLAB_TEXTURE(22,11,LILAC_STONE)
    CHANGE_SLAB_TEXTURE(22,12,LILAC_STONE)
    CHANGE_SLAB_TEXTURE(22,13,LILAC_STONE)
    CHANGE_SLAB_TEXTURE(22,14,LILAC_STONE)
    CHANGE_SLAB_TEXTURE(21,14,LILAC_STONE)
    CHANGE_SLAB_TEXTURE(20,14,LILAC_STONE)
    CHANGE_SLAB_TEXTURE(20,13,LILAC_STONE)
    CHANGE_SLAB_TYPE(15,18,PRETTY_PATH)
    CHANGE_SLAB_OWNER(14,18,PLAYER_GOOD)
    CHANGE_SLAB_OWNER(15,18,PLAYER_GOOD)
    CHANGE_SLAB_TYPE(14,18,PRETTY_PATH)
    CHANGE_SLAB_TYPE(11,19,DRAPE_WALL)
    CHANGE_SLAB_OWNER(11,19,PLAYER_GOOD)
    CHANGE_SLAB_TYPE(10,20,DIRT)
    CHANGE_SLAB_TYPE(11,20,DIRT)
    CHANGE_SLAB_TYPE(12,20,DIRT)
    CHANGE_SLAB_TYPE(13,20,DIRT)
    CHANGE_SLAB_OWNER(9,19,PLAYER_GOOD,MATCH)
    CHANGE_SLAB_OWNER(13,18,PLAYER_GOOD,MATCH)
    CHANGE_SLAB_OWNER(10,15,PLAYER_GOOD)
    CHANGE_SLAB_OWNER(11,15,PLAYER_GOOD)
    CHANGE_SLAB_OWNER(12,15,PLAYER_GOOD)
    RESET_ACTION_POINT(17,PLAYER0)
    IF_ACTION_POINT(17,PLAYER0)
        REM "We're so close! Soon he will be free!"
        DISPLAY_MESSAGE(164,PLAYER3)
        IF(PLAYER0,TIMER3>50)
            ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SKELE,17,1,1,0)
            ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SKELEMAGE,17,1,1,0)
            REM "Turn back now!"
            DISPLAY_MESSAGE(165,SKELE)
            REM "You have no idea of the power this holds!"
            DISPLAY_MESSAGE(166,SKELEMAGE)
            REM "Kill the skeletons guarding the vault."
            DISPLAY_OBJECTIVE(167)
            SET_FLAG(PLAYER0,FLAG5,7)
        ENDIF
        IF(PLAYER0,FLAG5 == 7)
            IF(PLAYER_GOOD,SKELE == 0)
                IF(PLAYER_GOOD,SKELEMAGE == 0)
                    RESET_ACTION_POINT(13,PLAYER0)
                    SET_TIMER(PLAYER1,TIMER1)
                    IF(PLAYER1,TIMER1 > 40)
                        USE_POWER_AT_POS(PLAYER_NEUTRAL,49,58,POWER_DESTROY_WALLS,1,1)
                        PLAY_MESSAGE(PLAYER0,SOUND,72)
                    ENDIF
                    IF(PLAYER1,TIMER1 > 50)
                        USE_POWER_AT_POS(PLAYER_NEUTRAL,49,61,POWER_DESTROY_WALLS,1,1)
                        PLAY_MESSAGE(PLAYER0,SOUND,72)
                    ENDIF
                    IF(PLAYER1,TIMER1 > 60)
                        USE_POWER_AT_POS(PLAYER_NEUTRAL,52,61,POWER_DESTROY_WALLS,1,1)
                        PLAY_MESSAGE(PLAYER0,SOUND,72)
                    ENDIF
                    IF(PLAYER1,TIMER1 > 70)
                        USE_POWER_AT_POS(PLAYER_NEUTRAL,55,61,POWER_DESTROY_WALLS,2,1)
                        PLAY_MESSAGE(PLAYER0,SOUND,72)
                    ENDIF
                    IF_ACTION_POINT(13,PLAYER0)
                        SET_TIMER(PLAYER0,TIMER3)
                        REM "By the dark gods, you've done it!"
                        DISPLAY_MESSAGE(168,VAMPIRE)
                        IF(PLAYER0,TIMER3>50)
                            REM "Meet me inside the vault."
                            DISPLAY_MESSAGE(169,VAMPIRE)
                            REM "Return to the vault and meet with the vampire."
                            DISPLAY_OBJECTIVE(170)
                            MOVE_CREATURE(PLAYER5,VAMPIRE,AT_ACTION_POINT[22],1,21,EFFECT_STRANGE_GAS_2)
                            CHANGE_SLAB_TYPE(16,17,HARD)
                            CHANGE_SLAB_TYPE(16,13,HARD)
                            CHANGE_SLAB_TYPE(16,14,HARD,MATCH)
                            SET_FLAG(PLAYER0,FLAG5,8)
                            RESET_ACTION_POINT(17,PLAYER0)
                            CHANGE_SLAB_TYPE(11,16,HEART_PEDESTAL)
                            ADD_OBJECT_TO_LEVEL_AT_POS(SPELLBOOK_ARMG,34,49,0)
                        ENDIF
                    ENDIF
                ENDIF
            ENDIF
        ENDIF
    ENDIF
ENDIF


IF(PLAYER0,FLAG5 == 8)
    IF_ACTION_POINT(17,PLAYER0)
        IF(PLAYER0,BOX0_ACTIVATED == 0)
            REM "After all this time..."
            DISPLAY_MESSAGE(171,VAMPIRE)
            SET_TIMER(PLAYER0,TIMER3)
            IF(PLAYER0,TIMER3>50)
                REM "...the spellbook I've been seeking."
                DISPLAY_MESSAGE(172,VAMPIRE)
            ENDIF
            IF(PLAYER0,TIMER3>100)
                REM "Oh, and your artefact!"
                DISPLAY_MESSAGE(173,VAMPIRE)
            ENDIF
            IF(PLAYER0,TIMER3>150)
                REM "Here you go. I've kept my word."
                DISPLAY_MESSAGE(174,VAMPIRE)
                CHANGE_SLAB_OWNER(11,15,PLAYER0,NONE)
                CREATE_EFFECT_AT_POS(EFFECT_SPANGLE_ORANGE,34,46,2)
                PLAY_MESSAGE(PLAYER0,SOUND,116)
            ENDIF
            IF(PLAYER0,TIMER3>200)
                REM "We finally have it! Activate the artefact!"
                DISPLAY_MESSAGE(175,PLAYER3)
            ENDIF
            IF(PLAYER0,TIMER3>400)
                REM "And one more thing..."
                DISPLAY_MESSAGE(176,VAMPIRE)
            ENDIF
            IF(PLAYER0,TIMER3>420)
                REM " Do it!"
                DISPLAY_MESSAGE(177,PLAYER3)
            ENDIF
            IF(PLAYER0,TIMER3>450)
                REM "...I hope you know what you're doing."
                DISPLAY_MESSAGE(178,VAMPIRE)
            ENDIF
            IF(PLAYER0,TIMER3>470)
                REM "  Do it!"
                DISPLAY_MESSAGE(179,PLAYER3)
            ENDIF
            IF(PLAYER0,TIMER3>500)
                DISPLAY_MESSAGE(177,PLAYER3)
            ENDIF
            IF(PLAYER0,TIMER3>520)
                DISPLAY_MESSAGE(179,PLAYER3)
            ENDIF
            IF(PLAYER0,TIMER3>540)
                DISPLAY_MESSAGE(177,PLAYER3)
            ENDIF
            IF(PLAYER0,TIMER3>560)
                IF(PLAYER0,TIMER3<=640)
                    SET_TIMER(PLAYER0,TIMER2)
                    IF(PLAYER0,TIMER2 >= 0)
                       IF(PLAYER3,FLAG3 == 0)
                            NEXT_COMMAND_REUSABLE
                            DISPLAY_MESSAGE(179,PLAYER3)
                            NEXT_COMMAND_REUSABLE
                            SET_FLAG(PLAYER3,FLAG3,1)
                        ENDIF
                    ENDIF
                    IF(PLAYER0,TIMER2 >= 10)
                      IF(PLAYER3,FLAG3 == 1)
                            NEXT_COMMAND_REUSABLE
                            DISPLAY_MESSAGE(177,PLAYER3)
                            NEXT_COMMAND_REUSABLE
                            SET_FLAG(PLAYER3,FLAG3,2)
                        ENDIF
                    ENDIF
                    IF(PLAYER0,TIMER2 >= 20)
                         IF(PLAYER3,FLAG3 == 2)
                            NEXT_COMMAND_REUSABLE
                            SET_TIMER(PLAYER0,TIMER2)
                            NEXT_COMMAND_REUSABLE
                            SET_FLAG(PLAYER3,FLAG3,0)
                        ENDIF
                    ENDIF
                ENDIF
            ENDIF
            IF(PLAYER0,TIMER3>640)
                IF(PLAYER0,TIMER3<=800)
                   SET_FLAG(PLAYER3,FLAG3,3)
                    SET_TIMER(PLAYER0,TIMER2)
                    IF(PLAYER0,TIMER2>0)
                        IF(PLAYER3,FLAG3 == 3)
                            NEXT_COMMAND_REUSABLE
                            DISPLAY_MESSAGE(177,PLAYER3)
                            NEXT_COMMAND_REUSABLE
                            SET_FLAG(PLAYER3,FLAG3,4)
                        ENDIF
                    ENDIF
                    IF(PLAYER0,TIMER2>2)
                        IF(PLAYER3,FLAG3 == 4)
                            NEXT_COMMAND_REUSABLE
                            DISPLAY_MESSAGE(179,PLAYER3)
                            NEXT_COMMAND_REUSABLE
                            SET_FLAG(PLAYER3,FLAG3,5)
                        ENDIF
                    ENDIF
                    IF(PLAYER0,TIMER2>4)
                        IF(PLAYER3,FLAG3 == 5)
                            NEXT_COMMAND_REUSABLE
                            SET_TIMER(PLAYER0,TIMER2)
                            NEXT_COMMAND_REUSABLE
                            SET_FLAG(PLAYER3,FLAG3,3)
                        ENDIF
                    ENDIF
                ENDIF
            ENDIF
            IF(PLAYER0,TIMER3>839)
            QUICK_MESSAGE(58," ",NONE)
            QUICK_MESSAGE(58," ",NONE)
            QUICK_MESSAGE(58," ",NONE)
            QUICK_MESSAGE(58," ",NONE)
            QUICK_MESSAGE(58," ",NONE)
            QUICK_MESSAGE(58," ",NONE)
            QUICK_MESSAGE(58," ",NONE)
            QUICK_MESSAGE(58," ",NONE)
            QUICK_MESSAGE(58," ",NONE)
            QUICK_MESSAGE(58," ",NONE)
            ENDIF
            IF(PLAYER0,TIMER3>840)
                REM " Fine. I'll do it."
                DISPLAY_MESSAGE(181,PLAYER3)
            ENDIF
            IF(PLAYER0,TIMER3 > 890)
                SET_FLAG(PLAYER0,BOX0_ACTIVATED,1)
                SET_OBJECT_CONFIGURATION(SPECBOX_CUSTOM,MaximumSize,0)
                CREATE_EFFECT_AT_POS(EFFECT_SPANGLE_MULTICOLOURED,34,46,2)
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF(PLAYER0,BOX0_ACTIVATED > 0)
    SET_TIMER(PLAYER1,TIMER2)

    PLAY_MESSAGE(PLAYER0,SOUND,180)
    IF(PLAYER1,TIMER2 > 5)
        CREATE_EFFECT_AT_POS(EFFECT_COLOURFUL_FIRE_CIRCLE,34,46,2)
    ENDIF
    IF(PLAYER1,TIMER2 > 35)
        SET_OBJECT_CONFIGURATION(SPELLBOOK_ARMG,MaximumSize,0)
        CREATE_EFFECT_AT_POS(EFFECT_BALL_PUFF_BLACK,34,49,2)
        MOVE_CREATURE(PLAYER5,VAMPIRE,AT_ACTION_POINT[17],1,80,EFFECT_BALL_PUFF_BLACK)
    ENDIF
    IF(PLAYER1,TIMER2 > 55)
        PLAY_MESSAGE(PLAYER0,SOUND,39)
    ENDIF
    IF(PLAYER1,TIMER2 > 80)
        SET_FLAG(PLAYER0,CAMPAIGN_FLAG7,1)
        CREATE_EFFECT_AT_POS(EFFECT_FLASH,34,46,2)
        PLAY_MESSAGE(PLAYER0,SOUND,152)
        PLAY_MESSAGE(PLAYER0,SOUND,340)
        PLAY_MESSAGE(PLAYER0,SOUND,357)
        PLAY_MESSAGE(PLAYER0,SOUND,374)
        PLAY_MESSAGE(PLAYER0,SOUND,391)
        PLAY_MESSAGE(PLAYER0,SOUND,408)
        PLAY_MESSAGE(PLAYER0,SOUND,442)
        KILL_CREATURE(PLAYER0,ANY_CREATURE,ANYWHERE,5)
        RESET_ACTION_POINT(2,PLAYER0)
        RESET_ACTION_POINT(25,PLAYER0)
        SET_MUSIC("silence.mp3")
    ENDIF
    IF(PLAYER1,TIMER2 > 90)
        ADD_CREATURE_TO_LEVEL(PLAYER0,SPIDER,23,1,3,0)
        ADD_CREATURE_TO_LEVEL(PLAYER0,BUG,23,1,3,0)
    ENDIF
    IF(PLAYER0,VIEW_TYPE == 1)
        IF(PLAYER1,TIMER2 > 220)
            SET_MUSIC("this_is_halloween_spookier.mp3")
            ZOOM_TO_LOCATION(PLAYER0,PLAYER0)
            CONCEAL_MAP_RECT(PLAYER0,115,93,220,123,0)
            REM "By the gods...what have we done?"
            DISPLAY_OBJECTIVE(182)
        ENDIF
        IF(PLAYER1,TIMER2 > 240)
            REM " Great! Now we can finally grab that imp!"
            DISPLAY_OBJECTIVE(183)
        ENDIF
    ENDIF
ENDIF

IF(PLAYER0,CAMPAIGN_FLAG7 == 1)
    RESET_ACTION_POINT(2,PLAYER0)
    CHANGE_SLAB_TYPE(17,39,ENTRANCE_ZONE)
    MOVE_CREATURE(PLAYER6,IMP,ANYWHERE,1,24,NULL)
    KILL_CREATURE(PLAYER6,IMP,ANYWHERE,1)
    RESET_ACTION_POINT(26,PLAYER0)
    RESET_ACTION_POINT(27,PLAYER0)
    RESET_ACTION_POINT(28,PLAYER0)
    RESET_ACTION_POINT(29,PLAYER0)
    IF_ACTION_POINT(2,PLAYER0)
        IF(PLAYER0,VIEW_TYPE == 2)
            REM " We're almost there...don't stop now!"
            DISPLAY_MESSAGE(184,PLAYER3)
        ENDIF
    ENDIF
    IF_ACTION_POINT(25,PLAYER0)
        REM " Just a few more steps, he's finally free."
        DISPLAY_MESSAGE(185,PLAYER3)
        SET_TIMER(PLAYER1,TIMER3)
        SET_TIMER(PLAYER1,TIMER4)
        IF(PLAYER2,FLAG1 == 0)
            IF(PLAYER1,TIMER3 > 80)
                NEXT_COMMAND_REUSABLE
                SET_TEXTURE(ALL_PLAYERS,0)
            ENDIF
            IF(PLAYER1,TIMER3 > 83)
                NEXT_COMMAND_REUSABLE
                SET_TEXTURE(ALL_PLAYERS,IMPORT(PLAYER0,CAMPAIGN_FLAG0))
            ENDIF
            IF(PLAYER1,TIMER3 > 200)
                NEXT_COMMAND_REUSABLE
                SET_TEXTURE(ALL_PLAYERS,0)
            ENDIF
            IF(PLAYER1,TIMER3 > 203)
                NEXT_COMMAND_REUSABLE
                SET_TEXTURE(ALL_PLAYERS,IMPORT(PLAYER0,CAMPAIGN_FLAG0))
            ENDIF
            IF(PLAYER1,TIMER3 > 215)
                NEXT_COMMAND_REUSABLE
                SET_TEXTURE(ALL_PLAYERS,0)
            ENDIF
            IF(PLAYER1,TIMER3 > 218)
                NEXT_COMMAND_REUSABLE
                SET_TEXTURE(ALL_PLAYERS,IMPORT(PLAYER0,CAMPAIGN_FLAG0))
            ENDIF
            IF(PLAYER1,TIMER3 > 260)
                NEXT_COMMAND_REUSABLE
                SET_TEXTURE(ALL_PLAYERS,0)
            ENDIF
            IF(PLAYER1,TIMER3 > 263)
                NEXT_COMMAND_REUSABLE
                SET_TEXTURE(ALL_PLAYERS,IMPORT(PLAYER0,CAMPAIGN_FLAG0))
                NEXT_COMMAND_REUSABLE
                SET_TIMER(PLAYER1,TIMER3)
            ENDIF
            IF(PLAYER1,TIMER4 > 4)
                CHANGE_SLAB_TYPE(15,51,PURPLE_PATH)
                CHANGE_SLAB_TYPE(19,49,PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 8)
                CHANGE_SLAB_TYPE(17,50,PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 12)
                CHANGE_SLAB_TYPE(18,47,PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 16)
                CHANGE_SLAB_TYPE(14,47,PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 40)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 70)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 100)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 140)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 170)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 200)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 240)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 270)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 300)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 340)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 370)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 400)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 440)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 470)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 500)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 540)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 570)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
            ENDIF
            IF(PLAYER1,TIMER4 > 600)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
                CHANGE_SLAB_TYPE(DRAWFROM(15~19),41,PURPLE_PATH)
            ENDIF
            REM IF(PLAYER1,TIMER4 > 640)
            REM ENDIF
            REM IF(PLAYER1,TIMER4 > 670)
            REM    CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
            REM    CHANGE_SLAB_TYPE(DRAWFROM(9~25),DRAWFROM(41~50),PURPLE_PATH)
            REM ENDIF
        ENDIF
    ENDIF
    IF_ACTION_POINT(30,PLAYER0)
        SET_CREATURE_CONFIGURATION(SPIDER,BaseSpeed,56)
        SET_CREATURE_CONFIGURATION(BUG,BaseSpeed,56)
        SET_CREATURE_CONFIGURATION(FLY2,BaseSpeed,56)
    ENDIF
    IF_ACTION_POINT(29,PLAYER0)
        SET_CREATURE_CONFIGURATION(SPIDER,BaseSpeed,42)
        SET_CREATURE_CONFIGURATION(BUG,BaseSpeed,42)
        SET_CREATURE_CONFIGURATION(FLY2,BaseSpeed,42)
    ENDIF
    IF_ACTION_POINT(28,PLAYER0)
        SET_CREATURE_CONFIGURATION(SPIDER,BaseSpeed,28)
        SET_CREATURE_CONFIGURATION(BUG,BaseSpeed,28)
        SET_CREATURE_CONFIGURATION(FLY2,BaseSpeed,28)
    ENDIF
    IF_ACTION_POINT(27,PLAYER0)
        SET_CREATURE_CONFIGURATION(SPIDER,BaseSpeed,14)
        SET_CREATURE_CONFIGURATION(BUG,BaseSpeed,14)
        SET_CREATURE_CONFIGURATION(FLY2,BaseSpeed,14)
    ENDIF
    IF_ACTION_POINT(26,PLAYER0)
        SET_FLAG(PLAYER2,FLAG1,1)
        SET_CREATURE_CONFIGURATION(SPIDER,BaseSpeed,0)
        SET_CREATURE_CONFIGURATION(BUG,BaseSpeed,0)
        SET_CREATURE_CONFIGURATION(FLY2,BaseSpeed,0)
        SET_TIMER(PLAYER1,TIMER5)
        IF(PLAYER1,FLAG7 == 0)
            IF(PLAYER1,TIMER5 >= 20)
                SET_TEXTURE(ALL_PLAYERS,WINTER)
                SET_MUSIC("this_is_halloween_loop_short.mp3")
                IF(PLAYER1,FLAG5 == 0)
                    SET_TIMER(PLAYER0,TIMER3)
                    IF(PLAYER0,TIMER3 > 0)
                        NEXT_COMMAND_REUSABLE
                        SET_OBJECT_CONFIGURATION(TORCH,AnimationID,1)
                    ENDIF
                    IF(PLAYER0,TIMER3 > 2)
                        NEXT_COMMAND_REUSABLE
                        SET_OBJECT_CONFIGURATION(TORCH,AnimationID,792)
                    ENDIF
                    IF(PLAYER0,TIMER3 > 4)
                        NEXT_COMMAND_REUSABLE
                        SET_OBJECT_CONFIGURATION(TORCH,AnimationID,814)
                    ENDIF
                    IF(PLAYER0,TIMER3 > 6)
                        NEXT_COMMAND_REUSABLE
                        SET_OBJECT_CONFIGURATION(TORCH,AnimationID,905)
                    ENDIF
                    IF(PLAYER0,TIMER3 > 8)
                        NEXT_COMMAND_REUSABLE
                        SET_OBJECT_CONFIGURATION(TORCH,AnimationID,1)
                    ENDIF
                    IF(PLAYER0,TIMER3 > 10)
                        NEXT_COMMAND_REUSABLE
                        SET_OBJECT_CONFIGURATION(TORCH,AnimationID,910)
                    ENDIF
                    IF(PLAYER0,TIMER3 > 12)
                        NEXT_COMMAND_REUSABLE
                        SET_OBJECT_CONFIGURATION(TORCH,AnimationID,973)
                    ENDIF
                    IF(PLAYER0,TIMER3 > 14)
                        NEXT_COMMAND_REUSABLE
                        SET_OBJECT_CONFIGURATION(TORCH,AnimationID,930)
                    ENDIF
                    IF(PLAYER0,TIMER3 > 16)
                        NEXT_COMMAND_REUSABLE
                        SET_OBJECT_CONFIGURATION(TORCH,AnimationID,1)
                    ENDIF
                    IF(PLAYER0,TIMER3 > 18)
                        NEXT_COMMAND_REUSABLE
                        SET_OBJECT_CONFIGURATION(TORCH,AnimationID,946)
                    ENDIF
                    IF(PLAYER0,TIMER3 > 20)
                        NEXT_COMMAND_REUSABLE
                        SET_OBJECT_CONFIGURATION(TORCH,AnimationID,960)
                        NEXT_COMMAND_REUSABLE
                        SET_TIMER(PLAYER0,TIMER3)
                    ENDIF
                ENDIF
                ADD_GOLD_TO_PLAYER(PLAYER0,9892656)
                NEXT_COMMAND_REUSABLE
                ADD_GOLD_TO_PLAYER(PLAYER0,3371471)
                IF(PLAYER0,MONEY >= 10000000)
                    NEXT_COMMAND_REUSABLE
                    ADD_GOLD_TO_PLAYER(PLAYER0,-4293484)
                ENDIF
            ENDIF
            IF(PLAYER1,TIMER5 >= 40)
                IF(PLAYER1,FLAG5 == 0)
                    NEXT_COMMAND_REUSABLE
                    ADD_OBJECT_TO_LEVEL(STATUE2_2,26,1)
                ENDIF
            ENDIF
        ENDIF
        IF(PLAYER1,TIMER5 >= 70)
            KILL_CREATURE(PLAYER0,ANY_CREATURE,ANYWHERE,5)
            CONCEAL_MAP_RECT(PLAYER0,120,120,240,240)
            SET_MUSIC("silence.mp3")

            CHANGE_SLAB_TYPE(12,52,DIRT)
            CHANGE_SLAB_TYPE(18,37,DIRT)
            CHANGE_SLAB_TYPE(19,37,DIRT)
            CHANGE_SLAB_TYPE(14,38,HARD)
            CHANGE_SLAB_TYPE(15,38,HARD)
            CHANGE_SLAB_TYPE(16,38,HARD)
            CHANGE_SLAB_TYPE(17,38,HARD)
            CHANGE_SLAB_TYPE(18,38,HARD)
            CHANGE_SLAB_TYPE(19,38,DIRT)
            CHANGE_SLAB_TYPE(11,39,HARD)
            CHANGE_SLAB_TYPE(12,39,HARD)
            CHANGE_SLAB_TYPE(13,39,HARD)
            CHANGE_SLAB_TYPE(14,39,HARD)
            CHANGE_SLAB_TYPE(15,39,HARD)
            CHANGE_SLAB_TYPE(16,39,HARD)
            CHANGE_SLAB_TYPE(17,39,HARD)
            CHANGE_SLAB_TYPE(18,39,HARD)
            CHANGE_SLAB_TYPE(19,39,HARD)
            CHANGE_SLAB_TYPE(20,39,DIRT)
            CHANGE_SLAB_TYPE(21,39,DIRT)
            CHANGE_SLAB_TYPE(10,40,HARD)
            CHANGE_SLAB_TYPE(11,40,HARD)
            CHANGE_SLAB_TYPE(12,40,HARD)
            CHANGE_SLAB_TYPE(13,40,HARD)
            CHANGE_SLAB_TYPE(14,40,HARD)
            CHANGE_SLAB_TYPE(15,40,HARD)
            CHANGE_SLAB_TYPE(16,40,HARD)
            CHANGE_SLAB_TYPE(17,40,HARD)
            CHANGE_SLAB_TYPE(18,40,HARD)
            CHANGE_SLAB_TYPE(19,40,HARD)
            CHANGE_SLAB_TYPE(20,40,HARD)
            CHANGE_SLAB_TYPE(21,40,DIRT)
            CHANGE_SLAB_TYPE(22,40,DIRT)
            CHANGE_SLAB_TYPE(23,40,DIRT)
            CHANGE_SLAB_TYPE(24,40,DIRT)
            CHANGE_SLAB_TYPE(25,40,DIRT)
            CHANGE_SLAB_TYPE(9,41,HARD)
            CHANGE_SLAB_TYPE(10,41,HARD)
            CHANGE_SLAB_TYPE(11,41,HARD)
            CHANGE_SLAB_TYPE(12,41,HARD)
            CHANGE_SLAB_TYPE(13,41,HARD)
            CHANGE_SLAB_TYPE(14,41,HARD)
            CHANGE_SLAB_TYPE(15,41,HARD)
            CHANGE_SLAB_TYPE(16,41,HARD)
            CHANGE_SLAB_TYPE(17,41,HARD)
            CHANGE_SLAB_TYPE(18,41,HARD)
            CHANGE_SLAB_TYPE(19,41,HARD)
            CHANGE_SLAB_TYPE(20,41,HARD)
            CHANGE_SLAB_TYPE(21,41,DIRT)
            CHANGE_SLAB_TYPE(22,41,DIRT)
            CHANGE_SLAB_TYPE(23,41,DIRT)
            CHANGE_SLAB_TYPE(24,41,DIRT)
            CHANGE_SLAB_TYPE(25,41,DIRT)
            CHANGE_SLAB_TYPE(9,42,HARD)
            CHANGE_SLAB_TYPE(10,42,HARD)
            CHANGE_SLAB_TYPE(11,42,HARD)
            CHANGE_SLAB_TYPE(12,42,HARD)
            CHANGE_SLAB_TYPE(13,42,HARD)
            CHANGE_SLAB_TYPE(14,42,HARD)
            CHANGE_SLAB_TYPE(15,42,HARD)
            CHANGE_SLAB_TYPE(16,42,HARD)
            CHANGE_SLAB_TYPE(17,42,HARD)
            CHANGE_SLAB_TYPE(18,42,HARD)
            CHANGE_SLAB_TYPE(19,42,HARD)
            CHANGE_SLAB_TYPE(20,42,HARD)
            CHANGE_SLAB_TYPE(21,42,HARD)
            CHANGE_SLAB_TYPE(22,42,DIRT)
            CHANGE_SLAB_TYPE(23,42,DIRT)
            CHANGE_SLAB_TYPE(24,42,DIRT)
            CHANGE_SLAB_TYPE(25,42,DIRT)
            CHANGE_SLAB_TYPE(8,43,HARD)
            CHANGE_SLAB_TYPE(9,43,HARD)
            CHANGE_SLAB_TYPE(10,43,HARD)
            CHANGE_SLAB_TYPE(11,43,HARD)
            CHANGE_SLAB_TYPE(12,43,HARD)
            CHANGE_SLAB_TYPE(13,43,HARD)
            CHANGE_SLAB_TYPE(14,43,HARD)
            CHANGE_SLAB_TYPE(15,43,HARD)
            CHANGE_SLAB_TYPE(16,43,HARD)
            CHANGE_SLAB_TYPE(17,43,HARD)
            CHANGE_SLAB_TYPE(18,43,HARD)
            CHANGE_SLAB_TYPE(19,43,HARD)
            CHANGE_SLAB_TYPE(20,43,HARD)
            CHANGE_SLAB_TYPE(21,43,HARD)
            CHANGE_SLAB_TYPE(22,43,DIRT)
            CHANGE_SLAB_TYPE(23,43,DIRT)
            CHANGE_SLAB_TYPE(24,43,DIRT)
            CHANGE_SLAB_TYPE(25,43,DIRT)
            CHANGE_SLAB_TYPE(8,44,HARD)
            CHANGE_SLAB_TYPE(9,44,HARD)
            CHANGE_SLAB_TYPE(10,44,HARD)
            CHANGE_SLAB_TYPE(11,44,HARD)
            CHANGE_SLAB_TYPE(12,44,HARD)
            CHANGE_SLAB_TYPE(13,44,HARD)
            CHANGE_SLAB_TYPE(14,44,HARD)
            CHANGE_SLAB_TYPE(15,44,HARD)
            CHANGE_SLAB_TYPE(16,44,HARD)
            CHANGE_SLAB_TYPE(17,44,HARD)
            CHANGE_SLAB_TYPE(18,44,HARD)
            CHANGE_SLAB_TYPE(19,44,HARD)
            CHANGE_SLAB_TYPE(20,44,HARD)
            CHANGE_SLAB_TYPE(21,44,HARD)
            CHANGE_SLAB_TYPE(22,44,DIRT)
            CHANGE_SLAB_TYPE(23,44,DIRT)
            CHANGE_SLAB_TYPE(24,44,DIRT)
            CHANGE_SLAB_TYPE(25,44,DIRT)
            CHANGE_SLAB_TYPE(8,45,HARD)
            CHANGE_SLAB_TYPE(9,45,HARD)
            CHANGE_SLAB_TYPE(10,45,HARD)
            CHANGE_SLAB_TYPE(11,45,HARD)
            CHANGE_SLAB_TYPE(12,45,HARD)
            CHANGE_SLAB_TYPE(13,45,HARD)
            CHANGE_SLAB_TYPE(14,45,HARD)
            CHANGE_SLAB_TYPE(15,45,HARD)
            CHANGE_SLAB_TYPE(16,45,HARD)
            CHANGE_SLAB_TYPE(17,45,HARD)
            CHANGE_SLAB_TYPE(18,45,HARD)
            CHANGE_SLAB_TYPE(19,45,HARD)
            CHANGE_SLAB_TYPE(20,45,HARD)
            CHANGE_SLAB_TYPE(21,45,HARD)
            CHANGE_SLAB_TYPE(22,45,DIRT)
            CHANGE_SLAB_TYPE(23,45,DIRT)
            CHANGE_SLAB_TYPE(24,45,DIRT)
            CHANGE_SLAB_TYPE(25,45,DIRT)
            CHANGE_SLAB_TYPE(8,46,HARD)
            CHANGE_SLAB_TYPE(9,46,HARD)
            CHANGE_SLAB_TYPE(10,46,HARD)
            CHANGE_SLAB_TYPE(11,46,HARD)
            CHANGE_SLAB_TYPE(12,46,HARD)
            CHANGE_SLAB_TYPE(13,46,HARD)
            CHANGE_SLAB_TYPE(14,46,HARD)
            CHANGE_SLAB_TYPE(15,46,HARD)
            CHANGE_SLAB_TYPE(16,46,HARD)
            CHANGE_SLAB_TYPE(17,46,HARD)
            CHANGE_SLAB_TYPE(18,46,HARD)
            CHANGE_SLAB_TYPE(19,46,HARD)
            CHANGE_SLAB_TYPE(20,46,HARD)
            CHANGE_SLAB_TYPE(21,46,DIRT)
            CHANGE_SLAB_TYPE(22,46,DIRT)
            CHANGE_SLAB_TYPE(23,46,DIRT)
            CHANGE_SLAB_TYPE(24,46,DIRT)
            CHANGE_SLAB_TYPE(25,46,DIRT)
            CHANGE_SLAB_TYPE(8,47,HARD)
            CHANGE_SLAB_TYPE(9,47,HARD)
            CHANGE_SLAB_TYPE(10,47,HARD)
            CHANGE_SLAB_TYPE(11,47,HARD)
            CHANGE_SLAB_TYPE(12,47,HARD)
            CHANGE_SLAB_TYPE(13,47,HARD)
            CHANGE_SLAB_TYPE(14,47,HARD)
            CHANGE_SLAB_TYPE(15,47,HARD)
            CHANGE_SLAB_TYPE(16,47,HARD)
            CHANGE_SLAB_TYPE(17,47,HARD)
            CHANGE_SLAB_TYPE(18,47,HARD)
            CHANGE_SLAB_TYPE(19,47,HARD)
            CHANGE_SLAB_TYPE(20,47,DIRT)
            CHANGE_SLAB_TYPE(21,47,DIRT)
            CHANGE_SLAB_TYPE(22,47,DIRT)
            CHANGE_SLAB_TYPE(23,47,DIRT)
            CHANGE_SLAB_TYPE(24,47,DIRT)
            CHANGE_SLAB_TYPE(25,47,DIRT)
            CHANGE_SLAB_TYPE(8,48,HARD)
            CHANGE_SLAB_TYPE(9,48,HARD)
            CHANGE_SLAB_TYPE(10,48,HARD)
            CHANGE_SLAB_TYPE(11,48,HARD)
            CHANGE_SLAB_TYPE(12,48,HARD)
            CHANGE_SLAB_TYPE(13,48,HARD)
            CHANGE_SLAB_TYPE(14,48,HARD)
            CHANGE_SLAB_TYPE(15,48,HARD)
            CHANGE_SLAB_TYPE(16,48,HARD)
            CHANGE_SLAB_TYPE(17,48,HARD)
            CHANGE_SLAB_TYPE(18,48,HARD)
            CHANGE_SLAB_TYPE(19,48,DIRT)
            CHANGE_SLAB_TYPE(20,48,DIRT)
            CHANGE_SLAB_TYPE(21,48,DIRT)
            CHANGE_SLAB_TYPE(22,48,DIRT)
            CHANGE_SLAB_TYPE(23,48,DIRT)
            CHANGE_SLAB_TYPE(24,48,DIRT)
            CHANGE_SLAB_TYPE(25,48,DIRT)
            CHANGE_SLAB_TYPE(8,49,HARD)
            CHANGE_SLAB_TYPE(9,49,HARD)
            CHANGE_SLAB_TYPE(10,49,HARD)
            CHANGE_SLAB_TYPE(11,49,HARD)
            CHANGE_SLAB_TYPE(12,49,HARD)
            CHANGE_SLAB_TYPE(13,49,HARD)
            CHANGE_SLAB_TYPE(14,49,HARD)
            CHANGE_SLAB_TYPE(15,49,HARD)
            CHANGE_SLAB_TYPE(16,49,HARD)
            CHANGE_SLAB_TYPE(17,49,DIRT)
            CHANGE_SLAB_TYPE(18,49,DIRT)
            CHANGE_SLAB_TYPE(19,49,DIRT)
            CHANGE_SLAB_TYPE(20,49,DIRT)
            CHANGE_SLAB_TYPE(21,49,DIRT)
            CHANGE_SLAB_TYPE(22,49,DIRT)
            CHANGE_SLAB_TYPE(23,49,DIRT)
            CHANGE_SLAB_TYPE(24,49,DIRT)
            CHANGE_SLAB_TYPE(25,49,DIRT)
            CHANGE_SLAB_TYPE(8,50,HARD)
            CHANGE_SLAB_TYPE(9,50,HARD)
            CHANGE_SLAB_TYPE(10,50,HARD)
            CHANGE_SLAB_TYPE(11,50,HARD)
            CHANGE_SLAB_TYPE(12,50,HARD)
            CHANGE_SLAB_TYPE(13,50,HARD)
            CHANGE_SLAB_TYPE(14,50,HARD)
            CHANGE_SLAB_TYPE(15,50,DIRT)
            CHANGE_SLAB_TYPE(16,50,DIRT)
            CHANGE_SLAB_TYPE(17,50,DIRT)
            CHANGE_SLAB_TYPE(18,50,DIRT)
            CHANGE_SLAB_TYPE(19,50,DIRT)
            CHANGE_SLAB_TYPE(20,50,DIRT)
            CHANGE_SLAB_TYPE(21,50,DIRT)
            CHANGE_SLAB_TYPE(22,50,DIRT)
            CHANGE_SLAB_TYPE(23,50,DIRT)
            CHANGE_SLAB_TYPE(24,50,DIRT)
            CHANGE_SLAB_TYPE(25,50,DIRT)
            CHANGE_SLAB_TYPE(8,51,HARD)
            CHANGE_SLAB_TYPE(9,51,HARD)
            CHANGE_SLAB_TYPE(10,51,HARD)
            CHANGE_SLAB_TYPE(11,51,HARD)
            CHANGE_SLAB_TYPE(12,51,HARD)
            CHANGE_SLAB_TYPE(13,51,HARD)
            CHANGE_SLAB_TYPE(14,51,DIRT)
            CHANGE_SLAB_TYPE(15,51,DIRT)
            CHANGE_SLAB_TYPE(16,51,DIRT)
            CHANGE_SLAB_TYPE(17,51,DIRT)
            CHANGE_SLAB_TYPE(18,51,DIRT)
            CHANGE_SLAB_TYPE(19,51,DIRT)
            CHANGE_SLAB_TYPE(20,51,DIRT)
            CHANGE_SLAB_TYPE(21,51,DIRT)
            CHANGE_SLAB_TYPE(22,51,DIRT)
            CHANGE_SLAB_TYPE(23,51,DIRT)
            CHANGE_SLAB_TYPE(24,51,DIRT)
            CHANGE_SLAB_TYPE(25,51,DIRT)
            CHANGE_SLAB_TYPE(8,52,HARD)
            CHANGE_SLAB_TYPE(9,52,HARD)
            CHANGE_SLAB_TYPE(10,52,HARD)
            CHANGE_SLAB_TYPE(11,52,HARD)
            CHANGE_SLAB_TYPE(12,52,HARD)

            REVEAL_MAP_RECT(PLAYER0,43,136,45,45)
            CONCEAL_MAP_RECT(PLAYER0,58,115,3,3)
            CONCEAL_MAP_RECT(PLAYER0,61,115,3,3)
            CONCEAL_MAP_RECT(PLAYER0,64,115,3,3)
            CONCEAL_MAP_RECT(PLAYER0,61,118,3,3)
            CONCEAL_MAP_RECT(PLAYER0,64,118,3,3)
            CONCEAL_MAP_RECT(PLAYER0,64,121,3,3)
            CONCEAL_MAP_RECT(PLAYER0,64,124,3,3)
            CONCEAL_MAP_RECT(PLAYER0,64,139,3,3)
            CONCEAL_MAP_RECT(PLAYER0,61,142,3,3)
            CONCEAL_MAP_RECT(PLAYER0,64,142,3,3)
            CONCEAL_MAP_RECT(PLAYER0,58,145,3,3)
            CONCEAL_MAP_RECT(PLAYER0,61,145,3,3)
            CONCEAL_MAP_RECT(PLAYER0,64,145,3,3)
            CONCEAL_MAP_RECT(PLAYER0,52,148,3,3)
            CONCEAL_MAP_RECT(PLAYER0,55,148,3,3)
            
            CONCEAL_MAP_RECT(PLAYER0,55,112,3,3)

            CONCEAL_MAP_RECT(PLAYER0,58,148,3,3)
            CONCEAL_MAP_RECT(PLAYER0,61,148,3,3)
            CONCEAL_MAP_RECT(PLAYER0,64,148,3,3)
            CONCEAL_MAP_RECT(PLAYER0,46,151,3,3)
            CONCEAL_MAP_RECT(PLAYER0,49,151,3,3)
            CONCEAL_MAP_RECT(PLAYER0,52,151,3,3)
            CONCEAL_MAP_RECT(PLAYER0,55,151,3,3)
            CONCEAL_MAP_RECT(PLAYER0,58,151,3,3)
            CONCEAL_MAP_RECT(PLAYER0,61,151,3,3)
            CONCEAL_MAP_RECT(PLAYER0,64,151,3,3)
            CONCEAL_MAP_RECT(PLAYER0,43,154,3,3)
            CONCEAL_MAP_RECT(PLAYER0,46,154,3,3)
            CONCEAL_MAP_RECT(PLAYER0,49,154,3,3)
            CONCEAL_MAP_RECT(PLAYER0,52,154,3,3)
            CONCEAL_MAP_RECT(PLAYER0,55,154,3,3)
            CONCEAL_MAP_RECT(PLAYER0,58,154,3,3)
            CONCEAL_MAP_RECT(PLAYER0,61,154,3,3)
            CONCEAL_MAP_RECT(PLAYER0,64,154,3,3)
            CONCEAL_MAP_RECT(PLAYER0,40,157,3,3)
            CONCEAL_MAP_RECT(PLAYER0,43,157,3,3)
            CONCEAL_MAP_RECT(PLAYER0,46,157,3,3)
            CONCEAL_MAP_RECT(PLAYER0,49,157,3,3)
            CONCEAL_MAP_RECT(PLAYER0,52,157,3,3)
            CONCEAL_MAP_RECT(PLAYER0,55,157,3,3)
            CONCEAL_MAP_RECT(PLAYER0,58,157,3,3)
            CONCEAL_MAP_RECT(PLAYER0,61,157,3,3)
            CONCEAL_MAP_RECT(PLAYER0,64,157,3,3)

            REVEAL_MAP_RECT(PLAYER0,67,163,3,3)
            CONCEAL_MAP_RECT(PLAYER0,40,184,3,3)
            CONCEAL_MAP_RECT(PLAYER0,40,187,3,3)
            CONCEAL_MAP_RECT(PLAYER0,40,160,3,3)

            CHANGE_SLAB_TYPE(13,52,DIRT)
            CHANGE_SLAB_TYPE(14,52,DIRT)
            CHANGE_SLAB_TYPE(20,52,DIRT)
            CHANGE_SLAB_TYPE(21,52,DIRT)
            CHANGE_SLAB_TYPE(22,52,DIRT)
            CHANGE_SLAB_TYPE(23,52,DIRT)
            CHANGE_SLAB_TYPE(24,52,DIRT)
            CHANGE_SLAB_TYPE(25,52,DIRT)
            CHANGE_SLAB_TYPE(13,38,HARD)
            CHANGE_SLAB_TYPE(15,54,LAVA)
            CHANGE_SLAB_TYPE(19,54,LAVA)
            CHANGE_SLAB_TYPE(15,54,WATER)
            CHANGE_SLAB_TYPE(19,54,WATER)
            CHANGE_SLAB_TYPE(16,54,PRETTY_PATH)
            CHANGE_SLAB_TYPE(17,54,PRETTY_PATH)
            CHANGE_SLAB_TYPE(18,54,PRETTY_PATH)
            CHANGE_SLAB_TYPE(15,53,DRAPE_WALL)
            CHANGE_SLAB_TYPE(16,53,PAIR_WALL)
            CHANGE_SLAB_TYPE(17,53,DRAPE_WALL)
            CHANGE_SLAB_TYPE(18,53,PAIR_WALL)
            CHANGE_SLAB_TYPE(19,53,DRAPE_WALL)
            CHANGE_SLAB_TYPE(14,56,LAVA)
            CHANGE_SLAB_TYPE(14,57,LAVA)
            CHANGE_SLAB_TYPE(14,58,LAVA)
            CHANGE_SLAB_TYPE(20,56,LAVA)
            CHANGE_SLAB_TYPE(20,57,LAVA)
            CHANGE_SLAB_TYPE(20,58,LAVA)
            CHANGE_SLAB_TYPE(14,56,WATER)
            CHANGE_SLAB_TYPE(14,57,WATER)
            CHANGE_SLAB_TYPE(14,58,WATER)
            CHANGE_SLAB_TYPE(20,56,WATER)
            CHANGE_SLAB_TYPE(20,57,WATER)
            CHANGE_SLAB_TYPE(20,58,WATER)

            CHANGE_SLAB_TYPE(20,38,DIRT)
            CHANGE_SLAB_TYPE(20,37,DIRT)
            CHANGE_SLAB_TYPE(21,38,DIRT)
            CHANGE_SLAB_TYPE(22,39,DIRT)
            CHANGE_SLAB_TYPE(20,36,DIRT)
            CHANGE_SLAB_TYPE(19,36,DIRT)
            CHANGE_SLAB_TYPE(19,35,DIRT)

            CHANGE_SLAB_TYPE(13,56,PRETTY_PATH)
            CHANGE_SLAB_TYPE(13,57,PRETTY_PATH)
            CHANGE_SLAB_TYPE(13,58,PRETTY_PATH)
            CHANGE_SLAB_TYPE(21,56,PRETTY_PATH)
            CHANGE_SLAB_TYPE(21,57,PRETTY_PATH)
            CHANGE_SLAB_TYPE(21,58,PRETTY_PATH)

            CHANGE_SLAB_TYPE(15,57,PRETTY_PATH)
            CHANGE_SLAB_TYPE(19,57,PRETTY_PATH)
            
            CHANGE_SLAB_TYPE(12,55,DRAPE_WALL)
            CHANGE_SLAB_TYPE(12,56,PAIR_WALL)
            CHANGE_SLAB_TYPE(12,57,DRAPE_WALL)
            CHANGE_SLAB_TYPE(12,58,PAIR_WALL)
            CHANGE_SLAB_TYPE(12,59,DRAPE_WALL)

            CHANGE_SLAB_TYPE(22,55,DRAPE_WALL)
            CHANGE_SLAB_TYPE(22,56,DRAPE_WALL)
            CHANGE_SLAB_TYPE(22,57,PRETTY_PATH)
            CHANGE_SLAB_TYPE(22,58,DRAPE_WALL)
            CHANGE_SLAB_TYPE(22,59,DRAPE_WALL)
            CHANGE_SLAB_TYPE(21,55,PRETTY_PATH)
            CHANGE_SLAB_TYPE(21,59,PRETTY_PATH)
            CHANGE_SLAB_TYPE(20,55,PRETTY_PATH)
            CHANGE_SLAB_TYPE(20,59,PRETTY_PATH)

            CHANGE_SLAB_TYPE(17,52,DRAPE_WALL)

            ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,46,172,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,58,172,1,PLAYER_NEUTRAL)

            ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,40,172,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(CANDLESTCK,40,169,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(CANDLESTCK,40,175,1,PLAYER_NEUTRAL)

            ADD_OBJECT_TO_LEVEL_AT_POS(CANDLESTCK,49,163,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(CANDLESTCK,55,163,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,52,172,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,52,163,1,PLAYER_NEUTRAL)

            ADD_OBJECT_TO_LEVEL_AT_POS(STATUE_HORNY,61,166,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(STATUE_HORNY,61,178,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,64,169,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,64,175,1,PLAYER_NEUTRAL)

            ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,63,166,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,64,166,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,64,165,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,65,165,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,65,166,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,65,167,1,PLAYER_NEUTRAL)

            ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,63,178,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,64,178,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,65,178,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,64,179,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,65,179,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,65,177,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,65,176,1,PLAYER_NEUTRAL)

            ADD_OBJECT_TO_LEVEL_AT_POS(TORCH,65,169,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,65,175,1,PLAYER_NEUTRAL)

            SET_OBJECT_CONFIGURATION(TORCH,AnimationID,962)
            SET_CREATURE_CONFIGURATION(IMP,HandSymbol,IMP_ICON)

            SET_FLAG(PLAYER1,FLAG5,1)
            IF(PLAYER0,CAMPAIGN_FLAG0 == 4)
                SET_FLAG(PLAYER0,CAMPAIGN_FLAG0,7)
                SET_TEXTURE(ALL_PLAYERS,7)
            ENDIF
            IF(PLAYER0,CAMPAIGN_FLAG0 == 5)
                SET_FLAG(PLAYER0,CAMPAIGN_FLAG0,4)
                SET_TEXTURE(ALL_PLAYERS,4)
            ENDIF
            IF(PLAYER0,CAMPAIGN_FLAG0 == 6)
                SET_FLAG(PLAYER0,CAMPAIGN_FLAG0,5)
                SET_TEXTURE(ALL_PLAYERS,5)
            ENDIF
            IF(PLAYER0,CAMPAIGN_FLAG0 == 7)
                SET_FLAG(PLAYER0,CAMPAIGN_FLAG0,6)
                SET_TEXTURE(ALL_PLAYERS,6)
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF(PLAYER1,FLAG5 == 1)
    IF(PLAYER0,VIEW_TYPE == 1)
        SET_TIMER(PLAYER1,TIMER5)
        IF(PLAYER1,TIMER5 > 10)
            NEXT_COMMAND_REUSABLE
            ZOOM_TO_LOCATION(PLAYER0,PLAYER0)
        ENDIF
        IF(PLAYER1,TIMER5 > 20)
            SET_FLAG(PLAYER0,CAMPAIGN_FLAG7,2)
            SET_FLAG(PLAYER1,FLAG5,2)
        ENDIF  
    ENDIF
ENDIF

IF(PLAYER1,FLAG5 >= 1)
    IF(PLAYER0,VIEW_TYPE == 1)
        IF(PLAYER1,TIMER5 > 10)
            IF(PLAYER1,FLAG6 == 0)
                SET_FLAG(PLAYER1,FLAG7,1)
                SET_TIMER(PLAYER1,TIMER6)
                IF(PLAYER0,MONEY > 1113610)
                    NEXT_COMMAND_REUSABLE
                    ADD_GOLD_TO_PLAYER(PLAYER0,-1000000)
                ENDIF
                IF(PLAYER0,MONEY > 113610)
                    NEXT_COMMAND_REUSABLE
                    ADD_GOLD_TO_PLAYER(PLAYER0,-100000)
                ENDIF
                IF(PLAYER0,MONEY > 13610)
                    NEXT_COMMAND_REUSABLE
                    ADD_GOLD_TO_PLAYER(PLAYER0,-10000)
                ENDIF
                IF(PLAYER0,MONEY > 3610)
                    NEXT_COMMAND_REUSABLE
                    ADD_GOLD_TO_PLAYER(PLAYER0,-1000)
                ENDIF
                IF(PLAYER0,MONEY > 2610)
                    NEXT_COMMAND_REUSABLE
                    ADD_GOLD_TO_PLAYER(PLAYER0,-100)
                ENDIF
                IF(PLAYER0,MONEY > 2510)
                    NEXT_COMMAND_REUSABLE
                    ADD_GOLD_TO_PLAYER(PLAYER0,-10)
                ENDIF
                IF(PLAYER0,MONEY > 2500)
                    NEXT_COMMAND_REUSABLE
                    ADD_GOLD_TO_PLAYER(PLAYER0,-1)
                ENDIF
                IF(PLAYER0,MONEY < 2500)
                    NEXT_COMMAND_REUSABLE
                    ADD_GOLD_TO_PLAYER(PLAYER0,1)
                ENDIF
                IF(PLAYER0,MONEY < 2490)
                    NEXT_COMMAND_REUSABLE
                    ADD_GOLD_TO_PLAYER(PLAYER0,10)
                ENDIF
                IF(PLAYER0,MONEY == 2500)
                    IF(PLAYER1,TIMER6 > 150)
                        SET_FLAG(PLAYER1,FLAG6,1)
                    ENDIF
                ENDIF
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF_ACTION_POINT(31,PLAYER0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SKELE,33,1,2,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SKELEMAGE,34,1,2,0)
    SET_TIMER(PLAYER1,TIMER5)
    IF(PLAYER1,TIMER5 > 20)
        REM "Intruder! Leave the prisoner alone!"
        DISPLAY_MESSAGE(186,SKELEMAGE)
        REM "Turn back now!"
        DISPLAY_MESSAGE(187,SKELE)
        CHANGE_SLAB_TYPE(32,56,PRETTY_PATH)
        CHANGE_SLAB_TYPE(32,58,PRETTY_PATH)
        CREATE_EFFECT_AT_POS(27,97,169,5)
        CREATE_EFFECT_AT_POS(27,97,175,5)
        PLAY_MESSAGE(PLAYER0,SOUND,72)
    ENDIF
ENDIF

IF_ACTION_POINT(35,PLAYER0)
    REM "What a cruel joke. Find another way to break him out."
    DISPLAY_MESSAGE(188,PLAYER0)
    CHANGE_SLAB_TYPE(34,53,WATER)
    SET_TIMER(PLAYER0,TIMER3)   
    IF(PLAYER0,TIMER3>20)
        REM "Help me! I've been trapped here for so long!"
        DISPLAY_MESSAGE(189,IMP2)
    ENDIF
    IF(PLAYER0,TIMER3>70)
        REM "I'll do anything you wish if you free me!"
        DISPLAY_MESSAGE(190,IMP2)
    ENDIF
    IF(PLAYER0,TIMER3>120)
        REM "There is a troll to the north who knows how to free me."
        DISPLAY_MESSAGE(191,IMP2)
        DISPLAY_OBJECTIVE(191)
    ENDIF
    IF(PLAYER0,TIMER3>170)
        REM "But the last one who went to find him didn't come back..."
        DISPLAY_MESSAGE(192,IMP2)
    ENDIF
ENDIF

IF_ACTION_POINT(78,PLAYER0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,TOADWARRIOR,79,1,3,0)
ENDIF

IF_ACTION_POINT(36,PLAYER0)
    SET_TIMER(PLAYER0,TIMER3)
    REM "Thank the gods you're here! Something is horribly wrong."
    DISPLAY_MESSAGE(193,SORCEROR)
    IF(PLAYER0,TIMER3>50)
        REM "We don't have much time."
        DISPLAY_MESSAGE(194,SORCEROR)
    ENDIF
    IF(PLAYER0,TIMER3>100)
        REM "There is a dark force corrupting this land."
        DISPLAY_MESSAGE(195,SORCEROR)
    ENDIF
    IF(PLAYER0,TIMER3>150)
        REM "To defeat it, you have t"
        DISPLAY_MESSAGE(196,SORCEROR)
    ENDIF
    IF(PLAYER0,TIMER3>158)
        MOVE_CREATURE(PLAYER3,SORCEROR,ANYWHERE,5,24,NULL)
        QUICK_MESSAGE(58," ",NONE)
        QUICK_MESSAGE(58," ",NONE)
        QUICK_MESSAGE(58," ",NONE)
        QUICK_MESSAGE(58," ",NONE)
        QUICK_MESSAGE(58," ",NONE)
        QUICK_MESSAGE(58," ",NONE)
        QUICK_MESSAGE(58," ",NONE)
        QUICK_MESSAGE(58," ",NONE)
        QUICK_MESSAGE(58," ",NONE)
        QUICK_MESSAGE(58," ",NONE)
        SET_TEXTURE(ALL_PLAYERS,WINTER)
        PLAY_MESSAGE(PLAYER0,SOUND,"this_is_halloween_loop_short.mp3")
        SET_OBJECT_CONFIGURATION(MUSHROOM_GREEN,MaximumSize,0)
        SET_OBJECT_CONFIGURATION(MUSHROOM_RED,MaximumSize,0)
        SET_OBJECT_CONFIGURATION(MUSHROOM_YELLOW,MaximumSize,0)
    ENDIF
    IF(PLAYER0,TIMER3>159)    
        IF(PLAYER0,CAMPAIGN_FLAG0 == 4)
            SET_FLAG(PLAYER0,CAMPAIGN_FLAG0,7)
            SET_TEXTURE(ALL_PLAYERS,7)
        ENDIF
        IF(PLAYER0,CAMPAIGN_FLAG0 == 5)
            SET_FLAG(PLAYER0,CAMPAIGN_FLAG0,4)
            SET_TEXTURE(ALL_PLAYERS,4)
        ENDIF
        IF(PLAYER0,CAMPAIGN_FLAG0 == 6)
            SET_FLAG(PLAYER0,CAMPAIGN_FLAG0,5)
            SET_TEXTURE(ALL_PLAYERS,5)
        ENDIF
        IF(PLAYER0,CAMPAIGN_FLAG0 == 7)
            SET_FLAG(PLAYER0,CAMPAIGN_FLAG0,6)
            SET_TEXTURE(ALL_PLAYERS,6)
        ENDIF
        MOVE_CREATURE(PLAYER6,TOADWARRIOR,ANYWHERE,5,36,NULL)
        CHANGE_CREATURE_OWNER(PLAYER6,TOADWARRIOR,ANYWHERE,PLAYER_GOOD)
        CHANGE_CREATURE_OWNER(PLAYER6,TOADWARRIOR,ANYWHERE,PLAYER_GOOD)
        CHANGE_CREATURE_OWNER(PLAYER6,TOADWARRIOR,ANYWHERE,PLAYER_GOOD)
        ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,122,126,1,PLAYER_NEUTRAL)
        ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,121,126,1,PLAYER_NEUTRAL)
        ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,122,127,1,PLAYER_NEUTRAL)
        ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,117,130,1,PLAYER_NEUTRAL)
        ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,117,131,1,PLAYER_NEUTRAL)
        ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,118,131,1,PLAYER_NEUTRAL)
        ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,125,130,1,PLAYER_NEUTRAL)
        ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,125,131,1,PLAYER_NEUTRAL)
        ADD_OBJECT_TO_LEVEL_AT_POS(BARREL,125,132,1,PLAYER_NEUTRAL)
        CHANGE_SLAB_TYPE(28,39,WATER)
        CHANGE_SLAB_TYPE(27,39,WATER)
        ADD_TO_FLAG(PLAYER3,FLAG0,1)
    ENDIF
ENDIF

IF(PLAYER0,CAMPAIGN_FLAG7 == 2)
    IF_ACTION_POINT(11,PLAYER0)
        RESET_ACTION_POINT(37,PLAYER0)
    ENDIF
    IF_ACTION_POINT(37,PLAYER0)
        SET_TIMER(PLAYER0,TIMER2)
        IF(PLAYER0,TIMER2 > 40)
            SET_TEXTURE(ALL_PLAYERS,WINTER)
            PLAY_MESSAGE(PLAYER0,SOUND,"this_is_halloween_loop_short.mp3")
        ENDIF
        IF(PLAYER0,TIMER2 > 41)
            IF(PLAYER0,CAMPAIGN_FLAG0 == 4)
                SET_FLAG(PLAYER0,CAMPAIGN_FLAG0,7)
                SET_TEXTURE(ALL_PLAYERS,7)
            ENDIF
            IF(PLAYER0,CAMPAIGN_FLAG0 == 5)
                SET_FLAG(PLAYER0,CAMPAIGN_FLAG0,4)
                SET_TEXTURE(ALL_PLAYERS,4)
            ENDIF
            IF(PLAYER0,CAMPAIGN_FLAG0 == 6)
                SET_FLAG(PLAYER0,CAMPAIGN_FLAG0,5)
                SET_TEXTURE(ALL_PLAYERS,5)
            ENDIF
            IF(PLAYER0,CAMPAIGN_FLAG0 == 7)
                SET_FLAG(PLAYER0,CAMPAIGN_FLAG0,6)
                SET_TEXTURE(ALL_PLAYERS,6)
            ENDIF
            CHANGE_SLAB_TYPE(19,27,PRETTY_PATH)
            ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,58,82,1,PLAYER_NEUTRAL)
            CHANGE_SLAB_TYPE(17,23,DIRT)
            CHANGE_SLAB_TYPE(18,23,DIRT)
            CHANGE_SLAB_TYPE(19,23,DIRT)
            CHANGE_SLAB_TYPE(20,23,DIRT)
            CHANGE_SLAB_TYPE(21,23,DIRT)
            CHANGE_SLAB_TYPE(15,24,DIRT)
            CHANGE_SLAB_TYPE(16,24,DIRT)
            CHANGE_SLAB_TYPE(17,24,DIRT)
            CHANGE_SLAB_TYPE(18,24,DIRT)
            CHANGE_SLAB_TYPE(19,24,DIRT)
            CHANGE_SLAB_TYPE(20,24,DIRT)
            CHANGE_SLAB_TYPE(21,24,DIRT)
            CHANGE_SLAB_TYPE(22,24,DIRT)
            CHANGE_SLAB_TYPE(14,25,DIRT)
            CHANGE_SLAB_TYPE(15,25,DIRT)
            CHANGE_SLAB_TYPE(16,25,DIRT)
            CHANGE_SLAB_TYPE(17,25,DIRT)
            CHANGE_SLAB_TYPE(18,25,WATER)
            CHANGE_SLAB_TYPE(19,25,WATER)
            CHANGE_SLAB_TYPE(20,25,WATER)
            CHANGE_SLAB_TYPE(21,25,DIRT)
            CHANGE_SLAB_TYPE(22,25,DIRT)
            CHANGE_SLAB_TYPE(14,26,DIRT)
            CHANGE_SLAB_TYPE(15,26,DIRT)
            CHANGE_SLAB_TYPE(16,26,DIRT)
            CHANGE_SLAB_TYPE(17,26,WATER)
            CHANGE_SLAB_TYPE(18,26,WATER)
            CHANGE_SLAB_TYPE(19,26,WATER)
            CHANGE_SLAB_TYPE(20,26,WATER)
            CHANGE_SLAB_TYPE(21,26,WATER)
            CHANGE_SLAB_TYPE(22,26,DIRT)
            CHANGE_SLAB_TYPE(14,27,DIRT)
            CHANGE_SLAB_TYPE(15,27,DIRT)
            CHANGE_SLAB_TYPE(16,27,DIRT)
            CHANGE_SLAB_TYPE(17,27,WATER)
            CHANGE_SLAB_TYPE(18,27,WATER)
            CHANGE_SLAB_TYPE(20,27,WATER)
            CHANGE_SLAB_TYPE(21,27,WATER)
            CHANGE_SLAB_TYPE(22,27,DIRT)
            CHANGE_SLAB_TYPE(15,28,DIRT)
            CHANGE_SLAB_TYPE(16,28,DIRT)
            CHANGE_SLAB_TYPE(17,28,WATER)
            CHANGE_SLAB_TYPE(18,28,WATER)
            CHANGE_SLAB_TYPE(19,28,WATER)
            CHANGE_SLAB_TYPE(16,29,DIRT)
            CHANGE_SLAB_TYPE(17,29,DIRT)
            CHANGE_SLAB_TYPE(18,30,DIRT)
            CONCEAL_MAP_RECT(PLAYER0,58,64,9,27)
            CONCEAL_MAP_RECT(PLAYER0,43,79,27,9)
            CONCEAL_MAP_RECT(PLAYER0,49,73,3,3)
            CONCEAL_MAP_RECT(PLAYER0,57,79,36,30)
            ADD_TO_FLAG(PLAYER3,FLAG0,1)
        ENDIF
    ENDIF
ENDIF

IF_ACTION_POINT(39,PLAYER0)
    REM "Ah, welcome. It's been so long since I've had a visitor."
    DISPLAY_MESSAGE(197,TROLL)
    SET_TIMER(PLAYER0,TIMER3)   
    IF(PLAYER0,TIMER3>50)
        REM "A way to free your imp friend? I know just the thing."
        DISPLAY_MESSAGE(198,TROLL)
    ENDIF
    IF(PLAYER0,TIMER3>100)
        REM "There is a skeleton key in a storeroom to the south."
        DISPLAY_MESSAGE(199,TROLL)
        REVEAL_MAP_RECT(PLAYER0,124,196,15,15)
    ENDIF
    IF(PLAYER0,TIMER3>150)
        REM "I've no need of it, so you can just take it."
        DISPLAY_MESSAGE(200,TROLL)
    ENDIF
    IF(PLAYER0,TIMER3>200)
        REM "Go through this secret passage. You'll find it before long."
        DISPLAY_MESSAGE(901,TROLL)
        SET_DOOR(UNLOCKED,64,17)
        CREATE_EFFECT_AT_POS(EFFECT_HARMLESS_GAS_1,193,50)
        REM "Follow the secret path from the troll's workshop to the skeleton key."
        DISPLAY_OBJECTIVE(902)
    ENDIF
    IF(PLAYER0,TIMER3>250)
        REM "You might even be able to find a way out!"
        DISPLAY_MESSAGE(903,TROLL)
    ENDIF
ENDIF

IF_ACTION_POINT(38,PLAYER0)
    SET_TIMER(PLAYER0,TIMER2)
    IF(PLAYER0,TIMER2 > 0)
        SET_CREATURE_CONFIGURATION(SPIDER,BaseSpeed,0)
        SET_CREATURE_CONFIGURATION(BUG,BaseSpeed,0)
        SET_CREATURE_CONFIGURATION(FLY2,BaseSpeed,0)
    ENDIF
    IF(PLAYER0,TIMER2 > 40)
        SET_TEXTURE(ALL_PLAYERS,WINTER)
        PLAY_MESSAGE(PLAYER0,SOUND,"this_is_halloween_loop_short.mp3")
        CHANGE_SLAB_TYPE(72,11,SCAVENGE_AREA,MATCH)
    ENDIF
    IF(PLAYER0,TIMER2 > 41)
        MOVE_CREATURE(PLAYER2,TROLL,ANYWHERE,1,40,NULL)
        MOVE_CREATURE(PLAYER1,SKELETON2,ANYWHERE,1,41,NULL)
        SET_OBJECT_CONFIGURATION(LAIR_GOBLN,AnimationID,156)
        ADD_GOLD_TO_PLAYER(PLAYER2,-9999)
        CHANGE_SLAB_TYPE(72,11,HATCHERY,MATCH)
        CHANGE_SLAB_TYPE(61,12,BOOK_SHELVES,MATCH)
        CHANGE_SLAB_TYPE(64,17,PATH)
        SET_OBJECT_CONFIGURATION(WRKBOX_ALARM,UpdateFunction,UPDATE_POWER_LIGHTNING)
        SET_OBJECT_CONFIGURATION(WRKBOX_WRDOFPW,UpdateFunction,UPDATE_POWER_LIGHTNING)
        SET_OBJECT_CONFIGURATION(WRKBOX_POISONG,UpdateFunction,UPDATE_POWER_LIGHTNING)
        SET_OBJECT_CONFIGURATION(WRKBOX_LAVA,UpdateFunction,UPDATE_POWER_LIGHTNING)
        SET_OBJECT_CONFIGURATION(WRKBOX_DEMOLTN,UpdateFunction,UPDATE_POWER_LIGHTNING)
        SET_OBJECT_CONFIGURATION(WRKBOX_WOOD,UpdateFunction,UPDATE_POWER_LIGHTNING)
        SET_OBJECT_CONFIGURATION(WRKBOX_SECRET,UpdateFunction,UPDATE_POWER_LIGHTNING)
        SET_CREATURE_CONFIGURATION(SPIDER,BaseSpeed,56)
        SET_CREATURE_CONFIGURATION(BUG,BaseSpeed,56)
        SET_CREATURE_CONFIGURATION(FLY2,BaseSpeed,96)
        ADD_TO_FLAG(PLAYER3,FLAG0,1)
        REM "Follow the path from the skeleton's library to the troll key."
        DISPLAY_OBJECTIVE(904)
        IF(PLAYER0,CAMPAIGN_FLAG0 == 4)
            SET_FLAG(PLAYER0,CAMPAIGN_FLAG0,7)
            SET_TEXTURE(ALL_PLAYERS,7)
        ENDIF
        IF(PLAYER0,CAMPAIGN_FLAG0 == 5)
            SET_FLAG(PLAYER0,CAMPAIGN_FLAG0,4)
            SET_TEXTURE(ALL_PLAYERS,4)
        ENDIF
        IF(PLAYER0,CAMPAIGN_FLAG0 == 6)
            SET_FLAG(PLAYER0,CAMPAIGN_FLAG0,5)
            SET_TEXTURE(ALL_PLAYERS,5)
        ENDIF
        IF(PLAYER0,CAMPAIGN_FLAG0 == 7)
            SET_FLAG(PLAYER0,CAMPAIGN_FLAG0,6)
            SET_TEXTURE(ALL_PLAYERS,6)
        ENDIF
    ENDIF
ENDIF

IF_ACTION_POINT(43,PLAYER0)
    MOVE_CREATURE(PLAYER5,VAMPIRE,ANYWHERE,1,42,EFFECT_HARMLESS_GAS_1)
    SET_CREATURE_CONFIGURATION(SPIDER,BaseSpeed,0)
    SET_CREATURE_CONFIGURATION(BUG,BaseSpeed,0)
    SET_CREATURE_CONFIGURATION(FLY2,BaseSpeed,0)


    REM "Wait! Listen to me. We don't have long."
    DISPLAY_MESSAGE(905,VAMPIRE)
    SET_TIMER(PLAYER0,TIMER3)   
    IF(PLAYER0,TIMER3>40)
        REM "We have to stop this before we can't."
        DISPLAY_MESSAGE(906,VAMPIRE)
    ENDIF
    IF(PLAYER0,TIMER3>80)
        REM "I've cloaked my presence from his effects for now."
        DISPLAY_MESSAGE(907,VAMPIRE)
    ENDIF
    IF(PLAYER0,TIMER3>120)
        REM "We have no time for these pointless quests."
        DISPLAY_MESSAGE(908,VAMPIRE)
    ENDIF
    IF(PLAYER0,TIMER3>160)
        REM "I've made a shortcut to the south."
        DISPLAY_MESSAGE(909,VAMPIRE)
    ENDIF
    IF(PLAYER0,TIMER3>200)
        REM "Freeing your imp friend won't help. He will be useless."
        DISPLAY_MESSAGE(910,VAMPIRE)
    ENDIF
    IF(PLAYER0,TIMER3>240)
        REM "Instead, sacrifice him in the temple south of here."
        DISPLAY_MESSAGE(911,VAMPIRE)
        REVEAL_MAP_RECT(PLAYER0,142,145,15,15)
        CHANGE_SLAB_TEXTURE(46,47,LAVA_CAVERN,MATCH)
        CHANGE_SLAB_TEXTURE(47,48,GYPSUM)
        TUTORIAL_FLASH_BUTTON(12,-1)
    ENDIF
    IF(PLAYER0,TIMER3>280)
        REM "I'm sorry, we're in this together now."
        DISPLAY_MESSAGE(912,VAMPIRE)
    ENDIF
    IF(PLAYER0,TIMER3>280)
        MOVE_CREATURE(PLAYER5,VAMPIRE,ANYWHERE,1,24,EFFECT_HARMLESS_GAS_1)
        CHANGE_SLAB_TYPE(42,25,DIRT,MATCH)
        CHANGE_SLAB_TYPE(43,26,PATH,MATCH)
        CHANGE_SLAB_TYPE(46,25,DIRT)
        CHANGE_SLAB_TYPE(46,26,DIRT)
        CHANGE_SLAB_TYPE(46,27,DIRT)
        CHANGE_SLAB_TYPE(46,28,DIRT)
        CHANGE_SLAB_TYPE(47,26,DIRT)
        CHANGE_SLAB_TYPE(47,27,DIRT)
        CHANGE_SLAB_TYPE(47,28,DIRT)
        CHANGE_SLAB_TYPE(48,26,DIRT)
        CHANGE_SLAB_TYPE(48,27,DIRT)
        CHANGE_SLAB_TYPE(48,28,DIRT)
        CHANGE_SLAB_TYPE(43,29,PATH)
        CHANGE_SLAB_TYPE(44,29,PATH)
        CHANGE_SLAB_TYPE(45,29,PATH)
        CHANGE_SLAB_TYPE(43,30,PATH)
        CHANGE_SLAB_TYPE(44,30,PATH)
        CHANGE_SLAB_TYPE(43,25,PATH)
        CHANGE_SLAB_TYPE(44,25,PATH)
        CHANGE_SLAB_TYPE(45,25,DIRT)
        CHANGE_SLAB_TYPE(43,28,DIRT)
        SET_CREATURE_CONFIGURATION(SPIDER,BaseSpeed,56)
        SET_CREATURE_CONFIGURATION(BUG,BaseSpeed,56)
        SET_CREATURE_CONFIGURATION(FLY2,BaseSpeed,96)
        ADD_OBJECT_TO_LEVEL_AT_POS(CANDLESTCK,129,92,1)
        ADD_OBJECT_TO_LEVEL_AT_POS(CANDLESTCK,131,92,1)
        REVEAL_MAP_RECT(PLAYER0,130,91,3,3)
        REVEAL_MAP_RECT(PLAYER0,133,91,3,3)
    ENDIF
ENDIF

IF_ACTION_POINT(44,PLAYER0)
    SET_FLAG(PLAYER2,FLAG3,1)
    ADD_TO_FLAG(PLAYER3,FLAG0,1)
ENDIF

IF(PLAYER2,FLAG3 > 0)
    ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,145,196,1)
    ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,142,187,1)
    ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,136,187,1)
    ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,142,193,1)
    ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,130,184,1)
    ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,124,187,1)
    ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,148,199,1)
ENDIF

IF_ACTION_POINT(48,PLAYER0)
    USE_POWER_ON_PLAYERS_CREATURES(PLAYER0,ANY_CREATURE,PLAYER0,POWER_SLAP,1,1)
ENDIF

IF_ACTION_POINT(45,PLAYER0)
    PLAY_MESSAGE(PLAYER0,SOUND,116)
    SET_OBJECT_CONFIGURATION(KEY,MaximumSize,0)
    CREATE_EFFECT_AT_POS(EFFECT_SPANGLE_ORANGE,124,196)
    REM "We have the key. Now to find the shortcut home."
    DISPLAY_MESSAGE(913,PLAYER0)
    DISPLAY_OBJECTIVE("913")
    IF_SLAB_TYPE(35,63,LAVA)
        RESET_ACTION_POINT(35,PLAYER0)
        CHANGE_SLAB_TYPE(43,51,HARD)
        IF_ACTION_POINT(35,PLAYER0)
            PLAY_MESSAGE(PLAYER0,SOUND,979)
            CHANGE_SLAB_OWNER(35,57,PLAYER3)
            CHANGE_CREATURE_OWNER(PLAYER3,IMP2,AT_ACTION_POINT[35],PLAYER0)
            REM "Hooray! I'm finally free!"
            DISPLAY_MESSAGE(914,IMP2)
            PLAY_MESSAGE(PLAYER0,SOUND,496)
            CHANGE_SLAB_TYPE(34,53,DIRT)
            CONCEAL_MAP_RECT(PLAYER0,82,94,86,128)
            CONCEAL_MAP_RECT(PLAYER0,187,61,123,85)
            SET_TIMER(PLAYER0,TIMER3)
            IF(PLAYER0,TIMER3 > 1200)
                SET_CREATURE_INSTANCE(IMP2,1,NULL,1)
            ENDIF
            IF(PLAYER0,TIMER3 > 5000)
                TUTORIAL_FLASH_BUTTON(12,-1)
            ENDIF
            REM IF(PLAYER0,TIMER3 > 10000)
            REM    REM "Instead, sacrifice him in the temple south of here."
            REM    DISPLAY_INFORMATION(911)
            REM ENDIF
            IF(PLAYER2,FLAG2 == 0)
                IF(PLAYER0,IMP2 < 1)
                    NEXT_COMMAND_REUSABLE
                    ADD_CREATURE_TO_LEVEL(PLAYER0,IMP2,PLAYER0,1,1,0)
                    NEXT_COMMAND_REUSABLE
                    PLAY_MESSAGE(PLAYER0,SOUND,496)
                ENDIF
            ENDIF
            REM "Now that you have an imp, claim territory and build yourself back up. Then crush the heroes in the base to the north and show them you are not to be trifled with."
            DISPLAY_OBJECTIVE(915)
        ENDIF
    ENDIF
ENDIF

IF_ACTION_POINT(46,PLAYER0)
    IF(PLAYER2,FLAG2 == 0)
        NEXT_COMMAND_REUSABLE
        COUNT_CREATURES_AT_ACTION_POINT(46,PLAYER0,IMP2,PLAYER2,FLAG2)
    ENDIF
    IF(PLAYER2,FLAG2 == 1)
        SET_TIMER(PLAYER0,TIMER3)
        KILL_CREATURE(PLAYER0,IMP2,ANYWHERE,1)
        CREATE_EFFECT_AT_POS(38,142,145,2)
        CHANGE_SLAB_TEXTURE(47,48,LAVA_CAVERN)
        IF(PLAYER0,TIMER3 > 20)
            REM "Why did you do that? We're going to have to find a new imp now."
            DISPLAY_OBJECTIVE(916,ALL_PLAYERS)
        ENDIF
        IF(PLAYER0,TIMER3 > 39)
            QUICK_MESSAGE(58," ",NONE)
            QUICK_MESSAGE(58," ",NONE)
            QUICK_MESSAGE(58," ",NONE)
            QUICK_MESSAGE(58," ",NONE)
            QUICK_MESSAGE(58," ",NONE)
            QUICK_MESSAGE(58," ",NONE)
            QUICK_MESSAGE(58," ",NONE)
            QUICK_MESSAGE(58," ",NONE)
        ENDIF
        IF(PLAYER0,TIMER3 > 40)
            REM " I see you."
            DISPLAY_OBJECTIVE(917,ALL_PLAYERS)
            DISPLAY_INFORMATION(917,ALL_PLAYERS)
            DISPLAY_INFORMATION(917,ALL_PLAYERS)
            DISPLAY_INFORMATION(917,ALL_PLAYERS)
            DISPLAY_INFORMATION(917,ALL_PLAYERS)
            DISPLAY_INFORMATION(917,ALL_PLAYERS)
            DISPLAY_INFORMATION(917,ALL_PLAYERS)
            DISPLAY_INFORMATION(917,ALL_PLAYERS)
            DISPLAY_INFORMATION(917,ALL_PLAYERS)
            DISPLAY_MESSAGE(917,PLAYER3)
            PLAY_MESSAGE(PLAYER0,SOUND,8)
        ENDIF
        IF(PLAYER0,TIMER3 > 60)
            CHANGE_CREATURE_OWNER(PLAYER0,ANY_CREATURE,ANYWHERE,PLAYER6)
            CHANGE_CREATURE_OWNER(PLAYER0,ANY_CREATURE,ANYWHERE,PLAYER6)
            MOVE_CREATURE(PLAYER6,SPIDER,ANYWHERE,2,PLAYER0,NULL)
            MOVE_CREATURE(PLAYER6,BUG,ANYWHERE,2,PLAYER0,NULL)
            MOVE_CREATURE(PLAYER6,FLY2,ANYWHERE,2,PLAYER0,NULL)
            ADD_CREATURE_TO_LEVEL(PLAYER6,DRAWFROM(SPIDER,BUG,FLY2),PLAYER0,1,3,0)
        ENDIF
        IF(PLAYER0,TIMER3 > 460)
            MOVE_CREATURE(PLAYER6,SPIDER,ANYWHERE,4,49,NULL)
            MOVE_CREATURE(PLAYER6,BUG,ANYWHERE,4,49,NULL)
            MOVE_CREATURE(PLAYER6,FLY2,ANYWHERE,4,49,NULL)
        ENDIF
        IF(PLAYER0,TIMER3 > 500)
            REM "Now he's noticed what you're doing. We have to be quick."
            DISPLAY_MESSAGE(918,VAMPIRE)
        ENDIF
        IF(PLAYER0,TIMER3 > 550)
            REM "One last time. Sacrifice three insects."
            DISPLAY_MESSAGE(919,VAMPIRE)
            TUTORIAL_FLASH_BUTTON(12,-1)
            REM "Now that the imp we rescued is dead, I reckon our next plan is to lay down and die like an animal. That will show them, Keeper."
            DISPLAY_OBJECTIVE(920)
        ENDIF
        IF(PLAYER0,TIMER3 > 600)
            DISPLAY_VARIABLE(PLAYER2,FLAG2,5,0)
            RESET_ACTION_POINT(46,PLAYER0)
            RESET_ACTION_POINT(54,PLAYER0)
            SET_FLAG(PLAYER2,FLAG2,2)
        ENDIF
    ENDIF
ENDIF

IF(PLAYER2,FLAG2 >= 2)
    IF(PLAYER0,VIEW_TYPE == 2)
        IF(PLAYER2,FLAG2 < 5)
            SET_TIMER(PLAYER2,TIMER3)
            USE_POWER_ON_PLAYERS_CREATURES(PLAYER0,ANY_CREATURE,PLAYER0,POWER_SLAP,1,1)
            IF(PLAYER2,TIMER3 > 400)
                NEXT_COMMAND_REUSABLE
                USE_POWER_ON_PLAYERS_CREATURES(PLAYER0,ANY_CREATURE,PLAYER0,POWER_SLAP,1,1)
                NEXT_COMMAND_REUSABLE
                SET_TIMER(PLAYER2,TIMER3)
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF(PLAYER2,FLAG2 == 2)
    IF_ACTION_POINT(54,PLAYER0)
        REM " Master, I think your creatures have lost faith in you..."
        DISPLAY_MESSAGE(921,PLAYER3)
        RESET_ACTION_POINT(50,PLAYER0)
        IF_ACTION_POINT(50,PLAYER0)
            CHANGE_CREATURES_ANNOYANCE(PLAYER0,ANY_CREATURE,INCREASE,10000)
            RESET_ACTION_POINT(53,PLAYER0)
            RESET_ACTION_POINT(47,PLAYER0)
            IF_ACTION_POINT(53,PLAYER0)
                PLAY_MESSAGE(PLAYER0,SPEECH,5)
                RESET_ACTION_POINT(47,PLAYER0)
                IF_ACTION_POINT(47,PLAYER0)
                    PLAY_MESSAGE(PLAYER0,SPEECH,6)
                ENDIF
            ENDIF
        ENDIF
    ENDIF
    IF_ACTION_POINT(46,PLAYER0)
        KILL_CREATURE(PLAYER0,ANY_CREATURE,AT_ACTION_POINT[46],1)
        CREATE_EFFECT_AT_POS(38,142,145,2)
        RESET_ACTION_POINT(46,PLAYER0)
        CHANGE_SLAB_TEXTURE(47,48,SWAMP_SERPENT)
        ADD_TO_FLAG(PLAYER2,FLAG2,1)
        TUTORIAL_FLASH_BUTTON(0,-1)
    ENDIF
ENDIF
IF(PLAYER2,FLAG2 == 3)
    REM " Stop this nonsense."
    DISPLAY_MESSAGE(922,PLAYER3)
    DISPLAY_OBJECTIVE(922)
    RESET_ACTION_POINT(54,PLAYER0)
    IF_ACTION_POINT(54,PLAYER0)
        CHANGE_SLAB_TYPE(41,64,LAVA,MATCH)
        SET_DOOR(LOCKED,39,65)
        SET_DOOR(LOCKED,41,63)
        CHANGE_SLAB_OWNER(39,63,PLAYER_NEUTRAL,MATCH)
        CHANGE_SLAB_OWNER(42,63,PLAYER_NEUTRAL,MATCH)
        CHANGE_SLAB_TYPE(41,64,PRETTY_PATH,MATCH)
        CHANGE_SLAB_OWNER(41,64,PLAYER_NEUTRAL,MATCH)
        CHANGE_SLAB_OWNER(39,65,PLAYER_NEUTRAL)
        CHANGE_SLAB_OWNER(41,63,PLAYER_NEUTRAL)
        CHANGE_SLAB_TYPE(41,65,VOID)
        SET_FLAG(PLAYER2,FLAG3,1)
        CONCEAL_MAP_RECT(PLAYER0,124,196,8,8)
        RESET_ACTION_POINT(50,PLAYER0)
        RESET_ACTION_POINT(45,PLAYER0)
        IF_ACTION_POINT(45,PLAYER0)
            ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,127,193,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,121,193,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,121,199,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,127,199,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,130,178,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,133,163,1,PLAYER_NEUTRAL)
            ADD_OBJECT_TO_LEVEL_AT_POS(STATUE2_3,132,160,1,PLAYER_NEUTRAL)
        ENDIF
        IF_ACTION_POINT(50,PLAYER0)
            PLAY_MESSAGE(PLAYER0,SPEECH,7)
            PLAY_MESSAGE(PLAYER0,SOUND,947)
            RESET_ACTION_POINT(51,PLAYER0)
            IF_ACTION_POINT(51,PLAYER0)
                PLAY_MESSAGE(PLAYER0,SPEECH,11)
                PLAY_MESSAGE(PLAYER0,SOUND,947)
                RESET_ACTION_POINT(47,PLAYER0)
                IF_ACTION_POINT(47,PLAYER0)
                    PLAY_MESSAGE(PLAYER0,SPEECH,8)
                    PLAY_MESSAGE(PLAYER0,SOUND,947)
                ENDIF
            ENDIF
        ENDIF
    ENDIF
    IF_ACTION_POINT(46,PLAYER0)
        KILL_CREATURE(PLAYER0,ANY_CREATURE,AT_ACTION_POINT[46],1)
        CREATE_EFFECT_AT_POS(38,142,145,2)
        RESET_ACTION_POINT(46,PLAYER0)
        CHANGE_SLAB_TEXTURE(47,48,GYPSUM)
        ADD_TO_FLAG(PLAYER2,FLAG2,1)
        REM " Fine. I'll stop you by force."
        DISPLAY_MESSAGE(923,PLAYER3)
        REM "We've taken too long and now the lord of this realm has arrived. It's over."
        DISPLAY_OBJECTIVE(924)
        HIDE_HERO_GATE(-1,0)
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,LANDLORD,-1,1)
        ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,LANDLORD,-2,DUNGEON_HEART,0,5,0)
        RESET_ACTION_POINT(54,PLAYER0)
        RESET_ACTION_POINT(47,PLAYER0)
    ENDIF
ENDIF

IF(PLAYER2,FLAG2 == 4)
    IF_ACTION_POINT(54,PLAYER0)
        CHANGE_SLAB_TYPE(40,64,LAVA,MATCH)
        CHANGE_SLAB_TYPE(41,65,LAVA,MATCH)
        CHANGE_SLAB_TYPE(39,63,DIRT,MATCH)
        CHANGE_SLAB_TYPE(39,66,DIRT,MATCH)
        CHANGE_SLAB_TYPE(43,62,LAVA,MATCH)
    ENDIF
    IF_ACTION_POINT(47,PLAYER0)
        CHANGE_SLAB_TYPE(47,48,VOID,MATCH)
        PLAY_MESSAGE(PLAYER0,SOUND,"kktaunt01.mp3")
        SET_TIMER(PLAYER0,TIMER3)
        IF(PLAYER0,TIMER3 > 100)
            REM "No...no..."
            DISPLAY_MESSAGE(925,VAMPIRE)
        ENDIF
        IF(PLAYER0,TIMER3 > 150)
            REM "...quickly, Keeper. Make your own."
            DISPLAY_MESSAGE(926,VAMPIRE)
            ROOM_AVAILABLE(PLAYER0,TEMPLE,1,1)
            TUTORIAL_FLASH_BUTTON(12,-1)
            IF(PLAYER0,MONEY < 3150)
                NEXT_COMMAND_REUSABLE
                ADD_GOLD_TO_PLAYER(PLAYER0,1000)
            ENDIF
        ENDIF
        IF(PLAYER0,TIMER3 > 200)
            REM " So there is another who would oppose me..."
            DISPLAY_MESSAGE(927,PLAYER3)
            IF(PLAYER0,TEMPLE > 0)
                REM "Don't do this. You will regret it."
                DISPLAY_MESSAGE(928,PLAYER3)
                REM "Don't do this. You will regret it."
                DISPLAY_OBJECTIVE(929)
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF_SLAB_TYPE(22,62,TEMPLE_POOL)
    IF_SLAB_TYPE(23,62,TEMPLE_POOL)
        IF_SLAB_TYPE(24,62,TEMPLE_POOL)
            IF_SLAB_TYPE(22,63,TEMPLE_POOL)
                IF_SLAB_TYPE(23,63,TEMPLE_POOL)
                    IF_SLAB_TYPE(24,63,TEMPLE_POOL)
                        IF_SLAB_TYPE(22,64,TEMPLE_POOL)
                            IF_SLAB_TYPE(23,64,TEMPLE_POOL)
                                IF_SLAB_TYPE(24,64,TEMPLE_POOL)
                                    RESET_ACTION_POINT(52,PLAYER0)
                                    CHANGE_SLAB_TEXTURE(23,63,GYPSUM)
                                    IF_ACTION_POINT(52,PLAYER0)
                                        KILL_CREATURE(PLAYER0,ANY_CREATURE,AT_ACTION_POINT[52],1)
                                        CREATE_EFFECT_AT_POS(38,70,190,2)
                                        CHANGE_SLAB_TEXTURE(23,63,NONE)
                                        SET_FLAG(PLAYER2,FLAG2,5)
                                    ENDIF
                                ENDIF
                            ENDIF
                        ENDIF
                    ENDIF
                ENDIF
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF_SLAB_TYPE(25,65,TEMPLE_POOL)
    IF_SLAB_TYPE(26,65,TEMPLE_POOL)
        IF_SLAB_TYPE(27,65,TEMPLE_POOL)
            IF_SLAB_TYPE(25,66,TEMPLE_POOL)
                IF_SLAB_TYPE(26,66,TEMPLE_POOL)
                    IF_SLAB_TYPE(27,66,TEMPLE_POOL)
                        IF_SLAB_TYPE(25,67,TEMPLE_POOL)
                            IF_SLAB_TYPE(26,67,TEMPLE_POOL)
                                IF_SLAB_TYPE(27,67,TEMPLE_POOL)
                                    RESET_ACTION_POINT(55,PLAYER0)
                                    CHANGE_SLAB_TEXTURE(26,66,GYPSUM)
                                    IF_ACTION_POINT(55,PLAYER0)
                                        KILL_CREATURE(PLAYER0,ANY_CREATURE,AT_ACTION_POINT[55],1)
                                        CREATE_EFFECT_AT_POS(38,79,199,2)
                                        CHANGE_SLAB_TEXTURE(26,66,NONE)
                                        SET_FLAG(PLAYER2,FLAG2,5)
                                    ENDIF
                                ENDIF
                            ENDIF
                        ENDIF
                    ENDIF
                ENDIF
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF_SLAB_TYPE(22,68,TEMPLE_POOL)
    IF_SLAB_TYPE(23,68,TEMPLE_POOL)
        IF_SLAB_TYPE(24,68,TEMPLE_POOL)
            IF_SLAB_TYPE(22,69,TEMPLE_POOL)
                IF_SLAB_TYPE(23,69,TEMPLE_POOL)
                    IF_SLAB_TYPE(24,69,TEMPLE_POOL)
                        IF_SLAB_TYPE(22,70,TEMPLE_POOL)
                            IF_SLAB_TYPE(23,70,TEMPLE_POOL)
                                IF_SLAB_TYPE(24,70,TEMPLE_POOL)
                                    RESET_ACTION_POINT(56,PLAYER0)
                                    CHANGE_SLAB_TEXTURE(23,69,GYPSUM)
                                    IF_ACTION_POINT(56,PLAYER0)
                                        KILL_CREATURE(PLAYER0,ANY_CREATURE,AT_ACTION_POINT[56],1)
                                        CREATE_EFFECT_AT_POS(38,70,208,2)
                                        CHANGE_SLAB_TEXTURE(23,69,NONE)
                                        SET_FLAG(PLAYER2,FLAG2,5)
                                    ENDIF
                                ENDIF
                            ENDIF
                        ENDIF
                    ENDIF
                ENDIF
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF(PLAYER2,FLAG2 < 5)
    IF(PLAYER_GOOD,MONEY < 999900)
        CHANGE_SLAB_TYPE(60,42,DRAPE_WALL)
    ENDIF
ENDIF

IF(PLAYER0,TEMPLE > 0)
    ROOM_AVAILABLE(PLAYER0,LAIR,1,1)
    ROOM_AVAILABLE(PLAYER0,GARDEN,1,1)
    ROOM_AVAILABLE(PLAYER0,TREASURE,1,1)
ENDIF

IF(PLAYER2,FLAG2 == 5)
    HIDE_VARIABLE
    REM "You should have listened..."
    DISPLAY_MESSAGE(930,PLAYER3)
    SET_TIMER(PLAYER0,TIMER3)
    IF(PLAYER0,TIMER3 > 50)
        PLAY_MESSAGE(PLAYER0,SPEECH,105)
        DISPLAY_OBJECTIVE(335,PLAYER0)
        KILL_CREATURE(PLAYER0,ANY_CREATURE,ANYWHERE,99)
        CREATE_EFFECT(EFFECT_WORD_OF_POWER,PLAYER0)
    ENDIF
    IF(PLAYER0,TIMER3 > 150)
        REM "...wait...nothing happened. You're still here."
        DISPLAY_MESSAGE(931,VAMPIRE)
    ENDIF
    IF(PLAYER0,TIMER3 > 200)
        REM "His power is weakening! He can't stop me now!"
        DISPLAY_MESSAGE(932,VAMPIRE)
        CHANGE_SLAB_TYPE(43,62,PATH,MATCH)
    ENDIF
    IF(PLAYER0,TIMER3 > 250)
        REM "Quickly, use these to destroy anything in the way."
        DISPLAY_MESSAGE(933,VAMPIRE)
        PLAY_MESSAGE(PLAYER0,SPEECH,43)
        MAGIC_AVAILABLE(PLAYER0,POWER_CALL_TO_ARMS,1,1)
        MAGIC_AVAILABLE(PLAYER0,POWER_LIGHTNING,1,1)
        MAGIC_AVAILABLE(PLAYER0,POWER_HEAL_CREATURE,1,1)
        MAGIC_AVAILABLE(PLAYER0,POWER_PROTECT,1,1)
        MAGIC_AVAILABLE(PLAYER0,POWER_SPEED,1,1)
        MAGIC_AVAILABLE(PLAYER0,POWER_FLIGHT,1,1)
        MAGIC_AVAILABLE(PLAYER0,POWER_HOLD_AUDIENCE,1,1)
        TUTORIAL_FLASH_BUTTON(25,-1)
        CHANGE_SLAB_TYPE(60,43,PATH)
        CHANGE_SLAB_TYPE(22,62,HATCHERY)
        CHANGE_SLAB_TYPE(23,62,HATCHERY)
        CHANGE_SLAB_TYPE(24,62,HATCHERY)
        CHANGE_SLAB_TYPE(22,63,HATCHERY)
        CHANGE_SLAB_TYPE(23,63,HATCHERY)
        CHANGE_SLAB_TYPE(24,63,HATCHERY)
        CHANGE_SLAB_TYPE(22,64,HATCHERY)
        CHANGE_SLAB_TYPE(23,64,HATCHERY)
        CHANGE_SLAB_TYPE(24,64,HATCHERY)
        CHANGE_SLAB_TYPE(25,65,LAIR_AREA)
        CHANGE_SLAB_TYPE(26,65,LAIR_AREA)
        CHANGE_SLAB_TYPE(27,65,LAIR_AREA)
        CHANGE_SLAB_TYPE(25,66,LAIR_AREA)
        CHANGE_SLAB_TYPE(26,66,LAIR_AREA)
        CHANGE_SLAB_TYPE(27,66,LAIR_AREA)
        CHANGE_SLAB_TYPE(25,67,LAIR_AREA)
        CHANGE_SLAB_TYPE(26,67,LAIR_AREA)
        CHANGE_SLAB_TYPE(27,67,LAIR_AREA)
        CHANGE_SLAB_TYPE(22,68,TREASURY_AREA)
        CHANGE_SLAB_TYPE(23,68,TREASURY_AREA)
        CHANGE_SLAB_TYPE(24,68,TREASURY_AREA)
        CHANGE_SLAB_TYPE(22,69,TREASURY_AREA)
        CHANGE_SLAB_TYPE(23,69,TREASURY_AREA)
        CHANGE_SLAB_TYPE(24,69,TREASURY_AREA)
        CHANGE_SLAB_TYPE(22,70,TREASURY_AREA)
        CHANGE_SLAB_TYPE(23,70,TREASURY_AREA)
        CHANGE_SLAB_TYPE(24,70,TREASURY_AREA)
        ADD_GOLD_TO_PLAYER(PLAYER0,10)
    ENDIF
    IF(PLAYER0,TIMER3 > 300)
        REM "Wipe out the heroes! I've strengthened your creatures too."
        DISPLAY_MESSAGE(934,VAMPIRE)
        USE_SPECIAL_INCREASE_LEVEL(PLAYER0,3)
        CREATURE_ENTRANCE_LEVEL(PLAYER0,6)
        SET_FLAG(PLAYER2,FLAG2,6)
    ENDIF
ENDIF

IF(PLAYER2,FLAG2 > 5)
    IF(PLAYER0,MONEY < 5000)
        NEXT_COMMAND_REUSABLE
        ADD_GOLD_TO_PLAYER(PLAYER0,399)
    ENDIF   
    IF(PLAYER0,MONEY < 9800)
        NEXT_COMMAND_REUSABLE
        ADD_GOLD_TO_PLAYER(PLAYER0,99)
    ENDIF
    IF(PLAYER0,MONEY < 9980)
        NEXT_COMMAND_REUSABLE
        ADD_GOLD_TO_PLAYER(PLAYER0,10)
    ENDIF
    IF(PLAYER0,MONEY < 10000)
        NEXT_COMMAND_REUSABLE
        ADD_GOLD_TO_PLAYER(PLAYER0,1)
    ENDIF
    IF(PLAYER0,MONEY > 10000)
        NEXT_COMMAND_REUSABLE
        ADD_GOLD_TO_PLAYER(PLAYER0,-1)
    ENDIF
    IF(PLAYER_GOOD,GOOD_CREATURES == 0)
        REM "That's the heroes taken care of."
        DISPLAY_MESSAGE(1080,VAMPIRE)
        SET_TIMER(PLAYER0,TIMER3)
        IF(PLAYER0,TIMER3 > 50)
            REM "The tunneller party has opened up their base."
            DISPLAY_MESSAGE(1081,VAMPIRE)
        ENDIF
        IF(PLAYER0,TIMER3 > 100)
            REM "Destroy the heart inside, reveal his true base. End this!"
            DISPLAY_MESSAGE(1082,VAMPIRE)
            REM "Now, destroy the heart to the east before he can recover!"
            DISPLAY_OBJECTIVE(1083)
            TUTORIAL_FLASH_BUTTON(23,-1)
        ENDIF
        IF_ACTION_POINT(57,PLAYER0)
            REM "It won't break with the gold they have. Let me help."
            DISPLAY_MESSAGE(1084,VAMPIRE)
            SET_TIMER(PLAYER0,TIMER3)
            IF(PLAYER0,TIMER3 > 50)
                QUICK_MESSAGE(99,"!player.addgold PLAYER_GOOD -9999999999",NONE)
                ADD_GOLD_TO_PLAYER(PLAYER_GOOD,-99999999)
                CHANGE_SLAB_TYPE(66,42,PRETTY_PATH)
                CREATE_EFFECT_AT_POS(EFFECT_DIRT_RUBBLE_BIG,199,127)
            ENDIF
        ENDIF
        IF(PLAYER4,DUNGEON_DESTROYED==1)
            REM "I should have finished you a long time ago. No more games."
            DISPLAY_MESSAGE(1086,PLAYER3)
            SET_TIMER(PLAYER0,TIMER3)
            SET_OBJECT_CONFIGURATION(STATUE2_3,UpdateFunction,UPDATE_POWER_LIGHTNING)
            SET_OBJECT_CONFIGURATION(STATUE2_3,MaximumSize,0)
            SET_OBJECT_CONFIGURATION(STATUE2,UpdateFunction,UPDATE_POWER_LIGHTNING)
            SET_OBJECT_CONFIGURATION(STATUE2,MaximumSize,0)
            ADD_CREATURE_TO_LEVEL(PLAYER6,STATUE,58,3,5,0)
            ADD_CREATURE_TO_LEVEL(PLAYER6,STATUE,59,5,5,0)
            ADD_CREATURE_TO_LEVEL(PLAYER6,STATUE,60,2,6,0)
            ADD_CREATURE_TO_LEVEL(PLAYER6,STATUE,52,1,6,0)
            ADD_CREATURE_TO_LEVEL(PLAYER6,STATUE,55,1,6,0)
            ADD_CREATURE_TO_LEVEL(PLAYER6,STATUE,56,1,6,0)
            ADD_CREATURE_TO_LEVEL(PLAYER6,STATUE,45,4,5,0)
            ADD_CREATURE_TO_LEVEL(PLAYER6,STATUE,50,3,5,0)
            ADD_CREATURE_TO_LEVEL(PLAYER6,STATUE,44,5,5,0)
            ADD_CREATURE_TO_LEVEL(PLAYER6,STATUE,53,3,5,0)
            IF(PLAYER0,TIMER3 > 50)
                SET_GENERATE_SPEED(50)
                MAX_CREATURES(PLAYER0,5)
            ENDIF
            IF(PLAYER6,STATUE < 6)
                REM "We've survived everything so far. Let's storm his base."
                DISPLAY_MESSAGE(1087,VAMPIRE)
                REM "We've survived everything so far. Let's storm his base."
                DISPLAY_OBJECTIVE(1088,77)
                REVEAL_MAP_RECT(PLAYER0,160,175,9,9)
                CHANGE_SLAB_TYPE(53,60,PATH)
                CHANGE_SLAB_TYPE(52,61,PATH)
                CHANGE_SLAB_TYPE(51,62,PATH)
                CHANGE_SLAB_TYPE(50,63,PATH)
                CHANGE_SLAB_TYPE(50,64,PATH)
                CHANGE_SLAB_TYPE(54,49,PATH)
                CHANGE_SLAB_TYPE(54,50,PATH)
                CHANGE_SLAB_TYPE(53,50,PATH,MATCH)
                CHANGE_SLAB_TYPE(51,52,PATH,MATCH)
                CHANGE_SLAB_TYPE(50,55,PATH,MATCH)
                CHANGE_SLAB_TYPE(45,60,PATH,MATCH)
                CHANGE_SLAB_TYPE(46,61,PATH)
                CHANGE_SLAB_TYPE(46,63,PATH)
                CHANGE_SLAB_TYPE(22,65,PRETTY_PATH)
                CHANGE_SLAB_TYPE(24,65,PRETTY_PATH)
                CHANGE_SLAB_TYPE(22,67,PRETTY_PATH)
                CHANGE_SLAB_TYPE(24,67,PRETTY_PATH)
                CHANGE_SLAB_OWNER(22,65,PLAYER0)
                CHANGE_SLAB_OWNER(24,65,PLAYER0)
                CHANGE_SLAB_OWNER(22,67,PLAYER0)
                CHANGE_SLAB_OWNER(24,67,PLAYER0)

                CHANGE_SLAB_TYPE(20,65,PRETTY_PATH)
                CHANGE_SLAB_TYPE(20,67,PRETTY_PATH)
                CHANGE_SLAB_OWNER(20,65,PLAYER0)
                CHANGE_SLAB_OWNER(20,67,PLAYER0)

                SET_TIMER(PLAYER2,TIMER4)
                IF(PLAYER2,TIMER4 > 300)
                    ADD_CREATURE_TO_LEVEL(PLAYER6,STATUE,61,2,8,0)
                ENDIF
                IF_ACTION_POINT(61,PLAYER0)
                    REM "That thing is spawning abominations. Destroy it"
                    DISPLAY_MESSAGE(1089,VAMPIRE)
                    DISPLAY_OBJECTIVE(1089,61)
                    ADD_CREATURE_TO_LEVEL(PLAYER6,CFLY,61,4,7,0)
                    ADD_CREATURE_TO_LEVEL(PLAYER6,STATUE,61,6,8,0)
                    IF_SLAB_TYPE(57,58,VOID)
                        SET_TIMER(PLAYER2,TIMER5)
                        IF(PLAYER2,TIMER5 > 600)
                            ADD_CREATURE_TO_LEVEL(PLAYER6,CFLY,61,4,7,0)
                        ENDIF
                    ENDIF
                    IF_SLAB_TYPE(57,58,LAVA)
                        REM "Don't question it. Keep moving."
                        DISPLAY_MESSAGE(1090,VAMPIRE)
                        MAX_CREATURES(PLAYER0,10)
                        CHANGE_SLAB_TYPE(23,66,LAIR_AREA,MATCH)
                        ROOM_AVAILABLE(PLAYER0,LAIR,1,1)
                        USE_POWER_AT_POS(PLAYER0,172,163,POWER_DESTROY_WALLS,2,1)
                        CHANGE_SLAB_OWNER(57,54,PLAYER6)
                    ENDIF
                ENDIF
            ENDIF
        ENDIF
    ENDIF
ENDIF


IF_ACTION_POINT(62,PLAYER0)
    REM "This is it. The source of his power is to the south."
    DISPLAY_MESSAGE(1091,VAMPIRE)
    SET_MUSIC("this_is_halloween_loop_final.mp3")
    REVEAL_MAP_RECT(PLAYER0,199,208,9,9)
    SET_TIMER(PLAYER2,TIMER6)
    SET_TIMER(PLAYER3,TIMER2)
    CREATURE_ENTRANCE_LEVEL(PLAYER0,7)
    SET_CREATURE_INSTANCE(SPIDER,7,DRAIN,7)
    SET_CREATURE_INSTANCE(BUG,7,ARMOUR,7)
    SET_CREATURE_INSTANCE(FLY2,5,MISSILE,5)
    SET_CREATURE_INSTANCE(FLY2,7,INVISIBILITY,7)
    IF(PLAYER2,TIMER6 == 0)
        NEXT_COMMAND_REUSABLE
        SET_CREATURE_CONFIGURATION(NECROVATAR,HandSymbol,CBOSS_PORTRAIT1)
    ENDIF
    IF(PLAYER2,TIMER6 == 1)
        NEXT_COMMAND_REUSABLE
        SET_CREATURE_CONFIGURATION(NECROVATAR,HandSymbol,CBOSS_PORTRAIT2)
    ENDIF
    IF(PLAYER2,TIMER6 == 2)
        NEXT_COMMAND_REUSABLE
        SET_CREATURE_CONFIGURATION(NECROVATAR,HandSymbol,CBOSS_PORTRAIT3)
    ENDIF
    IF(PLAYER2,TIMER6 == 3)
        NEXT_COMMAND_REUSABLE
        SET_CREATURE_CONFIGURATION(NECROVATAR,HandSymbol,CBOSS_PORTRAIT4)
    ENDIF
    IF(PLAYER2,TIMER6 >= 4)
        NEXT_COMMAND_REUSABLE
        SET_CREATURE_CONFIGURATION(NECROVATAR,HandSymbol,CBOSS_PORTRAIT5)
        REM "Destroy the spawners to get at his heart!"
        DISPLAY_MESSAGE(1092,VAMPIRE)
        DISPLAY_OBJECTIVE(1092,64)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER2,TIMER6)
    ENDIF
    IF(PLAYER3,TIMER2 > 2000)
        IF(PLAYER3,FLAG1 <= 1)
            REM "Carve a path through! Destroy the spawner with a creature!"
            DISPLAY_MESSAGE(1093,VAMPIRE)
            DISPLAY_INFORMATION(1093,64)
        ENDIF
    ENDIF
    SET_TIMER(PLAYER2,TIMER5)
    ADD_CREATURE_TO_LEVEL(PLAYER6,CFLY,63,1,8,0)
    ADD_CREATURE_TO_LEVEL(PLAYER6,CGHOST,63,1,8,0)
    ADD_CREATURE_TO_LEVEL(PLAYER6,CDEMONSPAWN,64,2,8,0)
    ADD_CREATURE_TO_LEVEL(PLAYER6,CHELL_HOUND,65,2,8,0)
    IF(PLAYER2,TIMER5 > 750)
        IF_SLAB_TYPE(62,54,VOID)
            NEXT_COMMAND_REUSABLE
            ADD_CREATURE_TO_LEVEL(PLAYER6,CFLY,63,1,8,0)
            NEXT_COMMAND_REUSABLE
            ADD_CREATURE_TO_LEVEL(PLAYER6,CGHOST,63,1,8,0)
        ENDIF
        IF_SLAB_TYPE(65,56,VOID)
            NEXT_COMMAND_REUSABLE
            ADD_CREATURE_TO_LEVEL(PLAYER6,CDEMONSPAWN,64,2,8,0)
        ENDIF
        IF_SLAB_TYPE(70,56,VOID)
            NEXT_COMMAND_REUSABLE
            ADD_CREATURE_TO_LEVEL(PLAYER6,CHELL_HOUND,65,2,8,0)
        ENDIF
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER2,TIMER5)
    ENDIF
    IF_SLAB_TYPE(62,54,LAVA)
        ADD_TO_FLAG(PLAYER3,FLAG1,1)
    ENDIF
    IF_SLAB_TYPE(65,56,LAVA)
        ADD_TO_FLAG(PLAYER3,FLAG1,1)
    ENDIF
    IF_SLAB_TYPE(70,56,LAVA)
        ADD_TO_FLAG(PLAYER3,FLAG1,1)
    ENDIF
    IF(PLAYER3,FLAG1 >= 3)
        USE_POWER_AT_POS(PLAYER0,205,178,POWER_DESTROY_WALLS,3,1)
        REM "The spawners are destroyed! The wall is open!"
        DISPLAY_MESSAGE(1094,VAMPIRE)
        DISPLAY_OBJECTIVE(1094,66)
    ENDIF
ENDIF

IF_ACTION_POINT(66,PLAYER0)
    SET_MUSIC("silence.mp3")
    SET_TIMER(PLAYER2,TIMER7)
    SET_TIMER(PLAYER0,TIMER3)
    PLAY_MESSAGE(PLAYER2,SOUND,"kktaunt03.mp3")
    IF(PLAYER2,TIMER7 > 20)
        PLAY_MESSAGE(PLAYER0,SOUND,"this_is_halloween_loop_short.mp3")
        SET_TEXTURE(PLAYER6,WINTER)
    ENDIF
    IF(PLAYER2,TIMER7 > 30)
        PLAY_MESSAGE(PLAYER0,SOUND,"this_is_halloween_loop_short.mp3")
        SET_TEXTURE(PLAYER6,BIG_BREASTS)
    ENDIF
    IF(PLAYER2,TIMER7 > 34)
        PLAY_MESSAGE(PLAYER0,SOUND,"this_is_halloween_loop_short.mp3")
        SET_TEXTURE(PLAYER6,WINTER)
    ENDIF
    IF(PLAYER2,TIMER7 > 40)
        PLAY_MESSAGE(PLAYER0,SOUND,"this_is_halloween_loop_short.mp3")
        SET_TEXTURE(PLAYER6,BIG_BREASTS)
    ENDIF
    IF(PLAYER2,TIMER7 > 50)
        PLAY_MESSAGE(PLAYER0,SOUND,"this_is_halloween_loop_short.mp3")
        SET_TEXTURE(PLAYER6,WINTER)
        SET_TEXTURE(PLAYER3,WINTER)
        SET_MUSIC("this_is_halloween_loop_final.mp3")
        SET_TIMER(PLAYER3,TIMER0)
        ADD_CREATURE_TO_LEVEL(PLAYER6,STATUE,76,10,8,0)
    ENDIF
    IF(PLAYER6,DUNGEON_DESTROYED == 0)
        IF(PLAYER3,TIMER0 == 0)
            NEXT_COMMAND_REUSABLE
            SET_TEXTURE(PLAYER0,4)
            NEXT_COMMAND_REUSABLE
            SET_TEXTURE(PLAYER_NEUTRAL,4)
            NEXT_COMMAND_REUSABLE
            SET_TEXTURE(PLAYER_GOOD,4)
        ENDIF
        IF(PLAYER3,TIMER0 == 2)
            NEXT_COMMAND_REUSABLE
            SET_TEXTURE(PLAYER0,5)
            NEXT_COMMAND_REUSABLE
            SET_TEXTURE(PLAYER_NEUTRAL,5)
            NEXT_COMMAND_REUSABLE
            SET_TEXTURE(PLAYER_GOOD,5)
        ENDIF
        IF(PLAYER3,TIMER0 == 4)
            NEXT_COMMAND_REUSABLE
            SET_TEXTURE(PLAYER0,6)
            NEXT_COMMAND_REUSABLE
            SET_TEXTURE(PLAYER_NEUTRAL,6)
            NEXT_COMMAND_REUSABLE
            SET_TEXTURE(PLAYER_GOOD,6)
        ENDIF
        IF(PLAYER3,TIMER0 == 6)
            NEXT_COMMAND_REUSABLE
            SET_TEXTURE(PLAYER0,7)
            NEXT_COMMAND_REUSABLE
            SET_TEXTURE(PLAYER_NEUTRAL,7)
            NEXT_COMMAND_REUSABLE
            SET_TEXTURE(PLAYER_GOOD,7)
        ENDIF
        IF(PLAYER3,TIMER0 >= 8)
            NEXT_COMMAND_REUSABLE
            SET_TEXTURE(PLAYER0,4)
            NEXT_COMMAND_REUSABLE
            SET_TEXTURE(PLAYER_NEUTRAL,4)
            NEXT_COMMAND_REUSABLE
            SET_TEXTURE(PLAYER_GOOD,4)
            NEXT_COMMAND_REUSABLE
            SET_TIMER(PLAYER3,TIMER0)
        ENDIF
    ENDIF
    IF(PLAYER0,TIMER3 > 50)
        REM "So many spawners...let's even it out."
        DISPLAY_MESSAGE(1095,VAMPIRE)
        PLAY_MESSAGE(PLAYER0,SOUND,115)
        MAGIC_AVAILABLE(PLAYER0,POWER_CONCEAL,1,1)
        CHANGE_SLAB_TYPE(16,57,LAIR_AREA,MATCH)
        CHANGE_SLAB_TYPE(64,49,ENTRANCE_ZONE)
        CHANGE_SLAB_TYPE(65,49,ENTRANCE_ZONE)
        CHANGE_SLAB_TYPE(66,49,ENTRANCE_ZONE)
        CHANGE_SLAB_TYPE(67,49,ENTRANCE_ZONE)
        CHANGE_SLAB_TYPE(64,50,ENTRANCE_ZONE)
        CHANGE_SLAB_TYPE(65,50,ENTRANCE_ZONE)
        CHANGE_SLAB_TYPE(66,50,ENTRANCE_ZONE)
        CHANGE_SLAB_TYPE(67,50,ENTRANCE_ZONE)
        CHANGE_SLAB_TYPE(64,51,ENTRANCE_ZONE)
        CHANGE_SLAB_TYPE(65,51,ENTRANCE_ZONE)
        CHANGE_SLAB_TYPE(66,51,ENTRANCE_ZONE)
        CHANGE_SLAB_TYPE(67,51,ENTRANCE_ZONE)
        CHANGE_SLAB_OWNER(64,49,PLAYER0,MATCH)
        ADD_CREATURE_TO_POOL(DRAGON,5)
        ADD_CREATURE_TO_POOL(DEMONSPAWN,5)
        ADD_CREATURE_TO_POOL(DARK_MISTRESS,5)
        ADD_CREATURE_TO_POOL(SORCEROR,5)
        ADD_CREATURE_TO_POOL(BILE_DEMON,5)
        ADD_CREATURE_TO_POOL(SKELETON,5)
        ADD_CREATURE_TO_POOL(TROLL,5)
        ADD_CREATURE_TO_POOL(HELL_HOUND,5)
        ADD_CREATURE_TO_POOL(TENTACLE,5)
        ADD_CREATURE_TO_POOL(ORC,5)
        ADD_CREATURE_TO_POOL(DRUID,5)
        SET_CREATURE_CONFIGURATION(SORCEROR,BaseSpeed,48)
        SET_CREATURE_CONFIGURATION(VAMPIRE,BaseSpeed,48)
        SET_CREATURE_CONFIGURATION(SKELETON,BaseSpeed,48)
        SET_CREATURE_CONFIGURATION(TROLL,BaseSpeed,48)

        SET_CREATURE_CONFIGURATION(DRAGON,HungerRate,0)
        SET_CREATURE_CONFIGURATION(DEMONSPAWN,HungerRate,0)
        SET_CREATURE_CONFIGURATION(DARK_MISTRESS,HungerRate,0)
        SET_CREATURE_CONFIGURATION(SORCEROR,HungerRate,0)
        SET_CREATURE_CONFIGURATION(BILE_DEMON,HungerRate,0)
        SET_CREATURE_CONFIGURATION(SKELETON,HungerRate,0)
        SET_CREATURE_CONFIGURATION(TROLL,HungerRate,0)
        SET_CREATURE_CONFIGURATION(HELL_HOUND,HungerRate,0)
        SET_CREATURE_CONFIGURATION(TENTACLE,HungerRate,0)
        SET_CREATURE_CONFIGURATION(ORC,HungerRate,0)
        SET_CREATURE_CONFIGURATION(DRUID,HungerRate,0)

        SET_CREATURE_CONFIGURATION(DRAGON,LairSize,0)
        SET_CREATURE_CONFIGURATION(DEMONSPAWN,LairSize,0)
        SET_CREATURE_CONFIGURATION(DARK_MISTRESS,LairSize,0)
        SET_CREATURE_CONFIGURATION(SORCEROR,LairSize,0)
        SET_CREATURE_CONFIGURATION(BILE_DEMON,LairSize,0)
        SET_CREATURE_CONFIGURATION(SKELETON,LairSize,0)
        SET_CREATURE_CONFIGURATION(TROLL,LairSize,0)
        SET_CREATURE_CONFIGURATION(HELL_HOUND,LairSize,0)
        SET_CREATURE_CONFIGURATION(TENTACLE,LairSize,0)
        SET_CREATURE_CONFIGURATION(ORC,LairSize,0)
        SET_CREATURE_CONFIGURATION(DRUID,LairSize,0)

        SET_CREATURE_CONFIGURATION(SPIDER,LairSize,0)
        SET_CREATURE_CONFIGURATION(BUG,LairSize,0)
        SET_CREATURE_CONFIGURATION(FLY2,LairSize,0)

        SET_CREATURE_PROPERTY(SPIDER,NO_CORPSE_ROTTING,1)
        SET_CREATURE_PROPERTY(BUG,NO_CORPSE_ROTTING,1)
        SET_CREATURE_PROPERTY(FLY2,NO_CORPSE_ROTTING,1)
        SET_CREATURE_PROPERTY(DRAGON,NO_CORPSE_ROTTING,1)
        SET_CREATURE_PROPERTY(DEMONSPAWN,NO_CORPSE_ROTTING,1)
        SET_CREATURE_PROPERTY(DARK_MISTRESS,NO_CORPSE_ROTTING,1)
        SET_CREATURE_PROPERTY(SORCEROR,NO_CORPSE_ROTTING,1)
        SET_CREATURE_PROPERTY(BILE_DEMON,NO_CORPSE_ROTTING,1)
        SET_CREATURE_PROPERTY(SKELETON,NO_CORPSE_ROTTING,1)
        SET_CREATURE_PROPERTY(TROLL,NO_CORPSE_ROTTING,1)
        SET_CREATURE_PROPERTY(HELL_HOUND,NO_CORPSE_ROTTING,1)
        SET_CREATURE_PROPERTY(TENTACLE,NO_CORPSE_ROTTING,1)
        SET_CREATURE_PROPERTY(ORC,NO_CORPSE_ROTTING,1)
        SET_CREATURE_PROPERTY(DRUID,NO_CORPSE_ROTTING,1)

        CREATURE_AVAILABLE(PLAYER0,DRAGON,1,99)
        CREATURE_AVAILABLE(PLAYER0,DEMONSPAWN,1,99)
        CREATURE_AVAILABLE(PLAYER0,DARK_MISTRESS,1,99)
        CREATURE_AVAILABLE(PLAYER0,SORCEROR,1,99)
        CREATURE_AVAILABLE(PLAYER0,BILE_DEMON,1,99)
        CREATURE_AVAILABLE(PLAYER0,SKELETON,1,99)
        CREATURE_AVAILABLE(PLAYER0,TROLL,1,99)
        CREATURE_AVAILABLE(PLAYER0,HELL_HOUND,1,99)
        CREATURE_AVAILABLE(PLAYER0,TENTACLE,1,99)
        CREATURE_AVAILABLE(PLAYER0,ORC,1,99)
        CREATURE_AVAILABLE(PLAYER0,DRUID,1,99)

        SET_GENERATE_SPEED(10)
        MAX_CREATURES(PLAYER0,25)
        CREATURE_ENTRANCE_LEVEL(PLAYER0,8)
        CHANGE_SLAB_TYPE(57,54,LAVA)

        SET_TIMER(PLAYER2,TIMER5)
        ADD_CREATURE_TO_LEVEL(PLAYER6,CFLY,67,1,8,0)
        ADD_CREATURE_TO_LEVEL(PLAYER6,CGHOST,67,1,8,0)
        ADD_CREATURE_TO_LEVEL(PLAYER6,CDEMONSPAWN,68,2,8,0)
        ADD_CREATURE_TO_LEVEL(PLAYER6,CHELL_HOUND,69,2,8,0)
        IF(PLAYER6,TOTAL_CREATURES < 20)
            IF(PLAYER2,TIMER5 > 500)
                IF_SLAB_TYPE(63,61,VOID)
                    NEXT_COMMAND_REUSABLE
                    ADD_CREATURE_TO_LEVEL(PLAYER6,CFLY,67,2,8,0)
                ENDIF
                IF_SLAB_TYPE(67,62,VOID)
                    NEXT_COMMAND_REUSABLE
                    ADD_CREATURE_TO_LEVEL(PLAYER6,CDEMONSPAWN,68,2,8,0)
                ENDIF
                IF_SLAB_TYPE(71,63,VOID)
                    NEXT_COMMAND_REUSABLE
                    ADD_CREATURE_TO_LEVEL(PLAYER6,CHELL_HOUND,69,2,8,0)
                ENDIF
                IF_SLAB_TYPE(61,65,VOID)
                    NEXT_COMMAND_REUSABLE
                    ADD_CREATURE_TO_LEVEL(PLAYER6,CBILE_DEMON,70,2,8,0)
                ENDIF
                IF_SLAB_TYPE(73,67,VOID)
                    NEXT_COMMAND_REUSABLE
                    ADD_CREATURE_TO_LEVEL(PLAYER6,CDARK_MISTRESS,71,2,8,0)
                ENDIF
                IF_SLAB_TYPE(60,69,VOID)
                    NEXT_COMMAND_REUSABLE
                    ADD_CREATURE_TO_LEVEL(PLAYER6,CGHOST,72,2,8,0)
                ENDIF
                IF_SLAB_TYPE(72,71,VOID)
                    NEXT_COMMAND_REUSABLE
                    ADD_CREATURE_TO_LEVEL(PLAYER6,CVAMPIRE,73,2,8,0)
                ENDIF
                IF_SLAB_TYPE(64,74,VOID)
                    NEXT_COMMAND_REUSABLE
                    ADD_CREATURE_TO_LEVEL(PLAYER6,HORNY,74,2,8,0)
                ENDIF
                IF_SLAB_TYPE(68,75,VOID)
                    NEXT_COMMAND_REUSABLE
                    ADD_CREATURE_TO_LEVEL(PLAYER6,STATUE,75,2,8,0)
                ENDIF
                NEXT_COMMAND_REUSABLE
                SET_TIMER(PLAYER2,TIMER5)
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF_SLAB_TYPE(63,61,LAVA)
    IF_SLAB_TYPE(67,62,LAVA)
        IF_SLAB_TYPE(71,63,LAVA)
            IF_SLAB_TYPE(61,65,LAVA)
                IF_SLAB_TYPE(73,67,LAVA)
                    IF_SLAB_TYPE(60,69,LAVA)
                        IF_SLAB_TYPE(72,71,LAVA)
                            IF_SLAB_TYPE(64,74,LAVA)
                                IF_SLAB_TYPE(68,75,LAVA)
                                    SET_TIMER(PLAYER0,TIMER3)
                                    IF(PLAYER0,TIMER3>50)
                                        REM "The walls aren't opening..."
                                        DISPLAY_MESSAGE(1096,VAMPIRE)
                                        ADD_PARTY_TO_LEVEL(PLAYER6,FINAL_BOSS,76,1)
                                        ADD_CREATURE_TO_LEVEL(PLAYER6,STATUE,76,3,8,0)
                                        PLAY_MESSAGE(PLAYER0,SOUND,"kktaunt08.mp3")
                                    ENDIF
                                    IF(PLAYER0,TIMER3>100)
                                        REM "This creature must be the final hurdle..."
                                        DISPLAY_MESSAGE(1097,VAMPIRE)
                                        IF(PLAYER6,NECROVATAR == 0)
                                            USE_POWER_AT_POS(PLAYER0,193,208,POWER_DESTROY_WALLS,8,1)
                                            USE_POWER_AT_POS(PLAYER0,199,202,POWER_DESTROY_WALLS,8,1)
                                            USE_POWER_AT_POS(PLAYER0,205,208,POWER_DESTROY_WALLS,8,1)
                                            USE_POWER_AT_POS(PLAYER0,199,214,POWER_DESTROY_WALLS,8,1)
                                            REM "Go! Destroy it!"
                                            DISPLAY_MESSAGE(1098,VAMPIRE)
                                            REM "Go! Destroy it!"
                                            DISPLAY_OBJECTIVE(1099)
                                        ENDIF
                                    ENDIF
                                ENDIF
                            ENDIF
                        ENDIF
                    ENDIF
                ENDIF
            ENDIF
        ENDIF
    ENDIF
ENDIF


IF(PLAYER6,DUNGEON_DESTROYED == 1)
    KILL_CREATURE(PLAYER6,ANY_CREATURE,ANYWHERE,99)
    KILL_CREATURE(PLAYER0,ANY_CREATURE,ANYWHERE,99)
    SET_MUSIC("silence.mp3")
    SET_TIMER(PLAYER0,TIMER3)
    CHANGE_SLAB_TYPE(65,50,PATH,MATCH)
    MAX_CREATURES(PLAYER0,2)
    SET_GENERATE_SPEED(400)
    CREATURE_AVAILABLE(PLAYER0,DRAGON,0,0)
    CREATURE_AVAILABLE(PLAYER0,DEMONSPAWN,0,0)
    CREATURE_AVAILABLE(PLAYER0,DARK_MISTRESS,0,0)
    CREATURE_AVAILABLE(PLAYER0,SORCEROR,0,0)
    CREATURE_AVAILABLE(PLAYER0,BILE_DEMON,0,0)
    CREATURE_AVAILABLE(PLAYER0,SKELETON,0,0)
    CREATURE_AVAILABLE(PLAYER0,TROLL,0,0)
    CREATURE_AVAILABLE(PLAYER0,HELL_HOUND,0,0)
    CREATURE_AVAILABLE(PLAYER0,TENTACLE,0,0)
    CREATURE_AVAILABLE(PLAYER0,ORC,0,0)
    CREATURE_AVAILABLE(PLAYER0,DRUID,0,0)
    MAGIC_AVAILABLE(PLAYER0,POWER_HAND,1,1)
    IF(PLAYER0,TIMER3>50)
        REM "It is done...but you're still stuck here..."
        DISPLAY_MESSAGE(1100,VAMPIRE)
    ENDIF
    IF(PLAYER0,TIMER3>100)
        REM "Of course, you have to complete the objective."
        DISPLAY_MESSAGE(1101,VAMPIRE)
    ENDIF
    IF(PLAYER0,TIMER3>150)
        REM "Claim your imp and destroy the heroes to the north."
        DISPLAY_MESSAGE(1102,VAMPIRE)
        REM "Claim your imp and destroy the heroes to the north."
        DISPLAY_OBJECTIVE(1103)
    ENDIF
    IF(PLAYER0,TIMER3>200)
        REM "Good luck, and good bye."
        DISPLAY_MESSAGE(1104,VAMPIRE)
        CONCEAL_MAP_RECT(PLAYER0,120,120,240,240)
        REVEAL_MAP_RECT(PLAYER0,61,199,39,21)
        REVEAL_MAP_RECT(PLAYER0,70,199,9,39)
        REVEAL_MAP_RECT(PLAYER0,52,199,15,27)
        REVEAL_MAP_RECT(PLAYER0,52,199,27,15)
        REVEAL_MAP_RECT(PLAYER0,70,199,15,33)
        REVEAL_MAP_RECT(PLAYER0,70,199,21,27)
        REVEAL_MAP_RECT(PLAYER0,70,199,27,21)
        REVEAL_MAP_RECT(PLAYER0,70,199,33,15)
        REVEAL_MAP_RECT(PLAYER0,70,199,39,9)
        REVEAL_MAP_RECT(PLAYER0,52,172,27,33)
        REVEAL_MAP_RECT(PLAYER0,40,160,3,3)
        REVEAL_MAP_RECT(PLAYER0,64,160,3,3)
        REVEAL_MAP_RECT(PLAYER0,40,199,9,9)
        REVEAL_MAP_RECT(PLAYER0,52,211,9,9)
        CONCEAL_MAP_RECT(PLAYER0,43,160,3,3)
        CONCEAL_MAP_RECT(PLAYER0,62,160,3,3)
        REVEAL_MAP_RECT(PLAYER0,37,172,3,15)
        REVEAL_MAP_RECT(PLAYER0,67,172,3,15)
        REVEAL_MAP_RECT(PLAYER0,70,172,3,9)
        CONCEAL_MAP_RECT(PLAYER0,52,157,27,3)
        REVEAL_MAP_RECT(PLAYER0,52,163,27,9)
        MAGIC_AVAILABLE(PLAYER0,POWER_CALL_TO_ARMS,1,0)
        CHANGE_SLAB_TYPE(65,50,PATH,MATCH)
        CHANGE_SLAB_TYPE(29,66,DRAPE_WALL)
        CHANGE_SLAB_OWNER(29,66,PLAYER0)
        CHANGE_SLAB_TYPE(23,57,DRAPE_WALL)
        CHANGE_SLAB_TYPE(16,56,ENTRANCE_ZONE)
        CHANGE_SLAB_TYPE(16,57,ENTRANCE_ZONE)
        CHANGE_SLAB_TYPE(16,58,ENTRANCE_ZONE)
        CHANGE_SLAB_TYPE(17,56,ENTRANCE_ZONE)
        CHANGE_SLAB_TYPE(17,57,ENTRANCE_ZONE)
        CHANGE_SLAB_TYPE(17,58,ENTRANCE_ZONE)
        CHANGE_SLAB_TYPE(18,56,ENTRANCE_ZONE)
        CHANGE_SLAB_TYPE(18,57,ENTRANCE_ZONE)
        CHANGE_SLAB_TYPE(18,58,ENTRANCE_ZONE)
        CHANGE_SLAB_OWNER(17,57,PLAYER0,MATCH)
        SET_MUSIC("this_is_halloween_loop.mp3")
        CHANGE_SLAB_TYPE(17,53,PRETTY_PATH)
        CHANGE_SLAB_TYPE(16,52,PRETTY_PATH)
        CHANGE_SLAB_TYPE(17,52,PRETTY_PATH)
        CHANGE_SLAB_TYPE(18,52,PRETTY_PATH)
        CHANGE_SLAB_TYPE(16,51,PRETTY_PATH)
        CHANGE_SLAB_TYPE(17,51,PRETTY_PATH)
        CHANGE_SLAB_TYPE(18,51,PRETTY_PATH)
        CHANGE_SLAB_TYPE(16,50,PRETTY_PATH)
        CHANGE_SLAB_TYPE(17,50,PRETTY_PATH)
        CHANGE_SLAB_TYPE(18,50,PRETTY_PATH)
        CHANGE_SLAB_TYPE(15,50,DRAPE_WALL)
        CHANGE_SLAB_TYPE(15,51,DRAPE_WALL)
        CHANGE_SLAB_TYPE(15,52,DRAPE_WALL)
        CHANGE_SLAB_TYPE(17,49,DRAPE_WALL)
        CHANGE_SLAB_TYPE(18,49,DRAPE_WALL)
        CHANGE_SLAB_TYPE(19,49,DRAPE_WALL)
        CHANGE_SLAB_TYPE(19,50,DRAPE_WALL)
        CHANGE_SLAB_TYPE(19,51,DRAPE_WALL)
        CHANGE_SLAB_TYPE(29,65,DRAPE_WALL)
        CHANGE_SLAB_TYPE(29,67,DRAPE_WALL)
        CHANGE_SLAB_OWNER(29,65,PLAYER0)
        CHANGE_SLAB_OWNER(29,67,PLAYER0)
        SET_CREATURE_CONFIGURATION(SPIDER,LairSize,1)
        SET_CREATURE_CONFIGURATION(BUG,LairSize,1)
        SET_CREATURE_CONFIGURATION(FLY2,LairSize,1)
        SET_CREATURE_CONFIGURATION(IMP,HandSymbol,222)
        CHANGE_SLAB_TYPE(30,66,DIRT)
        CHANGE_SLAB_TYPE(35,63,DIRT)
        CHANGE_SLAB_TYPE(31,66,DIRT,MATCH)
        CHANGE_SLAB_TYPE(41,65,DIRT,MATCH)
        CHANGE_SLAB_TYPE(43,57,HARD)
        CHANGE_SLAB_TYPE(44,57,HARD)
        CHANGE_SLAB_TYPE(43,58,HARD)
        CHANGE_SLAB_TYPE(44,58,HARD)
        CHANGE_SLAB_TYPE(44,59,HARD)
        CHANGE_SLAB_TYPE(45,59,HARD)
        CHANGE_SLAB_TYPE(45,60,HARD)
        CHANGE_SLAB_TYPE(46,60,HARD)
        CHANGE_SLAB_TYPE(46,61,HARD)
        CHANGE_SLAB_TYPE(46,62,HARD)
        CHANGE_SLAB_TYPE(46,63,HARD)
        CHANGE_SLAB_TYPE(45,58,HARD)
        CHANGE_SLAB_TYPE(46,59,HARD)
        CHANGE_SLAB_TYPE(47,60,HARD)
        CHANGE_SLAB_TYPE(47,61,HARD)
        CHANGE_SLAB_TYPE(47,62,HARD)
        CHANGE_SLAB_TYPE(47,63,HARD)
        CHANGE_SLAB_TYPE(47,64,HARD)
        CHANGE_SLAB_TYPE(36,61,DRAPE_WALL)
        CHANGE_SLAB_TYPE(37,61,DRAPE_WALL)
        CHANGE_SLAB_TYPE(37,60,DRAPE_WALL)
        CHANGE_SLAB_TYPE(66,72,PATH,MATCH)
        CHANGE_SLAB_TYPE(64,71,PATH,MATCH)
        CHANGE_SLAB_TYPE(64,67,PATH,MATCH)
        CHANGE_SLAB_TYPE(66,66,PATH,MATCH)
        CHANGE_SLAB_TYPE(68,71,PATH,MATCH)
        CHANGE_SLAB_TYPE(74,68,PATH,MATCH)
        ZOOM_TO_LOCATION(PLAYER0,PLAYER0)
        RESET_ACTION_POINT(25,PLAYER0)
        SET_TEXTURE(PLAYER6,NONE)
        REM IF_ACTION_POINT(81,PLAYER0)
        REM     PLAY_MESSAGE(PLAYER0,SOUND,"trickortreat.mp3")
        REM ENDIF
        IF_ACTION_POINT(25,PLAYER0)
            ADD_CREATURE_TO_LEVEL(PLAYER0,IMP,25,3,3,0)
            ADD_PARTY_TO_LEVEL(PLAYER_GOOD,PUNY_LANDLORD,25,1)
            IF(PLAYER_GOOD,GOOD_CREATURES == 0)
                WIN_GAME
                QUICK_MESSAGE(1,"X/4",ALL_PLAYERS)
                DISPLAY_MESSAGE(744,ALL_PLAYERS)
                DISPLAY_VARIABLE(PLAYER3,FLAG0)
            ENDIF
        ENDIF
    ENDIF
ENDIF