Advertisement
Angst

TStone [+10]

Dec 10th, 2011
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.62 KB | None | 0 0
  1. function    script  AMRA    {
  2.     set .@id, getarg(0);
  3.     if (.@id == 32100) {
  4.         if (countitem(.@id) > 2) {
  5.             set .@del, ((countitem(.@id)/3)*3);
  6.             getitem (1 + .@id), (countitem(.@id)/3);
  7.             delitem .@id, .@del;
  8.         }
  9.         end;
  10.     }
  11.     if (.@id >= 32101 && .@id <= 32109) {
  12.         prompt "Merge 3 "+getitemname(.@id)+"'s","Apply "+getitemname(.@id)+" to Equipment";
  13.         if (@menu == 1) {
  14.             if (countitem(.@id) == 2) {
  15.                 message strcharinfo(0), "Merge Failed: "+(3 - countitem(.@id))+" more "+getitemname(.@id)+" is needed to merge.";
  16.                 close;
  17.             }
  18.             if (countitem(.@id) == 1) {
  19.                 message strcharinfo(0), "Merge Failed: "+(3 - countitem(.@id))+" more "+getitemname(.@id)+"'s are needed to merge.";
  20.                 close;
  21.             } else {
  22.                 set .@del, ((countitem(.@id)/3)*3);
  23.                 getitem (1 + .@id), (countitem(.@id)/3);
  24.                 delitem .@id, .@del;
  25.                 if (countitem(.@id) == 1) {
  26.                     dispbottom "One "+getitemname(.@id)+" could not merge.";
  27.                 }
  28.                 if (countitem(.@id) == 2) {
  29.                     dispbottom "Two "+getitemname(.@id)+"'s could not merge.";
  30.                 }
  31.             }
  32.             close;
  33.         }
  34.         if (@menu == 2) {
  35.             callfunc "AMRACOMB",.@id;
  36.         }
  37.     }
  38.     if (.@id == 32110) {
  39.         prompt "Apply to Equipment";
  40.         if (@menu == 1) {
  41.             callfunc "AMRACOMB",.@id;
  42.         }
  43.     }
  44. }//END
  45.  
  46. function    script  AMRACOMB    {
  47.     set .@id, getarg(0);
  48.     mes "Select what you wish to refine.";
  49.     mes " ";
  50.     mes "You can refine an item up to +"+(.@id - 32100)+" using this stone.";
  51.     setarray .@position$[1], "Head (Upper)","Armor","Left hand","Right hand","Robe","Shoes","Accessory (Left)","Accessory (Right)","Head (Mid)","Head (Lower)";
  52.     set .@menu$,"";
  53.     for (set .@i, 1; .@i <= 10; set .@i, .@i + 1) {
  54.         if (getequipisequiped(.@i))
  55.             if (getequiprefinerycnt(.@i) > 0) {
  56.                 set .@menu$, .@menu$ + .@position$[.@i] + " - " + "[+" + getequiprefinerycnt(.@i) + " " + getequipname(.@i) + "]";
  57.             } else {
  58.                 set .@menu$, .@menu$ + .@position$[.@i] + " - " + "[" + getequipname(.@i) + "]";
  59.             }
  60.         set .@menu$, .@menu$ + ":";
  61.     }
  62.     set .@part, select(.@menu$);
  63.     if (!getequipisequiped(.@part)) {
  64.         next;
  65.         mes "Nothing equipped in that slot.";
  66.         close;
  67.     }
  68.     if (!getequipisenableref(.@part)) {
  69.         next;
  70.         mes "This item is not refineable.";
  71.         close;
  72.     }
  73.     if (!getequipisidentify(.@part)) {
  74.         next;
  75.         mes "This has not been identified. Please identify it before attempting to refine.";
  76.         close;
  77.     }
  78.     if (getequiprefinerycnt(.@part) >= 10) {
  79.         next;
  80.         mes "Max level reached, the process has failed.";
  81.         close;
  82.     }
  83. close2;
  84.     if (.@id >= 1) {
  85.         if (.@part == 1) { set .@reflvl, 256; }
  86.         if (.@part == 2) { set .@reflvl, 16; }
  87.         if (.@part == 3) { set .@reflvl, 2; }
  88.         if (.@part == 4) { set .@reflvl, 32; }
  89.         if (.@part == 5) { set .@reflvl, 4; }
  90.         if (.@part == 6) { set .@reflvl, 64; }
  91.         if (.@part == 7) { set .@reflvl, 8; }
  92.         if (.@part == 8) { set .@reflvl, 128; }
  93.         if (.@part == 9) { set .@reflvl, 512; }
  94.         if (.@part == 10) { set .@reflvl, 1; }
  95.         set .@tlevel, (.@id - 32100);
  96.         set .@currefine, getequiprefinerycnt(.@part);
  97.         if (getequiprefinerycnt(.@part) > 0) {
  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;}
  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;}
  100.             if (.@currefine < .@tlevel) {
  101.                 delitem .@id, 1;
  102.                 atcommand "@refine "+.@reflvl+" "+(.@tlevel - .@currefine);
  103.                 close;
  104.             }
  105.  
  106.         }
  107.         if (getequiprefinerycnt(.@part) == 0) {
  108.             delitem .@id, 1;
  109.             atcommand "@refine "+.@reflvl+" "+.@tlevel+"";
  110.         }
  111.  
  112.  
  113.     }
  114. return;
  115. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement