Jump to content
  • 0

Woe Cash points Guild Reward


Question

11 answers to this question

Recommended Posts

Posted

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;
Posted


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;

Posted

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;
 
Posted
-	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

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

Posted

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

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