summaryrefslogtreecommitdiff
path: root/npc/003-1/mahoud.txt
blob: 089b32b243f8ed47ae3f5ec3ed41e11342a64b9e (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
// TMW-2 Script
// Author:
//    Saulc
//    Jesusalva
// Description:
//    Mahoud is the Tulimshar Well Master
// TODO: Chance to lose a bit of GP by getting water with money inside.
// I think water should not be so OP, and some minor RNG would be nice here

003-1,46,79,0	script	Mahoud	NPC_PLAYER_TONORI,{
    mesn;
    mes l("I can fill your bottle with water for only @@ gp the bottle.", .COST_PER_BOTTLE);
    mes l("After all, I am the Well Master!");
    input .@count;

    if (.@count == 0)
        close;
    .@Cost = .@count * .COST_PER_BOTTLE;
    .@empty = countitem(EmptyBottle);

    if (.@empty < .@count)
        goto L_NotEnoughBottles;
    if (Zeny < .@Cost)
        goto L_NotEnoughMoney;
    getinventorylist;
    inventoryplace BottleOfTonoriWater, .@count;

    Zeny=Zeny-.@Cost;
    delitem EmptyBottle, .@count;
    getitem BottleOfTonoriWater, .@count;
    close;

L_NotEnoughBottles:
    mes "";
    mesn;
    mes l("You don't have that many empty bottles!");
    close;

L_NotEnoughMoney:
    mes "";
    mesn;
    mes l("You don't have enough gold! You need @@ gp.", .@Cost);
    close;

OnInit:
    .COST_PER_BOTTLE = 50;
    .sex = G_MALE;
    .distance = 7;

    .@npcId = getnpcid(.name$);
    // Check items.xml for info about this
    setunitdata(.@npcId, UDT_HEADTOP, InfantryHelmet);
    setunitdata(.@npcId, UDT_HEADMIDDLE, SailorShirt);
    setunitdata(.@npcId, UDT_HEADBOTTOM, RaidTrousers);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 7);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 17);

    end;
}