Retail like invul and invis messages.

This commit is contained in:
MobiusDev 2018-05-04 02:46:06 +00:00
parent 2d16304b80
commit 0a8d23fd17
16 changed files with 119 additions and 119 deletions

View File

@ -46,6 +46,7 @@ import com.l2jmobius.gameserver.network.serverpackets.SocialAction;
import com.l2jmobius.gameserver.network.serverpackets.SunRise;
import com.l2jmobius.gameserver.network.serverpackets.SunSet;
import com.l2jmobius.gameserver.util.Broadcast;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util;
/**
@ -124,7 +125,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.setInvisible(true);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now invisible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you cannot be seen.");
}
else
{
@ -132,7 +133,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.STEALTH);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now visible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you can be seen.");
}
command = "";
@ -143,7 +144,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.setInvisible(true);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now invisible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you cannot be seen.");
}
else if (command.startsWith("admin_vis"))
{
@ -151,7 +152,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.STEALTH);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now visible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you can be seen.");
}
else if (command.startsWith("admin_setinvis"))
{
@ -162,7 +163,7 @@ public class AdminEffects implements IAdminCommandHandler
}
final L2Character target = (L2Character) activeChar.getTarget();
target.setInvisible(!target.isInvisible());
activeChar.sendMessage("You've made " + target.getName() + " " + (target.isInvisible() ? "invisible" : "visible") + ".");
BuilderUtil.sendSysMessage(activeChar, "You've made " + target.getName() + " " + (target.isInvisible() ? "invisible" : "visible") + ".");
if (target.isPlayer())
{

View File

@ -20,6 +20,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands: - invul = turns invulnerability on/off
@ -46,7 +47,7 @@ public class AdminInvul implements IAdminCommandHandler
}
else if (command.equals("admin_undying"))
{
handleUndying(activeChar);
handleUndying(activeChar, activeChar);
AdminHtml.showAdminHtml(activeChar, "gm_menu.htm");
}
@ -63,7 +64,7 @@ public class AdminInvul implements IAdminCommandHandler
final L2Object target = activeChar.getTarget();
if (target instanceof L2Character)
{
handleUndying((L2Character) target);
handleUndying(activeChar, (L2Character) target);
}
}
return true;
@ -88,22 +89,22 @@ public class AdminInvul implements IAdminCommandHandler
activeChar.setIsInvul(true);
text = activeChar.getName() + " is now invulnerable.";
}
activeChar.sendMessage(text);
BuilderUtil.sendSysMessage(activeChar, text);
}
private void handleUndying(L2Character activeChar)
private void handleUndying(L2PcInstance activeChar, L2Character target)
{
String text;
if (activeChar.isUndying())
if (target.isUndying())
{
activeChar.setUndying(false);
text = activeChar.getName() + " is now mortal.";
target.setUndying(false);
text = target.getName() + " is now mortal.";
}
else
{
activeChar.setUndying(true);
text = activeChar.getName() + " is now undying.";
target.setUndying(true);
text = target.getName() + " is now undying.";
}
activeChar.sendMessage(text);
BuilderUtil.sendSysMessage(activeChar, text);
}
}

View File

@ -46,6 +46,7 @@ import com.l2jmobius.gameserver.network.serverpackets.SocialAction;
import com.l2jmobius.gameserver.network.serverpackets.SunRise;
import com.l2jmobius.gameserver.network.serverpackets.SunSet;
import com.l2jmobius.gameserver.util.Broadcast;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util;
/**
@ -124,7 +125,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.setInvisible(true);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now invisible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you cannot be seen.");
}
else
{
@ -132,7 +133,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.STEALTH);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now visible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you can be seen.");
}
command = "";
@ -143,7 +144,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.setInvisible(true);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now invisible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you cannot be seen.");
}
else if (command.startsWith("admin_vis"))
{
@ -151,7 +152,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.STEALTH);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now visible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you can be seen.");
}
else if (command.startsWith("admin_setinvis"))
{
@ -162,7 +163,7 @@ public class AdminEffects implements IAdminCommandHandler
}
final L2Character target = (L2Character) activeChar.getTarget();
target.setInvisible(!target.isInvisible());
activeChar.sendMessage("You've made " + target.getName() + " " + (target.isInvisible() ? "invisible" : "visible") + ".");
BuilderUtil.sendSysMessage(activeChar, "You've made " + target.getName() + " " + (target.isInvisible() ? "invisible" : "visible") + ".");
if (target.isPlayer())
{

View File

@ -20,6 +20,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands: - invul = turns invulnerability on/off
@ -46,7 +47,7 @@ public class AdminInvul implements IAdminCommandHandler
}
else if (command.equals("admin_undying"))
{
handleUndying(activeChar);
handleUndying(activeChar, activeChar);
AdminHtml.showAdminHtml(activeChar, "gm_menu.htm");
}
@ -63,7 +64,7 @@ public class AdminInvul implements IAdminCommandHandler
final L2Object target = activeChar.getTarget();
if (target instanceof L2Character)
{
handleUndying((L2Character) target);
handleUndying(activeChar, (L2Character) target);
}
}
return true;
@ -88,22 +89,22 @@ public class AdminInvul implements IAdminCommandHandler
activeChar.setIsInvul(true);
text = activeChar.getName() + " is now invulnerable.";
}
activeChar.sendMessage(text);
BuilderUtil.sendSysMessage(activeChar, text);
}
private void handleUndying(L2Character activeChar)
private void handleUndying(L2PcInstance activeChar, L2Character target)
{
String text;
if (activeChar.isUndying())
if (target.isUndying())
{
activeChar.setUndying(false);
text = activeChar.getName() + " is now mortal.";
target.setUndying(false);
text = target.getName() + " is now mortal.";
}
else
{
activeChar.setUndying(true);
text = activeChar.getName() + " is now undying.";
target.setUndying(true);
text = target.getName() + " is now undying.";
}
activeChar.sendMessage(text);
BuilderUtil.sendSysMessage(activeChar, text);
}
}

View File

@ -46,6 +46,7 @@ import com.l2jmobius.gameserver.network.serverpackets.SocialAction;
import com.l2jmobius.gameserver.network.serverpackets.SunRise;
import com.l2jmobius.gameserver.network.serverpackets.SunSet;
import com.l2jmobius.gameserver.util.Broadcast;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util;
/**
@ -124,7 +125,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.setInvisible(true);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now invisible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you cannot be seen.");
}
else
{
@ -132,7 +133,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.STEALTH);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now visible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you can be seen.");
}
command = "";
@ -143,7 +144,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.setInvisible(true);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now invisible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you cannot be seen.");
}
else if (command.startsWith("admin_vis"))
{
@ -151,7 +152,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.STEALTH);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now visible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you can be seen.");
}
else if (command.startsWith("admin_setinvis"))
{
@ -162,7 +163,7 @@ public class AdminEffects implements IAdminCommandHandler
}
final L2Character target = (L2Character) activeChar.getTarget();
target.setInvisible(!target.isInvisible());
activeChar.sendMessage("You've made " + target.getName() + " " + (target.isInvisible() ? "invisible" : "visible") + ".");
BuilderUtil.sendSysMessage(activeChar, "You've made " + target.getName() + " " + (target.isInvisible() ? "invisible" : "visible") + ".");
if (target.isPlayer())
{

View File

@ -20,6 +20,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands: - invul = turns invulnerability on/off
@ -46,7 +47,7 @@ public class AdminInvul implements IAdminCommandHandler
}
else if (command.equals("admin_undying"))
{
handleUndying(activeChar);
handleUndying(activeChar, activeChar);
AdminHtml.showAdminHtml(activeChar, "gm_menu.htm");
}
@ -63,7 +64,7 @@ public class AdminInvul implements IAdminCommandHandler
final L2Object target = activeChar.getTarget();
if (target instanceof L2Character)
{
handleUndying((L2Character) target);
handleUndying(activeChar, (L2Character) target);
}
}
return true;
@ -88,22 +89,22 @@ public class AdminInvul implements IAdminCommandHandler
activeChar.setIsInvul(true);
text = activeChar.getName() + " is now invulnerable.";
}
activeChar.sendMessage(text);
BuilderUtil.sendSysMessage(activeChar, text);
}
private void handleUndying(L2Character activeChar)
private void handleUndying(L2PcInstance activeChar, L2Character target)
{
String text;
if (activeChar.isUndying())
if (target.isUndying())
{
activeChar.setUndying(false);
text = activeChar.getName() + " is now mortal.";
target.setUndying(false);
text = target.getName() + " is now mortal.";
}
else
{
activeChar.setUndying(true);
text = activeChar.getName() + " is now undying.";
target.setUndying(true);
text = target.getName() + " is now undying.";
}
activeChar.sendMessage(text);
BuilderUtil.sendSysMessage(activeChar, text);
}
}

View File

@ -46,6 +46,7 @@ import com.l2jmobius.gameserver.network.serverpackets.SocialAction;
import com.l2jmobius.gameserver.network.serverpackets.SunRise;
import com.l2jmobius.gameserver.network.serverpackets.SunSet;
import com.l2jmobius.gameserver.util.Broadcast;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util;
/**
@ -124,7 +125,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.setInvisible(true);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now invisible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you cannot be seen.");
}
else
{
@ -132,7 +133,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.STEALTH);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now visible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you can be seen.");
}
command = "";
@ -143,7 +144,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.setInvisible(true);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now invisible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you cannot be seen.");
}
else if (command.startsWith("admin_vis"))
{
@ -151,7 +152,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.STEALTH);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now visible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you can be seen.");
}
else if (command.startsWith("admin_setinvis"))
{
@ -162,7 +163,7 @@ public class AdminEffects implements IAdminCommandHandler
}
final L2Character target = (L2Character) activeChar.getTarget();
target.setInvisible(!target.isInvisible());
activeChar.sendMessage("You've made " + target.getName() + " " + (target.isInvisible() ? "invisible" : "visible") + ".");
BuilderUtil.sendSysMessage(activeChar, "You've made " + target.getName() + " " + (target.isInvisible() ? "invisible" : "visible") + ".");
if (target.isPlayer())
{

View File

@ -20,6 +20,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands: - invul = turns invulnerability on/off
@ -46,7 +47,7 @@ public class AdminInvul implements IAdminCommandHandler
}
else if (command.equals("admin_undying"))
{
handleUndying(activeChar);
handleUndying(activeChar, activeChar);
AdminHtml.showAdminHtml(activeChar, "gm_menu.htm");
}
@ -63,7 +64,7 @@ public class AdminInvul implements IAdminCommandHandler
final L2Object target = activeChar.getTarget();
if (target instanceof L2Character)
{
handleUndying((L2Character) target);
handleUndying(activeChar, (L2Character) target);
}
}
return true;
@ -88,22 +89,22 @@ public class AdminInvul implements IAdminCommandHandler
activeChar.setIsInvul(true);
text = activeChar.getName() + " is now invulnerable.";
}
activeChar.sendMessage(text);
BuilderUtil.sendSysMessage(activeChar, text);
}
private void handleUndying(L2Character activeChar)
private void handleUndying(L2PcInstance activeChar, L2Character target)
{
String text;
if (activeChar.isUndying())
if (target.isUndying())
{
activeChar.setUndying(false);
text = activeChar.getName() + " is now mortal.";
target.setUndying(false);
text = target.getName() + " is now mortal.";
}
else
{
activeChar.setUndying(true);
text = activeChar.getName() + " is now undying.";
target.setUndying(true);
text = target.getName() + " is now undying.";
}
activeChar.sendMessage(text);
BuilderUtil.sendSysMessage(activeChar, text);
}
}

View File

@ -40,6 +40,7 @@ import com.l2jmobius.gameserver.network.serverpackets.SunRise;
import com.l2jmobius.gameserver.network.serverpackets.SunSet;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands:
@ -115,11 +116,13 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.decayMe();
activeChar.broadcastUserInfo();
activeChar.spawnMe();
BuilderUtil.sendSysMessage(activeChar, "Now, you cannot be seen.");
}
else
{
activeChar.getAppearance().setVisible();
activeChar.broadcastUserInfo();
BuilderUtil.sendSysMessage(activeChar, "Now, you can be seen.");
}
}
@ -129,11 +132,13 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.decayMe();
activeChar.broadcastUserInfo();
activeChar.spawnMe();
BuilderUtil.sendSysMessage(activeChar, "Now, you cannot be seen.");
}
else if (command.startsWith("admin_vis"))
{
activeChar.getAppearance().setVisible();
activeChar.broadcastUserInfo();
BuilderUtil.sendSysMessage(activeChar, "Now, you can be seen.");
}
else if (command.startsWith("admin_earthquake"))

View File

@ -16,12 +16,10 @@
*/
package com.l2jmobius.gameserver.handler.admincommandhandlers;
import java.util.logging.Logger;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands: - invul = turns invulnerability on/off
@ -29,8 +27,6 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
*/
public class AdminInvul implements IAdminCommandHandler
{
private static Logger LOGGER = Logger.getLogger(AdminInvul.class.getName());
private static final String[] ADMIN_COMMANDS =
{
"admin_invul",
@ -41,11 +37,6 @@ public class AdminInvul implements IAdminCommandHandler
@Override
public boolean useAdminCommand(String command, L2PcInstance activeChar)
{
/*
* if(!AdminCommandAccessRights.getInstance().hasAccess(command, activeChar.getAccessLevel())){ return false; } if(Config.GMAUDIT) { Logger _logAudit = Logger.getLogger("gmaudit"); LogRecord record = new LogRecord(Level.INFO, command); record.setParameters(new Object[] { "GM: " +
* activeChar.getName(), " to target [" + activeChar.getTarget() + "] " }); _logAudit.LOGGER(record); }
*/
if (command.equals("admin_invul"))
{
handleInvul(activeChar);
@ -79,26 +70,16 @@ public class AdminInvul implements IAdminCommandHandler
private void handleInvul(L2PcInstance activeChar)
{
String text;
if (activeChar.isInvul())
{
activeChar.setIsInvul(false);
text = activeChar.getName() + " is now mortal.";
if (Config.DEBUG)
{
LOGGER.info("GM: Gm removed invul mode from character " + activeChar.getName() + "(" + activeChar.getObjectId() + ")");
}
}
else
{
activeChar.setIsInvul(true);
text = activeChar.getName() + " is now invulnerable.";
if (Config.DEBUG)
{
LOGGER.info("GM: Gm activated invul mode for character " + activeChar.getName() + "(" + activeChar.getObjectId() + ")");
}
}
activeChar.sendMessage(text);
BuilderUtil.sendSysMessage(activeChar, text);
}
}

View File

@ -38,6 +38,7 @@ import com.l2jmobius.gameserver.network.serverpackets.SocialAction;
import com.l2jmobius.gameserver.network.serverpackets.SunRise;
import com.l2jmobius.gameserver.network.serverpackets.SunSet;
import com.l2jmobius.gameserver.util.Broadcast;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util;
/**
@ -115,13 +116,13 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.broadcastUserInfo();
activeChar.decayMe();
activeChar.spawnMe();
activeChar.sendMessage("You are now invisible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you cannot be seen.");
}
else
{
activeChar.setInvisible(false);
activeChar.broadcastUserInfo();
activeChar.sendMessage("You are now visible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you can be seen.");
}
command = "";
@ -133,13 +134,13 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.broadcastUserInfo();
activeChar.decayMe();
activeChar.spawnMe();
activeChar.sendMessage("You are now invisible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you cannot be seen.");
}
else if (command.startsWith("admin_vis"))
{
activeChar.setInvisible(false);
activeChar.broadcastUserInfo();
activeChar.sendMessage("You are now visible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you can be seen.");
}
else if (command.startsWith("admin_setinvis"))
{
@ -150,7 +151,7 @@ public class AdminEffects implements IAdminCommandHandler
}
final L2Character target = (L2Character) activeChar.getTarget();
target.setInvisible(!target.isInvisible());
activeChar.sendMessage("You've made " + target.getName() + " " + (target.isInvisible() ? "invisible" : "visible") + ".");
BuilderUtil.sendSysMessage(activeChar, "You've made " + target.getName() + " " + (target.isInvisible() ? "invisible" : "visible") + ".");
if (target.isPlayer())
{

View File

@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands: - invul = turns invulnerability on/off
@ -64,13 +65,13 @@ public class AdminInvul implements IAdminCommandHandler
if (activeChar.isInvul())
{
activeChar.setIsInvul(false);
text = activeChar.getName() + " is now mortal";
text = activeChar.getName() + " is now mortal.";
}
else
{
activeChar.setIsInvul(true);
text = activeChar.getName() + " is now invulnerable";
text = activeChar.getName() + " is now invulnerable.";
}
activeChar.sendMessage(text);
BuilderUtil.sendSysMessage(activeChar, text);
}
}

View File

@ -46,6 +46,7 @@ import com.l2jmobius.gameserver.network.serverpackets.SocialAction;
import com.l2jmobius.gameserver.network.serverpackets.SunRise;
import com.l2jmobius.gameserver.network.serverpackets.SunSet;
import com.l2jmobius.gameserver.util.Broadcast;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util;
/**
@ -124,7 +125,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.setInvisible(true);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now invisible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you cannot be seen.");
}
else
{
@ -132,7 +133,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.STEALTH);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now visible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you can be seen.");
}
command = "";
@ -143,7 +144,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.setInvisible(true);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now invisible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you cannot be seen.");
}
else if (command.startsWith("admin_vis"))
{
@ -151,7 +152,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.STEALTH);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now visible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you can be seen.");
}
else if (command.startsWith("admin_setinvis"))
{
@ -162,7 +163,7 @@ public class AdminEffects implements IAdminCommandHandler
}
final L2Character target = (L2Character) activeChar.getTarget();
target.setInvisible(!target.isInvisible());
activeChar.sendMessage("You've made " + target.getName() + " " + (target.isInvisible() ? "invisible" : "visible") + ".");
BuilderUtil.sendSysMessage(activeChar, "You've made " + target.getName() + " " + (target.isInvisible() ? "invisible" : "visible") + ".");
if (target.isPlayer())
{

View File

@ -20,6 +20,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands: - invul = turns invulnerability on/off
@ -46,7 +47,7 @@ public class AdminInvul implements IAdminCommandHandler
}
else if (command.equals("admin_undying"))
{
handleUndying(activeChar);
handleUndying(activeChar, activeChar);
AdminHtml.showAdminHtml(activeChar, "gm_menu.htm");
}
@ -63,7 +64,7 @@ public class AdminInvul implements IAdminCommandHandler
final L2Object target = activeChar.getTarget();
if (target instanceof L2Character)
{
handleUndying((L2Character) target);
handleUndying(activeChar, (L2Character) target);
}
}
return true;
@ -88,22 +89,22 @@ public class AdminInvul implements IAdminCommandHandler
activeChar.setIsInvul(true);
text = activeChar.getName() + " is now invulnerable.";
}
activeChar.sendMessage(text);
BuilderUtil.sendSysMessage(activeChar, text);
}
private void handleUndying(L2Character activeChar)
private void handleUndying(L2PcInstance activeChar, L2Character target)
{
String text;
if (activeChar.isUndying())
if (target.isUndying())
{
activeChar.setUndying(false);
text = activeChar.getName() + " is now mortal.";
target.setUndying(false);
text = target.getName() + " is now mortal.";
}
else
{
activeChar.setUndying(true);
text = activeChar.getName() + " is now undying.";
target.setUndying(true);
text = target.getName() + " is now undying.";
}
activeChar.sendMessage(text);
BuilderUtil.sendSysMessage(activeChar, text);
}
}

View File

@ -46,6 +46,7 @@ import com.l2jmobius.gameserver.network.serverpackets.SocialAction;
import com.l2jmobius.gameserver.network.serverpackets.SunRise;
import com.l2jmobius.gameserver.network.serverpackets.SunSet;
import com.l2jmobius.gameserver.util.Broadcast;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util;
/**
@ -124,7 +125,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.setInvisible(true);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now invisible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you cannot be seen.");
}
else
{
@ -132,7 +133,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.STEALTH);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now visible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you can be seen.");
}
command = "";
@ -143,7 +144,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.setInvisible(true);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now invisible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you cannot be seen.");
}
else if (command.startsWith("admin_vis"))
{
@ -151,7 +152,7 @@ public class AdminEffects implements IAdminCommandHandler
activeChar.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.STEALTH);
activeChar.broadcastUserInfo();
activeChar.sendPacket(new ExUserInfoAbnormalVisualEffect(activeChar));
activeChar.sendMessage("You are now visible.");
BuilderUtil.sendSysMessage(activeChar, "Now, you can be seen.");
}
else if (command.startsWith("admin_setinvis"))
{
@ -162,7 +163,7 @@ public class AdminEffects implements IAdminCommandHandler
}
final L2Character target = (L2Character) activeChar.getTarget();
target.setInvisible(!target.isInvisible());
activeChar.sendMessage("You've made " + target.getName() + " " + (target.isInvisible() ? "invisible" : "visible") + ".");
BuilderUtil.sendSysMessage(activeChar, "You've made " + target.getName() + " " + (target.isInvisible() ? "invisible" : "visible") + ".");
if (target.isPlayer())
{

View File

@ -20,6 +20,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands: - invul = turns invulnerability on/off
@ -46,7 +47,7 @@ public class AdminInvul implements IAdminCommandHandler
}
else if (command.equals("admin_undying"))
{
handleUndying(activeChar);
handleUndying(activeChar, activeChar);
AdminHtml.showAdminHtml(activeChar, "gm_menu.htm");
}
@ -63,7 +64,7 @@ public class AdminInvul implements IAdminCommandHandler
final L2Object target = activeChar.getTarget();
if (target instanceof L2Character)
{
handleUndying((L2Character) target);
handleUndying(activeChar, (L2Character) target);
}
}
return true;
@ -88,22 +89,22 @@ public class AdminInvul implements IAdminCommandHandler
activeChar.setIsInvul(true);
text = activeChar.getName() + " is now invulnerable.";
}
activeChar.sendMessage(text);
BuilderUtil.sendSysMessage(activeChar, text);
}
private void handleUndying(L2Character activeChar)
private void handleUndying(L2PcInstance activeChar, L2Character target)
{
String text;
if (activeChar.isUndying())
if (target.isUndying())
{
activeChar.setUndying(false);
text = activeChar.getName() + " is now mortal.";
target.setUndying(false);
text = target.getName() + " is now mortal.";
}
else
{
activeChar.setUndying(true);
text = activeChar.getName() + " is now undying.";
target.setUndying(true);
text = target.getName() + " is now undying.";
}
activeChar.sendMessage(text);
BuilderUtil.sendSysMessage(activeChar, text);
}
}