Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function script AMRA {
- set .@id, getarg(0);
- if (.@id == 32100) {
- if (countitem(.@id) > 2) {
- set .@del, ((countitem(.@id)/3)*3);
- getitem (1 + .@id), (countitem(.@id)/3);
- delitem .@id, .@del;
- }
- end;
- }
- if (.@id >= 32101 && .@id <= 32109) {
- 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) {
- callfunc "AMRACOMB",.@id;
- }
- }
- if (.@id == 32110) {
- prompt "Apply to Equipment";
- if (@menu == 1) {
- callfunc "AMRACOMB",.@id;
- }
- }
- }//END
- function script AMRACOMB {
- set .@id, getarg(0);
- mes "Select what you wish to refine.";
- mes " ";
- mes "You can refine an item up to +"+(.@id - 32100)+" 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) {
- if (.@part == 1) { set .@reflvl, 256; }
- if (.@part == 2) { set .@reflvl, 16; }
- if (.@part == 3) { set .@reflvl, 2; }
- if (.@part == 4) { set .@reflvl, 32; }
- if (.@part == 5) { set .@reflvl, 4; }
- if (.@part == 6) { set .@reflvl, 64; }
- if (.@part == 7) { set .@reflvl, 8; }
- if (.@part == 8) { set .@reflvl, 128; }
- if (.@part == 9) { set .@reflvl, 512; }
- if (.@part == 10) { set .@reflvl, 1; }
- set .@tlevel, (.@id - 32100);
- 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;
- atcommand "@refine "+.@reflvl+" "+(.@tlevel - .@currefine);
- close;
- }
- }
- if (getequiprefinerycnt(.@part) == 0) {
- delitem .@id, 1;
- atcommand "@refine "+.@reflvl+" "+.@tlevel+"";
- }
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement