summaryrefslogtreecommitdiff
path: root/npc/031-5/beatrice.txt
blob: 252a6edaece3888a7f4bdc97c55483361fee2cfb (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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
// TMW2 scripts.
// Authors:
//    Jesusalva
// Description:
//    Questmaker Handbook 14.0 (F = Favorable)

031-5,97,41,0	script	Beatrice	NPC_SAVIOR_F,{
    // Unlocks upon: Rebirth
    if (!REBIRTH) {
        mesn;
        mesq l("Hey there, %s. What I deal with is too much for your weak bones. So please come again after you are reborn, then I'll have something for you.", get_race());
        close;
    }
    mesn;
    mesq l("Hey there, %s. I deal with ultra rare items. If the Powers That Be decided you're out of luck, well, I am here to help you to bypass it.", get_race());
    next;
    mesn;
    mesq l("For that, I use a special currency - Aethyr points. You can trade rare items for points. I also sell one point for %d GP. So, what will it me?", .price);
    next;

L_Loop:
    mesc l("Aethyr Points: %s", fnum(AETHYR_PTS)), 2;
    select
        l("Nothing right now."),
        l("Buying rares"),
        l("Selling rares"),
        l("Purchasing points");
    mes "";
    switch (@menu) {
    case 1:
        closeclientdialog;
        close;
    case 2:
        openshop;
        closedialog; // Top-Level exit
        end;
    case 3:
        goto L_Seller;
    case 4:
        mesc l("How many points? (0-%d)", Zeny/.price);
        input .@points, 0, Zeny/.price;
        if (.@points * .price > Zeny)
            .@points = 0;
        Zeny-=.price*.@points;
        AETHYR_PTS+=.@points;
        mesc l("Done!"), 2;
        break;
    }
    clear;
    goto L_Loop;

L_Seller:
    .@id = 0;
    .@rt = 0;
    .@pc = 0;
    .@am = 0;

    .@mr$=sprintf("%d.%02d", .ratio/100, .ratio%100);
    mesc l("Only items with max %s%% drop rate are accepted!", .@mr$), 1;
    .@id = requestitem();
    if (.@id < 1) goto L_Cont;
    if (checkbound(.@id)) goto L_Cont;
    .@rt = getiteminfo(.@id, ITEMINFO_MAXCHANCE);
    // Some items are... special. Refuse them.
    if (.@rt == 0)
        .@rt=10000;
    if (array_find(.blacklist, .@id) >= 0)
        .@rt=10000;

    .@mb$=sprintf("%d.%02d", .@rt/100, .@rt%100);
    if (.@rt > .ratio) {
        mesc l("This item drop rate is %s%%, which exceeds the threshold of %s%%.", .@mb$, .@mr$);
        next;
        goto L_Cont;
    }
    debugmes "Ratio %s", .@mb$;
    .@pc = 1+.ratio-(.@rt); // The reverse, so it goes from 1 to ratio
    .@pc *= 12; // Each 0.01% chance gives a bonus of 12 points
    mesn;
    mesq l("I offer you %s Aethyr Points per unit of %s. How many do you wish to sell? (0-%d)", fnum(.@pc), getitemlink(.@id), countitem(.@id));
    input .@am, 0, countitem(.@id);
    if (.@am < 1)
        goto L_Cont;
    delitem .@id, .@am;
    AETHYR_PTS+=.@pc;
    // FALLTHROUGH

L_Cont:
    clear;
    goto L_Loop;

OnInit:
    .@npcId = getnpcid(.name$);
    setunitdata(.@npcId, UDT_HEADBOTTOM, CottonSkirt);
    setunitdata(.@npcId, UDT_HEADMIDDLE, SaviorArmor);
    setunitdata(.@npcId, UDT_HEADTOP, TrapperHat);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 9);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 18);

    .sex = G_FEMALE;
    .distance = 5;
    .price = 520; // Loosely ased on Crafty Wings price
    .ratio = 100; // Max drop rate
    // Some items can be obtained by "other means" and thus, their value cannot be
    // reliably calculated
    setarray .blacklist, GuildCoin, WarlordPlate, Lightsaber, PowerfulLightsaber, Emperium, PinkieCrystal, PinkieHat, IronIngot, Kanabo, WarlordHelmet, Kitana, LeatherGloves, SacredManaPotion, EverburnPowder, WoodenSword, MoubooFigurine, FancyHat, LOFCoin, JeansShorts, MinerHat, LeatherShield, Boots, CommonCarp, IcedBottle, ShortBow, CottonShirt, MinerGloves, LoveLetter, LegendaryTortuga, ChocolateDye;

	tradertype(NST_CUSTOM);
    // Okay, so for the catalog
    /* Some important prices
        Crystallized Maggot - 1,200 pts
        Light Green Diamond - 1,176 pts
        Amethyst - 384 pts
       TL;DR From 12 to 1200 pts */

    // Rare equips
    sellitem HeartNecklace, 7500;
    sellitem MoubiHat, 7500;
    sellitem BloodyMoubooHat, 7000;
    sellitem AlphaMoubooHat, 6500;
    sellitem MoubooHat, 6000;
    sellitem AntlersHat, 6000;
    sellitem FluffyHat, 6000;
    sellitem ShroomHat, 6000;
    sellitem CaveSnakeHat, 6000;
    sellitem SantaBeardHat, 6000;
    sellitem MushHat, 6000;
    sellitem ForestShroomHat, 6000;
    sellitem WickedShroomHat, 6000;
    sellitem MoonshroomHat, 6000;
    sellitem TerraniteMask, 6000;
    sellitem DragonStar, 6000;
    sellitem Kanabo, 6000;
    sellitem FourLeafClover, 6000;
    sellitem IceGladius, 6000;
    sellitem PinkieHat, 5500;

    // Rare non-equips are cheaper
    sellitem Bloodstone, 5000;
    sellitem Butterfly, 5000;
    sellitem CrystallizedMaggot, 5000;
    sellitem PirateTreasureMap, 5000;
    sellitem BlueManaPearl, 5000;
    sellitem DesertTablet, 5000;
    sellitem LavaManaPearl, 5000;
    sellitem LightGreenDiamond, 5000;
    sellitem BlackPearl, 5000;

    // "Kinda generic"
    sellitem BanditPants, 2500;
    sellitem CentaurSpear, 2500;
    sellitem DarkDesertMushroom, 2500;
    sellitem SkullMask, 2500;
    sellitem BunnyEars, 2500;
    //sellitem TerraniteBlueprint, 2500;
    sellitem Quill, 2400;
    sellitem CopperKey, 2400;
    sellitem SilverMirror, 2400;
    sellitem GoldenApple, 2400;
    sellitem SaxsoKey, 1200;

    // Not drops
    sellitem StrangeCoin, 1000;
    sellitem BottleOfDivineWater, 600;
	sellitem Curshroom, 300;
    end;

OnCountFunds:
	setcurrency(AETHYR_PTS);
	end;

/* @price is total cost. @points is if we accept two items as currency. */
OnPayFunds:
	if( AETHYR_PTS < @price )
		end;
	AETHYR_PTS -= @price;
	purchaseok();
	end;

}