CashShop_Functions.txt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  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 a 3x3 location around the leader.
  50. // - No arguments.
  51. function script F_CashPartyCall {
  52. warp "Random",0,0;
  53. if (is_party_leader() == true)
  54. warpparty "Leader", 0, 0, getcharid(1), strcharinfo(3), 3, 3;
  55. return;
  56. }
  57. // Neuralizer
  58. //============================================================
  59. // - Reset players skills. Weight must be 0, options must be off.
  60. // - No arguments.
  61. function script F_CashReset {
  62. if (Class != Job_Novice && Weight == 0 && !checkriding() && !checkfalcon() && !checkcart() && !ismounting() && !checkdragon()) {
  63. resetskill;
  64. sc_end SC_ALL;
  65. if (countitem(12213)) delitem 12213,1;
  66. }
  67. return;
  68. }
  69. // Dungeon Teleport Scroll
  70. //============================================================
  71. // - Warp player to the selected dungeon.
  72. // - Arg(0) = type of scroll.
  73. function script F_CashDungeon {
  74. switch(getarg(0)) {
  75. case 1:
  76. 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")) {
  77. case 1: warp "mag_dun01",125,71; end; // Nogg Road
  78. case 2: warp "mjo_dun02",80,297; end; // Mjolnir Dead Pit
  79. case 3: warp "um_dun02",125,122; end; // Umbala Dungeon (Pre-Renewal only)
  80. case 4: warp "ein_dun01",261,262; end; // Einbroch Dungeon
  81. case 5: warp "pay_dun03",155,150; end; // Payon Caves
  82. case 6: warp "xmas_dun01",133,130; end; // Toy Factory
  83. case 7: warp "gl_prison",140,15; end; // Glast Heim Prison
  84. case 8: warp "lou_dun03",165,38; end; // Louyang Dungeon
  85. case 9: warp "gon_dun02",251,263; end; // Kunlun Dungeon
  86. case 10: warp "iz_dun02",350,335; end; // Izlude Undersea Tunnel
  87. case 11: warp "tur_dun02",165,30; end; // Turtle Island
  88. case 12: warp "alde_dun03",275,180; end; // Clocktower 3F
  89. case 13: warp "c_tower3",34,42; end; // Clocktower B3F
  90. case 14: warp "gl_sew02",292,295; end; // Glast Heim Sewers 2F
  91. case 15: warp "in_sphinx4",120,120; end; // Sphinx Dungeon 4F
  92. case 16: warp "moc_pryd04",195,4; end; // Pyramid Dungeon 4F
  93. case 17: warp "prt_sewb3",20,175; end; // Prontera Culverts 3F
  94. case 18: warp "ama_dun01",222,144; end; // Amatsu Dungeon 1F
  95. case 19: warp "lhz_dun01",19,153; end; // Somatology Laboratory 1F
  96. case 20: warp "ayo_dun02",70,240; end; // Ayotaya Dungeon 2F
  97. }
  98. case 2: // Menu names are not official.
  99. 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")) {
  100. case 1: warp "thor_v02",77,208; end; // Thor Volcano 2F
  101. case 2: warp "ra_fild01",237,333; end; // Ice Dungeon
  102. case 3: warp "ve_fild07",127,131; end; // Nameless Island
  103. case 4: warp "niflheim",206,179; end; // Niflheim
  104. case 5: warp "prt_maze02",100,174; end; // Labyrinth Forest F2
  105. case 6: warp "jupe_cave",36,54; end; // Juperos
  106. case 7: warp "anthell02",36,265; end; // Ant Hell F2
  107. case 8: warp "yuno_fild08",70,171; end; // Kiel Hyre's Academy
  108. case 9: warp "hu_fild01",140,160; end; // Thanatos Tower
  109. case 10: warp "hu_fild05",168,302; end; // Abyss Lake
  110. case 11: warp "ra_temple",117,173; end; // Rachel Sanctuary
  111. case 12: warp "odin_tem02",257,374; end; // Odin Temple F2
  112. }
  113. case 3:
  114. 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)")) {
  115. case 1: warp "lhz_dun02",145,149; end; // Somatology Laboratory 2F
  116. case 2: warp "ice_dun03",150,176; end; // Ice Dungeon 3F
  117. case 3: warp "odin_tem03",278,235; end; // Odin Temple 3F
  118. case 4: warp "thor_v03",144,170; end; // Thor Volcano 3F
  119. case 5: warp "abyss_03",97,104; end; // Abyss Lakes 3F
  120. case 6: warp "juperos_02",130,159; end; // Juperos Dungeon 2F
  121. }
  122. }
  123. return;
  124. }
  125. // Coloured Butterly Wings
  126. //============================================================
  127. // - Warp player to different cities acording to the scroll.
  128. // - Arg(0) = type of scroll.
  129. function script F_CashCity {
  130. switch(getarg(0)) {
  131. case 1: // Yellow - Rune-Midgart
  132. switch(select("Prontera:Izlude:Geffen:Payon:Morroc:Alberta:Al de Baran")) {
  133. case 1: warp "prontera",122,87; end;
  134. case 2: if (checkre(0)) warp "izlude",130,90; else warp "izlude",91,105; end;
  135. case 3: warp "geffen",128,48; end;
  136. case 4: warp "payon",164,123; end;
  137. case 5: warp "morocc",160,100; end;
  138. case 6: warp "alberta",117,50; end;
  139. case 7: warp "aldebaran",140,110; end;
  140. }
  141. case 2: // Green - Schwartzvalt
  142. switch(select("Juno:Lighthalzen:Einbroch:Einbech:Hugel")) {
  143. case 1: warp "yuno",160,170; end;
  144. case 2: warp "lighthalzen",190,310; end;
  145. case 3: warp "einbroch",230,190; end;
  146. case 4: warp "einbech",187,120; end;
  147. case 5: warp "hugel",92,165; end;
  148. }
  149. case 3: // Red - Arunafeltz
  150. switch(select("Rachel:Veins")) {
  151. case 1: warp "rachel",120,125; end;
  152. case 2: warp "veins",215,105; end;
  153. }
  154. case 4: // Blue - Islands
  155. switch(select("Amatsu:Kunlun:Ayotaya:Louyang")) {
  156. case 1: warp "amatsu",110,140; end;
  157. case 2: warp "gonryun",160,115; end;
  158. case 3: warp "ayothaya",220,170; end;
  159. case 4: warp "louyang",217,95; end;
  160. }
  161. case 5: // Blue - Islands (Renewal)
  162. switch(select("Amatsu:Kunlun:Ayotaya:Louyang:Moscovia:Dewata:Brasilis")) {
  163. case 1: warp "amatsu",110,140; end;
  164. case 2: warp "gonryun",160,115; end;
  165. case 3: warp "ayothaya",220,170; end;
  166. case 4: warp "louyang",217,95; end;
  167. case 5: warp "moscovia",224,195; end;
  168. case 6: warp "dewata",200,107; end;
  169. case 7: warp "brasilis",196,181; end;
  170. }
  171. }
  172. return;
  173. }
  174. // Teleport Scrolls
  175. //============================================================
  176. // - Warp player to save point or city acording to the scroll.
  177. // - Arg(0) = type of scroll.
  178. function script F_CashTele {
  179. switch(getarg(0)) {
  180. case 1:
  181. switch(select("Prontera:Geffen:Al de Baran:Izlude:Savepoint")) {
  182. case 1: warp "prontera",119,77; end;
  183. case 2: warp "geffen",119,39; end;
  184. case 3: warp "aldebaran",165,107; end;
  185. case 4: if (checkre(0)) warp "izlude",128,105; else warp "izlude",91,105; end;
  186. case 5: warp "SavePoint",0,0; end;
  187. }
  188. case 2:
  189. switch(select("Payon:Alberta:Morroc:Comodo:Savepoint")) {
  190. case 1: warp "payon",158,55; end;
  191. case 2: warp "alberta",115,57; end;
  192. case 3: warp "morocc",158,48; end;
  193. case 4: warp "comodo",217,148; end;
  194. case 5: warp "SavePoint",0,0; end;
  195. }
  196. case 3:
  197. switch(select("Louyang:Amatsu:Kunlun Field:Ayothaya:Savepoint")) {
  198. case 1: warp "louyang",214,101; end;
  199. case 2: warp "amatsu",112,145; end;
  200. case 3: warp "gonryun",160,118; end;
  201. case 4: warp "ayothaya",216,175; end;
  202. case 5: warp "SavePoint",0,0; end;
  203. }
  204. case 4:
  205. switch(select("Lutie Field:Umbala:Niflheim:Savepoint")) {
  206. case 1: warp "xmas",148,131; end;
  207. case 2: warp "umbala",93,154; end;
  208. case 3: warp "niflheim",187,189; end;
  209. case 4: warp "SavePoint",0,0; end;
  210. }
  211. case 5:
  212. switch(select("Juno:Einbroch:Lighthalzen:Hugel:Savepoint")) {
  213. case 1: warp "yuno",157,124; end;
  214. case 2: warp "einbroch",230,192; end;
  215. case 3: warp "lighthalzen",158,94; end;
  216. case 4: warp "hugel",93,159; end;
  217. case 5: warp "SavePoint",0,0; end;
  218. }
  219. case 6:
  220. switch(select("Rachel:Veins:Savepoint")) {
  221. case 1: warp "rachel",118,132; end;
  222. case 2: warp "veins",214,125; end;
  223. case 3: warp "SavePoint",0,0; end;
  224. }
  225. }
  226. return;
  227. }
  228. // Siege Teleport Scroll
  229. //============================================================
  230. // - Warp player to selected guild castle.
  231. // - No arguments.
  232. function script F_CashSiegeTele {
  233. 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)")) {
  234. case 1: warp "alde_gld",48,91; end;
  235. case 2: warp "alde_gld",103,245; end;
  236. case 3: warp "alde_gld",142,87; end;
  237. case 4: warp "alde_gld",236,243; end;
  238. case 5: warp "alde_gld",269,90; end;
  239. case 6: warp "gef_fild13",217,75; end;
  240. case 7: warp "gef_fild13",307,237; end;
  241. case 8: warp "gef_fild13",77,297; end;
  242. case 9: warp "gef_fild13",190,276; end;
  243. case 10: warp "gef_fild13",312,91; end;
  244. case 11: warp "pay_gld",121,232; end;
  245. case 12: warp "pay_gld",297,116; end;
  246. case 13: warp "pay_gld",318,293; end;
  247. case 14: warp "pay_gld",140,164; end;
  248. case 15: warp "pay_gld",202,264; end;
  249. case 16: warp "prt_gld",141,64; end;
  250. case 17: warp "prt_gld",240,131; end;
  251. case 18: warp "prt_gld",153,133; end;
  252. case 19: warp "prt_gld",126,240; end;
  253. case 20: warp "prt_gld",195,240; end;
  254. }
  255. return;
  256. }
  257. // Curious Snowball
  258. //============================================================
  259. // - You can get an effect of Restore, Endure, or Wing of Butterfly.
  260. // - No arguments.
  261. function script F_Snowball {
  262. cutin "rutie_snownow03",2;
  263. mes "[Snowman]";
  264. mes "Merry Christmas!";
  265. switch(select("Restore Some HP/SP:Strengthen My Body!:Restore My SP Fully.:Return to Savepoint")) {
  266. case 1:
  267. mes "Aha!";
  268. mes "Quiet night~";
  269. percentheal 70,70;
  270. close2;
  271. cutin "",255;
  272. break;
  273. case 2:
  274. mes "Blessings.";
  275. mes "Holy night~";
  276. unitskilluseid getcharid(3),"SM_ENDURE",10;
  277. close2;
  278. cutin "",255;
  279. break;
  280. case 3:
  281. mes "Hey!";
  282. mes "White Christmas~";
  283. percentheal 0,100;
  284. close2;
  285. cutin "",255;
  286. break;
  287. case 4:
  288. mes "Jingle Bells~";
  289. mes "Jingle Bells~ Jingle Bells!";
  290. close2;
  291. cutin "",255;
  292. warp "SavePoint",0,0;
  293. break;
  294. }
  295. end;
  296. }
  297. // Status reduction potion
  298. //============================================================
  299. // - Permanently reduces base stat <type> by <val>.
  300. // - Returns status points equals to points needed to raise
  301. // that stat to original value.
  302. // - Doesn't work if base status <type> would become lower than 1 after reduction.
  303. // * callfunc("F_CashReduceStat",<type>{,<val>,<itemid>});
  304. function script F_CashReduceStat {
  305. .@type = getarg(0);
  306. .@amount = getarg(1, -1);
  307. .@itemid = getarg(2, 0);
  308. if((readparam(.@type) + .@amount) < 1) return;
  309. if(.@itemid) {
  310. if(countitem(.@itemid))
  311. delitem .@itemid,1;
  312. else
  313. return;
  314. }
  315. StatusPoint += needed_status_point(.@type, .@amount);
  316. statusup2 .@type,.@amount;
  317. return;
  318. }