I'm currently using a script from this thread: Link
Im using eAthena SVN and the script is working but my problem is that, only the Guild Leader is receiving the prize.
Thanks in advance for helping out.
Here is my code:
//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]))
{
message strcharinfo(0),"Victory !!";
getitem 969,5;
detachrid;
}
}
return;
}
- script AGME -1,{
OnAgitEnd:
setarray .@maps$[0],"prtg_cas01";
//"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05",
//"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05",
//"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05",
//"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05";
for( set .@i,0; .@i <= 19; set .@i, .@i+1)
{
callfunc "AllGuildMemberEvent",.@maps$[.@i];
}
end;
}