summaryrefslogtreecommitdiff
path: root/npc/003-0-1/maxime.txt
blob: ed3204b9e317985f8767d8919b113c63fb5ff17f (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
// TMW-2 Script.
// Author:
//    Saulc
//    Jesusalva
// Notes:
//    Bakes Tonori Delight

003-0-1,77,40,0	script	Maxime	NPC_PLAYER,{
    function MaximeOven;
    mesn;
    mesq l("Hello. I know the secrets of the legendary @@.", getitemlink(TonoriDelight));
    next;
    mesn;
    mesq l("I could easily bake one for you, provided you bring me the following:");
    mesc l("@@/12 @@", countitem(MaggotSlime), getitemlink(MaggotSlime));
    mesc l("@@/8 @@", countitem(Plushroom), getitemlink(Plushroom));
    mesc l("@@/4 @@", countitem(MushroomSpores), getitemlink(MushroomSpores));
    mesc l("@@/3 @@", countitem(ScorpionStinger), getitemlink(ScorpionStinger));
    mesc l("@@/2 @@", countitem(CactusDrink), getitemlink(CactusDrink));
    mesc l("@@/1 @@", countitem(RoastedMaggot), getitemlink(RoastedMaggot));
    mesc l("@@/120 GP", format_number(Zeny));
    next;
    .@q=getq(HalinarzoQuest_LifeDelight);
    menuint
        l("I have the items, please bake for me"), 1,
        rif(.@q > 10, l("I want two batches!")), 2,
        rif(.@q > 20, l("I want THREE batches!")), 3,
        rif(.@q > 30, l("I need FIVE batches!")), 5,
        rif(.@q > 50, l("I have a supplier, gimme TEN batches!")), 10,
        rif(.@q > 75, l("Do as much as possible.")), 100,
        l("Ah, nice to know."), 0;

    mes "";

    if (!@menuret)
        goto L_Close;

    for (.@i=0; .@i < @menuret; .@i++) {
        if (!MaximeOven())
            goto L_Missing;
    }

    mesn;
    mesq l("Here you go, fresh from the oven!");
    next;

L_Close:
    closedialog;
    goodbye;
    close;

L_Missing:
    if (@menuret == 100) close;
    mesn;
    mesq l("You don't have everything I asked you for.");
    next;
    mesn;
    mesq l("I always wonder if I should raise my price to teach bad kids to don't lie.");
    close;

function MaximeOven {
    if (
        countitem(MaggotSlime) < 12 ||
        countitem(Plushroom) < 8 ||
        countitem(MushroomSpores) < 4 ||
        countitem(ScorpionStinger) < 3 ||
        countitem(CactusDrink) < 2 ||
        countitem(RoastedMaggot) < 1 ||
        Zeny < 120) return false;

    // 4~7 normaly, 5~10 during Summer
    // Xanthem Patch: +20% craft and -20% effect
    // New values: 5~9 normal or 6~12 during Summer
    inventoryplace TonoriDelight, 12;
    delitem MaggotSlime, 12;
    delitem Plushroom, 8;
    delitem MushroomSpores, 4;
    delitem ScorpionStinger, 3;
    delitem CactusDrink, 2;
    delitem RoastedMaggot, 1;
    getitem TonoriDelight, rand2(5,9);
    if (season() == SUMMER) {
        getitem TonoriDelight, rand2(1,3);
        mesc l("During summer, more Tonori Delight can be produced.");
    } else if (getequipid(EQI_HEAD_TOP) == ChefHat) {
        getitem TonoriDelight, any(1, 1, 2);
        mesc l("You are a master chef, looking at you inspires Maxime.");
    }
    Zeny=Zeny-120;
    getexp rand2(30, 60), 0;
    return true;
}

OnInit:
    .@npcId = getnpcid(.name$);
    setunitdata(.@npcId, UDT_HEADTOP, ChefHat);
    setunitdata(.@npcId, UDT_HEADMIDDLE, SilkRobe);
    setunitdata(.@npcId, UDT_HEADBOTTOM, CottonTrousers);
    setunitdata(.@npcId, UDT_WEAPON, AssassinBoots);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 26);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 2);

    .sex = G_MALE;
    .distance = 4;
    npcsit;
    end;
}