1 | //===== eAthena Script ======================================= |
---|
2 | //= Milk Trader |
---|
3 | //===== By: ================================================== |
---|
4 | //= kobra_k88; L0ne_W0lf |
---|
5 | //===== Current Version: ===================================== |
---|
6 | //= 1.5 |
---|
7 | //===== Compatible With: ===================================== |
---|
8 | //= eAthena SVN |
---|
9 | //===== Description: ========================================= |
---|
10 | //= [Aegis Conversion] |
---|
11 | //= Trades bottles for milk |
---|
12 | //===== Additional Comments: ================================= |
---|
13 | //= Fully working |
---|
14 | //= 1.1 Negative input bug fixed [Lupus] |
---|
15 | //= 1.2 Raised the price to close zeny exploit [Lupus] |
---|
16 | //= 1.2a Switched to Lupus's "loopless" technique.[kobra_k88] |
---|
17 | //= 1.3 Rescripted to Aegis 10.3 standards. [L0ne_W0lf] |
---|
18 | //= 1.4 Implemented checkweight. [L0ne_W0lf] |
---|
19 | //= 1.5 Fixed missed variable. (bugreport:1523) [L0ne_W0lf] |
---|
20 | //============================================================ |
---|
21 | |
---|
22 | prontera,73,140,0 script Milk Vendor 86,{ |
---|
23 | if (checkweight(1201,1) == 0) { |
---|
24 | mes "^3355FFJust a minute!"; |
---|
25 | mes "I can't offer any of my"; |
---|
26 | mes "services to you because"; |
---|
27 | mes "you're carrying too much"; |
---|
28 | mes "stuff. Put your extra items in"; |
---|
29 | mes "Kafra Storage and come again~"; |
---|
30 | close; |
---|
31 | } |
---|
32 | mes "[Milk Vendor]"; |
---|
33 | mes "Hey, hey..."; |
---|
34 | mes "If you bring me"; |
---|
35 | mes "1 Empty Bottle and"; |
---|
36 | mes "15 Zeny, I'll exchange"; |
---|
37 | mes "them for 1 Milk. How"; |
---|
38 | mes "does that sound?"; |
---|
39 | next; |
---|
40 | if (select("Exchange all empty bottles.:Cancel") == 1) { |
---|
41 | if (countitem(713) <= 0) { |
---|
42 | mes "[Milk Vendor]"; |
---|
43 | mes "Hey..."; |
---|
44 | mes "You don't have"; |
---|
45 | mes "any Empty Bottles."; |
---|
46 | mes "I can't really give you"; |
---|
47 | mes "this milk any other"; |
---|
48 | mes "way, you know..."; |
---|
49 | close; |
---|
50 | } |
---|
51 | set .@bottles,countitem(713); |
---|
52 | set .@total_weight,.@bottles * 50; |
---|
53 | set .@total_cost,.@bottles * 15; |
---|
54 | if (zeny < .@Total_cost) { |
---|
55 | mes "[Milk Vendor]"; |
---|
56 | mes "Oh, whoa~!"; |
---|
57 | mes "You don't have enough"; |
---|
58 | mes "zeny to exchange all"; |
---|
59 | mes "these Empty Bottles for"; |
---|
60 | mes "Milk. You need to have"; |
---|
61 | mes "at least " + .@total_cost + " zeny."; |
---|
62 | close; |
---|
63 | } |
---|
64 | if ((maxweight-weight) < .@total_weight) { |
---|
65 | mes "[Milk Vendor]"; |
---|
66 | mes "Hmm..."; |
---|
67 | mes "Would you make"; |
---|
68 | mes "a little more room"; |
---|
69 | mes "in your inventory"; |
---|
70 | mes "before I give you"; |
---|
71 | mes "all of this milk?"; |
---|
72 | close; |
---|
73 | } |
---|
74 | set zeny,zeny-.@total_cost; |
---|
75 | delitem 713,.@bottles; //Empty Bottles |
---|
76 | getitem 519,.@bottles; //Milk |
---|
77 | close; |
---|
78 | } |
---|
79 | close; |
---|
80 | } |
---|