}
catch(Exception e){}
try
{
L2Object target = activeChar.getTarget();
L2Character player = null;
if (target instanceof L2Character)
{
player = (L2Character)target;
if (type.equals("1"))
player.startAbnormalEffect(0x0400);
else
player.startAbnormalEffect(0x0800);
player.setIsParalyzed(true);
StopMove sm = new StopMove(player);
player.sendPacket(sm);
player.broadcastPacket(sm);
}
}
catch (Exception e)
{
}
}
else if (command.equals("admin_unpara")||command.equals("admin_unpara_menu"))
{
try
{
L2Object target = activeChar.getTarget();
L2Character player = null;
if (target instanceof L2Character)
{
player = (L2Character)target;
player.stopAbnormalEffect((short)0x0400);
player.setIsParalyzed(false);
}
}
catch (Exception e)
{
}
}
else if (command.startsWith("admin_para_all"))
{
try
{
for (L2PcInstance player : activeChar.getKnownList().getKnownPlayers().values())
{
if (!player.isGM())
{
player.startAbnormalEffect(0x0400);
player.setIsParalyzed(true);
StopMove sm = new StopMove(player);
player.sendPacket(sm);
player.broadcastPacket(sm);
}
}
}
catch (Exception e)
{
}
}
else if (command.startsWith("admin_unpara_all"))
{
try
{
for (L2PcInstance player : activeChar.getKnownList().getKnownPlayers().values())
{
player.stopAbnormalEffect(0x0400);
player.setIsParalyzed(false);
}
}
catch (Exception e)
{
}
}
else if (command.startsWith("admin_bighead"))
{
try
{
L2Object target = activeChar.getTarget();
L2Character player = null;
if (target instanceof L2Character)
{
player = (L2Character)target;
player.startAbnormalEffect(0x2000);
}
}
catch (Exception e)
{
}
}
else if (command.startsWith("admin_shrinkhead"))
{
try
{
L2Object target = activeChar.getTarget();
L2Character player = null;
if (target instanceof L2Character)
{
player = (L2Character)target;
player.stopAbnormalEffect((short)0x2000);
}
}
catch (Exception e)
{
}
}
else if (command.startsWith("admin_gmspeed"))
{
try
{
int val = Integer.parseInt(st.nextToken());
boolean sendMessage = activeChar.getFirstEffect(7029) != null;
activeChar.stopSkillEffects(7029);
if (val == 0 && sendMessage)
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.EFFECT_S1_DISAPPEARED).addSkillName(7029));
}
else if ((val >= 1) && (val <= 4))
{
L2Skill gmSpeedSkill = SkillTable.getInstance().getInfo(7029, val);
activeChar.doCast(gmSpeedSkill);
}
}
catch (Exception e)
{
activeChar.sendMessage("Use //gmspeed value (0=off...4=max).");
}
finally
{
activeChar.updateEffectIcons();
}
}
else if (command.startsWith("admin_polyself"))
{
try
{
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);
player.broadcastPacket(info1);
}
activeChar.sendMessage("Changed name from "+ oldName +" to "+ name +".");
}
catch (Exception e){}
}
catch (StringIndexOutOfBoundsException e){}
}
else if (command.equals("admin_clear_teams"))
{
try
{
for (L2PcInstance player : activeChar.getKnownList().getKnownPlayers().values())
{
player.setTeam(0);
player.broadcastUserInfo();
}
}
catch (Exception e){}
}
else if (command.startsWith("admin_setteam_close"))
{
try
{
String val = st.nextToken();
int teamVal = Integer.parseInt(val);
for (L2PcInstance player : activeChar.getKnownList().getKnownPlayers().values())
{
if (activeChar.isInsideRadius(player, 400, false, true))
{
player.setTeam(0);
if (teamVal != 0)
{
SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
sm.addString("You have joined team " + teamVal);
player.sendPacket(sm);
}
player.broadcastUserInfo();
}
}
}
catch (Exception e)
{
}
}
else if (command.startsWith("admin_setteam"))
{
String val = command.substring(14);
int teamVal = Integer.parseInt(val);
L2Object target = activeChar.getTarget();
L2PcInstance player = null;
if (target instanceof L2PcInstance)
player = (L2PcInstance)target;
else
return false;
player.setTeam(teamVal);
if (teamVal != 0)
{
SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
sm.addString("You have joined team " + teamVal);
player.sendPacket(sm);
}
player.broadcastUserInfo();
}
else if (command.startsWith("admin_social"))
{
try
{
String target=null;
L2Object obj = activeChar.getTarget();
if (st.countTokens() == 2)
{
int social = Integer.parseInt(st.nextToken());
target = st.nextToken();
if (target != null)
{
L2PcInstance player = L2World.getInstance().getPlayer(target);
if (player != null)
{
if (performSocial(social,player,activeChar))
activeChar.sendMessage(player.getName()+" was affected by your request.");
}
else
{
try
{
int radius = Integer.parseInt(target);
for (L2Object object : activeChar.getKnownList().getKnownObjects().values())
if (activeChar.isInsideRadius(object, radius, false, false))
performSocial(social,object,activeChar);
activeChar.sendMessage(radius+ " units radius affected by your request.");
}
catch (NumberFormatException nbe)
{
activeChar.sendMessage("Incorrect parameter");
}
}
}
}
else if (st.countTokens() == 1)
{
int social = Integer.parseInt(st.nextToken());
if (obj == null)
obj = activeChar;
if (performSocial(social,obj,activeChar))
activeChar.sendMessage(obj.getName()+ " was affected by your request.");
else
activeChar.sendPacket(new SystemMessage(SystemMessageId.NOTHING_HAPPENED));
}
else if (!command.contains("menu"))
activeChar.sendMessage("Usage: //social <social_id> [player_name|radius]");
}
catch (Exception e)
{
if (Config.DEBUG)
e.printStackTrace();
}
}
else if (command.startsWith("admin_abnormal"))
{
try
{
String target=null;
L2Object obj = activeChar.getTarget();
if (st.countTokens() == 2)
{
String parm = st.nextToken();
int abnormal = Integer.decode("0x"+parm);
target = st.nextToken();
if (target != null)
{
L2PcInstance player = L2World.getInstance().getPlayer(target);
if (player != null)
{
if (performAbnormal(abnormal,player))
activeChar.sendMessage(player.getName()+"'s abnormal status was affected by your request.");
else
activeChar.sendPacket(new SystemMessage(SystemMessageId.NOTHING_HAPPENED));
}
else
{
try
{
int radius = Integer.parseInt(target);
for (L2Object object : activeChar.getKnownList().getKnownObjects().values())
if (activeChar.isInsideRadius(object, radius, false, false))
performAbnormal(abnormal,object);
activeChar.sendMessage(radius+ " units radius affected by your request.");
}
catch (NumberFormatException nbe)
{
activeChar.sendMessage("Usage: //abnormal <hex_abnormal_mask> [player|radius]");
}
}
}
}
else if (st.countTokens() == 1)
{
int abnormal = Integer.decode("0x"+st.nextToken());
if (obj == null)
obj = activeChar;
if (performAbnormal(abnormal,obj))
activeChar.sendMessage(obj.getName()+ "'s abnormal status was affected by your request.");
else
activeChar.sendPacket(new SystemMessage(SystemMessageId.NOTHING_HAPPENED));
}
else if (!command.contains("menu"))
activeChar.sendMessage("Usage: //abnormal <abnormal_mask> [player_name|radius]");
}
catch (Exception e)
{
if (Config.DEBUG)
e.printStackTrace();
}
}
else if (command.startsWith("admin_effect"))
{
try
{
L2Object obj = activeChar.getTarget();
int level = 1,hittime = 1;
int skill = Integer.parseInt(st.nextToken());
if (st.hasMoreTokens())
level = Integer.parseInt(st.nextToken());
if (st.hasMoreTokens())
hittime = Integer.parseInt(st.nextToken());
if (obj == null)
obj = activeChar;
if (!(obj instanceof L2Character))
activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
else
{
L2Character target = (L2Character)obj;
target.broadcastPacket(new MagicSkillUser(target,activeChar,skill,level,hittime,0));
activeChar.sendMessage(obj.getName()+" performs MSU "+skill+"/"+level+" by your request.");
}
}
catch(Exception e)
{