//Version : (2011/5/27-22:46)
- script fi -1,{
OnWhisperGlobal:
if(!getgmlevel())
end;
if(@whispervar0$=="all")
callfunc "itemforall",strcharinfo(0),atoi(@whispervar1$),atoi(@whispervar2$);
if(@whispervar0$=="map")
callfunc "itemforallmap",strcharinfo(0),atoi(@whispervar1$),atoi(@whispervar2$),@whispervar3$;
end;
}
function script itemforallmap {
getmapxy(.@N$,.@B,.@C,0);
if( getitemname(getarg(1)) == "null" ){ announce "error id 1-1",bc_self,0x00FFFF; end; }
if( getarg(1) <= 0 ){ announce "error id 2-1",bc_self,0x00FFFF; end; }
while( .@V < $PlayerNumber ){
set .@V,.@V+1;
getmapxy(.@N123$,.@B,.@C,0,rid2name(getd("$RecordAID"+.@V)));
if( .@N$ == .@N123$ && getarg(3) == "" )||( getarg(3) != "" && getarg(3) == .@N123$ ){
message rid2name(getd("$RecordAID"+.@V)),getarg(0)+" give you "+getitemname(getarg(1))+"x"+getarg(2)+". Now hurry and pick it up!";
//getitem getarg(1),getarg(2),getd("$RecordAID"+.@V);
//makeitem getarg(1),getarg(2),.@N123$,.@B,.@C;
for(set .@a,0;.@a<getarg(2);set .@a,.@a+1) makeitem getarg(1),1,.@N123$,.@B,.@C;
}
}
return;
}
function script itemforall {
if( getitemname(getarg(1)) == "null" ){ announce "error id 1-2",bc_self,0x00FFFF; end; }
if( getarg(1) <= 0 ){ announce "error id 2-2",bc_self,0x00FFFF; end; }
while( .@V < $PlayerNumber ){
set .@V,.@V+1;
if( isloggedin(getd("$RecordAID"+.@V)) ){
message rid2name(getd("$RecordAID"+.@V)),getarg(0)+" give you "+getitemname(getarg(1))+"x"+getarg(2)+". Now hurry and pick it up!";
getmapxy(.@N123$,.@B,.@C,0,rid2name(getd("$RecordAID"+.@V)));
//makeitem getarg(1),getarg(2),.@N123$,.@B,.@C;
for(set .@a,0;.@a<getarg(2);set .@a,.@a+1) makeitem getarg(1),1,.@N123$,.@B,.@C;
//getitem getarg(1),getarg(2),getd("$RecordAID"+.@V);
}
}
return;
}
- script BlackHoleEvent -1,{
OnPCLoginEvent:
setd "$RecordAID"+set($PlayerNumber,$PlayerNumber+1),getcharid(3);
end;
OnInit:
OnTimer5000:
initnpctimer;
for(set .@i,1;.@i<=$PlayerNumber;set .@i,.@i+1)
{
if(!isloggedin(getd("$RecordAID"+.@i)))
{
if(!getd("$RecordAID"+.@i))
{
set $PlayerNumber,0;
break;
}
setd "$RecordAID"+.@i,getd("$RecordAID"+(.@i+1));
setd "$RecordAID"+(.@i+1),0;
set .@i,.@i-1;
}
}
end;
}