Jump to content
  • 0

MVP Ranker


Hades03

Question


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  242
  • Reputation:   3
  • Joined:  01/01/12
  • Last Seen:  

The MVP Ranker does't show the real name look @ 3, 4, 6, 7, 8, 9

1073y2u.jpg

xu7pg.jpg

http://pastebin.com/6sTs24L2

Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  407
  • Reputation:   159
  • Joined:  11/18/11
  • Last Seen:  

You can optimize your script...

Just delete array .mobid

and change OnNPCKillEvent label to

OnNPCKillEvent: // Script execution
if(getmonsterinfo(killedrid,22))
set .@s, 1; // If a MvP
...

Type 22 is MvP Exp. See changeset 15872

EDIT:

nevermind :)

Edited by Lilith
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

Might be easier to write a new script :)

Here's one that runs off the SQL logs table. First enable the mvplog in trunk/conf/log_athena.conf

// Use MySQL Logs? [sql Version Only] (Note 1)
sql_logs: yes

// 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

Then the NPC script:

prontera,155,188,0	script	MVP Rank	910,{
// get database names, for join
query_sql    "SELECT DATABASE()", .@rag_db$;
query_logsql "SELECT DATABASE()", .@log_db$;

query_sql "SELECT `name`,COUNT(mvp_id) FROM "+.@log_db$+".mvplog " + 
          "LEFT JOIN "+.@rag_db$+".`char` ON mvplog.kill_char_id=`char`.char_id " + 
          "GROUP BY kill_char_id ORDER BY COUNT(mvp_id) DESC LIMIT 10", .@name$, .@kills;

mes "[MVP Rank Top 10]";
for (.@i=0; .@i<getarraysize(.@name$); .@i++) {
	mes "Top ^FF0000"+(.@i+1)+"^000000 "+.@name$[.@i]+" with ^FF0000"+.@kills[.@i]+"^000000 MVPs killed.";
}
close;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  152
  • Topics Per Day:  0.03
  • Content Count:  569
  • Reputation:   11
  • Joined:  11/24/11
  • Last Seen:  

@Brian

error. im using eathena latest revision.

[Error]:  Loading NPC file: npc/test/MVP_Ranking.txt
script error on npc/heroinro/MVP_Ranking.txt line 11
parse_line: expect command, missing function name or calling undeclared func
tion
 6 :		query_sql "SELECT `name`,COUNT(mvp_id) FROM "+.@log_db$+".mvplog
" +
 7 :				  "LEFT JOIN "+.@rag_db$+".`char` ON mvplog.kill_char_id
=`char`.char_id " +
 8 :				  "GROUP BY kill_char_id ORDER BY COUNT(mvp_id) DESC LIM
IT 10", .@name$, .@kills;
 9 :
10 :		mes "[MVP Rank Top 10]";
*   11 :		for ('.'@i=0; .@i<getarraysize(.@name$); .@i++) {
12 :				mes "Top ^FF0000"+(.@i+1)+"^000000 "+.@name$[.@i]+" with
^FF0000"+.@kills[.@i]+"^000000 MVPs killed.";
13 :		}
14 :		close;
15 : }

how to fix that function?

Edited by Will Suranol
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

change

for ('.'@i=0; .@i<getarraysize(.@name$); .@i++) {

to

for( set .@i,0; .@i<getarraysize(.@name$); set .@i,.@i + 1 ){

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  242
  • Reputation:   3
  • Joined:  01/01/12
  • Last Seen:  

im not using sql im using txt

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

@Will Suranol: oh, it's because direct variable assignment was just added 3 days ago.

r15982: Script Engine Update.

@Jam: sorry, thought you were using SQL because there's no more TXT in rAthena :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  242
  • Reputation:   3
  • Joined:  01/01/12
  • Last Seen:  

but can you make ma 1 via txt?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  140
  • Topics Per Day:  0.03
  • Content Count:  562
  • Reputation:   108
  • Joined:  10/05/12
  • Last Seen:  

Posted · Hidden by Emistry, October 5, 2012 - Bad Talking Manner ..
Hidden by Emistry, October 5, 2012 - Bad Talking Manner ..

fuuuck, we still fucking waiting that shit

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...