{
String[] commandSplit = command.split(" ");
int npcId = Integer.valueOf(commandSplit[1]);
L2NpcTemplate npc = NpcTable.getInstance().getTemplate(npcId);
Show_Npc_Property(activeChar, npc);
commandSplit = null;
npc = null;
}
catch(Exception e)
{
if(Config.ENABLE_ALL_EXCEPTIONS)
e.printStackTrace();
activeChar.sendMessage("Wrong usage: //edit_npc <npcId>");
}
}else{
if(activeChar.getTarget() instanceof L2NpcInstance){
int npcId = Integer.valueOf(((L2NpcInstance) activeChar.getTarget()).getNpcId());
L2NpcTemplate npc = NpcTable.getInstance().getTemplate(npcId);
Show_Npc_Property(activeChar, npc);
npc = null;
}
}
}
else if(command.startsWith("admin_load_npc"))
{
StringTokenizer st = new StringTokenizer(command);
st.nextToken();
int id = 0;
try
{
id = Integer.parseInt(st.nextToken());
}
catch(Exception e)
{
activeChar.sendMessage("Usage: //load_npc <id>");
}
if(id > 0)
NpcTable.getInstance().reloadNpc(id);
}
else if(command.startsWith("admin_show_droplist "))
{
int npcId = 0;
try
{
npcId = Integer.parseInt(command.substring(20).trim());
}
catch(Exception e)
{
if(Config.ENABLE_ALL_EXCEPTIONS)
e.printStackTrace();
}
if(npcId > 0)
{
showNpcDropList(activeChar, npcId);
}
else
{
activeChar.sendMessage("Usage: //show_droplist <npc_id>");
}
}
else if(command.startsWith("admin_addShopItem "))
{
String[] args = command.split(" ");
if(args.length > 1)
{
addShopItem(activeChar, args);
}
args = null;
}
else if(command.startsWith("admin_delShopItem "))
{
String[] args = command.split(" ");
if(args.length > 2)
{
delShopItem(activeChar, args);
}
args = null;
}
else if(command.startsWith("admin_editShopItem "))
{
String[] args = command.split(" ");
if(args.length > 2)
{
editShopItem(activeChar, args);
}
args = null;
}
else if(command.startsWith("admin_save_npc "))
{
try
{
save_npc_property(activeChar, command);
}
catch(StringIndexOutOfBoundsException e)
{
if(Config.ENABLE_ALL_EXCEPTIONS)
e.printStackTrace();
}
}
else if(command.startsWith("admin_show_skilllist_npc "))
{
StringTokenizer st = new StringTokenizer(command.substring(25), " ");
try
{
int npcId = -1;
int page = 0;
if (st.countTokens() <= 2)
{
if (st.hasMoreTokens())
npcId = Integer.parseInt(st.nextToken());
if (st.hasMoreTokens())
page = Integer.parseInt(st.nextToken());
}
if(npcId > 0)
{
showNpcSkillList(activeChar, npcId, page);
}
else
activeChar.sendMessage("Usage: //show_skilllist_npc <npc_id> <page>");
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //show_skilllist_npc <npc_id> <page>");
}
}
else if(command.startsWith("admin_edit_skill_npc "))
{
int npcId = -1, skillId = -1;
try
{
StringTokenizer st = new StringTokenizer(command.substring(21).trim(), " ");
if (st.countTokens() == 2)
{
try
{
npcId = Integer.parseInt(st.nextToken());
skillId = Integer.parseInt(st.nextToken());
showNpcSkillEdit(activeChar, npcId, skillId);
}
catch(Exception e)
{}
}
else if (st.countTokens() == 3)
{
try
{
npcId = Integer.parseInt(st.nextToken());
skillId = Integer.parseInt(st.nextToken());
int level = Integer.parseInt(st.nextToken());
updateNpcSkillData(activeChar, npcId, skillId, level);
}
catch(Exception e)
{
_log.fine("admin_edit_skill_npc parements error: " + command);
}
}
else
{
activeChar.sendMessage("Usage: //edit_skill_npc <npc_id> <item_id> [<level>]");
}
}
catch (StringIndexOutOfBoundsException e)
{
activeChar.sendMessage("Usage: //edit_skill_npc <npc_id> <item_id> [<level>]");
}
}
else if(command.startsWith("admin_add_skill_npc "))
{
int npcId = -1, skillId = -1;
try
{
StringTokenizer st = new StringTokenizer(command.substring(20).trim(), " ");
if(st.countTokens() == 1)
{
try
{
String[] input = command.substring(20).split(" ");
if (input.length < 1)
return true;
npcId = Integer.parseInt(input[0]);
}
catch(Exception e){}
if(npcId > 0)
{
L2NpcTemplate npcData = NpcTable.getInstance().getTemplate(npcId);
showNpcSkillAdd(activeChar, npcData);
}
}
else if (st.countTokens() == 3)
{
try
{
npcId = Integer.parseInt(st.nextToken());
skillId = Integer.parseInt(st.nextToken());
int level = Integer.parseInt(st.nextToken());
addNpcSkillData(activeChar, npcId, skillId, level);
}
catch(Exception e)
{
_log.fine("admin_add_skill_npc parements error: " + command);
}
}
else
{
activeChar.sendMessage("Usage: //add_skill_npc <npc_id> [<level>]");
}
}
catch (StringIndexOutOfBoundsException e)
{
activeChar.sendMessage("Usage: //add_skill_npc <npc_id> [<level>]");
}
}
else if(command.startsWith("admin_del_skill_npc "))
{
int npcId = -1, skillId = -1;
try
{
String[] input = command.substring(20).split(" ");
if (input.length >= 2)
{
npcId = Integer.parseInt(input[0]);
skillId = Integer.parseInt(input[1]);
}
}
catch(Exception e){}
if(npcId > 0)
{
deleteNpcSkillData(activeChar, npcId, skillId);
}
else
{
activeChar.sendMessage("Usage: //del_skill_npc <npc_id> <skill_id>");
}
}
else if(command.startsWith("admin_edit_drop "))
{
int npcId = -1, itemId = 0, category = -1000;
try
{
StringTokenizer st = new StringTokenizer(command.substring(16).trim());
if(st.countTokens() == 3)
{
try
{
npcId = Integer.parseInt(st.nextToken());
itemId = Integer.parseInt(st.nextToken());
category = Integer.parseInt(st.nextToken());
showEditDropData(activeChar, npcId, itemId, category);
}
catch(Exception e)
{
if(Config.ENABLE_ALL_EXCEPTIONS)
e.printStackTrace();
}
}
else if(st.countTokens() == 6)
{
try
{
npcId = Integer.parseInt(st.nextToken());
itemId = Integer.parseInt(st.nextToken());
category = Integer.parseInt(st.nextToken());
int min = Integer.parseInt(st.nextToken());
int max = Integer.parseInt(st.nextToken());
int chance = Integer.parseInt(st.nextToken());
updateDropData(activeChar, npcId, itemId, min, max, category, chance);
}
catch(Exception e)
{
if(Config.ENABLE_ALL_EXCEPTIONS)
e.printStackTrace();
_log.fine("admin_edit_drop parements error: " + command);
}
}
else
{
activeChar.sendMessage("Usage: //edit_drop <npc_id> <item_id> <category> [<min> <max> <chance>]");
}
st = null;
}
catch(StringIndexOutOfBoundsException e)
{
if(Config.ENABLE_ALL_EXCEPTIONS)
e.printStackTrace();
activeChar.sendMessage("Usage: //edit_drop <npc_id> <item_id> <category> [<min> <max> <chance>]");
}
}
else if(command.startsWith("admin_add_drop "))
{
int npcId = -1;
try
{
StringTokenizer st = new StringTokenizer(command.substring(15).trim());
if(st.countTokens() == 1)
{
try
{
String[] input = command.substring(15).split(" ");
if(input.length < 1)
return true;
npcId = Integer.parseInt(input[0]);
input = null;
}
catch(Exception e)
{
if(Config.ENABLE_ALL_EXCEPTIONS)
e.printStackTrace();
}
if(npcId > 0)
{
L2NpcTemplate npcData = NpcTable.getInstance().getTemplate(npcId);
showAddDropData(activeChar, npcData);
npcData = null;
}
}
else if(st.countTokens() == 6)