CashShop_Functions.txt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. //===== rAthena Script =======================================
  2. //= Cash Shop Functions
  3. //===== By: ==================================================
  4. //= L0ne_W0lf
  5. //===== Current Version: =====================================
  6. //= 1.8
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= Used for Cash shop items:
  11. //= - Kafra Card
  12. //= - Giant Fly Wing
  13. //= - Neuralizer
  14. //= - Dungeon Teleport Scroll
  15. //= Also included are functions related to the VIP system.
  16. //===== Additional Comments: =================================
  17. //= 1.0 First version. [L0ne_W0lf]
  18. //= F_CashPartyCall Optimized by Trancid.
  19. //= 1.1 Updated Dungeon Teleport Scroll. [L0ne_W0lf]
  20. //= Added Town Teleport Scroll Function
  21. //= Added Seige Teleport Scroll Function
  22. //= 1.2 Updated the dungeon teleport scroll menu. [L0ne_w0lf]
  23. //= 1.3 Implemented Aozi Giant Flywing Fix. (bugreport:4242) [L0ne_w0lf]
  24. //= 1.4 Simplified Giant Flywing function using warpparty. [L0ne_w0lf]
  25. //= 1.5 Neuralizer is no longer consumed upon failure. [Euphy]
  26. //= 1.6 Updated Teleport functions and added Curious_Snowball. [Euphy]
  27. //= 1.7 Added Dungeon Teleport Scroll II maps. [Euphy]
  28. //= 1.8 Added VIP function. [Euphy]
  29. //= 1.9 Added checkdragon() in F_CashReset. [Capuche]
  30. //= 2.0 Moved VIP_Third_Class function into other/re/CashShop_Functions. [Capuche]
  31. //============================================================
  32. // Kafra Card
  33. //============================================================
  34. // - Open player's storage.
  35. // - No arguments.
  36. function script F_CashStore {
  37. cutin "kafra_01",2;
  38. mes "[Kafra Employee]";
  39. mes "Welcome to the Kafra Corporation.";
  40. mes "Here, let me open your Storage for you.";
  41. close2;
  42. openstorage;
  43. cutin "",255;
  44. return;
  45. }
  46. // Giant Fly Wing
  47. //============================================================
  48. // - Warp party leader to random spot on the map.
  49. // - Summon Party members on party leader map to that location.
  50. // - No arguments.
  51. function script F_CashPartyCall {
  52. warp "Random",0,0;
  53. if(getpartyleader(getcharid(1),2) == getcharid(0)) {
  54. getmapxy .@mapl$, .@xl, .@yl, UNITTYPE_PC;
  55. warpparty .@mapl$, .@xl, .@yl, getcharid(1), .@mapl$;
  56. }
  57. return;
  58. }
  59. // Neuralizer
  60. //============================================================
  61. // - Reset players skills. Weight must be 0, options must be off.
  62. // - No arguments.
  63. function script F_CashReset {
  64. if (Class != Job_Novice && Weight == 0 && !checkriding() && !checkfalcon() && !checkcart() && !ismounting() && !checkdragon()) {
  65. resetskill;
  66. sc_end SC_ALL;
  67. if (countitem(12213)) delitem 12213,1;
  68. }
  69. return;
  70. }
  71. // Dungeon Teleport Scroll
  72. //============================================================
  73. // - Warp player to the selected dungeon.
  74. // - Arg(0) = type of scroll.
  75. function script F_CashDungeon {
  76. switch(getarg(0)) {
  77. case 1:
  78. switch(select("Nogg Road:Mjolnir Dead Pit:"+((checkre(0))?"":"Umbala Dungeon")+":Einbroch Mine Dungeon:Payon Dungeon:Toy Dungeon:Glast Heim Underprison:Louyang Dungeon:Hermit's Checkers:Izlude Dungeon:Turtle Island Dungeon:Clock Tower B3f:Clock Tower 3f:Glast Heim Culvert 2f:Sphinx Dungeon 4f:Inside Pyramid 4f:Prontera Culvert 3f:Amatsu Dungeon 1f (Tatami Maze):Somatology Laboratory 1st floor:Ayothya Ancient Shrine 2nd floor")) {
  79. case 1: warp "mag_dun01",125,71; end; // Nogg Road
  80. case 2: warp "mjo_dun02",80,297; end; // Mjolnir Dead Pit
  81. case 3: warp "um_dun02",125,122; end; // Umbala Dungeon (Pre-Renewal only)
  82. case 4: warp "ein_dun01",261,262; end; // Einbroch Dungeon
  83. case 5: warp "pay_dun03",155,150; end; // Payon Caves
  84. case 6: warp "xmas_dun01",133,130; end; // Toy Factory
  85. case 7: warp "gl_prison",140,15; end; // Glast Heim Prison
  86. case 8: warp "lou_dun03",165,38; end; // Louyang Dungeon
  87. case 9: warp "gon_dun02",251,263; end; // Kunlun Dungeon
  88. case 10: warp "iz_dun02",350,335; end; // Izlude Undersea Tunnel
  89. case 11: warp "tur_dun02",165,30; end; // Turtle Island
  90. case 12: warp "alde_dun03",275,180; end; // Clocktower 3F
  91. case 13: warp "c_tower3",34,42; end; // Clocktower B3F
  92. case 14: warp "gl_sew02",292,295; end; // Glast Heim Sewers 2F
  93. case 15: warp "in_sphinx4",120,120; end; // Sphinx Dungeon 4F
  94. case 16: warp "moc_pryd04",195,4; end; // Pyramid Dungeon 4F
  95. case 17: warp "prt_sewb3",20,175; end; // Prontera Culverts 3F
  96. case 18: warp "ama_dun01",222,144; end; // Amatsu Dungeon 1F
  97. case 19: warp "lhz_dun01",19,153; end; // Somatology Laboratory 1F
  98. case 20: warp "ayo_dun02",70,240; end; // Ayotaya Dungeon 2F
  99. }
  100. case 2: // Menu names are not official.
  101. switch(select("Thor Volcano 2f:Ice Dungeon Entrance:Nameless Island Entrance:Niflheim:Labyrinth Forest 2f:Ruins of Juperos Entrance:Ant Hell 2f:Kiel Hyre's Academy Entrance:Thanatos Tower Entrance:Abyss Lake Entrance:Rachel Sanctuary Entrance:Odin Temple 2f")) {
  102. case 1: warp "thor_v02",77,208; end; // Thor Volcano 2F
  103. case 2: warp "ra_fild01",237,333; end; // Ice Dungeon
  104. case 3: warp "ve_fild07",127,131; end; // Nameless Island
  105. case 4: warp "niflheim",206,179; end; // Niflheim
  106. case 5: warp "prt_maze02",100,174; end; // Labyrinth Forest F2
  107. case 6: warp "jupe_cave",36,54; end; // Juperos
  108. case 7: warp "anthell02",36,265; end; // Ant Hell F2
  109. case 8: warp "yuno_fild08",70,171; end; // Kiel Hyre's Academy
  110. case 9: warp "hu_fild01",140,160; end; // Thanatos Tower
  111. case 10: warp "hu_fild05",168,302; end; // Abyss Lake
  112. case 11: warp "ra_temple",117,173; end; // Rachel Sanctuary
  113. case 12: warp "odin_tem02",257,374; end; // Odin Temple F2
  114. }
  115. case 3:
  116. switch(select("Bio Lab (2nd Floor):Ice Dungeon (3rd Floor):Odin Temple (3rd Floor):Thor Volcano (3rd Floor):Abyss Lake (3rd Floor):Juperos Ruins (2nd Floor)")) {
  117. case 1: warp "lhz_dun02",145,149; end; // Somatology Laboratory 2F
  118. case 2: warp "ice_dun03",150,176; end; // Ice Dungeon 3F
  119. case 3: warp "odin_tem03",278,235; end; // Odin Temple 3F
  120. case 4: warp "thor_v03",144,170; end; // Thor Volcano 3F
  121. case 5: warp "abyss_03",97,104; end; // Abyss Lakes 3F
  122. case 6: warp "juperos_02",130,159; end; // Juperos Dungeon 2F
  123. }
  124. }
  125. return;
  126. }
  127. // Coloured Butterly Wings
  128. //============================================================
  129. // - Warp player to different cities acording to the scroll.
  130. // - Arg(0) = type of scroll.
  131. function script F_CashCity {
  132. switch(getarg(0)) {
  133. case 1: // Yellow - Rune-Midgart
  134. switch(select("Prontera:Izlude:Geffen:Payon:Morroc:Alberta:Al de Baran")) {
  135. case 1: warp "prontera",122,87; end;
  136. case 2: if (checkre(0)) warp "izlude",130,90; else warp "izlude",91,105; end;
  137. case 3: warp "geffen",128,48; end;
  138. case 4: warp "payon",164,123; end;
  139. case 5: warp "morocc",160,100; end;
  140. case 6: warp "alberta",117,50; end;
  141. case 7: warp "aldebaran",140,110; end;
  142. }
  143. case 2: // Green - Schwartzvalt
  144. switch(select("Juno:Lighthalzen:Einbroch:Einbech:Hugel")) {
  145. case 1: warp "yuno",160,170; end;
  146. case 2: warp "lighthalzen",190,310; end;
  147. case 3: warp "einbroch",230,190; end;
  148. case 4: warp "einbech",187,120; end;
  149. case 5: warp "hugel",92,165; end;
  150. }
  151. case 3: // Red - Arunafeltz
  152. switch(select("Rachel:Veins")) {
  153. case 1: warp "rachel",120,125; end;
  154. case 2: warp "veins",215,105; end;
  155. }
  156. case 4: // Blue - Islands
  157. switch(select("Amatsu:Kunlun:Ayotaya:Louyang")) {
  158. case 1: warp "amatsu",110,140; end;
  159. case 2: warp "gonryun",160,115; end;
  160. case 3: warp "ayothaya",220,170; end;
  161. case 4: warp "louyang",217,95; end;
  162. }
  163. case 5: // Blue - Islands (Renewal)
  164. switch(select("Amatsu:Kunlun:Ayotaya:Louyang:Moscovia:Dewata:Brasilis")) {
  165. case 1: warp "amatsu",110,140; end;
  166. case 2: warp "gonryun",160,115; end;
  167. case 3: warp "ayothaya",220,170; end;
  168. case 4: warp "louyang",217,95; end;
  169. case 5: warp "moscovia",224,195; end;
  170. case 6: warp "dewata",200,107; end;
  171. case 7: warp "brasilis",196,181; end;
  172. }
  173. }
  174. return;
  175. }
  176. // Teleport Scrolls
  177. //============================================================
  178. // - Warp player to save point or city acording to the scroll.
  179. // - Arg(0) = type of scroll.
  180. function script F_CashTele {
  181. switch(getarg(0)) {
  182. case 1:
  183. switch(select("Prontera:Geffen:Al de Baran:Izlude:Savepoint")) {
  184. case 1: warp "prontera",119,77; end;
  185. case 2: warp "geffen",119,39; end;
  186. case 3: warp "aldebaran",165,107; end;
  187. case 4: if (checkre(0)) warp "izlude",128,105; else warp "izlude",91,105; end;
  188. case 5: warp "SavePoint",0,0; end;
  189. }
  190. case 2:
  191. switch(select("Payon:Alberta:Morroc:Comodo:Savepoint")) {
  192. case 1: warp "payon",158,55; end;
  193. case 2: warp "alberta",115,57; end;
  194. case 3: warp "morocc",158,48; end;
  195. case 4: warp "comodo",217,148; end;
  196. case 5: warp "SavePoint",0,0; end;
  197. }
  198. case 3:
  199. switch(select("Louyang:Amatsu:Kunlun Field:Ayothaya:Savepoint")) {
  200. case 1: warp "louyang",214,101; end;
  201. case 2: warp "amatsu",112,145; end;
  202. case 3: warp "gonryun",160,118; end;
  203. case 4: warp "ayothaya",216,175; end;
  204. case 5: warp "SavePoint",0,0; end;
  205. }
  206. case 4:
  207. switch(select("Lutie Field:Umbala:Niflheim:Savepoint")) {
  208. case 1: warp "xmas",148,131; end;
  209. case 2: warp "umbala",93,154; end;
  210. case 3: warp "niflheim",187,189; end;
  211. case 4: warp "SavePoint",0,0; end;
  212. }
  213. case 5:
  214. switch(select("Juno:Einbroch:Lighthalzen:Hugel:Savepoint")) {
  215. case 1: warp "yuno",157,124; end;
  216. case 2: warp "einbroch",230,192; end;
  217. case 3: warp "lighthalzen",158,94; end;
  218. case 4: warp "hugel",93,159; end;
  219. case 5: warp "SavePoint",0,0; end;
  220. }
  221. case 6:
  222. switch(select("Rachel:Veins:Savepoint")) {
  223. case 1: warp "rachel",118,132; end;
  224. case 2: warp "veins",214,125; end;
  225. case 3: warp "SavePoint",0,0; end;
  226. }
  227. }
  228. return;
  229. }
  230. // Siege Teleport Scroll
  231. //============================================================
  232. // - Warp player to selected guild castle.
  233. // - No arguments.
  234. function script F_CashSiegeTele {
  235. switch(select("Neuschwanstein (aldeg_cas01):Hohenschwangau (aldeg_cas02):Nuernberg (aldeg_cas03):Wuerzburg (aldeg_cas04):Rothenburg (aldeg_cas05):Repherion (gefg_cas01):Eeyorbriggar (gefg_cas02):Yesnelph (gefg_cas03):Bergel (gefg_cas04):Mersetzdeitz (gefg_cas05):Bright Arbor (payg_cas01):Sacred Altar (payg_cas02):Holy Shadow (payg_cas03):Scarlet Palace (payg_cas04):Bamboo Grove Hill (payg_cas05):Kriemhild (prtg_cas01):Swanhild (prtg_cas02):Fadhgridh (prtg_cas03):Skoegul (prtg_cas04):Gondul (prtg_cas05)")) {
  236. case 1: warp "alde_gld",48,91; end;
  237. case 2: warp "alde_gld",103,245; end;
  238. case 3: warp "alde_gld",142,87; end;
  239. case 4: warp "alde_gld",236,243; end;
  240. case 5: warp "alde_gld",269,90; end;
  241. case 6: warp "gef_fild13",217,75; end;
  242. case 7: warp "gef_fild13",307,237; end;
  243. case 8: warp "gef_fild13",77,297; end;
  244. case 9: warp "gef_fild13",190,276; end;
  245. case 10: warp "gef_fild13",312,91; end;
  246. case 11: warp "pay_gld",121,232; end;
  247. case 12: warp "pay_gld",297,116; end;
  248. case 13: warp "pay_gld",318,293; end;
  249. case 14: warp "pay_gld",140,164; end;
  250. case 15: warp "pay_gld",202,264; end;
  251. case 16: warp "prt_gld",141,64; end;
  252. case 17: warp "prt_gld",240,131; end;
  253. case 18: warp "prt_gld",153,133; end;
  254. case 19: warp "prt_gld",126,240; end;
  255. case 20: warp "prt_gld",195,240; end;
  256. }
  257. return;
  258. }
  259. // Curious Snowball
  260. //============================================================
  261. // - You can get an effect of Restore, Endure, or Wing of Butterfly.
  262. // - No arguments.
  263. function script F_Snowball {
  264. cutin "rutie_snownow03",2;
  265. mes "[Snowman]";
  266. mes "Merry Christmas!";
  267. switch(select("Restore Some HP/SP:Strengthen My Body!:Restore My SP Fully.:Return to Savepoint")) {
  268. case 1:
  269. mes "Aha!";
  270. mes "Quiet night~";
  271. percentheal 70,70;
  272. close2;
  273. cutin "",255;
  274. break;
  275. case 2:
  276. mes "Blessings.";
  277. mes "Holy night~";
  278. unitskilluseid getcharid(3),"SM_ENDURE",10;
  279. close2;
  280. cutin "",255;
  281. break;
  282. case 3:
  283. mes "Hey!";
  284. mes "White Christmas~";
  285. percentheal 0,100;
  286. close2;
  287. cutin "",255;
  288. break;
  289. case 4:
  290. mes "Jingle Bells~";
  291. mes "Jingle Bells~ Jingle Bells!";
  292. close2;
  293. cutin "",255;
  294. warp "SavePoint",0,0;
  295. break;
  296. }
  297. end;
  298. }
  299. // Status reduction potion
  300. //============================================================
  301. // - Permanently reduces base stat <type> by <val>.
  302. // - Returns status points equals to points needed to raise
  303. // that stat to original value.
  304. // - Doesn't work if base status <type> would become lower than 1 after reduction.
  305. // * callfunc("F_CashReduceStat",<type>{,<val>,<itemid>});
  306. function script F_CashReduceStat {
  307. .@type = getarg(0);
  308. .@amount = getarg(1, -1);
  309. .@itemid = getarg(2, 0);
  310. if((readparam(.@type) + .@amount) < 1) return;
  311. if(.@itemid) {
  312. if(countitem(.@itemid))
  313. delitem .@itemid,1;
  314. else
  315. return;
  316. }
  317. StatusPoint += needed_status_point(.@type, .@amount);
  318. statusup2 .@type,.@amount;
  319. return;
  320. }