Want more features on Pastebin? Sign Up, it's FREE!
Guest

enchant

By: manabeast on Sep 29th, 2012  |  syntax: None  |  size: 6.20 KB  |  views: 34  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. prt_in,63,58,3  script  Enchanted Smite 743,{
  2. function EquipmentValidation;
  3. function RuneSelect;
  4. function ListEquipment;
  5.  
  6. mes "Which Part you want to enchant ?";
  7. mes "^FF0000Make sure you wear the Equipments^000000";
  8. next;
  9. set .@i,( select( "^0000FFView Equipment Lists^000000",
  10.                                 ( getequipid(EQI_HEAD_TOP) == -1 )?"[TOP] ^FF0000Unavailable^000000":"[TOP] "+getitemname(getequipid(EQI_HEAD_TOP)),
  11.                                 ( getequipid(EQI_ARMOR) == -1 )?"[ARMOR] ^FF0000Unavailable^000000":"[ARMOR] "+getitemname(getequipid(EQI_ARMOR)),
  12.                                 ( getequipid(EQI_HAND_R) == -1 )?"[HAND_R] ^FF0000Unavailable^000000":"[HAND_R] "+getitemname(getequipid(EQI_HAND_R)),
  13.                                 ( getequipid(EQI_GARMENT) == -1 )?"[GARMENT] ^FF0000Unavailable^000000":"[GARMENT] "+getitemname(getequipid(EQI_GARMENT)),
  14.                                 ( getequipid(EQI_SHOES) == -1 )?"[SHOES] ^FF0000Unavailable^000000":"[SHOES] "+getitemname(getequipid(EQI_SHOES))) - 1 );
  15. if( .@i <= 0 ) ListEquipment();
  16. set .@Equip,(( .@i < 3 )?.@i:.@i+1 );
  17. if( getequipid( .@Equip ) == -1 ){
  18.         mes "Sorry make sure you have Item Equipped.";
  19. }else if( !EquipmentValidation( .@Equip ) ){
  20.         mes "Sorry but you cant Enchant the Equipment if it is not Allowed / Named.";
  21. }else if( countitem( getequipid( .@Equip ) ) > 1 ){
  22.         mes "Please make sure you only have 1 x "+getitemname( getequipid( .@Equip ) );
  23. }else{
  24.         mes "Socket you want to Enchant ?";
  25.         set .@Socket,select("Socket 1:Socket 2:Socket 3");
  26.         mes "What type of Attribute you want to Enchant ?";
  27.         set .@Stat,select("STR:INT:DEX:AGI:VIT:LUK");
  28.         set .@CurrentRune,getequipcardid( .@Equip,.@Socket );
  29.         set .@NextRune,RuneSelect( .@CurrentRune,.@Stat );
  30.         if( .@NextRune && EquipmentValidation( .@Equip ) ){
  31.                 if( getequipcardid( .@Equip,0 ) || getequiprefinerycnt( .@Equip ) ){
  32.                         mes "There is Card inside or the Equipment is Refined, the Item will be destroyed if Failed.";
  33.                         if( select("Continue:Cancel") == 2 ) close;
  34.                 }
  35.                 mes "It cost ^FF0000"+.Cost[@Level]+"^000000 Zeny to enchant ^0000FF"+getitemname( getequipid( .@Equip ) )+"^000000 with ^0000FF"+getitemname(.@NextRune)+"^000000 at ^FF0000Socket "+.@Socket+"^000000.";
  36.                 next;
  37.                 if( select("Continue:Cancel") == 2 ) close;
  38.                 setarray .@EQStats[0],getequiprefinerycnt( .@Equip ),getequipcardid( .@Equip,0 ),getequipcardid( .@Equip,1 ),getequipcardid( .@Equip,2 ),getequipcardid( .@Equip,3 );  
  39.                 if( Zeny < .Cost[@Level] ){
  40.                         mes "Sorry you didnt have enough of "+.Cost[@Level]+" Zeny.";
  41.                 }else{
  42.                         set Zeny,Zeny - .Cost[@Level];
  43.                         if( rand(100) < 0 ){
  44.                                 mes "Congratulation, you SUCCESS to enchant the ^0000FF"+getitemname( getequipid( .@Equip ) )+"^000000 with ^0000FF"+getitemname(.@NextRune)+"^000000 at ^FF0000Socket "+.@Socket+"^000000.";
  45.                                 set .@EQID,getequipid( .@Equip );
  46.                                 delitem .@EQID,1;
  47.                                 specialeffect2 154;
  48.                                 getitem2 .@EQID,1,1,.@EQStats[0],0,.@EQStats[1],( ( .@Socket == 1 )?.@NextRune:.@EQStats[2] ),( ( .@Socket == 2 )?.@NextRune:.@EQStats[3] ),( ( .@Socket == 3 )?.@NextRune:.@EQStats[4] );
  49.                         }else{
  50.                                 mes "Sorry, the Process Failed.";
  51.                         }
  52.                 }
  53.         }
  54. }
  55. close;
  56.  
  57. function        EquipmentValidation     {
  58. if( getequipcardid( getarg(0),0 ) == -255 ||
  59.         getequipcardid( getarg(0),0 ) == 254 ||
  60.         getequipcardid( getarg(0),0 ) == 255 )
  61.         return 0;
  62.  
  63.         switch( getarg(0) ){
  64.                 Case 1: copyarray .@EQList[0],.Headgear[0],getarraysize(.Headgear[0]); break;
  65.                 Case 2: copyarray .@EQList[0],.Armor[0],getarraysize(.Armor[0]); break;
  66.                 Case 4: copyarray .@EQList[0],.Shield[0],getarraysize(.Shield[0]); break;
  67.                 Case 5: copyarray .@EQList[0],.Garment[0],getarraysize(.Garment[0]); break;
  68.                 Case 6: copyarray .@EQList[0],.Shoes[0],getarraysize(.Shoes[0]); break;
  69.                 default:
  70.                         mes "ERROR. Wrong Equipment Part Selection ["+getarg(0)+"].";
  71.                         close;
  72.         }
  73. for( set .@i,0; .@i < getarraysize( .@EQList ); set .@i,.@i + 1 )
  74.         if( .@EQList[.@i] == getequipid( getarg(0) ) )
  75.                 return 1;
  76. return 0;
  77. }
  78.  
  79. function        RuneSelect      {
  80.         switch( getarg(1) ){
  81.                 Case 1: setarray .@RuneID[0],4700,4701,4702; break;
  82.                 Case 2: setarray .@RuneID[0],4710,4711,4712; break;
  83.                 Case 3: setarray .@RuneID[0],4720,4721,4722; break;
  84.                 Case 4: setarray .@RuneID[0],4730,4731,4732; break;
  85.                 Case 5: setarray .@RuneID[0],4740,4741,4742; break;
  86.                 Case 6: setarray .@RuneID[0],4750,4751,4752; break;
  87.         }
  88.        
  89.         for( set .@i,0; .@i < getarraysize( .@RuneID ); set .@i,.@i + 1 )
  90.                 if( getarg(0) == .@RuneID[2] ){
  91.                         mes "Sorry you cant enchant this socket anymore.";
  92.                         return 0;
  93.                 }else if( !getarg(0) ){
  94.                         set @Level,.@i;
  95.                         return .@RuneID[.@i];
  96.                 }else if( getarg(0) == .@RuneiD[.@i] ){
  97.                         set @Level,.@i+1;
  98.                         return .@RuneID[.@i+1];
  99.                 }
  100. mes "Please select a RUNE that ^FF0000Same Attribute^000000 you enchanted for this socket before.";
  101. return 0;
  102. }
  103.  
  104. function        ListEquipment   {
  105.         for( set .@i,0; .@i < getarraysize( .Headgear ); set .@i,.@i + 1 )
  106.                 mes "["+.@i+"]   "+getitemname(.Headgear[.@i]);
  107.         next;
  108.         for( set .@i,0; .@i < getarraysize( .Armor ); set .@i,.@i + 1 )
  109.                 mes "["+.@i+"]   "+getitemname(.Armor[.@i]);
  110.         next;
  111.         for( set .@i,0; .@i < getarraysize( .Shield ); set .@i,.@i + 1 )
  112.                 mes "["+.@i+"]   "+getitemname(.Shield[.@i]);
  113.         next;
  114.         for( set .@i,0; .@i < getarraysize( .Garment ); set .@i,.@i + 1 )
  115.                 mes "["+.@i+"]   "+getitemname(.Garment[.@i]);
  116.         next;
  117.         for( set .@i,0; .@i < getarraysize( .Shoes ); set .@i,.@i + 1 )
  118.                 mes "["+.@i+"]   "+getitemname(.Shoes[.@i]);
  119.         close;
  120. }
  121.        
  122.        
  123. OnInit:
  124. // Level Cost
  125. setarray .Cost[0],100000,300000,500000;
  126. // Level Success Rate
  127. setarray .Rate[0],70,20,10;
  128. // Equipment Lists
  129. setarray .Headgear[0],5292,5151,5382,5451,5452,5453,5529,5505,5751,20017,20031,20032,20043,20044,20052,5171;
  130. setarray .Armor[0],15036,15037,15030,15038,15042,15043,15007,15025,15026,15027,15028,2389,2378,15000,2310,2375,2374,2366,2320,2317,2391,2386,2315,2364,2340,2360,2348,2349,2350,2351,2344,2345,2346,2347,2357;
  131. setarray .Shield[0],2153,2145,2116,2138,2131,2115,2134,2104;
  132. setarray .Garment[0],2574,2575,2570,2577,2580,2581,2559,2554,2524,2521,2537,2544,2506,2504,2512,2554,2509;
  133. setarray .Shoes[0],2475,2476,2472,2477,2479,2480,2455,2467,2468,2469,2470,2421,2406,2433,2412,2404,2440,2450;
  134.                
  135. end;
  136. }
  137.  
  138. dicastes01,180,232,5    duplicate(Enchanted Smite)      Enchanted Smite#01      743
  139. gonryun,137,117,5       duplicate(Enchanted Smite)      Enchanted Smite#02      743
  140. prontlegend,201,177,3   duplicate(Enchanted Smite)      Enchanted Smite#03      743
clone this paste RAW Paste Data