item_signer.txt 4.3 KB

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