cupet.txt 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. //===== rAthena Script =======================================
  2. //= Cute Pet Manager
  3. //===== By: ==================================================
  4. //= Z3R0
  5. //===== Current Version: =====================================
  6. //= 1.1
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= [Official Conversion]
  11. //= Exchanges Hunted Items for Tames
  12. //===== Additional Comments: =================================
  13. //= 1.0 First / Optimized Version
  14. //= 1.1 Little clean-up & added a delitem. [Capuche]
  15. //============================================================
  16. // 1st NPC
  17. - script CPM1 -1,{
  18. set .@npc$, "[Cute Pet Manager]";
  19. setarray .@tame_id[0],619,620,622,623,624,627,628,629,630;
  20. setarray .@tame_amount[0],3,3,3,3,3,3,3,3,3;
  21. setarray .@hunt_id[0],909,909,705,916,935,919,919,940,921;
  22. setarray .@hunt_amount[0],500,600,500,500,500,500,600,500,500;
  23. setarray .@mob_id[0],1002,1113,1063,1049,1011,1167,1107,1052,1014;
  24. set .@tame_gets, 3;
  25. if (cpm_one == .@tame_gets) {
  26. mes "[Cute Pet Manager]";
  27. mes "You have already exchanged";
  28. mes .@tame_amount + " times for a taming item.";
  29. mes "You can't exchange anymore.";
  30. next;
  31. mes "[Cute Pet Manager]";
  32. mes "Besides me, there are other";
  33. mes "Cute Pet Managers. If you want";
  34. mes "to tame other pets, I suggest";
  35. mes "you go and see them.";
  36. close;
  37. }
  38. callfunc "cute_pet_manager",.@tame_id,.@tame_amount,.@hunt_id,.@hunt_amount,.@mob_id,cpm_one,.@tame_gets,.@hunt_id2,.@hunt_amount2;
  39. }
  40. // 2nd NPC
  41. - script CPM2 -1,{
  42. set .@npc$, "[Cute Pet Manager]";
  43. setarray .@tame_id[0],621,625,632,631,633,634,635,636,659,637,639,640;
  44. setarray .@tame_amount[0],2,2,2,2,2,2,2,2,2,2,2,2;
  45. setarray .@hunt_id[0],938,935,925,7033,945,942,931,901,1094,1021,936,1035;
  46. setarray .@hunt_amount[0],500,600,500,300,500,500,500,500,500,500,500,500;
  47. setarray .@mob_id[0],1031,1042,1019,1077,1056,1057,1023,1026,1188,1110,1029;
  48. set .@tame_gets, 2;
  49. if (cpm_two == .@tame_gets) {
  50. mes "[Cute Pet Manager]";
  51. mes "You have already exchanged";
  52. mes .@tame_amount + " times for a taming item.";
  53. mes "You can't exchange anymore.";
  54. next;
  55. mes "[Cute Pet Manager]";
  56. mes "Besides me, there are other";
  57. mes "Cute Pet Managers. If you want";
  58. mes "to tame other pets, I suggest";
  59. mes "you go and see them.";
  60. close;
  61. }
  62. callfunc "cute_pet_manager",.@tame_id,.@tame_amount,.@hunt_id,.@hunt_amount,.@mob_id,cpm_two,.@tame_gets,.@hunt_id2,.@hunt_amount2;
  63. }
  64. // 3rd NPC
  65. - script CPM3 -1,{
  66. set .@npc$, "[Cute Pet Manager]";
  67. setarray .@tame_id[0],638,626,641,661,660,642;
  68. setarray .@tame_amount[0],1,1,1,1,1,1;
  69. setarray .@hunt_id[0],1020,943,1038,7047,1970,923;
  70. setarray .@hunt_amount[0],600,600,600,500,1,100;
  71. setarray .@hunt_id2[0],0,0,0,0,7017,0;
  72. setarray .@hunt_amount2[0],0,0,0,0,20,0;
  73. setarray .@mob_id[0],1170,1035,1109,1275,1200,1101;
  74. set .@tame_gets, 1;
  75. if (cpm_three == .@tame_gets) {
  76. mes "[Cute Pet Manager]";
  77. mes "You have already exchanged";
  78. mes .@tame_amount + " times for a taming item.";
  79. mes "You can't exchange anymore.";
  80. next;
  81. mes "[Cute Pet Manager]";
  82. mes "Besides me, there are other";
  83. mes "Cute Pet Managers. If you want";
  84. mes "to tame other pets, I suggest";
  85. mes "you go and see them.";
  86. close;
  87. }
  88. callfunc "cute_pet_manager",.@tame_id,.@tame_amount,.@hunt_id,.@hunt_amount,.@mob_id,cpm_three,.@tame_gets,.@hunt_id2,.@hunt_amount2;
  89. }
  90. function script cute_pet_manager {
  91. // getarg(0) -> .@tame_id Array
  92. // getarg(1) -> .@tame_amount Array
  93. // getarg(2) -> .@hunt_id Array
  94. // getarg(3) -> .@hunt_amount Array
  95. // getarg(4) -> .@mob_id Array
  96. // getarg(5) -> Attempt Variable
  97. // getarg(6) -> .@tame_gets Variable
  98. // getarg(7) -> .@hunt_id2 Array
  99. // getarg(8) -> .@hunt_amount2 Array
  100. mes "[Cute Pet Manager]";
  101. mes "Hello~! I am a Cute Pet Manager";
  102. mes "who is in charge of public relations";
  103. mes "for the New Upgraded Cute Pet system.";
  104. next;
  105. mes "[Cute Pet Manager]";
  106. mes "If you have any concerns regarding";
  107. mes "the Cute Pet system I am here to guide you.";
  108. mes "Let me know which taming";
  109. mes "item you want,";
  110. mes "then I will tell you the monster";
  111. mes "that you can tame with the item.";
  112. next;
  113. mes "[Cute Pet Manager]";
  114. mes "Also I will explain what materials";
  115. mes "you need to bring in order to";
  116. mes "get the taming item.";
  117. next;
  118. mes "[Cute Pet Manager]";
  119. mes "If you already brought materials";
  120. mes "to exchange for the taming item,";
  121. mes "I can exchange it for taming items immediately.";
  122. next;
  123. mes "[Cute Pet Manager]";
  124. mes "However, there is a limit";
  125. mes "for exchanging taming items.";
  126. mes "You can only get taming items";
  127. mes getarg(6) + " times. So please make sure";
  128. mes "how many times you have exchanged.";
  129. next;
  130. mes "[Cute Pet Manager]";
  131. mes "So, which taming item do you want?";
  132. mes "Please choose one from the list.";
  133. next;
  134. // Create Menu System
  135. set .@size, getarraysize(getarg(0));
  136. for (set .@a, 0; .@a < .@size; set .@a, .@a + 1)
  137. set .@menu$, .@menu$ + (.@menu$ == "" ? "" : ":") + getitemname(getelementofarray(getarg(0), .@a));
  138. // Query Player Choice
  139. set .@choice, select(.@menu$) - 1;
  140. // Store Variables (Less Lookup)
  141. set .@tame_id, getelementofarray(getarg(0), .@choice);
  142. set .@tame_amount, getelementofarray(getarg(1), .@choice);
  143. set .@hunt_id, getelementofarray(getarg(2), .@choice);
  144. set .@hunt_amount, getelementofarray(getarg(3), .@choice);
  145. set .@mob_id, getelementofarray(getarg(4), .@choice);
  146. set .@hunt_id2, getelementofarray(getarg(7), .@choice);
  147. set .@hunt_amount2, getelementofarray(getarg(8), .@choice);
  148. // dispbottom "Tame ID: " + .@tame_id;
  149. // dispbottom "Tame Amount: " + .@tame_amount;
  150. // dispbottom "Hunt ID: " + .@hunt_id;
  151. // dispbottom "Hunt Name: " + getitemname(.@hunt_id);
  152. // dispbottom "Hunt Amount: " + .@hunt_amount;
  153. // dispbottom "Mob ID: " + .@mob_id;
  154. if (.@hunt_id2) {
  155. // dispbottom "Hunt ID2: " + .@hunt_id2;
  156. // dispbottom "Hunt Amount2: " + .@hunt_amount2;
  157. set .@hunt2_count, countitem(.@hunt_id2);
  158. }
  159. if (countitem(.@hunt_id) >= .@hunt_amount && countitem(6083) > 0 && .@hunt2_count >= .@hunt_amount2) {
  160. mes "[Cute Pet Manager]";
  161. mes "Ah, you have gathered all items";
  162. mes "with your friends. You can now";
  163. mes "exchange for an " + getitemname(.@tame_id) + ".";
  164. mes "Do you want to exchange with me?";
  165. next;
  166. if (select("Exchange:Don't Exchange") == 2) {
  167. mes "[Cute Pet Manager]";
  168. mes "You don't? You will come back again.";
  169. close;
  170. }
  171. delitem .@hunt_id, .@hunt_amount;
  172. delitem 6083, 1;
  173. if (.@hunt_id2)
  174. delitem .@hunt_id2, .@hunt_amount2;
  175. set getarg(5), getarg(5) + 1;
  176. getitem .@tame_id, .@tame_amount;
  177. mes "[Cute Pet Manager]";
  178. mes "Wise choice.";
  179. mes "I hope you and your pet get along.";
  180. close;
  181. } else {
  182. mes "[Cute Pet Manager]";
  183. mes "You have chosen " + getitemname(.@tame_id) + ".";
  184. mes "You can use it for taming";
  185. mes "^FF0000" + getmonsterinfo(.@mob_id, MOB_NAME) + "^000000 monsters.";
  186. next;
  187. mes "[Cute Pet Manager]";
  188. mes "Bring ^FF0000" + .@hunt_amount + " " + getitemname(.@hunt_id) + "^000000" + (.@hunt_id2 ? ", ^FF0000" + .@hunt_amount2 + " " + getitemname(.@hunt_id2) : "") + " ^000000 and ^FF00001 Dolly Capsule^000000";
  189. mes "then you can exchange them";
  190. mes "for an " + getitemname(.@tame_id) + ".";
  191. close;
  192. }
  193. }
  194. // NPC Duplicates
  195. prontera,67,212,5 duplicate(CPM1) Cute Pet Manager#1 4_M_ALCHE_C
  196. prontera,242,92,3 duplicate(CPM2) Cute Pet Manager#2 4_M_ALCHE_C
  197. prontera,179,92,3 duplicate(CPM3) Cute Pet Manager#3 4_M_ALCHE_C
  198. geffen,180,125,5 duplicate(CPM1) Cute Pet Manager#4 4_M_ALCHE_C
  199. geffen,152,66,3 duplicate(CPM2) Cute Pet Manager#5 4_M_ALCHE_C
  200. geffen,197,95,3 duplicate(CPM3) Cute Pet Manager#6 4_M_ALCHE_C
  201. morocc,115,83,5 duplicate(CPM1) Cute Pet Manager#7 4_M_ALCHE_C
  202. morocc,218,130,3 duplicate(CPM2) Cute Pet Manager#8 4_M_ALCHE_C
  203. morocc,236,225,3 duplicate(CPM3) Cute Pet Manager#9 4_M_ALCHE_C
  204. payon,109,278,5 duplicate(CPM1) Cute Pet Manager#10 4_M_ALCHE_C
  205. payon,157,124,3 duplicate(CPM2) Cute Pet Manager#11 4_M_ALCHE_C
  206. payon,85,237,3 duplicate(CPM3) Cute Pet Manager#12 4_M_ALCHE_C