REM ********************************************
REM  Grinics' KReign campaign for KeeperFX
REM  Script for Level 212
REM  Version 1.00
REM ********************************************

REM Briefing

REM ********************************************
REM There is trouble m'lord. In Sadlack.
REM Since your conquest of Castle Sadlack, a fellow Keeper, Meeninas, has been
REM looking after it, rebuilding, repairing walls, paying creatures and so forth.
REM But now Meeninas is missing, presumed dead and all the previous foes have met:
REM the undead Sadlackians, the Hangdamien wizards, the summoned demons
REM and the Hopemirth heroes have banded together to rid the
REM under and over world of you. Quite an honour I would say.
REM So, we believe the heroes to be in your former dungeon, and entered there
REM through abandoned Gates and so you will have to start in the former castle
REM dungeons. It's quite amusing.
REM The downside of residing in the stronghold is that the Library there was
REM burnt to the ground to prevent the knowledge of demon summoning\converting
REM ever falling into the right hands, so you'll have to work something out.
REM One final thing, the Portals are nearly exhausted here, so put the
REM Scavenger Room to good use.


SET_GENERATE_SPEED(400)

MAX_CREATURES(ALL_PLAYERS,120)

START_MONEY(PLAYER0,80000)
START_MONEY(PLAYER_GOOD,100000)

ADD_CREATURE_TO_POOL(DEMONSPAWN,13)
ADD_CREATURE_TO_POOL(BILE_DEMON,15)
ADD_CREATURE_TO_POOL(DRAGON,10)
ADD_CREATURE_TO_POOL(DARK_MISTRESS,20)
ADD_CREATURE_TO_POOL(TROLL,10)
ADD_CREATURE_TO_POOL(BUG,4)
ADD_CREATURE_TO_POOL(TENTACLE,3)
ADD_CREATURE_TO_POOL(ORC,12)
ADD_CREATURE_TO_POOL(SPIDER,9)
ADD_CREATURE_TO_POOL(SORCEROR,15)
ADD_CREATURE_TO_POOL(VAMPIRE,4)
ADD_CREATURE_TO_POOL(GHOST,2)
ADD_CREATURE_TO_POOL(HORNY,1)
ADD_CREATURE_TO_POOL(HELL_HOUND,10)


CREATURE_AVAILABLE(PLAYER0,HORNY,1,1)
CREATURE_AVAILABLE(PLAYER_GOOD,VAMPIRE,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,TENTACLE,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SORCEROR,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,SPIDER,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DRAGON,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,TROLL,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DARK_MISTRESS,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,BUG,1,1)
CREATURE_AVAILABLE(PLAYER0,ORC,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,BILE_DEMON,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,DEMONSPAWN,1,1)
CREATURE_AVAILABLE(ALL_PLAYERS,HELL_HOUND,1,1)

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

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(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_SPEED,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CONCEAL,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DISEASE,1,0)
MAGIC_AVAILABLE(PLAYER_GOOD,POWER_DESTROY_WALLS,1,1)
MAGIC_AVAILABLE(PLAYER0,POWER_DESTROY_WALLS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CHICKEN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SIGHT,1,0)

DOOR_AVAILABLE(ALL_PLAYERS,WOOD,1,0)
DOOR_AVAILABLE(ALL_PLAYERS,BRACED,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,ALARM,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(PLAYER_GOOD,MAGIC,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,LIGHTNING,1,0)
TRAP_AVAILABLE(ALL_PLAYERS,WORD_OF_POWER,1,0)


CREATE_PARTY(GOODIE1)
    ADD_TO_PARTY(GOODIE1,GIANT,10,1000,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE1,BARBARIAN,10,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE1,MONK,3,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE1,BARBARIAN,5,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE1,FAIRY,9,400,ATTACK_ENEMIES,0)

CREATE_PARTY(GOODIE2)
    ADD_TO_PARTY(GOODIE2,WITCH,10,1000,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE2,DWARFA,10,2000,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE2,FAIRY,10,3000,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE2,FAIRY,5,100,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE2,FAIRY,5,400,ATTACK_ENEMIES,0)

CREATE_PARTY(GOODIE3)
    ADD_TO_PARTY(GOODIE3,VAMPIRE,9,1000,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE3,SAMURAI,10,200,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE3,VAMPIRE,10,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE3,WIZARD,5,9000,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE3,FAIRY,7,2,ATTACK_ENEMIES,0)

CREATE_PARTY(GOODIE4)
    ADD_TO_PARTY(GOODIE4,DRAGON,10,1,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE4,BILE_DEMON,10,50,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE4,BILE_DEMON,8,400,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE4,VAMPIRE,10,20,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE4,DRAGON,10,18,ATTACK_ENEMIES,0)

CREATE_PARTY(GOODIE5)
    ADD_TO_PARTY(GOODIE5,ARCHER,10,1000,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE5,MONK,5,220,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE5,DRAGON,10,500,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE5,DEMONSPAWN,10,9000,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE5,DEMONSPAWN,5,1000,ATTACK_ENEMIES,0)

CREATE_PARTY(GOODIE6)
    ADD_TO_PARTY(GOODIE6,HORNY,10,1080,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE6,BARBARIAN,10,220,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE6,FAIRY,10,200,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE6,BARBARIAN,10,200,ATTACK_ENEMIES,0)
    ADD_TO_PARTY(GOODIE6,VAMPIRE,10,1000,ATTACK_ENEMIES,0)

DISPLAY_OBJECTIVE(59,ALL_PLAYERS)

IF(PLAYER0,GAME_TURN > 400)
    DISPLAY_INFORMATION(60)
ENDIF

SET_FLAG(PLAYER0,FLAG0,0)

IF(PLAYER0,GAME_TURN >= 20000)
    SET_TIMER(PLAYER0,TIMER0)
    SET_FLAG(PLAYER0,FLAG0,1)
ENDIF

IF(PLAYER0,FLAG0 == 1)
    IF(PLAYER0,TIMER0 >= 4000)
        
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,VAMPIRE,-6,2,10,600)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,BILE_DEMON,-4,5,10,600)
        NEXT_COMMAND_REUSABLE
        ADD_CREATURE_TO_LEVEL(PLAYER_GOOD,BARBARIAN,-5,2,10,600)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER0,TIMER0)
        
    ENDIF
ENDIF

IF(PLAYER0,GAME_TURN >= 30000)
    IF(PLAYER0,TOTAL_CREATURES >= 80)
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,GOODIE1,2,2)
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,GOODIE2,3,1)
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,GOODIE3,4,2)
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,GOODIE4,5,1)
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,GOODIE5,6,2)
        ADD_PARTY_TO_LEVEL(PLAYER_GOOD,GOODIE6,7,2)
        ADD_CREATURE_TO_LEVEL(PLAYER0,HORNY,-5,5,10,600)
        SET_FLAG(PLAYER0,FLAG0,2)
    ENDIF
ENDIF

IF(PLAYER_GOOD,DUNGEON_DESTROYED == 1)
    IF(PLAYER0,FLAG0 == 2)
        WIN_GAME
    ENDIF
    IF(PLAYER0,FLAG0 == 0)
        SET_FLAG(PLAYER0,FLAG0,1)
    ENDIF
ENDIF

IF(PLAYER0,DUNGEON_DESTROYED == 1)
    LOSE_GAME
ENDIF
