summaryrefslogtreecommitdiff
path: root/npc/items/teleporter.txt
blob: 27453b24814cbc3d0d6858f335cc0e4ea0924633 (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
// TMW2 scripts.
// Authors:
//    Pyndragon
//    Jesusalva
// Description:
//    Hand Teleporter (also saves coordinates - @memo)

-	script	LoF Teleporter	NPC_HIDDEN,{
    close;

L_Cooldown:
    mesn;
    mesc l("This teleporter is currently recharging.");
    mesc l("You can use it again in @@.", FuzzyTime(TELEPORTER_TIME));
    close;

OnUse:
    if (TELEPORTER_TIME > gettimetick(2))
        goto L_Cooldown;
    if (readparam(Hp) < readparam(MaxHp)) {
        dispbottom l("You are hurt, and cannot use this.");
        end;
    }

    mesn;
    mesc l("Ozthokk, a great sage from the Land Of Fire, holds secrets of time and space travel.");
    mesc l("This is not magic, it is science!");
    mes "";
    mesc l("PS. Additional reagents may be required for warps.");
    next;

    .@x=reputation("Hurns");

    menu
        l("Don't warp"), -,
        l("Land Of Fire Village (@@m)", 50-.@x), L_LoF,
        l("Save Point (@@m)", 30-.@x), L_Save;

    close;

L_Save:
    if (readparam(Hp) < readparam(MaxHp)) {
        dispbottom l("You are hurt, and cannot use this.");
    } else {
	    doevent "shake::OnGM";
        warp "Save", 0, 0;
        TELEPORTER_TIME=gettimetick(2)+(60*30)-(.@x*60);
    }
    closedialog;
    end;

L_LoF:
    if (readparam(Hp) < readparam(MaxHp)) {
        dispbottom l("You are hurt, and cannot use this.");
    } else {
	    doevent "shake::OnGM";
        warp "017-1", 120, 89;
        TELEPORTER_TIME=gettimetick(2)+(60*30)-(.@x*60);
    }
    closedialog;
    end;
}