Jump to content
  • 0

Mvp Rank


Dynasty

Question


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  151
  • Reputation:   5
  • Joined:  11/09/12
  • Last Seen:  

Hi everyone and happy new year.

 

i would like to ask for a mvp rank that use sql table mvplogs.

 

emmm that is everything -w-

 

Peace!

Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

euphy way's of using SQL syntax is unoptimized

http://rathena.org/board/topic/90971-euphys-mvp-ladder-bug-npc-hides/?p=237993

try this

/*
alter table `char` add `mvp_kill` int(11) unsigned not null default 0 after unban_time, add key (`mvp_kill`);
*/
prontera,148,170,6	script	MVP Ladder	891,{
	mes "[MVP Ladder]";
	mes "Hello!";
	mes "What are you doing here?";
	next;
	switch(select("Check rankings.:My stats.:Nothing...")) {
	case 1:
		mes "[MVP Ladder]";
		.@nb = query_sql( "select name, mvp_kill from `char` where mvp_kill > 0 order by mvp_kill desc limit 20", .@name$, .@value );
		if ( !.@nb )
			mes "The rankings are empty.";
		else
			for ( .@i = 0; .@i < .@nb; .@i++ )
				mes "["+( .@i +1 )+"] "+ .@name$[.@i] +" ~ "+ .@value[.@i] +" kills";
		close;
	case 2:
		mes "[MVP Ladder]";
		query_sql "select mvp_kill from `char` where char_id = "+ getcharid(0), .@value;
		mes "You have killed "+( ( .@value )?"^0055FF"+ .@value :"no" )+"^000000 MVP"+( ( .@value == 1)? "." : "s." );
		close;
	default:
	}
	close;
OnNPCKillEvent:
	if ( getmonsterinfo( killedrid, MOB_MVPEXP ) ) {
		query_sql "update `char` set mvp_kill = mvp_kill + 1 where char_id = "+ getcharid(0);
		query_sql "select mvp_kill from `char` where char_id = "+ getcharid(0), .@value;
		dispbottom "~ You've killed "+ .@value +" MVP"+( ( .@value == 1 )? "" : "s" )+". ~";
		specialeffect2 EF_HEAL2;
	}
	end;
}
EDIT :

http://rathena.org/board/topic/66423-mvp-rank/?p=178037

lol ... totally forgotten I already made another one

same script, same method even

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  567
  • Reputation:   18
  • Joined:  04/15/13
  • Last Seen:  

prontera,148,170,6	script	MVP Ladder	891,{
	mes "[MVP Ladder]";
	mes "Hello!";
	mes "What are you doing here?";
	next;
	switch(select("Check rankings.:My stats.:Nothing...")) {
	case 1:
		mes "[MVP Ladder]";
		query_sql("SELECT char_id,CAST(`value` AS SIGNED) FROM `global_reg_value` WHERE `str` = 'MVP_Rank' ORDER BY CAST(`value` AS SIGNED) DESC LIMIT 20",.@cid,.@value);
		for(set .@i,0; .@i<getarraysize(.@cid); set .@i,.@i+1) {
			query_sql("SELECT `name` FROM `char` WHERE char_id = "+.@cid[.@i]+";",.@j$);
			set .@name$[.@i], .@j$;
		}
		if (!getarraysize(.@cid))
			mes "The rankings are empty.";
		else for(set .@i,0; .@i<getarraysize(.@cid); set .@i,.@i+1)
			mes "["+(.@i+1)+"] "+.@name$[.@i]+" ~ "+.@value[.@i]+" kills";
		close;
	case 2:
		mes "[MVP Ladder]";
		mes "You have killed "+((MVP_Rank)?"^0055FF"+MVP_Rank:"no")+"^000000 MVP"+((MVP_Rank == 1)?".":"s.");
		close;
	case 3:
		close;
	}

OnNPCKillEvent:
	if (getmonsterinfo(killedrid,22)) {
		set MVP_Rank, MVP_Rank+1;
		if (MVP_Rank == 1)
			query_sql("INSERT INTO `global_reg_value` (`char_id`,`str`,`value`,`type`,`account_id`) VALUES ("+getcharid(0)+",'MVP_Rank','1',3,0)");
		else
			query_sql("UPDATE `global_reg_value` SET `value` = '"+MVP_Rank+"' WHERE char_id = "+getcharid(0)+" AND `str` ='MVP_Rank'");
		dispbottom "~ You've killed "+MVP_Rank+" MVP"+((MVP_Rank == 1)?"":"s")+". ~";
		specialeffect2 313;
	}
	end;
}

Created by Euphy

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  151
  • Reputation:   5
  • Joined:  11/09/12
  • Last Seen:  

ill try both. Yonna and annie

 

but in reality i need one for those player that already have some mvp killed.

Edited by Dynasty
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

but in reality i need one for those player that already have some mvp killed.

unfortunately ... none ...

you have to get a script running then only able to log the data into a sql table

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  151
  • Reputation:   5
  • Joined:  11/09/12
  • Last Seen:  

ok, thank :D

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  168
  • Reputation:   0
  • Joined:  11/20/13
  • Last Seen:  

hi annie.. how to put delete mvp ladder here?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

hi annie.. how to put delete mvp ladder here?

[paste=4h0fgrfz7mvd]
  • Upvote 1
Link to comment
Share on other sites

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