Famous Posted September 15, 2013 Group: Members Topic Count: 145 Topics Per Day: 0.03 Content Count: 455 Reputation: 3 Joined: 06/19/12 Last Seen: February 26, 2018 Share 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 Link to comment Share on other sites More sharing options...
LatSo Posted September 15, 2013 Group: Members Topic Count: 69 Topics Per Day: 0.02 Content Count: 296 Reputation: 2 Joined: 04/11/13 Last Seen: December 22, 2020 Share Posted September 15, 2013 what castle is activated in your server? Quote Link to comment Share on other sites More sharing options...
Capuche Posted September 16, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share 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 Link to comment Share on other sites More sharing options...
Famous Posted September 17, 2013 Group: Members Topic Count: 145 Topics Per Day: 0.03 Content Count: 455 Reputation: 3 Joined: 06/19/12 Last Seen: February 26, 2018 Author Share 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 Link to comment Share on other sites More sharing options...
Capuche Posted September 17, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share 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 Link to comment Share on other sites More sharing options...
HelloKekette Posted September 19, 2013 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 36 Reputation: 0 Joined: 09/09/13 Last Seen: April 11, 2014 Share 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 Link to comment Share on other sites More sharing options...
Capuche Posted September 19, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share 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 Link to comment Share on other sites More sharing options...
Famous Posted September 22, 2013 Group: Members Topic Count: 145 Topics Per Day: 0.03 Content Count: 455 Reputation: 3 Joined: 06/19/12 Last Seen: February 26, 2018 Author Share 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 Link to comment Share on other sites More sharing options...
Famous Posted October 13, 2013 Group: Members Topic Count: 145 Topics Per Day: 0.03 Content Count: 455 Reputation: 3 Joined: 06/19/12 Last Seen: February 26, 2018 Author Share Posted October 13, 2013 · Hidden by Capuche, October 20, 2013 - No reason given Hidden by Capuche, October 20, 2013 - No reason given bump Link to comment
Emistry Posted October 13, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted October 13, 2013 add at the end of the script.... Quote Link to comment Share on other sites More sharing options...
Capuche Posted October 13, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share 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 Link to comment Share on other sites More sharing options...
Capuche Posted October 28, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share 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 Link to comment Share on other sites More sharing options...
Question
Famous
Can I request script after woe all players in the guild who gets a castle will received 30 cashpoints reward thank you!
Link to comment
Share on other sites
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.