1 | //===== eAthena Script ======================================= |
---|
2 | //= Gemstone trader |
---|
3 | //===== By: ================================================== |
---|
4 | //= L0ne_W0lf |
---|
5 | //===== Current Version: ===================================== |
---|
6 | //= 1.2 |
---|
7 | //===== Compatible With: ===================================== |
---|
8 | //= eAhena SVN |
---|
9 | //===== Description: ========================================= |
---|
10 | //= [Aegis Conversion] |
---|
11 | //= Trade various colors of gemstones for other color gemstones. |
---|
12 | //===== Additional Comments: ================================= |
---|
13 | //= 1.0 Rescripted to Aegis 10.3 standards. [L0ne_W0lf] |
---|
14 | //= Any notes pertaining to the prior trader may be found |
---|
15 | //= in the cities/payon.txt |
---|
16 | //= 1.1 Corrected NPC names to fall within proper restrictions. [L0ne_W0lf] |
---|
17 | //= 1.2 Updated input with min/max values. [L0ne_W0lf] |
---|
18 | //= Added a checkweight. |
---|
19 | //============================================================ |
---|
20 | |
---|
21 | payon,173,238,5 script Jade#pay 754,{ |
---|
22 | if (checkweight(1201,1) == 0) { |
---|
23 | mes "^3355FFWait a second! Right now, you're carrying too many items with you. Please come back after putting some of your things into Kafra Storage.^000000"; |
---|
24 | close; |
---|
25 | } |
---|
26 | mes "[Jade]"; |
---|
27 | mes "Bring me two"; |
---|
28 | mes "Gemstones of the"; |
---|
29 | mes "same color, and I will"; |
---|
30 | mes "change them to Gemstones"; |
---|
31 | mes "of a different color."; |
---|
32 | next; |
---|
33 | switch(select("Blue Gemstones into Red ones!:Red Gemstones into Yellow ones!:Yellow Gemstones into Blue ones!")) { |
---|
34 | case 1: callsub S_TradeGems,717,716; |
---|
35 | case 2: callsub S_TradeGems,716,715; |
---|
36 | case 3: callsub S_TradeGems,715,717; |
---|
37 | } |
---|
38 | |
---|
39 | S_TradeGems: |
---|
40 | if (countitem(getarg(0)) < 2) { |
---|
41 | mes "[Jade]"; |
---|
42 | mes "Hah...!"; |
---|
43 | mes "You're kidding me, right?"; |
---|
44 | mes "I can't provide you with this"; |
---|
45 | mes "service if you don't"; |
---|
46 | mes "give me at least"; |
---|
47 | mes "2 "+getitemname(getarg(0))+"s!"; |
---|
48 | close; |
---|
49 | } |
---|
50 | else { |
---|
51 | set .@gems,countitem(getarg(0))/2; |
---|
52 | mes "[Jade]"; |
---|
53 | mes "I believe I can create"; |
---|
54 | mes "a total of " + .@gems + " " + getitemname(getarg(1)) + "s"; |
---|
55 | mes "using the "+getitemname(getarg(0))+"s"; |
---|
56 | mes "that you currently have."; |
---|
57 | mes "What do you want to do?"; |
---|
58 | next; |
---|
59 | switch(select("Give me as many as you can.:I want to set the amount.:I quit.")) { |
---|
60 | case 1: |
---|
61 | delitem getarg(0),.@gems * 2; |
---|
62 | getitem getarg(1),.@gems; |
---|
63 | mes "[Jade]"; |
---|
64 | mes "There you go."; |
---|
65 | mes "Feel free to come"; |
---|
66 | mes "back any time."; |
---|
67 | mes "Hm, what's that look for?"; |
---|
68 | mes "Is there something on my face?"; |
---|
69 | close; |
---|
70 | case 2: |
---|
71 | mes "[Jade]"; |
---|
72 | mes "So how many"; |
---|
73 | mes "do you want?"; |
---|
74 | mes "The maximum number"; |
---|
75 | mes "that you can enter is 100."; |
---|
76 | next; |
---|
77 | while(1) { |
---|
78 | input .@input,0,101; |
---|
79 | if (.@input == 0) { |
---|
80 | mes "[Jade]"; |
---|
81 | mes "None at all?"; |
---|
82 | mes "I guess you"; |
---|
83 | mes "changed your mind..."; |
---|
84 | close; |
---|
85 | } |
---|
86 | else if (.@input > 100) { |
---|
87 | mes "[Jade]"; |
---|
88 | mes "Errm..."; |
---|
89 | mes "I asked you to enter"; |
---|
90 | mes "an amount no greater"; |
---|
91 | mes "than 100, remember...?"; |
---|
92 | next; |
---|
93 | } |
---|
94 | else { |
---|
95 | break; |
---|
96 | } |
---|
97 | } |
---|
98 | |
---|
99 | if (.@gems > .@input) { |
---|
100 | delitem getarg(0),.@input * 2; |
---|
101 | getitem getarg(1),.@input; |
---|
102 | mes "[Jade]"; |
---|
103 | mes "There you go."; |
---|
104 | mes "Feel free to come"; |
---|
105 | mes "back any time."; |
---|
106 | mes "Hm, what's that look for?"; |
---|
107 | mes "Is there something on my face?"; |
---|
108 | } |
---|
109 | close; |
---|
110 | case 3: |
---|
111 | mes "[Jade]"; |
---|
112 | mes "Sure, no problem."; |
---|
113 | mes "Come back any time."; |
---|
114 | close; |
---|
115 | } |
---|
116 | } |
---|
117 | } |
---|