summaryrefslogtreecommitdiff
path: root/npc/008-2-2/melania.txt
blob: e8e7aa861f7579165fe50b30ddc842a3403f087b (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
// Evol scripts.
// Author:
//    Micksha
// Description:
//    Receptionist of Rusty Pick.

008-2-2,28,27,0	script	Melania	NPC_AIRLIA,{
    function accepted_room;
    function register_room;
    function lodge_check;

    speech
        l("Hello."),
        l("Welcome to the Rusty Pick."),
        l("One advice: Don't take the things those drinkers say too serious. They are sitting here and drinking all day."),
        l("How can we serve you today?");

    do
    {
        select
            l("Could I lodge here for a while?"),
            l("Nothing.");
        mes "";

        if (@menu == 1)
            lodge_check();

    } while (@menu != 2);
    speech S_FIRST_BLANK_LINE,
    l("I wish you a beautiful day.");
    close;

    // Check if you are booked here or somewhere else
    function lodge_check {
        if (INN_REGISTER == NO_INN)
        {
            register_room();
        }
        else if (INN_REGISTER == .inn)
        {
            speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
                l("You are already registered here."),
                l("Go on the upper level if you want to change your room or to use it.");
        }
        else
        {
            speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
                l("If you are registered somewhere else you will loose that reservation."),
                l("Do you still want to lodge here?");

            if (askyesno() == ASK_YES)
            {
                register_room();
            }
        }
        return;
    }

    // Find out prices
    function register_room {
        .@price = lognbaselvl(100, 10);
        .@price = .@price*12/10; // Make the price 20% higher by WildX request

        speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
            l("That will be @@ E to set your respawn point", .@price),
            l("This will remain your respawn point until set elsewhere."),
            l("Is that okay?");

        if (askyesno() == ASK_YES)
        {
            accepted_room(.@price);
        }
        else
        {
            speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
                l("Come back later if you changed your mind!");
        }

        return;
    }

    // Book a room
    function accepted_room {
        .@price = getarg(0);
        if (Zeny < .@price)
        {
            speech S_FIRST_BLANK_LINE | S_LAST_NEXT, l("You don't have enough money, bring @@ E.", .@price);
        }
        else
        {
            emotion E_HAPPY;
            Zeny -= .@price;
            INN_REGISTER = .inn;
            PC_IS_DEAD = false;

            speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
                l("I registered you on a random bed on the upper level."),
                l("You can go upstairs and choose a different room if you want.");
            savepoint "008-2-3", any(49, 53, 57), any(31, 35);
        }
    }

OnInit:
    .distance = 4;
    .inn=RUSTYPICK_INN;
    end;
}