Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function script AMRA {
- //Tier Stone ID's 1-10
- set .ts0, 32100;
- set .ts1, 32101;
- set .ts2, 32102;
- set .ts3, 32103;
- set .ts4, 32104;
- set .ts5, 32105;
- set .ts6, 32106;
- set .ts7, 32107;
- set .ts8, 32108;
- set .ts9, 32109;
- set .ts10, 32110;
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- set .@id, getarg(0);
- if (.@id == .ts0) {
- if (countitem(.@id) > 2) {
- set .@del, ((countitem(.@id)/3)*3);
- getitem (1 + .@id), (countitem(.@id)/3);
- delitem .@id, .@del;
- }
- end;
- }
- if (.@id >= .ts1 && .@id <= .ts9) {
- prompt "Merge 3 "+getitemname(.@id)+"'s","Apply "+getitemname(.@id)+" to Equipment.";
- if (@menu == 1) {
- if (countitem(.@id) == 2) {
- message strcharinfo(0), "Merge Failed: "+(3 - countitem(.@id))+" more "+getitemname(.@id)+" is needed to merge.";
- close;
- }
- if (countitem(.@id) == 1) {
- message strcharinfo(0), "Merge Failed: "+(3 - countitem(.@id))+" more "+getitemname(.@id)+"'s are needed to merge.";
- close;
- } else {
- set .@del, ((countitem(.@id)/3)*3);
- getitem (1 + .@id), (countitem(.@id)/3);
- delitem .@id, .@del;
- if (countitem(.@id) == 1) {
- dispbottom "One "+getitemname(.@id)+" could not merge.";
- }
- if (countitem(.@id) == 2) {
- dispbottom "Two "+getitemname(.@id)+"'s could not merge.";
- }
- }
- close;
- }
- if (@menu == 2) goto AMRACOMB;
- if (@menu == 255) close;
- }
- if (.@id == .ts10) {
- prompt "Apply "+getitemname(.@id)+" to Equipment.";
- if (@menu == 1) goto AMRACOMB;
- }
- AMRACOMB:
- set .@id, getarg(0);
- mes "Select what you wish to refine.";
- mes " ";
- mes "You can refine an item up to +"+(.@id - .ts0)+" using this stone.";
- setarray .@position$[1], "Head (Upper)","Armor","Left hand","Right hand","Robe","Shoes","Accessory (Left)","Accessory (Right)","Head (Mid)","Head (Lower)";
- set .@menu$,"";
- for (set .@i, 1; .@i <= 10; set .@i, .@i + 1) {
- if (getequipisequiped(.@i))
- if (getequiprefinerycnt(.@i) > 0) {
- set .@menu$, .@menu$ + .@position$[.@i] + " - " + "[+" + getequiprefinerycnt(.@i) + " " + getequipname(.@i) + "]";
- } else {
- set .@menu$, .@menu$ + .@position$[.@i] + " - " + "[" + getequipname(.@i) + "]";
- }
- set .@menu$, .@menu$ + ":";
- }
- set .@part, select(.@menu$);
- if (!getequipisequiped(.@part)) {
- next;
- mes "Nothing equipped in that slot.";
- close;
- }
- if (!getequipisenableref(.@part)) {
- next;
- mes "This item is not refineable.";
- close;
- }
- if (!getequipisidentify(.@part)) {
- next;
- mes "This has not been identified. Please identify it before attempting to refine.";
- close;
- }
- if (getequiprefinerycnt(.@part) >= 10) {
- next;
- mes "Max level reached, the process has failed.";
- close;
- }
- close2;
- if (.@id >= 1) {
- set .@tlevel, (.@id - .ts0);
- set .@currefine, getequiprefinerycnt(.@part);
- if (getequiprefinerycnt(.@part) > 0) {
- 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;
- }
- 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;
- }
- if (.@currefine < .@tlevel) {
- delitem .@id, 1;
- set .@r, 1;
- set .@diff, .@tlevel - .@currefine;
- while(.@r <= .@diff) {
- successrefitem .@part;
- set .@r, .@r + 1;
- }
- close;
- }
- }
- if (getequiprefinerycnt(.@part) == 0) {
- delitem .@id, 1;
- set .@r, 1;
- while(.@r <= .@tlevel) {
- successrefitem .@part;
- set .@r, .@r + 1;
- }
- close;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement