Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.84 KB | None | 0 0
  1. // Update Log
  2. // - Removing Long menu string in script, increase readability
  3. // - Moving or merged first check on Enchantment function
  4. // - Recoded Enchantment function from looping entire inventory to 8 item intended
  5. // - Changing @menu variable generated from select or promt script command to npc variable
  6.  
  7. prontera,192,168,5 script Khawl'El#spec 619,{
  8. mes "^0000FF[Khawl'El]^000000";
  9. mes "Greetings and salutations!";
  10. mes "How may I help you?";
  11.  
  12. .@menu$[0] = "^777777-^000000 Trade ^0000FFSpectral Fragments^000000";
  13. .@menu$[1] = "^777777-^000000 Forge ^0000FFEnchantment Gems^000000";
  14. .@menu$[2] = "^777777-^000000 Purify ^0000FFEmperium^000000";
  15. .@idx = select(implode(.@menu$, ":"));
  16. switch(.@idx){
  17. case 1:
  18. mes "Very well.";
  19. close2;
  20.  
  21. callshop "SpecShop",1;
  22. break;
  23. case 2:
  24. clear;
  25. mes "^0000FF[Khawl'El]^000000";
  26. mes "Which ^0000FFGem^000000 you wish to forge?";
  27.  
  28. .@menu2$[0] = "^777777-^000000 Forge ^7e9466Dragon Gem";
  29. .@menu2$[1] = "^777777-^000000 Forge ^8a77acOx Gem";
  30. .@menu2$[2] = "^777777-^000000 Forge ^cb6266Phoenix Gem";
  31. .@menu2$[3] = "^777777-^000000 Forge ^8088a0Tiger Gem";
  32. .@idx2 = select(implode(.@menu2$, ":"));
  33.  
  34. next;
  35. mes "^0000FF[Khawl'El]^000000";
  36. mes "To forge a " + getitemname(.Gems[.@idx2]) + " you'll need 5 ^0000FFSpectral Fragment^000000 and 100 of ^0000FF" + getitemname(.Forge[.@idx2]) + "^000000.";
  37.  
  38. if (countitem(.Forge[.@idx2]) < 100 || countitem(42108) < 5){
  39. mes "I'll be waiting you to gather all required items.";
  40. close;
  41. }
  42.  
  43. select( "^777777-^000000 Forge " + .Colors$[.@idx2] + getitemname(.Gems[.@idx2]) );
  44.  
  45. delitem .Forge[.@idx2], 100;
  46. delitem 42108, 5;
  47.  
  48. specialeffect2 154;
  49.  
  50. getitem .Gems[.@idx2], 1;
  51. announce "[ Khawl'El ] : " + strcharinfo(0) + " just forged a " + replacestr(getitemname(.Gems[.@idx2]), " Enchantment", " Gem") + " !",bc_all,0x9cbedc;
  52.  
  53. mes "Come anytime";
  54. close;
  55.  
  56. case 3:
  57. clear;
  58. mes "^0000FF[Khawl'El]^000000";
  59. mes "For this proccess, you'll need at least 10 ^0000FFEmperiums^000000 and, there's only ^0000FF20^000000% chance of actually find any ^0000FFSpectral Fragment^000000.";
  60.  
  61. if (countitem(714) < 10){
  62. mes "I'll be waiting you to gather all required items.";
  63. close;
  64. }
  65.  
  66. while (countitem(714) >= 10){
  67. select( "^777777-^000000 Purify ^0000FFEmperium^000000 (^0000FF" + countitem(714) + "^000000)" );
  68.  
  69. delitem 714, 10;
  70. if (rand(1,5) == 1){
  71. specialeffect2 154;
  72. mes "Nice luck, young one!";
  73. getitem 42108,1;
  74. set .@frag, .@frag + 1;
  75. } else {
  76. specialeffect2 155;
  77. mes "Better luck next time!";
  78. }
  79. }
  80. if (.@frag) announce "[ Khawl'El ] : " + strcharinfo(0) + " had success on purifying " + .@frag + " Spectral Fragments from Emperiums !",bc_all,0x9cbedc;
  81. close;
  82. }
  83. end;
  84.  
  85. OnInit:
  86. setarray .Gems[1], 42201, 42202, 42203, 42204;
  87. setarray .Colors$[1], "^7e9466", "^8a77ac", "^cb6266", "^8088a0";
  88. setarray .Forge[1], 996, 997, 994, 995;
  89. end;
  90. }
  91.  
  92. - itemshop SpecShop -1,42108,42105:40,42106:35,42107:30,42101:25,42104:25,42102:20,42103:20
  93.  
  94. function script SpectralGem {
  95. getinventorylist;
  96. .@menu$ = "";
  97. for (.@i = 42101; .@i < 42108; .@i++) {
  98. .@idx = inarray(@inventorylist_id, .@i);
  99. if (.@idx == -1) continue;
  100. if (.@i != @inventorylist_id[.@idx]) {
  101. message strcharinfo(0), "Error!! Someting went wrong, notify Administrator. E0!";
  102. end;
  103. }
  104. .@j++;
  105. .@it_id[.@j] = .@i;
  106. .@it_ref[.@j] = @inventorylist_refine[.@idx];
  107. .@it_iden[.@j] = @inventorylist_identify[.@idx];
  108. .@it_attr[.@j] = @inventorylist_attribute[.@idx];
  109. .@it_card1[.@j] = @inventorylist_card1[.@idx];
  110. .@it_card2[.@j] = @inventorylist_card2[.@idx];
  111. .@it_card3[.@j] = @inventorylist_card3[.@idx];
  112. .@it_card4[.@j] = @inventorylist_card4[.@idx];
  113.  
  114. .@string$ = "^999999-^000000 Enchant ^0000FF";
  115. .@string$ = .@string$ + ((.@it_ref[.@j]) ? "+"+ .@it_ref[.@j] : "");
  116. .@string$ = .@string$ + ((.@it_card4[.@j])? "["+ getitemname(.@it_card4[.@j]) +"] " : "");
  117. .@string$ = .@string$ + getitemname(.@it_id[.@j]);
  118. if (.@it_card1[.@j])
  119. .@string$ = .@string$ + " ["+ replacestr(getitemname(.@it_card1[.@j]), " Card", "") +"]";
  120. else if (getitemslots(.@it_id[.@j]))
  121. .@string$ = .@string$ + " [" + getitemslots(.@it_id[.@j]) + "]";
  122. .@menu$ = .@menu$ + .@string$ + ":";
  123. }
  124.  
  125. if (!.@j) {
  126. dispbottom "You have no Spectral Set piece to Enchant!",0xFF0000;
  127. end;
  128. }
  129.  
  130. .@idx = select(.@menu$);
  131.  
  132. .@way = getarg(0, 1) * 10;
  133. delitem 42200 + (.@way/10), 1;
  134. specialeffect2 getarg(1, 593);
  135. delitem2 .@it_id[.@idx2], 1, .@it_iden[.@idx2], .@it_ref[.@idx2], 0, .@it_card1[.@idx2],0,0,.@it_card4[.@idx2];
  136. getitem2 (.@it_id[.@idx2] + .@way), 1, 1, .@it_ref[.@idx2], 0, .@it_card1[@menu], 0, 0, 42108 + .@way;
  137. end;
  138. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement