return false;
}
int val;
AbnormalEffect ae = AbnormalEffect.NULL;
String Skill = new String();
GameObject target = activeChar.getTarget();
switch (command)
{
case admin_invis:
case admin_vis:
if (activeChar.isInvisible())
{
activeChar.setInvisibleType(InvisibleType.NONE);
activeChar.broadcastCharInfo();
for (Summon summon : activeChar.getSummonList())
{
summon.broadcastCharInfo();
}
}
else
{
activeChar.setInvisibleType(InvisibleType.NORMAL);
activeChar.sendUserInfo();
World.removeObjectFromPlayers(activeChar);
}
break;
case admin_gmspeed:
if (wordList.length < 2)
{
val = 0;
}
else
{
try
{
val = Integer.parseInt(wordList[1]);
}
catch (Exception e)
{
activeChar.sendMessage("USAGE: //gmspeed value=[0..4]");
return false;
}
}
List<Effect> superhaste = activeChar.getEffectList().getEffectsBySkillId(7029);
int sh_level = superhaste == null ? 0 : superhaste.isEmpty() ? 0 : superhaste.get(0).getSkill().getLevel();
if (val == 0)
{
if (sh_level != 0)
{
activeChar.doCast(SkillTable.getInstance().getInfo(7029, sh_level), activeChar, true);
}
activeChar.unsetVar("gm_gmspeed");
}
else if ((val >= 1) && (val <= 4))
{
if (Config.SAVE_GM_EFFECTS)
{
activeChar.setVar("gm_gmspeed", String.valueOf(val), -1);
}
if (val != sh_level)
{
if (sh_level != 0)
{
activeChar.doCast(SkillTable.getInstance().getInfo(7029, sh_level), activeChar, true);
}
activeChar.doCast(SkillTable.getInstance().getInfo(7029, val), activeChar, true);
}
}
else
{
activeChar.sendMessage("USAGE: //gmspeed value=[0..4]");
}
break;
case admin_invul:
handleInvul(activeChar, activeChar);
if (activeChar.isInvul())
{
if (Config.SAVE_GM_EFFECTS)
{
activeChar.setVar("gm_invul", "true", -1);
}
}
else
{
activeChar.unsetVar("gm_invul");
}
break;
default:
break;
}
if (!activeChar.isGM())
{
return false;
}
switch (command)
{
case admin_offline_vis:
for (Player player : GameObjectsStorage.getAllPlayers())
{
if ((player != null) && player.isInOfflineMode())
{
player.setInvisibleType(InvisibleType.NONE);
player.decayMe();
player.spawnMe();
}
}
break;
case admin_offline_invis:
for (Player player : GameObjectsStorage.getAllPlayers())
{
if ((player != null) && player.isInOfflineMode())
{
player.setInvisibleType(InvisibleType.NORMAL);
player.decayMe();
}
}
break;
case admin_earthquake:
try
{
int intensity = Integer.parseInt(wordList[1]);
int duration = Integer.parseInt(wordList[2]);
activeChar.broadcastPacket(new Earthquake(activeChar.getLoc(), intensity, duration));
}
catch (Exception e)
{
activeChar.sendMessage("USAGE: //earthquake intensity duration");
return false;
}
break;
case admin_block:
if ((target == null) || !target.isCreature())
{
activeChar.sendPacket(Msg.INVALID_TARGET);
return false;
}
if (((Creature) target).isBlocked())
{
return false;
}
((Creature) target).abortAttack(true, false);
((Creature) target).abortCast(true, false);
((Creature) target).block();
activeChar.sendMessage("Target blocked.");
break;
case admin_unblock:
if ((target == null) || !target.isCreature())
{
activeChar.sendPacket(Msg.INVALID_TARGET);
return false;
}
if (!((Creature) target).isBlocked())
{
return false;
}
((Creature) target).unblock();
activeChar.sendMessage("Target unblocked.");
break;
case admin_changename:
if (wordList.length < 2)
{
activeChar.sendMessage("USAGE: //changename newName");
return false;
}
if (target == null)
{
target = activeChar;
}
if (!target.isCreature())
{
activeChar.sendPacket(Msg.INVALID_TARGET);
return false;
}
String oldName = ((Creature) target).getName();
String newName = Util.joinStrings(" ", wordList, 1);
((Creature) target).setName(newName);
((Creature) target).broadcastCharInfo();
activeChar.sendMessage("Changed name from " + oldName + " to " + newName + ".");
break;
case admin_setinvul:
if ((target == null) || !target.isPlayer())
{
activeChar.sendPacket(Msg.INVALID_TARGET);
return false;
}
handleInvul(activeChar, (Player) target);
break;
case admin_getinvul:
if ((target != null) && target.isCreature())
{
activeChar.sendMessage("Target " + target.getName() + "(object ID: " + target.getObjectId() + ") is " + (!((Creature) target).isInvul() ? "NOT " : "") + "invul");
}
break;
case admin_social:
if (wordList.length < 2)
{
val = Rnd.get(1, 7);
}
else
{
try
{
val = Integer.parseInt(wordList[1]);
}
catch (NumberFormatException nfe)
{
activeChar.sendMessage("USAGE: //social value");
return false;
}
}
if ((target == null) || (target == activeChar))
{
activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), val));
}
else if (target.isCreature())
{
((Creature) target).broadcastPacket(new SocialAction(target.getObjectId(), val));
}
break;
case admin_abnormal:
try
{