yuhsing

Untitled

Aug 21st, 2013
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.56 KB | None | 0 0
  1.  
  2.  
  3. - script enchanter -1,{
  4. OnInit:
  5. // Zeny cost for enchant
  6. .enchant_cost = 250000;
  7.  
  8. // Armor that available for enchant
  9. setarray .equipment_1_id,2301;
  10. // Garment that available for enchant
  11. setarray .equipment_2_id,2503,2504;
  12. // Shoes that available for enchant
  13. setarray .equipment_3_id,2403;
  14. // Accesory that available for enchant
  15. setarray .equipment_4_id,2601;
  16. // chams that will be enchant into an armor
  17. setarray .charm_id,
  18. 4700,4701,4702,4703,4704,4705,4706,4707,4708,4709, // STR 1 ~ 10
  19. 4710,4711,4712,4713,4714,4715,4716,4717,4718,4719, // INT 1 ~ 10
  20. 4720,4721,4722,4723,4724,4725,4726,4727,4728,4729, // DEX 1 ~ 10
  21. 4730,4731,4732,4733,4734,4735,4736,4737,4738,4739, // AGI 1 ~ 10
  22. 4740,4741,4742,4743,4744,4745,4746,4747,4748,4749, // VIT 1 ~ 10
  23. 4750,4751,4752,4753,4754,4755,4756,4757,4758,4759; // LUK 1 ~ 10
  24.  
  25. // Success Rate for each charm base on array above ( charm_id )
  26. // first time enchant success rate for charm enchant
  27. setarray .rate_1,
  28. 100,90,80,70,60,50,40,30,20,10,
  29. 100,90,80,70,60,50,40,30,20,10,
  30. 100,90,80,70,60,50,40,30,20,10,
  31. 100,90,80,70,60,50,40,30,20,10,
  32. 100,90,80,70,60,50,40,30,20,10,
  33. 100,90,80,70,60,50,40,30,20,10;
  34. // second time enchant success rate for charm enchant
  35. setarray .rate_2,
  36. 100,90,80,70,60,50,40,30,20,10,
  37. 100,90,80,70,60,50,40,30,20,10,
  38. 100,90,80,70,60,50,40,30,20,10,
  39. 100,90,80,70,60,50,40,30,20,10,
  40. 100,90,80,70,60,50,40,30,20,10,
  41. 100,90,80,70,60,50,40,30,20,10;
  42. // third time enchant success rate for charm enchant
  43. setarray .rate_3,
  44. 100,90,80,70,60,50,40,30,20,10,
  45. 100,90,80,70,60,50,40,30,20,10,
  46. 100,90,80,70,60,50,40,30,20,10,
  47. 100,90,80,70,60,50,40,30,20,10,
  48. 100,90,80,70,60,50,40,30,20,10,
  49. 100,90,80,70,60,50,40,30,20,10;
  50.  
  51. setarray .equipment_name$,
  52. "Armor",
  53. "Garment",
  54. "Shoes",
  55. "Accessory";
  56.  
  57. // --- DONT EDIT ---
  58.  
  59. setarray .equipment_size,
  60. getarraysize( .equipment_1_id ),
  61. getarraysize( .equipment_2_id ),
  62. getarraysize( .equipment_3_id ),
  63. getarraysize( .equipment_4_id );
  64. .charm_size = getarraysize( .charm_id );
  65. .equipment_name_size = getarraysize( .equipment_name$ );
  66. while( .@category < .equipment_name_size ){
  67. if( .equipment_size[.@category] ){
  68. .@equip = 0;
  69. while( .@equip < .equipment_size[.@category] ){
  70. .@item_id = getd( ".equipment_"+( .@category + 1 )+"_id["+.@equip+"]" );
  71. if( getitemname( .@item_id ) != "null" ){
  72. .@slot = getitemslots( .@item_id );
  73. .@addtomenu$ = getitemname( .@item_id ) + ( ( .@slot )?" ["+.@slot+"]":"" );
  74.  
  75. }
  76. setd( ".equipment_"+.@category+"_menu$" ),( getd( ".equipment_"+.@category+"_menu$" ) + .@addtomenu$ + ":" );
  77. .@addtomenu$ = "";
  78. .@equip++;
  79. }
  80. .category_menu$ = .category_menu$ + .equipment_name$[.@category];
  81. }
  82. .category_menu$ = .category_menu$ + ":";
  83. .@category++;
  84. }
  85. end;
  86.  
  87. OnWhisperGlobal:
  88. if( getgmlevel() >= 90 ){
  89. dispbottom "=== CHARM LIST + 1st / 2nd / 3rd SUCCESS RATE ===";
  90. while( .@i < .charm_size ){
  91. dispbottom "Charm ID : "+.charm_id[.@i]+" | "+.rate_1[.@i]+"% | "+.rate_2[.@i]+"% | "+.rate_3[.@i]+"% | Name : "+getitemname( .charm_id[.@i] );
  92. .@i++;
  93. }
  94. dispbottom "====================== END ======================";
  95. }
  96. end;
  97.  
  98. OnTalk:
  99. mes "Please select which equipment category..";
  100. .@category = select( .category_menu$ ) - 1;
  101. mes "Select desired ^0055FF"+.equipment_name$[.@category]+"^000000.";
  102. .@equipment = select( getd( ".equipment_"+.@category+"_menu$" ) ) - 1;
  103. .@equipment_id = getd( ".equipment_"+( .@category + 1 )+"_id["+.@equipment+"]" );
  104. if( !isequipped( .@equipment_id ) ){
  105. mes "You're not equipped with a "+getitemname( .@equipment_id );
  106. }else{
  107. for( .@i = 1; .@i <= 14; .@i++ )
  108. if( getequipid( .@i ) == .@equipment_id ){
  109. .@equipment_part = .@i;
  110. break;
  111. }
  112. if( !.@equipment_part ){
  113. mes "Didnt found "+getitemname( .@equipment_id )+" in your equipment window.";
  114. }else{
  115. for( .@i = 1; .@i <= 3; .@i++ )
  116. if( !getequipcardid( .@equipment_part,.@i ) ){
  117. .@enchant_slot = .@i;
  118. // break;
  119. }
  120. if( !.@enchant_slot ){
  121. mes "You can didnt have any available slot to enchant for this "+getitemname( .@equipment_id )+".";
  122. }else{
  123. next;
  124. .@refine = getequiprefinerycnt( .@equipment_part );
  125. for( .@i = 0; .@i < 4; .@i++ )
  126. .@compounded_item[.@i] = getequipcardid( .@equipment_part,.@i );
  127. .@charm_index = rand( .charm_size );
  128. .@compounded_item[.@enchant_slot] = .charm_id[ .@charm_index ];
  129. .@success_rate = getd( ".rate_"+.@enchant_slot+"["+.@charm_index+"]" );
  130. mes "Equipment : ";
  131. mes "^777777 ~ "+(( .@refine )?"+"+.@refine:"" )+" "+getitemname( .@equipment_id )+"["+getitemslots( .@equipment_id )+"]^000000";
  132. // mes "Charm : ^777777"+getitemname( .@compounded_item[.@enchant_slot] )+"^000000";
  133. mes "Success Rate : ^777777"+.@success_rate+"%^000000";
  134. mes "Cost : ^777777"+.enchant_cost+" z^000000";
  135. mes " ";
  136. if( Zeny >= .enchant_cost ){
  137. if( select( "Continue","Close" ) == 1 ){
  138. delequip .@equipment_part;
  139. if( rand( 100 ) <= .@success_rate ){
  140. specialeffect EF_REFINEOK;
  141. mes "^0055FFSuccess to enchant a new charm.^000000";
  142. getitem2 .@equipment_id,1,1,.@refine,0,.@compounded_item[0],.@compounded_item[1],.@compounded_item[2],.@compounded_item[3];
  143. }else{
  144. specialeffect EF_REFINEFAIL;
  145. mes "^FF0000Sorry failed..item destroyed.^000000";
  146. }
  147. }
  148. }
  149. }
  150. }
  151. }
  152. close;
  153. }
  154.  
  155.  
  156.  
  157. prontera,155,181,5 script Enchanter#1 757,{
  158. doevent "enchanter::OnTalk";
  159. }
  160.  
  161.  
  162. prontera,155,171,5 duplicate(Enchanter#1) Enchanter#2 757
  163. prontera,155,172,5 duplicate(Enchanter#1) Enchanter#3 757
  164. prontera,155,173,5 duplicate(Enchanter#1) Enchanter#4 757
Advertisement
Add Comment
Please, Sign In to add comment