summaryrefslogtreecommitdiff
path: root/npc/001-16/obelisk.c
blob: affa6bc6233e74fe356a6a48f15f505ed18a990d (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// TMW2 scripts.
// Author:
//    Jesusalva
// Description:
//   Moubootaur Legends :: Final Showdown - Post Mortem Realm

001-16	mapflag	zone	FinalMMO

// This Obelisk will warp you back to the Showdown. Are you sure? 89 48
001-16,89,48,0	script	Obelisk#MLDL1	NPC_FINAL_POINT,{
    mesn;
    mesc l("Lost soul who wanders the mazes of life and death, the path lies herein ahead, but only those of stout heart may return.");
    mesc l("This is the challenge which Mr. Saves has determined upon all those whom die outside the Mana Source's Jurisdiction.");
    .@ans = ASK_NO;
    next;
    if ($@ML_SHOWDOWN) {
        // Determine if your body still exists and can be recovered
        // (Logout should have created it, but it lasts only 10 minutes)
        // Player_Name#ML!GIDGID
        // So 13 chars available for char name
        if (getstrlen(strcharinfo(0)) > 12)
            .@n$=substr(strcharinfo(0), 0, 12);
        else
            .@n$=strcharinfo(0);
        .@n$=sprintf("%s#ML!%06d", .@n$, getcharid(0));
        .@bodyId = getnpcid(.@n$);
        if (.@bodyId) {
            mesc l("Do you wish to return to the Moubootaur Showdown as an undead?"), 1;
            next;
            .@ans = askyesno();
        } else {
            mesc l("Your physical body no longer exists; you will need to use the Obelisk of Power and hope it recreates one for you!"), 1;
            next;
        }
    }
    closeclientdialog;
    if (.@ans == ASK_YES)
        "#Moubootaur"::DeathHandler(true);
    close;

OnInit:
    .distance=2;
   end;
}

// This Obelisk will warp you to a random town. Are you sure? 215 162
001-16,215,162,0	script	Obelisk#MLDL2	NPC_FINAL_POINT,{
    mesc l("This Obelisk will warp you to a random town. Are you sure?"), 1;
    .@ans = askyesno();
    closeclientdialog;
    if (.@ans == ASK_YES) {
        if (getq(LilitQuest_Access))
            .@dest = any(TP_FROST, TP_HALIN, TP_LOF, TP_FORT, TP_LILIT, TP_CANDOR, TP_ARTIS); // TP_BOSSR? TP_NIVAL?
        else
            .@dest = any(TP_FROST, TP_HALIN, TP_LOF, TP_FORT, TP_CANDOR, TP_ARTIS); // TP_BOSSR? TP_NIVAL?
        .@i = array_find($@LOCMASTER_TP, .@dest);
        warp $@LOCMASTER_MAP$[.@i], $@LOCMASTER_X[.@i], $@LOCMASTER_Y[.@i];
        EnterTown($@LOCMASTER_LOC$[.@i], true);
        "#Moubootaur"::ReviveHandler(true);
    }
    close;

OnInit:
    .distance=2;
   end;
}

// This Obelist will warp you to the Optional Dungeon. Are you sure? 286 287
//    if you can't, then the Obelisk does not react
001-16,286,287,0	script	Obelisk#MLDL3	NPC_FINAL_POINT,{
    if (!MK_WINNER) {
        npctalk3 l("The Obelisk doesn't react. You likely haven't fulfilled the requisites to use it.");
        end;
    }
    mesc l("This Obelisk will warp you to the Optional Dungeon. Are you sure?"), 1;
    .@ans = askyesno();
    closeclientdialog;
    if (.@ans == ASK_YES) {
        .@dest = TP_HEART;
        .@i = array_find($@LOCMASTER_TP, .@dest);
        warp $@LOCMASTER_MAP$[.@i], $@LOCMASTER_X[.@i], $@LOCMASTER_Y[.@i];
        EnterTown($@LOCMASTER_LOC$[.@i], true);
        "#Moubootaur"::ReviveHandler(true);
    }
    close;

OnInit:
    .distance=2;
   end;
}

// This Obelisk will return you to your savepoint and heal you fully. Are you sure?
// 108 216
001-16,108,216,0	script	Obelisk#MLDL4	NPC_FINAL_POINT,{
    mesc l("This Obelisk will return you to your savepoint and heal you fully. Are you sure?"), 1;
    .@ans = askyesno();
    closeclientdialog;
    if (.@ans == ASK_YES) {
        teleporthome();
        "#Moubootaur"::ReviveHandler(false);
        percentheal 100, 100;
		SC_Bonus(180, SC_KAIZEL, 1); // Revives with 1% HP if you die
    }
    end;

OnInit:
    .distance=2;
   end;
}