String id = st.nextToken();
activeChar.getPoly().setPolyInfo("npc", id);
activeChar.teleToLocation(activeChar.getX(), activeChar.getY(), activeChar.getZ(), false);
CharInfo info1 = new CharInfo(activeChar);
activeChar.broadcastPacket(info1);
UserInfo info2 = new UserInfo(activeChar);
activeChar.sendPacket(info2);
}
catch(Exception e)
{
}
}
else if (command.startsWith("admin_unpolyself"))
{
activeChar.getPoly().setPolyInfo(null, "1");
activeChar.decayMe();
activeChar.spawnMe(activeChar.getX(),activeChar.getY(),activeChar.getZ());
CharInfo info1 = new CharInfo(activeChar);
activeChar.broadcastPacket(info1);
UserInfo info2 = new UserInfo(activeChar);
activeChar.sendPacket(info2);
}
else if (command.startsWith("admin_changename"))
{
try
{
String name = st.nextToken();
String oldName = "null";
try
{
L2Object target = activeChar.getTarget();
L2Character player = null;
if (target instanceof L2Character)
{
player = (L2Character)target;
oldName = player.getName();
}
else if (target == null)
{
player = activeChar;
oldName = activeChar.getName();
}
if (player instanceof L2PcInstance)
L2World.getInstance().removeFromAllPlayers((L2PcInstance)player);
player.setName(name);
if (player instanceof L2PcInstance)
L2World.getInstance().addVisibleObject(player, null, null);
if (player instanceof L2PcInstance)
{
CharInfo info1 = new CharInfo((L2PcInstance)player);
player.broadcastPacket(info1);
UserInfo info2 = new UserInfo((L2PcInstance)player);
player.sendPacket(info2);
}
else if(player instanceof L2NpcInstance)
{
NpcInfo info1 = new NpcInfo((L2NpcInstance)player, null);