Jump to content
  • 0

Question

Posted

schg_cas 01 = 3 points

arug_cas01 = 2 points

prtg_cas01 = 1 point

 

The guild will gain points whenever their guild conquered the castle.

There will also be a npc that will show the rankings of the guild.

max of 10 guild will be displayer in the top 10 guild ranking.

4 answers to this question

Recommended Posts

Posted

Put under npc/guild/agit_main.txt#L102 :

if ( getcharid( 2 ) ) {
	if ( strcharinfo( 3 ) == "prtg_cas01" )
		setd "$grank_" + getcharid( 2 ), getd( "$grank_" + getcharid( 2 ) ) + 1;
	else if ( strcharinfo( 3 ) == "arug_cas01" )
		setd "$grank_" + getcharid( 2 ), getd( "$grank_" + getcharid( 2 ) ) + 2;
	else if ( strcharinfo( 3 ) == "schg_cas01" ) 
		setd "$grank_" + getcharid( 2 ), getd( "$grank_" + getcharid( 2 ) ) + 3;
}

Then ladder : 

prontera,150,150,0	script	Sample	100,{
	set .@top, 10;
	
	query_sql "SELECT `varname`, `value` FROM `mapreg` WHERE `varname` LIKE '$grank_%' ORDER BY CONVERT( `value`, UNSIGNED INTEGER ) DESC LIMIT " + .@top, .@n$, .@p;
	
	mes "[ TOP " + .@top + " ]";
	for ( .@i = 0; .@i < getarraysize( .@n$ ); .@i++ ) {
		explode( .@arr$, .@n$[ .@i ], "_" );
		dispbottom .@arr$[1];
		mes ( .@i + 1 ) + ". " + getguildname( atoi( .@arr$[ 1 ] ) ) + " with " + .@p[ .@i ] + " points";
	}
	close;
}

Not tested. Not instant because we use sql.

  • Upvote 1
Posted

Reset the ladder by executing this :

DELETE FROM `mapreg` WHERE `varname` LIKE '$grank_%';

If you want it to add after the woe, Please refer to OnAgitEnd event label and getcastledata script command.

Posted

Reset the ladder by executing this :

DELETE FROM `mapreg` WHERE `varname` LIKE '$grank_%';

If you want it to add after the woe, Please refer to OnAgitEnd event label and getcastledata script command.

 

 

 

>>guildpoints(getcastledata(prtg_cas01) = guildpoints(1) + 1; ?

 

how am i supposed to make a variable like guildpoints ? :( I get the flow but i dont know what commands to use :(

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...