SHOW:
|
|
- or go back to the newest paste.
1 | function script AMRA { | |
2 | //Tier Stone ID's 1-10 | |
3 | - | if (.@id == 32100) { |
3 | + | set .ts0, 32100; |
4 | set .ts1, 32101; | |
5 | set .ts2, 32102; | |
6 | set .ts3, 32103; | |
7 | set .ts4, 32104; | |
8 | set .ts5, 32105; | |
9 | set .ts6, 32106; | |
10 | set .ts7, 32107; | |
11 | - | if (.@id >= 32101 && .@id <= 32109) { |
11 | + | set .ts8, 32108; |
12 | - | prompt "Merge 3 "+getitemname(.@id)+"'s","Apply "+getitemname(.@id)+" to Equipment"; |
12 | + | set .ts9, 32109; |
13 | set .ts10, 32110; | |
14 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
15 | set .@id, getarg(0); | |
16 | if (.@id == .ts0) { | |
17 | if (countitem(.@id) > 2) { | |
18 | set .@del, ((countitem(.@id)/3)*3); | |
19 | getitem (1 + .@id), (countitem(.@id)/3); | |
20 | delitem .@id, .@del; | |
21 | } | |
22 | end; | |
23 | } | |
24 | if (.@id >= .ts1 && .@id <= .ts9) { | |
25 | prompt "Merge 3 "+getitemname(.@id)+"'s","Apply "+getitemname(.@id)+" to Equipment."; | |
26 | if (@menu == 1) { | |
27 | if (countitem(.@id) == 2) { | |
28 | message strcharinfo(0), "Merge Failed: "+(3 - countitem(.@id))+" more "+getitemname(.@id)+" is needed to merge."; | |
29 | close; | |
30 | } | |
31 | if (countitem(.@id) == 1) { | |
32 | message strcharinfo(0), "Merge Failed: "+(3 - countitem(.@id))+" more "+getitemname(.@id)+"'s are needed to merge."; | |
33 | close; | |
34 | - | if (@menu == 2) { |
34 | + | |
35 | - | callfunc "AMRACOMB",.@id; |
35 | + | |
36 | getitem (1 + .@id), (countitem(.@id)/3); | |
37 | delitem .@id, .@del; | |
38 | - | if (.@id == 32110) { |
38 | + | |
39 | - | prompt "Apply to Equipment"; |
39 | + | |
40 | } | |
41 | - | callfunc "AMRACOMB",.@id; |
41 | + | |
42 | dispbottom "Two "+getitemname(.@id)+"'s could not merge."; | |
43 | } | |
44 | - | }//END |
44 | + | |
45 | - | |
45 | + | |
46 | - | function script AMRACOMB { |
46 | + | |
47 | if (@menu == 2) goto AMRACOMB; | |
48 | if (@menu == 255) close; | |
49 | } | |
50 | - | mes "You can refine an item up to +"+(.@id - 32100)+" using this stone."; |
50 | + | if (.@id == .ts10) { |
51 | prompt "Apply "+getitemname(.@id)+" to Equipment."; | |
52 | if (@menu == 1) goto AMRACOMB; | |
53 | ||
54 | } | |
55 | AMRACOMB: | |
56 | set .@id, getarg(0); | |
57 | mes "Select what you wish to refine."; | |
58 | mes " "; | |
59 | mes "You can refine an item up to +"+(.@id - .ts0)+" using this stone."; | |
60 | setarray .@position$[1], "Head (Upper)","Armor","Left hand","Right hand","Robe","Shoes","Accessory (Left)","Accessory (Right)","Head (Mid)","Head (Lower)"; | |
61 | set .@menu$,""; | |
62 | for (set .@i, 1; .@i <= 10; set .@i, .@i + 1) { | |
63 | if (getequipisequiped(.@i)) | |
64 | if (getequiprefinerycnt(.@i) > 0) { | |
65 | set .@menu$, .@menu$ + .@position$[.@i] + " - " + "[+" + getequiprefinerycnt(.@i) + " " + getequipname(.@i) + "]"; | |
66 | } else { | |
67 | set .@menu$, .@menu$ + .@position$[.@i] + " - " + "[" + getequipname(.@i) + "]"; | |
68 | } | |
69 | set .@menu$, .@menu$ + ":"; | |
70 | } | |
71 | set .@part, select(.@menu$); | |
72 | if (!getequipisequiped(.@part)) { | |
73 | next; | |
74 | mes "Nothing equipped in that slot."; | |
75 | close; | |
76 | } | |
77 | if (!getequipisenableref(.@part)) { | |
78 | next; | |
79 | mes "This item is not refineable."; | |
80 | close; | |
81 | } | |
82 | if (!getequipisidentify(.@part)) { | |
83 | next; | |
84 | mes "This has not been identified. Please identify it before attempting to refine."; | |
85 | - | if (.@part == 1) { set .@reflvl, 256; } |
85 | + | |
86 | - | if (.@part == 2) { set .@reflvl, 16; } |
86 | + | |
87 | - | if (.@part == 3) { set .@reflvl, 2; } |
87 | + | |
88 | - | if (.@part == 4) { set .@reflvl, 32; } |
88 | + | |
89 | - | if (.@part == 5) { set .@reflvl, 4; } |
89 | + | |
90 | - | if (.@part == 6) { set .@reflvl, 64; } |
90 | + | |
91 | - | if (.@part == 7) { set .@reflvl, 8; } |
91 | + | |
92 | - | if (.@part == 8) { set .@reflvl, 128; } |
92 | + | |
93 | - | if (.@part == 9) { set .@reflvl, 512; } |
93 | + | |
94 | - | if (.@part == 10) { set .@reflvl, 1; } |
94 | + | set .@tlevel, (.@id - .ts0); |
95 | - | set .@tlevel, (.@id - 32100); |
95 | + | |
96 | if (getequiprefinerycnt(.@part) > 0) { | |
97 | if (.@currefine == .@tlevel) { | |
98 | - | if (.@currefine == .@tlevel) { mes "You cannot use this stone on your "+getequipname(.@part)+"."; mes "Current equipment's refinement is equal to the stone's power."; close;} |
98 | + | mes "You cannot use this stone on your "+getequipname(.@part)+"."; |
99 | - | if (.@currefine > .@tlevel) { mes "You cannot use this stone on your "+getequipname(.@part)+"."; mes "Current equipment's refinement is higher than the stone's power."; close;} |
99 | + | mes "Current equipment's refinement is equal to the stone's power."; |
100 | close; | |
101 | } | |
102 | - | atcommand "@refine "+.@reflvl+" "+(.@tlevel - .@currefine); |
102 | + | if (.@currefine > .@tlevel) { |
103 | mes "You cannot use this stone on your "+getequipname(.@part)+"."; | |
104 | mes "Current equipment's refinement is higher than the stone's power."; | |
105 | - | |
105 | + | |
106 | } | |
107 | if (.@currefine < .@tlevel) { | |
108 | delitem .@id, 1; | |
109 | - | atcommand "@refine "+.@reflvl+" "+.@tlevel+""; |
109 | + | set .@r, 1; |
110 | set .@diff, .@tlevel - .@currefine; | |
111 | - | |
111 | + | while(.@r <= .@diff) { |
112 | - | |
112 | + | successrefitem .@part; |
113 | set .@r, .@r + 1; | |
114 | - | return; |
114 | + | |
115 | close; | |
116 | } | |
117 | } | |
118 | if (getequiprefinerycnt(.@part) == 0) { | |
119 | delitem .@id, 1; | |
120 | set .@r, 1; | |
121 | while(.@r <= .@tlevel) { | |
122 | successrefitem .@part; | |
123 | set .@r, .@r + 1; | |
124 | } | |
125 | close; | |
126 | } | |
127 | } | |
128 | } |