summaryrefslogtreecommitdiff
path: root/npc/019-5-3/episode.txt
blob: 08254dbe4c0a55b6b366aa754e913434b31ae6cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// 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;
}