Jump to content
  • 0

Guild Ranker By Conquer Calculations


Question

Posted (edited)

Is it possible to make a Guild based on how many times you have conquered a castle?

like if guild A conquered alde_cas01 then they gained + 1 guild rank

then after 10 minutes the Guild B conquered the castle so the Guild B gains + 1 Guild Rank

and after 10 minutes again the Guild A conquers the Castle so they gained + 1 again .... so the total would be 2.............

something like this......

but if Guild A Break the guild then the rank of the guild would also be deleted on the rank page.......

Edited by caspa

Recommended Posts

Posted (edited)

SQL

alter table guild add column woe_points int(11) default 0 after emblem_data, add index (woe_points);

In npc/guild/agit_main.txt under OnAgitBreak: add

query_sql "update guild set woe_points = woe_points +1 where guild_id = "+ getcharid(2);

Ref this post

*If you want to display guild points

prontera,155,181,5	script	Woe Points	100,{
.@nb = query_sql( "select name, woe_points from guild order by woe_points desc limit 3", .@guild_name$, .@points );
for ( .@i = 0; .@i < .@nb; .@i++ ) {
	if ( !.@points[.@i] ) break;
	mes ( .@i +1 )+". "+ .@guild_name$[.@i] +" -> "+ .@points[.@i];
}
close;
}

Edited by Capuche
  • Upvote 1
Posted (edited)

thank you capuche!! i have not tested it yet since im not on my house yet...... but this script is not something attach to the breaker right? i mean if

juanito from the demigodz guild breaks the emp!! then that guild gains the +1 so theyre part of the rank now....... but then the player suddenly decides to leave the guild!! the +1 that the guild earned will stay right there right? and not disappear and would only disappear unless the guild is being /breakguild......

Edited by caspa
Posted
the +1 that the guild earned will stay right there right? and not disappear and would only disappear unless the guild is being /breakguild......

Yeah it's attached to the guild not to players.

Posted (edited)

It's easy to reset by sql no need this option I guess.

prontera,155,181,5    script    Woe Points    100,{
   if( getgmlevel() > 1 ) {
       if( select( "Reset ?", "Continue" ) == 1 ) {
           query_sql "UPDATE `guild` SET `woe_points` = '0' WHERE `woe_points` > 0";
           close;
       }
   }
   .@nb = query_sql( "select name, woe_points from guild order by woe_points desc limit 3", .@guild_name$, .@points );
   for ( .@i = 0; .@i < .@nb; .@i++ ) {
       if ( !.@points[.@i] ) break;
       mes ( .@i +1 )+". "+ .@guild_name$[.@i] +" -> "+ .@points[.@i];
   }
   close;
}

Edited by Capuche
Posted

@Capuche - I want to use the script in a certain map only.

How?

And there is no agit_main.txt in npc/guild/

 

Thanks!

 

The file's name is agit_template on eathena.

 

Under OnAgitBreak: add

	if ( strcharinfo(3) == "Your Castle Map Name" )
		query_sql "update guild set woe_points = woe_points +1 where guild_id = "+ getcharid(2);

and replace "Your Castle Map Name" by the map name of the castle

Posted (edited)

@Capuche - I want to use the script in a certain map only.

How?

And there is no agit_main.txt in npc/guild/

 

Thanks!

 

The file's name is agit_template on eathena.

 

Under OnAgitBreak: add

	if ( strcharinfo(3) == "Your Castle Map Name" )
		query_sql "update guild set woe_points = woe_points +1 where guild_id = "+ getcharid(2);

and replace "Your Castle Map Name" by the map name of the castle

Thanks for that. /no1 BTW

I tried this on eathena

 

It's easy to reset by sql no need this option I guess.

 

prontera,155,181,5    script    Woe Points    100,{
    if( getgmlevel() > 1 ) {
        if( select( "Reset ?", "Continue" ) == 1 ) {
            query_sql "UPDATE `guild` SET `woe_points` = '0' WHERE `woe_points` > 0";
            close;
        }
    }
    .@nb = query_sql( "select name, woe_points from guild order by woe_points desc limit 3", .@guild_name$, .@points );
    for ( .@i = 0; .@i < .@nb; .@i++ ) {
        if ( !.@points[.@i] ) break;
        mes ( .@i +1 )+". "+ .@guild_name$[.@i] +" -> "+ .@points[.@i];
    }
    close;
}

 

But there is an error in Line 8. Not working in eathena/3CeAM?

Edited by heartfilia
Posted
-    .@nb = query_sql( "select name, woe_points from guild order by woe_points desc limit 3", .@guild_name$, .@points );
-    for ( .@i = 0; .@i < .@nb; .@i++ ) {
+    set .@nb, query_sql( "select name, woe_points from guild order by woe_points desc limit 3", .@guild_name$, .@points );
+    for ( set .@i, 0; .@i < .@nb; set .@i, .@i +1 ) {

Not working in eathena/3CeAM?

these emu don't support direct variable assignment like in C

Posted

SQL

alter table guild add column woe_points int(11) default 0 after emblem_data, add index (woe_points);
In npc/guild/agit_main.txt under OnAgitBreak: add

	query_sql "update guild set woe_points = woe_points +1 where guild_id = "+ getcharid(2);
Ref this post

*If you want to display guild points

prontera,155,181,5	script	Woe Points	100,{
	.@nb = query_sql( "select name, woe_points from guild order by woe_points desc limit 3", .@guild_name$, .@points );
	for ( .@i = 0; .@i < .@nb; .@i++ ) {
		if ( !.@points[.@i] ) break;
		mes ( .@i +1 )+". "+ .@guild_name$[.@i] +" -> "+ .@points[.@i];
	}
	close;
}

How about on guild2/agit_main_se.txt? nothing to change? just the guild/agit_main.txt?

Posted

About woe 2, in agit_main_se add the sql update under OnStartArena

OnStartArena:
	query_sql "update guild set woe_points = woe_points +1 where guild_id = "+ getcharid(2);
  • Upvote 1
Posted

Im sorry to ask again, but how can I exclude 1 castle on breaks being counted?

Say i do not want for prtg_cas01 to be included?

Thanks!!

Under OnAgitBreak:

if (!strcharinfo(3) == "prtg_cas01" )

query_sql "update guild set woe_points = woe_points +1 where guild_id = "+ getcharid(2);

-is this correct?

Posted

I misread, you want to exclude the castle.. in the previous post it should be

if ( preg_match( "prtg_cas0[123]",strcharinfo(3) ) == 0 )
    query_sql "update guild set woe_points = woe_points +1 where guild_id = "+ getcharid(2);
.@map$ = strcharinfo(3);
if ( preg_match( "prtg_cas0[123]",.@map$ ) == 0 && preg_match( "payg_cas0[45]",.@map$ ) == 0 && preg_match( "aldeg_cas0[2]",.@map$ ) == 0 )
	query_sql "update guild set woe_points = woe_points +1 where guild_id = "+ getcharid(2);

prtg_cas0[123] to exclude prtg_cas01, prtg_cas02, prtg_cas03

payg_cas0[45] to exclude castle 4, 5 etc..

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