summaryrefslogtreecommitdiff
path: root/npc/001-2/jhedia.txt
blob: 8d5e2e28fd03f746a53362847ef1c1c2ac405d0b (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
001-2,23,50,0	script	Jhedia	NPC160,{
    @Cost_Per_Ingot = 1000;
    @iron_Ore_Per = 5;
    @Coal_Per = 10;

    mes "[Jhedia]";
    mes "\"I forge Iron Ore into ingots. Ingots are more useful for skilled smiths, like armorers, because the ore is refined and made into useful units which can be worked with. To make ingots, I need " + @iron_Ore_Per + " Iron Ore and " + @Cost_Per_Ingot + " gp per ingot. I also need " + @Coal_Per + " Coal for my forge.\"";
    next;
    mes "[Jhedia]";
    mes "\"How many ingots would you like?\"";
    input @ingot_count;

    if (@ingot_count == 0)
        goto L_Jhedia_Bye;
    @Zeny_cost = @ingot_count * @Cost_Per_Ingot;
    if (countitem("IronOre") < @iron_Ore_Per * @ingot_count)
        goto L_Jhedia_NotEnough_Ore;
    if (countitem("Coal") < @Coal_Per * @ingot_count)
        goto L_Jhedia_NotEnough_Coal;
    if (Zeny < @Zeny_cost)
        goto L_Jhedia_NotEnough_Zeny;
    getinventorylist;
    if (@inventorylist_count == 100
        && countitem("IronIngot") == 0
        && countitem("IronOre") > @ingot_count * @iron_Ore_Per
        | countitem("Coal") > @ingot_count * @Coal_Per)
            goto L_Jhedia_NotEnoughSlots;
    Zeny = Zeny - @Zeny_cost;
    delitem "IronOre", @ingot_count * @iron_Ore_Per;
    delitem "Coal", @ingot_count * @Coal_Per;
    getitem "IronIngot", @ingot_count;
    close;

L_Jhedia_Bye:
    mes "[Jhedia]";
    mes "\"Goodbye then.\"";
    close;

L_Jhedia_NotEnough_Ore:
    mes "[Jhedia]";
    mes "\"You do not seem to have enough Iron Ore.\"";
    close;

L_Jhedia_NotEnough_Coal:
    mes "[Jhedia]";
    mes "\"You do not seem to have enough Coal.\"";
    close;

L_Jhedia_NotEnough_Zeny:
    mes "[Jhedia]";
    mes "\"You do not seem to have enough gold pieces.\"";
    close;

L_Jhedia_NotEnoughSlots:
    mes "[Jhedia]";
    mes "\"You do not seem to have enough room to carry this many ingots.\"";
    close;

}