REM ****************************************************
REM Spring Execration
REM
REM Assmist Isle Campaign by Kix
REM
REM v2.0 for DAT file objectives (by dayokay)
REM 17-Oct-2020
REM ****************************************************

LEVEL_VERSION(1)

COMPUTER_PLAYER(PLAYER2,7)
START_MONEY(ALL_PLAYERS,35000)

DOOR_AVAILABLE(ALL_PLAYERS,STEEL,1,2)

SET_CREATURE_MAX_LEVEL(PLAYER2,VAMPIRE,5)

ROOM_AVAILABLE(ALL_PLAYERS,TREASURE,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,LAIR,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,GARDEN,1,1)
ROOM_AVAILABLE(PLAYER0,BRIDGE,1,0)
ROOM_AVAILABLE(ALL_PLAYERS,TRAINING,1,1)
ROOM_AVAILABLE(ALL_PLAYERS,RESEARCH,1,1)
ROOM_AVAILABLE(PLAYER0,WORKSHOP,1,0)
ROOM_AVAILABLE(PLAYER2,GRAVEYARD,1,1)

ROOM_AVAILABLE(PLAYER0,TORTURE,1,0)
ROOM_AVAILABLE(PLAYER0,BARRACKS,1,0)

MAGIC_AVAILABLE(ALL_PLAYERS,POWER_IMP,1,1)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SPEED,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CALL_TO_ARMS,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_DISEASE,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_CHICKEN,1,0)
MAGIC_AVAILABLE(ALL_PLAYERS,POWER_SIGHT,1,0)

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

