Advertisement
manabeast

chris pvp

Sep 24th, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 44.17 KB | None | 0 0
  1. //===== eAthena Script =======================================
  2. //= Arena Master
  3. //===== By ===================================================
  4. //= lllchrislll
  5. //===== Version ==============================================
  6. //= 1.0 - Script Made
  7. // Added Multi Kill & SoundEffects
  8. // Added Bounty & Promotion Feature
  9. // Fully tested & Rewritten most of the code
  10. // - Since it didn't wanted to work like I wanted q-q
  11. // - Couldn't test the Party PvP option though.
  12. // Added a bonus at the bounty feature
  13. // - If an player gains a "$@bty_bon_start" spree, "$@bty_bonus"
  14. // will be given to the player, who kill him/her.
  15. //===== Compatible With ======================================
  16. //= Every eAthena Version [SQL]
  17. //===== Description ==========================================
  18. //= PvP / GvG & MvP Arena which also handles an ranking to it.
  19. //= PvP Types:
  20. // - Normal
  21. // - Dispell: You'll be dispelled on Room entry.
  22. // - Deathmatch: You'll be auto resurrect when you die.
  23. // If you type @die, get comaed and similar, you'll be warped to your save point.
  24. // - Party PvP: 2vs2, 3vs3, 4vs4, 5vs5
  25. //= PvP:
  26. // - There are 5 Rooms: Prontera, Alberta, Izlude, Morroc
  27. // PvP Types: Normal - Deathmatch has one of these.
  28. // That means 5*3.
  29. // - Party PvP: There are 4 types and those also has one of room each.
  30. // > So 5*4.
  31. // -----------------------------------------------
  32. // = Total 35 Rooms !!!!
  33. // -----------------------------------------------
  34. //= GvG: 5 Arenas, the default guild_vs1 - guild_vs5.
  35. //= MvP: For the MvP Part I'm using the scripts in npc/custom/MVP_arena/
  36. // Enable both in npc/scripts_custom.conf or uncomment the two "npc:" below this
  37. //npc: npc/custom/MVP_arena/arena_mvp.txt
  38. //npc: npc/custom/MVP_arena/amvp_func.txt
  39. //===== Comments & Credits =============================================
  40. //= Credits:
  41. // - MvP Arena: Darkchild, massdriller, Silent
  42. // Well, it's added to the SVN already, but just in case D:.
  43. //=========== Item Usage Restrictions =======================
  44. // Required File: db/item_noequip.txt
  45. // Entries, insert theres at the bottom of the file.
  46. /*
  47. // Disabled for PvP+GvG - PvP/GvG Arena [lllchrislll]
  48. //607,3 // Yggdrasil Berry
  49. //608,3 // Yggdrasil Seed
  50. */
  51. //===== MySQL Entries ========================================
  52. /*
  53. // v1.0
  54. DROP TABLE IF EXISTS `arena_master`;
  55. CREATE TABLE `arena_master` (
  56. `char_id` int(10) unsigned NOT NULL,
  57. `kills` smallint(5) unsigned DEFAULT '0',
  58. `death` smallint(5) unsigned DEFAULT '0',
  59. `hscore` smallint(5) unsigned DEFAULT '0',
  60. `bounty` smallint(5) unsigned DEFAULT '0',
  61. `bounty_pts` smallint(5) unsigned DEFAULT '0',
  62. `killer` smallint(5) unsigned DEFAULT '0',
  63. `domi` smallint(5) unsigned DEFAULT '0',
  64. `mega` smallint(5) unsigned DEFAULT '0',
  65. `unstopp` smallint(5) unsigned DEFAULT '0',
  66. `wicked` smallint(5) unsigned DEFAULT '0',
  67. `monster` smallint(5) unsigned DEFAULT '0',
  68. `godlike` smallint(5) unsigned DEFAULT '0',
  69. `holys` smallint(5) unsigned DEFAULT '0',
  70. `mvp` smallint(5) unsigned DEFAULT '0',
  71. PRIMARY KEY (`char_id`)
  72. ) ENGINE=MyISAM;
  73. */
  74. //=============== ToDo List ==========================
  75. // - Nothing yet
  76. //============================================================
  77. // ================= Arena Master ================== //
  78.  
  79. //Arena Informationand Ranking EDITED ****
  80.  
  81. malangdo,155,142,4 script Arena Information 974,{
  82. set .@n$,"["+strnpcinfo(1)+"]";
  83.  
  84. mes .@n$;
  85. mes "How can I help you?";
  86. mes "-------------------------";
  87. mes "Ranking Status: "+ ( ($@pvptable)?"Online":"Offline");
  88. if(!$@pvptable) mes "Duo the ranking system being offline, no ranking will take place.";
  89. next;
  90. switch(select("- See Rankings:- Need Information:- Nevermind")) {
  91.  
  92. // Ranking
  93. case 1:
  94. mes .@n$;
  95. if(!$@pvptable) {
  96. mes "I'm sorry, the ranking system is offline and thus I can't show you any ranking.";
  97. close;
  98. }
  99. mes "Which ranking do you wanna see?";
  100. next;
  101. switch(select("- Kills:- Deaths:- High Scores:- Killing Sphree:- Dominating:- Mega Kill:- Unstoppable:- Wicked Sick:- Monster Kill:- GodLike:- Holy Sh1t:- MvP")) {
  102. case 1: set .@listr$,"kills"; break;
  103. case 2: set .@listr$,"death"; break;
  104. case 3: set .@listr$,"hscore"; break;
  105. case 4: set .@listr$,"killer"; break;
  106. case 5: set .@listr$,"domi"; break;
  107. case 6: set .@listr$,"mega"; break;
  108. case 7: set .@listr$,"unstopp"; break;
  109. case 8: set .@listr$,"wicked"; break;
  110. case 9: set .@listr$,"monster"; break;
  111. case 10: set .@listr$,"godlike"; break;
  112. case 11: set .@listr$,"holys"; break;
  113. case 12: set .@listr$,"mvp"; break;
  114. }
  115. set @rank,@menu;
  116. mes .@n$;
  117. mes "Which list do you want to see?";
  118. next;
  119. switch(select("- Top 5:- Top 10:- Top 15:- Top 20:- Top 25:- Top 30:- Nevermind")) {
  120.  
  121. default:
  122. set .@limit,5*@menu;
  123. break;
  124.  
  125. case 7:
  126. goto R_Bye;
  127. break;
  128. }
  129. mes .@n$;
  130. mes "Ranking:";
  131. switch(@rank) {
  132.  
  133. case 1: mes set(.@rankn$,"Top "+.@limit+" Killers"); set .@rankt$,"Kills"; break;
  134. case 2: mes set(.@rankn$,"Top "+.@limit+" Victims"); set .@rankt$,"Deaths"; break;
  135. case 3: mes set(.@rankn$,"Top "+.@limit+" High Scores"); set .@rankt$,"High Score"; break;
  136. case 12: mes set(.@rank$,"Top "+.@limit+" MvP Hunters"); set .@rankt$,"MvP Kills"; break;
  137. default: mes set(.@rankn$,"Top "+.@limit+" \""+$@sphreen$[@rank-3]+"\" Rankers"); set .@rankt$,$@sphreen$[@rank-3]+"s"; break;
  138. }
  139. mes "Correct?";
  140. next;
  141. if(select("- Yes:- No") == 2) goto R_Bye;
  142. mes .@n$;
  143. mes "I will now list the ranking in your Chat Box.";
  144. close2;
  145. dispbottom "======= "+.@rankn$+" ===========";
  146. dispbottom "Player Name: "+.@rankt$;
  147. query_sql "SELECT `char_id` , `"+.@listr$+"` FROM `arena_master` WHERE `"+.@listr$+"` > 0 ORDER BY `"+.@listr$+"` DESC LIMIT "+.@limit,.@ch_id,.@sh_r;
  148. if(!.@sh_r[0]) {
  149. dispbottom "No Player found.";
  150. end;
  151. }
  152. for( set .@r,0; .@r < getarraysize(.@sh_r); set .@r,.@r + 1) {
  153. query_sql "SELECT `name` FROM `char` WHERE `char_id` = '"+.@ch_id[.@r]+"'",.@ch_na$;
  154. dispbottom .@ch_na$+": "+.@sh_r[.@r];
  155. }
  156. deletearray .@ch_id[0],128;
  157. deletearray .@sh_r[0],128;
  158. end;
  159.  
  160. // Arena Shop
  161. case 2:
  162. mes .@n$;
  163. mes "Hello, I can sell your useful items for the daily PvP need and more.";
  164. mes "Depending on the bounty, I will open the respective shop.";
  165. next;
  166. mes .@n$;
  167. switch($@bty_type) {
  168.  
  169. case 0:
  170. mes "I'm sorry, but the bounty feature is not enabled.";
  171. close;
  172.  
  173. case 1:
  174. mes "I will now open the Bounty Shop, which uses \"Zeny\" as payment.";
  175. break;
  176.  
  177. case 2:
  178. mes "I will now open the Bounty Shop, which uses \"Cash Points\" as payment.";
  179. break;
  180.  
  181. case 3:
  182. mes "I will now open the Bounty Shop, which uses \"Bounty Points\" as payment.";
  183. break;
  184. }
  185. close2;
  186. callshop "Arena_Shop",1;
  187. npcshopattach "Arena_Shop";
  188. end;
  189.  
  190. OnBuyItem:
  191. for( set @s,0; @s < getarraysize(@bought_nameid); set @s,@s + 1) {
  192. for( set @i,0; @i < getarraysize($@arena_sh); set @i,@i + 1) {
  193. if(@bought_nameid[@s] == $@arena_sh[@i]) {
  194. if(checkweight(@bought_nameid[@s],@bought_quantity[@s]) == 1) {
  195. set @c_item,(@bought_quantity[@s]*$@arena_ar[@i]);
  196. set @total,(@total + @c_item);
  197. break;
  198. } else {
  199. dispbottom "Arena Shop: You have reached your weight limit, lose some weight and come back please.";
  200. end;
  201. }
  202. }
  203. }
  204. }
  205. switch($@bty_type) {
  206.  
  207. case 1:
  208. if(Zeny >= @total) {
  209. for ( set @b,0; @b < getarraysize(@bought_nameid); set @b,@b + 1)
  210. getitem @bought_nameid[@b],@bought_quantity[@b];
  211.  
  212. set Zeny,Zeny - @total;
  213.  
  214. } else dispbottom "You don't have enough Zeny.";
  215. break;
  216.  
  217. case 2:
  218. if(#CASHPOINTS >= @total) {
  219. for ( set @b,0; @b < getarraysize(@bought_nameid); set @b,@b + 1)
  220. getitem @bought_nameid[@b],@bought_quantity[@b];
  221.  
  222. set #CASHPOINTS,#CASHPOINTS - @total;
  223.  
  224. } else dispbottom "You don't have enough Cash Points, currently "+#CASHPOINTS;
  225. break;
  226.  
  227. case 3:
  228. if(query_sql("SELECT `bounty_pts` FROM `arena_master` WHERE `char_id` = '"+getcharid(0)+"'",@pts) >= @total)
  229. for ( set @b,0; @b < getarraysize(@bought_nameid); set @b,@b + 1) {
  230. getitem @bought_nameid[@b],@bought_quantity[@b];
  231.  
  232. query_sql "UPDATE `arena_master` SET `bounty_pts` = `bounty_pts` - "+@total+" WHERE `char_id` = '"+getcharid(0)+"'";
  233.  
  234. } else dispbottom "You don't have enough Bounty Points, currently "+@pts;
  235. break;
  236. }
  237. set @total,0;
  238. deletearray @bought_nameid[0],128;
  239. deletearray @bought_quantity[0],128;
  240. end;
  241.  
  242. // Information
  243. case 3:
  244. mes .@n$;
  245. mes "What do you want to know about?";
  246. next;
  247. switch(select("- PvP:- GvG:- Sphree:- Ranking:- Bounty Feature:- Nevermind")) {
  248.  
  249. case 1:
  250. mes "[=== PvP ===]";
  251. mes "Each PvP Type has five rooms, displayed as";
  252. mes "Prontera, Alberta, Izlude, Payon and Morroc.";
  253. mes "Party PvP has 4 types and each type has also five rooms.";
  254. next;
  255. mes "[=== PvP ===]";
  256. mes "PvP Types:";
  257. mes " - Normal";
  258. mes " - Deathmatch";
  259. mes " - Party PvP:";
  260. mes " - 2vs2";
  261. mes " - 3vs3";
  262. mes " - 4vs4";
  263. mes " - 5vs5";
  264. next;
  265. mes "[=== PvP ===]";
  266. mes "Deathmatch PvP:";
  267. mes " - You'll be auto-resurrect on";
  268. mes " death, except you type @die,";
  269. mes " get comaed or similar, then";
  270. mes " you'll be warped to your savepoint.";
  271. close;
  272.  
  273. case 2:
  274. mes "[=== GvG ===]";
  275. if($@same_gld) {
  276. mes "There can be two guilds in one room at the same time with maximum "+$@mpgld+" members per guild.";
  277. mes "Each guild has two spawn postions, Guild 1 has North and West and Guild 2 has East and South,";
  278. mes "which will be chosen randomly on room entry, also only members";
  279. mes "of 'em can enter the same room until no one is left of the respective guild.";
  280. } else mes "Only members of a guild can enter a room and the maximum players, which can enter are "+$@mgvg+".";
  281. close;
  282.  
  283. case 3:
  284. mes "[=== Sphree ===]";
  285. mes "Sphree - Required Kills.";
  286. mes "First Blood - 1";
  287. for ( set .@s,1; .@s < getarraysize($@sphreen$); set .@s,.@s + 1)
  288. mes $@sphreen$[.@s] +" - "+$@sphr_kills[.@s];
  289.  
  290. next;
  291. mes "[=== Sphree ===]";
  292. mes "For each sphree you accomplish, except First Blood, you gain an point for the bounty feature, if it has been activated.";
  293. mes "For more ask me about the Bounty Feature.";
  294. next;
  295. mes "[=== Sphree ===]";
  296. mes "Also there is the Multi Kill Sphrees, but you won't recieve points for them.";
  297. mes "The time span you can achieve them is "+ $@multi+" seconds.";
  298. next;
  299. mes "[=== Sphree ===]";
  300. mes "In this time you, if you kill";
  301. mes " - one more player = Double Kill";
  302. mes " - two more players = Triple Kill";
  303. mes " - three or more players = Ultra Kill";
  304. close;
  305.  
  306. case 4:
  307. mes "[=== Ranking ===]";
  308. mes "Kills, Deaths, Sphree Counts (like Killing Sphree), the highest kill count till you died and lists it in either a Top 5, 10, 15, 20, 25 or a Top 30 List with the wanted information you have chosen, will be displayed.";
  309. next;
  310. mes "[=== Ranking ===]";
  311. mes "Additionally there is an promote feature, which is part of the ranking to save your sphree counts which can be, like mentioned above, listed.";
  312. mes "But the save of them will only apply when you logout.";
  313. close;
  314.  
  315. case 5:
  316. mes .@n$;
  317. if(!$@bty_type) {
  318. mes "This feature isn't activate.";
  319. close;
  320. }
  321. mes "There are three different bounty rewards, which are the following:";
  322. mes " - Zeny";
  323. mes " - Cash Points";
  324. mes " - Bounty Points";
  325. next;
  326. mes .@n$;
  327. mes "But depending on the setting which has been made by the GM Team, only one will be used.";
  328. mes "Also for each of these an Shop exists and only one shop can be accessed.";
  329. mes "Current Bounty Reward: "+ $@bty_price + " " + ( ($@bty_type == 1)?"Zeny": ( ($@bty_type == 2)?"Cash Points":"Bounty Points") );
  330. next;
  331. mes .@n$;
  332. mes "The bounty depends on your victims sphree.";
  333. mes "Here is a list of them:";
  334. mes "And while I'm on it I will list the required kills for them too.";
  335. mes " ";
  336. mes "Sphree - Requ. Kills - Points";
  337. for ( set .@s,1; .@s < getarraysize($@sphreen$); set .@s,.@s + 1)
  338. mes $@sphreen$[.@s] +" - "+$@sphr_kills[.@s] + " - "+.@s;
  339.  
  340. next;
  341.  
  342. case 6:
  343. goto R_Bye;
  344. close;
  345. }
  346.  
  347. // Nevermind
  348. case 4:
  349. goto R_Bye;
  350. break;
  351. }
  352.  
  353. R_Bye:
  354. mes .@n$;
  355. mes "Okay, see ya.";
  356. close;
  357. }
  358.  
  359. // Arena GVG - EDITED ****
  360. malangdo,173,145,4 script GVG Arena 651,{
  361. set .@n$,"["+strnpcinfo(1)+"]";
  362.  
  363. mes .@n$;
  364. mes "Guild vs Guild arena";
  365. mes "-------------------------";
  366. mes "Ranking Status: "+ ( ($@pvptable)?"Online":"Offline");
  367. if(!$@pvptable) mes "Duo the ranking system being offline, no ranking will take place.";
  368. next;
  369. switch(select("- Go to GVG arena:- Nevermind")) {
  370.  
  371. // GvG
  372. case 1:
  373. set @sphr,0;
  374. set @bty,0;
  375. set @killct,0;
  376. set @first,1; // First Blood
  377. mes .@n$;
  378. mes "In which arena do you want to fight?";
  379. next;
  380. mes .@n$;
  381. if(!getcharid(2)) {
  382. mes "I'm sorry, but you are not in a guild.";
  383. close;
  384. }
  385. mes "Please choose the room you want to join:";
  386. mes "Each arena can hold up to "+$@mgvg+" player(s).";
  387. if($@same_gld) mes "If guilds already are in this room, you have to be a member of it so that you can join.";
  388. next;
  389. set .@rchoi,select("- GvG 1 ["+getmapusers($@gvgr$[0])+"]:- GvG 2 ["+getmapusers($@gvgr$[1])+"]:- GvG 3 ["+getmapusers($@gvgr$[2])+"]:- GvG 4 ["+getmapusers($@gvgr$[3])+"]:- GvG 5 ["+getmapusers($@gvgr$[4])+"]") - 1;
  390. mes .@n$;
  391. if($@same_gld) {
  392. set @gvgc,@menu;
  393. if(getd("$@gvg_"+@gvgc+"_gld_1") == 0) {
  394. mes "I will warp you now.";
  395. close2;
  396. warp $@gvgr$[.@rchoi],$@gvg_gld1_x[.@rchoi],$@gvg_gld1_y[.@rchoi];
  397. setd("$@gvg_"+@gvgc+"_gld_1"),getcharid(2);
  398. setd("$@gvg_"+@gvgc+"_1_ppl"),getd("$@gvg_"+@gvgc+"_1_ppl") + 1;
  399. end;
  400. } else if(getd("$@gvg_"+@gvgc+"_gld_2") == 0) {
  401. mes "I will warp you now.";
  402. close2;
  403. warp $@gvgr$[.@rchoi],$@gvg_gld2_x[.@rchoi],$@gvg_gld2_x[.@rchoi];
  404. setd("$@gvg_"+@gvgc+"_gld_2"),getcharid(2);
  405. setd("$@gvg_"+@gvgc+"_2_ppl"),getd("$@gvg_"+@gvgc+"_2_ppl") + 1;
  406. end;
  407. }
  408. if(getd("$@gvg_"+@gvgc+"_gld_1") == getcharid(2)) {
  409. if(getd("$@gvg_"+@gvgc+"_1_ppl") >= $@mpgld) {
  410. mes "I'm sorry, but your guild's side is already full.";
  411. close;
  412. }
  413. mes "I will warp you now.";
  414. close2;
  415. set @rand,rand(1,2);
  416. warp $@gvgr$[.@rchoi],getd("$@gvg_gld1_x"+@rand+"["+.@rchoi+"]"),getd("$@gvg_gld1_y"+@rand+"["+.@rchoi+"]");
  417. setd("$@gvg_"+@gvgc+"_1_ppl"),getd("$@gvg_"+@gvgc+"_1_ppl") + 1;
  418. end;
  419. } else if(getd("$@gvg_"+@gvgc+"_gld_2") == getcharid(2)) {
  420. if(getd("$@gvg_"+@gvgc+"_2_ppl") >= $@mpgld) {
  421. mes "I'm sorry, but your guild's side is already full.";
  422. close;
  423. }
  424. mes "I will warp you now.";
  425. close2;
  426. set @rand,rand(1,2);
  427. warp $@gvgr$[.@rchoi],getd("$@gvg_gld2_x"+@rand+"["+.@rchoi+"]"),getd("$@gvg_gld2_y"+@rand+"["+.@rchoi+"]");
  428. setd("$@gvg_"+@gvgc+"_2_ppl"),getd("$@gvg_"+@gvgc+"_2_ppl") + 1;
  429. end;
  430. }
  431. } else {
  432. if(getmapusers($@gvgr$[.@rchoi]) >= $@mgvg) {
  433. mes "I'm sorry, but this Arena is already full.";
  434. close;
  435. }
  436. mes "I will warp you now.";
  437. close2;
  438. warp $@gvgr$[.@rchoi],0,0;
  439. end;
  440. }
  441. break;
  442.  
  443. // Nevermind
  444. case 2:
  445. goto R_Bye;
  446. break;
  447. }
  448.  
  449. R_Bye:
  450. mes .@n$;
  451. mes "Okay, see ya.";
  452. close;
  453. }
  454.  
  455. // PVP Arena NPC Edited ****
  456.  
  457. malangdo,162,146,4 script PVP Arena 651,{
  458. set .@n$,"["+strnpcinfo(1)+"]";
  459. function getPartyMapUsers;
  460.  
  461. mes .@n$;
  462. mes "Would you like to PvP now?";
  463. mes "-------------------------";
  464. mes "Ranking Status: "+ ( ($@pvptable)?"Online":"Offline");
  465. if(!$@pvptable) mes "Duo the ranking system being offline, no ranking will take place.";
  466. next;
  467. switch(select("- Enter to PvP:- Cancel")) {
  468.  
  469. // PvP
  470. case 1:
  471. set @sphr,0;
  472. set @bty,0;
  473. set @killct,0;
  474. set @first,1; // First Blood
  475. mes .@n$;
  476. mes "In which arena do you want to fight?";
  477. next;
  478. mes .@n$;
  479. mes "Now select the room you want to fight in.";
  480. set @map,select("- Prontera:- Alberta:- Izlude:- Payon:- Morroc");
  481. next;
  482. mes .@n$;
  483. mes "Please choose the PvP Type:";
  484. mes "This arena can hold up to "+$@muser[@map]+" player(s).";
  485. mes "Party PvP is different of course.";
  486. next;
  487. switch(select("- Normal PvP ["+getmapusers($@npvp$[@map])+"]:- PvP Deathmatch["+getmapusers($@dmpvp$[@map])+"]:- Party PvP["+getPartyMapUsers(6)+"]")) {
  488.  
  489. //PvP Normal
  490. case 1:
  491. mes .@n$;
  492. if(getmapusers($@npvp$[@map]) >= $@muser[@map]) {
  493. mes "I'm sorry, but this room is already full.";
  494. close;
  495. }
  496. mes "I'll warp you now to the "+ $@room$[@map]+" PvP Room.";
  497. close2;
  498. warp $@npvp$[@map],0,0;
  499. end;
  500.  
  501. // PvP DM
  502. case 2:
  503. mes .@n$;
  504. if(getmapusers($@dmpvp$[@map]) >= $@muser[@map]) {
  505. mes "I'm sorry, but this room is already full.";
  506. close;
  507. }
  508. mes "I'll warp you now to the "+ $@room$[@map]+" PvP Deathmatch Room.";
  509. close2;
  510. warp $@dmpvp$[@map],0,0;
  511. end;
  512.  
  513. // Party PvP
  514. case 3:
  515. mes .@n$;
  516. if(!getcharid(1)) {
  517. mes "I'm sorry, but you are not in a party.";
  518. mes "Please come back as soon you have found one.";
  519. close;
  520. }
  521. mes "Please choose the Party vs Party Mode:";
  522. next;
  523. set .@pt,select("- 2vs2 ["+getPartyMapUsers(2,@map)/2+"]:- 3vs3 ["+getPartyMapUsers(3,@map)/3+"]:- 4vs4 ["+getPartyMapUsers(4,@map)/4+"]:- 5vs5 ["+getPartyMapUsers(5,@map)/5+"]") + 1;
  524. mes .@n$;
  525. if(getPartyMapUsers(.@pt,@map) >= (.@pt*.@pt)) {
  526. mes "I'm sorry, but this "+.@pt+"vs"+.@pt+" Arena is already full.";
  527. mes "Please try another.";
  528. close;
  529. }
  530. set @pty_id,getcharid(1);
  531. if(getpartyleader(@pty_id) != strcharinfo(0)) {
  532. mes "I'm sorry, but only your leader can register your party.";
  533. close;
  534. }
  535.  
  536. getpartymember(@pty_id,1);
  537. set @ptymem,$@partymembercount;
  538. if(@ptymem != .@pt) {
  539. mes "I'm sorry, but you have not the required amount of members in your party.";
  540. mes "Please make sure that you have exact "+.@pt+" members, not more not less.";
  541. close;
  542. }
  543. getpartymember(@pty_id,2);
  544. copyarray @ptymemid[0],$@partymembercid,@ptymem;
  545. copyarray @ptymemaid[0],$@partymemberaid,@ptymem;
  546. set .@pt_ct,0;
  547. for ( set .@pm,0; .@pm < @ptymem; set .@pm,.@pm + 1)
  548. if(isloggedin(@ptymemid[.@pm],@ptymemaid[.@pm]) == 0)
  549. set .@pt_ct,.@pt_ct + 1;
  550. if(.@pt_ct) {
  551. mes "It seems like that members are offline.";
  552. mes "Please kick them and gather new members.";
  553. close;
  554. }
  555. mes "I'll warp your party now.";
  556. mes "Good luck.";
  557. close2;
  558. warpparty getd("$@pt"+.@pt+"pvp$["+@map+"]"),0,0,@pty_id;
  559. end;
  560. }
  561. break;
  562.  
  563. function getPartyMapUsers {
  564. // getarg(0) == Party PvP Type (2vs2,3vs3, etc...) > 2,3, etc...
  565. // if it's a 6 = Total Map Users of the Party PvP Maps
  566. // getarg(1) == Room
  567. if(getarg(0) == 6) {
  568. set @pt2play,getmapusers($@pt2pvp$[1]) + getmapusers($@pt2pvp$[2]) + getmapusers($@pt2pvp$[3]) + getmapusers($@pt2pvp$[4]) + getmapusers($@pt2pvp$[5]);
  569. set @pt3play,getmapusers($@pt3pvp$[1]) + getmapusers($@pt3pvp$[2]) + getmapusers($@pt3pvp$[3]) + getmapusers($@pt3pvp$[4]) + getmapusers($@pt3pvp$[5]);
  570. set @pt4play,getmapusers($@pt4pvp$[1]) + getmapusers($@pt4pvp$[2]) + getmapusers($@pt4pvp$[3]) + getmapusers($@pt4pvp$[4]) + getmapusers($@pt4pvp$[5]);
  571. set @pt5play,getmapusers($@pt5pvp$[1]) + getmapusers($@pt5pvp$[2]) + getmapusers($@pt5pvp$[3]) + getmapusers($@pt5pvp$[4]) + getmapusers($@pt5pvp$[5]);
  572. return @pt2play + @pt3play + @pt4play + @pt5play;
  573.  
  574. } else return getmapusers(getd("$@pt"+getarg(0)+"pvp$["+getarg(1)+"]"));
  575. }
  576.  
  577. // Nevermind
  578. case 5:
  579. goto R_Bye;
  580. break;
  581. }
  582.  
  583. R_Bye:
  584. mes .@n$;
  585. mes "Okay, see ya.";
  586. close;
  587. }
  588.  
  589.  
  590. // =============== Bounty Feature Shop =========== //
  591. - shop Arena_Shop -1,512:-1
  592. // =============== Main Settings ===============//
  593. - script PvPGvGMain -1,{
  594. end;
  595.  
  596. OnInit:
  597. // =============== Ranking Check & Debug Messages ================//
  598. if($@debug) announce "====== Arena Master - Debug initiate... ========",bc_self;
  599. if(query_sql("SHOW TABLES LIKE 'arena_master'",.@pvptab[0]) == 0) set $@pvptable,0; else set $@pvptable,1;
  600. announce "Arena Master Ranking System - Status: "+ ( ($@pvptable)?"Online":"Offline"),bc_all;
  601. // ============== Sphree Settings ============//
  602. setarray $@sphreen$[1],"Killing Sphree","Dominating","Mega Kill","Unstoppable","Wicked Sick","Monster Kill","GodLike","Holy Sh1t";
  603. setarray $@msphree$[1],"Double Kill","Triple Kill","Ultra Kill";
  604. setarray $@sphr_kills[1],3,5,7,9,11,13,15,17; // Kills required for each sphree.
  605. set $@multi,15000; // Time Span for chance to gain Multi-Kill in milliseconds.
  606. set $@promo,5; // Kills required till points will be promoted to the current sphree.
  607. if($@debug) announce "PvP Sphree Settings loaded: "+$@sphreen$[0],bc_self;
  608. // ============== Bounty Settings =========//
  609. // Bounty Type: 0 = Off, 1 = Zeny, 2 = Cash Points, 3 = Bounty Points
  610. set $@bty_type,1;
  611. if($@bty_type) {
  612. set $@bty_bonus,5; // Bonus, if you kill an player
  613. set $@bty_bon_start,4; //which has achieved an spree of "$@bty_bon_start"
  614. // Clearing Array on Whisper to prevent double entries
  615. if(.@re_in) {
  616. // Items
  617. for (set .@s,0; .@s < getarraysize($@arena_sh); set .@s,.@s + 1)
  618. npcshopdelitem "Arena_Shop",$@arena_sh[.@s];
  619. // Prices
  620. deletearray $@arena_ar[0],128;
  621. }
  622.  
  623. // Shop Items: PvP useful stuff D:, like Elements, Boxes and Food
  624. // These will be used for all shops, but the prices depends on the Bounty Type you have set.
  625. setarray $@arena_sh[0],12020,12028,12029,12030,12031,12032,12033,12034,12108,12215,12216,12217,12218,12219,12075,12080,12085,12090,12095,12100,12114,12115,12116,12117,12118,12119,12120,12121,13543,13544,13545,13546,13547,14593;
  626. npcshopdelitem "Arena_Shop",512;
  627. // Prices:
  628. // Two ways of doing so:
  629. // - By formula
  630. // - Array
  631. // You can determine for each currency the way of calculation and prices.
  632. if($@bty_type == 1) {
  633. // =============== Zeny ========== //
  634. set $@bty_price,2000; // Zeny per Sphree
  635.  
  636. // If you want to use the formula, set ".arena_pay" to 1.
  637. // If you wanna use the array, set ".arena_pay" to 2.
  638. set $@arena_pay,1; // 1 = Formula, 2 = Per Array
  639.  
  640. // But remember to put the prices for all items.
  641. setarray $@arena_ar[0],100; // Etc
  642.  
  643. } else if($@bty_type == 2) {
  644. // =============== Cash Points ========== //
  645. set $@bty_price,2; // Cash Points per Sphree
  646.  
  647. // If you want to use the formula, set ".arena_pay" to 1.
  648. // If you wanna use the array, set ".arena_pay" to 2.
  649. set $@arena_pay,1; // 1 = Formula, 2 = Per Array
  650.  
  651. // But remember to put the prices for all items.
  652. setarray $@arena_ar[0],100; // Etc
  653.  
  654. } else if($@bty_type == 3) {
  655. // =============== Bounty Points ========== //
  656. set $@bty_price,5; // Bounty Points per Sphree
  657.  
  658. // If you want to use the formula, set ".arena_pay" to 1.
  659. // If you wanna use the array, set ".arena_pay" to 2.
  660. set $@arena_pay,1; // 1 = Formula, 2 = Per Array
  661.  
  662. // But remember to put the prices for all items.
  663. setarray $@arena_ar[0],100; // Etc
  664. }
  665. for ( set .@s,0; .@s < getarraysize($@arena_sh); set .@s,.@s + 1) {
  666. if($@arena_pay == 1) { // By Formula
  667.  
  668. // =============== Zeny Formula ========== //
  669. // Default: ($@bty_price+(.@s*($@bty_price/10)))/2
  670. // Base Price = $@bty_price, "Multiplier" = + (Index ID* ($@bty_price/10))/2
  671. // Example: 5000 + (4(=Index of 12031)*(5000/10=500) > 7000/2 = 3500 Zeny for 12031
  672. // Note: If the formula results in a decimal number it will be degraded.
  673. if($@bty_type == 1) set .@arena_fo,($@bty_price+(.@s*($@bty_price/10)))/2;
  674.  
  675. // =============== Cash Points Formula ========== //
  676. // Default: ($@bty_price+.@s)/2
  677. // Base Price = $@bty_price, "Multiplier" = + Index ID/2
  678. // Example: 2 + 4(=Index of 12031) > 6/2 = 3 Cash Points for 12031
  679. // Note: If the formula results in a decimal number it will be degraded.
  680. else if($@bty_type == 2) set .@arena_fo,($@bty_price+.@s)/2;
  681.  
  682. // =============== Bounty Points Formula ========== //
  683. // Default: ($@bty_price+(.@s*10))/2
  684. // Base Price = $@bty_price, "Multiplier" = + (Index ID* 10)/2
  685. // Example: 5 + (4(=Index of 12031)*10) > 45/2 = 22 Bounty Points for 12031
  686. // Note: If the formula results in a decimal number it will be degraded.
  687. else if($@bty_type == 3) set .@arena_fo,($@bty_price+(.@s*10))/2;
  688.  
  689. // =============== Adding the price (calculated by the formula) to the array ========== //
  690. setarray $@arena_ar[.@s],.@arena_fo;
  691.  
  692. }
  693. npcshopadditem "Arena_Shop",$@arena_sh[.@s],$@arena_ar[.@s];
  694. }
  695. }
  696. if($@debug) announce "Bounty Shop - Currency: " + ( ($@bty_type == 1)?"Zeny": ( ($@bty_type == 2)?"Cash Points":"Bounty Points") ) + ", Basic Price: "+ $@bty_price + ", Items: "+getarraysize($@arena_sh)+", Prices: "+getarraysize($@arena_ar),bc_self;
  697. // Bounty Calculation:
  698. // Scroll down till the line with "function getBounty {", should be near Line 813
  699. if($@debug) announce "Bounty Settings loaded: "+$@bty_type,bc_self;
  700. // ============ GvG Settings ============//
  701. set $@mpgld,20; //Max Guild Members per Guild
  702. if($@debug) announce "Max Members per Guild loaded: "+$@mpgld,bc_self;
  703. set $@mgvg,$@mpgld*2; // Total Members per Arena.
  704. if($@debug) announce "Max Members per Arena loaded: "+$@mgvg,bc_self;
  705. set $@same_gld,1; // Same Guild requirement: 1 = On / 0 = Off
  706. if($@debug) announce "Same Guild Requirement loaded: "+$@same_gld,bc_self;
  707. setarray $@gvgr$[0],"guild_vs1","guild_vs2","guild_vs3","guild_vs4","guild_vs5";
  708. if($@debug) announce "Guild Maps loaded: "+$@gvgr$[0],bc_self;
  709. // If you want to add more mapflags, add them before the "10" > mf_gvg_noparty
  710. setarray $@gvg_mf[0],0,1,2,3,4,5,9,11,13,15,22,33,34,35,38,41,44,10;
  711. if($@debug) announce "Guild Mapflags loaded: "+getarraysize($@gvg_mf),bc_self;
  712. if($@same_gld) {
  713. // Guild Map Coordinates - used if $@same_gld is enabled
  714. // Every Guild has two coordinates to spawn from:
  715. // Guild 1: gld1_ > x1+y1 = North, x2+y2 = East
  716. setarray $@gvg_gld1_x1[0],9,9,12,8,18;
  717. setarray $@gvg_gld1_y1[0],50,50,51,49,50;
  718. setarray $@gvg_gld1_x2[0],50,50,50,50,49;
  719. setarray $@gvg_gld1_y2[0],7,7,13,8,23;
  720. // Guild 2: gld2_ > x1+y1 = West, x2+y2 = South
  721. setarray $@gvg_gld2_x1[0],50,50,49,50,49;
  722. setarray $@gvg_gld2_y1[0],91,91,86,91,76;
  723. setarray $@gvg_gld2_x2[0],92,92,86,91,79;
  724. setarray $@gvg_gld2_y2[0],50,50,51,49,49;
  725. if($@debug) announce "Guild 1 Map Coordinates 1 loaded: X - "+getarraysize($@gvg_gld1_x1) +" & Y - "+getarraysize($@gvg_gld1_y1),bc_self;
  726. if($@debug) announce "Guild 1 Map Coordinates 2 loaded: X - "+getarraysize($@gvg_gld1_x2) +" & Y - "+getarraysize($@gvg_gld1_y2),bc_self;
  727. if($@debug) announce "Guild 2 Map Coordinates 1 loaded: X - "+getarraysize($@gvg_gld2_x1) +" & Y - "+getarraysize($@gvg_gld2_y1),bc_self;
  728. if($@debug) announce "Guild 2 Map Coordinates 2 loaded: X - "+getarraysize($@gvg_gld2_x2) +" & Y - "+getarraysize($@gvg_gld2_y2),bc_self;
  729. }
  730. // ======= Auto Mapflag Adding ===============//
  731. for ( set .@m,0; .@m < getarraysize($@gvgr$); set .@m,.@m + 1 ) {
  732. if($@debug) announce "Array Reading of GvG Maps complete",bc_self;
  733. if($@debug) announce "Mapflag set at "+$@gvgr$[.@m] + " initiate...",bc_self;
  734.  
  735. // Use this if you disallows parties
  736. // for ( set .@mf,0; .@mf < getarraysize($@gvg_mf); set .@mf,.@mf + 1 ) {
  737.  
  738. // Use this if you allow parties
  739. for ( set .@mf,0; .@mf < (getarraysize($@gvg_mf) - 1); set .@mf,.@mf + 1 ) {
  740. setmapflag $@gvgr$[.@m],$@gvg_mf[.@mf];
  741. if($@debug) announce "Mapflag "+ $@gvg_mf[.@mf] +" set at "+$@gvgr$[.@m] + " complete",bc_self;
  742. }
  743. }
  744. if($@debug) announce "Guild Mapflag loading completed",bc_self;
  745. // ============ PvP Settings ============//
  746. // If you want to add more mapflags, add them before the "7" > mf_pvp_noparty
  747. setarray $@pvp_mf[0],0,1,2,3,4,5,7,11,13,22,33,34,35,38,41,44,7;
  748. if($@debug) announce "PvP Mapflags loaded: "+getarraysize($@pvp_mf),bc_self;
  749. // ============= PvP Room Settings =======//
  750. setarray $@room$[1],"Prontera","Alberta","Izlude","Payon","Morroc";
  751. setarray $@muser[1],70,45,30,55,60;
  752. if($@debug) announce "PvP Town Maps loaded: "+$@room$[1],bc_self;
  753. // Dispell PvP
  754. setarray $@disppvp$[1],"pvp_y_1-1","pvp_y_1-4","pvp_y_1-2","pvp_y_1-3","pvp_y_1-5";
  755. if($@debug) announce "PvP Dispell Maps loaded: "+$@disppvp$[1],bc_self;
  756. // ======= Auto Mapflag Adding - Dispell PvP ===============//
  757. for ( set .@m,1; .@m < getarraysize($@disppvp$); set .@m,.@m + 1 ) {
  758. if($@debug) announce "Array Reading of Dispell PvP Maps complete",bc_self;
  759. if($@debug) announce "Mapflag set at "+$@disppvp$[.@m] + " initiate...",bc_self;
  760. // Use this if you disallows parties
  761. // for ( set .@mf,0; .@mf < getarraysize($@pvp_mf); set .@mf,.@mf + 1 ) {
  762.  
  763. // Use this if you allow parties
  764. for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
  765. setmapflag $@disppvp$[.@m],$@pvp_mf[.@mf];
  766. if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@disppvp$[.@m] + " complete",bc_self;
  767. }
  768. }
  769. if($@debug) announce "PvP Dispell Mapflags loaded.",bc_self;
  770. // Normal PvP
  771. setarray $@npvp$[1],"pvp_y_2-1","pvp_y_2-4","pvp_y_2-2","pvp_y_2-3","pvp_y_2-5";
  772. if($@debug) announce "PvP Normal Maps loaded: "+$@npvp$[0],bc_self;
  773. // ======= Auto Mapflag Adding - Normal PvP ===============//
  774. for ( set .@m,1; .@m < getarraysize($@npvp$); set .@m,.@m + 1 ) {
  775. if($@debug) announce "Array Reading of Normal PvP Maps complete",bc_self;
  776. if($@debug) announce "Mapflag set at "+$@npvp$[.@m] + " initiate...",bc_self;
  777. // Use this if you disallows parties
  778. // for ( set .@mf,0; .@mf < getarraysize($@pvp_mf); set .@mf,.@mf + 1 ) {
  779.  
  780. // Use this if you allow parties
  781. for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
  782. setmapflag $@npvp$[.@m],$@pvp_mf[.@mf];
  783. if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@npvp$[.@m] + " complete",bc_self;
  784. }
  785. }
  786. if($@debug) announce "PvP Normal Mapflags loaded.",bc_self;
  787. // ================== Deathmatch Settings + Maps ================
  788. setarray $@dmpvp$[1],"pvp_y_3-1","pvp_y_3-4","pvp_y_3-2","pvp_y_3-3","pvp_y_3-5";
  789. if($@debug) announce "PvP DM Maps loaded: "+$@dmpvp$[0],bc_self;
  790. // ======= Auto Mapflag Adding - DM PvP ===============//
  791. for ( set .@m,1; .@m < getarraysize($@dmpvp$); set .@m,.@m + 1 ) {
  792. if($@debug) announce "Array Reading of DM PvP Maps complete",bc_self;
  793. if($@debug) announce "Mapflag set at "+$@dmpvp$[.@m] + " initiate...",bc_self;
  794. // Use this if you disallows parties
  795. // for ( set .@mf,0; .@mf < getarraysize($@pvp_mf); set .@mf,.@mf + 1 ) {
  796.  
  797. // Use this if you allow parties
  798. for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
  799. setmapflag $@dmpvp$[.@m],$@pvp_mf[.@mf];
  800. if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@dmpvp$[.@m] + " complete",bc_self;
  801. }
  802. }
  803. if($@debug) announce "PvP DM Mapflags loaded.",bc_self;
  804. // ================= Party PvP Settings =================
  805. // ========= 2vs2 Party PvP ==========//
  806. setarray $@pt2pvp$[1],"pvp_y_4-1","pvp_y_4-4","pvp_y_4-2","pvp_y_4-3","pvp_y_4-5";
  807. if($@debug) announce "Party PvP 2vs2 Maps loaded: "+$@pt2pvp$[0],bc_self;
  808. // 3vs3 Party PvP
  809. setarray $@pt3pvp$[1],"pvp_y_5-1","pvp_y_5-4","pvp_y_5-2","pvp_y_5-3","pvp_y_5-5";
  810. if($@debug) announce "Party PvP 3vs3 Maps loaded: "+$@pt3pvp$[0],bc_self;
  811. // 4vs4 Party PvP
  812. setarray $@pt4pvp$[1],"pvp_y_6-1","pvp_y_6-4","pvp_y_6-2","pvp_y_6-3","pvp_y_6-5";
  813. if($@debug) announce "Party PvP 4vs4 Maps loaded: "+$@pt4pvp$[0],bc_self;
  814. // 5vs5 Party PvP
  815. setarray $@pt5pvp$[1],"pvp_y_7-1","pvp_y_7-4","pvp_y_7-2","pvp_y_7-3","pvp_y_7-5";
  816. if($@debug) announce "Party PvP 5vs5 Maps loaded: "+$@pt5pvp$[0],bc_self;
  817. // ======= Auto Mapflag Adding ===============//
  818. // ============== Party 2vs2 =================//
  819. if($@debug) announce "Array Reading of Party 2vs2 PvP Maps - configuring",bc_self;
  820. for ( set .@m,1; .@m < getarraysize($@pt2pvp$); set .@m,.@m + 1 ) {
  821. if($@debug) announce "Mapflag set at "+$@pt2pvp$[.@m] + " initiate...",bc_self;
  822. for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
  823. setmapflag $@pt2pvp$[.@m],$@pvp_mf[.@mf];
  824. if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@pt2pvp$[.@m] + " complete",bc_self;
  825. }
  826. }
  827. if($@debug) announce "Party 2v2 PvP Mapflags loaded.",bc_self;
  828. sleep2 100;
  829. // ============== Party 3vs3 =================//
  830. if($@debug) announce "Array Reading of Party 3vs3 PvP Maps - configuring",bc_self;
  831. for ( set .@m,1; .@m < getarraysize($@pt3pvp$); set .@m,.@m + 1 ) {
  832. if($@debug) announce "Mapflag set at "+$@pt3pvp$[.@m] + " initiate...",bc_self;
  833. for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
  834. setmapflag $@pt3pvp$[.@m],$@pvp_mf[.@mf];
  835. if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@pt3pvp$[.@m] + " complete",bc_self;
  836. }
  837. }
  838. if($@debug) announce "Party 3v3 PvP Mapflags loaded.",bc_self;
  839. sleep2 100;
  840. // ============== Party 4vs4 =================//
  841. if($@debug) announce "Array Reading of Party 4vs4 PvP Maps - configuring",bc_self;
  842. for ( set .@m,1; .@m < getarraysize($@pt4pvp$); set .@m,.@m + 1 ) {
  843. if($@debug) announce "Mapflag set at "+$@pt4pvp$[.@m] + " initiate...",bc_self;
  844. for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
  845. setmapflag $@pt4pvp$[.@m],$@pvp_mf[.@mf];
  846. if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@pt4pvp$[.@m] + " complete",bc_self;
  847. }
  848. }
  849. if($@debug) announce "Party 4v4 PvP Mapflags loaded.",bc_self;
  850. sleep2 100;
  851. // ============== Party 5vs5 =================//
  852. if($@debug) announce "Array Reading of Party 5vs5 PvP Maps - configuring",bc_self;
  853. for ( set .@m,1; .@m < getarraysize($@pt5pvp$); set .@m,.@m + 1 ) {
  854. if($@debug) announce "Mapflag set at "+$@pt5pvp$[.@m] + " initiate...",bc_self;
  855. for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
  856. setmapflag $@pt5pvp$[.@m],$@pvp_mf[.@mf];
  857. if($@debug) announce "Mapflag "+ $@pvp_mf[.@mf] +" set at "+$@pt5pvp$[.@m] + " complete",bc_self;
  858. }
  859. }
  860. if($@debug) announce "Party 5v5 PvP Mapflags loaded.",bc_self;
  861. sleep2 100;
  862. if($@debug) announce "Party PvP Mapflags loaded.",bc_self;
  863. function writeStats;
  864. if($@debug) announce "Write Stats Function loaded.",bc_self;
  865. function getBounty;
  866. function writeBounty;
  867. if($@debug) announce "Bounty Function loaded.",bc_self;
  868. function doPromote;
  869. if($@debug) announce "Promote Function loaded.",bc_self;
  870. if(.@re_in) goto OnWhisperGlobal;
  871. end;
  872.  
  873. OnPCKillEvent:
  874. if(compare(strcharinfo(3),"pvp_y_") == 0 && compare(strcharinfo(3),"guild_vs") == 0) end;
  875. if(getmapflag(strcharinfo(3),mf_pvp) == 0 && getmapflag(strcharinfo(3),mf_gvg) == 0) end;
  876. set .@v,killedrid;
  877. mapannounce strcharinfo(3),strcharinfo(0) + " has killed "+rid2name(.@v)+"!!!!!",0;
  878. set @killct,@killct + 1;
  879. switch(@killct) {
  880. case 1:
  881. if(@first) {
  882. mapannounce strcharinfo(3),strcharinfo(0) + " has achieved First Blood!!!!",0;
  883. soundeffectall "firstblood.wav",0,strcharinfo(3);
  884. set @first,0;
  885. }
  886. break;
  887.  
  888. case 3:
  889. mapannounce strcharinfo(3),strcharinfo(0) + " is now on Killing Spree!!!!",0;
  890. soundeffectall "killingspree.wav",0,strcharinfo(3);
  891. set @sphr,1;
  892. break;
  893.  
  894. case 5:
  895. mapannounce strcharinfo(3),strcharinfo(0) + " is now on Dominating!!!!",0;
  896. soundeffectall "dominating.wav",0,strcharinfo(3);
  897. set @sphr,2;
  898. break;
  899.  
  900. case 7:
  901. mapannounce strcharinfo(3),strcharinfo(0) + " is now on Mega Kill!!!!",0;
  902. soundeffectall "megakill.wav",0,strcharinfo(3);
  903. set @sphr,3;
  904. break;
  905.  
  906. case 9:
  907. mapannounce strcharinfo(3),strcharinfo(0) + " is now on Unstoppable!!!!",0;
  908. soundeffectall "unstoppable.wav",0,strcharinfo(3);
  909. set @sphr,4;
  910. break;
  911.  
  912. case 11:
  913. mapannounce strcharinfo(3),strcharinfo(0) + " is now on Wicked Sick!!!!",0;
  914. soundeffectall "wickedsick.wav",0,strcharinfo(3);
  915. set @sphr,5;
  916. break;
  917.  
  918. case 13:
  919. mapannounce strcharinfo(3),strcharinfo(0) + " is now on Monster Kill!!!!",0;
  920. soundeffectall "monsterkill.wav",0,strcharinfo(3);
  921. set @sphr,6;
  922. break;
  923.  
  924. case 15:
  925. mapannounce strcharinfo(3),strcharinfo(0) + " is now on GodLike!!!!",0;
  926. soundeffectall "godlike.wav",0,strcharinfo(3);
  927. set @sphr,7;
  928. break;
  929.  
  930. case 17:
  931. mapannounce strcharinfo(3),strcharinfo(0) + " is now on Holy Sh1t!!!!",0;
  932. soundeffectall "holyshit.wav",0,strcharinfo(3);
  933. set @sphr,8;
  934. break;
  935.  
  936. default:
  937. if(@killct > 17) {
  938. mapannounce strcharinfo(3),strcharinfo(0) + " is now on Holy Sh1t!!!!",0;
  939. soundeffectall "holyshit.wav",0,strcharinfo(3);
  940. }
  941. break;
  942. }
  943. set @prokill,@prokill + 1;
  944. doPromote;
  945.  
  946.  
  947. set @mkillct,@mkillct + 1;
  948. deltimer strnpcinfo(0)+"::OnMultiSpan";
  949. addtimer $@multi,strnpcinfo(0)+"::OnMultiSpan";
  950. if(@mkillct >= 2) sleep2 500; // Slowing down multi-kill sound effects
  951. if(@mkillct == 2) {
  952. mapannounce strcharinfo(3),strcharinfo(0) + " has made an Double Kill!!!!",0;
  953. soundeffectall "doublekill.wav",0,strcharinfo(3);
  954. } else if(@mkillct == 3) {
  955. mapannounce strcharinfo(3),strcharinfo(0) + " has made an Triple Kill!!!!",0;
  956. soundeffectall "triplekill.wav",0,strcharinfo(3);
  957. } else if(@mkillct >= 4) {
  958. mapannounce strcharinfo(3),strcharinfo(0) + " has made an Ultra Kill!!!!",0;
  959. soundeffectall "ultrakill.wav",0,strcharinfo(3);
  960. }
  961. if($@bty_type && $@pvptable) {
  962. if(@sphr >= $@bty_bon_start) {
  963. mapannounce strcharinfo(3),"Bounty Hunter: Oh My God!!! Someone stop "+strcharinfo(0)+" please!!! I'll give you a bonus of "+$@bty_bonus+" on "+ ( (Sex)?"his":"her") +" head!!",0;
  964. set @sphr,@sphr + $@bty_bonus;
  965. }
  966. query_sql("SELECT `bounty` FROM `arena_master` WHERE `char_id` = '"+getcharid(0,rid2name(.@v))+"'",@bty);
  967. getBounty(@bty,.@v);
  968. writeBounty(@sphr);
  969. }
  970. if(@killct%5==0) message strcharinfo(0),"Defeated Players: "+@killct;
  971. end;
  972.  
  973. OnPCDieEvent:
  974. // ===== Should affects you only, if you warped to an player via @warpto/@goto or were @recall-ed
  975. // ==== so you won't recieve a value for @map, which is required for the respawn in DM Maps
  976. if(!@map) {
  977. for( set @m,1; @m < getarraysize($@dmpvp$); set @m,@m + 1)
  978. if(strcharinfo(3) == $@dmpvp$[@m]) {
  979. set @map,@m;
  980. break;
  981. }
  982. }
  983. if($@pvptable) {
  984. writeStats(getcharid(0),@killct,1);
  985. if($@bty_type) writeBounty(@sphr);
  986.  
  987. }
  988. set @sphr,0;
  989. set @killct,0;
  990.  
  991. if($@same_gld && @gvgc > 0) {
  992. if(getd("$@gvg_"+@gvgc+"_gld_1") == getcharid(2)) {
  993. setd("$@gvg_"+@gvgc+"_1_ppl"),getd("$@gvg_"+@gvgc+"_1_ppl") - 1;
  994. if(getd("$@gvg_"+@gvgc+"_1_ppl") < 1) setd("$@gvg_"+@gvgc+"_gld_1"),0;
  995. } else if(getd("$@gvg_"+@gvgc+"_gld_2") == getcharid(2)) {
  996. setd("$@gvg_"+@gvgc+"_2_ppl"),getd("$@gvg_"+@gvgc+"_2_ppl") - 1;
  997. if(getd("$@gvg_"+@gvgc+"_2_ppl") < 1) setd("$@gvg_"+@gvgc+"_gld_2"),0;
  998. }
  999. set @gvg_c,0;
  1000. }
  1001. if(strcharinfo(3) == $@dmpvp$[@map]) {
  1002. sleep2 1500;
  1003. if(killerrid != getcharid(3)) {
  1004. warp strcharinfo(3),0,0;
  1005. if(HP == 0) atcommand "@alive";
  1006. percentheal 100,100;
  1007. } else warp "SavePoint",0,0;
  1008. }
  1009. end;
  1010.  
  1011. OnMultiSpan:
  1012. set @mkillct,0;
  1013. end;
  1014.  
  1015. OnPCLogOutEvent:
  1016. if(compare(strcharinfo(3),"pvp_y_") == 0 || compare(strcharinfo(3),"guild_vs") == 0) end;
  1017. if(getmapflag(strcharinfo(3),mf_pvp) == 0 || getmapflag(strcharinfo(3),mf_gvg) == 0) end;
  1018. if($@pvptable) {
  1019. writeStats(getcharid(0),@killct,0);
  1020. if(@prodo)
  1021. if(query_sql("SELECT `char_id` FROM `arena_master` WHERE `char_id` = '"+getcharid(0)+"'",@charid) != 0) // Should never happen, but to prevent bugs :I
  1022. query_sql "UPDATE `arena_master` SET `killer` = `killer` + "+@killer+" , `domi` = `domi` + "+@domi+" , `mega` = `mega` + "+@mega+" , `unstopp` = `unstopp` + "+@unstopp+" , `wicked` = `wicked` + "+@wicked+" , `monster` = `monster` + "+@monster+" , `godlike` = `godlike` + "+@godlike+" , `holys` = `holys` + "+@holys+" WHERE `char_id` = '"+getcharid(0)+"'";
  1023. }
  1024. if($@same_gld && @gvgc > 0) {
  1025. if(getd("$@gvg_"+@gvgc+"_gld_1") == getcharid(2)) setd("$@gvg_"+@gvgc+"_1_ppl"),getd("$@gvg_"+@gvgc+"_1_ppl") - 1;
  1026. else if(getd("$@gvg_"+@gvgc+"_gld_2") == getcharid(2)) setd("$@gvg_"+@gvgc+"_2_ppl"),getd("$@gvg_"+@gvgc+"_2_ppl") - 1;
  1027. }
  1028. end;
  1029.  
  1030. OnNPCKillEvent:
  1031. if(!$@pvptable) end;
  1032. if(compare(strcharinfo(3),"pvp_n_") == 0) end; // Only working in the MvP Arena
  1033. if(getmonsterinfo(killedrid,MOB_MODE) & 32) { // 32 = Mini-Boss & MvP Flag (There is no solo-flag for MvP q.q)
  1034. if(query_sql("SELECT `char_id` FROM `arena_master` WHERE `char_id` = '"+getcharid(0)+"'",@charid) != 0)
  1035. query_sql "UPDATE `arena_master` SET `mvp` = `mvp` + 1 WHERE `char_id` = '"+getcharid(0)+"'";
  1036. else query_sql "INSERT INTO `arena_master` ( `char_id` , `mvp`) VALUES ( '"+getcharid(0)+"' , '1' )";
  1037. }
  1038. end;
  1039.  
  1040. function writeStats {
  1041. if(!$@pvptable) return; // To be save :O
  1042. set @c,getarg(0); // Char ID
  1043. set @k,getarg(1); // Kills
  1044. set @d,getarg(2); // Deaths
  1045. if(query_sql("SELECT `char_id` FROM `arena_master` WHERE `char_id` = '"+@c+"'",@charid) != 0) {
  1046. if(@k > query_sql("SELECT `hscore` FROM `arena_master` WHERE `char_id` = '"+@c+"'",@hscore)) set @hscore,@k;
  1047. query_sql "UPDATE `arena_master` SET `kills` = `kills` + "+@k+", `death` = `death` + "+@d+" , `hscore` = '"+@hscore+"' WHERE `char_id` = '"+@c+"'";
  1048. } else query_sql "INSERT INTO `arena_master` ( `char_id` , `kills` , `death` , `hscore` ) VALUES ( '"+@c+"' , '"+@k+"' , '"+@d+"' , '"+@hscore+"' )";
  1049. return;
  1050. }
  1051.  
  1052. function doPromote {
  1053. set @prodo,1; // Check for OnPCLogOutEvent
  1054. switch(@sphr) { // Sphree Index
  1055. case 1:
  1056. if(@prokill/$@promo == 1) set @killer,@killer + 1;
  1057. break;
  1058.  
  1059. case 2:
  1060. if(@prokill/$@promo == 1) set @domi,@domi + 1;
  1061. break;
  1062.  
  1063. case 3:
  1064. if(@prokill/$@promo == 1) set @mega,@mega + 1;
  1065. break;
  1066.  
  1067. case 4:
  1068. if(@prokill/$@promo == 1) set @unstopp,@unstopp + 1;
  1069. break;
  1070.  
  1071. case 5:
  1072. if(@prokill/$@promo == 1) set @wicked,@wicked + 1;
  1073. break;
  1074.  
  1075. case 6:
  1076. if(@prokill/$@promo == 1) set @monster,@monster + 1;
  1077. break;
  1078.  
  1079. case 7:
  1080. if(@prokill/$@promo == 1) set @godlike,@godlike + 1;
  1081. break;
  1082.  
  1083. case 8:
  1084. if(@prokill/$@promo == 1) set @holys,@holys+ 1;
  1085. break;
  1086. }
  1087. set @prokill,0;
  1088. return;
  1089. }
  1090.  
  1091. function getBounty {
  1092. // getarg(0) == Last Sphree of Victim
  1093. // getarg(1) == RID of Victim
  1094. if(!getarg(0)) return; // No Sphree = No Bounty ;I
  1095. // Calculation:
  1096. // Exchange the */+ with the symbol you want,
  1097. // but note that it can be exploited if you change it too much,
  1098. // like 8 (Sphree Index)*$@bty_price (Cash Points,5) = 40 CASHPOINTS
  1099. switch($@bty_type) { // Bounty Reward Type
  1100. case 1: // Zeny
  1101. set Zeny,Zeny + ($@bty_price*getarg(0));
  1102. dispbottom "Bounty Hunter: You have recieved "+($@bty_price*getarg(0))+" Zeny for killing "+rid2name(getarg(1))+".";
  1103. break;
  1104.  
  1105. case 2: // Cash Points
  1106. set #CASHPOINTS,#CASHPOINTS + ($@bty_price+getarg(0));
  1107. dispbottom "Bounty Hunter: You have recieved "+($@bty_price+getarg(0))+" Cash Points for killing "+rid2name(getarg(1))+".";
  1108. dispbottom "You have now "+#CASHPOINTS+" Cash Points.";
  1109. break;
  1110.  
  1111. case 3: // Bounty Points
  1112. query_sql "UPDATE `arena_master` SET `bounty_pts` = `bounty_pts` + "+($@bty_price+getarg(0))+" WHERE `char_id` = '"+getcharid(0)+"'";
  1113. dispbottom "Bounty Hunter: You have recieved "+($@bty_price+getarg(0))+" Bounty Points for killing "+rid2name(getarg(1))+".";
  1114. break;
  1115. }
  1116. if(getarg(0) >= $@bty_bon_start)
  1117. mapannounce strcharinfo(3),"Bounty Hunter: "+strcharinfo(0)+" has ended "+rid2name(getarg(1))+"'s Spree and was rewarded with "+($@bty_price*getarg(0))+" " + ( ($@bty_type == 1)?"Zeny": ( ($@bty_type == 2)?"Cash Points":"Bounty Points") ),0;
  1118. return;
  1119. }
  1120.  
  1121. function writeBounty {
  1122. query_sql "UPDATE `arena_master` SET `bounty` = '"+getarg(0)+"' WHERE `char_id` = '"+getcharid(0)+"'";
  1123. return;
  1124. }
  1125.  
  1126. OnWhisperGlobal:
  1127. if(!getgmlevel()) end;
  1128. set .@re_in,0;
  1129. set $@debug,0;
  1130. if(select("- ReLoad:- Nevermind") == 2) close;
  1131. if(select("- Debug:- Without Debug") == 1) set $@debug,1;
  1132. set .@re_in,1;
  1133. goto OnInit;
  1134. end;
  1135. }
  1136.  
  1137. pvp_y_1-1 mapflag pvp_noguild
  1138. pvp_y_1-1 mapflag pvp_noparty
  1139. pvp_y_1-4 mapflag pvp_noparty
  1140. pvp_y_1-2 mapflag pvp_noparty
  1141. pvp_y_1-3 mapflag pvp_noparty
  1142. pvp_y_1-5 mapflag pvp_noparty
  1143. pvp_y_2-1 mapflag pvp_noparty
  1144. pvp_y_2-4 mapflag pvp_noparty
  1145. pvp_y_2-2 mapflag pvp_noparty
  1146. pvp_y_2-3 mapflag pvp_noparty
  1147. pvp_y_2-5 mapflag pvp_noparty
  1148. pvp_y_3-1 mapflag pvp_noparty
  1149. pvp_y_3-4 mapflag pvp_noparty
  1150. pvp_y_3-2 mapflag pvp_noparty
  1151. pvp_y_3-3 mapflag pvp_noparty
  1152. pvp_y_3-5 mapflag pvp_noparty
  1153. pvp_y_1-1 mapflag pvp_noguild
  1154. pvp_y_1-1 mapflag pvp_noguild
  1155. pvp_y_1-4 mapflag pvp_noguild
  1156. pvp_y_1-2 mapflag pvp_noguild
  1157. pvp_y_1-3 mapflag pvp_noguild
  1158. pvp_y_1-5 mapflag pvp_noguild
  1159. pvp_y_2-1 mapflag pvp_noguild
  1160. pvp_y_2-4 mapflag pvp_noguild
  1161. pvp_y_2-2 mapflag pvp_noguild
  1162. pvp_y_2-3 mapflag pvp_noguild
  1163. pvp_y_2-5 mapflag pvp_noguild
  1164. pvp_y_3-1 mapflag pvp_noguild
  1165. pvp_y_3-4 mapflag pvp_noguild
  1166. pvp_y_3-2 mapflag pvp_noguild
  1167. pvp_y_3-3 mapflag pvp_noguild
  1168. pvp_y_3-5 mapflag pvp_noguild
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement