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);
}
}