summaryrefslogtreecommitdiff
path: root/npc/functions/mounts.txt
blob: c5ff0f10859514f6ed063d6cce0420521beb6641 (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
111
// TMW2 scripts.
// Authors:
//    Jesusalva
// Description:
//    Mount Renting (var MOUBOO_RENTTIME - TODO: Discount when mouboo friend )

// MoubooRent( NPC Name )
function	script	MoubooRent	{
    .@n$=getarg(0, strnpcinfo(0));
    if (MOUBOO_RENTTIME > gettimetick(2) || BaseLevel < 20) {
        mesn .@n$;
        mesq l("Moo!");
        tutmes l("You are already renting a mount or are below level 20.");
        return;
    }

    mesn .@n$;
    mesq l("Moo!");
    next;
    mesn .@n$;
    mesq l("Do you want to rent a Mouboo? It allows quick traveling!");
    mesc l("WARNING: you can only rent one mount per character. Either tortuga or a mouboo."), 1;
    next;
    menuint
        rif(Zeny > 100, l("Rent 1 day for 100 GP")), 100,
        rif(Zeny > 270, l("Rent 3 days for 270 GP")), 270,
        rif(Zeny > 600, l("Rent 7 days for 600 GP")), 600,
        rif(Zeny > 1200, l("Rent 15 days for 1200 GP")), 1200,
        rif(Zeny > 2000, l("Rent 30 days for 2000 GP")), 2000,
        rif(Zeny > 20000, l("Rent 365 days for 20000 GP")), 20000,
        l("Don't rent a mouboo."), 0;
    mes "";
    switch (@menuret) {
        case 0:
            return;
        case 100:
            .@time=86400; break;
        case 270:
            .@time=259200; break;
        case 600:
            .@time=604800; break;
        case 1200:
            .@time=1296000; break;
        case 2000:
            .@time=2592000; break;
        case 20000:
            .@time=365*24*60*60; break;
        default:
            Exception("Invalid price: "+@menuret, RB_DEFAULT|RB_SPEECH|RB_ISFATAL);
            break;
    }
    inventoryplace RidingMouboo, 1;
    MOUBOO_RENTTIME=gettimetick(2)+.@time;
    Zeny-=@menuret;
    rentitem RidingMouboo, .@time;
    return;
}

// TortugaRent( NPC Name )
function	script	TortugaRent	{
    .@n$=getarg(0, strnpcinfo(0));
    if (MOUBOO_RENTTIME > gettimetick(2)) {
        mesn .@n$;
        mesq l("Boo!");
        tutmes l("You are already renting a mount or are below level 20.");
        return;
    }

    mesn .@n$;
    mesq l("Boo!");
    next;
    mesn .@n$;
    mesq l("Do you want to rent a Tortuga? It allows quick traveling!");
    mesc l("WARNING: you can only rent one mount per character. Either tortuga or a mouboo."), 1;
    next;
    menuint
        rif(Zeny > 50, l("Rent 1 day for 50 GP")), 50,
        rif(Zeny > 135, l("Rent 3 days for 135 GP")), 135,
        rif(Zeny > 300, l("Rent 7 days for 300 GP")), 300,
        rif(Zeny > 600, l("Rent 15 days for 600 GP")), 600,
        rif(Zeny > 1000, l("Rent 30 days for 1000 GP")), 1000,
        rif(Zeny > 10000, l("Rent 365 days for 10000 GP")), 10000,
        l("Don't rent a tortuga."), 0;
    mes "";
    switch (@menuret) {
        case 0:
            return;
        case 50:
            .@time=86400; break;
        case 135:
            .@time=259200; break;
        case 300:
            .@time=604800; break;
        case 600:
            .@time=1296000; break;
        case 1000:
            .@time=2592000; break;
        case 10000:
            .@time=365*24*60*60; break;
        default:
            Exception("Invalid price: "+@menuret, RB_DEFAULT|RB_SPEECH|RB_ISFATAL);
            break;
    }
    inventoryplace RidingTortuga, 1;
    MOUBOO_RENTTIME=gettimetick(2)+.@time;
    Zeny-=@menuret;
    rentitem RidingTortuga, .@time;
    return;
}