CREATE_PARTY(HRED)
ADD_TO_PARTY(HRED,FAIRY,3,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(HRED2)
ADD_TO_PARTY(HRED2,FAIRY,6,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(HBLUE)
ADD_TO_PARTY(HBLUE,MONK,2,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(HBLUE2)
ADD_TO_PARTY(HBLUE2,MONK,5,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(HGREEN)
ADD_TO_PARTY(HGREEN,ARCHER,4,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(HGREEN2)
ADD_TO_PARTY(HGREEN2,ARCHER,7,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(HYELLOW)
ADD_TO_PARTY(HYELLOW,WITCH,3,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(HYELLOW1)
ADD_TO_PARTY(HYELLOW1,WITCH,8,0,ATTACK_DUNGEON_HEART,0)


CREATE_PARTY(W1)
ADD_TO_PARTY(W1,WIZARD,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(W1,WIZARD,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(W1,DWARFA,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(W1,ARCHER,1,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(W1,BARBARIAN,1,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(WW1)
ADD_TO_PARTY(WW1,WIZARD,3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(WW1,WIZARD,3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(WW1,ARCHER,3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(WW1,DWARFA,3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(WW1,MONK,3,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(WW1,SAMURAI,3,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(X1)
ADD_TO_PARTY(X1,WIZARD,6,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(X1,FAIRY,6,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(X1,THIEF,6,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(X1,THIEF,6,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(X1,GIANT,6,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(X2)
ADD_TO_PARTY(X2,WITCH,6,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(X2,BARBARIAN,6,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(X2,DWARFA,5,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(X2,DWARFA,5,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(X2,SAMURAI,6,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(X3)
ADD_TO_PARTY(X3,DWARFA,6,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(X3,GIANT,7,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(X3,BARBARIAN,6,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(X3,BARBARIAN,6,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(X3,FAIRY,6,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(FIN)
ADD_TO_PARTY(FIN,AVATAR,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FIN,KNIGHT,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FIN,KNIGHT,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FIN,KNIGHT,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(FIN,KNIGHT,10,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(SIDEKICK)
ADD_TO_PARTY(SIDEKICK,SAMURAI,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SIDEKICK,ARCHER,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SIDEKICK,ARCHER,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SIDEKICK,MONK,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SIDEKICK,MONK,10,0,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(SIDEKICK,DRAWFROM(WIZARD,WITCH),10,0,ATTACK_DUNGEON_HEART,0)

CREATE_PARTY(FLIES)
ADD_TO_PARTY(FLIES,FLY,10,0,ATTACK_DUNGEON_HEART,0)

REVEAL_MAP_LOCATION(PLAYER0,1,3)
REVEAL_MAP_LOCATION(PLAYER0,2,3)
REVEAL_MAP_LOCATION(PLAYER0,3,3)
REVEAL_MAP_LOCATION(PLAYER0,4,3)

REM gates: 1 northeast; 2 east to heart; 3 portal path; 4 northwest fortress; 5 fantasy land
REM aps: 1 red flame fantasy land; 2 blue flame northwest fortress; 3 green flame west fortress; 4 yellow flame water fortress; 5 entrance
REM
REM
REM

REM	QUICK_OBJECTIVE(1,"As if keeper to the east was not enough, people of this land already know where the intruders are and will start offense soon. Defeat the other keeper, withstand all waves and the land is yours.",PLAYER2)
DISPLAY_OBJECTIVE(85,PLAYER2)
REM	QUICK_INFORMATION(2,"Many people see joining you as the only way to defeat the vampire group east keeper controls. Use this to your advantage: not only you will receive powerful troops on your side, but also some financial income. Touch all the 4 colored flames and to keep receiving full power of the sentinels.",ALL_PLAYERS)
DISPLAY_INFORMATION(86,ALL_PLAYERS)

ADD_CREATURE_TO_POOL(TROLL,4)
CREATURE_AVAILABLE(PLAYER0,TROLL,1,0)
ADD_CREATURE_TO_POOL(SORCEROR,4)
CREATURE_AVAILABLE(PLAYER0,SORCEROR,1,0)
ADD_CREATURE_TO_POOL(DRAWFROM(TENTACLE,DEMONSPAWN),3)
CREATURE_AVAILABLE(PLAYER0,TENTACLE,1,5)
CREATURE_AVAILABLE(PLAYER0,DEMONSPAWN,1,5)
ADD_CREATURE_TO_POOL(ORC,4)
CREATURE_AVAILABLE(PLAYER0,ORC,1,0)
ADD_CREATURE_TO_POOL(BILE_DEMON,3)
CREATURE_AVAILABLE(PLAYER0,BILE_DEMON,1,0)
ADD_CREATURE_TO_POOL(SPIDER,3)
CREATURE_AVAILABLE(PLAYER0,SPIDER,1,0)

IF(PLAYER0,TOTAL_CREATURES>15)
    ADD_CREATURE_TO_POOL(HELL_HOUND,5)
    CREATURE_AVAILABLE(PLAYER0,HELL_HOUND,1,5)
ENDIF
IF(PLAYER_GOOD,BATTLES_LOST>12)
    ADD_CREATURE_TO_LEVEL(PLAYER0,BARBARIAN,5,IMPORT(PLAYER0,CAMPAIGN_FLAG7),2,0)
    IF(PLAYER0,BARBARIAN>0)
        REM	QUICK_INFORMATION(13,"Look! A few barbarians have joined you!",5)
        DISPLAY_INFORMATION(87,5)
    ENDIF
ENDIF

IF(PLAYER0,GRAVEYARD>0)
    ROOM_AVAILABLE(PLAYER0,GRAVEYARD,1,1)
    TUTORIAL_FLASH_BUTTON(15,105)
ENDIF

REM timer0: ally hero spawn
REM flag0 red flame; flag1 blue; flag2 green; flag3 yellow; flag4 sum
REM

SET_TIMER(PLAYER0,TIMER0)
IF(PLAYER0,TIMER0>655)
    NEXT_COMMAND_REUSABLE
    SET_TIMER(PLAYER0,TIMER0)
    IF(PLAYER0,FLAG0>0)
        IF(PLAYER0,FAIRY<3)
            NEXT_COMMAND_REUSABLE
            ADD_GOLD_TO_PLAYER(PLAYER0,1000)
            IF(PLAYER0,FLAG4>=4)
                REM	QUICK_INFORMATION(11,"All sentinel dwellings captured.",ALL_PLAYERS)
                DISPLAY_INFORMATION(88,ALL_PLAYERS)
                IF(PLAYER0,BARBARIAN<3)
                    NEXT_COMMAND_REUSABLE
                    ADD_CREATURE_TO_LEVEL(PLAYER0,BARBARIAN,5,IMPORT(PLAYER0,CAMPAIGN_FLAG6),8,0)
                ENDIF
                NEXT_COMMAND_REUSABLE
                ADD_GOLD_TO_PLAYER(PLAYER0,1000)
                NEXT_COMMAND_REUSABLE
                ADD_PARTY_TO_LEVEL(PLAYER0,HRED2,5,1)
            ENDIF
            IF(PLAYER0,FLAG4<4)
                NEXT_COMMAND_REUSABLE
                ADD_PARTY_TO_LEVEL(PLAYER0,HRED,5,1)
            ENDIF
        ENDIF
    ENDIF
    IF(PLAYER0,FLAG1>0)
        IF(PLAYER0,MONK<3)
            NEXT_COMMAND_REUSABLE
            ADD_GOLD_TO_PLAYER(PLAYER0,1000)
            IF(PLAYER0,FLAG4>=4)
                NEXT_COMMAND_REUSABLE
                ADD_GOLD_TO_PLAYER(PLAYER0,1000)
                NEXT_COMMAND_REUSABLE
                ADD_PARTY_TO_LEVEL(PLAYER0,HBLUE2,5,1)
            ENDIF
            IF(PLAYER0,FLAG4<4)
                NEXT_COMMAND_REUSABLE
                ADD_PARTY_TO_LEVEL(PLAYER0,HBLUE,5,1)
            ENDIF
        ENDIF
    ENDIF
    IF(PLAYER0,FLAG2>0)
        IF(PLAYER0,ARCHER<3)
            NEXT_COMMAND_REUSABLE
            ADD_GOLD_TO_PLAYER(PLAYER0,1000)
            IF(PLAYER0,FLAG4>=4)
                NEXT_COMMAND_REUSABLE
                ADD_GOLD_TO_PLAYER(PLAYER0,1000)
                NEXT_COMMAND_REUSABLE
                ADD_PARTY_TO_LEVEL(PLAYER0,HGREEN2,5,1)
            ENDIF
            IF(PLAYER0,FLAG4<4)
                NEXT_COMMAND_REUSABLE
                ADD_PARTY_TO_LEVEL(PLAYER0,HGREEN,5,1)
            ENDIF
        ENDIF
    ENDIF
    IF(PLAYER0,FLAG3>0)
        IF(PLAYER0,WITCH<3)
            NEXT_COMMAND_REUSABLE
            ADD_GOLD_TO_PLAYER(PLAYER0,1000)
            IF(PLAYER0,FLAG4>=4)
                NEXT_COMMAND_REUSABLE
                ADD_GOLD_TO_PLAYER(PLAYER0,1000)
                NEXT_COMMAND_REUSABLE
                ADD_PARTY_TO_LEVEL(PLAYER0,HYELLOW1,5,1)
            ENDIF
            IF(PLAYER0,FLAG4<4)
                NEXT_COMMAND_REUSABLE
                ADD_PARTY_TO_LEVEL(PLAYER0,HYELLOW,5,1)
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF_ACTION_POINT(1,PLAYER0)
    SET_FLAG(PLAYER0,FLAG0,1)
    ADD_TO_FLAG(PLAYER0,FLAG4,1)
    REM	QUICK_INFORMATION(3,"Fairies have joined your cause.",1)
    DISPLAY_INFORMATION(90,1)
ENDIF
IF_ACTION_POINT(2,PLAYER0)
    SET_FLAG(PLAYER0,FLAG1,1)
    ADD_TO_FLAG(PLAYER0,FLAG4,1)
    REM	QUICK_INFORMATION(4,"Monks have joined your cause.",2)
    DISPLAY_INFORMATION(91,2)
ENDIF
IF_ACTION_POINT(3,PLAYER0)
    SET_FLAG(PLAYER0,FLAG2,1)
    ADD_TO_FLAG(PLAYER0,FLAG4,1)
    REM	QUICK_INFORMATION(5,"Archers have joined your cause.",3)
    DISPLAY_INFORMATION(92,3)
ENDIF
IF_ACTION_POINT(4,PLAYER0)
    SET_FLAG(PLAYER0,FLAG3,1)
    ADD_TO_FLAG(PLAYER0,FLAG4,1)
    REM	QUICK_INFORMATION(6,"Priestesses have joined your cause.",4)
    DISPLAY_INFORMATION(93,4)
ENDIF


IF(PLAYER0,TOTAL_CREATURES>1)
    SET_TIMER(PLAYER0,TIMER1)
ENDIF

IF(PLAYER0,TIMER1>1660)
    ADD_TUNNELLER_PARTY_TO_LEVEL(PLAYER_GOOD,W1,-2,DUNGEON_HEART,0,5,1000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,W1,-1,2)
ENDIF

IF(PLAYER0,TIMER1>7660)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,W1,-3,3)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,W1,-4,3)
    REM	QUICK_INFORMATION(7,"You can thank those people for one thing though. A group of autistic monks have managed to limit the east keeper's vampires' power for some time.",PLAYER2)
    DISPLAY_INFORMATION(94,PLAYER2)
ENDIF

IF(PLAYER0,TIMER1>14000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,W1,-3,3)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,W1,-4,2)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,W1,-2,2)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,W1,-1,3)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,W1,-5,3)
ENDIF

IF(PLAYER0,TIMER1>20000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WW1,-3,3)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WW1,-1,3)
ENDIF

IF(PLAYER0,TIMER1>29000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WW1,-5,2)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WW1,-4,2)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WW1,-3,3)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,WW1,-1,2)
ENDIF


IF(PLAYER0,TIMER1>37000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,X1,-2,2)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,X1,-4,3)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,X1,-1,2)
ENDIF

IF(PLAYER0,TIMER1>44000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FLIES,DRAWFROM(-3,-4,-5),21)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FLIES,-1,21)
    ADD_GOLD_TO_PLAYER(PLAYER2,150000)
ENDIF

IF(PLAYER0,TIMER1>50000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,X1,-4,2)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,X1,-3,2)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,X1,-2,2)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,X1,-5,2)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,X1,-1,5)
ENDIF

IF(PLAYER0,TIMER1>60000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,X2,DRAWFROM(-2,-3),2)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,X2,DRAWFROM(-4,-5),2)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,X2,-1,3)
    IF(PLAYER2,DUNGEON_DESTROYED==0)
        REM	QUICK_INFORMATION(8,"Autistic monks' curse seems to have dissipated.",PLAYER2)
        DISPLAY_INFORMATION(95,PLAYER2)
        SET_CREATURE_MAX_LEVEL(PLAYER2,VAMPIRE,10)
    ENDIF
ENDIF

IF(PLAYER0,TIMER1>70000)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,X3,DRAWFROM(-2,-3),2)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,X3,DRAWFROM(-4,-5),2)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,X3,DRAWFROM(-2,-5),2)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,X2,DRAWFROM(-5,-4),3)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,X3,-1,4)
    REVEAL_MAP_LOCATION(PLAYER0,-4,25)
ENDIF

IF(PLAYER0,TIMER1>82000)
    REM presence of avatar
    PLAY_MESSAGE(PLAYER0,SPEECH,107)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,FIN,-3,1)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SIDEKICK,DRAWFROM(-4,-5),2)
    ADD_PARTY_TO_LEVEL(PLAYER_GOOD,SIDEKICK,DRAWFROM(-4,-5),2)
    SET_FLAG(PLAYER0,FLAG5,1)
    REM	QUICK_OBJECTIVE(10,"The lord of the land took his time but is finally here to revenge his comrades. Send him where he belongs.",ALL_PLAYERS)
    DISPLAY_OBJECTIVE(96,ALL_PLAYERS)
ENDIF

IF(PLAYER0,FLAG5>0)
    IF(PLAYER0,ALL_DUNGEONS_DESTROYED==1)
        IF_CONTROLS(PLAYER_GOOD,AVATAR==0)
            IF_CONTROLS(PLAYER_GOOD,KNIGHT==0)
                REM	QUICK_OBJECTIVE(12,"What are you waiting for? You're done. To the next realm!",ALL_PLAYERS)
                DISPLAY_OBJECTIVE(97,ALL_PLAYERS)
                WIN_GAME
            ENDIF
        ENDIF
    ENDIF
ENDIF

SET_TIMER(PLAYER0,TIMER2)
IF(PLAYER0,ENTRANCE>0)
    IF(PLAYER0,TIMER2>355)
        NEXT_COMMAND_REUSABLE
        SET_TIMER(PLAYER0,TIMER2)
        IF(PLAYER0,WIZARD<13)
            NEXT_COMMAND_REUSABLE
            ADD_CREATURE_TO_LEVEL(PLAYER0,WIZARD,5,1,1,0)
        ENDIF
        IF(PLAYER0,DARK_MISTRESS<4)
            IF(PLAYER0,TORTURE>0)
                NEXT_COMMAND_REUSABLE
                ADD_CREATURE_TO_LEVEL(PLAYER0,DARK_MISTRESS,5,1,1,0)
            ENDIF
        ENDIF
    ENDIF
ENDIF

IF(PLAYER2,VAMPIRE>8)
    REM	QUICK_INFORMATION(9,"The other keeper's vampire army is expanding. Interfere if you do not wish to bow before him later.",PLAYER2)
    DISPLAY_INFORMATION(98,PLAYER2)
ENDIF
