diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java index 7d0d0bcbf8..7879a201ff 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java @@ -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()) { diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java index 1fff955404..d856879106 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java @@ -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); } } diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java index 7d0d0bcbf8..7879a201ff 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java @@ -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()) { diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java index 1fff955404..d856879106 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java @@ -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); } } diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java index 7d0d0bcbf8..7879a201ff 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java @@ -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()) { diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java index 1fff955404..d856879106 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java @@ -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); } } diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java index 7d0d0bcbf8..7879a201ff 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java @@ -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()) { diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java index 1fff955404..d856879106 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java @@ -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); } } diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/admincommandhandlers/AdminEffects.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/admincommandhandlers/AdminEffects.java index 9fd491f7f5..9aa9dc79a9 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/admincommandhandlers/AdminEffects.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/admincommandhandlers/AdminEffects.java @@ -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")) diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/admincommandhandlers/AdminInvul.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/admincommandhandlers/AdminInvul.java index 7ae8bc8765..722cd614e7 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/admincommandhandlers/AdminInvul.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/handler/admincommandhandlers/AdminInvul.java @@ -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); } } diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java index 865e2e4ba3..a79b0f08b2 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java @@ -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()) { diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java index 2ecbd11226..3846d0f668 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java @@ -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); } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java index 7d0d0bcbf8..7879a201ff 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java @@ -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()) { diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java index 1fff955404..d856879106 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java @@ -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); } } diff --git a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java index 7d0d0bcbf8..7879a201ff 100644 --- a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java +++ b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminEffects.java @@ -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()) { diff --git a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java index 1fff955404..d856879106 100644 --- a/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java +++ b/L2J_Mobius_Classic_2.0_Zaken/dist/game/data/scripts/handlers/admincommandhandlers/AdminInvul.java @@ -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); } }