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:
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:
Code:
//Author : Goddameit
//Version : 2012/06/24 - 04:19
//Web : [URL="http://goo.gl/8Nedn"]http://goo.gl/8Nedn[/URL]
/*
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;
}