npc2 = NpcTable.getInstance().getTemplate(mid2);
NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
TextBuilder replyMSG = new TextBuilder();
if (npc1 != null && npc2 != null)
{
replyMSG.append("<html><title>Selected mobs to fight</title>");
replyMSG.append("<body>");
replyMSG.append("<table>");
replyMSG.append("<tr><td>First</td><td>Second</td></tr>");
replyMSG.append("<tr><td>level "+lvl1+"</td><td>level "+lvl2+"</td></tr>");
replyMSG.append("<tr><td>id "+npc1.npcId+"</td><td>id "+npc2.npcId+"</td></tr>");
replyMSG.append("<tr><td>"+npc1.name+"</td><td>"+npc2.name+"</td></tr>");
replyMSG.append("</table>");
replyMSG.append("<center><br><br><br>");
replyMSG.append("<button value=\"OK\" action=\"bypass -h admin_fight_calculator_show "+npc1.npcId+" "+npc2.npcId+"\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
replyMSG.append("</center>");
replyMSG.append("</body></html>");
}
else if (lvl1 != 0 && npc1 == null)
{
replyMSG.append("<html><title>Select first mob to fight</title>");
replyMSG.append("<body><table>");
L2NpcTemplate[] npcs = NpcTable.getInstance().getAllOfLevel(lvl1);
for (L2NpcTemplate n : npcs) {
replyMSG.append("<tr><td><a action=\"bypass -h admin_fight_calculator lvl1 "+lvl1+" lvl2 "+lvl2+" mid1 "+n.npcId+" mid2 "+mid2+"\">"+n.name+"</a></td></tr>");
}
replyMSG.append("</table></body></html>");
}
else if (lvl2 != 0 && npc2 == null)
{
replyMSG.append("<html><title>Select second mob to fight</title>");
replyMSG.append("<body><table>");
L2NpcTemplate[] npcs = NpcTable.getInstance().getAllOfLevel(lvl2);
for (L2NpcTemplate n : npcs) {
replyMSG.append("<tr><td><a action=\"bypass -h admin_fight_calculator lvl1 "+lvl1+" lvl2 "+lvl2+" mid1 "+mid1+" mid2 "+n.npcId+"\">"+n.name+"</a></td></tr>");
}
replyMSG.append("</table></body></html>");
}
else {
replyMSG.append("<html><title>Select mobs to fight</title>");
replyMSG.append("<body>");
replyMSG.append("<table>");
replyMSG.append("<tr><td>First</td><td>Second</td></tr>");
replyMSG.append("<tr><td><edit var=\"lvl1\" width=80></td><td><edit var=\"lvl2\" width=80></td></tr>");
replyMSG.append("</table>");
replyMSG.append("<center><br><br><br>");
replyMSG.append("<button value=\"OK\" action=\"bypass -h admin_fight_calculator lvl1 $lvl1 lvl2 $lvl2\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
replyMSG.append("</center>");
replyMSG.append("</body></html>");
}
adminReply.setHtml(replyMSG.toString());
activeChar.sendPacket(adminReply);
}