OnBat:
set $@KingTmpID,getcharid(3);
if (isloggedin($rmk_kingAID[gettime(4)],$rmk_kingCID[gettime(4)])){
attachrid($rmk_kingAID[gettime(4)]);
if (strcharinfo(0) == $rmk_king$[gettime(4)]){
delitem $@KingItems[gettime(4)],1;
detachrid;
attachrid($@KingTmpID);
goto DelEnde;
}
}
set .@i,0;
query_sql "DELETE FROM inventory WHERE (nameid = '"+$@KingItems[gettime(4)]+"')";
query_sql "UPDATE `char` SET `ITEMStobeADDED` = '"+.@i+"' WHERE `char_id` = '"+$rmk_kingCID[gettime(4)]+"'";
DelEnde:
set $rmk_king$[gettime(4)],strcharinfo(0);
set $rmk_kingAID[gettime(4)],getcharid(3);
set $rmk_kingCID[gettime(4)],getcharid(0);
getitem $@KingItems[gettime(4)],1;
announce $rmk_king$[gettime(4)]+" Testing "+$@KingItemsName$[gettime(4)],bc_all;
set $rmk_active,0;
pvpoff "map_1-1.gat";
sleep 5000;
mapwarp "map_1-1","map",x,y;
end;