item_signer.txt 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. //===== rAthena Script =======================================
  2. //= Sign Your Items
  3. //===== By: ==================================================
  4. //= Lupus
  5. //===== Current Version: =====================================
  6. //= 1.1
  7. //===== Compatible With: =====================================
  8. //= rAthena SVN
  9. //===== Description: =========================================
  10. //= Write you name on your rare equipment or weapon ^_-
  11. //===== Additional Comments: =================================
  12. //= 1.1 Cleaned and edited for general use. [Euphy]
  13. //============================================================
  14. prt_in,24,61,7 script Perchik 47,{
  15. setarray .@Item[0],644,3; // Item requirements: <ID>,<Count>{,...} (0 to disable)
  16. setarray .@Cost[0],0,5000; // Zeny requirements: <base price>,<price per refine>
  17. mes "[Perchik]";
  18. mes "I can ^0055FFsign your name^000000 on almost any rare item you hold.";
  19. next;
  20. if(select("Tell me more...:Sign my items, please!") == 1) {
  21. mes "[Perchik]";
  22. mes "I can put your name on any slotless equipment or weapon.";
  23. emotion e_ic;
  24. next;
  25. mes "[Perchik]";
  26. if (getarraysize(.@Item) || getarraysize(.@Cost)) {
  27. mes "For my work I accept:";
  28. if (getarraysize(.@Item)) for(set .@i,0; .@i<getarraysize(.@Item); set .@i,.@i+2)
  29. mes " ~ "+.@Item[.@i+1]+"x "+getitemname(.@Item[.@i]);
  30. if (.@Cost[0]) mes " ~ "+.@Cost[0]+" Zeny";
  31. if (.@Cost[1]) mes " ~ "+.@Cost[1]+" Zeny per refine";
  32. }
  33. else mes "I work for free, but...";
  34. next;
  35. emotion e_cry;
  36. mes "[Perchik]";
  37. mes "Alas, I have 12 hungry children";
  38. mes "and a very angry wife.";
  39. next;
  40. mes "[Perchik]";
  41. mes "Or it was 12 angry children";
  42. mes "and a very hungry wife...";
  43. emotion e_hmm;
  44. close;
  45. }
  46. mes "[Perchik]";
  47. mes "Show me your items to sign...";
  48. next;
  49. setarray .@pos$[1],"Upper Headgear","Armor","Left hand","Right hand","Garment","Footgear","Left Accessory","Right Accessory","Mid Headgear","Lower Headgear";
  50. set .@menu$,"";
  51. for (set .@i,1; .@i<=10; set .@i,.@i+1) {
  52. if (getequipisequiped(.@i))
  53. set .@menu$, .@menu$+.@pos$[.@i]+" [^0055FF"+getequipname(.@i)+"^000000]";
  54. set .@menu$, .@menu$+":";
  55. }
  56. set .@part, select(.@menu$);
  57. set .@id, getequipid(.@part);
  58. set .@ref, getequiprefinerycnt(.@part);
  59. mes "[Perchik]";
  60. if (!getequipisequiped(.@part)) {
  61. mes "Nothing is equipped there!";
  62. emotion e_wah;
  63. close;
  64. }
  65. for(set .@i,0; .@i<4; set .@i,.@i+1)
  66. set .@slot[.@i], getequipcardid(.@part,.@i);
  67. if (.@slot[0]==255 || .@slot[0]==254 || .@slot[0]<0) {
  68. mes "Alas, this item's already signed.";
  69. mes "I would never touch a master's work.";
  70. emotion e_hmm;
  71. close;
  72. }
  73. if (.@slot[0]>4000 && .@slot[0]<5000) {
  74. mes "A card? Here?!";
  75. mes "As I said before, I don't sign items with cards.";
  76. emotion e_hmm;
  77. close;
  78. }
  79. if (getiteminfo(.@id,10)) {
  80. mes "Sorry, I don't sign slotted items.";
  81. emotion e_sry;
  82. close;
  83. }
  84. getinventorylist;
  85. for(set .@i,0; .@i<@inventorylist_count; set .@i,.@i+1)
  86. if (@inventorylist_expire[.@i] != 0) {
  87. mes "Sorry, I don't sign rental items!";
  88. emotion e_hmm;
  89. close;
  90. }
  91. set .@price, .@Cost[0]+(.@Cost[1]*.@ref);
  92. if (getarraysize(.@Item) || .@price) {
  93. mes "I will need:";
  94. if (getarraysize(.@Item)) for(set .@i,0; .@i<getarraysize(.@Item); set .@i,.@i+2) {
  95. mes " ~ "+.@Item[.@i+1]+"x "+getitemname(.@Item[.@i]);
  96. if (countitem(.@Item[.@i]) < .@Item[.@i+1]) set .@nr,1;
  97. }
  98. if (.@price) mes " ~ "+.@price+" Zeny";
  99. }
  100. mes "Shall I sign your ^0055FF"+getitemname(.@id)+"^000000?";
  101. next;
  102. if(select("Ok!:Leave")==2) {
  103. mes "[Perchik]";
  104. mes "See you...";
  105. emotion e_yawn;
  106. close;
  107. }
  108. mes "[Perchik]";
  109. if (Zeny < .@price || .@nr) {
  110. mes "I don't work for 'thanks'.";
  111. emotion e_sry;
  112. close;
  113. }
  114. if (!countitem2(.@id,1,.@ref,0,.@slot[0],.@slot[1],.@slot[2],.@slot[3])) {
  115. mes "Where is "+getitemname(@id)+"...?";
  116. npctalk "You're a snoozy cheater!";
  117. logmes "CHEATER: Tried to sign an item not having it: "+getitemname(@id);
  118. emotion e_wah;
  119. close;
  120. }
  121. if (.@price) set Zeny, Zeny-.@price;
  122. if (getarraysize(.@Item)) for(set .@i,0; .@i<getarraysize(.@Item); set .@i,.@i+2)
  123. delitem .@Item[.@i], .@Item[.@i+1];
  124. delitem2 .@id,1,1,.@ref,0,.@slot[0],.@slot[1],.@slot[2],.@slot[3];
  125. mes "Done!";
  126. emotion e_proud;
  127. getitem2 .@id,1,1,.@ref,0,254,0,getcharid(0)&0xffff,(getcharid(0)>>16)&0xffff;
  128. equip .@id;
  129. close;
  130. }