Famous Posted September 15, 2013 Posted September 15, 2013 Can I request script after woe all players in the guild who gets a castle will received 30 cashpoints reward thank you! Quote
LatSo Posted September 15, 2013 Posted September 15, 2013 what castle is activated in your server? Quote
Capuche Posted September 16, 2013 Posted September 16, 2013 something like this OnAgitEnd: .@castle_map$ = "prtg_cas01";// your castle map .@guild_id = getcastledata( .@castle_map$,1 ); .@count = query_sql( "select account_id from guild_member where guild_id = "+ .@guild_id +" and online = 1", .@account_id ); while( .@i < .@count ) { attachrid .@account_id[.@i]; #CASHPOINTS += 30; .@i++; } query_sql "INSERT INTO `global_reg_value` (`char_id`, `str`, `value`, `type`, `account_id`) select `guild_member`.`char_id`, '#CASHPOINTS', '30', '3', '0' from `guild_member` where guild_id = "+ .@guild_id +" and online = 0 on duplicate key update `value` = `value` +30"; end; EDIT : can be done with addrid too OnAgitEnd: .@castle_map$ = "prtg_cas01";// your castle map .@guild_id = getcastledata( .@castle_map$,1 ); query_sql "INSERT INTO `global_reg_value` (`char_id`, `str`, `value`, `type`, `account_id`) select `guild_member`.`char_id`, '#CASHPOINTS', '30', '3', '0' from `guild_member` where guild_id = "+ .@guild_id +" and online = 0 on duplicate key update `value` = `value` +30"; addrid( 3,0, .@guild_id ); #CASHPOINTS += 30; end; Quote
Famous Posted September 17, 2013 Author Posted September 17, 2013 @LatSo here is my active castle prtg_cas01 prtg_cas02 prtg_cas03 prtg_cas04 prtg_cas05 @Capuche how to add more castle? Quote
Capuche Posted September 17, 2013 Posted September 17, 2013 OnAgitEnd: setarray .@castle_map$, "prtg_cas01", "prtg_cas02", "prtg_cas03", "prtg_cas04", "prtg_cas05";// your castle map .@size = getarraysize( .@castle_map$ ); while( .@j < .@size ) { .@guild_id = getcastledata( .@castle_map$[.@j],1 ); if ( .@guild_id ) { .@count = query_sql( "select account_id from guild_member where guild_id = "+ .@guild_id +" and online = 1", .@account_id ); for ( .@i = 0; .@i < .@count; .@i++ ) { if ( attachrid .@account_id[.@i] ) #CASHPOINTS += 30; } query_sql "INSERT INTO `global_reg_value` (`char_id`, `str`, `value`, `type`, `account_id`) select `guild_member`.`char_id`, '#CASHPOINTS', '30', '3', '0' from `guild_member` where guild_id = "+ .@guild_id +" and online = 0 on duplicate key update `value` = `value` +30"; } .@j++; } end; Quote
HelloKekette Posted September 19, 2013 Posted September 19, 2013 How can I switch Cash Point with War Badges with this script ? It runs if i do this : for ( .@i = 0; .@i < .@count; .@i++ ) { if ( attachrid .@account_id[.@i] ) #CASHPOINTS += 30; to for ( .@i = 0; .@i < .@count; .@i++ ) { if ( attachrid .@account_id[.@i] ) getitem 7773,20; Quote
Capuche Posted September 19, 2013 Posted September 19, 2013 Yes it's correct however you can delete the attachrid part when giving an item for ( .@i = 0; .@i < .@count; .@i++ ) { getitem 7773,20, .@account_id[.@i]; 1 Quote
Famous Posted September 22, 2013 Author Posted September 22, 2013 - script allwoecashrewards -1,{ OnAgitEnd: setarray .@castle_map$, "prtg_cas01", "prtg_cas02", "prtg_cas03", "prtg_cas04", "prtg_cas05","aldeg_cas05", "payg_cas04", "gefg_cas02", "aldeg_cas02";// your castle map .@size = getarraysize( .@castle_map$ ); while( .@j < .@size ) { .@guild_id = getcastledata( .@castle_map$[.@j],1 ); if ( .@guild_id ) { .@count = query_sql( "select account_id from guild_member where guild_id = "+ .@guild_id +" and online = 1", .@account_id ); for ( .@i = 0; .@i < .@count; .@i++ ) { if ( attachrid .@account_id[.@i] ) #CASHPOINTS += 30; } query_sql "INSERT INTO `global_reg_value` (`char_id`, `str`, `value`, `type`, `account_id`) select `guild_member`.`char_id`, '#CASHPOINTS', '30', '3', '0' from `guild_member` where guild_id = "+ .@guild_id +" and online = 0 on duplicate key update `value` = `value` +30"; } .@j++; } end; missing 1 curlys <-- how to fix this Quote
Famous Posted October 13, 2013 Author Posted October 13, 2013 · Hidden by Capuche, October 20, 2013 - No reason given Hidden by Capuche, October 20, 2013 - No reason given bump
Capuche Posted October 13, 2013 Posted October 13, 2013 - script allwoecashrewards -1,{ OnAgitEnd: setarray .@castle_map$, "prtg_cas01", "prtg_cas02", "prtg_cas03", "prtg_cas04", "prtg_cas05","aldeg_cas05", "payg_cas04", "gefg_cas02", "aldeg_cas02";// your castle map .@size = getarraysize( .@castle_map$ ); while( .@j < .@size ) { .@guild_id = getcastledata( .@castle_map$[.@j],1 ); if ( .@guild_id ) { .@count = query_sql( "select account_id from guild_member where guild_id = "+ .@guild_id +" and online = 1", .@account_id ); for ( .@i = 0; .@i < .@count; .@i++ ) { if ( attachrid .@account_id[.@i] ) #CASHPOINTS += 30; } query_sql "INSERT INTO `global_reg_value` (`char_id`, `str`, `value`, `type`, `account_id`) select '0', '#CASHPOINTS', '30', '2', `guild_member`.`account_id` from `guild_member` where guild_id = "+ .@guild_id +" and online = 0 on duplicate key update `value` = `value` +30"; } .@j++; } end; } there was an error with insert into too Also this script give a reward for each member in the guild regardless their account/ip... I should rewrite it Quote
Capuche Posted October 28, 2013 Posted October 28, 2013 here a new version which check the ip of the guid members - script allwoecashrewards -1,{ OnAgitEnd: setarray .@castle_map$, "prtg_cas01", "prtg_cas02", "prtg_cas03", "prtg_cas04", "prtg_cas05","aldeg_cas05", "payg_cas04", "gefg_cas02", "aldeg_cas02";// your castle map .@size = getarraysize( .@castle_map$ ); while( .@j < .@size ) { .@guild_id = getcastledata( .@castle_map$[.@j],1 ); if ( .@guild_id ) { .@count = query_sql( "select distinct `account_id` from `char` where `online` = 1 and `account_id` = ( select `login`.`account_id` from `login` "+ "left join `char` on `char`.`account_id` = `login`.`account_id` where `guild_id` = "+ .@guild_id +" group by `last_ip` ) order by `account_id` asc", .@account_id ); for ( .@i = 0; .@i < .@count; .@i++ ) { attachrid .@account_id[.@i]; #CASHPOINTS += 30; } query_sql "INSERT INTO `global_reg_value` (`char_id`, `str`, `value`, `type`, `account_id`) (select distinct '0', '#CASHPOINTS', '30', '2', `account_id` "+ "from `char` where `online` = 0 and `account_id` = ( select `login`.`account_id` from `login` "+ "left join `char` on `char`.`account_id` = `login`.`account_id` where `guild_id` = "+ .@guild_id +" group by `last_ip` ) order by `account_id` asc) "+ "on duplicate key update `value` = `value` +30"; } .@j++; } end; } Quote
Question
Famous
Can I request script after woe all players in the guild who gets a castle will received 30 cashpoints reward thank you!
11 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.