REM -------------------------------------------------------------------------------------------------------------------------------------------
REM Undead Keeper
REM Nazirite
REM Made by Duke Ragereaver
REM -------------------------------------------------------------------------------------------------------------------------------------------

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

SET_CREATURE_HEALTH(WIZARD,3150)
SET_CREATURE_STRENGTH(WIZARD,175)
SET_CREATURE_ARMOUR(WIZARD,140)

START_MONEY(PLAYER0,100000)
START_MONEY(PLAYER1,3000000)

COMPUTER_PLAYER(PLAYER1,0)

SET_COMPUTER_CHECKS(PLAYER1,"CHECK FOR NEUTRAL PLACES",15000,0,0,0,195000)

REM CHECKEVERY	ATTACKPERCENT	CTADURATION		MINFORATTACK	LASTCHECK

SET_COMPUTER_CHECKS(PLAYER1,"CHECK FOR QUICK ATTACK",14250,45,4000,5,10000)
SET_COMPUTER_PROCESS(PLAYER1,"ATTACK SAFE ATTACK",-1,100,335,100,0)
SET_COMPUTER_PROCESS(PLAYER1,"ATTACK PLAN 1",-1,100,335,100,0)

SET_CREATURE_MAX_LEVEL(PLAYER0,SKELETON,2)
SET_CREATURE_MAX_LEVEL(PLAYER0,SPIDER,2)
SET_CREATURE_MAX_LEVEL(PLAYER0,VAMPIRE,2)
SET_CREATURE_MAX_LEVEL(PLAYER0,GHOST,2)

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

MAX_CREATURES(PLAYER0,30)
MAX_CREATURES(PLAYER1,25)

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

SET_GENERATE_SPEED(525)
ADD_CREATURE_TO_POOL(TROLL,15)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,25)
ADD_CREATURE_TO_POOL(SKELETON,25)
ADD_CREATURE_TO_POOL(BILE_DEMON,25)
ADD_CREATURE_TO_POOL(DRAGON,25)
ADD_CREATURE_TO_POOL(VAMPIRE,1)
ADD_CREATURE_TO_POOL(GHOST,15)
ADD_CREATURE_TO_POOL(SORCEROR,15)
ADD_CREATURE_TO_POOL(HORNY,3)
ADD_CREATURE_TO_POOL(TENTACLE,10)
ADD_CREATURE_TO_POOL(ORC,15)
ADD_CREATURE_TO_POOL(SPIDER,10)
ADD_CREATURE_TO_POOL(HELL_HOUND,10)

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

CREATURE_AVAILABLE(ALL_PLAYERS,VAMPIRE,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,1)

CREATURE_AVAILABLE(PLAYER0,SKELETON,1,1)
CREATURE_AVAILABLE(PLAYER0,GHOST,1,1)

