REM Play Level Allarvale

REM ******* Basic settings *******

SET_GENERATE_SPEED(300)

MAX_CREATURES(PLAYER0,12)

START_MONEY(PLAYER0,5000)

ADD_CREATURE_TO_POOL(FLY,8)
ADD_CREATURE_TO_POOL(BUG,12)
ADD_CREATURE_TO_POOL(SPIDER,1)
ADD_CREATURE_TO_POOL(DEMONSPAWN,1)
ADD_CREATURE_TO_POOL(SORCEROR,5)
ADD_CREATURE_TO_POOL(HELL_HOUND,2)

REM ********** Available creatures **********

CREATURE_AVAILABLE(ALL_PLAYERS,FLY,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,BUG,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DEMONSPAWN,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,HELL_HOUND,1,1)

REM ********** Available rooms **********

ROOM_AVAILABLE(ALL_PLAYERS,TREASURE,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,LAIR,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,GARDEN,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,TRAINING,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,RESEARCH,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,GUARD_POST,1,0)

REM ********** Available spells **********

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SPEED,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_OBEY,1,0)


REM ********** Game settings **********

IF(PLAYER0,DUNGEON_DESTROYED == 1)
    LOSE_GAME
ENDIF

SET_CREATURE_MAX_LEVEL(PLAYER0,BUG,5)
SET_CREATURE_MAX_LEVEL(PLAYER0,SORCEROR,5)
SET_CREATURE_MAX_LEVEL(PLAYER0,SPIDER,5)
SET_CREATURE_MAX_LEVEL(PLAYER0,HELL_HOUND,5)
SET_CREATURE_MAX_LEVEL(PLAYER0,FLY,5)
SET_CREATURE_MAX_LEVEL(PLAYER0,DEMONSPAWN,5)

REM ********** Parties **********

CREATE_PARTY(ONE)
    ADD_TO_PARTY(ONE,DWARFA,1,100,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(ONE,DWARFA,1,100,ATTACK_ENEMIES,0)

REM ********** Triggers & End game **********

IF(PLAYER0,TOTAL_CREATURES >= 12)
    SET_TIMER(PLAYER_GOOD,TIMER0)
    SET_TIMER(PLAYER_GOOD,TIMER1)
ENDIF

IF(PLAYER_GOOD,TIMER0 >= 5000)
    ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,ONE,1,ACTION_POINT,2,1,100)
ENDIF

IF(PLAYER_GOOD,ARCHER == 0)
    ADD_TUNNELLER_TO_LEVEL(PLAYER_GOOD,3,ACTION_POINT,1,1,100)
ENDIF

IF(PLAYER_GOOD,WIZARD == 0)
    ADD_TUNNELLER_TO_LEVEL(PLAYER_GOOD,4,ACTION_POINT,1,1,100)
ENDIF

SET_FLAG(PLAYER0,FLAG0,0)

IF_ACTION_POINT(6,PLAYER0)
    SET_FLAG(PLAYER0,FLAG0,1)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,AVATAR,-1,1,2,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,WIZARD,-1,2,3,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,THIEF,-1,4,3,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,BARBARIAN,-1,1,2,0)
    ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,DWARFA,-1,1,2,0)
    IF(PLAYER_GOOD,AVATAR == 0)
        WIN_GAME
    ENDIF
ENDIF

IF(PLAYER_GOOD,TIMER1 >= 3000)
    IF(PLAYER0,FLAG0 == 0)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,GIANT,5,2,1,0)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER_GOOD,TIMER1)
    ENDIF
ENDIF
