summaryrefslogblamecommitdiff
path: root/npc/020-1/guards.txt
blob: 15d8b2122823a277ca958b52f6e2873577b56c98 (plain) (tree)












































































































































                                                                                        
// TMW2 scripts.
// Authors:
//    Jesusalva
// Description:
//    Protect Nivalis

020-1,49,48,0	script	Lieutenant Joshua	NPC_PLAYER,{
    // The Monster King guild have a special menu
    if (strcharinfo(2) == "Monster King") goto L_MKControl;

    if ($NIVALIS_LIBDATE) {
        mesn;
        mesq l("Nivalis was liberated @@ ago.", FuzzyTime($NIVALIS_LIBDATE));
        close;
    } else {
        legiontalk; end;
    }

// Respawn monster from $@SIEGE_TMPMOBS memory
OnRespawn:
    getmapxy(.@m$,.@x,.@y,0);
    siege_spawn(.@m$, any_of($@SIEGE_TMPMOBS), 1, .name$+"::OnRespawn");
    if (rand(10000) <= $coinsrate+($@SIEGE_NIVAL*50))
        makeitem StrangeCoin, 1, .@m$, .@x, .@y;
    end;


L_MKControl:
    mesn;
    mes "Oh noes! You've found the Nivalis control panel!";
    next;
    select
        l("Abort"),
        l("Initiate a siege");
    mes "";
    if (@menu == 2) {
        doevent "Lieutenant Joshua::OnStartSiege";
        closedialog;
    }
    close;


OnMKSiege:
    $@SIEGE_NIVAL=rand(1,10);
OnStartSiege:
    siege_setup("019-2");
    kamibroadcast(col("WARNING! WARNING! Monster Army marching towards Nivalis!!",1));
    siege_cast("019-2", .name$, 0, TP_NIVAL);
    initnpctimer;
    end;

// Timers
OnTimer35000:
    siege_setup("020-1");
    siege_cast("019-2", .name$, $@SIEGE_NIVAL, TP_NIVAL);
    mapannounce("020-1", "##2Message to all Nivalis NPCs: Take shelter!", bc_map);
    disablenpc "Serge";
    disablenpc "Knox The Traveler";
    disablenpc "Camilot";
    disablenpc "Mede";
    disablenpc "Gambler#020-4";
    disablenpc "Gambling Xan";
    disablenpc "Baktar";
    disablenpc "Bracco";
    disablenpc "Agostine";
    end;

OnTimer65000:
    siege_cast("020-1", .name$, 0, TP_NIVAL);
    siege_cast("019-2", .name$, $@SIEGE_NIVAL, TP_NIVAL);
    disablenpc "Ben#NivBanker";
    end;

OnTimer96000:
    siege_cast("020-1", .name$, $@SIEGE_NIVAL, TP_NIVAL);
    end;

OnTimer180000:
    siege_boss("020-1", $@SIEGE_NIVAL);
    siege_cast("020-1", .name$, $@SIEGE_NIVAL, TP_NIVAL);
    end;

// At certain moments, the difficulty rises
OnTimer210000:
OnTimer420000:
OnTimer540000:
    $@SIEGE_NIVAL+=1;
// Spawn each 45s after timer 120, difficulty raisers exempt (same for boss)
OnTimer120000:
OnTimer165000:
//Timer 180000: BOSS WAVE
//OnTimer210000: difficulty raiser
OnTimer255000:
OnTimer300000:
OnTimer345000:
OnTimer390000:
//Timer 420000: difficulty raiser
OnTimer435000:
OnTimer480000:
OnTimer525000:
//OnTimer540000: difficulty raiser
OnTimer570000:
    siege_cast("020-1", .name$, $@SIEGE_NIVAL, TP_NIVAL);
    end;

OnTimer600000:
    mapannounce("020-1", "##1The Monster Army is getting tired of resistance!", bc_map);
    siege_cast("020-1", .name$, $@SIEGE_NIVAL, TP_NIVAL);
    end;

OnTimer660000:
    $@MK_SCENE=MK_NONE;
    $@MK_AGGRO=$@MK_AGGRO/20;
    mapannounce("020-1", "##1The Monster King army is preparing to withdraw!", bc_map);
    end;

OnTimer690000:
    siege_revert("020-1");
    siege_revert("019-2");
    enablenpc("Mana Stone");
    $@SIEGE_NIVAL=0;
    announce(("Nivalis siege is over!"), bc_all);
    enablenpc "Serge";
    enablenpc "Knox The Traveler";
    enablenpc "Camilot";
    enablenpc "Mede";
    enablenpc "Gambler#020-4";
    enablenpc "Gambling Xan";
    enablenpc "Baktar";
    enablenpc "Bracco";
    enablenpc "Agostine";
    enablenpc "Ben#NivBanker";
    stopnpctimer;
    end;

OnInit:
    end;


}