caspa Posted February 4, 2013 Posted February 4, 2013 (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 February 4, 2013 by caspa Quote
Capuche Posted February 4, 2013 Posted February 4, 2013 (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 February 5, 2013 by Capuche 1 Quote
caspa Posted February 4, 2013 Author Posted February 4, 2013 (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 February 4, 2013 by caspa Quote
Capuche Posted February 4, 2013 Posted February 4, 2013 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. Quote
GM Takumirai Posted February 4, 2013 Posted February 4, 2013 How qbout in the npc if you want to reset the rankings? Quote
Capuche Posted February 4, 2013 Posted February 4, 2013 (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 February 4, 2013 by Capuche Quote
nazdecoco Posted March 24, 2013 Posted March 24, 2013 (edited) how can i see the rankings ofthe guild? [EDIT]... i already saw it,, thx Edited March 24, 2013 by nazdecoco Quote
heartfilia Posted June 12, 2013 Posted June 12, 2013 (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! Edited June 12, 2013 by heartfilia Quote
Capuche Posted June 12, 2013 Posted June 12, 2013 @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 Quote
heartfilia Posted July 14, 2013 Posted July 14, 2013 (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. 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 July 15, 2013 by heartfilia Quote
Capuche Posted July 16, 2013 Posted July 16, 2013 - .@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 Quote
xienne15 Posted September 7, 2013 Posted September 7, 2013 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? Quote
Capuche Posted September 7, 2013 Posted September 7, 2013 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); 1 Quote
xienne15 Posted September 8, 2013 Posted September 8, 2013 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); Thank you Capuche Quote
Fresh prince Posted January 15, 2014 Posted January 15, 2014 (edited) alter table guild add column woe_points int(11) default 0 after emblem_data, add index (woe_points); Should i run this on the mysql database? Edited January 16, 2014 by Fresh prince Quote
nanakiwurtz Posted January 16, 2014 Posted January 16, 2014 Yes, you only have to do it once, Fresh Prince. 1 Quote
Fresh prince Posted January 18, 2014 Posted January 18, 2014 Thanks very much for answering my question! Quote
Fresh prince Posted January 27, 2014 Posted January 27, 2014 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? Quote
AnnieRuru Posted January 28, 2014 Posted January 28, 2014 OnAgitBreak: if ( strcharinfo(3) != "prtg_cas01" ) query_sql "update guild set woe_points = woe_points +1 where guild_id = "+ getcharid(2); 1 Quote
Fresh prince Posted May 8, 2014 Posted May 8, 2014 Hello, what about if i want to exclude 3 castles? Should i do = "prtg_cas01", "prtg_cas02", "prtg_cas03") ? Quote
Capuche Posted May 8, 2014 Posted May 8, 2014 if ( preg_match( "prtg_cas0[123]",strcharinfo(3) ) ) Quote
Fresh prince Posted May 8, 2014 Posted May 8, 2014 Thanks Mr. Capuche, these are prontera castles. What if i want to include payg_cas04? payg_cas04,prtg_cas05, and aldeg_cas02? Thank you so much! Quote
Capuche Posted May 9, 2014 Posted May 9, 2014 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.. Quote
Question
caspa
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 caspa28 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.