CREATURE_AVAILABLE(PLAYER1,TROLL,1,1)
CREATURE_AVAILABLE(PLAYER1,BILE_DEMON,1,1)
CREATURE_AVAILABLE(PLAYER1,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(PLAYER1,DRAGON,1,1)
CREATURE_AVAILABLE(PLAYER1,SORCEROR,1,1)
CREATURE_AVAILABLE(PLAYER1,HORNY,1,1)
CREATURE_AVAILABLE(PLAYER1,TENTACLE,1,1)
CREATURE_AVAILABLE(PLAYER1,HELL_HOUND,1,1)
CREATURE_AVAILABLE(PLAYER1,ORC,1,1)

IF(PLAYER0,TIMER0 >= 700)
    IF(PLAYER0,TOTAL_CREATURES < 30)
        IF(PLAYER0,FLAG0 == 0)
            NEXT_COMMAND_REUSABLE
            ADD_CREATURE_TO_LEVEL(PLAYER0,SKELETON,1,1,1,0)
            NEXT_COMMAND_REUSABLE
            SET_TIMER(PLAYER0,TIMER0)
        ENDIF
    ENDIF
ENDIF

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

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

SET_COMPUTER_PROCESS(PLAYER1,"BUILD A GRAVEYARD ROOM",0,5,6,11,0)

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

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HAND,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SLAP,1,1)
MAGIC_AVAILABLE(PLAYER1,POWER_SIGHT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_HEAL_CREATURE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SPEED,1,0)
MAGIC_AVAILABLE(PLAYER1,POWER_LIGHTNING,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_PROTECT,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(PLAYER1,POWER_DISEASE,1,0)
MAGIC_AVAILABLE(PLAYER1,POWER_CHICKEN,1,0)
MAGIC_AVAILABLE(PLAYER1,POWER_DESTROY_WALLS,1,0)

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

TRAP_AVAILABLE(PLAYER0,ALARM,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,POISON_GAS,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)

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

CREATE_PARTY(EASY_FIRST)
    ADD_TO_PARTY(EASY_FIRST,DWARFA,RANDOM(1,2),250,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(EASY_FIRST,ARCHER,2,250,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(EASY_FIRST,THIEF,RANDOM(1,2),250,DEFEND_PARTY,0)

CREATE_PARTY(EASY_SECOND)
    ADD_TO_PARTY(EASY_SECOND,DWARFA,2,300,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(EASY_SECOND,DWARFA,RANDOM(1,2),300,ATTACK_ENEMIES,0)

CREATE_PARTY(EASY_THIRD)
    ADD_TO_PARTY(EASY_THIRD,ARCHER,RANDOM(1,2),250,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(EASY_THIRD,THIEF,2,250,DEFEND_PARTY,0)
    ADD_TO_PARTY(EASY_THIRD,ARCHER,RANDOM(1,2),250,DEFEND_PARTY,0)

CREATE_PARTY(EASY_FOURTH)
    ADD_TO_PARTY(EASY_FOURTH,ARCHER,2,300,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(EASY_FOURTH,THIEF,RANDOM(1,2),300,ATTACK_ENEMIES,0)

CREATE_PARTY(MEDIUM_FIRST)
    ADD_TO_PARTY(MEDIUM_FIRST,ARCHER,3,300,DEFEND_PARTY,0)
    ADD_TO_PARTY(MEDIUM_FIRST,BARBARIAN,RANDOM(3,4),300,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(MEDIUM_FIRST,ARCHER,RANDOM(3,4),300,ATTACK_ENEMIES,0)

CREATE_PARTY(MEDIUM_SECOND)
    ADD_TO_PARTY(MEDIUM_SECOND,ARCHER,RANDOM(3,4),300,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(MEDIUM_SECOND,MONK,RANDOM(3,4),300,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(MEDIUM_SECOND,MONK,3,300,DEFEND_PARTY,0)

CREATE_PARTY(MEDIUM_THIRD)
    ADD_TO_PARTY(MEDIUM_THIRD,GIANT,3,300,ATTACK_ROOMS,0)
    ADD_TO_PARTY(MEDIUM_THIRD,GIANT,RANDOM(3,4),300,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(MEDIUM_THIRD,WITCH,RANDOM(3,4),300,DEFEND_PARTY,0)

CREATE_PARTY(HARD_FIRST)
    ADD_TO_PARTY(HARD_FIRST,SAMURAI,RANDOM(4,5),400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(HARD_FIRST,MONK,6,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(HARD_FIRST,MONK,5,400,STEAL_SPELLS,0)
    ADD_TO_PARTY(HARD_FIRST,ARCHER,RANDOM(4,6),400,DEFEND_PARTY,0)

CREATE_PARTY(HARD_SECOND)
    ADD_TO_PARTY(HARD_SECOND,BARBARIAN,RANDOM(4,5),400,ATTACK_ROOMS,0)
    ADD_TO_PARTY(HARD_SECOND,GIANT,6,400,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(HARD_SECOND,ARCHER,5,400,DEFEND_PARTY,0)
    ADD_TO_PARTY(HARD_SECOND,ARCHER,RANDOM(4,6),400,DEFEND_PARTY,0)

CREATE_PARTY(VERY_HARD)
    ADD_TO_PARTY(VERY_HARD,SAMURAI,RANDOM(6,8),500,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(VERY_HARD,MONK,RANDOM(6,8),500,STEAL_SPELLS,0)
    ADD_TO_PARTY(VERY_HARD,BARBARIAN,RANDOM(6,8),500,DEFEND_PARTY,0)
    ADD_TO_PARTY(VERY_HARD,GIANT,RANDOM(6,7),500,ATTACK_ROOMS,0)
    ADD_TO_PARTY(VERY_HARD,DWARFA,7,500,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(VERY_HARD,ARCHER,7,500,DEFEND_PARTY,0)
    ADD_TO_PARTY(VERY_HARD,THIEF,7,500,STEAL_GOLD,0)

CREATE_PARTY(BRUTES)
    ADD_TO_PARTY(BRUTES,BARBARIAN,8,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(BRUTES,GIANT,8,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(BRUTES,GIANT,8,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(BRUTES,BARBARIAN,8,400,ATTACK_ENEMIES,0)

CREATE_PARTY(SCOUTS)
    ADD_TO_PARTY(SCOUTS,DWARFA,8,500,STEAL_GOLD,0)
    ADD_TO_PARTY(SCOUTS,THIEF,8,600,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SCOUTS,THIEF,8,500,DEFEND_PARTY,0)
    ADD_TO_PARTY(SCOUTS,THIEF,8,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(SCOUTS,ARCHER,9,300,DEFEND_PARTY,0)
    ADD_TO_PARTY(SCOUTS,ARCHER,8,200,DEFEND_PARTY,0)
    ADD_TO_PARTY(SCOUTS,ARCHER,8,200,DEFEND_PARTY,0)

CREATE_PARTY(MYSTIC)
    ADD_TO_PARTY(MYSTIC,FAIRY,10,500,DEFEND_PARTY,0)
    ADD_TO_PARTY(MYSTIC,MONK,8,750,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(MYSTIC,MONK,9,1000,DEFEND_PARTY,0)
    ADD_TO_PARTY(MYSTIC,WITCH,8,500,STEAL_SPELLS,0)
    ADD_TO_PARTY(MYSTIC,SAMURAI,8,500,DEFEND_PARTY,0)

CREATE_PARTY(BOSS)
    ADD_TO_PARTY(BOSS,SAMURAI,9,1000,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(BOSS,WIZARD,10,10000,ATTACK_DUNGEON_HEART,0)
    ADD_TO_PARTY(BOSS,SAMURAI,9,1000,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(BOSS,GIANT,10,1000,DEFEND_PARTY,0)
    ADD_TO_PARTY(BOSS,KNIGHT,10,1500,STEAL_SPELLS,0)
    ADD_TO_PARTY(BOSS,MONK,10,1000,DEFEND_PARTY,0)

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

QUICK_OBJECTIVE(0,"The Heroes are preparing for their last stand, which is, naturally, only delaying the inevitable. The Wizard Lucian himself will be present, so prepare for a long and tough fight. They are coming!",PLAYER0)
SET_TIMER(PLAYER0,TIMER0)
SET_TIMER(PLAYER_GOOD,TIMER0)

IF(PLAYER_GOOD,TIMER0 >= 6100)
    ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,EASY_FIRST,2,DUNGEON_HEART,0,1,500)
    SET_TIMER(PLAYER_GOOD,TIMER1)
    SET_TIMER(PLAYER_GOOD,TIMER2)
    SET_TIMER(PLAYER_GOOD,TIMER3)
    SET_TIMER(PLAYER_GOOD,TIMER4)
QUICK_OBJECTIVE(1,"Lucian has spoken out a spell that disables your Creatures from gaining experience from fighting. The essence of this magic is bound by 5 Generals that lead the armies against you. Find them and kill them before you are overrun.",PLAYER0)
ENDIF

IF(PLAYER_GOOD,KNIGHT == 3)
    SET_CREATURE_MAX_LEVEL(PLAYER0,SKELETON,4)
    SET_CREATURE_MAX_LEVEL(PLAYER0,SPIDER,4)
    SET_CREATURE_MAX_LEVEL(PLAYER0,VAMPIRE,4)
    SET_CREATURE_MAX_LEVEL(PLAYER0,GHOST,4)
    SET_FLAG(PLAYER_GOOD,FLAG0,1)
    SET_TIMER(PLAYER_GOOD,TIMER0)
    SET_TIMER(PLAYER_GOOD,TIMER5)
    SET_TIMER(PLAYER_GOOD,TIMER6)
    SET_TIMER(PLAYER_GOOD,TIMER7)
    QUICK_OBJECTIVE(2,"That is one less, well done. Be warned, I can sense something powerful stir up the Heroes in the west...",PLAYER0)
ENDIF

IF(PLAYER_GOOD,KNIGHT == 2)
    SET_CREATURE_MAX_LEVEL(PLAYER0,SKELETON,6)
    SET_CREATURE_MAX_LEVEL(PLAYER0,SPIDER,6)
    SET_CREATURE_MAX_LEVEL(PLAYER0,VAMPIRE,6)
    SET_CREATURE_MAX_LEVEL(PLAYER0,GHOST,6)
    MAX_CREATURES(PLAYER1,30)
    SET_FLAG(PLAYER_GOOD,FLAG0,2)
    SET_TIMER(PLAYER_GOOD,TIMER0)
    SET_TIMER(PLAYER2,TIMER0)
    SET_TIMER(PLAYER2,TIMER1)
QUICK_OBJECTIVE(3,"I have discovered that an all-powerful Keeper by the name of Leto is present in this realm. I thought he was only a legend; the reputation of his ruthlessness, malice and cruelity alone is staggering. But it's his passion for warfare that makes him one of the most feared opponents you will ever find. Deliberate and cunning, he will use every dirty trick and dishonest tactic at his disposal to win the day.",PLAYER0)
ENDIF

IF(PLAYER_GOOD,KNIGHT == 1)
    SET_CREATURE_MAX_LEVEL(PLAYER0,SKELETON,8)
    SET_CREATURE_MAX_LEVEL(PLAYER0,SPIDER,8)
    SET_CREATURE_MAX_LEVEL(PLAYER0,VAMPIRE,8)
    SET_CREATURE_MAX_LEVEL(PLAYER0,GHOST,8)
    MAX_CREATURES(PLAYER1,35)
    SET_FLAG(PLAYER_GOOD,FLAG0,3)
    SET_TIMER(PLAYER_GOOD,TIMER0)
    SET_TIMER(PLAYER2,TIMER2)
ENDIF

IF(PLAYER_GOOD,KNIGHT == 0)
    SET_CREATURE_MAX_LEVEL(PLAYER0,SKELETON,9)
    SET_CREATURE_MAX_LEVEL(PLAYER0,SPIDER,9)
    SET_CREATURE_MAX_LEVEL(PLAYER0,VAMPIRE,9)
    SET_CREATURE_MAX_LEVEL(PLAYER0,GHOST,9)
    MAX_CREATURES(PLAYER1,40)
    SET_FLAG(PLAYER_GOOD,FLAG0,4)
QUICK_OBJECTIVE(5,"You have slain the 4th General and cut off their attack routes in the process, but the last and greatest of the Generals has been captured alive by Leto. You have to retrieve him somehow of Leto's clutches... Noone said this would be easy, wouldn't it?",PLAYER0)
ENDIF

IF(PLAYER_GOOD,AVATAR == 0)
    IF(PLAYER_GOOD,KNIGHT == 0)
        SET_CREATURE_MAX_LEVEL(PLAYER0,SKELETON,10)
        SET_CREATURE_MAX_LEVEL(PLAYER0,SPIDER,10)
        SET_CREATURE_MAX_LEVEL(PLAYER0,VAMPIRE,10)
        SET_CREATURE_MAX_LEVEL(PLAYER0,GHOST,10)
        MAX_CREATURES(PLAYER1,50)
        SET_FLAG(PLAYER_GOOD,FLAG0,5)
        TRAP_AVAILABLE(PLAYER0,BOULDER,0,0)
        QUICK_OBJECTIVE(6,"With the death of all the Generals, I can already smell the fear from Lucian across the realm. Put his head on a spike when you are ready for it.",PLAYER0)
    ENDIF
ENDIF

REM Easy

IF(PLAYER_GOOD,FLAG0 == 0)
    IF(PLAYER_GOOD,TIMER0 >= 1000)
        IF(PLAYER_GOOD,TIMER1 > 1750)
            NEXT_COMMAND_REUSABLE
            ADD_PARTY_TO_LEVEL(PLAYER_GOOD,EASY_FIRST,-1,1)
            NEXT_COMMAND_REUSABLE
            SET_TIMER(PLAYER_GOOD,TIMER1)
        ENDIF
    ENDIF
ENDIF


IF(PLAYER_GOOD,FLAG0 == 0)
    IF(PLAYER_GOOD,TIMER0 >= 1750)
        IF(PLAYER_GOOD,TIMER2 > 2250)
            NEXT_COMMAND_REUSABLE
            ADD_PARTY_TO_LEVEL(PLAYER_GOOD,EASY_SECOND,-2,1)
            NEXT_COMMAND_REUSABLE
            SET_TIMER(PLAYER_GOOD,TIMER2)
        ENDIF
    ENDIF
ENDIF


IF(PLAYER_GOOD,FLAG0 == 0)
    IF(PLAYER_GOOD,TIMER0 >= 2500)
        IF(PLAYER_GOOD,TIMER3 > 2750)
            NEXT_COMMAND_REUSABLE
            ADD_PARTY_TO_LEVEL(PLAYER_GOOD,EASY_THIRD,-3,1)
            NEXT_COMMAND_REUSABLE
            SET_TIMER(PLAYER_GOOD,TIMER3)
        ENDIF
    ENDIF
ENDIF


IF(PLAYER_GOOD,FLAG0 == 0)
    IF(PLAYER_GOOD,TIMER0 >= 3250)
        IF(PLAYER_GOOD,TIMER4 > 3500)
            NEXT_COMMAND_REUSABLE
            ADD_PARTY_TO_LEVEL(PLAYER_GOOD,EASY_FOURTH,-4,1)
            NEXT_COMMAND_REUSABLE
            SET_TIMER(PLAYER_GOOD,TIMER4)
        ENDIF
    ENDIF
ENDIF

REM Medium

IF(PLAYER_GOOD,FLAG0 == 1)
    IF(PLAYER_GOOD,TIMER0 >= 1500)
        IF(PLAYER_GOOD,TIMER5 > 2250)
            NEXT_COMMAND_REUSABLE
            ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MEDIUM_FIRST,-2,1)
            NEXT_COMMAND_REUSABLE
            SET_TIMER(PLAYER_GOOD,TIMER5)
        ENDIF
    ENDIF
ENDIF


IF(PLAYER_GOOD,FLAG0 == 1)
    IF(PLAYER_GOOD,TIMER0 >= 2250)
        IF(PLAYER_GOOD,TIMER6 > 3250)
            NEXT_COMMAND_REUSABLE
            ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MEDIUM_SECOND,-3,1)
            NEXT_COMMAND_REUSABLE
            SET_TIMER(PLAYER_GOOD,TIMER6)
        ENDIF
    ENDIF
ENDIF


IF(PLAYER_GOOD,FLAG0 == 1)
    IF(PLAYER_GOOD,TIMER0 >= 3000)
        IF(PLAYER_GOOD,TIMER7 > 4250)
            NEXT_COMMAND_REUSABLE
            ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MEDIUM_THIRD,-4,1)
            NEXT_COMMAND_REUSABLE
            SET_TIMER(PLAYER_GOOD,TIMER7)
        ENDIF
    ENDIF
ENDIF

REM Hard

IF(PLAYER_GOOD,FLAG0 == 2)
    IF(PLAYER_GOOD,TIMER0 >= 4000)
        IF(PLAYER2,TIMER0 > 3000)
            NEXT_COMMAND_REUSABLE
            ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HARD_FIRST,-3,1)
            NEXT_COMMAND_REUSABLE
            SET_TIMER(PLAYER2,TIMER0)
        ENDIF
    ENDIF
ENDIF


IF(PLAYER_GOOD,FLAG0 == 2)
    IF(PLAYER2,TIMER1 >= 6750)
        IF(PLAYER2,TIMER1 > 4250)
            NEXT_COMMAND_REUSABLE
            ADD_PARTY_TO_LEVEL(PLAYER_GOOD,HARD_SECOND,-4,1)
            NEXT_COMMAND_REUSABLE
            SET_TIMER(PLAYER2,TIMER1)
        ENDIF
    ENDIF
ENDIF

REM Very hard

IF(PLAYER_GOOD,FLAG0 == 3)
    IF(PLAYER2,TIMER2 >= 7500)
        IF(PLAYER_GOOD,TIMER2 > 4500)
            NEXT_COMMAND_REUSABLE
            ADD_PARTY_TO_LEVEL(PLAYER_GOOD,VERY_HARD,-4,1)
            NEXT_COMMAND_REUSABLE
            SET_TIMER(PLAYER2,TIMER2)
        ENDIF
    ENDIF
ENDIF

REM Endgame

IF(PLAYER_GOOD,FLAG0 == 5)
    ROOM_AVAILABLE(PLAYER0,PRISON,1,1)
    SET_FLAG(PLAYER0,FLAG0,1)
ENDIF

IF_ACTION_POINT(3,PLAYER0)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BOSS,-5,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BRUTES,4,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,MYSTIC,5,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SCOUTS,6,1)
    MAX_CREATURES(PLAYER1,50)
    SET_FLAG(PLAYER0,FLAG1,1)
ENDIF

IF(PLAYER0,FLAG1 == 1)
    IF(PLAYER0,ALL_DUNGEONS_DESTROYED == 1)
        IF(PLAYER_GOOD,TOTAL_CREATURES == 0)
QUICK_OBJECTIVE(7,"I had never dreamed you were this powerful, master. You have won, there is nothing left to conquer... for the moment... for I have this feeling we have not seen the last of either Leto and the Heroes....",PLAYER0)
            WIN_GAME
        ENDIF
    ENDIF
ENDIF
