probably a wrong bypass string with less than required parameters sent from the npc as "command" , this would fix the problem. source: http://javarevisited.blogspot.com/2012/02/how-to-solve-javautilnosuchelementexcep.html
private static void sendReport(String event, L2PcInstance player, String command)
{
StringTokenizer st = new StringTokenizer(command);
if(st.hasMoreTokens())
st.nextToken();
String message = "";
String _type = null;
L2GameClient info = player.getClient().getConnection().getClient();
try
{
if(st.hasMoreTokens())
_type = st.nextToken();
while (st.hasMoreTokens())
{
message = message + st.nextToken() + " ";
}
if (message.equals(""))
{
player.sendMessage("Message box cannot be empty.");
return;
}
String timeStamp = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss").format(Calendar.getInstance().getTime());
String fname = "data/Reports/" + player.getName() + " "+timeStamp+".txt";
File file = new File(fname);
boolean exist = file.createNewFile();
if (!exist)
{
return;
}
FileWriter fstream = new FileWriter(fname);
BufferedWriter out = new BufferedWriter(fstream);
out.write("Character Info: " + info + "\r\nBug Type: " + _type + "\r\nMessage: " + message);
player.sendMessage("Report successfully sent. Staff will check it soon, thank you!");
for (L2PcInstance allgms : L2World.getAllGMs())
{
allgms.sendMessage(player.getName() + " has sent a report. Type: " + _type);
}
out.close();
}
catch (Exception e)
{
L2Character._log.warning("could not send report: " + e);
}
}