Limestone Posted June 27, 2012 Group: Members Topic Count: 155 Topics Per Day: 0.03 Content Count: 647 Reputation: 16 Joined: 11/21/11 Last Seen: December 28, 2022 Share Posted June 27, 2012 //= --- //= MvP Rank Improved v1.0 //= --- //= This Rank will count every MvP you kill, //= to be more clear, will count every mob //= defined inside the array ".mobid[0]", //= so, if you add the poring ID will count in the rank //= you can modify and ad miniBoss because this array //= only have all MvPs, that's the idea, only MvPs... //= --- - script Rank MvP -1,{ OnInit: // Script Configuration setarray .mobid[0],1511,1647,1785,1630,1399,1039,1874,2068,1272,1719,1046,1389,1112,1115,1957,1418,1871,1252,1768,1086,1688,1646, 1373,1147,1059,1150,1956,2022,1087,1190,1038,1157,1159,1502,1623,1650,1583,1708,1312,1751,1685,1648,1917,1658; // MvP Ids set .a, 0; // Broadcast who killed the MvP and wich MvP and wick Map [0 Off - 1 On] set $@top, 5; // Max. Top Rank (Hihgly recommended between 5~10, more maybe bug the server (limited variables) end; OnNPCKillEvent: // Script execution for (set .@c, 0; .@c < getarraysize(.mobid); set .@c, .@c + 1) if (killedrid == .mobid[.@c]) set .@s, 1; // If a MvP if (!.@s) end; if (.a) // If announce On announce "The user [" +strcharinfo(0) +"] has killed a [" +getmonsterinfo(killedrid,0) +"] in the map [" +strcharinfo(3) +"]",bc_blue|bc_all; set MvP, MvP + 1; callfunc ("MvPRank",MvP,strcharinfo(0)); end; } // End Script prontera,141,180,7 script MvP Rank 404,{ // NPC que mostrará el Rank mes "[ MVP Rankings ]"; for (set .@c, 0; .@c < $@top; set .@c, .@c + 1) mes "#^FF0000" +(.@c + 1) +"^000000 [ ^0000FF" +getd("$topmvp" +.@c +"$") +"^000000 ] with ^FF0000" +getd("$topmvp" +.@c) +"^000000 MvP killed."; close; } // End if function script MvPRank { set @mvptotal, getarg(0); set @nomb$, getarg(1); for (set .@c, 0; .@c < $@top; set .@c, .@c + 1) { if (@mvptotal >= getd("$topmvp" +.@c)) { if (strcharinfo(0) == getd("$topmvp" +.@c +"$")) { setd "$topmvp" +.@c, @mvptotal; setd "$topmvp" +.@c +"$", @nomb$; return; } else { if (getd("$topmvp" +(.@c + 1) +"$") == "") { setd "$topmvp" +.@c, @mvptotal; setd "$topmvp" +.@c +"$", @nomb$; return; } else { setd "$topmvp" +(.@c + 1), getd("$topmvp" +.@c); setd "$topmvp" +(.@c + 1) +"$", getd("$topmvp"+.@c+"$"); setd "$topmvp" +.@c, @mvptotal; setd "$topmvp" +.@c +"$", @nomb$; return; } // End if } // End if } // End if } // End loop return; } // End function Please Help me on this script, i want to put Rank Reset if GM lvl 99, if not a GM 99, the menu will not show. Thanks Quote Link to comment Share on other sites More sharing options...
Cookie Posted June 28, 2012 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 213 Reputation: 109 Joined: 05/21/12 Last Seen: December 27, 2014 Share Posted June 28, 2012 Hello, I had a few minutes and I re-coded the NPC to clean it up a bit. I added your menu as well. Please refer to the OnInits to set configuration of the NPC such as gm permissions. I hope this is what you needed! Cheers! -Cookie MVPRank.txt Quote Link to comment Share on other sites More sharing options...
Limestone Posted June 28, 2012 Group: Members Topic Count: 155 Topics Per Day: 0.03 Content Count: 647 Reputation: 16 Joined: 11/21/11 Last Seen: December 28, 2022 Author Share Posted June 28, 2012 Thanks Cookie! but i have found a bug.. if i reset the rankings. then i kill again a mvp.. the count of mvp that i killed is not reseted.. it increased, for example.. i killed 3 tao gunka, then i reset the rankings.. after i reset and kill another tao gunka, then my mvp kills turns to 4.. sorry for my bad english Quote Link to comment Share on other sites More sharing options...
Cookie Posted June 28, 2012 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 213 Reputation: 109 Joined: 05/21/12 Last Seen: December 27, 2014 Share Posted June 28, 2012 Fixed. See attached file. Briefly tested, tell me if anything else bugs out. CookieMVP_Rank_v2.0.txt Quote Link to comment Share on other sites More sharing options...
Limestone Posted June 28, 2012 Group: Members Topic Count: 155 Topics Per Day: 0.03 Content Count: 647 Reputation: 16 Joined: 11/21/11 Last Seen: December 28, 2022 Author Share Posted June 28, 2012 (edited) Thanks Cookie! But i found a error on Script: [Error]: Loading NPC file: npc/fmro/utilities/mvprank.txt script error on npc/fmro/utilities/mvprank.txt line 110 parse_line: need ';' 105 : for (set .@i, 0; .@i < $@top; set .@i, .@i + 1) 106 : { 107 : setd "$topmvp" +.@i, 0; 108 : setd "$topmvp" +.@i +"$", ""; 109 : } * 110 : set $mvp_rank_date$, mvp_rank_date'('); 111 : mes .npcname$; 112 : mes "The Ranking has been reset."; 113 : close; 114 : end; 115 : } [info]: Done loading '6138' NPCs: Edited June 28, 2012 by Rage Quote Link to comment Share on other sites More sharing options...
Cookie Posted June 28, 2012 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 213 Reputation: 109 Joined: 05/21/12 Last Seen: December 27, 2014 Share Posted June 28, 2012 (edited) I didn't receive that error on the console and I was testing it in-game. Ensure you didn't re-arrange the script. The functions should be in the first part of the script as I set it up. Reason being the functions need to load before they're referenced. Did you alter anything? Also, are you using the latest revision of rA or at least a revision of rA that incorporates the updated Script Engine released by Epoque? If not, change lines: set $mvp_rank_date$, mvp_rank_date(); To: set $mvp_rank_date$, callfunc("mvp_rank_date"); Edited June 28, 2012 by Cookie Quote Link to comment Share on other sites More sharing options...
Limestone Posted June 28, 2012 Group: Members Topic Count: 155 Topics Per Day: 0.03 Content Count: 647 Reputation: 16 Joined: 11/21/11 Last Seen: December 28, 2022 Author Share Posted June 28, 2012 sorry but my svn is still eathena.. ok after my work.. i'll check this.. thanks thanks Cookie it worked. btw.. can i request another one? how can i set if a player is the top 1 mvp hunter.. the npc will announce.. thanks Quote Link to comment Share on other sites More sharing options...
iraciz Posted October 5, 2012 Group: Members Topic Count: 140 Topics Per Day: 0.03 Content Count: 562 Reputation: 111 Joined: 10/05/12 Last Seen: February 12, 2024 Share Posted October 5, 2012 (edited) The npc display option for 4 positions but only show the person in the first one For example if i kill 4 mvps after another player, who killed 3, the other player must be now in second place. But they don´t swap positions,. I took that position, and the other 4 positions remainings still in blank sorry for my bad english Edited October 5, 2012 by Euphy Please act respectfully. Quote Link to comment Share on other sites More sharing options...
Emistry Posted October 5, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted October 5, 2012 you can try this...but it's SQL Version. http://pastebin.com/raw.php?i=KQFjt7ia make sure you load this Table in your SQL before use the NPC Scripts. CREATE TABLE IF NOT EXISTS `E-MVPRank` ( `char_id` int(11) unsigned NOT NULL default '0', `name` varchar(30) NOT NULL DEFAULT '', `Count` int(11) unsigned NOT NULL default '0', PRIMARY KEY (`char_id`) ) ENGINE=MyISAM; @iraciz those data are saved in variable..and use for TXT version...it's much more harder to track and debug the script than you can imagine..... and since we are now using SQL ....and ...coincidentally another topic also request for a MVP Ranker script...so i will post the content here for second time.. Please respect others work....even if the script isnt working / buggy ....still you have to respect his/her works... the ranker is not working! DO NOT DOWNLOAD THAT PIECE OF CRAP it might hurting somebody ... and please dont use ALMOST / FULL CAPITAL in your posts...it's irritating .. >.< Quote Link to comment Share on other sites More sharing options...
caspa Posted February 5, 2013 Group: Members Topic Count: 194 Topics Per Day: 0.04 Content Count: 499 Reputation: 3 Joined: 03/11/12 Last Seen: September 18, 2023 Share Posted February 5, 2013 you can try this...but it's SQL Version. http://pastebin.com/raw.php?i=KQFjt7ia make sure you load this Table in your SQL before use the NPC Scripts. CREATE TABLE IF NOT EXISTS `E-MVPRank` ( `char_id` int(11) unsigned NOT NULL default '0', `name` varchar(30) NOT NULL DEFAULT '', `Count` int(11) unsigned NOT NULL default '0', PRIMARY KEY (`char_id`) ) ENGINE=MyISAM; @iraciz those data are saved in variable..and use for TXT version...it's much more harder to track and debug the script than you can imagine..... and since we are now using SQL ....and ...coincidentally another topic also request for a MVP Ranker script...so i will post the content here for second time.. Please respect others work....even if the script isnt working / buggy ....still you have to respect his/her works... the ranker is not working! DO NOT DOWNLOAD THAT PIECE OF CRAP it might hurting somebody ... and please dont use ALMOST / FULL CAPITAL in your posts...it's irritating .. >.< Sir Emistry, I have this kind of Error Quote Link to comment Share on other sites More sharing options...
Emistry Posted February 5, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted February 5, 2013 it's your MVP Ladder script problems...and this has been answered many times too... try search inside the forum.. if i am not mistaken...it's because of the script compare with a non-string arguments... Quote Link to comment Share on other sites More sharing options...
caspa Posted February 5, 2013 Group: Members Topic Count: 194 Topics Per Day: 0.04 Content Count: 499 Reputation: 3 Joined: 03/11/12 Last Seen: September 18, 2023 Share Posted February 5, 2013 if you dont mind would you just transform the script into an arrays and i'll just manually put the list of mvp monsteR? Quote Link to comment Share on other sites More sharing options...
Emistry Posted February 5, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted February 5, 2013 if you dont mind would you just transform the script into an arrays and i'll just manually put the list of mvp monsteR? try http://pastebin.com/raw.php?i=Ed5M3DiS Quote Link to comment Share on other sites More sharing options...
caspa Posted February 5, 2013 Group: Members Topic Count: 194 Topics Per Day: 0.04 Content Count: 499 Reputation: 3 Joined: 03/11/12 Last Seen: September 18, 2023 Share Posted February 5, 2013 (edited) sir i have tested the script and its working so far........ however after my char was in the rank and i deleted it.... the name of my char is still on the rank? what should i put to auto erase the name of char in the mvp ladder if the char is deleted? and i would also like it to be top 10 only Edited February 5, 2013 by caspa Quote Link to comment Share on other sites More sharing options...
Cisqua Posted February 5, 2013 Group: Members Topic Count: 46 Topics Per Day: 0.01 Content Count: 131 Reputation: 1 Joined: 12/29/12 Last Seen: August 10, 2016 Share Posted February 5, 2013 can i request here? like this ladder will show only 10 players Quote Link to comment Share on other sites More sharing options...
caspa Posted February 6, 2013 Group: Members Topic Count: 194 Topics Per Day: 0.04 Content Count: 499 Reputation: 3 Joined: 03/11/12 Last Seen: September 18, 2023 Share Posted February 6, 2013 bump............. Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted February 7, 2013 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted February 7, 2013 (edited) /* alter table `char` add column mvp_rank int(11) default 0 after delete_date, add index (mvp_rank); */ prontera,155,188,5 script jsfkdsfhsk 100,{ .@nb = query_sql( "select name, mvp_rank from `char` where mvp_rank > 0 order by mvp_rank desc limit 10", .@name$, .@count ); if ( !.@nb ) { mes "no entry"; close; } for ( .@i = 0; .@i < .@nb; .@i++ ) mes ( .@i +1 )+". "+ .@name$[.@i] +" -> "+ .@count[.@i] +" points"; close; OnInit: setarray .mvp, 1001, 1002, 1004; while ( .mvp ) { setd ".mvp"+ .mvp, 1; .@i++; } end; OnNPCKillEvent: if ( getd( ".mvp"+ killedrid ) ) query_sql "update `char` set mvp_rank = mvp_rank +1 where char_id = "+ getcharid(0); end; } I try another one EDIT: thx to below Edited February 13, 2013 by AnnieRuru Quote Link to comment Share on other sites More sharing options...
Omnipotent Posted February 7, 2013 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 71 Reputation: 25 Joined: 11/23/11 Last Seen: May 16, 2024 Share Posted February 7, 2013 (edited) /* alter table `char` add column mvp_rank int(11) default 0 after delete_date, add index (mvp_rank); */ prontera,155,188,5 script jsfkdsfhsk 100,{ .@nb = query_sql( "select name, mvp_rank from `char` where mvp_rank > 0 order by mvp_rank desc limit 10", .@name$, .@count ); if ( !.@nb ) { mes "no entry"; close; } for ( .@i = 0; .@i < .@nb; .@i++ ) mes ( .@i +1 )+". "+ .@name$ +" -> "+ .@count +" points"; close; OnInit: setarray .mvp, 1001, 1002, 1004; while ( .mvp ) { setd ".mvp"+ .mvp, 1; .@i++; } end; OnNPCKillEvent: if ( getd( ".mvp"+ .mvp ) ) query_sql "update `char` set mvp_rank = mvp_rank +1 where char_id = "+ getcharid(0); end; } I try another one Seems like you forgot killedrid. if ( getd( ".mvp"+ killedrid ) ) And setd ".mvp"+ .mvp[.@i], 1; And I think OnInit can be made like (but there will be a lot of loops): freeloop 1 ; set .@max, 2000; set .@i, .@max; while ( .@max - .@i < 1000 ) { if ( getmonsterinfo ( .@i, MOB_MVPEXP ) ) { set .mvp[.@j], .@i; set .@j, .@j + 1; } set .@i, .@i - 1; } freeloop 0 ; Edited February 7, 2013 by Omnipotent 1 Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted February 7, 2013 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted February 7, 2013 (edited) I also failed to noticed the fault of 1st one lol for 2nd one, try refer the script made by Emistry in post#9 OnNPCKillEvent: if( getmonsterinfo( killedrid,MOB_MVPEXP ) )better I guessor like this /* alter table `char` add column mvp_rank int(11) default 0 after delete_date, add index (mvp_rank); */ prontera,155,188,5 script jsfkdsfhsk 100,{ .@nb = query_sql( "select name, mvp_rank from `char` where mvp_rank > 0 order by mvp_rank desc limit 10", .@name$, .@count ); if ( !.@nb ) { mes "no entry"; close; } for ( .@i = 0; .@i < .@nb; .@i++ ) mes ( .@i +1 )+". "+ .@name$[.@i] +" -> "+ .@count[.@i] +" points"; close; OnInit: .@nb = query_sql( "select id from mob_db where mexp > 0", .@mvp ); while ( .@i < .@nb ) { setd ".mvp"+ .@mvp[.@i], .@mvp[.@i]; .@i++; } end; OnNPCKillEvent: if ( getd( ".mvp"+ killedrid ) ) query_sql "update `char` set mvp_rank = mvp_rank +1 where char_id = "+ getcharid(0); end; } Edited January 3, 2014 by AnnieRuru Quote Link to comment Share on other sites More sharing options...
Brian Posted February 11, 2013 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 593 Joined: 10/26/11 Last Seen: June 2, 2018 Share Posted February 11, 2013 you can try this...but it's SQL Version.http://pastebin.com/raw.php?i=KQFjt7ia I prefer enabling log_mvpdrop (trunk/conf/log_athena.conf), rather than creating a whole new SQL table. // Log MVP Monster Drops (Note 1) // Outdated. Use Pick_Log instead. But this log could be useful to keep track slayed MVPs log_mvpdrop: yes In addition to Who killed the most mvps?, you can get more info like: - How many times was _____ mvp killed? - Who killed _____ mvp the most? - When was the last time _____ mvp (or each mvp) was killed? - Who killed MVPs on maps they do not normally spawn on? (ex: bloody branch, that one Abracadabra skill, or @monster) 1 Quote Link to comment Share on other sites More sharing options...
Checkmate Posted August 30, 2013 Group: Members Topic Count: 96 Topics Per Day: 0.02 Content Count: 554 Reputation: 14 Joined: 09/24/12 Last Seen: November 20, 2024 Share Posted August 30, 2013 I prefer enabling log_mvpdrop (trunk/conf/log_athena.conf), rather than creating a whole new SQL table. // Log MVP Monster Drops (Note 1) // Outdated. Use Pick_Log instead. But this log could be useful to keep track slayed MVPs log_mvpdrop: yes In addition to Who killed the most mvps?, you can get more info like: - How many times was _____ mvp killed? - Who killed _____ mvp the most? - When was the last time _____ mvp (or each mvp) was killed? - Who killed MVPs on maps they do not normally spawn on? (ex: bloody branch, that one Abracadabra skill, or @monster) Sir Brian... Like what you said above... Where did we can see all this description... In addition to Who killed the most mvps?, you can get more info like: - How many times was _____ mvp killed? - Who killed _____ mvp the most? - When was the last time _____ mvp (or each mvp) was killed? - Who killed MVPs on maps they do not normally spawn on? (ex: bloody branch, that one Abracadabra skill, or @monster) Cuz im already enable it and the description did not show in my chat bar....... Quote Link to comment Share on other sites More sharing options...
Lil Troll Posted August 30, 2013 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 276 Reputation: 24 Joined: 07/06/13 Last Seen: April 19, 2014 Share Posted August 30, 2013 Actually the recorded name will be overlapped by new rankers. About Top 10 Rank, find this and change DESC LIMIT 5 to 10. If you want to use sir Emistry or Aniruru script. ORDER BY `Count` DESC LIMIT 5 or refer to sir Brian post. Quote Link to comment Share on other sites More sharing options...
Brian Posted September 3, 2013 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 593 Joined: 10/26/11 Last Seen: June 2, 2018 Share Posted September 3, 2013 Sir Brian... Like what you said above... Where did we can see all this description... Enabling the mvplog does not automatically display all that info. I was just pointing out that by logging all MVP kills with the mvplog, you could use SQL queries to get that info.- How many times was _____ mvp killed? # count for single MVP (Eddga) SELECT COUNT(mvp_id) FROM mvplog WHERE monster_id=1115; # each MVP name, with count SELECT `kName`, COUNT(mvp_id) AS 'count' FROM mvplog LEFT JOIN ragnarok.mob_db ON mvplog.monster_id=mob_db.`ID` GROUP BY monster_id;- Who killed _____ mvp the most?# who killed Eddga the most? SELECT `name`,COUNT(mvp_id) FROM mvplog LEFT JOIN ragnarok.`char` ON mvplog.kill_char_id=`char`.char_id WHERE monster_id=1115 GROUP BY kill_char_id ORDER BY COUNT(mvp_id) DESC;- When was the last time _____ mvp was killed?# last time Eddga was killed SELECT * FROM mvplog WHERE monster_id=1115 ORDER BY mvp_id DESC LIMIT 1;- Who killed MVPs on maps they do not normally spawn on?# Eddga kills not on pay_fild11 or gld_dun01 SELECT * FROM mvplog WHERE monster_id=1115 AND (`map`!='pay_fild11' OR `map`!='gld_dun01'); 1 Quote Link to comment Share on other sites More sharing options...
Drakkus Posted September 5, 2013 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 386 Reputation: 15 Joined: 11/17/11 Last Seen: September 13, 2024 Share Posted September 5, 2013 Any one have the complete script then? Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted January 3, 2014 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted January 3, 2014 (edited) // Log MVP Monster Drops (Note 1) // Outdated. Use Pick_Log instead. But this log could be useful to keep track slayed MVPs log_mvpdrop: yes prontera,155,188,5 script jsfkdsfhsk 100,{ mes "blah"; next; switch ( select ( "player ranking", "mvp killed", "last mvp killed" ) ) { case 1: .@nb = query_sql( "select kill_char_id as aaa, ( select name from `char` where char_id = aaa ), count(1) as bbb from mvplog group by kill_char_id order by bbb desc limit 20", .@cid, .@name$, .@count ); if ( !.@nb ) { mes "no entry"; close; } for ( .@i = 0; .@i < .@nb; .@i++ ) mes ( .@i +1 )+". "+ .@name$[.@i] +" -> "+ .@count[.@i] +" points"; close; case 2: .@nb = query_sql( "select monster_id as aaa, ( select kname from mob_db_re where id = aaa ), count(1) from mvplog group by monster_id", .@mobid, .@name$, .@count ); if ( !.@nb ) { mes "no entry"; close; } for ( .@i = 0; .@i < .@nb; .@i++ ) mes .@name$[.@i] +" : "+ .@count[.@i] +" times"; close; case 3: .@nb = query_sql( "select monster_id as aaa, ( select kname from mob_db_re where id = aaa ), max(mvp_date) from mvplog group by monster_id", .@mobid, .@name$, .@date$ ); if ( !.@nb ) { mes "no entry"; close; } for ( .@i = 0; .@i < .@nb; .@i++ ) mes .@name$[.@i] +" -> "+ .@date$[.@i]; close; } close; } - Who killed MVPs on maps they do not normally spawn on? # Eddga kills not on pay_fild11 or gld_dun01 SELECT * FROM mvplog WHERE monster_id=1115 AND (`map`!='pay_fild11' OR `map`!='gld_dun01'); this part needs someone to provide an array for me x.x Edited January 3, 2014 by AnnieRuru Quote Link to comment Share on other sites More sharing options...
Question
Limestone
//= MvP Rank Improved v1.0
//= ---
//= This Rank will count every MvP you kill,
//= to be more clear, will count every mob
//= defined inside the array ".mobid[0]",
//= so, if you add the poring ID will count in the rank
//= you can modify and ad miniBoss because this array
//= only have all MvPs, that's the idea, only MvPs...
//= ---
- script Rank MvP -1,{
OnInit: // Script Configuration
setarray .mobid[0],1511,1647,1785,1630,1399,1039,1874,2068,1272,1719,1046,1389,1112,1115,1957,1418,1871,1252,1768,1086,1688,1646,
1373,1147,1059,1150,1956,2022,1087,1190,1038,1157,1159,1502,1623,1650,1583,1708,1312,1751,1685,1648,1917,1658; // MvP Ids
set .a, 0; // Broadcast who killed the MvP and wich MvP and wick Map [0 Off - 1 On]
set $@top, 5; // Max. Top Rank (Hihgly recommended between 5~10, more maybe bug the server (limited variables)
end;
OnNPCKillEvent: // Script execution
for (set .@c, 0; .@c < getarraysize(.mobid); set .@c, .@c + 1)
if (killedrid == .mobid[.@c])
set .@s, 1; // If a MvP
if (!.@s) end;
if (.a) // If announce On
announce "The user [" +strcharinfo(0) +"] has killed a [" +getmonsterinfo(killedrid,0) +"] in the map [" +strcharinfo(3) +"]",bc_blue|bc_all;
set MvP, MvP + 1;
callfunc ("MvPRank",MvP,strcharinfo(0));
end;
} // End Script
prontera,141,180,7 script MvP Rank 404,{ // NPC que mostrará el Rank
mes "[ MVP Rankings ]";
for (set .@c, 0; .@c < $@top; set .@c, .@c + 1)
mes "#^FF0000" +(.@c + 1) +"^000000 [ ^0000FF" +getd("$topmvp" +.@c +"$") +"^000000 ] with ^FF0000" +getd("$topmvp" +.@c) +"^000000 MvP killed.";
close;
} // End if
function script MvPRank {
set @mvptotal, getarg(0);
set @nomb$, getarg(1);
for (set .@c, 0; .@c < $@top; set .@c, .@c + 1) {
if (@mvptotal >= getd("$topmvp" +.@c)) {
if (strcharinfo(0) == getd("$topmvp" +.@c +"$")) {
setd "$topmvp" +.@c, @mvptotal;
setd "$topmvp" +.@c +"$", @nomb$;
return;
} else {
if (getd("$topmvp" +(.@c + 1) +"$") == "") {
setd "$topmvp" +.@c, @mvptotal;
setd "$topmvp" +.@c +"$", @nomb$;
return;
} else {
setd "$topmvp" +(.@c + 1), getd("$topmvp" +.@c);
setd "$topmvp" +(.@c + 1) +"$", getd("$topmvp"+.@c+"$");
setd "$topmvp" +.@c, @mvptotal;
setd "$topmvp" +.@c +"$", @nomb$;
return;
} // End if
} // End if
} // End if
} // End loop
return;
} // End function
Link to comment
Share on other sites
24 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.