Jump to content
  • 0

Guild Ranking npc


iubantot

Question


  • Group:  Members
  • Topic Count:  117
  • Topics Per Day:  0.03
  • Content Count:  312
  • Reputation:   34
  • Joined:  10/15/12
  • Last Seen:  

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.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  117
  • Topics Per Day:  0.03
  • Content Count:  312
  • Reputation:   34
  • Joined:  10/15/12
  • Last Seen:  

it's working but how do i reset the points?

and another thing can the point be added after the WOE ended?

Edited by ivantuting
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  117
  • Topics Per Day:  0.03
  • Content Count:  312
  • Reputation:   34
  • Joined:  10/15/12
  • Last Seen:  

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 :(

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