summaryrefslogtreecommitdiff
path: root/npc/007-1/pylon.txt
blob: a326955c2dce9180c9da108d8f2bfefa5235c309 (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
// TMW2 scripts.
// TMW2 Authors:
//      Saulc
//      Jesusalva
// Description:
//      Miner Pylon transforme gems into gem powder, he ask for 100gp + 1 gem and give 100 EXp (each time) + 1 to 3 gem powder's.
// Variable:
//      dont need variable
// Reference:
//     https://fr.wikipedia.org/wiki/Pilon#Objets not Epiphysis !

007-1,47,44,0	script	Pylon	NPC_PLAYER,{

    mesn;
    mesq l("Hello, I'm Pylon!");
    next;
    mesq l("I work in this mine since 3 years, I'm an expert on gems: Ruby, Topaz, Sapphire, You know!");
    next;
    mesq l("If you have some gems, I can transform them into powder.");
    next;
    mesq l("I only take a tax of 100 gp per gem.");
    if (Zeny < 100)
        close;
    next;
    mesq lg("Then, would you like me to transform one of your gems?");
    next;
    goto L_Menu;

L_Menu:
    mesn strcharinfo(0);
    // We could add a drag zone, and allow players to drag their gems, but... Meh.
    select
        l("Hum, how many gem powders can I get from one gem?"),
        rif(countitem(Diamond) >= 1 && Zeny >= 100, l("Yeah sure, take my Diamond!")),
        rif(countitem(Ruby) >= 1 && Zeny >= 100, l("Yeah sure, take my Ruby!")),
        rif(countitem(Emerald) >= 1 && Zeny >= 100, l("Yeah sure, take my Emerald!")),
        rif(countitem(Sapphire) >= 1 && Zeny >= 100, l("Yeah sure, take my Sapphire!")),
        rif(countitem(Topaz) >= 1 && Zeny >= 100, l("Yeah sure, take my Topaz!")),
        rif(countitem(Amethyst) >= 1 && Zeny >= 100, l("Yeah sure, take my Amethyst!")),
        rif(countitem(IronOre) >= 1 && Zeny >= 100, l("And what's about Iron Ore?")),
        rif(countitem(SunnyCrystal) >= 1 && Zeny >= 1000, l("And what's about Sunny Crystal?")),
        l("No, thanks, I will keep my gems.");

    mes "";

    switch (@menu) {
    case 1:
        goto L_Question;
        break;
    case 8:
        goto L_Ore;
        break;
    case 9:
        goto L_Savior;
        break;
    case 10:
        close;
        break;
    default:
        goto L_Powder;
        break;
    }

L_Question:
    mesn;
    mesq lg("That depends on your luck!");
    next;
    mesq l("With one gem you can expect to get 1 to 3 powders!");
    next;
    mesc l("We must blame Saulc!");
    next;
    mesq lg("By the way would you like to transform your gem?");
    next;
    goto L_Menu;

L_Ore:
    mesn;
    mesq l("Hum... I'm not really good at it.");
    next;
    mesn;
    mesq l("But I can try my best for you!");
    next;
    mesn;
    mesq l("If you want it?");
    next;
    goto L_MenuOre;

L_MenuOre:
    menu
        rif(countitem(IronOre) >= 1 && Zeny >= 100, l("Make me an Iron Powder.")), L_OreOk,
        l("Nah, thank you."), L_Close;

L_OreOk:
    // Amount iron ore
    .@amo=rand2(2,3);
    inventoryplace IronPowder, .@amo, SulfurPowder, 1;

    delitem IronOre, 1;
    Zeny = Zeny - 100;
    getexp 10, 0;
    getitem IronPowder, .@amo;
    if (!(rand2(BaseLevel)/5))
        getitem SulfurPowder, 1;
    mes "";
    mesn;
    mesq l("Here you go, I tried my best! Do you want another?");
    next;
    goto L_MenuOre;


// Must rework IDs
L_Powder:
    // Magic
    .@id=Diamond+@menu-2;
    .@pw=DiamondPowder+@menu-2;

    // Amount
    .@am=rand2(1,3);
    inventoryplace .@pw, .@am;

    // Del items and EXP
    delitem .@id, 1;
    Zeny = Zeny - 100;
    getexp 60, 0;

    // Get items
    getitem .@pw, .@am;
    if (!(rand2(BaseLevel)/2))
        getitem SulfurPowder, 1;

    mes "";
    mesn;
    mesq l("Here is your powder! I hope it will be useful.");
    next;
    mesq l("Would you like to transform one more?");
    next;
    goto L_Menu;


L_Savior:
	// FIXME This is a dirt hack. TODO There should be no such checks
	if (checkbound(SunnyCrystal)) {
		mesn;
		mesc l("Not every @@ with you belongs to you.", getitemlink(SunnyCrystal)), 1;
		close;
	}
    mesn;
    mesq l("I can make @@ from @@, but this costs @@ GP.", getitemlink(MylarinDust), getitemlink(SunnyCrystal), 1000);
    next;
    mesn;
    mesc l("WARNING, THIS IS A RARE ITEM AND THIS OPERATION CANNOT BE REVERTED!!");
    next;
    mesn;
    mesc l("Are you sure you want to smash it?"), 1;
    next;
	if (askyesno() == ASK_YES) {
		Zeny-=1000;
		delitem SunnyCrystal, 1;
		getitem MylarinDust, 3;
		mesc l("SMASH! And it is now only dust..."), 3;
		next;
	}
    goto L_Menu;

L_Close:
    close;

OnInit:
    .@npcId = getnpcid(.name$);
    setunitdata(.@npcId, UDT_HEADTOP, MinerHat);
    setunitdata(.@npcId, UDT_HEADMIDDLE, ArtisTankTop);
    setunitdata(.@npcId, UDT_HEADBOTTOM, BromenalPants);
    setunitdata(.@npcId, UDT_WEAPON, DeepBlackBoots);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 15);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 4);
    .sex = G_MALE;
    .distance = 4;
    end;
}