REM ********************************************
REM
REM Script for Level 212
REM
REM ********************************************
REM Action Point 1 - Central door, halfway point
REM Action Point 2 - Enemy Dungeon Heart
REM Action Point 3 - Front door dungeon
REM Action Point 4,5 - Dragon room west,east
REM Action Point 6,7,8 - Spider Lairs west
REM Action Point 9,10,11 - Spider Lairs east
REM Action Point 12,13 - Demon spawn Training rooms
REM Action Point 14,15 - Warlock Libraries
REM Action Point 16,17 - Troll Workshops
REM Action Point 18,19 - Mistress Torture room
REM Action Point 20,21 - Skeleton Prison
REM Action Point 22,23 - Orc Barracks
REM Action Point 24,25 - Ghost Temple
REM Action Point 26,27 - Skeleton Prison

LEVEL_VERSION(1)
SET_GENERATE_SPEED(400)

SET_PLAYER_COLOR(PLAYER0,WHITE)
SET_PLAYER_COLOR(PLAYER_GOOD,RED)

MAX_CREATURES(PLAYER0,24)

START_MONEY(ALL_PLAYERS,15000)

CREATE_PARTY(VAMPIRE)
    ADD_TO_PARTY(VAMPIRE,VAMPIRE,7,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(VAMPIRE,VAMPIRE,8,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(VAMPIRE,VAMPIRE,9,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(VAMPIRE,VAMPIRE,10,0,ATTACK_ENEMIES,0)

CREATE_PARTY(FALL)
    ADD_TO_PARTY(FALL,DRAGON,7,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(FALL,BILE_DEMON,6,0,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(FALL,DARK_MISTRESS,7,0,ATTACK_ENEMIES,0)


ADD_CREATURE_TO_POOL(TUNNELLER,20)
ADD_CREATURE_TO_POOL(WIZARD,20)
ADD_CREATURE_TO_POOL(BARBARIAN,20)
ADD_CREATURE_TO_POOL(ARCHER,20)
ADD_CREATURE_TO_POOL(MONK,20)
ADD_CREATURE_TO_POOL(DWARFA,20)
ADD_CREATURE_TO_POOL(KNIGHT,20)
ADD_CREATURE_TO_POOL(WITCH,20)
ADD_CREATURE_TO_POOL(GIANT,20)
ADD_CREATURE_TO_POOL(FAIRY,20)
ADD_CREATURE_TO_POOL(THIEF,20)
ADD_CREATURE_TO_POOL(SAMURAI,20)
ADD_CREATURE_TO_POOL(TIME_MAGE,20)

CREATURE_AVAILABLE(PLAYER0,THIEF,1,0)
CREATURE_AVAILABLE(PLAYER0,DWARFA,1,0)
CREATURE_AVAILABLE(PLAYER0,TUNNELLER,1,0)
CREATURE_AVAILABLE(PLAYER0,ARCHER,1,0)
CREATURE_AVAILABLE(PLAYER0,BARBARIAN,1,0)
CREATURE_AVAILABLE(PLAYER0,FAIRY,1,0)
CREATURE_AVAILABLE(PLAYER0,GIANT,1,0)
CREATURE_AVAILABLE(PLAYER0,KNIGHT,1,0)
CREATURE_AVAILABLE(PLAYER0,WIZARD,1,0)
CREATURE_AVAILABLE(PLAYER0,MONK,1,0)
CREATURE_AVAILABLE(PLAYER0,SAMURAI,1,0)
CREATURE_AVAILABLE(PLAYER0,WITCH,1,0)
CREATURE_AVAILABLE(PLAYER0,TIME_MAGE,1,0)

ROOM_AVAILABLE(ALL_PLAYERS,GUARD_POST,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TREASURE,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,RESEARCH,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,WORKSHOP,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,GARDEN,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,LAIR,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,GRAVEYARD,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,PRISON,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TORTURE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TRAINING,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,BARRACKS,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TEMPLE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,BRIDGE,1,0)

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_OBEY,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SIGHT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CAVE_IN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HOLD_AUDIENCE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CHICKEN,0,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SPEED,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_LIGHTNING,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DISEASE,0,0)

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

IF(PLAYER0,GAME_TURN > 20)
    REM "You have come into the dungeon of a previous hero who attempted to destroy the evil fortess. He failed, but you shall succeed! YOu have all the time, and resources in the world to build up an army and crush the evil forever!"
    DISPLAY_OBJECTIVE(80,ALL_PLAYERS)
ENDIF

REM Halfway point. Spawn party to attack and fill in second part of dungeon with creatures.
IF_ACTION_POINT(1,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FALL,1,2)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DEMONSPAWN,12,4,10,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DEMONSPAWN,13,4,10,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SORCEROR,14,5,10,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SORCEROR,15,5,10,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,TROLL,16,4,10,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,TROLL,17,4,10,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DARK_MISTRESS,18,4,10,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DARK_MISTRESS,19,4,10,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SKELETON,20,10,10,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SKELETON,21,10,10,0)
ENDIF

IF_ACTION_POINT(2,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,VAMPIRE,2,4)
    DISPLAY_OBJECTIVE(81,PLAYER_GOOD)
    REM QUICK_INFORMATION(2,"You have reached the heart of the vampires! Drive a steak through every heart in this room!")
ENDIF

REM When player reaches the entrance of the dungeon will the dragons spawn.
IF_ACTION_POINT(3,PLAYER0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DRAGON,4,6,10,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DRAGON,5,6,10,0)
ENDIF

REM When player reaches area around the west spider lair, spawn the spiders.
IF_ACTION_POINT(6,PLAYER0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SPIDER,7,4,10,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SPIDER,8,4,10,0)
ENDIF

REM When player reaches area around the east spider lair, spawn the spiders.
IF_ACTION_POINT(9,PLAYER0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SPIDER,10,4,10,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,SPIDER,11,4,10,0)
ENDIF

REM When the player reaches either torture chamber, spawn the creatures for the final stretch.
IF_ACTION_POINT(18,PLAYER0)
    SET_FLAG(PLAYER0,FLAG1,1)
ENDIF
IF_ACTION_POINT(19,PLAYER0)
    SET_FLAG(PLAYER0,FLAG1,1)
ENDIF
IF(PLAYER0,FLAG1 == 1)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,ORC,22,4,10,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,ORC,22,2,8,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,ORC,23,4,10,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,ORC,23,2,8,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,GHOST,24,14,10,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,GHOST,25,14,10,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,HELL_HOUND,26,10,10,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,HELL_HOUND,27,10,10,0)
ENDIF

IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
    IF(PLAYER0,ALL_DUNGEONS_DESTROYED == 1)
        WIN_GAME
    ENDIF
ENDIF
