SHOW:
|
|
- or go back to the newest paste.
1 | //================================================================ | |
2 | // Tier Stone Refining ( Up to +10 ver) | |
3 | // Written By Angst, equipment menu snippet taken from refiner.txt. | |
4 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
5 | // Using 'Catalyst' items, in this case Enhancement Stone; requires the | |
6 | // player to have at least 10 in inventory to get the full chance to refine. | |
7 | // Support Stone prevents item breaking should the refinement process fail. | |
8 | // | |
9 | // 'Tier Stone' 1-4 + 'Enhancement Stone' x10 = 100% | |
10 | // 'Tier Stone' 5-6 + 'Enhancement Stone' x10 = 95% | |
11 | // 'Tier Stone' 7-8 + 'Enhancement Stone' x10 = 85% | |
12 | // 'Tier Stone' 9-10 + 'Enhancement Stone' x10 = 75% | |
13 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
14 | - | // v1.2 |
14 | + | // v1.3 |
15 | // | |
16 | // Item Db2 Inserts: | |
17 | // If you change the id' of these then be sure to change them in the Settings below, too. | |
18 | // | |
19 | //32098,Support_Stone,Support Stone,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{},{},{} | |
20 | //32099,Enhancement_Stone,Enhancement Stone,11,,,,,,,,0xFFFFFFFF,7,2,,,,,,{},{},{} | |
21 | //================================================================ | |
22 | ||
23 | ||
24 | function script AMRA { | |
25 | //------ SETTINGS --------------------------------------------------------------------- | |
26 | // Enhancement Stone Item_ID | |
27 | set .enstid, 32099; | |
28 | ||
29 | // Support Stone Item_ID | |
30 | set .sustid, 32098; | |
31 | ||
32 | //Tier Stone ID's 1-10 | |
33 | set .ts0, 32100; | |
34 | set .ts1, 32101; | |
35 | set .ts2, 32102; | |
36 | set .ts3, 32103; | |
37 | set .ts4, 32104; | |
38 | set .ts5, 32105; | |
39 | set .ts6, 32106; | |
40 | set .ts7, 32107; | |
41 | set .ts8, 32108; | |
42 | set .ts9, 32109; | |
43 | set .ts10, 32110; | |
44 | //============================================================ | |
45 | set .@id, getarg(0); | |
46 | if (.@id == .ts0) { | |
47 | if (countitem(.@id) > 2) { | |
48 | set .@del, ((countitem(.@id)/3)*3); | |
49 | getitem (1 + .@id), (countitem(.@id)/3); | |
50 | delitem .@id, .@del; | |
51 | } | |
52 | end; | |
53 | } | |
54 | if (.@id >= .ts1 && .@id <= .ts9) { | |
55 | prompt "Merge 3 "+getitemname(.@id)+"'s","Apply "+getitemname(.@id)+" to Equipment"; | |
56 | if (@menu == 1) { | |
57 | if (countitem(.@id) == 2) { | |
58 | message strcharinfo(0), "Merge Failed: "+(3 - countitem(.@id))+" more "+getitemname(.@id)+" is needed to merge."; | |
59 | close; | |
60 | } | |
61 | if (countitem(.@id) == 1) { | |
62 | message strcharinfo(0), "Merge Failed: "+(3 - countitem(.@id))+" more "+getitemname(.@id)+"'s are needed to merge."; | |
63 | close; | |
64 | } else { | |
65 | set .@del, ((countitem(.@id)/3)*3); | |
66 | getitem (1 + .@id), (countitem(.@id)/3); | |
67 | delitem .@id, .@del; | |
68 | if (countitem(.@id) == 1) dispbottom "One "+getitemname(.@id)+" could not merge."; | |
69 | if (countitem(.@id) == 2) dispbottom "Two "+getitemname(.@id)+"'s could not merge."; | |
70 | } | |
71 | close; | |
72 | } | |
73 | if (@menu == 2) goto AMRACOMB; | |
74 | if (@menu == 255) close; | |
75 | } | |
76 | if (.@id == .ts10) { | |
77 | prompt "Apply to Equipment"; | |
78 | if (@menu == 1) goto AMRACOMB; | |
79 | } | |
80 | AMRACOMB: | |
81 | set .@id, getarg(0); | |
82 | mes "Select what you wish to refine."; | |
83 | mes " "; | |
84 | mes "You can refine an item up to +"+(.@id - .ts0)+" using this stone."; | |
85 | setarray .@position$[1], "Head (Upper)","Armor","Left hand","Right hand","Robe","Shoes","Accessory (Left)","Accessory (Right)","Head (Mid)","Head (Lower)"; | |
86 | set .@menu$,""; | |
87 | for (set .@i, 1; .@i <= 10; set .@i, .@i + 1) { | |
88 | if (getequipisequiped(.@i)) | |
89 | if (getequiprefinerycnt(.@i) > 0) { | |
90 | set .@menu$, .@menu$ + .@position$[.@i] + " - " + "[+" + getequiprefinerycnt(.@i) + " " + getequipname(.@i) + " [" + getitemslots(.@i) + "] ]"; | |
91 | } else { | |
92 | set .@menu$, .@menu$ + .@position$[.@i] + " - " + "[" + getequipname(.@i) + " [" + getitemslots(.@i) + "] ]"; | |
93 | } | |
94 | set .@menu$, .@menu$ + ":"; | |
95 | } | |
96 | set .@part, select(.@menu$); | |
97 | if (!getequipisequiped(.@part)) { | |
98 | next; | |
99 | mes "Nothing equipped in that slot."; | |
100 | close; | |
101 | } | |
102 | if (!getequipisenableref(.@part)) { | |
103 | next; | |
104 | mes "This item is not refineable."; | |
105 | close; | |
106 | } | |
107 | if (!getequipisidentify(.@part)) { | |
108 | next; | |
109 | mes "This has not been identified. Please identify it before attempting to refine."; | |
110 | close; | |
111 | } | |
112 | if (getequiprefinerycnt(.@part) >= 10) { | |
113 | next; | |
114 | mes "Max level reached, the process has failed."; | |
115 | close; | |
116 | } | |
117 | close2; | |
118 | if (.@id >= 1) { | |
119 | set .@tlevel, (.@id - .ts0); | |
120 | set .@currefine, getequiprefinerycnt(.@part); | |
121 | if (getequiprefinerycnt(.@part) > 0) { | |
122 | if (.@currefine == .@tlevel) { | |
123 | mes "You cannot use this stone on your " + getequipname(.@part) + "."; | |
124 | mes "Current equipment's refinement is equal to the stone's power."; | |
125 | close; | |
126 | } | |
127 | if (.@currefine > .@tlevel) { | |
128 | mes "You cannot use this stone on your " + getequipname(.@part) + "."; | |
129 | mes "Current equipment's refinement is higher than the stone's power."; | |
130 | close; | |
131 | } | |
132 | if (.@currefine < .@tlevel) { | |
133 | set .@sust, (countitem(.sustid) > 0 ? 1 : 0); | |
134 | switch(.@id) { | |
135 | case 32101: case 32102: case 32103: case 32104: | |
136 | set .@rate, 10; break; | |
137 | case 32105: case 32106: set .@rate, 9; break; | |
138 | case 32107: case 32108: set .@rate, 8; break; | |
139 | case 32109: case 32110: set .@rate, 7; break; | |
140 | } | |
141 | set .@p, (countitem(.enstid) >= 10) ? (10 * .@rate) + 5 >= rand(100) : (countitem(.enstid) * .@rate) + 5 >= rand(100); | |
142 | if (.@p == 1) { | |
143 | - | delitem .@id, 1; |
143 | + | |
144 | if (.@id > .ts4) { | |
145 | delitem .enstid, (countitem(.enstid) >= 10 ? 10 : countitem(.enstid)); | |
146 | - | set .@r, 1; |
146 | + | |
147 | - | set .@diff, .@tlevel - .@currefine; |
147 | + | |
148 | - | while(.@r <= .@diff) { |
148 | + | set .@r, 1; |
149 | - | successrefitem .@part; |
149 | + | set .@diff, .@tlevel - .@currefine; |
150 | - | set .@r, .@r + 1; |
150 | + | while(.@r <= .@diff) { |
151 | - | } |
151 | + | successrefitem .@part; |
152 | set .@r, .@r + 1; | |
153 | } | |
154 | close; | |
155 | } | |
156 | if (.@p == 0) { | |
157 | mes "Sorry, the merging failed."; | |
158 | delitem .@id, 1; | |
159 | delitem .enstid, (countitem(.enstid) >= 10 ? 10 : countitem(.enstid)); | |
160 | delitem .sustid, (.@sust == 1 ? 1 : 0); | |
161 | if(.@sust == 0) { | |
162 | failedrefitem .@part; | |
163 | } | |
164 | close; | |
165 | } | |
166 | } | |
167 | } | |
168 | - | delitem .enstid, (countitem(.enstid) >= 10 ? 10 : countitem(.enstid)); |
168 | + | |
169 | - | delitem .sustid, (.@sust == 1 ? 1 : 0); |
169 | + | |
170 | if (.@id > .ts4) { | |
171 | delitem .enstid, (countitem(.enstid) >= 10 ? 10 : countitem(.enstid)); | |
172 | delitem .sustid, (.@sust == 1 ? 1 : 0); | |
173 | } | |
174 | set .@r, 1; | |
175 | while(.@r <= .@tlevel) { | |
176 | successrefitem .@part; | |
177 | set .@r, .@r + 1; | |
178 | } | |
179 | } | |
180 | } | |
181 | } |