summaryrefslogtreecommitdiff
path: root/npc/functions/soul_menhir.txt
blob: d08e09b715d67407e023a17788f952a24bb64ec7 (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
// TMW2 Script
// Author: Jesusalva
// With parts from The Mana World.

function	script	SoulMenhir	{
    mes l("[Soul Menhir]");
    mes l("(A mystical aura surrounds this stone. You feel mysteriously attracted to it. Something tells you to touch it. What do you do?)");

    menu
        l("Touch it."), L_Bind,
        rif($@GM_EVENT, l("Send soul to the Mana Plane for GM events")), L_Aeros,
        rif($EVENT$ == "Easter", l("[Easter] Send soul to the Mana Forest!")), L_Easter,
        rif($EVENT$ == "Worker Day", l("[Worker Day] Send soul to the Contributor Cave!")), L_Worker,
        rif($EVENT$ == "Christmas", l("[Christmas] Send soul to the Christmas Workshop!")), L_Xmas, // TODO: In future there'll be an event map
        l("Leave it alone."), L_Return;

//L_Towel:
//    if (TowelLastUsed > (gettimetick(2) - 1800))
//        goto L_DontPanic;
//    TowelLastUsed = gettimetick(2);
//    mes l("[Soul Menhir]");
//    mes "(You touch the mysterious stone. Somehow it feels hard and soft at the same time.)";
//    getitem "HitchhikersTowel", 1;
//    goto L_Return;

L_Bind:
    if (@map$ ~= "003-1" && !(TELEPORTERS & TP_TULIM))
        TELEPORTERS=TELEPORTERS|TP_TULIM;
    if (@map$ ~= "012-1" && !(TELEPORTERS & TP_HURNS))
        TELEPORTERS=TELEPORTERS|TP_HURNS;

    if (Menhir_Activated == 1)
        goto L_Shortversion;

    mes l("[Soul Menhir]");
    mes l("(You touch the mysterious stone. Somehow it feels warm and cold at the same time.)");
    mes l("(Suddenly a strange sensation flows through you. It feels like your soul leaves your body and becomes one with the stone.)");
    mes l("(As suddenly as the feeling started it stops. The strange attraction is away from one moment to the next and the menhir feels like just an ordinary stone.)");
    Menhir_Activated = 1;
    goto L_Save;

L_Shortversion:
    mes l("[Soul Menhir]");
    mes l("(A strange sensation flows through you. It feels like your soul leaves your body and becomes one with the stone. As suddenly as the feeling started it stops.)");
    goto L_Save;

L_Save:
    if (@x == 0 && @y == 0)
        goto L_FindPoint;
    goto L_Do_Save;

L_Aeros:
    if (!$@GM_EVENT) goto L_DontPanic;
    .@gt=$@AEROS_SPWN;
    if (.@gt == 2) {
        select
            l("East Aeros"),
            l("West Aeros");
        .@gt=@menu-1;
    }
    switch (.@gt) {
    case 0:
        warp "001-1", 235, 26; break;
    case 1:
        warp "001-1", 23, 108; break;
    }
    specialeffect(63, AREA, getcharid(3));
    message strcharinfo(0), l("You are now at the Mana Plane of Existence, at the Floating Island of Aeros.");
    close;

L_Easter:
    if ($EVENT$ != "Easter") goto L_DontPanic;
    warp "001-4", 151, 157;
    message strcharinfo(0), l("You are now at the Mana Plane of Existence, at the Magical Forest.");
    close;

L_Worker:
    if ($EVENT$ != "Worker Day") goto L_DontPanic;
    warp "001-5", 22, 79;
    message strcharinfo(0), l("You are now at the Mana Plane of Existence, at the Contributor's Cave.");
    close;

L_Xmas:
    if ($EVENT$ != "Christmas") goto L_DontPanic;
    warp "019-4-1", 32, 36;
    message strcharinfo(0), l("You are now at the Christmas Workshop.");
    close;

L_DontPanic:
    message strcharinfo(0), l("(A strange barrier keeps you from touching the stone at this time.)");
    goto L_Return;

L_Do_Save:
    savepoint @map$, @x, @y;
    specialeffect(4, SELF, getcharid(3));

    // As we have a dialog box open, this function produces an undesirable player talk.
    //savepointparticle @map$, @x, @y, NO_INN;
    goto L_Return;

L_FindPoint:
    @n = rand(getarraysize(@Xs));
    @x = @Xs[@n];
    @y = @Ys[@n];
    goto L_Do_Save;

L_Return:
    return;
}