Jump to content
  • 0
Sign in to follow this  
Caves

[REQUEST] Can someone make a script for woe reward

Question

Can someone please make a script that gives a reward to the winners of the castle.
It will give a different item per castle.

I tried to edit a script i found somewhere, but i cant seem to make it work properly.
can someone please help me. Here's the script that i found:

 

//Author	:	Goddameit
//Version	:	2012/06/24 - 04:19
//Web		:	http://goo.gl/8Nedn
/*
I added some checks to make sure that will not happen some errors what I didn't expect for.
Test in eA15*** SQL
*/
function	script	AllGuildMemberEvent	{
	if(!set(.@gid,getcastledata(getarg(0),1)))
		return;
	query_sql("select account_id, char_id from `guild_member` where guild_id = '"+.@gid+"'", .@gmaid, .@gmcid);
	set .@amount,getarraysize(.@gmcid);
	for(set .@i,0;.@i<.@amount;set .@i,.@i+1)
	{
		if(!.@gmaid[.@i])
			continue;
		query_sql("select last_ip from `login` where account_id = '"+.@gmaid[.@i]+"'",.@ip$);
		query_sql("select account_id from `login` where last_ip= '"+.@ip$+"'",.@aa);
		set .@bb,getarraysize(.@aa);		
		for(set .@i2,1;.@i2<.@bb;set .@i2,.@i2+1)
		{
			for(set .@i3,0;.@i3<.@amount;set .@i3,.@i3+1)
			{
				if(.@aa[.@i2]==.@gmaid[.@i3])
				{
					set .@gmaid[.@i3],0;
					set .@gmcid[.@i3],0;
				}
			}
		}
		if(attachrid(.@gmaid[.@i])) //For "prtg_cas04" winners
		{
			message strcharinfo(0),"VICTORY!!";
			getitem 607,1;
			detachrid;
		}
		if(attachrid(.@gmaid[.@i])) //For "gefg_cas04" winners
		{
			message strcharinfo(0),"VICTORY!!";
			getitem 608,1;
			detachrid;
		}
		if(attachrid(.@gmaid[.@i])) //For "aldeg_cas03" winners 
		{
			message strcharinfo(0),"VICTORY!!";
			getitem 609,1;
			detachrid;
		}
		if(attachrid(.@gmaid[.@i])) //For "payg_cas02" winners
		{
			message strcharinfo(0),"VICTORY!!";
			getitem 606,1;
			detachrid;
		}
		if(attachrid(.@gmaid[.@i])) //For "arug_cas01" winners
		{
			message strcharinfo(0),"VICTORY!!";
			getitem 606,1;
			detachrid;
		}
		if(attachrid(.@gmaid[.@i])) //For "schg_cas03" winners
		{
			message strcharinfo(0),"VICTORY!!";
			getitem 606,1;
			detachrid;
		}
		if(attachrid(.@gmaid[.@i])) //For "payg_cas04" winners
		{
			message strcharinfo(0),"VICTORY!!";
			getitem 606,1;
			detachrid;
		}
	}
	return;
}

-	script	AGME	-1,{

OnAgitEnd:
	setarray .@maps$[0],"prtg_cas04","gefg_cas04","aldeg_cas03","payg_cas02","arug_cas01","schg_cas03","payg_cas04";
		
		
	for( set .@i,0; .@i <= 6; set .@i, .@i+1)
	{
		callfunc "AllGuildMemberEvent",.@maps$[.@i];
	}
	end;
}

 

Share this post


Link to post
Share on other sites

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

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.