*/
@Override
public boolean useAdminCommand(Enum<?> comm, String[] wordList, String fullString, Player player)
{
final Commands c = (Commands) comm;
GameObject target = player.getTarget();
switch (c)
{
case admin_setskill:
if (wordList.length != 3)
{
return false;
}
if (!player.getPlayerAccess().CanEditChar)
{
return false;
}
if ((target == null) || !target.isPlayer())
{
return false;
}
try
{
final Skill skill = SkillTable.getInstance().getInfo(Integer.parseInt(wordList[1]), Integer.parseInt(wordList[2]));
target.getPlayer().addSkill(skill, true);
target.getPlayer().sendPacket(new SystemMessage2(SystemMsg.YOU_HAVE_EARNED_S1_SKILL).addSkillName(skill.getId(), skill.getLevel()));
}
catch (NumberFormatException e)
{
_log.info("AdminClientSupport:useAdminCommand(Enum,String[],String,L2Player): " + e, e);
return false;
}
break;
case admin_summon:
if (wordList.length != 3)
{
return false;
}
if (!player.getPlayerAccess().CanEditChar)
{
return false;
}
try
{
final int id = Integer.parseInt(wordList[1]);
final long count = Long.parseLong(wordList[2]);
if (id >= 1000000)
{
if (target == null)
{
target = player;
}
final NpcTemplate template = NpcHolder.getInstance().getTemplate(id - 1000000);
for (int i = 0; i < count; i++)
{
NpcInstance npc = template.getNewInstance();
npc.setSpawnedLoc(target.getLoc());
npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp(), true);
npc.spawnMe(npc.getSpawnedLoc());
}
}
else
{
if (target == null)
{
target = player;
}
if (!target.isPlayer())
{
return false;
}
final ItemTemplate template = ItemHolder.getInstance().getTemplate(id);
if (template == null)
{
return false;
}
if (template.isStackable())
{
final ItemInstance item = ItemFunctions.createItem(id);
item.setCount(count);
target.getPlayer().getInventory().addItem(item);
target.getPlayer().sendPacket(SystemMessage2.obtainItems(item));
}
else
{
for (int i = 0; i < count; i++)
{
ItemInstance item = ItemFunctions.createItem(id);
target.getPlayer().getInventory().addItem(item);
target.getPlayer().sendPacket(SystemMessage2.obtainItems(item));
}
}
}
}
catch (NumberFormatException e)