pvp.txt 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. //===== rAthena Script =======================================
  2. //= PvP NPCs
  3. //===== By: ==================================================
  4. //= kobra_k88; L0ne_W0lf, Elias (og2)
  5. //===== Current Version: =====================================
  6. //= 2.5
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= PvP NPCs that are found in the Inns in major cities.
  11. //= Includes Yoyo Mode, Nightmare Mode, and Event Mode.
  12. //===== Additional Comments: =================================
  13. //= 2.0 Narrators/GateKeepers,etc. Translated from the Official 2011 [Elias]
  14. //= 2.1 Changed PVP Narrator and GateKeeper to Floating NPC [Elias]
  15. //= 2.2 Some cleaning. [Euphy]
  16. //= 2.3 Fixed grammatical errors. [Joseph]
  17. //= 2.4 Fixed incorrect use of 'close' and some cleaning. [Joseph]
  18. //= 2.5 Renewal/Pre-Renewal split. [Euphy]
  19. //============================================================
  20. // Information
  21. //============================================================
  22. - script PVP Narrator::pvpe -1,{
  23. mes "[PVP Narrator]";
  24. mes "Hello and welcome!";
  25. mes "I am in charge of";
  26. mes "explaining the PVP Modes.";
  27. mes "I am the PVP Narrator!";
  28. next;
  29. switch(select("What is PVP?:What are the PVP Modes?:What are the rules for PVP?:Save Position.:End Dialog.")) {
  30. case 1:
  31. mes "[PVP Narrator]";
  32. mes "In short, PVP means";
  33. mes "' Player VS Player Mode '";
  34. mes "It's a unique place for people";
  35. mes "to duel with each other.";
  36. next;
  37. mes "[PVP Narrator]";
  38. mes "Just tell the";
  39. mes "^3355FFGate Keeper^000000";
  40. mes "that you want to try. He will";
  41. mes "let you enter the PVP square.";
  42. next;
  43. mes "[PVP Narrator]";
  44. mes "But, you need to be at";
  45. mes "least level 31. And you";
  46. mes "must pay 500 zeny entrance fee in order";
  47. mes "to enter a PVP fight square.";
  48. break;
  49. case 2:
  50. mes "[PVP Narrator]";
  51. mes "When you are qualified, you";
  52. mes "can choose one of the two modes.";
  53. mes "Yoyo Mode or Nightmare Mode.";
  54. next;
  55. mes "[PVP Narrator]";
  56. mes "Yoyo Mode is risk free.";
  57. mes "You can experience PVP";
  58. mes "without any restriction or";
  59. mes "punishment. It is recommended";
  60. mes "that you practice your skills";
  61. mes "here before you move on.";
  62. next;
  63. mes "[PVP Narrator]";
  64. mes "Nightmare Mode is very";
  65. mes "dangerous! Please be cautious,";
  66. mes "you will lose some of your";
  67. mes "EXP when you are defeated. And";
  68. mes "there is a small chance that";
  69. mes "you will drop some equipment.";
  70. next;
  71. mes "[PVP Narrator]";
  72. mes "However, if you win, the";
  73. mes "rewards can be great!";
  74. mes "To avoid misunderstanding,";
  75. mes "you should think twice";
  76. mes "before you go there...";
  77. mes "Good Luck!";
  78. break;
  79. case 3:
  80. mes "[PVP Narrator]";
  81. mes "Each of the fight squares";
  82. mes "have a row of Narrators and";
  83. mes "choose them based on your";
  84. mes "qualifications.";
  85. next;
  86. mes "[PVP Narrator]";
  87. mes "Each Narrator will ask";
  88. mes "which of the five PVP maps";
  89. mes "you wish to go to.";
  90. mes "Choose, and go in!";
  91. next;
  92. mes "[PVP Narrator]";
  93. mes "Each map has a limitation on";
  94. mes "the number of people who can";
  95. mes "participate. So you will see";
  96. mes "figures in the corner showing";
  97. mes "'Attendee/Total'.";
  98. next;
  99. mes "[PVP Narrator]";
  100. mes "Also, there is a hidden EXP";
  101. mes "value in PVP mode. This EXP";
  102. mes "score will only apply inside";
  103. mes "of the PVP zone, so do not";
  104. mes "worry.";
  105. next;
  106. mes "[PVP Narrator]";
  107. mes "Every player's EXP at the";
  108. mes "beginning is usually 5 points.";
  109. mes "If you win, it will";
  110. mes "increase by 1 point";
  111. next;
  112. mes "[PVP Narrator]";
  113. mes "In the same way, when you";
  114. mes "lose... Your EXP will";
  115. mes "drop by 5 points.";
  116. mes "So be careful!";
  117. next;
  118. mes "[PVP Narrator]";
  119. mes "When you are defeated";
  120. mes "And your EXP is equal";
  121. mes "to or less than 0,";
  122. mes "You will be removed from PVP";
  123. mes "and your duel is finished!";
  124. next;
  125. mes "[PVP Narrator]";
  126. mes "However, if your EXP is more";
  127. mes "than 0. You can still get help";
  128. mes "through other players healing...";
  129. mes "Do you get it?";
  130. next;
  131. mes "[PVP Narrator]";
  132. mes "The fighting commands inside of";
  133. mes "PVP are the same as the normal.";
  134. mes "All the basic controls are the";
  135. mes "same.";
  136. next;
  137. mes "[PVP Narrator]";
  138. mes "However, there is one thing...";
  139. mes "Within the PVP fight square";
  140. mes "and PVP fighting zones,";
  141. mes "you cannot save your position.";
  142. mes "Remember well... These rules";
  143. mes "can help to ensure your victory.";
  144. break;
  145. case 4:
  146. mes "[PVP Narrator]";
  147. mes "Position successfully saved...";
  148. mes "Thank you very much!";
  149. mes "We will see you again soon.";
  150. if(strnpcinfo(4) == "morocc_in") { savepoint "morocc_in",141,139,1,1; }
  151. if(strnpcinfo(4) == "alberta_in") { savepoint "alberta_in",22,148,1,1; }
  152. if(strnpcinfo(4) == "prt_in") { savepoint "prt_in",54,137,1,1; }
  153. if(strnpcinfo(4) == "geffen_in") { savepoint "geffen_in",70,59,1,1; }
  154. if(strnpcinfo(4) == "payon_in01") { savepoint "payon_in01",142,46,1,1; }
  155. break;
  156. case 5:
  157. mes "[PVP Narrator]";
  158. mes "With war raging between monsters";
  159. mes "and humans, this competition";
  160. mes "among people - PVP -";
  161. mes "encourages us all to get";
  162. mes "stronger. Come again,";
  163. mes "we welcome your challenge!";
  164. break;
  165. }
  166. close;
  167. }
  168. morocc_in,144,138,4 duplicate(pvpe) PVP Narrator#pe1 84
  169. alberta_in,22,146,4 duplicate(pvpe) PVP Narrator#pe2 84
  170. prt_in,56,140,4 duplicate(pvpe) PVP Narrator#pe3 84
  171. geffen_in,67,63,4 duplicate(pvpe) PVP Narrator#pe4 84
  172. payon_in01,142,50,4 duplicate(pvpe) PVP Narrator#pe5 84
  173. geffen_in,67,63,4 duplicate(pvpe) PVP Narrator#pe6 84
  174. // Mode Select
  175. //============================================================
  176. - script Gate Keeper::gkut -1,{
  177. mes "[Gate Keeper]";
  178. mes "Glad to be of service.";
  179. mes "I will open the PVP fight";
  180. mes "square for you! If you have";
  181. mes "any questions about the PVP";
  182. mes "modes or rules, Please ask";
  183. mes "the Narrator...";
  184. next;
  185. switch(select("^FF5533' PvP Nightmare Mode'^000000:^3355FF' PvP Yoyo Mode'^000000:^3355FF' PvP Event Mode'^000000:Quit")) {
  186. case 1:
  187. mes "[Gate Keeper]";
  188. mes "I am sorry, but currently the Nightmare mode service is not available.";
  189. mes "Please use the Yoyo Mode instead. We apologize for the inconvenience.";
  190. break;
  191. case 2:
  192. mes "[Gate Keeper]";
  193. mes "The admission fee is 500 Zeny.";
  194. mes "Do you want to move";
  195. mes "to the Yoyo Mode";
  196. mes "fight square?";
  197. next;
  198. switch(select("Move:Cancel")) {
  199. case 1:
  200. if ((Zeny > 499) && (BaseLevel > 30)) {
  201. set Zeny, Zeny - 500;
  202. callsub L_Warp,"pvp_y_room";
  203. }
  204. else {
  205. mes "[Gate Keeper]";
  206. mes "Excuse me, but";
  207. mes "did you not come prepared?";
  208. mes "Double check that you have the";
  209. mes "500 Zeny entrance fee, and";
  210. mes "that you are at least level 31!";
  211. }
  212. close;
  213. case 2:
  214. mes "[Gate Keeper]";
  215. mes "With war raging between monsters";
  216. mes "and humans, this competition";
  217. mes "among people - PVP -";
  218. mes "encourages us all to get";
  219. mes "stronger. Come again,";
  220. mes "we welcome your challenge!";
  221. close;
  222. }
  223. case 3:
  224. mes "[Gate Keeper]";
  225. mes "Welcome!";
  226. mes "Please double check";
  227. mes "that you have the admission or viewing ticket.";
  228. next;
  229. if ((countitem(7028) == 0) && (countitem(7029) == 0)) {
  230. mes "[Gate Keeper]";
  231. mes "Eh? You don't have it? Then I";
  232. mes "am sorry, this fight square is";
  233. mes "only for people who have";
  234. mes "admission or viewing tickets.";
  235. mes "You cannot come in without it.";
  236. close;
  237. }
  238. mes "[Gate Keeper]";
  239. mes "Yes, thank you for participating. Have fun!";
  240. if (Zeny >= 500) set Zeny, Zeny - 500;
  241. callsub L_Warp,"pvp_room";
  242. break;
  243. case 4:
  244. mes "[Gate Keeper]";
  245. mes "With war raging between monsters";
  246. mes "and humans, This competition";
  247. mes "among people - PVP -";
  248. mes "encourages us all to get";
  249. mes "stronger. Come again,";
  250. mes "we welcome your challenge!";
  251. break;
  252. }
  253. close;
  254. L_Warp:
  255. set .@map$,getarg(0);
  256. if (checkre(0)) {
  257. switch(rand(1,10)) {
  258. case 1: warp .@map$,34,38; break;
  259. case 2: warp .@map$,46,38; break;
  260. case 3: warp .@map$,58,38; break;
  261. case 4: warp .@map$,70,38; break;
  262. case 5: warp .@map$,82,38; break;
  263. case 6: warp .@map$,82,58; break;
  264. case 7: warp .@map$,65,58; break;
  265. case 8: warp .@map$,49,58; break;
  266. case 9: warp .@map$,33,58; break;
  267. case 10: warp .@map$,52,24; break;
  268. }
  269. } else
  270. warp .@map$,51,23;
  271. return;
  272. }
  273. morocc_in,144,142,4 duplicate(gkut) Gate Keeper#gke1 83
  274. alberta_in,26,146,4 duplicate(gkut) Gate Keeper#gke2 83
  275. prt_in,52,140,4 duplicate(gkut) Gate Keeper#gke3 83
  276. geffen_in,63,63,4 duplicate(gkut) Gate Keeper#gke4 83
  277. payon_in01,140,53,4 duplicate(gkut) Gate Keeper#gke5 83
  278. // PVP Warper Function
  279. //============================================================
  280. // Note: The warper NPCs are in the pre-re/re paths.
  281. //callfunc "F_PVP_FSRS"{,<min_lvl>,<max_lvl>};
  282. function script F_PVP_FSRS {
  283. if (getargcount()) {
  284. setarray .@lvl[0], getarg(0), getarg(1);
  285. if (BaseLevel < .@lvl[0] || BaseLevel > .@lvl[1]) {
  286. mes "[PVP Fight Square Reception Staff]";
  287. mes "Sorry, but you base level has to be between LV "+ .@lvl[0] +" and LV "+ .@lvl[1] +".";
  288. close;
  289. }
  290. }
  291. if (strnpcinfo(4) == "pvp_y_room") {
  292. set .@base$, "pvp_y_"+strnpcinfo(2);
  293. setarray .@Maps$[0], .@base$+"-1", .@base$+"-2", .@base$+"-3", .@base$+"-4", .@base$+"-5";
  294. setarray .@Name$[0], "Prontera", "Izlude", "Payon", "Alberta", "Morroc";
  295. setarray .@Limit[0], 128, 128, 128, 128, 128;
  296. } else {
  297. setarray .@Maps$[0], "pvp_n_8-1", "pvp_n_8-2", "pvp_n_8-3", "pvp_n_8-4", "pvp_n_8-5";
  298. setarray .@Name$[0], "Sandwich", "Lock on", "Four Room", "Under cross", "Compass Room";
  299. setarray .@Limit[0], 64, 32, 32, 32, 32;
  300. }
  301. for(set .@i,0; .@i<5; set .@i,.@i+1)
  302. set .@menu$, .@menu$+.@Name$[.@i]+" ["+getmapusers(.@Maps$[.@i])+" / "+.@Limit[.@i]+"]:";
  303. set .@menu$, .@menu$+"Cancel.";
  304. set .@i, select(.@menu$)-1;
  305. if (.@i == 5) close;
  306. if (getmapusers(.@Maps$[.@i]) >= .@Limit[.@i]) {
  307. mes "[PVP Fight Square Reception Staff]";
  308. mes "This map is currently full.";
  309. close;
  310. }
  311. warp .@Maps$[.@i],0,0;
  312. end;
  313. }
  314. // Event Contestant Entrance
  315. //============================================================
  316. pvp_room,54,85,4 script Registration Staff#1 105,{
  317. if (countitem(7028) == 0) {
  318. mes "[PVP Combat Square Register Staff]";
  319. mes "Eh? How did you get in here?";
  320. mes "This is the entrance for players only.";
  321. mes "For details about viewers please proceed to the Register Staff on your right.";
  322. close;
  323. }
  324. set .@size, getarraysize(.warp_x);
  325. if (.@size == 0) {
  326. setarray .warp_x,40,59,20,40;
  327. setarray .warp_y,59,40,40,20;
  328. }
  329. if (select("Combat Square one:Cancel") == 1) {
  330. mes "[PVP Combat Square Register Staff]";
  331. mes "'"+ strcharinfo(0) +"'";
  332. mes "Are you ready?!";
  333. next;
  334. if (select("Yes!:No!") == 1) {
  335. mes "[PVP Combat Square Register Staff]";
  336. mes "OK! I will send you inside";
  337. mes "Good luck!";
  338. close2;
  339. delitem 7028,1; //Invite_For_Duel
  340. set .@rand, rand(.@size);
  341. warp "pvp_2vs2", .warp_x[.@rand], .warp_y[.@rand];
  342. deletearray .warp_x[.@rand],1;
  343. deletearray .warp_y[.@rand],1;
  344. end;
  345. }
  346. mes "[PVP Combat Square Register Staff]";
  347. mes "Come back anytime you are ready.";
  348. close;
  349. }
  350. close;
  351. OnInit:
  352. waitingroom "Combat Square players entrance only",0;
  353. end;
  354. }
  355. // Spectator Entrance
  356. //============================================================
  357. - script Spectator's Entrance#dum::PVPSpectator -1,{
  358. if (countitem(7029) == 0) {
  359. mes "[PVP Compete Square Register Staff]";
  360. mes "This is the entrance for viewers.";
  361. mes "For details about players entrance please proceed to the Register Staff on your left.";
  362. close;
  363. }
  364. if (select("Compete Square one:Cancel") == 1) {
  365. mes "[PVP Combat Square Register Staff]";
  366. mes "You got it, thanks for participating. Have fun!";
  367. close2;
  368. delitem 7029,1; //Admission_For_Duel
  369. switch(rand(1,4)) {
  370. case 1: warp "pvp_2vs2",39,7; end;
  371. case 2: warp "pvp_2vs2",39,73; end;
  372. case 3: warp "pvp_2vs2",7,39; end;
  373. case 4: warp "pvp_2vs2",73,39; end;
  374. }
  375. }
  376. close;
  377. OnInit:
  378. waitingroom "Compete Square viewer's entrance",0;
  379. end;
  380. }
  381. pvp_room,62,85,4 duplicate(PVPSpectator) Spectator's Entrance#1 105
  382. pvp_room,70,85,4 duplicate(PVPSpectator) Spectator's Entrance#2 105
  383. pvp_room,78,85,4 duplicate(PVPSpectator) Spectator's Entrance#3 105
  384. pvp_room,86,85,4 duplicate(PVPSpectator) Spectator's Entrance#4 105
  385. // Spectator Warps
  386. //============================================================
  387. - script Combat Square Staff#dum::PVPSpecWarp -1,{
  388. OnTouch_:
  389. mes "[Combat Square Staff]";
  390. mes "May I help you?";
  391. if (select("To the center viewer seat.:Leave Combat Square.") == 1) {
  392. warp "pvp_2vs2",38,38;
  393. end;
  394. }
  395. warp "pvp_room",84,39;
  396. end;
  397. }
  398. pvp_2vs2,5,4,0 duplicate(PVPSpecWarp) Combat Square Staff#1 45,1,1
  399. pvp_2vs2,5,74,0 duplicate(PVPSpecWarp) Combat Square Staff#2 45,1,1
  400. pvp_2vs2,74,74,0 duplicate(PVPSpecWarp) Combat Square Staff#3 45,1,1
  401. pvp_2vs2,74,5,0 duplicate(PVPSpecWarp) Combat Square Staff#4 45,1,1
  402. pvp_2vs2,40,40,0 script Combat Square Staff#5 45,1,1,{
  403. mes "[Combat Square Staff]";
  404. mes "May I help you?";
  405. switch(select("To the side viewer seat.:Leave Combat Square.")) {
  406. case 1:
  407. switch(rand(1,4)) {
  408. case 1: warp "pvp_2vs2",39,7; end;
  409. case 2: warp "pvp_2vs2",39,73; end;
  410. case 3: warp "pvp_2vs2",7,39; end;
  411. case 4: warp "pvp_2vs2",73,39; end;
  412. }
  413. case 2:
  414. warp "pvp_c_room",84,39;
  415. end;
  416. }
  417. }
  418. // PVP Area Exit warp
  419. //============================================================
  420. pvp_room,51,19,0 script out#eventpvp 45,4,2,{
  421. OnTouch_:
  422. mes "[Combat Square Staff]";
  423. mes "Did you have fun in Combat Square?";
  424. mes "May I ask where you want to go?";
  425. next;
  426. switch(select("Prontera.:Morocc.:Geffen.:Payon.:Alberta.:Cancel.")) {
  427. case 1: warp "prontera",107,60; end;
  428. case 2: warp "morocc",157,96; end;
  429. case 3: warp "geffen",120,36; end;
  430. case 4: warp "payon",96,100; end;
  431. case 5: warp "alberta",41,243; end;
  432. case 6: close;
  433. }
  434. }