Jump to content
  • 0

Woe Cash points Guild Reward


Famous

Question


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.03
  • Content Count:  455
  • Reputation:   3
  • Joined:  06/19/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  296
  • Reputation:   2
  • Joined:  04/11/13
  • Last Seen:  

what castle is activated in your server?

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.03
  • Content Count:  455
  • Reputation:   3
  • Joined:  06/19/12
  • Last Seen:  

@LatSo

here is my active castle

prtg_cas01 prtg_cas02 prtg_cas03 prtg_cas04 prtg_cas05

 

 

@Capuche how to add more castle?




 

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


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;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   0
  • Joined:  09/09/13
  • Last Seen:  

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


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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];
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.03
  • Content Count:  455
  • Reputation:   3
  • Joined:  06/19/12
  • Last Seen:  

-	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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.03
  • Content Count:  455
  • Reputation:   3
  • Joined:  06/19/12
  • Last Seen:  

Posted · Hidden by Capuche, October 20, 2013 - No reason given
Hidden by Capuche, October 20, 2013 - No reason given

bump

Link to comment

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

add at the end of the script....

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

-	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

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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