summaryrefslogblamecommitdiff
path: root/npc/019-5-3/episode.txt
blob: 08254dbe4c0a55b6b366aa754e913434b31ae6cc (plain) (tree)










































































                                                                                                   
// TMW2 scripts.
// Authors:
//    Jesusalva <jesusalva@tmw2.org>
// Description:
//    The Episode

019-5-3,21,25,0	script	Mysterious Chest#EP1	NPC_CHEST,{
    if (instance_id() < 0) end;
    .@gp = BankVault + Zeny;
    .@money = 1+(BaseLevel > 60 ? (BaseLevel > 80 ? .@gp/5 : .@gp/10) : .@gp/50);
    .@money = max(.@money, 1000);
    mesc l("Do you want to open this chest?");
    mesc l("You must deposit %s GP, which will be returned if quest is completed.", fnum(.@money));
    mesc l("There is a time limit, which is already running.");
    // At level 80, the "boss" is just small fry.
    if (BaseLevel < 80)
        mesc l("WARNING: Dangerous!!"), 1;
    if (Zeny < .@money) close;
    next;
    if (askyesno() == ASK_NO) {
        closeclientdialog;
        close;
    }
    CHEST_MONEY=(CHEST_MONEY/2)+.@money; // You lose 50% of whatever you put earlier
    Zeny-=.@money;
    disablenpc instance_npcname("Mysterious Chest#EP1", getq2(LoFQuest_EPISODE));
    enablenpc instance_npcname("Mysterious Chest#EP2", getq2(LoFQuest_EPISODE));
    // Good luck with your boss :3
    .@m$=getmap();
    monster(.@m$, 31, 31, "???", JackO, 1);
    sleep2(max(300, 10000-(BaseLevel * 100)));
    monster(.@m$, 30, 31, "???", MagicGoblin, 1);
    monster(.@m$, 31, 31, "???", MagicGoblin, 1);
    sleep2(max(15000, 60000-(BaseLevel * 200)));
    monster(.@m$, 30, 31, "???", MagicGoblin, 1);
    monster(.@m$, 31, 31, "???", MagicGoblin, 1);
    close;

OnInit:
    .distance = 2;
    end;
}


019-5-3,21,25,0	script	Mysterious Chest#EP2	NPC_CHEST,{
    if (instance_id() < 0) end;
    if (mobcount(getmap(), "all")) end;
    mesc l("Do you want to open this chest?");
    if (askyesno() == ASK_NO) {
        closeclientdialog;
        close;
    }
    if (getq(LoFQuest_EPISODE) != 11) {
        atcommand("@ban 3d "+strcharinfo(0));
        end;
    }
    .@q2 = getq2(LoFQuest_EPISODE);
	instance_set_timeout(900, 900, .@q2);
    warp "ep02@"+getcharid(0), 37, 20; // To Falkrun
    disablenpc instance_npcname("#004-3-1_70_25", getq2(LoFQuest_EPISODE));
    disablenpc instance_npcname("#004-3-1_68_33", getq2(LoFQuest_EPISODE));
    disablenpc instance_npcname("Mysterious Chest#EP2", getq2(LoFQuest_EPISODE));
    close;

OnInstanceInit:
    .distance = 2;
    disablenpc instance_npcname("Mysterious Chest#EP2");
    end;

OnInit:
    .distance = 2;
    disablenpc .name$;
    end;
}