Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.72 KB | None | 0 0
  1. //===== rAthena Script =======================================
  2. //= Automated MVP Ladder and reward system
  3. //===== By: ==================================================
  4. //= pajodex
  5. //===== Current Version: =====================================
  6. //= 4.3
  7. //===== Compatible With: =====================================
  8. //= rAthena Project (pajodex)
  9. //===== Description: =========================================
  10. /*
  11.  
  12. - MVP Ladder which is fully automated.
  13. - Just leave it on and NPC will do the rest.
  14. - Easy configure
  15. - Added @mvpreset command to reset the ladder. It will also reset the
  16. monthly and weekly if it is on the '.day' and '.week' at settings
  17. - Updated with latest mail command https://github.com/rathena/rathena/commit/5b13dc7009e312585bba0ea55d77fc5afa8aecad
  18.  
  19. New Feature:
  20. * Event will only trigger to MVPs in their respective maps..
  21. * If amon ra is killed outside moc_pryd06, script wont trigger..
  22.  
  23.  
  24. */
  25. //=====******** Note ********=================================
  26. //= if you find bugs or problem, please do tell DM me at
  27. //= Discord (pajodex#1328) or rAthena (pajodex)
  28. //= open for suggestions
  29. //===== Additional Comments: =================================
  30. // 1.0 - Initial release (MVP Kill standalone)
  31. // 2.0 - Added SQL based with ladder
  32. // Added automatic reward system
  33. // Added functions
  34. // Added bitwise variables
  35. // Optimization
  36. // 2.1 - Cleaned the script
  37. // updated title
  38. // 2.2 - Fixed error on reward if players are offline
  39. // 2.3 - Added nobranch mapflags to all maps listed (Sukea23 via discord)
  40. // 2.4 - Ranking fixed (reported by Sukea23)
  41. // 3.0 - Script optimization and re-work
  42. // added new ranker feature : view your rank
  43. // added mvp ladder points system
  44. // added simple mvp ladder shop
  45. // 3.1 - Fix ranking issues on tie-cases (reported by Heikenz) https://rathena.org/board/topic/114565-utility-automated-mvp-ladder-reward-system/?do=findComment&comment=344981
  46. // added item as currency support in ladder shop (Heikenz)
  47. // modified F_CheckMvpLadder function
  48. // Special Thanks to : AnnieRuru for mentoring me.
  49. // 4.0 - Updated to latest svn
  50. // Now uses *mail script command. You must UPDATE your trunk
  51. // or apply this commit https://github.com/rathena/rathena/commit/5b13dc7009e312585bba0ea55d77fc5afa8aecad
  52. // Script Optimization
  53. // Script Rework
  54. // Now uses a new SQL table that utilizes InnoDB instead of MyISAM
  55. // 4.1 - Fix repeat reward issue. Reported by Emperor via Discord
  56. // 4.2 - Fix loop reports.
  57. // 4.3 - Fix missing MVP Shop
  58. // -------------------------------------------------------
  59. // How to use F_MVPReward:
  60. // F_MVPReward ( <tablename>, <Num of players to get reward (default : 10)>, <rewardarrays> )
  61. // This will allow you to set the number of players to receive
  62. // the rewards. For small population server, you can set this to 5 or
  63. // any amount as you wish.
  64. // This update is in-response to Holograma's question in the post:
  65. // https://rathena.org/board/topic/114565-utility-automated-mvp-ladder-reward-system/?tab=comments#comment-341725
  66. //===== Credits goes to: =====================================
  67. //= hurtsky
  68. //= secret
  69. //= sader1992
  70. //= Stolao
  71. //= Euphy
  72. //= AnnieRuru
  73. //=============================================================
  74. prontera,165,104,3 script MVP Ranking 923,{
  75. function F_CheckMvpLadder;
  76. function F_CheckRank;
  77. function F_MVPReset;
  78. function F_MVPReward;
  79.  
  80. mes .nm$;
  81. mes "Hello "+strcharinfo(0)+",";
  82. mes " ";
  83. mes "How may I help you?";
  84. next;
  85. switch(select("My Status",(.Option&1) ? "Daily Ranking":"" ,(.Option&2) ? "Weekly Ranking":"",(.Option&4) ? "Monthly Ranking":"","All Time Ranking",( getgmlevel() >= 99 ) ? "^ff0000[ GM ] Reset ladder^000000":"" ,(.Option&16) ? "Open MVP Ladder Shop":"","Information","Nothing...")) {
  86. mes .nm$;
  87. case 1:
  88. mes "You've got:";
  89. if(.Option&1)
  90. {
  91. query_sql("SELECT `day_kills`, 1+(SELECT COUNT(1) FROM `mvp_ladder_rank` t1 WHERE t1.day_kills > t2.day_kills) FROM `mvp_ladder_rank` t2 WHERE `char_id` = "+ getcharid(0), .@dkill_count, .@rank );
  92. if (.@dkill_count == 0) {
  93. F_CheckRank ( "daily" );
  94. } else {
  95. mes " ~ ^FF0000" +.@dkill_count+ "^000000 kills and ranks ^FF0000" +.@rank+ "^000000 place today.";
  96. }
  97. }
  98. if(.Option&2)
  99. {
  100. query_sql("SELECT `week_kills`, 1+(SELECT COUNT(1) FROM `mvp_ladder_rank` t1 WHERE t1.week_kills > t2.week_kills) FROM `mvp_ladder_rank` t2 WHERE `char_id` = "+ getcharid(0), .@wkill_count, .@rank );if (.@wkill_count == 0) {
  101. F_CheckRank ( "weekly" );
  102. } else {
  103. mes " ~ ^FF0000" +.@wkill_count+ "^000000 kills and ranks ^FF0000" +.@rank+ "^000000 place this week.";
  104. }
  105. }
  106. if(.Option&4)
  107. {
  108. query_sql("SELECT `month_kills`, 1+(SELECT COUNT(1) FROM `mvp_ladder_rank` t1 WHERE t1.month_kills > t2.month_kills) FROM `mvp_ladder_rank` t2 WHERE `char_id` = "+ getcharid(0), .@mkill_count, .@rank );if (.@mkill_count == 0) {
  109. F_CheckRank ( "monthly" );
  110. } else {
  111. mes " ~ ^FF0000" +.@mkill_count+ "^000000 kills and ranks ^FF0000" +.@rank+ "^000000 place this month.";
  112. }
  113. }
  114. query_sql( "SELECT all_kills, find_in_set( all_kills, ( SELECT group_concat( all_kills order by all_kills desc ) from mvp_ladder_rank ) ) from mvp_ladder_rank where char_id = "+ getcharid(0), .@akill_count, .@rank );
  115. mes " ~ Over all score of ^FF0000" +.@akill_count+ "^000000 kills and ranks ^FF0000" +.@rank+ "^000000 place all time.";
  116. close;
  117.  
  118. case 2:
  119. F_CheckMvpLadder ( "day_kills" );
  120. close;
  121.  
  122. case 3:
  123. F_CheckMvpLadder ( "week_kills" );
  124. close;
  125.  
  126. case 4:
  127. F_CheckMvpLadder ( "month_kills" );
  128. close;
  129.  
  130. case 5:
  131. F_CheckMvpLadder ( "all_kills" );
  132. close;
  133.  
  134. case 6:
  135. switch(select((.Option&1) ? "Reset daily records":"",(.Option&2) ? "Reset weekly records":"",(.Option&4) ? "Reset monthly records":"","Reset everything")) {
  136. case 1:
  137. F_MVPReset ( "day_kills" );
  138. close;
  139.  
  140. case 2:
  141. F_MVPReset ( "week_kills" );
  142. close;
  143.  
  144. case 3:
  145. F_MVPReset ( "month_kills" );
  146. close;
  147.  
  148. case 4:
  149. if ( select( "Confirm","Cancel" ) == 1 ) {
  150. query_sql "TRUNCATE TABLE `mvp_ladder_rank`";
  151. close;
  152. }
  153. }
  154. break;
  155.  
  156. case 7:
  157. if ( !.ladderitem ) {
  158. if(!#MVPLADPOINTS) {
  159. mes "You don't have any mvp points, you cant purchase anything.";
  160. close;
  161. }
  162. mes "You currently have "+ #MVPLADPOINTS +" mvp ladder points.";
  163. } else {
  164. if(!countitem(.item)) {
  165. mes "You don't have any ^FF0000"+ getitemname( .item ) +"^000000, you cant purchase anything.";
  166. close;
  167. }
  168. mes "You currently have "+ countitem( .item ) +" x "+ getitemname( .item ) +" in your inventory.";
  169. }
  170. callshop "mvp_ladder_shop_q",1;
  171. npcshopattach "mvp_ladder_shop_q";
  172. end;
  173.  
  174. case 8:
  175. // Information menu part
  176. mes .nm$;
  177. mes "Mvp ladder will automatically reset every day, week, and month.";
  178. next;
  179. mes .nm$;
  180. mes "Before the ladder resets, the TOP MVP Hunter will be rewarded via ^FF0000RODex^000000 (mail) during the next day 12:00 A.M.";
  181. next;
  182. mes .nm$;
  183. mes "Note that only MVPs on their respective maps will be counted in the ladder. MVP Arena or else where will not.";
  184. next;
  185. if(.Option&16) {
  186. mes .nm$;
  187. mes "You can also gain 'MVP ladder points' for killing mvps for "+ .point +" points per kill";
  188. next;
  189. mes .nm$;
  190. mes "If you are in a party, points will be divided equally to each party members.";
  191. next;
  192. mes .nm$;
  193. mes "Points can be used in MVP Ladder shop to buy items.";
  194. next;
  195. }
  196. mes .nm$;
  197. mes "Goodluck ~";
  198. close;
  199.  
  200. default:
  201. close;
  202. }
  203.  
  204. OnBuyItem:
  205. for(set .@i,0; .@i<getarraysize(@bought_nameid); set .@i,.@i+1)
  206. for(set .@j,0; .@j<getarraysize(.Shop); set .@j,.@j+2)
  207. if (@bought_nameid[.@i] == .Shop[.@j]) {
  208. set .@cost, .@cost+(.Shop[.@j+1]*@bought_quantity[.@i]);
  209. break;
  210. }
  211. if ( checkweight2 ( @bought_nameid, @bought_quantity ) == false ) {
  212. mes .nm$;
  213. mes "It appears you cant carry them all";
  214. close;
  215. }
  216. if ( !.ladderitem ) {
  217. if (.@cost > #MVPLADPOINTS) {
  218. mes .nm$;
  219. mes "You don't have enough points to purchase anything in ladder shop.";
  220. next;
  221. mes .nm$;
  222. mes "You only have "+ #MVPLADPOINTS +" points left.";
  223. }
  224. else {
  225. mes .nm$;
  226. mes "Items purchased:";
  227. mes "-----------------------------------";
  228. for(set .@i,0; .@i<getarraysize(@bought_nameid); set .@i,.@i+1) {
  229. getitem @bought_nameid[.@i], @bought_quantity[.@i];
  230. mes " ^777777"+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+"^000000";
  231. }
  232. mes "-----------------------------------";
  233. #MVPLADPOINTS -= .@cost;
  234. next;
  235. mes .nm$;
  236. mes "You only have "+ #MVPLADPOINTS +" points left.";
  237.  
  238. }
  239. }
  240. else {
  241. if (.@cost > countitem( .item )) {
  242. mes .nm$;
  243. mes "You don't have enough ^FF0000"+ getitemname( .item ) +"^000000 to purchase anything in ladder shop.";
  244. next;
  245. mes .nm$;
  246. mes "You have "+ countitem( .item ) +" x "+ getitemname( .item ) +" in your inventory.";
  247. }
  248. else {
  249. mes .nm$;
  250. mes "Items purchased:";
  251. mes "-----------------------------------";
  252. for(set .@i,0; .@i<getarraysize(@bought_nameid); set .@i,.@i+1) {
  253. getitem @bought_nameid[.@i], @bought_quantity[.@i];
  254. mes " ^777777"+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+"^000000";
  255. }
  256. mes "-----------------------------------";
  257. delitem .item, .@cost;
  258. next;
  259. mes .nm$;
  260. mes "You have "+ countitem( .item ) +" x "+ getitemname( .item ) +" in your inventory.";
  261. }
  262. }
  263. deletearray @bought_nameid[0], getarraysize(@bought_nameid);
  264. deletearray @bought_quantity[0], getarraysize(@bought_quantity);
  265. close;
  266.  
  267. OnNPCKillEvent:
  268. if( getgmlevel() >= 60 ) end; // if gm.. event wont trigger
  269. for (.@i = 0; .@i < getarraysize(.mvp_id); .@i += 3 ) {
  270. if( killedrid == .mvp_id[.@i] && compare( strcharinfo(3), .maps$[.@i/3] ) ) {
  271. .@solopoints = .mvp_id[.@i+1];
  272. .@partypoints = .mvp_id[.@i+2];
  273. if( .haltevent ) { // temporarily disable while giving away rewards to avoid bugs
  274. dispbottom "Event is still giving away rewards. This kill wont not recorded.", 0xff0000;
  275. end;
  276. }
  277. query_sql( "INSERT INTO `mvp_ladder_rank` SET `char_id`='"+ getcharid(0) +"', `name`='"+ strcharinfo(0) +"', `day_kills` = '1', `week_kills` = '1', `month_kills` = '1', `all_kills` = '1' ON DUPLICATE KEY UPDATE `day_kills` = `day_kills` + 1, `week_kills`=`week_kills` + 1, `month_kills` = `month_kills` + 1,`all_kills` = `all_kills` + 1" );
  278. if( !getcharid(1) ) {
  279. if(.Option&8 && rand(100) < .chance)
  280. {
  281. .@annouce = true;
  282. for (.@p = 0; .@p < getarraysize(.solo_reward); .@p+=2)
  283. getitem .solo_reward[.@p], .solo_reward[.@p+1];
  284. }
  285. if(.Option&16) {
  286. #MVPLADPOINTS += .@solopoints;
  287. dispbottom "You got "+ .@solopoints +" ladder points. Total: "+ #MVPLADPOINTS;
  288. }
  289. if ( .@annouce )
  290. announce "[System] : Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" and received an item.", bc_all;
  291. else
  292. announce "[System] : Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" alone at "+ strcharinfo(3), bc_all;
  293. } else {
  294. if ( rand(100) < .chance )
  295. .@chance = true;
  296. if ( .@chance )
  297. announce "[ System ] : Player ["+ strcharinfo(0) +"] of party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" and received an item.", bc_all;
  298. else
  299. announce "[ System ] : Player ["+ strcharinfo(0) +"] of party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), bc_all;
  300. getpartymember getcharid(1), 1;
  301. getpartymember getcharid(1), 2;
  302. for ( .@q = 0; .@q < $@partymembercount; ++.@q ) {
  303. if ( isloggedin( $@partymemberaid[.@q], $@partymembercid[.@q] ) ) {
  304. if(.Option&16) {
  305. attachrid $@partymemberaid[.@q];
  306. #MVPLADPOINTS += .@partypoints / $@partymembercount;
  307. dispbottom "--------------------------------------------";
  308. dispbottom "You got "+ (.@partypoints / $@partymembercount) +" mvp ladder points. Total: "+ #MVPLADPOINTS;
  309. dispbottom "--------------------------------------------";
  310. }
  311. .@partymemberaid[.@c] = $@partymemberaid[.@q];
  312. ++.@c;
  313. }
  314. }
  315. if ( .Option&8 && .@chance ) {
  316. for (.@p = 0; .@p < getarraysize(.party_reward); .@p+=2)
  317. getitem .party_reward[.@p], .party_reward[.@p+1];
  318. }
  319. }
  320. end;
  321. }
  322. }
  323. end;
  324.  
  325. OnReward:
  326. OnClock0000:
  327. .haltevent = 1; // temporarily stops the event while giving of rewards.. (to avoid bugs)
  328. if(.Option&4 && gettime(DT_DAYOFMONTH) == .day ) {
  329. F_MVPReward( "month_kills", 10, "Monthly", .monthly_rwd[.@i * 3], .monthly_rwd[.@i * 3 + 1], .monthly_rwd[.@i * 3 + 2] );
  330. sleep 1250;
  331. query_sql("UPDATE `mvp_ladder_rank` SET `month_kills` = '0'");
  332. }
  333. if(.Option&2 && gettime(DT_DAYOFWEEk) == .week ) {
  334. F_MVPReward( "week_kills", 10, "Weekly", .weekly_rwd[.@i * 3], .weekly_rwd[.@i * 3 + 1], .weekly_rwd[.@i * 3 + 2] );
  335. sleep 1250;
  336. query_sql("UPDATE `mvp_ladder_rank` SET `week_kills` = '0'");
  337. }
  338. if(.Option&1) {
  339. F_MVPReward( "day_kills", 10, "Daily", .daily_rwd[.@i * 3], .daily_rwd[.@i * 3 + 1], .daily_rwd[.@i * 3 + 2] );
  340. sleep 1250;
  341. query_sql("UPDATE `mvp_ladder_rank` SET `day_kills` = '0'");
  342. }
  343. sleep 1250;
  344. .haltevent = 0; // start again after..
  345. end;
  346.  
  347. OnInit:
  348. query_sql("CREATE TABLE IF NOT EXISTS `mvp_ladder_rank` (`char_id` int(11) unsigned NOT NULL DEFAULT '0', `name` varchar(30) NOT NULL DEFAULT '',`day_kills` int(11) unsigned NOT NULL default '0',`week_kills` int(11) unsigned NOT NULL default '0',`month_kills` int(11) unsigned NOT NULL default '0',`all_kills` int(11) unsigned NOT NULL default '0', PRIMARY KEY (`char_id`)) ENGINE=InnoDB");
  349.  
  350. // Bitwise Variables
  351. // 1 = enable daily reward and record
  352. // 2 = enable weekly reward and record
  353. // 4 = enable monthly reward and record
  354. // 8 = enable mvp ladder item reward when killing MVP
  355. // 16 = enable mvp ladder points when killing MVP & MVP Ladder shop
  356. .Option = 1|2|4|8|16;
  357.  
  358. // NPC Name
  359. .nm$ = "[ ^FF0000MVP Ranker^000000 ]";
  360.  
  361. // Point rewarded when mvp is killed (if Option 16 is enabled)
  362. // This points is earned on ordinary mvps
  363. .point = 100;
  364.  
  365. // Chance of getting an item (if Option 8 is enabled)
  366. .chance = 10;
  367.  
  368. // Day of the month to automatically get reward
  369. .day = 1;
  370.  
  371. // Day of the week
  372. .week = SUNDAY;
  373.  
  374. // Items for sale in MVP Shop
  375. setarray .shop,
  376. // <ID>, <PRICE>
  377. 13989, 1,
  378. 14004, 1,
  379. 14524, 1,
  380. 42091, 8,
  381. 42094, 20,
  382. 6228, 1000,
  383. 6232, 1000,
  384. 41001, 500,
  385. 41002, 500,
  386. 41003, 500,
  387. 41004, 500,
  388. 41005, 500,
  389. 41006, 500,
  390. 41007, 500,
  391. 41008, 500,
  392. 41009, 500,
  393. 41010, 500,
  394. 41011, 500,
  395. 41012, 500,
  396. 41013, 500,
  397. 41014, 500,
  398. 41015, 500,
  399. 41016, 500,
  400. 41017, 500,
  401. 41018, 500,
  402. 41053, 250,
  403. 41054, 250,
  404. 41055, 250,
  405. 41056, 250,
  406. 41057, 250;
  407.  
  408. setarray .solo_reward, // rewards for mvp killing
  409. 7712, 1, // Solo reward <item>, <amt>
  410. 7819, 1;
  411.  
  412. setarray .party_reward, // rewards for mvp killing
  413. 7712, 1, // Party reward <item>, <amt>
  414. 7819, 1;
  415.  
  416. // daily top 10 reward <ID>,<AMOUNT>,<ZENY>
  417. setarray .daily_rwd,
  418. 14232,3,100000, // top 1
  419. 14232,2,90000,
  420. 14232,2,80000,
  421. 14232,2,70000,
  422. 14232,2,60000,
  423. 14232,2,50000,
  424. 14232,2,40000,
  425. 14232,2,30000,
  426. 14232,2,20000,
  427. 14232,1,10000; // top 10
  428.  
  429. // weekly top 10 reward <ID>,<AMOUNT>,<ZENY>
  430. setarray .weekly_rwd,
  431. 14232,3,100000, // top 1
  432. 14232,2,90000,
  433. 14232,2,80000,
  434. 14232,2,70000,
  435. 14232,2,60000,
  436. 14232,2,50000,
  437. 14232,2,40000,
  438. 14232,2,30000,
  439. 14232,2,20000,
  440. 14232,1,10000; // top 10
  441.  
  442. // monthly top 10 reward <ID>,<AMOUNT>,<ZENY>
  443. setarray .monthly_rwd,
  444. 14232,3,100000, // top 1
  445. 14232,2,90000,
  446. 14232,2,80000,
  447. 14232,2,70000,
  448. 14232,2,60000,
  449. 14232,2,50000,
  450. 14232,2,40000,
  451. 14232,2,30000,
  452. 14232,2,20000,
  453. 14232,1,10000; // top 10
  454.  
  455. // use @mvpreset command to reset the ladder. It will also reset the ...
  456. // ... montly and weekly if it is on the .day and .week settings from above
  457. bindatcmd("mvpreset" ,strnpcinfo(0)+"::OnReward",99,99);
  458.  
  459. // No branch mapflags on the maps listed..
  460. for(.@i = 0; .@i < getarraysize(.maps$); ++.@i)
  461. setmapflag .maps$[.@i], mf_nobranch;
  462.  
  463. // ladder shop
  464. npcshopdelitem "mvp_ladder_shop_q", 607;
  465.  
  466. for(.@i = 0; .@i < getarraysize(.Shop); .@i = .@i + 2)
  467. npcshopadditem "mvp_ladder_shop_q", .Shop[.@i], .Shop[.@i + 1];
  468.  
  469.  
  470. // ---------------------------------------------------------------------
  471. // Don't touch anything from here or else you will ruin the whole script
  472. // Unless you know what you are doing
  473. // ---------------------------------------------------------------------
  474. //
  475. // IF YOU WANT TO ADD MORE MVP, MATCH THE MVP TO THE MAP TO MAKE IT WORK
  476. // SAMPLE: >>> 1511, // AMON RA == "moc_pryd06" <<<
  477. // If you are confused, contact me.
  478.  
  479. setarray .maps$,
  480. "moc_pryd06",
  481. //"lhz_dun03",
  482. "ra_fild03",
  483. "ra_fild04",
  484. "ve_fild01",
  485. "ve_fild02",
  486. "lou_dun03",
  487. "prt_maze03",
  488. "bra_dun02",
  489. //"lhz_dun04",
  490. //"lhz_dun04",
  491. //"lhz_dun04",
  492. "gld2_pay",
  493. "gl_chyard",
  494. "abyss_03",
  495. "gef_dun02",
  496. "gef_dun01",
  497. "treasure02",
  498. "pay_fild10",
  499. "gon_dun03",
  500. "abbey02",
  501. "xmas_fild01",
  502. "gld_ald",
  503. "ra_san05",
  504. "dic_dun03",
  505. "prt_sewb4",
  506. "mosk_dun03",
  507. //"lhz_dun04",
  508. //"lhz_dun03",
  509. //"lhz_dun03",
  510. "thor_v03",
  511. "ama_dun03",
  512. "gld2_gef",
  513. "kh_dun02",
  514. "teg_dun02",
  515. "xmas_dun02",
  516. "iz_dun05",
  517. "ice_dun03",
  518. "ayo_dun02",
  519. "dew_dun01",
  520. //"lhz_dun03",
  521. "niflheim",
  522. "anthell02",
  523. "gld_dun02",
  524. "mjolnir_04",
  525. "gld_dun01",
  526. "pay_dun04",
  527. "gef_fild03",
  528. "gef_fild10",
  529. "moc_pryd04",
  530. //"lhz_dun04",
  531. "in_sphinx5",
  532. "moc_fild17",
  533. //"lhz_dun04",
  534. "gld2_prt",
  535. "dic_dun02",
  536. "ein_dun02",
  537. "moc_fild21",
  538. //"lhz_dun03",
  539. //"lhz_dun04",
  540. "beach_dun",
  541. "thana_boss",
  542. "teg_dun01",
  543. "tur_dun04",
  544. "odin_tem03",
  545. "jupe_core",
  546. //"lhz_dun03",
  547. "moc_fild22",
  548. "lhz_dun02",
  549. "moc_prydn2",
  550. "abbey03",
  551. "abbey03";
  552.  
  553. setarray .mvp_id,
  554. // <MVP ID>, <Solo Points>, <Party Points>
  555. 1511, 1, 12, // AMON RA
  556. //1647, 4, 12, // B_ERMES
  557. 1785, 2, 12, // ATROCE
  558. 1785, 2, 12, // ATROCE
  559. 1785, 2, 12, // ATROCE
  560. 1785, 2, 12, // ATROCE
  561. 1630, 1, 12, // BASCOJIN
  562. 1039, 2, 12, // BAPHOMET
  563. 2068, 1, 12, // BOITATA
  564. //2238, 1, 12, // B_CHEN
  565. //2240, 1, 12, // B_ALPHOCCIO
  566. //2236, 1, 12, // B_FLAMMEL
  567. 2253, 1, 12, // DAEHYON
  568. 1272, 1, 12, // DARK LORD
  569. 1719, 2, 12, // DETALE
  570. 1046, 1, 12, // DOPPELGANGER
  571. 1389, 1, 12, // DRACULA
  572. 1112, 1, 12, // DRAKE
  573. 1115, 1, 12, // EDDGA
  574. 1418, 1, 12, // EVIL SNAKE LORD
  575. 1871, 3, 12, // FALLEN BISHOP
  576. 1252, 1, 12, // GARM
  577. 2251, 1, 12, // GIOIA
  578. 1768, 3, 12, // GLOOMUNDERNIGHT
  579. 2165, 1, 12, // GOLDQUEENSCARABA
  580. 1086, 1, 12, // GTB
  581. 1885, 1, 12, // GOPINICH
  582. //2241, 1, 12, // B_TRENITI
  583. //1649, 4, 12, // B_MAGALETA
  584. //1651, 4, 12, // B_KATRIN
  585. 1832, 3, 12, // IFRIT
  586. 1492, 2, 12, // INCANTATION SAMURAI
  587. 2255, 1, 12, // KADES
  588. 1734, 3, 12, // KIEL
  589. 2442, 1, 12, // B_SUPERNOVICE
  590. 1251, 1, 12, // STORMY KNIGHT
  591. 2202, 1, 12, // KRAKKEN
  592. 1779, 2, 12, // KTULLANUX
  593. 1688, 2, 12, // LADY TANEE
  594. 2156, 1, 12, // LEAK
  595. //1646, 4, 12, // B_SEYREN
  596. 1373, 1, 12, // LORD OF DEATH
  597. 1147, 1, 12, // MAYA
  598. 1059, 1, 12, // MISTRESS
  599. 1059, 1, 12, // MISTRESS
  600. 1150, 1, 12, // MOONLIGHTFLOWER
  601. 1150, 1, 12, // MOONLIGHTFLOWER
  602. 1087, 1, 12, // ORC HERO
  603. 1190, 1, 12, // ORC LORD
  604. 1038, 1, 12, // OSIRIS
  605. //2235, 1, 12, // B_RANDEL
  606. 1157, 1, 12, // PHAROAH
  607. 1159, 1, 12, // PHREEONI
  608. //2237, 1, 12, // B_CELIA
  609. 2249, 1, 12, // ANGRYSTUDENY PYURIEL
  610. 2087, 1, 12, // GOLDEN QUEEN SCARAB
  611. 1623, 1, 12, // RSX12312
  612. 1916, 3, 12, // SATAN MORROC
  613. //1650, 4, 12, // B_CECIL
  614. //2239, 1, 12, // B_GERTIE
  615. 1583, 1, 12, // TAOGUNKA
  616. 1708, 1, 12, // THANATOS
  617. 2441, 1, 12, // B_NOVICE
  618. 1312, 1, 12, // TURTLE GEN
  619. 1751, 4, 12, // RANDGRIS
  620. 1685, 2, 12, // VESPER
  621. //1648, 4, 12, // B_HOWARD
  622. 1917, 4, 12, // WOUNDED MORROC
  623. 1658, 2, 12, // B_YGNIZEM
  624. 2362, 2, 12, // N_AMON_RA
  625. 1874, 2, 12, // BEELZEBUB
  626. 1873, 2, 12; // BEELZEBUB
  627. end;
  628.  
  629. function F_CheckMvpLadder {
  630. if ( !(.@nb = query_sql("SELECT `name`, `" + getarg(0) + "`, FIND_IN_SET(`" + getarg(0) + "`, (SELECT GROUP_CONCAT(`" + getarg(0) + "` ORDER BY `" + getarg(0) + "` DESC) FROM `mvp_ladder_rank`)) FROM `mvp_ladder_rank` ORDER BY `" + getarg(0) + "` DESC LIMIT 20", .@name$, .@value, .@rank) ) ) {
  631. mes "The rankings are empty.";
  632. }
  633. for ( .@i = 0; .@i < .@nb; ++.@i )
  634. mes "["+ .@rank[.@i] +"] "+ .@name$[.@i] +" ~ ^FF0000"+ .@value[.@i] +"^000000 kills";
  635. return;
  636. }
  637.  
  638. function F_MVPReset {
  639. if ( select( "Confirm","Cancel" ) == 1 ) {
  640. query_sql("UPDATE `mvp_ladder_rank` SET `"+getarg(0)+"` = '0'");
  641. }
  642. return;
  643. }
  644.  
  645. function F_CheckRank {
  646. mes "~ No "+ getarg(0) +" records found";
  647. return;
  648. }
  649.  
  650. function F_MVPReward {
  651. query_sql("SELECT `char_id` FROM `mvp_ladder_rank` WHERE `"+ getarg(0) +"` ORDER BY CAST(`"+ getarg(0) +"` AS SIGNED) DESC LIMIT "+ getarg(1) +" ", .@cid );
  652. for(.@i = 0; .@i < getarraysize(.@cid); ++.@i) {
  653. .@title$ = getarg(2)+" MVP Ladder reward";
  654. .@body$ = "Congratulations! You have ranked #"+ (.@i+1) +" in the "+ getarg(2) +" MVP ladder rankings!";
  655. .@mailitem = getarg(3);
  656. .@mailamount = getarg(4);
  657. .@zeny = getarg(5);
  658. mail .@cid[.@i], "GM", .@title$, .@body$, .@zeny, .@mailitem, .@mailamount;
  659. }
  660. announce "Congratulations to our "+ getarg(1) +" TOP "+ getarg(2) +" MVP Hunters! Check your mails for rewards.",bc_blue|bc_all;
  661. return;
  662. }
  663. }
  664.  
  665. - shop mvp_ladder_shop_q -1,607:-1 // dummyshop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement