Use builder SYS messages when possible.

This commit is contained in:
MobiusDev
2018-05-06 21:48:50 +00:00
parent 34d175b45b
commit ca6675953c
502 changed files with 4927 additions and 4441 deletions

View File

@@ -32,6 +32,7 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.CreatureSay; import com.l2jmobius.gameserver.network.serverpackets.CreatureSay;
import com.l2jmobius.gameserver.network.serverpackets.ExWorldChatCnt; import com.l2jmobius.gameserver.network.serverpackets.ExWorldChatCnt;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
/** /**
@@ -85,13 +86,13 @@ public class AdminAdmin implements IAdminCommandHandler
else if (command.startsWith("admin_gmliston")) else if (command.startsWith("admin_gmliston"))
{ {
AdminData.getInstance().showGm(activeChar); AdminData.getInstance().showGm(activeChar);
activeChar.sendMessage("Registered into gm list"); BuilderUtil.sendSysMessage(activeChar, "Registered into gm list.");
AdminHtml.showAdminHtml(activeChar, "gm_menu.htm"); AdminHtml.showAdminHtml(activeChar, "gm_menu.htm");
} }
else if (command.startsWith("admin_gmlistoff")) else if (command.startsWith("admin_gmlistoff"))
{ {
AdminData.getInstance().hideGm(activeChar); AdminData.getInstance().hideGm(activeChar);
activeChar.sendMessage("Removed from gm list"); BuilderUtil.sendSysMessage(activeChar, "Removed from gm list.");
AdminHtml.showAdminHtml(activeChar, "gm_menu.htm"); AdminHtml.showAdminHtml(activeChar, "gm_menu.htm");
} }
else if (command.startsWith("admin_silence")) else if (command.startsWith("admin_silence"))
@@ -111,7 +112,7 @@ public class AdminAdmin implements IAdminCommandHandler
else if (command.startsWith("admin_saveolymp")) else if (command.startsWith("admin_saveolymp"))
{ {
Olympiad.getInstance().saveOlympiadStatus(); Olympiad.getInstance().saveOlympiadStatus();
activeChar.sendMessage("olympiad system saved."); BuilderUtil.sendSysMessage(activeChar, "olympiad system saved.");
} }
else if (command.startsWith("admin_endolympiad")) else if (command.startsWith("admin_endolympiad"))
{ {
@@ -123,7 +124,7 @@ public class AdminAdmin implements IAdminCommandHandler
{ {
LOGGER.warning("An error occured while ending olympiad: " + e); LOGGER.warning("An error occured while ending olympiad: " + e);
} }
activeChar.sendMessage("Heroes formed."); BuilderUtil.sendSysMessage(activeChar, "Heroes formed.");
} }
else if (command.startsWith("admin_sethero")) else if (command.startsWith("admin_sethero"))
{ {
@@ -160,13 +161,13 @@ public class AdminAdmin implements IAdminCommandHandler
final L2PcInstance target = activeChar.getTarget().isPlayer() ? activeChar.getTarget().getActingPlayer() : activeChar; final L2PcInstance target = activeChar.getTarget().isPlayer() ? activeChar.getTarget().getActingPlayer() : activeChar;
if (Hero.getInstance().isHero(target.getObjectId())) if (Hero.getInstance().isHero(target.getObjectId()))
{ {
activeChar.sendMessage("This player has already claimed the hero status."); BuilderUtil.sendSysMessage(activeChar, "This player has already claimed the hero status.");
return false; return false;
} }
if (!Hero.getInstance().isUnclaimedHero(target.getObjectId())) if (!Hero.getInstance().isUnclaimedHero(target.getObjectId()))
{ {
activeChar.sendMessage("This player cannot claim the hero status."); BuilderUtil.sendSysMessage(activeChar, "This player cannot claim the hero status.");
return false; return false;
} }
Hero.getInstance().claimHero(target); Hero.getInstance().claimHero(target);
@@ -180,12 +181,12 @@ public class AdminAdmin implements IAdminCommandHandler
if (st.nextToken().equalsIgnoreCase("on")) if (st.nextToken().equalsIgnoreCase("on"))
{ {
activeChar.setDietMode(true); activeChar.setDietMode(true);
activeChar.sendMessage("Diet mode on"); BuilderUtil.sendSysMessage(activeChar, "Diet mode on.");
} }
else if (st.nextToken().equalsIgnoreCase("off")) else if (st.nextToken().equalsIgnoreCase("off"))
{ {
activeChar.setDietMode(false); activeChar.setDietMode(false);
activeChar.sendMessage("Diet mode off"); BuilderUtil.sendSysMessage(activeChar, "Diet mode off.");
} }
} }
catch (Exception ex) catch (Exception ex)
@@ -193,12 +194,12 @@ public class AdminAdmin implements IAdminCommandHandler
if (activeChar.getDietMode()) if (activeChar.getDietMode())
{ {
activeChar.setDietMode(false); activeChar.setDietMode(false);
activeChar.sendMessage("Diet mode off"); BuilderUtil.sendSysMessage(activeChar, "Diet mode off.");
} }
else else
{ {
activeChar.setDietMode(true); activeChar.setDietMode(true);
activeChar.sendMessage("Diet mode on"); BuilderUtil.sendSysMessage(activeChar, "Diet mode on.");
} }
} }
finally finally
@@ -215,12 +216,12 @@ public class AdminAdmin implements IAdminCommandHandler
if (mode.equalsIgnoreCase("on")) if (mode.equalsIgnoreCase("on"))
{ {
activeChar.setTradeRefusal(true); activeChar.setTradeRefusal(true);
activeChar.sendMessage("Trade refusal enabled"); BuilderUtil.sendSysMessage(activeChar, "Trade refusal enabled.");
} }
else if (mode.equalsIgnoreCase("off")) else if (mode.equalsIgnoreCase("off"))
{ {
activeChar.setTradeRefusal(false); activeChar.setTradeRefusal(false);
activeChar.sendMessage("Trade refusal disabled"); BuilderUtil.sendSysMessage(activeChar, "Trade refusal disabled.");
} }
} }
catch (Exception ex) catch (Exception ex)
@@ -228,12 +229,12 @@ public class AdminAdmin implements IAdminCommandHandler
if (activeChar.getTradeRefusal()) if (activeChar.getTradeRefusal())
{ {
activeChar.setTradeRefusal(false); activeChar.setTradeRefusal(false);
activeChar.sendMessage("Trade refusal disabled"); BuilderUtil.sendSysMessage(activeChar, "Trade refusal disabled.");
} }
else else
{ {
activeChar.setTradeRefusal(true); activeChar.setTradeRefusal(true);
activeChar.sendMessage("Trade refusal enabled"); BuilderUtil.sendSysMessage(activeChar, "Trade refusal enabled.");
} }
} }
AdminHtml.showAdminHtml(activeChar, "gm_menu.htm"); AdminHtml.showAdminHtml(activeChar, "gm_menu.htm");
@@ -248,7 +249,7 @@ public class AdminAdmin implements IAdminCommandHandler
final String pValue = st.nextToken(); final String pValue = st.nextToken();
if (Float.valueOf(pValue) == null) if (Float.valueOf(pValue) == null)
{ {
activeChar.sendMessage("Invalid parameter!"); BuilderUtil.sendSysMessage(activeChar, "Invalid parameter!");
return false; return false;
} }
switch (pName) switch (pName)
@@ -289,11 +290,11 @@ public class AdminAdmin implements IAdminCommandHandler
break; break;
} }
} }
activeChar.sendMessage("Config parameter " + pName + " set to " + pValue); BuilderUtil.sendSysMessage(activeChar, "Config parameter " + pName + " set to " + pValue);
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //setconfig <parameter> <value>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setconfig <parameter> <value>");
} }
finally finally
{ {
@@ -330,10 +331,10 @@ public class AdminAdmin implements IAdminCommandHandler
final L2PcInstance targetPlayer = target.getActingPlayer(); final L2PcInstance targetPlayer = target.getActingPlayer();
if (targetPlayer.getLevel() < Config.WORLD_CHAT_MIN_LEVEL) if (targetPlayer.getLevel() < Config.WORLD_CHAT_MIN_LEVEL)
{ {
activeChar.sendMessage("Your target's level is below the minimum: " + Config.WORLD_CHAT_MIN_LEVEL); BuilderUtil.sendSysMessage(activeChar, "Your target's level is below the minimum: " + Config.WORLD_CHAT_MIN_LEVEL);
break; break;
} }
activeChar.sendMessage(targetPlayer.getName() + ": has used world chat " + targetPlayer.getWorldChatUsed() + " times out of maximum " + targetPlayer.getWorldChatPoints() + " times."); BuilderUtil.sendSysMessage(activeChar, targetPlayer.getName() + ": has used world chat " + targetPlayer.getWorldChatUsed() + " times out of maximum " + targetPlayer.getWorldChatPoints() + " times.");
break; break;
} }
case "set": case "set":
@@ -348,24 +349,24 @@ public class AdminAdmin implements IAdminCommandHandler
final L2PcInstance targetPlayer = target.getActingPlayer(); final L2PcInstance targetPlayer = target.getActingPlayer();
if (targetPlayer.getLevel() < Config.WORLD_CHAT_MIN_LEVEL) if (targetPlayer.getLevel() < Config.WORLD_CHAT_MIN_LEVEL)
{ {
activeChar.sendMessage("Your target's level is below the minimum: " + Config.WORLD_CHAT_MIN_LEVEL); BuilderUtil.sendSysMessage(activeChar, "Your target's level is below the minimum: " + Config.WORLD_CHAT_MIN_LEVEL);
break; break;
} }
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <times used>"); BuilderUtil.sendSysMessage(activeChar, "Incorrect syntax, use: //worldchat set <times used>");
break; break;
} }
final String valueToken = st.nextToken(); final String valueToken = st.nextToken();
if (!Util.isDigit(valueToken)) if (!Util.isDigit(valueToken))
{ {
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <times used>"); BuilderUtil.sendSysMessage(activeChar, "Incorrect syntax, use: //worldchat set <times used>");
break; break;
} }
activeChar.sendMessage(targetPlayer.getName() + ": times used changed from " + targetPlayer.getWorldChatPoints() + " to " + valueToken); BuilderUtil.sendSysMessage(activeChar, targetPlayer.getName() + ": times used changed from " + targetPlayer.getWorldChatPoints() + " to " + valueToken);
targetPlayer.setWorldChatUsed(Integer.parseInt(valueToken)); targetPlayer.setWorldChatUsed(Integer.parseInt(valueToken));
if (Config.ENABLE_WORLD_CHAT) if (Config.ENABLE_WORLD_CHAT)
{ {
@@ -375,10 +376,10 @@ public class AdminAdmin implements IAdminCommandHandler
} }
default: default:
{ {
activeChar.sendMessage("Possible commands:"); BuilderUtil.sendSysMessage(activeChar, "Possible commands:");
activeChar.sendMessage(" - Send message: //worldchat shout <text>"); BuilderUtil.sendSysMessage(activeChar, " - Send message: //worldchat shout <text>");
activeChar.sendMessage(" - See your target's points: //worldchat see"); BuilderUtil.sendSysMessage(activeChar, " - See your target's points: //worldchat see");
activeChar.sendMessage(" - Change your target's points: //worldchat set <points>"); BuilderUtil.sendSysMessage(activeChar, " - Change your target's points: //worldchat set <points>");
break; break;
} }
} }

View File

@@ -30,6 +30,7 @@ import com.l2jmobius.gameserver.model.announce.IAnnouncement;
import com.l2jmobius.gameserver.model.html.PageBuilder; import com.l2jmobius.gameserver.model.html.PageBuilder;
import com.l2jmobius.gameserver.model.html.PageResult; import com.l2jmobius.gameserver.model.html.PageResult;
import com.l2jmobius.gameserver.util.Broadcast; import com.l2jmobius.gameserver.util.Broadcast;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
/** /**
@@ -58,7 +59,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
{ {
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announce <text to announce here>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announce <text to announce here>");
return false; return false;
} }
String announce = st.nextToken(); String announce = st.nextToken();
@@ -99,44 +100,44 @@ public class AdminAnnouncements implements IAdminCommandHandler
// ************************************ // ************************************
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
final String annInitDelay = st.nextToken(); final String annInitDelay = st.nextToken();
if (!Util.isDigit(annInitDelay)) if (!Util.isDigit(annInitDelay))
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
final int initDelay = Integer.parseInt(annInitDelay) * 1000; final int initDelay = Integer.parseInt(annInitDelay) * 1000;
// ************************************ // ************************************
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
final String annDelay = st.nextToken(); final String annDelay = st.nextToken();
if (!Util.isDigit(annDelay)) if (!Util.isDigit(annDelay))
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
final int delay = Integer.parseInt(annDelay) * 1000; final int delay = Integer.parseInt(annDelay) * 1000;
if ((delay < (10 * 1000)) && ((type == AnnouncementType.AUTO_NORMAL) || (type == AnnouncementType.AUTO_CRITICAL))) if ((delay < (10 * 1000)) && ((type == AnnouncementType.AUTO_NORMAL) || (type == AnnouncementType.AUTO_CRITICAL)))
{ {
activeChar.sendMessage("Delay cannot be less then 10 seconds!"); BuilderUtil.sendSysMessage(activeChar, "Delay cannot be less then 10 seconds!");
break; break;
} }
// ************************************ // ************************************
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
final String annRepeat = st.nextToken(); final String annRepeat = st.nextToken();
if (!Util.isDigit(annRepeat)) if (!Util.isDigit(annRepeat))
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
int repeat = Integer.parseInt(annRepeat); int repeat = Integer.parseInt(annRepeat);
@@ -147,7 +148,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
// ************************************ // ************************************
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
String content = st.nextToken(); String content = st.nextToken();
@@ -166,27 +167,27 @@ public class AdminAnnouncements implements IAdminCommandHandler
announce = new Announcement(type, content, activeChar.getName()); announce = new Announcement(type, content, activeChar.getName());
} }
AnnouncementsTable.getInstance().addAnnouncement(announce); AnnouncementsTable.getInstance().addAnnouncement(announce);
activeChar.sendMessage("Announcement has been successfully added!"); BuilderUtil.sendSysMessage(activeChar, "Announcement has been successfully added!");
return useAdminCommand("admin_announces list", activeChar); return useAdminCommand("admin_announces list", activeChar);
} }
case "edit": case "edit":
{ {
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announces edit <id>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces edit <id>");
break; break;
} }
final String annId = st.nextToken(); final String annId = st.nextToken();
if (!Util.isDigit(annId)) if (!Util.isDigit(annId))
{ {
activeChar.sendMessage("Syntax: //announces edit <id>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces edit <id>");
break; break;
} }
final int id = Integer.parseInt(annId); final int id = Integer.parseInt(annId);
final IAnnouncement announce = AnnouncementsTable.getInstance().getAnnounce(id); final IAnnouncement announce = AnnouncementsTable.getInstance().getAnnounce(id);
if (announce == null) if (announce == null)
{ {
activeChar.sendMessage("Announcement doesnt exists!"); BuilderUtil.sendSysMessage(activeChar, "Announcement does not exist!");
break; break;
} }
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
@@ -232,7 +233,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
} }
default: default:
{ {
activeChar.sendMessage("Announce type can be changed only to AUTO_NORMAL or AUTO_CRITICAL!"); BuilderUtil.sendSysMessage(activeChar, "Announce type can be changed only to AUTO_NORMAL or AUTO_CRITICAL!");
return false; return false;
} }
} }
@@ -250,7 +251,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
} }
default: default:
{ {
activeChar.sendMessage("Announce type can be changed only to NORMAL or CRITICAL!"); BuilderUtil.sendSysMessage(activeChar, "Announce type can be changed only to NORMAL or CRITICAL!");
return false; return false;
} }
} }
@@ -260,44 +261,44 @@ public class AdminAnnouncements implements IAdminCommandHandler
// ************************************ // ************************************
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
final String annInitDelay = st.nextToken(); final String annInitDelay = st.nextToken();
if (!Util.isDigit(annInitDelay)) if (!Util.isDigit(annInitDelay))
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
final int initDelay = Integer.parseInt(annInitDelay); final int initDelay = Integer.parseInt(annInitDelay);
// ************************************ // ************************************
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
final String annDelay = st.nextToken(); final String annDelay = st.nextToken();
if (!Util.isDigit(annDelay)) if (!Util.isDigit(annDelay))
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
final int delay = Integer.parseInt(annDelay); final int delay = Integer.parseInt(annDelay);
if ((delay < 10) && ((type == AnnouncementType.AUTO_NORMAL) || (type == AnnouncementType.AUTO_CRITICAL))) if ((delay < 10) && ((type == AnnouncementType.AUTO_NORMAL) || (type == AnnouncementType.AUTO_CRITICAL)))
{ {
activeChar.sendMessage("Delay cannot be less then 10 seconds!"); BuilderUtil.sendSysMessage(activeChar, "Delay cannot be less then 10 seconds!");
break; break;
} }
// ************************************ // ************************************
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
final String annRepeat = st.nextToken(); final String annRepeat = st.nextToken();
if (!Util.isDigit(annRepeat)) if (!Util.isDigit(annRepeat))
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
int repeat = Integer.parseInt(annRepeat); int repeat = Integer.parseInt(annRepeat);
@@ -331,30 +332,30 @@ public class AdminAnnouncements implements IAdminCommandHandler
autoAnnounce.setRepeat(repeat); autoAnnounce.setRepeat(repeat);
} }
announce.updateMe(); announce.updateMe();
activeChar.sendMessage("Announcement has been successfully edited!"); BuilderUtil.sendSysMessage(activeChar, "Announcement has been successfully edited!");
return useAdminCommand("admin_announces list", activeChar); return useAdminCommand("admin_announces list", activeChar);
} }
case "remove": case "remove":
{ {
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announces remove <announcement id>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces remove <announcement id>");
break; break;
} }
final String token = st.nextToken(); final String token = st.nextToken();
if (!Util.isDigit(token)) if (!Util.isDigit(token))
{ {
activeChar.sendMessage("Syntax: //announces remove <announcement id>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces remove <announcement id>");
break; break;
} }
final int id = Integer.parseInt(token); final int id = Integer.parseInt(token);
if (AnnouncementsTable.getInstance().deleteAnnouncement(id)) if (AnnouncementsTable.getInstance().deleteAnnouncement(id))
{ {
activeChar.sendMessage("Announcement has been successfully removed!"); BuilderUtil.sendSysMessage(activeChar, "Announcement has been successfully removed!");
} }
else else
{ {
activeChar.sendMessage("Announcement doesnt exists!"); BuilderUtil.sendSysMessage(activeChar, "Announcement does not exist!");
} }
return useAdminCommand("admin_announces list", activeChar); return useAdminCommand("admin_announces list", activeChar);
} }
@@ -370,13 +371,13 @@ public class AdminAnnouncements implements IAdminCommandHandler
autoAnnounce.restartMe(); autoAnnounce.restartMe();
} }
} }
activeChar.sendMessage("Auto announcements has been successfully restarted"); BuilderUtil.sendSysMessage(activeChar, "Auto announcements has been successfully restarted.");
break; break;
} }
final String token = st.nextToken(); final String token = st.nextToken();
if (!Util.isDigit(token)) if (!Util.isDigit(token))
{ {
activeChar.sendMessage("Syntax: //announces show <announcement id>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces show <announcement id>");
break; break;
} }
final int id = Integer.parseInt(token); final int id = Integer.parseInt(token);
@@ -387,16 +388,16 @@ public class AdminAnnouncements implements IAdminCommandHandler
{ {
final AutoAnnouncement autoAnnounce = (AutoAnnouncement) announce; final AutoAnnouncement autoAnnounce = (AutoAnnouncement) announce;
autoAnnounce.restartMe(); autoAnnounce.restartMe();
activeChar.sendMessage("Auto announcement has been successfully restarted"); BuilderUtil.sendSysMessage(activeChar, "Auto announcement has been successfully restarted.");
} }
else else
{ {
activeChar.sendMessage("This option has effect only on auto announcements!"); BuilderUtil.sendSysMessage(activeChar, "This option has effect only on auto announcements!");
} }
} }
else else
{ {
activeChar.sendMessage("Announcement doesnt exists!"); BuilderUtil.sendSysMessage(activeChar, "Announcement does not exist!");
} }
break; break;
} }
@@ -404,13 +405,13 @@ public class AdminAnnouncements implements IAdminCommandHandler
{ {
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announces show <announcement id>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces show <announcement id>");
break; break;
} }
final String token = st.nextToken(); final String token = st.nextToken();
if (!Util.isDigit(token)) if (!Util.isDigit(token))
{ {
activeChar.sendMessage("Syntax: //announces show <announcement id>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces show <announcement id>");
break; break;
} }
final int id = Integer.parseInt(token); final int id = Integer.parseInt(token);
@@ -442,7 +443,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
Util.sendCBHtml(activeChar, content); Util.sendCBHtml(activeChar, content);
break; break;
} }
activeChar.sendMessage("Announcement doesnt exists!"); BuilderUtil.sendSysMessage(activeChar, "Announcement does not exist!");
return useAdminCommand("admin_announces list", activeChar); return useAdminCommand("admin_announces list", activeChar);
} }
case "list": case "list":

View File

@@ -39,6 +39,7 @@ import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.SkillCoolTime; import com.l2jmobius.gameserver.network.serverpackets.SkillCoolTime;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.GMAudit; import com.l2jmobius.gameserver.util.GMAudit;
public class AdminBuffs implements IAdminCommandHandler public class AdminBuffs implements IAdminCommandHandler
@@ -74,8 +75,8 @@ public class AdminBuffs implements IAdminCommandHandler
command = st.nextToken(); command = st.nextToken();
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Skill Id and level are not specified."); BuilderUtil.sendSysMessage(activeChar, "Skill Id and level are not specified.");
activeChar.sendMessage("Usage: //buff <skillId> <skillLevel>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //buff <skillId> <skillLevel>");
return false; return false;
} }
@@ -87,18 +88,18 @@ public class AdminBuffs implements IAdminCommandHandler
final Skill skill = SkillData.getInstance().getSkill(skillId, skillLevel); final Skill skill = SkillData.getInstance().getSkill(skillId, skillLevel);
if (skill == null) if (skill == null)
{ {
activeChar.sendMessage("Skill with id: " + skillId + ", lvl: " + skillLevel + " not found."); BuilderUtil.sendSysMessage(activeChar, "Skill with id: " + skillId + ", lvl: " + skillLevel + " not found.");
return false; return false;
} }
activeChar.sendMessage("Admin buffing " + skill.getName() + " (" + skillId + "," + skillLevel + ")"); BuilderUtil.sendSysMessage(activeChar, "Admin buffing " + skill.getName() + " (" + skillId + "," + skillLevel + ")");
skill.applyEffects(activeChar, target); skill.applyEffects(activeChar, target);
return true; return true;
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Failed buffing: " + e.getMessage()); BuilderUtil.sendSysMessage(activeChar, "Failed buffing: " + e.getMessage());
activeChar.sendMessage("Usage: //buff <skillId> <skillLevel>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //buff <skillId> <skillLevel>");
return false; return false;
} }
} }
@@ -120,7 +121,7 @@ public class AdminBuffs implements IAdminCommandHandler
showBuffs(activeChar, player, page, command.endsWith("_ps")); showBuffs(activeChar, player, page, command.endsWith("_ps"));
return true; return true;
} }
activeChar.sendMessage("The player " + playername + " is not online."); BuilderUtil.sendSysMessage(activeChar, "The player " + playername + " is not online.");
return false; return false;
} }
else if ((activeChar.getTarget() != null) && activeChar.getTarget().isCharacter()) else if ((activeChar.getTarget() != null) && activeChar.getTarget().isCharacter())
@@ -149,8 +150,8 @@ public class AdminBuffs implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Failed removing effect: " + e.getMessage()); BuilderUtil.sendSysMessage(activeChar, "Failed removing effect: " + e.getMessage());
activeChar.sendMessage("Usage: //stopbuff <objectId> <skillId>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //stopbuff <objectId> <skillId>");
return false; return false;
} }
} }
@@ -166,8 +167,8 @@ public class AdminBuffs implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Failed removing all effects: " + e.getMessage()); BuilderUtil.sendSysMessage(activeChar, "Failed removing all effects: " + e.getMessage());
activeChar.sendMessage("Usage: //stopallbuffs <objectId>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //stopallbuffs <objectId>");
return false; return false;
} }
} }
@@ -183,8 +184,8 @@ public class AdminBuffs implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Failed viewing blocked effects: " + e.getMessage()); BuilderUtil.sendSysMessage(activeChar, "Failed viewing blocked effects: " + e.getMessage());
activeChar.sendMessage("Usage: //viewblockedeffects <objectId>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //viewblockedeffects <objectId>");
return false; return false;
} }
} }
@@ -199,12 +200,12 @@ public class AdminBuffs implements IAdminCommandHandler
L2World.getInstance().forEachVisibleObjectInRange(activeChar, L2PcInstance.class, radius, L2Character::stopAllEffects); L2World.getInstance().forEachVisibleObjectInRange(activeChar, L2PcInstance.class, radius, L2Character::stopAllEffects);
activeChar.sendMessage("All effects canceled within radius " + radius); BuilderUtil.sendSysMessage(activeChar, "All effects canceled within radius " + radius);
return true; return true;
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
activeChar.sendMessage("Usage: //areacancel <radius>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //areacancel <radius>");
return false; return false;
} }
} }
@@ -228,7 +229,7 @@ public class AdminBuffs implements IAdminCommandHandler
if (player == null) if (player == null)
{ {
activeChar.sendMessage("The player " + playername + " is not online."); BuilderUtil.sendSysMessage(activeChar, "The player " + playername + " is not online.");
return false; return false;
} }
} }
@@ -247,7 +248,7 @@ public class AdminBuffs implements IAdminCommandHandler
player.resetTimeStamps(); player.resetTimeStamps();
player.resetDisabledSkills(); player.resetDisabledSkills();
player.sendPacket(new SkillCoolTime(player)); player.sendPacket(new SkillCoolTime(player));
activeChar.sendMessage("Skill reuse was removed from " + player.getName() + "."); BuilderUtil.sendSysMessage(activeChar, "Skill reuse was removed from " + player.getName() + ".");
return true; return true;
} }
catch (NullPointerException e) catch (NullPointerException e)
@@ -262,10 +263,10 @@ public class AdminBuffs implements IAdminCommandHandler
final boolean toAuraSkills = activeChar.getKnownSkill(7041) != null; final boolean toAuraSkills = activeChar.getKnownSkill(7041) != null;
switchSkills(activeChar, toAuraSkills); switchSkills(activeChar, toAuraSkills);
activeChar.sendSkillList(); activeChar.sendSkillList();
activeChar.sendMessage("You have succefully changed to target " + (toAuraSkills ? "aura" : "one") + " special skills."); BuilderUtil.sendSysMessage(activeChar, "You have succefully changed to target " + (toAuraSkills ? "aura" : "one") + " special skills.");
return true; return true;
} }
activeChar.sendMessage("There is nothing to switch."); BuilderUtil.sendSysMessage(activeChar, "There is nothing to switch.");
return false; return false;
} }
return true; return true;
@@ -368,7 +369,7 @@ public class AdminBuffs implements IAdminCommandHandler
if (target.isAffectedBySkill(skillId)) if (target.isAffectedBySkill(skillId))
{ {
target.stopSkillEffects(true, skillId); target.stopSkillEffects(true, skillId);
activeChar.sendMessage("Removed skill ID: " + skillId + " effects from " + target.getName() + " (" + objId + ")."); BuilderUtil.sendSysMessage(activeChar, "Removed skill ID: " + skillId + " effects from " + target.getName() + " (" + objId + ").");
} }
showBuffs(activeChar, target, 0, false); showBuffs(activeChar, target, 0, false);
@@ -393,7 +394,7 @@ public class AdminBuffs implements IAdminCommandHandler
if (target != null) if (target != null)
{ {
target.stopAllEffects(); target.stopAllEffects();
activeChar.sendMessage("Removed all effects from " + target.getName() + " (" + objId + ")"); BuilderUtil.sendSysMessage(activeChar, "Removed all effects from " + target.getName() + " (" + objId + ")");
showBuffs(activeChar, target, 0, false); showBuffs(activeChar, target, 0, false);
if (Config.GMAUDIT) if (Config.GMAUDIT)
{ {
@@ -411,7 +412,7 @@ public class AdminBuffs implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Target with object id " + objId + " not found."); BuilderUtil.sendSysMessage(activeChar, "Target with object id " + objId + " not found.");
return; return;
} }

View File

@@ -21,6 +21,7 @@ import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.events.AbstractScript; import com.l2jmobius.gameserver.model.events.AbstractScript;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* Camera commands. * Camera commands.
@@ -52,7 +53,7 @@ public class AdminCamera implements IAdminCommandHandler
{ {
if (com.length != 12) if (com.length != 12)
{ {
activeChar.sendMessage("Usage: //cam force angle1 angle2 time range duration relYaw relPitch isWide relAngle"); BuilderUtil.sendSysMessage(activeChar, "Usage: //cam force angle1 angle2 time range duration relYaw relPitch isWide relAngle");
return false; return false;
} }
AbstractScript.specialCamera(activeChar, target, Integer.parseInt(com[1]), Integer.parseInt(com[2]), Integer.parseInt(com[3]), Integer.parseInt(com[4]), Integer.parseInt(com[5]), Integer.parseInt(com[6]), Integer.parseInt(com[7]), Integer.parseInt(com[8]), Integer.parseInt(com[9]), Integer.parseInt(com[10])); AbstractScript.specialCamera(activeChar, target, Integer.parseInt(com[1]), Integer.parseInt(com[2]), Integer.parseInt(com[3]), Integer.parseInt(com[4]), Integer.parseInt(com[5]), Integer.parseInt(com[6]), Integer.parseInt(com[7]), Integer.parseInt(com[8]), Integer.parseInt(com[9]), Integer.parseInt(com[10]));
@@ -62,7 +63,7 @@ public class AdminCamera implements IAdminCommandHandler
{ {
if (com.length != 10) if (com.length != 10)
{ {
activeChar.sendMessage("Usage: //camex force angle1 angle2 time duration relYaw relPitch isWide relAngle"); BuilderUtil.sendSysMessage(activeChar, "Usage: //camex force angle1 angle2 time duration relYaw relPitch isWide relAngle");
return false; return false;
} }
AbstractScript.specialCameraEx(activeChar, target, Integer.parseInt(com[1]), Integer.parseInt(com[2]), Integer.parseInt(com[3]), Integer.parseInt(com[4]), Integer.parseInt(com[5]), Integer.parseInt(com[6]), Integer.parseInt(com[7]), Integer.parseInt(com[8]), Integer.parseInt(com[9])); AbstractScript.specialCameraEx(activeChar, target, Integer.parseInt(com[1]), Integer.parseInt(com[2]), Integer.parseInt(com[3]), Integer.parseInt(com[4]), Integer.parseInt(com[5]), Integer.parseInt(com[6]), Integer.parseInt(com[7]), Integer.parseInt(com[8]), Integer.parseInt(com[9]));
@@ -72,7 +73,7 @@ public class AdminCamera implements IAdminCommandHandler
{ {
if (com.length != 12) if (com.length != 12)
{ {
activeChar.sendMessage("Usage: //cam3 force angle1 angle2 time range duration relYaw relPitch isWide relAngle unk"); BuilderUtil.sendSysMessage(activeChar, "Usage: //cam3 force angle1 angle2 time range duration relYaw relPitch isWide relAngle unk");
return false; return false;
} }
AbstractScript.specialCamera3(activeChar, target, Integer.parseInt(com[1]), Integer.parseInt(com[2]), Integer.parseInt(com[3]), Integer.parseInt(com[4]), Integer.parseInt(com[5]), Integer.parseInt(com[6]), Integer.parseInt(com[7]), Integer.parseInt(com[8]), Integer.parseInt(com[9]), Integer.parseInt(com[10]), Integer.parseInt(com[11])); AbstractScript.specialCamera3(activeChar, target, Integer.parseInt(com[1]), Integer.parseInt(com[2]), Integer.parseInt(com[3]), Integer.parseInt(com[4]), Integer.parseInt(com[5]), Integer.parseInt(com[6]), Integer.parseInt(com[7]), Integer.parseInt(com[8]), Integer.parseInt(com[9]), Integer.parseInt(com[10]), Integer.parseInt(com[11]));

View File

@@ -29,6 +29,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.Castle; import com.l2jmobius.gameserver.model.entity.Castle;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
/** /**
@@ -65,7 +66,7 @@ public final class AdminCastle implements IAdminCommandHandler
if (castle == null) if (castle == null)
{ {
activeChar.sendMessage("Invalid parameters! Usage: //castlemanage <castleId[1-9] / castleName>"); BuilderUtil.sendSysMessage(activeChar, "Invalid parameters! Usage: //castlemanage <castleId[1-9] / castleName>");
return false; return false;
} }
@@ -140,7 +141,7 @@ public final class AdminCastle implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("There is currently not registered any clan for castle siege!"); BuilderUtil.sendSysMessage(activeChar, "There is currently not registered any clan for castle siege!");
} }
break; break;
} }
@@ -152,7 +153,7 @@ public final class AdminCastle implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Castle siege is not currently in progress!"); BuilderUtil.sendSysMessage(activeChar, "Castle siege is not currently in progress!");
} }
showCastleMenu(activeChar, castle.getResidenceId()); showCastleMenu(activeChar, castle.getResidenceId());
break; break;
@@ -165,15 +166,15 @@ public final class AdminCastle implements IAdminCommandHandler
} }
else if (target.getClan().getCastleId() > 0) else if (target.getClan().getCastleId() > 0)
{ {
activeChar.sendMessage("This clan already have castle!"); BuilderUtil.sendSysMessage(activeChar, "This clan already have castle!");
} }
else if (castle.getOwner() != null) else if (castle.getOwner() != null)
{ {
activeChar.sendMessage("This castle is already taken by another clan!"); BuilderUtil.sendSysMessage(activeChar, "This castle is already taken by another clan!");
} }
else if (!st.hasMoreTokens()) else if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Invalid parameters!!"); BuilderUtil.sendSysMessage(activeChar, "Invalid parameters!!");
} }
else else
{ {
@@ -196,7 +197,7 @@ public final class AdminCastle implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Error during removing castle!"); BuilderUtil.sendSysMessage(activeChar, "Error during removing castle!");
} }
showCastleMenu(activeChar, castle.getResidenceId()); showCastleMenu(activeChar, castle.getResidenceId());
break; break;
@@ -213,7 +214,7 @@ public final class AdminCastle implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("You can't switch sides when is castle neutral!"); BuilderUtil.sendSysMessage(activeChar, "You can't switch sides when is castle neutral!");
} }
showCastleMenu(activeChar, castle.getResidenceId()); showCastleMenu(activeChar, castle.getResidenceId());
break; break;

View File

@@ -28,6 +28,7 @@ import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.Disconnection; import com.l2jmobius.gameserver.network.Disconnection;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* Change access level command handler. * Change access level command handler.
@@ -59,7 +60,7 @@ public final class AdminChangeAccessLevel implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //changelvl <target_new_level> | <player_name> <new_level>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //changelvl <target_new_level> | <player_name> <new_level>");
} }
} }
else if (parts.length == 3) else if (parts.length == 3)
@@ -83,16 +84,16 @@ public final class AdminChangeAccessLevel implements IAdminCommandHandler
statement.close(); statement.close();
if (count == 0) if (count == 0)
{ {
activeChar.sendMessage("Character not found or access level unaltered."); BuilderUtil.sendSysMessage(activeChar, "Character not found or access level unaltered.");
} }
else else
{ {
activeChar.sendMessage("Character's access level is now set to " + lvl); BuilderUtil.sendSysMessage(activeChar, "Character's access level is now set to " + lvl);
} }
} }
catch (SQLException se) catch (SQLException se)
{ {
activeChar.sendMessage("SQLException while changing character's access level"); BuilderUtil.sendSysMessage(activeChar, "SQLException while changing character's access level");
} }
} }
} }
@@ -123,7 +124,7 @@ public final class AdminChangeAccessLevel implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("You are trying to set unexisting access level: " + lvl + " please try again with a valid one!"); BuilderUtil.sendSysMessage(activeChar, "You are trying to set unexisting access level: " + lvl + " please try again with a valid one!");
} }
} }
else else

View File

@@ -31,6 +31,7 @@ import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
/** /**
@@ -157,7 +158,7 @@ public class AdminClan implements IAdminCommandHandler
} }
clan.setNewLeader(member); clan.setNewLeader(member);
activeChar.sendMessage("Task have been forcely executed."); BuilderUtil.sendSysMessage(activeChar, "Task have been forcely executed.");
break; break;
} }
} }

View File

@@ -28,6 +28,7 @@ import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.network.serverpackets.ExAdenaInvenCount; import com.l2jmobius.gameserver.network.serverpackets.ExAdenaInvenCount;
import com.l2jmobius.gameserver.network.serverpackets.GMViewItemList; import com.l2jmobius.gameserver.network.serverpackets.GMViewItemList;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - itemcreate = show menu - create_item <id> [num] = creates num items with respective id, if num is not specified, assumes 1. * This class handles following admin commands: - itemcreate = show menu - create_item <id> [num] = creates num items with respective id, if num is not specified, assumes 1.
@@ -76,11 +77,11 @@ public class AdminCreateItem implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Usage: //create_item <itemId> [amount]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //create_item <itemId> [amount]");
} }
catch (NumberFormatException nfe) catch (NumberFormatException nfe)
{ {
activeChar.sendMessage("Specify a valid number."); BuilderUtil.sendSysMessage(activeChar, "Specify a valid number.");
} }
AdminHtml.showAdminHtml(activeChar, "itemcreation.htm"); AdminHtml.showAdminHtml(activeChar, "itemcreation.htm");
} }
@@ -110,11 +111,11 @@ public class AdminCreateItem implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Usage: //create_coin <name> [amount]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //create_coin <name> [amount]");
} }
catch (NumberFormatException nfe) catch (NumberFormatException nfe)
{ {
activeChar.sendMessage("Specify a valid number."); BuilderUtil.sendSysMessage(activeChar, "Specify a valid number.");
} }
AdminHtml.showAdminHtml(activeChar, "itemcreation.htm"); AdminHtml.showAdminHtml(activeChar, "itemcreation.htm");
} }
@@ -129,7 +130,7 @@ public class AdminCreateItem implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Invalid target."); BuilderUtil.sendSysMessage(activeChar, "Invalid target.");
return false; return false;
} }
@@ -152,11 +153,11 @@ public class AdminCreateItem implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Usage: //give_item_target <itemId> [amount]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //give_item_target <itemId> [amount]");
} }
catch (NumberFormatException nfe) catch (NumberFormatException nfe)
{ {
activeChar.sendMessage("Specify a valid number."); BuilderUtil.sendSysMessage(activeChar, "Specify a valid number.");
} }
AdminHtml.showAdminHtml(activeChar, "itemcreation.htm"); AdminHtml.showAdminHtml(activeChar, "itemcreation.htm");
} }
@@ -183,12 +184,12 @@ public class AdminCreateItem implements IAdminCommandHandler
final L2Item template = ItemTable.getInstance().getTemplate(idval); final L2Item template = ItemTable.getInstance().getTemplate(idval);
if (template == null) if (template == null)
{ {
activeChar.sendMessage("This item doesn't exist."); BuilderUtil.sendSysMessage(activeChar, "This item doesn't exist.");
return false; return false;
} }
if ((numval > 10) && !template.isStackable()) if ((numval > 10) && !template.isStackable())
{ {
activeChar.sendMessage("This item does not stack - Creation aborted."); BuilderUtil.sendSysMessage(activeChar, "This item does not stack - Creation aborted.");
return false; return false;
} }
for (L2PcInstance onlinePlayer : L2World.getInstance().getPlayers()) for (L2PcInstance onlinePlayer : L2World.getInstance().getPlayers())
@@ -228,7 +229,7 @@ public class AdminCreateItem implements IAdminCommandHandler
final L2PcInstance player = L2World.getInstance().getPlayer(ownerId); final L2PcInstance player = L2World.getInstance().getPlayer(ownerId);
if (player == null) if (player == null)
{ {
activeChar.sendMessage("Player is not online."); BuilderUtil.sendSysMessage(activeChar, "Player is not online.");
return false; return false;
} }
@@ -239,11 +240,11 @@ public class AdminCreateItem implements IAdminCommandHandler
player.getInventory().destroyItem("AdminDelete", idval, numval, activeChar, null); player.getInventory().destroyItem("AdminDelete", idval, numval, activeChar, null);
activeChar.sendPacket(new GMViewItemList(player)); activeChar.sendPacket(new GMViewItemList(player));
activeChar.sendMessage("Item deleted."); BuilderUtil.sendSysMessage(activeChar, "Item deleted.");
} }
else else
{ {
activeChar.sendMessage("Item doesn't have owner."); BuilderUtil.sendSysMessage(activeChar, "Item doesn't have owner.");
return false; return false;
} }
} }
@@ -258,7 +259,7 @@ public class AdminCreateItem implements IAdminCommandHandler
final L2PcInstance player = L2World.getInstance().getPlayer(ownerId); final L2PcInstance player = L2World.getInstance().getPlayer(ownerId);
if (player == null) if (player == null)
{ {
activeChar.sendMessage("Player is not online."); BuilderUtil.sendSysMessage(activeChar, "Player is not online.");
return false; return false;
} }
@@ -279,7 +280,7 @@ public class AdminCreateItem implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Item doesn't have owner."); BuilderUtil.sendSysMessage(activeChar, "Item doesn't have owner.");
return false; return false;
} }
} }
@@ -297,12 +298,12 @@ public class AdminCreateItem implements IAdminCommandHandler
final L2Item template = ItemTable.getInstance().getTemplate(id); final L2Item template = ItemTable.getInstance().getTemplate(id);
if (template == null) if (template == null)
{ {
activeChar.sendMessage("This item doesn't exist."); BuilderUtil.sendSysMessage(activeChar, "This item doesn't exist.");
return; return;
} }
if ((num > 10) && !template.isStackable()) if ((num > 10) && !template.isStackable())
{ {
activeChar.sendMessage("This item does not stack - Creation aborted."); BuilderUtil.sendSysMessage(activeChar, "This item does not stack - Creation aborted.");
return; return;
} }
@@ -312,7 +313,7 @@ public class AdminCreateItem implements IAdminCommandHandler
{ {
target.sendMessage("Admin spawned " + num + " " + template.getName() + " in your inventory."); target.sendMessage("Admin spawned " + num + " " + template.getName() + " in your inventory.");
} }
activeChar.sendMessage("You have spawned " + num + " " + template.getName() + "(" + id + ") in " + target.getName() + " inventory."); BuilderUtil.sendSysMessage(activeChar, "You have spawned " + num + " " + template.getName() + "(" + id + ") in " + target.getName() + " inventory.");
target.sendPacket(new ExAdenaInvenCount(target)); target.sendPacket(new ExAdenaInvenCount(target));
} }

View File

@@ -26,6 +26,7 @@ import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - cw_info = displays cursed weapon status - cw_remove = removes a cursed weapon from the world, item id or name must be provided - cw_add = adds a cursed weapon into the world, item id or name must be provided. Target will be the weilder - cw_goto = * This class handles following admin commands: - cw_info = displays cursed weapon status - cw_remove = removes a cursed weapon from the world, item id or name must be provided - cw_add = adds a cursed weapon into the world, item id or name must be provided. Target will be the weilder - cw_goto =
@@ -60,27 +61,27 @@ public class AdminCursedWeapons implements IAdminCommandHandler
{ {
if (!command.contains("menu")) if (!command.contains("menu"))
{ {
activeChar.sendMessage("====== Cursed Weapons: ======"); BuilderUtil.sendSysMessage(activeChar, "====== Cursed Weapons: ======");
for (CursedWeapon cw : cwm.getCursedWeapons()) for (CursedWeapon cw : cwm.getCursedWeapons())
{ {
activeChar.sendMessage("> " + cw.getName() + " (" + cw.getItemId() + ")"); BuilderUtil.sendSysMessage(activeChar, "> " + cw.getName() + " (" + cw.getItemId() + ")");
if (cw.isActivated()) if (cw.isActivated())
{ {
final L2PcInstance pl = cw.getPlayer(); final L2PcInstance pl = cw.getPlayer();
activeChar.sendMessage(" Player holding: " + (pl == null ? "null" : pl.getName())); BuilderUtil.sendSysMessage(activeChar, " Player holding: " + (pl == null ? "null" : pl.getName()));
activeChar.sendMessage(" Player Reputation: " + cw.getPlayerReputation()); BuilderUtil.sendSysMessage(activeChar, " Player Reputation: " + cw.getPlayerReputation());
activeChar.sendMessage(" Time Remaining: " + (cw.getTimeLeft() / 60000) + " min."); BuilderUtil.sendSysMessage(activeChar, " Time Remaining: " + (cw.getTimeLeft() / 60000) + " min.");
activeChar.sendMessage(" Kills : " + cw.getNbKills()); BuilderUtil.sendSysMessage(activeChar, " Kills : " + cw.getNbKills());
} }
else if (cw.isDropped()) else if (cw.isDropped())
{ {
activeChar.sendMessage(" Lying on the ground."); BuilderUtil.sendSysMessage(activeChar, " Lying on the ground.");
activeChar.sendMessage(" Time Remaining: " + (cw.getTimeLeft() / 60000) + " min."); BuilderUtil.sendSysMessage(activeChar, " Time Remaining: " + (cw.getTimeLeft() / 60000) + " min.");
activeChar.sendMessage(" Kills : " + cw.getNbKills()); BuilderUtil.sendSysMessage(activeChar, " Kills : " + cw.getNbKills());
} }
else else
{ {
activeChar.sendMessage(" Don't exist in the world."); BuilderUtil.sendSysMessage(activeChar, " Don't exist in the world.");
} }
activeChar.sendPacket(SystemMessageId.EMPTY_3); activeChar.sendPacket(SystemMessageId.EMPTY_3);
} }
@@ -178,12 +179,12 @@ public class AdminCursedWeapons implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //cw_remove|//cw_goto|//cw_add <itemid|name>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //cw_remove|//cw_goto|//cw_add <itemid|name>");
} }
if (cw == null) if (cw == null)
{ {
activeChar.sendMessage("Unknown cursed weapon ID."); BuilderUtil.sendSysMessage(activeChar, "Unknown cursed weapon ID.");
return false; return false;
} }
@@ -199,7 +200,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
{ {
if (cw.isActive()) if (cw.isActive())
{ {
activeChar.sendMessage("This cursed weapon is already active."); BuilderUtil.sendSysMessage(activeChar, "This cursed weapon is already active.");
} }
else else
{ {
@@ -218,7 +219,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Unknown command."); BuilderUtil.sendSysMessage(activeChar, "Unknown command.");
} }
} }
return true; return true;

View File

@@ -23,6 +23,7 @@ import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2Spawn; import com.l2jmobius.gameserver.model.L2Spawn;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - delete = deletes target * This class handles following admin commands: - delete = deletes target
@@ -75,11 +76,11 @@ public class AdminDelete implements IAdminCommandHandler
} }
} }
activeChar.sendMessage("Deleted " + target.getName() + " from " + target.getObjectId() + "."); BuilderUtil.sendSysMessage(activeChar, "Deleted " + target.getName() + " from " + target.getObjectId() + ".");
} }
else else
{ {
activeChar.sendMessage("Incorrect target."); BuilderUtil.sendSysMessage(activeChar, "Incorrect target.");
} }
} }
} }

View File

@@ -20,6 +20,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.Disconnection; import com.l2jmobius.gameserver.network.Disconnection;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - character_disconnect = disconnects target player * This class handles following admin commands: - character_disconnect = disconnects target player
@@ -63,11 +64,11 @@ public class AdminDisconnect implements IAdminCommandHandler
if (player == activeChar) if (player == activeChar)
{ {
activeChar.sendMessage("You cannot logout your own character."); BuilderUtil.sendSysMessage(activeChar, "You cannot logout your own character.");
} }
else else
{ {
activeChar.sendMessage("Character " + player.getName() + " disconnected from server."); BuilderUtil.sendSysMessage(activeChar, "Character " + player.getName() + " disconnected from server.");
Disconnection.of(player).defaultSequence(false); Disconnection.of(player).defaultSequence(false);
} }

View File

@@ -27,6 +27,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2DoorInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.Castle; import com.l2jmobius.gameserver.model.entity.Castle;
import com.l2jmobius.gameserver.network.serverpackets.ExServerPrimitive; import com.l2jmobius.gameserver.network.serverpackets.ExServerPrimitive;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - open1 = open coloseum door 24190001 - open2 = open coloseum door 24190002 - open3 = open coloseum door 24190003 - open4 = open coloseum door 24190004 - openall = open all coloseum door - close1 = close coloseum door 24190001 - close2 = close coloseum * This class handles following admin commands: - open1 = open coloseum door 24190001 - open2 = open coloseum door 24190002 - open3 = open coloseum door 24190003 - open4 = open coloseum door 24190004 - openall = open all coloseum door - close1 = close coloseum door 24190001 - close2 = close coloseum
@@ -123,7 +124,7 @@ public class AdminDoorControl implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Incorrect target."); BuilderUtil.sendSysMessage(activeChar, "Incorrect target.");
} }
} }
else if (command.equals("admin_close")) else if (command.equals("admin_close"))
@@ -135,7 +136,7 @@ public class AdminDoorControl implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Incorrect target."); BuilderUtil.sendSysMessage(activeChar, "Incorrect target.");
} }
} }
else if (command.equals("admin_showdoors")) else if (command.equals("admin_showdoors"))
@@ -161,7 +162,7 @@ public class AdminDoorControl implements IAdminCommandHandler
packet.addLine(color, door.getX(2), door.getY(2), door.getZMax(), door.getX(3), door.getY(3), door.getZMin()); packet.addLine(color, door.getX(2), door.getY(2), door.getZMax(), door.getX(3), door.getY(3), door.getZMin());
activeChar.sendPacket(packet); activeChar.sendPacket(packet);
// send message // send message
activeChar.sendMessage("Found door " + door.getId()); BuilderUtil.sendSysMessage(activeChar, "Found door " + door.getId());
}); });
} }
} }

View File

@@ -61,6 +61,7 @@ import com.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
import com.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll; import com.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.network.serverpackets.UserInfo; import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* EditChar admin command implementation. * EditChar admin command implementation.
@@ -148,7 +149,7 @@ public class AdminEditChar implements IAdminCommandHandler
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
// Case of empty page number // Case of empty page number
activeChar.sendMessage("Usage: //show_characters <page_number>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //show_characters <page_number>");
} }
} }
else if (command.startsWith("admin_find_character")) else if (command.startsWith("admin_find_character"))
@@ -160,7 +161,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ // Case of empty character name { // Case of empty character name
activeChar.sendMessage("Usage: //find_character <character_name>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //find_character <character_name>");
listCharacters(activeChar, 0); listCharacters(activeChar, 0);
} }
} }
@@ -173,7 +174,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ // Case of empty or malformed IP number { // Case of empty or malformed IP number
activeChar.sendMessage("Usage: //find_ip <www.xxx.yyy.zzz>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //find_ip <www.xxx.yyy.zzz>");
listCharacters(activeChar, 0); listCharacters(activeChar, 0);
} }
} }
@@ -186,7 +187,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ // Case of empty or malformed player name { // Case of empty or malformed player name
activeChar.sendMessage("Usage: //find_account <player_name>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //find_account <player_name>");
listCharacters(activeChar, 0); listCharacters(activeChar, 0);
} }
} }
@@ -220,14 +221,14 @@ public class AdminEditChar implements IAdminCommandHandler
{ {
LOGGER.warning("Set reputation error: " + e); LOGGER.warning("Set reputation error: " + e);
} }
activeChar.sendMessage("Usage: //setreputation <new_reputation_value>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setreputation <new_reputation_value>");
} }
} }
else if (command.startsWith("admin_nokarma")) else if (command.startsWith("admin_nokarma"))
{ {
if ((activeChar.getTarget() == null) || !activeChar.getTarget().isPlayer()) if ((activeChar.getTarget() == null) || !activeChar.getTarget().isPlayer())
{ {
activeChar.sendMessage("You must target a player."); BuilderUtil.sendSysMessage(activeChar, "You must target a player.");
return false; return false;
} }
@@ -263,7 +264,7 @@ public class AdminEditChar implements IAdminCommandHandler
{ {
LOGGER.warning("Set pk error: " + e); LOGGER.warning("Set pk error: " + e);
} }
activeChar.sendMessage("Usage: //setpk <pk_count>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setpk <pk_count>");
} }
} }
else if (command.startsWith("admin_setpvp")) else if (command.startsWith("admin_setpvp"))
@@ -293,7 +294,7 @@ public class AdminEditChar implements IAdminCommandHandler
{ {
LOGGER.warning("Set pvp error: " + e); LOGGER.warning("Set pvp error: " + e);
} }
activeChar.sendMessage("Usage: //setpvp <pvp_count>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setpvp <pvp_count>");
} }
} }
else if (command.startsWith("admin_setfame")) else if (command.startsWith("admin_setfame"))
@@ -323,7 +324,7 @@ public class AdminEditChar implements IAdminCommandHandler
{ {
LOGGER.warning("Set Fame error: " + e); LOGGER.warning("Set Fame error: " + e);
} }
activeChar.sendMessage("Usage: //setfame <new_fame_value>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setfame <new_fame_value>");
} }
} }
else if (command.startsWith("admin_rec")) else if (command.startsWith("admin_rec"))
@@ -350,7 +351,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //rec number"); BuilderUtil.sendSysMessage(activeChar, "Usage: //rec number");
} }
} }
else if (command.startsWith("admin_setclass")) else if (command.startsWith("admin_setclass"))
@@ -440,7 +441,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Usage: //setclass <valid_new_classid>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setclass <valid_new_classid>");
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -449,7 +450,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
activeChar.sendMessage("Usage: //setclass <valid_new_classid>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setclass <valid_new_classid>");
} }
} }
else if (command.startsWith("admin_settitle")) else if (command.startsWith("admin_settitle"))
@@ -473,7 +474,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ // Case of empty character title { // Case of empty character title
activeChar.sendMessage("You need to specify the new title."); BuilderUtil.sendSysMessage(activeChar, "You need to specify the new title.");
} }
} }
else if (command.startsWith("admin_changename")) else if (command.startsWith("admin_changename"))
@@ -493,7 +494,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
if (CharNameTable.getInstance().getIdByName(val) > 0) if (CharNameTable.getInstance().getIdByName(val) > 0)
{ {
activeChar.sendMessage("Warning, player " + val + " already exists"); BuilderUtil.sendSysMessage(activeChar, "Warning, player " + val + " already exists.");
return false; return false;
} }
player.setName(val); player.setName(val);
@@ -503,7 +504,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
player.storeMe(); player.storeMe();
activeChar.sendMessage("Changed name to " + val); BuilderUtil.sendSysMessage(activeChar, "Changed name to " + val);
player.sendMessage("Your name has been changed by a GM."); player.sendMessage("Your name has been changed by a GM.");
player.broadcastUserInfo(); player.broadcastUserInfo();
@@ -527,7 +528,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ // Case of empty character name { // Case of empty character name
activeChar.sendMessage("Usage: //setname new_name_for_target"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setname new_name_for_target");
} }
} }
else if (command.startsWith("admin_setsex")) else if (command.startsWith("admin_setsex"))
@@ -567,7 +568,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ // Case of empty color or invalid hex string { // Case of empty color or invalid hex string
activeChar.sendMessage("You need to specify a valid new color."); BuilderUtil.sendSysMessage(activeChar, "You need to specify a valid new color.");
} }
} }
else if (command.startsWith("admin_settcolor")) else if (command.startsWith("admin_settcolor"))
@@ -591,7 +592,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ // Case of empty color or invalid hex string { // Case of empty color or invalid hex string
activeChar.sendMessage("You need to specify a valid new color."); BuilderUtil.sendSysMessage(activeChar, "You need to specify a valid new color.");
} }
} }
else if (command.startsWith("admin_fullfood")) else if (command.startsWith("admin_fullfood"))
@@ -615,7 +616,7 @@ public class AdminEditChar implements IAdminCommandHandler
final StringTokenizer st = new StringTokenizer(command, " "); final StringTokenizer st = new StringTokenizer(command, " ");
if (st.countTokens() != 3) if (st.countTokens() != 3)
{ {
activeChar.sendMessage("Usage: //remove_clan_penalty join|create charname"); BuilderUtil.sendSysMessage(activeChar, "Usage: //remove_clan_penalty join|create charname");
return false; return false;
} }
@@ -644,7 +645,7 @@ public class AdminEditChar implements IAdminCommandHandler
player.setClanJoinExpiryTime(0); player.setClanJoinExpiryTime(0);
} }
activeChar.sendMessage("Clan penalty successfully removed to character: " + playerName); BuilderUtil.sendSysMessage(activeChar, "Clan penalty successfully removed to character: " + playerName);
} }
catch (Exception e) catch (Exception e)
{ {
@@ -660,7 +661,7 @@ public class AdminEditChar implements IAdminCommandHandler
multibox = Integer.parseInt(val); multibox = Integer.parseInt(val);
if (multibox < 1) if (multibox < 1)
{ {
activeChar.sendMessage("Usage: //find_dualbox [number > 0]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //find_dualbox [number > 0]");
return false; return false;
} }
} }
@@ -678,7 +679,7 @@ public class AdminEditChar implements IAdminCommandHandler
multibox = Integer.parseInt(val); multibox = Integer.parseInt(val);
if (multibox < 1) if (multibox < 1)
{ {
activeChar.sendMessage("Usage: //strict_find_dualbox [number > 0]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //strict_find_dualbox [number > 0]");
return false; return false;
} }
} }
@@ -713,13 +714,13 @@ public class AdminEditChar implements IAdminCommandHandler
final L2GameClient client = pl.getClient(); final L2GameClient client = pl.getClient();
if (client == null) if (client == null)
{ {
activeChar.sendMessage("Client is null."); BuilderUtil.sendSysMessage(activeChar, "Client is null.");
return false; return false;
} }
if (client.isDetached()) if (client.isDetached())
{ {
activeChar.sendMessage("Client is detached."); BuilderUtil.sendSysMessage(activeChar, "Client is detached.");
return false; return false;
} }
@@ -736,7 +737,7 @@ public class AdminEditChar implements IAdminCommandHandler
ip = ip + "."; ip = ip + ".";
} }
} }
activeChar.sendMessage("Hop" + i + ": " + ip); BuilderUtil.sendSysMessage(activeChar, "Hop" + i + ": " + ip);
} }
} }
else if (command.startsWith("admin_summon_info")) else if (command.startsWith("admin_summon_info"))
@@ -748,7 +749,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Invalid target."); BuilderUtil.sendSysMessage(activeChar, "Invalid target.");
} }
} }
else if (command.startsWith("admin_unsummon")) else if (command.startsWith("admin_unsummon"))
@@ -760,7 +761,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Usable only with Pets/Summons"); BuilderUtil.sendSysMessage(activeChar, "Usable only with Pets/Summons");
} }
} }
else if (command.startsWith("admin_summon_setlvl")) else if (command.startsWith("admin_summon_setlvl"))
@@ -791,7 +792,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Usable only with Pets"); BuilderUtil.sendSysMessage(activeChar, "Usable only with Pets");
} }
} }
else if (command.startsWith("admin_show_pet_inv")) else if (command.startsWith("admin_show_pet_inv"))
@@ -814,7 +815,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Usable only with Pets"); BuilderUtil.sendSysMessage(activeChar, "Usable only with Pets");
} }
} }
@@ -843,7 +844,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Not in party."); BuilderUtil.sendSysMessage(activeChar, "Not in party.");
} }
} }
else else
@@ -869,7 +870,7 @@ public class AdminEditChar implements IAdminCommandHandler
player.setNoble(!player.isNoble()); player.setNoble(!player.isNoble());
if (player.getObjectId() != activeChar.getObjectId()) if (player.getObjectId() != activeChar.getObjectId())
{ {
activeChar.sendMessage("You've changed nobless status of: " + player.getName()); BuilderUtil.sendSysMessage(activeChar, "You've changed nobless status of: " + player.getName());
} }
player.broadcastUserInfo(); player.broadcastUserInfo();
player.sendMessage("GM changed your nobless status!"); player.sendMessage("GM changed your nobless status!");
@@ -890,7 +891,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //set_hp 1000"); BuilderUtil.sendSysMessage(activeChar, "Usage: //set_hp 1000");
} }
} }
else if (command.startsWith("admin_set_mp")) else if (command.startsWith("admin_set_mp"))
@@ -908,7 +909,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //set_mp 1000"); BuilderUtil.sendSysMessage(activeChar, "Usage: //set_mp 1000");
} }
} }
else if (command.startsWith("admin_set_cp")) else if (command.startsWith("admin_set_cp"))
@@ -926,7 +927,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //set_cp 1000"); BuilderUtil.sendSysMessage(activeChar, "Usage: //set_cp 1000");
} }
} }
else if (command.startsWith("admin_set_pvp_flag")) else if (command.startsWith("admin_set_pvp_flag"))
@@ -944,7 +945,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //set_pvp_flag"); BuilderUtil.sendSysMessage(activeChar, "Usage: //set_pvp_flag");
} }
} }
else if (command.startsWith("admin_setparam")) else if (command.startsWith("admin_setparam"))
@@ -959,13 +960,13 @@ public class AdminEditChar implements IAdminCommandHandler
st.nextToken(); // admin_setparam st.nextToken(); // admin_setparam
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //setparam <stat> <value>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //setparam <stat> <value>");
return false; return false;
} }
final String statName = st.nextToken(); final String statName = st.nextToken();
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //setparam <stat> <value>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //setparam <stat> <value>");
return false; return false;
} }
@@ -982,7 +983,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
if (stat == null) if (stat == null)
{ {
activeChar.sendMessage("Couldn't find such stat!"); BuilderUtil.sendSysMessage(activeChar, "Couldn't find such stat!");
return false; return false;
} }
@@ -992,16 +993,16 @@ public class AdminEditChar implements IAdminCommandHandler
{ {
targetCreature.getStat().addFixedValue(stat, value); targetCreature.getStat().addFixedValue(stat, value);
targetCreature.getStat().recalculateStats(true); targetCreature.getStat().recalculateStats(true);
activeChar.sendMessage("Fixed stat: " + stat + " has been set to " + value); BuilderUtil.sendSysMessage(activeChar, "Fixed stat: " + stat + " has been set to " + value);
} }
else else
{ {
activeChar.sendMessage("Non negative values are only allowed!"); BuilderUtil.sendSysMessage(activeChar, "Non negative values are only allowed!");
} }
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Syntax: //setparam <stat> <value>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //setparam <stat> <value>");
return false; return false;
} }
} }
@@ -1017,7 +1018,7 @@ public class AdminEditChar implements IAdminCommandHandler
st.nextToken(); // admin_setparam st.nextToken(); // admin_setparam
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //unsetparam <stat>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //unsetparam <stat>");
return false; return false;
} }
final String statName = st.nextToken(); final String statName = st.nextToken();
@@ -1033,14 +1034,14 @@ public class AdminEditChar implements IAdminCommandHandler
} }
if (stat == null) if (stat == null)
{ {
activeChar.sendMessage("Couldn't find such stat!"); BuilderUtil.sendSysMessage(activeChar, "Couldn't find such stat!");
return false; return false;
} }
final L2Character targetCreature = (L2Character) target; final L2Character targetCreature = (L2Character) target;
targetCreature.getStat().removeFixedValue(stat); targetCreature.getStat().removeFixedValue(stat);
targetCreature.getStat().recalculateStats(true); targetCreature.getStat().recalculateStats(true);
activeChar.sendMessage("Fixed stat: " + stat + " has been removed."); BuilderUtil.sendSysMessage(activeChar, "Fixed stat: " + stat + " has been removed.");
} }
return true; return true;
} }
@@ -1113,18 +1114,18 @@ public class AdminEditChar implements IAdminCommandHandler
if (player == null) if (player == null)
{ {
activeChar.sendMessage("Player is null."); BuilderUtil.sendSysMessage(activeChar, "Player is null.");
return; return;
} }
final L2GameClient client = player.getClient(); final L2GameClient client = player.getClient();
if (client == null) if (client == null)
{ {
activeChar.sendMessage("Client is null."); BuilderUtil.sendSysMessage(activeChar, "Client is null.");
} }
else if (client.isDetached()) else if (client.isDetached())
{ {
activeChar.sendMessage("Client is detached."); BuilderUtil.sendSysMessage(activeChar, "Client is detached.");
} }
else else
{ {
@@ -1202,7 +1203,7 @@ public class AdminEditChar implements IAdminCommandHandler
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOUR_REPUTATION_HAS_BEEN_CHANGED_TO_S1); final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOUR_REPUTATION_HAS_BEEN_CHANGED_TO_S1);
sm.addInt(newReputation); sm.addInt(newReputation);
player.sendPacket(sm); player.sendPacket(sm);
activeChar.sendMessage("Successfully Changed karma for " + player.getName() + " from (" + oldReputation + ") to (" + newReputation + ")."); BuilderUtil.sendSysMessage(activeChar, "Successfully Changed karma for " + player.getName() + " from (" + oldReputation + ") to (" + newReputation + ").");
} }
private void editCharacter(L2PcInstance activeChar, String targetName) private void editCharacter(L2PcInstance activeChar, String targetName)

View File

@@ -183,7 +183,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //earthquake <intensity> <duration>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //earthquake <intensity> <duration>");
} }
} }
else if (command.startsWith("admin_atmosphere")) else if (command.startsWith("admin_atmosphere"))
@@ -197,7 +197,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (Exception ex) catch (Exception ex)
{ {
activeChar.sendMessage("Usage: //atmosphere <signsky dawn|dusk>|<sky day|night|red> <duration>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //atmosphere <signsky dawn|dusk>|<sky day|night|red> <duration>");
} }
} }
else if (command.equals("admin_play_sounds")) else if (command.equals("admin_play_sounds"))
@@ -212,7 +212,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Usage: //play_sounds <pagenumber>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //play_sounds <pagenumber>");
} }
} }
else if (command.startsWith("admin_play_sound")) else if (command.startsWith("admin_play_sound"))
@@ -223,7 +223,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Usage: //play_sound <soundname>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //play_sound <soundname>");
} }
} }
else if (command.equals("admin_para_all")) else if (command.equals("admin_para_all"))
@@ -359,7 +359,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //polyself <npcId>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //polyself <npcId>");
} }
} }
else if (command.startsWith("admin_unpolyself")) else if (command.startsWith("admin_unpolyself"))
@@ -391,7 +391,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //setteam_close <none|blue|red> [radius]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setteam_close <none|blue|red> [radius]");
} }
} }
else if (command.startsWith("admin_setteam")) else if (command.startsWith("admin_setteam"))
@@ -412,7 +412,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //setteam <none|blue|red>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setteam <none|blue|red>");
} }
} }
else if (command.startsWith("admin_social")) else if (command.startsWith("admin_social"))
@@ -445,7 +445,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (NumberFormatException nbe) catch (NumberFormatException nbe)
{ {
activeChar.sendMessage("Incorrect parameter"); BuilderUtil.sendSysMessage(activeChar, "Incorrect parameter");
} }
} }
} }
@@ -469,7 +469,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
else if (!command.contains("menu")) else if (!command.contains("menu"))
{ {
activeChar.sendMessage("Usage: //social <social_id> [player_name|radius]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //social <social_id> [player_name|radius]");
} }
} }
catch (Exception e) catch (Exception e)
@@ -512,7 +512,7 @@ public class AdminEffects implements IAdminCommandHandler
if (radius > 0) if (radius > 0)
{ {
L2World.getInstance().forEachVisibleObjectInRange(activeChar, L2Object.class, radius, object -> performAbnormalVisualEffect(ave, object)); L2World.getInstance().forEachVisibleObjectInRange(activeChar, L2Object.class, radius, object -> performAbnormalVisualEffect(ave, object));
activeChar.sendMessage("Affected all characters in radius " + param2 + " by " + param1 + " abnormal visual effect."); BuilderUtil.sendSysMessage(activeChar, "Affected all characters in radius " + param2 + " by " + param1 + " abnormal visual effect.");
} }
else else
{ {
@@ -538,7 +538,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (NumberFormatException nfe) catch (NumberFormatException nfe)
{ {
activeChar.sendMessage("Incorrect page."); BuilderUtil.sendSysMessage(activeChar, "Incorrect page.");
} }
} }
@@ -561,7 +561,7 @@ public class AdminEffects implements IAdminCommandHandler
html.replace("%abnormals%", result.getBodyTemplate().toString()); html.replace("%abnormals%", result.getBodyTemplate().toString());
activeChar.sendPacket(html); activeChar.sendPacket(html);
activeChar.sendMessage("Usage: //" + command.replace("admin_", "") + " <AbnormalVisualEffect> [radius]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //" + command.replace("admin_", "") + " <AbnormalVisualEffect> [radius]");
return true; return true;
} }
} }
@@ -598,7 +598,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //effect skill [level | level hittime]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //effect skill [level | level hittime]");
} }
} }
else if (command.startsWith("admin_set_displayeffect")) else if (command.startsWith("admin_set_displayeffect"))
@@ -618,7 +618,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //set_displayeffect <id>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //set_displayeffect <id>");
} }
} }
else if (command.startsWith("admin_playmovie")) else if (command.startsWith("admin_playmovie"))
@@ -629,7 +629,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //playmovie <id>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //playmovie <id>");
} }
} }
else if (command.startsWith("admin_event_trigger")) else if (command.startsWith("admin_event_trigger"))
@@ -643,7 +643,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //event_trigger id [true | false]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //event_trigger id [true | false]");
} }
} }
else if (command.startsWith("admin_settargetable")) else if (command.startsWith("admin_settargetable"))
@@ -750,7 +750,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Usage: //atmosphere <signsky dawn|dusk>|<sky day|night|red> <duration>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //atmosphere <signsky dawn|dusk>|<sky day|night|red> <duration>");
} }
if (packet != null) if (packet != null)
{ {
@@ -763,7 +763,7 @@ public class AdminEffects implements IAdminCommandHandler
final PlaySound _snd = new PlaySound(1, sound, 0, 0, 0, 0, 0); final PlaySound _snd = new PlaySound(1, sound, 0, 0, 0, 0, 0);
activeChar.sendPacket(_snd); activeChar.sendPacket(_snd);
activeChar.broadcastPacket(_snd); activeChar.broadcastPacket(_snd);
activeChar.sendMessage("Playing " + sound + "."); BuilderUtil.sendSysMessage(activeChar, "Playing " + sound + ".");
} }
@Override @Override

View File

@@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.items.enchant.attribute.AttributeHolder;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - delete = deletes target * This class handles following admin commands: - delete = deletes target
@@ -87,7 +88,7 @@ public class AdminElement implements IAdminCommandHandler
final int value = Integer.parseInt(args[2]); final int value = Integer.parseInt(args[2]);
if ((type == null) || (value < 0) || (value > 450)) if ((type == null) || (value < 0) || (value > 450))
{ {
activeChar.sendMessage("Usage: //setlh/setlc/setlg/setlb/setll/setlw/setls <element> <value>[0-450]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setlh/setlc/setlg/setlb/setll/setlw/setls <element> <value>[0-450]");
return false; return false;
} }
@@ -95,7 +96,7 @@ public class AdminElement implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //setlh/setlc/setlg/setlb/setll/setlw/setls <element>[0-5] <value>[0-450]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setlh/setlc/setlg/setlb/setll/setlw/setls <element>[0-5] <value>[0-450]");
return false; return false;
} }
} }
@@ -181,7 +182,7 @@ public class AdminElement implements IAdminCommandHandler
player.sendInventoryUpdate(iu); player.sendInventoryUpdate(iu);
// informations // informations
activeChar.sendMessage("Changed elemental power of " + player.getName() + "'s " + itemInstance.getItem().getName() + " from " + old + " to " + current + "."); BuilderUtil.sendSysMessage(activeChar, "Changed elemental power of " + player.getName() + "'s " + itemInstance.getItem().getName() + " from " + old + " to " + current + ".");
if (player != activeChar) if (player != activeChar)
{ {
player.sendMessage(activeChar.getName() + " has changed the elemental power of your " + itemInstance.getItem().getName() + " from " + old + " to " + current + "."); player.sendMessage(activeChar.getName() + " has changed the elemental power of your " + itemInstance.getItem().getName() + " from " + old + " to " + current + ".");

View File

@@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - enchant_armor * This class handles following admin commands: - enchant_armor
@@ -135,7 +136,7 @@ public class AdminEnchant implements IAdminCommandHandler
// check value // check value
if ((ench < 0) || (ench > 127)) if ((ench < 0) || (ench > 127))
{ {
activeChar.sendMessage("You must set the enchant level to be between 0-127."); BuilderUtil.sendSysMessage(activeChar, "You must set the enchant level to be between 0-127.");
} }
else else
{ {
@@ -148,7 +149,7 @@ public class AdminEnchant implements IAdminCommandHandler
{ {
LOGGER.warning("Set enchant error: " + e); LOGGER.warning("Set enchant error: " + e);
} }
activeChar.sendMessage("Please specify a new enchant value."); BuilderUtil.sendSysMessage(activeChar, "Please specify a new enchant value.");
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
@@ -156,7 +157,7 @@ public class AdminEnchant implements IAdminCommandHandler
{ {
LOGGER.warning("Set enchant error: " + e); LOGGER.warning("Set enchant error: " + e);
} }
activeChar.sendMessage("Please specify a valid new enchant value."); BuilderUtil.sendSysMessage(activeChar, "Please specify a valid new enchant value.");
} }
} }
@@ -204,7 +205,7 @@ public class AdminEnchant implements IAdminCommandHandler
player.broadcastUserInfo(); player.broadcastUserInfo();
// informations // informations
activeChar.sendMessage("Changed enchantment of " + player.getName() + "'s " + itemInstance.getItem().getName() + " from " + curEnchant + " to " + ench + "."); BuilderUtil.sendSysMessage(activeChar, "Changed enchantment of " + player.getName() + "'s " + itemInstance.getItem().getName() + " from " + curEnchant + " to " + ench + ".");
player.sendMessage("Admin has changed the enchantment of your " + itemInstance.getItem().getName() + " from " + curEnchant + " to " + ench + "."); player.sendMessage("Admin has changed the enchantment of your " + itemInstance.getItem().getName() + " from " + curEnchant + " to " + ench + ".");
} }
} }

View File

@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.quest.Event; import com.l2jmobius.gameserver.model.quest.Event;
import com.l2jmobius.gameserver.model.quest.Quest; import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
public class AdminEvents implements IAdminCommandHandler public class AdminEvents implements IAdminCommandHandler
{ {
@@ -80,18 +81,18 @@ public class AdminEvents implements IAdminCommandHandler
{ {
if (event.eventStart(activeChar)) if (event.eventStart(activeChar))
{ {
activeChar.sendMessage("Event " + event_name + " started."); BuilderUtil.sendSysMessage(activeChar, "Event " + event_name + " started.");
return true; return true;
} }
activeChar.sendMessage("There is problem starting " + event_name + " event."); BuilderUtil.sendSysMessage(activeChar, "There is problem starting " + event_name + " event.");
return true; return true;
} }
} }
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //event_start <eventname>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //event_start <eventname>");
e.printStackTrace(); e.printStackTrace();
return false; return false;
} }
@@ -107,18 +108,18 @@ public class AdminEvents implements IAdminCommandHandler
{ {
if (event.eventStop()) if (event.eventStop())
{ {
activeChar.sendMessage("Event " + event_name + " stopped."); BuilderUtil.sendSysMessage(activeChar, "Event " + event_name + " stopped.");
return true; return true;
} }
activeChar.sendMessage("There is problem with stoping " + event_name + " event."); BuilderUtil.sendSysMessage(activeChar, "There is problem with stoping " + event_name + " event.");
return true; return true;
} }
} }
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //event_start <eventname>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //event_start <eventname>");
e.printStackTrace(); e.printStackTrace();
return false; return false;
} }
@@ -138,7 +139,7 @@ public class AdminEvents implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //event_bypass <eventname> <bypass>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //event_bypass <eventname> <bypass>");
e.printStackTrace(); e.printStackTrace();
return false; return false;
} }

View File

@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: * This class handles following admin commands:
@@ -51,12 +52,12 @@ public class AdminExpSp implements IAdminCommandHandler
final String val = command.substring(16); final String val = command.substring(16);
if (!adminAddExpSp(activeChar, val)) if (!adminAddExpSp(activeChar, val))
{ {
activeChar.sendMessage("Usage: //add_exp_sp exp sp"); BuilderUtil.sendSysMessage(activeChar, "Usage: //add_exp_sp exp sp");
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ // Case of missing parameter { // Case of missing parameter
activeChar.sendMessage("Usage: //add_exp_sp exp sp"); BuilderUtil.sendSysMessage(activeChar, "Usage: //add_exp_sp exp sp");
} }
} }
else if (command.startsWith("admin_remove_exp_sp")) else if (command.startsWith("admin_remove_exp_sp"))
@@ -66,12 +67,12 @@ public class AdminExpSp implements IAdminCommandHandler
final String val = command.substring(19); final String val = command.substring(19);
if (!adminRemoveExpSP(activeChar, val)) if (!adminRemoveExpSP(activeChar, val))
{ {
activeChar.sendMessage("Usage: //remove_exp_sp exp sp"); BuilderUtil.sendSysMessage(activeChar, "Usage: //remove_exp_sp exp sp");
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ // Case of missing parameter { // Case of missing parameter
activeChar.sendMessage("Usage: //remove_exp_sp exp sp"); BuilderUtil.sendSysMessage(activeChar, "Usage: //remove_exp_sp exp sp");
} }
} }
addExpSp(activeChar); addExpSp(activeChar);
@@ -145,7 +146,7 @@ public class AdminExpSp implements IAdminCommandHandler
player.sendMessage("Admin is adding you " + expval + " xp and " + spval + " sp."); player.sendMessage("Admin is adding you " + expval + " xp and " + spval + " sp.");
player.addExpAndSp(expval, spval); player.addExpAndSp(expval, spval);
// Admin information // Admin information
activeChar.sendMessage("Added " + expval + " xp and " + spval + " sp to " + player.getName() + "."); BuilderUtil.sendSysMessage(activeChar, "Added " + expval + " xp and " + spval + " sp to " + player.getName() + ".");
} }
return true; return true;
} }
@@ -188,7 +189,7 @@ public class AdminExpSp implements IAdminCommandHandler
player.sendMessage("Admin is removing you " + expval + " xp and " + spval + " sp."); player.sendMessage("Admin is removing you " + expval + " xp and " + spval + " sp.");
player.removeExpAndSp(expval, spval); player.removeExpAndSp(expval, spval);
// Admin information // Admin information
activeChar.sendMessage("Removed " + expval + " xp and " + spval + " sp from " + player.getName() + "."); BuilderUtil.sendSysMessage(activeChar, "Removed " + expval + " xp and " + spval + " sp from " + player.getName() + ".");
} }
return true; return true;
} }

View File

@@ -21,6 +21,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.instancemanager.FakePlayerChatManager; import com.l2jmobius.gameserver.instancemanager.FakePlayerChatManager;
import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* @author Mobius * @author Mobius
@@ -40,19 +41,19 @@ public class AdminFakePlayers implements IAdminCommandHandler
final String[] words = command.substring(15).split(" "); final String[] words = command.substring(15).split(" ");
if (words.length < 3) if (words.length < 3)
{ {
activeChar.sendMessage("Usage: //fakechat playername fpcname message"); BuilderUtil.sendSysMessage(activeChar, "Usage: //fakechat playername fpcname message");
return false; return false;
} }
final L2PcInstance player = L2World.getInstance().getPlayer(words[0]); final L2PcInstance player = L2World.getInstance().getPlayer(words[0]);
if (player == null) if (player == null)
{ {
activeChar.sendMessage("Player not found."); BuilderUtil.sendSysMessage(activeChar, "Player not found.");
return false; return false;
} }
final String fpcName = FakePlayerData.getInstance().getProperName(words[1]); final String fpcName = FakePlayerData.getInstance().getProperName(words[1]);
if (fpcName == null) if (fpcName == null)
{ {
activeChar.sendMessage("Fake player not found."); BuilderUtil.sendSysMessage(activeChar, "Fake player not found.");
return false; return false;
} }
String message = ""; String message = "";
@@ -65,7 +66,7 @@ public class AdminFakePlayers implements IAdminCommandHandler
message += (words[i] + " "); message += (words[i] + " ");
} }
FakePlayerChatManager.getInstance().sendChat(player, fpcName, message); FakePlayerChatManager.getInstance().sendChat(player, fpcName, message);
activeChar.sendMessage("Your message has been sent."); BuilderUtil.sendSysMessage(activeChar, "Your message has been sent.");
} }
return true; return true;
} }

View File

@@ -28,6 +28,7 @@ import com.l2jmobius.gameserver.model.entity.Fort;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles all siege commands: Todo: change the class name, and neaten it up * This class handles all siege commands: Todo: change the class name, and neaten it up
@@ -103,7 +104,7 @@ public class AdminFortSiege implements IAdminCommandHandler
} }
else if (command.equalsIgnoreCase("admin_list_fortsiege_clans")) else if (command.equalsIgnoreCase("admin_list_fortsiege_clans"))
{ {
activeChar.sendMessage("Not implemented yet."); BuilderUtil.sendSysMessage(activeChar, "Not implemented yet.");
} }
else if (command.equalsIgnoreCase("admin_setfort")) else if (command.equalsIgnoreCase("admin_setfort"))
{ {
@@ -125,7 +126,7 @@ public class AdminFortSiege implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Unable to remove fort"); BuilderUtil.sendSysMessage(activeChar, "Unable to remove fort");
} }
} }
else if (command.equalsIgnoreCase("admin_spawn_fortdoors")) else if (command.equalsIgnoreCase("admin_spawn_fortdoors"))

View File

@@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.GeoUtils; import com.l2jmobius.gameserver.util.GeoUtils;
/** /**
@@ -59,11 +60,11 @@ public class AdminGeodata implements IAdminCommandHandler
if (GeoEngine.getInstance().hasGeoPos(geoX, geoY)) if (GeoEngine.getInstance().hasGeoPos(geoX, geoY))
{ {
activeChar.sendMessage("WorldX: " + worldX + ", WorldY: " + worldY + ", WorldZ: " + worldZ + ", GeoX: " + geoX + ", GeoY: " + geoY + ", GeoZ: " + GeoEngine.getInstance().getHeight(worldX, worldY, worldZ)); BuilderUtil.sendSysMessage(activeChar, "WorldX: " + worldX + ", WorldY: " + worldY + ", WorldZ: " + worldZ + ", GeoX: " + geoX + ", GeoY: " + geoY + ", GeoZ: " + GeoEngine.getInstance().getHeight(worldX, worldY, worldZ));
} }
else else
{ {
activeChar.sendMessage("There is no geodata at this position."); BuilderUtil.sendSysMessage(activeChar, "There is no geodata at this position.");
} }
break; break;
} }
@@ -77,11 +78,11 @@ public class AdminGeodata implements IAdminCommandHandler
if (GeoEngine.getInstance().hasGeoPos(geoX, geoY)) if (GeoEngine.getInstance().hasGeoPos(geoX, geoY))
{ {
activeChar.sendMessage("WorldX: " + worldX + ", WorldY: " + worldY + ", WorldZ: " + worldZ + ", GeoX: " + geoX + ", GeoY: " + geoY + ", GeoZ: " + GeoEngine.getInstance().getHeight(worldX, worldY, worldZ)); BuilderUtil.sendSysMessage(activeChar, "WorldX: " + worldX + ", WorldY: " + worldY + ", WorldZ: " + worldZ + ", GeoX: " + geoX + ", GeoY: " + geoY + ", GeoZ: " + GeoEngine.getInstance().getHeight(worldX, worldY, worldZ));
} }
else else
{ {
activeChar.sendMessage("There is no geodata at this position."); BuilderUtil.sendSysMessage(activeChar, "There is no geodata at this position.");
} }
break; break;
} }
@@ -92,11 +93,11 @@ public class AdminGeodata implements IAdminCommandHandler
{ {
if (GeoEngine.getInstance().canSeeTarget(activeChar, target)) if (GeoEngine.getInstance().canSeeTarget(activeChar, target))
{ {
activeChar.sendMessage("Can move beeline."); BuilderUtil.sendSysMessage(activeChar, "Can move beeline.");
} }
else else
{ {
activeChar.sendMessage("Can not move beeline!"); BuilderUtil.sendSysMessage(activeChar, "Can not move beeline!");
} }
} }
else else
@@ -112,7 +113,7 @@ public class AdminGeodata implements IAdminCommandHandler
{ {
if (GeoEngine.getInstance().canSeeTarget(activeChar, target)) if (GeoEngine.getInstance().canSeeTarget(activeChar, target))
{ {
activeChar.sendMessage("Can see target."); BuilderUtil.sendSysMessage(activeChar, "Can see target.");
} }
else else
{ {
@@ -134,7 +135,7 @@ public class AdminGeodata implements IAdminCommandHandler
{ {
final int x = ((activeChar.getX() - L2World.MAP_MIN_X) >> 15) + L2World.TILE_X_MIN; final int x = ((activeChar.getX() - L2World.MAP_MIN_X) >> 15) + L2World.TILE_X_MIN;
final int y = ((activeChar.getY() - L2World.MAP_MIN_Y) >> 15) + L2World.TILE_Y_MIN; final int y = ((activeChar.getY() - L2World.MAP_MIN_Y) >> 15) + L2World.TILE_Y_MIN;
activeChar.sendMessage("GeoMap: " + x + "_" + y + " (" + ((x - L2World.TILE_ZERO_COORD_X) * L2World.TILE_SIZE) + "," + ((y - L2World.TILE_ZERO_COORD_Y) * L2World.TILE_SIZE) + " to " + ((((x - L2World.TILE_ZERO_COORD_X) * L2World.TILE_SIZE) + L2World.TILE_SIZE) - 1) + "," + ((((y - L2World.TILE_ZERO_COORD_Y) * L2World.TILE_SIZE) + L2World.TILE_SIZE) - 1) + ")"); BuilderUtil.sendSysMessage(activeChar, "GeoMap: " + x + "_" + y + " (" + ((x - L2World.TILE_ZERO_COORD_X) * L2World.TILE_SIZE) + "," + ((y - L2World.TILE_ZERO_COORD_Y) * L2World.TILE_SIZE) + " to " + ((((x - L2World.TILE_ZERO_COORD_X) * L2World.TILE_SIZE) + L2World.TILE_SIZE) - 1) + "," + ((((y - L2World.TILE_ZERO_COORD_Y) * L2World.TILE_SIZE) + L2World.TILE_SIZE) - 1) + ")");
break; break;
} }
} }

View File

@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import com.l2jmobius.gameserver.data.xml.impl.AdminData; import com.l2jmobius.gameserver.data.xml.impl.AdminData;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler; import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - gm = turns gm mode off * This class handles following admin commands: - gm = turns gm mode off
@@ -38,7 +39,7 @@ public class AdminGm implements IAdminCommandHandler
{ {
AdminData.getInstance().deleteGm(activeChar); AdminData.getInstance().deleteGm(activeChar);
activeChar.setAccessLevel(0, true, false); activeChar.setAccessLevel(0, true, false);
activeChar.sendMessage("You deactivated your GM access for this session, if you login again you will be GM again, in order to remove your access completely please shift yourself and set your accesslevel to 0."); BuilderUtil.sendSysMessage(activeChar, "You deactivated your GM access for this session, if you login again you will be GM again, in order to remove your access completely please shift yourself and set your accesslevel to 0.");
} }
return true; return true;
} }

View File

@@ -30,6 +30,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.quest.Quest; import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.zone.type.L2NoRestartZone; import com.l2jmobius.gameserver.model.zone.type.L2NoRestartZone;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import ai.bosses.Antharas.Antharas; import ai.bosses.Antharas.Antharas;
import ai.bosses.Baium.Baium; import ai.bosses.Baium.Baium;
@@ -93,12 +94,12 @@ public class AdminGrandBoss implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Wrong ID!"); BuilderUtil.sendSysMessage(activeChar, "Wrong ID!");
} }
} }
else else
{ {
activeChar.sendMessage("Usage: //grandboss_skip Id"); BuilderUtil.sendSysMessage(activeChar, "Usage: //grandboss_skip Id");
} }
break; break;
} }
@@ -124,13 +125,13 @@ public class AdminGrandBoss implements IAdminCommandHandler
} }
default: default:
{ {
activeChar.sendMessage("Wrong ID!"); BuilderUtil.sendSysMessage(activeChar, "Wrong ID!");
} }
} }
} }
else else
{ {
activeChar.sendMessage("Usage: //grandboss_respawn Id"); BuilderUtil.sendSysMessage(activeChar, "Usage: //grandboss_respawn Id");
} }
break; break;
} }
@@ -154,13 +155,13 @@ public class AdminGrandBoss implements IAdminCommandHandler
} }
default: default:
{ {
activeChar.sendMessage("Wrong ID!"); BuilderUtil.sendSysMessage(activeChar, "Wrong ID!");
} }
} }
} }
else else
{ {
activeChar.sendMessage("Usage: //grandboss_minions Id"); BuilderUtil.sendSysMessage(activeChar, "Usage: //grandboss_minions Id");
} }
break; break;
} }
@@ -186,13 +187,13 @@ public class AdminGrandBoss implements IAdminCommandHandler
} }
default: default:
{ {
activeChar.sendMessage("Wrong ID!"); BuilderUtil.sendSysMessage(activeChar, "Wrong ID!");
} }
} }
} }
else else
{ {
activeChar.sendMessage("Usage: //grandboss_abort Id"); BuilderUtil.sendSysMessage(activeChar, "Usage: //grandboss_abort Id");
} }
} }
break; break;
@@ -321,7 +322,7 @@ public class AdminGrandBoss implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Wrong ID!"); BuilderUtil.sendSysMessage(activeChar, "Wrong ID!");
} }
} }

View File

@@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - heal = restores HP/MP/CP on target, name or radius * This class handles following admin commands: - heal = restores HP/MP/CP on target, name or radius
@@ -59,7 +60,7 @@ public class AdminHeal implements IAdminCommandHandler
{ {
LOGGER.warning("Heal error: " + e); LOGGER.warning("Heal error: " + e);
} }
activeChar.sendMessage("Incorrect target/radius specified."); BuilderUtil.sendSysMessage(activeChar, "Incorrect target/radius specified.");
} }
} }
return true; return true;
@@ -102,7 +103,7 @@ public class AdminHeal implements IAdminCommandHandler
} }
}); });
activeChar.sendMessage("Healed within " + radius + " unit radius."); BuilderUtil.sendSysMessage(activeChar, "Healed within " + radius + " unit radius.");
return; return;
} }
catch (NumberFormatException nbe) catch (NumberFormatException nbe)

View File

@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.cache.HtmCache;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler; import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* @author NosBit * @author NosBit
@@ -47,7 +48,7 @@ public class AdminHtml implements IAdminCommandHandler
{ {
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Usage: //html path"); BuilderUtil.sendSysMessage(activeChar, "Usage: //html path");
return false; return false;
} }
@@ -59,7 +60,7 @@ public class AdminHtml implements IAdminCommandHandler
{ {
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Usage: //loadhtml path"); BuilderUtil.sendSysMessage(activeChar, "Usage: //loadhtml path");
return false; return false;
} }

View File

@@ -37,6 +37,7 @@ import com.l2jmobius.gameserver.model.instancezone.Instance;
import com.l2jmobius.gameserver.model.instancezone.InstanceTemplate; import com.l2jmobius.gameserver.model.instancezone.InstanceTemplate;
import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.BypassParser; import com.l2jmobius.gameserver.util.BypassParser;
/** /**
@@ -138,7 +139,7 @@ public final class AdminInstance implements IAdminCommandHandler
} }
default: default:
{ {
activeChar.sendMessage("Wrong enter group usage! Please use those values: Alone, Party or CommandChannel."); BuilderUtil.sendSysMessage(activeChar, "Wrong enter group usage! Please use those values: Alone, Party or CommandChannel.");
return true; return true;
} }
} }
@@ -157,7 +158,7 @@ public final class AdminInstance implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Wrong parameters! Please try again."); BuilderUtil.sendSysMessage(activeChar, "Wrong parameters! Please try again.");
return true; return true;
} }
break; break;
@@ -187,7 +188,7 @@ public final class AdminInstance implements IAdminCommandHandler
if (instance != null) if (instance != null)
{ {
instance.getPlayers().forEach(player -> player.sendPacket(new ExShowScreenMessage("Your instance has been destroyed by Game Master!", 10000))); instance.getPlayers().forEach(player -> player.sendPacket(new ExShowScreenMessage("Your instance has been destroyed by Game Master!", 10000)));
activeChar.sendMessage("You destroyed Instance " + instance.getId() + " with " + instance.getPlayersCount() + " players inside."); BuilderUtil.sendSysMessage(activeChar, "You destroyed Instance " + instance.getId() + " with " + instance.getPlayersCount() + " players inside.");
instance.destroy(); instance.destroy();
sendTemplateDetails(activeChar, instance.getTemplateId()); sendTemplateDetails(activeChar, instance.getTemplateId());
} }

View File

@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.GMAudit; import com.l2jmobius.gameserver.util.GMAudit;
public class AdminInstanceZone implements IAdminCommandHandler public class AdminInstanceZone implements IAdminCommandHandler
@@ -51,15 +52,15 @@ public class AdminInstanceZone implements IAdminCommandHandler
final int instanceId = Integer.parseInt(st.nextToken()); final int instanceId = Integer.parseInt(st.nextToken());
final String name = InstanceManager.getInstance().getInstanceName(instanceId); final String name = InstanceManager.getInstance().getInstanceName(instanceId);
InstanceManager.getInstance().deleteInstanceTime(player, instanceId); InstanceManager.getInstance().deleteInstanceTime(player, instanceId);
activeChar.sendMessage("Instance zone " + name + " cleared for player " + player.getName()); BuilderUtil.sendSysMessage(activeChar, "Instance zone " + name + " cleared for player " + player.getName());
player.sendMessage("Admin cleared instance zone " + name + " for you"); player.sendMessage("Admin cleared instance zone " + name + " for you");
return true; return true;
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Failed clearing instance time: " + e.getMessage()); BuilderUtil.sendSysMessage(activeChar, "Failed clearing instance time: " + e.getMessage());
activeChar.sendMessage("Usage: //instancezone_clear <playername> [instanceId]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //instancezone_clear <playername> [instanceId]");
return false; return false;
} }
} }
@@ -87,8 +88,8 @@ public class AdminInstanceZone implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("The player " + playername + " is not online"); BuilderUtil.sendSysMessage(activeChar, "The player " + playername + " is not online");
activeChar.sendMessage("Usage: //instancezone [playername]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //instancezone [playername]");
return false; return false;
} }
} }

View File

@@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.Disconnection; import com.l2jmobius.gameserver.network.Disconnection;
import com.l2jmobius.gameserver.util.BuilderUtil;
public class AdminKick implements IAdminCommandHandler public class AdminKick implements IAdminCommandHandler
{ {
@@ -45,7 +46,7 @@ public class AdminKick implements IAdminCommandHandler
if (plyr != null) if (plyr != null)
{ {
Disconnection.of(plyr).defaultSequence(false); Disconnection.of(plyr).defaultSequence(false);
activeChar.sendMessage("You kicked " + plyr.getName() + " from the game."); BuilderUtil.sendSysMessage(activeChar, "You kicked " + plyr.getName() + " from the game.");
} }
} }
} }
@@ -60,7 +61,7 @@ public class AdminKick implements IAdminCommandHandler
Disconnection.of(player).defaultSequence(false); Disconnection.of(player).defaultSequence(false);
} }
} }
activeChar.sendMessage("Kicked " + counter + " players."); BuilderUtil.sendSysMessage(activeChar, "Kicked " + counter + " players.");
} }
return true; return true;
} }

View File

@@ -27,6 +27,7 @@ import com.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2ControllableMobInstance; import com.l2jmobius.gameserver.model.actor.instance.L2ControllableMobInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - kill = kills target L2Character - kill_monster = kills target non-player - kill <radius> = If radius is specified, then ALL players only in that radius will be killed. - kill_monster <radius> = If radius is specified, then ALL non-players only in * This class handles following admin commands: - kill = kills target L2Character - kill_monster = kills target non-player - kill <radius> = If radius is specified, then ALL players only in that radius will be killed. - kill_monster <radius> = If radius is specified, then ALL non-players only in
@@ -70,12 +71,12 @@ public class AdminKill implements IAdminCommandHandler
kill(activeChar, knownChar); kill(activeChar, knownChar);
}); });
activeChar.sendMessage("Killed all characters within a " + radius + " unit radius."); BuilderUtil.sendSysMessage(activeChar, "Killed all characters within a " + radius + " unit radius.");
return true; return true;
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
activeChar.sendMessage("Invalid radius."); BuilderUtil.sendSysMessage(activeChar, "Invalid radius.");
return false; return false;
} }
} }
@@ -96,12 +97,12 @@ public class AdminKill implements IAdminCommandHandler
kill(activeChar, wo); kill(activeChar, wo);
}); });
activeChar.sendMessage("Killed all characters within a " + radius + " unit radius."); BuilderUtil.sendSysMessage(activeChar, "Killed all characters within a " + radius + " unit radius.");
return true; return true;
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
activeChar.sendMessage("Usage: //kill <player_name | radius>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //kill <player_name | radius>");
return false; return false;
} }
} }

View File

@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Playable; import com.l2jmobius.gameserver.model.actor.L2Playable;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
public class AdminLevel implements IAdminCommandHandler public class AdminLevel implements IAdminCommandHandler
{ {
@@ -57,7 +58,7 @@ public class AdminLevel implements IAdminCommandHandler
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
activeChar.sendMessage("Wrong Number Format"); BuilderUtil.sendSysMessage(activeChar, "Wrong Number Format");
} }
} }
else if (actualCommand.equalsIgnoreCase("admin_set_level")) else if (actualCommand.equalsIgnoreCase("admin_set_level"))
@@ -83,13 +84,13 @@ public class AdminLevel implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("You must specify level between 1 and " + maxLevel + "."); BuilderUtil.sendSysMessage(activeChar, "You must specify level between 1 and " + maxLevel + ".");
return false; return false;
} }
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
activeChar.sendMessage("You must specify level between 1 and " + maxLevel + "."); BuilderUtil.sendSysMessage(activeChar, "You must specify level between 1 and " + maxLevel + ".");
return false; return false;
} }
} }

View File

@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.loginserverpackets.game.ServerStatus; import com.l2jmobius.gameserver.network.loginserverpackets.game.ServerStatus;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles the admin commands that acts on the login * This class handles the admin commands that acts on the login
@@ -47,13 +48,13 @@ public class AdminLogin implements IAdminCommandHandler
if (command.equals("admin_server_gm_only")) if (command.equals("admin_server_gm_only"))
{ {
gmOnly(); gmOnly();
activeChar.sendMessage("Server is now GM only"); BuilderUtil.sendSysMessage(activeChar, "Server is now GM only");
showMainPage(activeChar); showMainPage(activeChar);
} }
else if (command.equals("admin_server_all")) else if (command.equals("admin_server_all"))
{ {
allowToAll(); allowToAll();
activeChar.sendMessage("Server is not GM only anymore"); BuilderUtil.sendSysMessage(activeChar, "Server is not GM only anymore");
showMainPage(activeChar); showMainPage(activeChar);
} }
else if (command.startsWith("admin_server_max_player")) else if (command.startsWith("admin_server_max_player"))
@@ -66,17 +67,17 @@ public class AdminLogin implements IAdminCommandHandler
try try
{ {
LoginServerThread.getInstance().setMaxPlayer(Integer.parseInt(number)); LoginServerThread.getInstance().setMaxPlayer(Integer.parseInt(number));
activeChar.sendMessage("maxPlayer set to " + number); BuilderUtil.sendSysMessage(activeChar, "maxPlayer set to " + number);
showMainPage(activeChar); showMainPage(activeChar);
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
activeChar.sendMessage("Max players must be a number."); BuilderUtil.sendSysMessage(activeChar, "Max players must be a number.");
} }
} }
else else
{ {
activeChar.sendMessage("Format is server_max_player <max>"); BuilderUtil.sendSysMessage(activeChar, "Format is server_max_player <max>");
} }
} }
else if (command.startsWith("admin_server_list_type")) else if (command.startsWith("admin_server_list_type"))
@@ -105,18 +106,18 @@ public class AdminLogin implements IAdminCommandHandler
{ {
Config.SERVER_LIST_TYPE = newType; Config.SERVER_LIST_TYPE = newType;
LoginServerThread.getInstance().sendServerType(); LoginServerThread.getInstance().sendServerType();
activeChar.sendMessage("Server Type changed to " + getServerTypeName(newType)); BuilderUtil.sendSysMessage(activeChar, "Server Type changed to " + getServerTypeName(newType));
showMainPage(activeChar); showMainPage(activeChar);
} }
else else
{ {
activeChar.sendMessage("Server Type is already " + getServerTypeName(newType)); BuilderUtil.sendSysMessage(activeChar, "Server Type is already " + getServerTypeName(newType));
showMainPage(activeChar); showMainPage(activeChar);
} }
} }
else else
{ {
activeChar.sendMessage("Format is server_list_type <normal/relax/test/nolabel/restricted/event/free>"); BuilderUtil.sendSysMessage(activeChar, "Format is server_list_type <normal/relax/test/nolabel/restricted/event/free>");
} }
} }
else if (command.startsWith("admin_server_list_age")) else if (command.startsWith("admin_server_list_age"))
@@ -134,23 +135,23 @@ public class AdminLogin implements IAdminCommandHandler
{ {
Config.SERVER_LIST_TYPE = age; Config.SERVER_LIST_TYPE = age;
LoginServerThread.getInstance().sendServerStatus(ServerStatus.SERVER_AGE, age); LoginServerThread.getInstance().sendServerStatus(ServerStatus.SERVER_AGE, age);
activeChar.sendMessage("Server Age changed to " + age); BuilderUtil.sendSysMessage(activeChar, "Server Age changed to " + age);
showMainPage(activeChar); showMainPage(activeChar);
} }
else else
{ {
activeChar.sendMessage("Server Age is already " + age); BuilderUtil.sendSysMessage(activeChar, "Server Age is already " + age);
showMainPage(activeChar); showMainPage(activeChar);
} }
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
activeChar.sendMessage("Age must be a number"); BuilderUtil.sendSysMessage(activeChar, "Age must be a number");
} }
} }
else else
{ {
activeChar.sendMessage("Format is server_list_age <number>"); BuilderUtil.sendSysMessage(activeChar, "Format is server_list_age <number>");
} }
} }
else if (command.equals("admin_server_login")) else if (command.equals("admin_server_login"))

View File

@@ -31,6 +31,7 @@ import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.Disconnection; import com.l2jmobius.gameserver.network.Disconnection;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - handles every admin menu command * This class handles following admin commands: - handles every admin menu command
@@ -100,7 +101,7 @@ public class AdminMenu implements IAdminCommandHandler
} }
if (!player.isInParty()) if (!player.isInParty())
{ {
activeChar.sendMessage("Player is not in party."); BuilderUtil.sendSysMessage(activeChar, "Player is not in party.");
teleportCharacter(player, activeChar.getLocation(), activeChar, "Admin is teleporting you."); teleportCharacter(player, activeChar.getLocation(), activeChar, "Admin is teleporting you.");
return true; return true;
} }
@@ -128,7 +129,7 @@ public class AdminMenu implements IAdminCommandHandler
final L2Clan clan = player.getClan(); final L2Clan clan = player.getClan();
if (clan == null) if (clan == null)
{ {
activeChar.sendMessage("Player is not in a clan."); BuilderUtil.sendSysMessage(activeChar, "Player is not in a clan.");
teleportCharacter(player, activeChar.getLocation(), activeChar, "Admin is teleporting you."); teleportCharacter(player, activeChar.getLocation(), activeChar, "Admin is teleporting you.");
return true; return true;
} }
@@ -225,7 +226,7 @@ public class AdminMenu implements IAdminCommandHandler
if (plyr != null) if (plyr != null)
{ {
target = plyr; target = plyr;
activeChar.sendMessage("You killed " + plyr.getName()); BuilderUtil.sendSysMessage(activeChar, "You killed " + plyr.getName());
} }
} }
if (target != null) if (target != null)
@@ -277,7 +278,7 @@ public class AdminMenu implements IAdminCommandHandler
else else
{ {
activeChar.teleToLocation(player.getLocation(), true, player.getInstanceWorld()); activeChar.teleToLocation(player.getLocation(), true, player.getInstanceWorld());
activeChar.sendMessage("You're teleporting yourself to character " + player.getName()); BuilderUtil.sendSysMessage(activeChar, "You're teleporting yourself to character " + player.getName());
} }
showMainPage(activeChar); showMainPage(activeChar);
} }

View File

@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler; import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
/** /**
@@ -47,7 +48,7 @@ public class AdminMessages implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Command format: //msg <SYSTEM_MSG_ID>"); BuilderUtil.sendSysMessage(activeChar, "Command format: //msg <SYSTEM_MSG_ID>");
} }
} }
else if (command.startsWith("admin_msgx ")) else if (command.startsWith("admin_msgx "))
@@ -55,7 +56,7 @@ public class AdminMessages implements IAdminCommandHandler
final String[] tokens = command.split(" "); final String[] tokens = command.split(" ");
if ((tokens.length <= 2) || !Util.isDigit(tokens[1])) if ((tokens.length <= 2) || !Util.isDigit(tokens[1]))
{ {
activeChar.sendMessage("Command format: //msgx <SYSTEM_MSG_ID> [item:Id] [skill:Id] [npc:Id] [zone:x,y,x] [castle:Id] [str:'text']"); BuilderUtil.sendSysMessage(activeChar, "Command format: //msgx <SYSTEM_MSG_ID> [item:Id] [skill:Id] [npc:Id] [zone:x,y,x] [castle:Id] [str:'text']");
return false; return false;
} }
@@ -99,7 +100,7 @@ public class AdminMessages implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Exception: " + e.getMessage()); BuilderUtil.sendSysMessage(activeChar, "Exception: " + e.getMessage());
continue; continue;
} }
} }

View File

@@ -28,6 +28,7 @@ import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.events.EventType; import com.l2jmobius.gameserver.model.events.EventType;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* @author Mobius * @author Mobius
@@ -55,7 +56,7 @@ public class AdminMissingHtmls implements IAdminCommandHandler
final int topLeftY = (y - L2World.TILE_ZERO_COORD_Y) * L2World.TILE_SIZE; final int topLeftY = (y - L2World.TILE_ZERO_COORD_Y) * L2World.TILE_SIZE;
final int bottomRightX = (((x - L2World.TILE_ZERO_COORD_X) * L2World.TILE_SIZE) + L2World.TILE_SIZE) - 1; final int bottomRightX = (((x - L2World.TILE_ZERO_COORD_X) * L2World.TILE_SIZE) + L2World.TILE_SIZE) - 1;
final int bottomRightY = (((y - L2World.TILE_ZERO_COORD_Y) * L2World.TILE_SIZE) + L2World.TILE_SIZE) - 1; final int bottomRightY = (((y - L2World.TILE_ZERO_COORD_Y) * L2World.TILE_SIZE) + L2World.TILE_SIZE) - 1;
activeChar.sendMessage("GeoMap: " + x + "_" + y + " (" + topLeftX + "," + topLeftY + " to " + bottomRightX + "," + bottomRightY + ")"); BuilderUtil.sendSysMessage(activeChar, "GeoMap: " + x + "_" + y + " (" + topLeftX + "," + topLeftY + " to " + bottomRightX + "," + bottomRightY + ")");
final List<Integer> results = new ArrayList<>(); final List<Integer> results = new ArrayList<>();
for (L2Object obj : L2World.getInstance().getVisibleObjects()) for (L2Object obj : L2World.getInstance().getVisibleObjects())
{ {
@@ -75,14 +76,14 @@ public class AdminMissingHtmls implements IAdminCommandHandler
Collections.sort(results); Collections.sort(results);
for (int id : results) for (int id : results)
{ {
activeChar.sendMessage("NPC " + id + " does not have a default html."); BuilderUtil.sendSysMessage(activeChar, "NPC " + id + " does not have a default html.");
} }
activeChar.sendMessage("Found " + results.size() + " results."); BuilderUtil.sendSysMessage(activeChar, "Found " + results.size() + " results.");
break; break;
} }
case "admin_world_missing_htmls": case "admin_world_missing_htmls":
{ {
activeChar.sendMessage("Missing htmls for the whole world."); BuilderUtil.sendSysMessage(activeChar, "Missing htmls for the whole world.");
final List<Integer> results = new ArrayList<>(); final List<Integer> results = new ArrayList<>();
for (L2Object obj : L2World.getInstance().getVisibleObjects()) for (L2Object obj : L2World.getInstance().getVisibleObjects())
{ {
@@ -102,9 +103,9 @@ public class AdminMissingHtmls implements IAdminCommandHandler
Collections.sort(results); Collections.sort(results);
for (int id : results) for (int id : results)
{ {
activeChar.sendMessage("NPC " + id + " does not have a default html."); BuilderUtil.sendSysMessage(activeChar, "NPC " + id + " does not have a default html.");
} }
activeChar.sendMessage("Found " + results.size() + " results."); BuilderUtil.sendSysMessage(activeChar, "Found " + results.size() + " results.");
break; break;
} }
} }

View File

@@ -28,6 +28,7 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.MagicSkillUse; import com.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
import com.l2jmobius.gameserver.network.serverpackets.SetupGauge; import com.l2jmobius.gameserver.network.serverpackets.SetupGauge;
import com.l2jmobius.gameserver.util.Broadcast; import com.l2jmobius.gameserver.util.Broadcast;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* @author littlecrow Admin commands handler for controllable mobs * @author littlecrow Admin commands handler for controllable mobs
@@ -154,13 +155,13 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Incorrect command arguments."); BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
return; return;
} }
final MobGroup group = MobGroupTable.getInstance().getGroup(groupId); final MobGroup group = MobGroupTable.getInstance().getGroup(groupId);
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
group.returnGroup(activeChar); group.returnGroup(activeChar);
@@ -176,13 +177,13 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Incorrect command arguments."); BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
return; return;
} }
final MobGroup group = MobGroupTable.getInstance().getGroup(groupId); final MobGroup group = MobGroupTable.getInstance().getGroup(groupId);
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
group.setIdleMode(); group.setIdleMode();
@@ -197,13 +198,13 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Incorrect command arguments."); BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
return; return;
} }
final MobGroup group = MobGroupTable.getInstance().getGroup(groupId); final MobGroup group = MobGroupTable.getInstance().getGroup(groupId);
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
group.setAttackRandom(); group.setAttackRandom();
@@ -218,13 +219,13 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Incorrect command arguments."); BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
return; return;
} }
final MobGroup group = MobGroupTable.getInstance().getGroup(groupId); final MobGroup group = MobGroupTable.getInstance().getGroup(groupId);
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
group.setAttackTarget(target); group.setAttackTarget(target);
@@ -239,13 +240,13 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Incorrect command arguments."); BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
return; return;
} }
final MobGroup group = MobGroupTable.getInstance().getGroup(groupId); final MobGroup group = MobGroupTable.getInstance().getGroup(groupId);
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
group.setFollowMode(target); group.setFollowMode(target);
@@ -267,13 +268,13 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //mobgroup_create <group> <npcid> <count>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_create <group> <npcid> <count>");
return; return;
} }
if (MobGroupTable.getInstance().getGroup(groupId) != null) if (MobGroupTable.getInstance().getGroup(groupId) != null)
{ {
activeChar.sendMessage("Mob group " + groupId + " already exists."); BuilderUtil.sendSysMessage(activeChar, "Mob group " + groupId + " already exists.");
return; return;
} }
@@ -281,14 +282,14 @@ public class AdminMobGroup implements IAdminCommandHandler
if (template == null) if (template == null)
{ {
activeChar.sendMessage("Invalid NPC ID specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid NPC ID specified.");
return; return;
} }
final MobGroup group = new MobGroup(groupId, template, mobCount); final MobGroup group = new MobGroup(groupId, template, mobCount);
MobGroupTable.getInstance().addGroup(groupId, group); MobGroupTable.getInstance().addGroup(groupId, group);
activeChar.sendMessage("Mob group " + groupId + " created."); BuilderUtil.sendSysMessage(activeChar, "Mob group " + groupId + " created.");
} }
private void removeGroup(String command, L2PcInstance activeChar) private void removeGroup(String command, L2PcInstance activeChar)
@@ -301,7 +302,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //mobgroup_remove <groupId>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_remove <groupId>");
return; return;
} }
@@ -309,7 +310,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
@@ -318,7 +319,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (MobGroupTable.getInstance().removeGroup(groupId)) if (MobGroupTable.getInstance().removeGroup(groupId))
{ {
activeChar.sendMessage("Mob group " + groupId + " unspawned and removed."); BuilderUtil.sendSysMessage(activeChar, "Mob group " + groupId + " unspawned and removed.");
} }
} }
@@ -349,7 +350,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //mobgroup_spawn <group> [ x y z ]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_spawn <group> [ x y z ]");
return; return;
} }
@@ -357,7 +358,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
@@ -372,7 +373,7 @@ public class AdminMobGroup implements IAdminCommandHandler
group.spawnGroup(activeChar); group.spawnGroup(activeChar);
} }
activeChar.sendMessage("Mob group " + groupId + " spawned."); BuilderUtil.sendSysMessage(activeChar, "Mob group " + groupId + " spawned.");
} }
private void unspawnGroup(String command, L2PcInstance activeChar) private void unspawnGroup(String command, L2PcInstance activeChar)
@@ -385,7 +386,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //mobgroup_unspawn <groupId>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_unspawn <groupId>");
return; return;
} }
@@ -393,14 +394,14 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
doAnimation(activeChar); doAnimation(activeChar);
group.unspawnGroup(); group.unspawnGroup();
activeChar.sendMessage("Mob group " + groupId + " unspawned."); BuilderUtil.sendSysMessage(activeChar, "Mob group " + groupId + " unspawned.");
} }
private void killGroup(String command, L2PcInstance activeChar) private void killGroup(String command, L2PcInstance activeChar)
@@ -413,7 +414,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //mobgroup_kill <groupId>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_kill <groupId>");
return; return;
} }
@@ -421,7 +422,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
@@ -439,7 +440,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //mobgroup_casting <groupId>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_casting <groupId>");
return; return;
} }
@@ -447,7 +448,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
@@ -466,7 +467,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //mobgroup_nomove <groupId> <on|off>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_nomove <groupId> <on|off>");
return; return;
} }
@@ -474,7 +475,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
@@ -488,7 +489,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Incorrect command arguments."); BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
} }
} }
@@ -510,7 +511,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //mobgroup_attackgrp <groupId> <TargetGroupId>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_attackgrp <groupId> <TargetGroupId>");
return; return;
} }
@@ -518,7 +519,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
@@ -526,7 +527,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (othGroup == null) if (othGroup == null)
{ {
activeChar.sendMessage("Incorrect target group."); BuilderUtil.sendSysMessage(activeChar, "Incorrect target group.");
return; return;
} }
@@ -545,7 +546,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //mobgroup_invul <groupId> <on|off>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_invul <groupId> <on|off>");
return; return;
} }
@@ -553,7 +554,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
@@ -567,7 +568,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Incorrect command arguments."); BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
} }
} }
@@ -594,7 +595,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //mobgroup_teleport <groupId> [playerName]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_teleport <groupId> [playerName]");
return; return;
} }
@@ -602,7 +603,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
@@ -613,7 +614,7 @@ public class AdminMobGroup implements IAdminCommandHandler
{ {
final MobGroup[] mobGroupList = MobGroupTable.getInstance().getGroups(); final MobGroup[] mobGroupList = MobGroupTable.getInstance().getGroups();
activeChar.sendMessage("======= <Mob Groups> ======="); BuilderUtil.sendSysMessage(activeChar, "======= <Mob Groups> =======");
for (MobGroup mobGroup : mobGroupList) for (MobGroup mobGroup : mobGroupList)
{ {

View File

@@ -30,6 +30,7 @@ import com.l2jmobius.gameserver.model.olympiad.OlympiadGameTask;
import com.l2jmobius.gameserver.model.olympiad.OlympiadManager; import com.l2jmobius.gameserver.model.olympiad.OlympiadManager;
import com.l2jmobius.gameserver.model.olympiad.Participant; import com.l2jmobius.gameserver.model.olympiad.Participant;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
/** /**
@@ -56,7 +57,7 @@ public class AdminOlympiad implements IAdminCommandHandler
{ {
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //olympiad_game <player name>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //olympiad_game <player name>");
return false; return false;
} }
@@ -107,7 +108,7 @@ public class AdminOlympiad implements IAdminCommandHandler
final int val = parseInt(st, Integer.MIN_VALUE); final int val = parseInt(st, Integer.MIN_VALUE);
if (val == Integer.MIN_VALUE) if (val == Integer.MIN_VALUE)
{ {
activeChar.sendMessage("Syntax: //addolypoints <points>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //addolypoints <points>");
return false; return false;
} }
@@ -118,24 +119,24 @@ public class AdminOlympiad implements IAdminCommandHandler
final int points = Math.max(oldpoints + val, 0); final int points = Math.max(oldpoints + val, 0);
if (points > 1000) if (points > 1000)
{ {
activeChar.sendMessage("You can't set more than 1000 or less than 0 Olympiad points!"); BuilderUtil.sendSysMessage(activeChar, "You can't set more than 1000 or less than 0 Olympiad points!");
return false; return false;
} }
statDat.set(Olympiad.POINTS, points); statDat.set(Olympiad.POINTS, points);
activeChar.sendMessage("Player " + player.getName() + " now has " + points + " Olympiad points."); BuilderUtil.sendSysMessage(activeChar, "Player " + player.getName() + " now has " + points + " Olympiad points.");
} }
else else
{ {
activeChar.sendMessage("This player is not noblesse!"); BuilderUtil.sendSysMessage(activeChar, "This player is not noblesse!");
return false; return false;
} }
} }
else else
{ {
activeChar.sendMessage("Usage: target a player and write the amount of points you would like to add."); BuilderUtil.sendSysMessage(activeChar, "Usage: target a player and write the amount of points you would like to add.");
activeChar.sendMessage("Example: //addolypoints 10"); BuilderUtil.sendSysMessage(activeChar, "Example: //addolypoints 10");
activeChar.sendMessage("However, keep in mind that you can't have less than 0 or more than 1000 points."); BuilderUtil.sendSysMessage(activeChar, "However, keep in mind that you can't have less than 0 or more than 1000 points.");
} }
break; break;
} }
@@ -148,7 +149,7 @@ public class AdminOlympiad implements IAdminCommandHandler
final int val = parseInt(st, Integer.MIN_VALUE); final int val = parseInt(st, Integer.MIN_VALUE);
if (val == Integer.MIN_VALUE) if (val == Integer.MIN_VALUE)
{ {
activeChar.sendMessage("Syntax: //removeolypoints <points>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //removeolypoints <points>");
return false; return false;
} }
@@ -157,7 +158,7 @@ public class AdminOlympiad implements IAdminCommandHandler
final StatsSet playerStat = Olympiad.getNobleStats(player.getObjectId()); final StatsSet playerStat = Olympiad.getNobleStats(player.getObjectId());
if (playerStat == null) if (playerStat == null)
{ {
activeChar.sendMessage("This player hasn't played on Olympiad yet!"); BuilderUtil.sendSysMessage(activeChar, "This player hasn't played on Olympiad yet!");
return false; return false;
} }
@@ -165,19 +166,19 @@ public class AdminOlympiad implements IAdminCommandHandler
final int points = Math.max(oldpoints - val, 0); final int points = Math.max(oldpoints - val, 0);
playerStat.set(Olympiad.POINTS, points); playerStat.set(Olympiad.POINTS, points);
activeChar.sendMessage("Player " + player.getName() + " now has " + points + " Olympiad points."); BuilderUtil.sendSysMessage(activeChar, "Player " + player.getName() + " now has " + points + " Olympiad points.");
} }
else else
{ {
activeChar.sendMessage("This player is not noblesse!"); BuilderUtil.sendSysMessage(activeChar, "This player is not noblesse!");
return false; return false;
} }
} }
else else
{ {
activeChar.sendMessage("Usage: target a player and write the amount of points you would like to remove."); BuilderUtil.sendSysMessage(activeChar, "Usage: target a player and write the amount of points you would like to remove.");
activeChar.sendMessage("Example: //removeolypoints 10"); BuilderUtil.sendSysMessage(activeChar, "Example: //removeolypoints 10");
activeChar.sendMessage("However, keep in mind that you can't have less than 0 or more than 1000 points."); BuilderUtil.sendSysMessage(activeChar, "However, keep in mind that you can't have less than 0 or more than 1000 points.");
} }
break; break;
} }
@@ -190,7 +191,7 @@ public class AdminOlympiad implements IAdminCommandHandler
final int val = parseInt(st, Integer.MIN_VALUE); final int val = parseInt(st, Integer.MIN_VALUE);
if (val == Integer.MIN_VALUE) if (val == Integer.MIN_VALUE)
{ {
activeChar.sendMessage("Syntax: //setolypoints <points>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //setolypoints <points>");
return false; return false;
} }
@@ -201,24 +202,24 @@ public class AdminOlympiad implements IAdminCommandHandler
final int points = oldpoints - val; final int points = oldpoints - val;
if ((points < 1) && (points > 1000)) if ((points < 1) && (points > 1000))
{ {
activeChar.sendMessage("You can't set more than 1000 or less than 0 Olympiad points! or lower then 0"); BuilderUtil.sendSysMessage(activeChar, "You can't set more than 1000 or less than 0 Olympiad points! or lower then 0");
return false; return false;
} }
statDat.set(Olympiad.POINTS, points); statDat.set(Olympiad.POINTS, points);
activeChar.sendMessage("Player " + player.getName() + " now has " + points + " Olympiad points."); BuilderUtil.sendSysMessage(activeChar, "Player " + player.getName() + " now has " + points + " Olympiad points.");
} }
else else
{ {
activeChar.sendMessage("This player is not noblesse!"); BuilderUtil.sendSysMessage(activeChar, "This player is not noblesse!");
return false; return false;
} }
} }
else else
{ {
activeChar.sendMessage("Usage: target a player and write the amount of points you would like to set."); BuilderUtil.sendSysMessage(activeChar, "Usage: target a player and write the amount of points you would like to set.");
activeChar.sendMessage("Example: //setolypoints 10"); BuilderUtil.sendSysMessage(activeChar, "Example: //setolypoints 10");
activeChar.sendMessage("However, keep in mind that you can't have less than 0 or more than 1000 points."); BuilderUtil.sendSysMessage(activeChar, "However, keep in mind that you can't have less than 0 or more than 1000 points.");
} }
break; break;
} }
@@ -263,22 +264,22 @@ public class AdminOlympiad implements IAdminCommandHandler
{ {
if (player.isSubClassActive()) if (player.isSubClassActive())
{ {
activeChar.sendMessage("Player " + player + " subclass active."); BuilderUtil.sendSysMessage(activeChar, "Player " + player + " subclass active.");
return false; return false;
} }
else if (player.getClassId().level() < 3) else if (player.getClassId().level() < 3)
{ {
activeChar.sendMessage("Player " + player + " has not 3rd class."); BuilderUtil.sendSysMessage(activeChar, "Player " + player + " has not 3rd class.");
return false; return false;
} }
else if (Olympiad.getInstance().getNoblePoints(player) <= 0) else if (Olympiad.getInstance().getNoblePoints(player) <= 0)
{ {
activeChar.sendMessage("Player " + player + " has 0 oly points (add them with (//addolypoints)."); BuilderUtil.sendSysMessage(activeChar, "Player " + player + " has 0 oly points (add them with (//addolypoints).");
return false; return false;
} }
else if (OlympiadManager.getInstance().isRegistered(player)) else if (OlympiadManager.getInstance().isRegistered(player))
{ {
activeChar.sendMessage("Player " + player + " registered to oly."); BuilderUtil.sendSysMessage(activeChar, "Player " + player + " registered to oly.");
return false; return false;
} }
return true; return true;

View File

@@ -31,6 +31,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2BoatInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.AdminForgePacket; import com.l2jmobius.gameserver.network.serverpackets.AdminForgePacket;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles commands for gm to forge packets * This class handles commands for gm to forge packets
@@ -195,13 +196,13 @@ public final class AdminPForge implements IAdminCommandHandler
private void showValuesUsage(L2PcInstance activeChar) private void showValuesUsage(L2PcInstance activeChar)
{ {
activeChar.sendMessage("Usage: //forge_values opcode1[ opcode2[ opcode3]] ;[ format]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //forge_values opcode1[ opcode2[ opcode3]] ;[ format]");
showMainPage(activeChar); showMainPage(activeChar);
} }
private void showSendUsage(L2PcInstance activeChar, String[] opCodes, String format) private void showSendUsage(L2PcInstance activeChar, String[] opCodes, String format)
{ {
activeChar.sendMessage("Usage: //forge_send sc|sb|cs opcode1[;opcode2[;opcode3]][ format value1 ... valueN] "); BuilderUtil.sendSysMessage(activeChar, "Usage: //forge_send sc|sb|cs opcode1[;opcode2[;opcode3]][ format value1 ... valueN] ");
if (opCodes == null) if (opCodes == null)
{ {
showMainPage(activeChar); showMainPage(activeChar);
@@ -300,7 +301,7 @@ public final class AdminPForge implements IAdminCommandHandler
final String[] opCodes = getOpCodes(st); final String[] opCodes = getOpCodes(st);
if (!validateOpCodes(opCodes)) if (!validateOpCodes(opCodes))
{ {
activeChar.sendMessage("Invalid op codes!"); BuilderUtil.sendSysMessage(activeChar, "Invalid op codes!");
showValuesUsage(activeChar); showValuesUsage(activeChar);
return false; return false;
} }
@@ -311,7 +312,7 @@ public final class AdminPForge implements IAdminCommandHandler
format = st.nextToken(); format = st.nextToken();
if (!validateFormat(format)) if (!validateFormat(format))
{ {
activeChar.sendMessage("Format invalid!"); BuilderUtil.sendSysMessage(activeChar, "Format invalid!");
showValuesUsage(activeChar); showValuesUsage(activeChar);
return false; return false;
} }
@@ -342,7 +343,7 @@ public final class AdminPForge implements IAdminCommandHandler
final String method = st.nextToken(); final String method = st.nextToken();
if (!validateMethod(method)) if (!validateMethod(method))
{ {
activeChar.sendMessage("Invalid method!"); BuilderUtil.sendSysMessage(activeChar, "Invalid method!");
showSendUsage(activeChar, null, null); showSendUsage(activeChar, null, null);
return false; return false;
} }
@@ -350,7 +351,7 @@ public final class AdminPForge implements IAdminCommandHandler
final String[] opCodes = st.nextToken().split(";"); final String[] opCodes = st.nextToken().split(";");
if (!validateOpCodes(opCodes)) if (!validateOpCodes(opCodes))
{ {
activeChar.sendMessage("Invalid op codes!"); BuilderUtil.sendSysMessage(activeChar, "Invalid op codes!");
showSendUsage(activeChar, null, null); showSendUsage(activeChar, null, null);
return false; return false;
} }
@@ -361,7 +362,7 @@ public final class AdminPForge implements IAdminCommandHandler
format = st.nextToken(); format = st.nextToken();
if (!validateFormat(format)) if (!validateFormat(format))
{ {
activeChar.sendMessage("Format invalid!"); BuilderUtil.sendSysMessage(activeChar, "Format invalid!");
showSendUsage(activeChar, null, null); showSendUsage(activeChar, null, null);
return false; return false;
} }
@@ -408,7 +409,7 @@ public final class AdminPForge implements IAdminCommandHandler
{ {
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Not enough values!"); BuilderUtil.sendSysMessage(activeChar, "Not enough values!");
showSendUsage(activeChar, null, null); showSendUsage(activeChar, null, null);
return false; return false;
} }

View File

@@ -23,6 +23,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.Location; import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
public class AdminPathNode implements IAdminCommandHandler public class AdminPathNode implements IAdminCommandHandler
{ {
@@ -41,13 +42,13 @@ public class AdminPathNode implements IAdminCommandHandler
final List<Location> path = GeoEngine.getInstance().findPath(activeChar.getX(), activeChar.getY(), (short) activeChar.getZ(), activeChar.getTarget().getX(), activeChar.getTarget().getY(), (short) activeChar.getTarget().getZ(), activeChar.getInstanceWorld()); final List<Location> path = GeoEngine.getInstance().findPath(activeChar.getX(), activeChar.getY(), (short) activeChar.getZ(), activeChar.getTarget().getX(), activeChar.getTarget().getY(), (short) activeChar.getTarget().getZ(), activeChar.getInstanceWorld());
if (path == null) if (path == null)
{ {
activeChar.sendMessage("No route found or pathfinding disabled."); BuilderUtil.sendSysMessage(activeChar, "No route found or pathfinding disabled.");
} }
else else
{ {
for (Location point : path) for (Location point : path)
{ {
activeChar.sendMessage("x:" + point.getX() + " y:" + point.getY() + " z:" + point.getZ()); BuilderUtil.sendSysMessage(activeChar, "x:" + point.getX() + " y:" + point.getY() + " z:" + point.getZ());
} }
} }
} }

View File

@@ -26,6 +26,7 @@ import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.ExPCCafePointInfo; import com.l2jmobius.gameserver.network.serverpackets.ExPCCafePointInfo;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
/** /**
@@ -64,7 +65,7 @@ public final class AdminPcCafePoints implements IAdminCommandHandler
catch (Exception e) catch (Exception e)
{ {
showMenuHtml(activeChar); showMenuHtml(activeChar);
activeChar.sendMessage("Invalid Value!"); BuilderUtil.sendSysMessage(activeChar, "Invalid Value!");
return false; return false;
} }
@@ -75,7 +76,7 @@ public final class AdminPcCafePoints implements IAdminCommandHandler
if (value > Config.PC_CAFE_MAX_POINTS) if (value > Config.PC_CAFE_MAX_POINTS)
{ {
showMenuHtml(activeChar); showMenuHtml(activeChar);
activeChar.sendMessage("You cannot set more than " + Config.PC_CAFE_MAX_POINTS + " PC points!"); BuilderUtil.sendSysMessage(activeChar, "You cannot set more than " + Config.PC_CAFE_MAX_POINTS + " PC points!");
return false; return false;
} }
if (value < 0) if (value < 0)
@@ -85,7 +86,7 @@ public final class AdminPcCafePoints implements IAdminCommandHandler
target.setPcCafePoints(value); target.setPcCafePoints(value);
target.sendMessage("Admin set your PC Cafe point(s) to " + value + "!"); target.sendMessage("Admin set your PC Cafe point(s) to " + value + "!");
activeChar.sendMessage("You set " + value + " PC Cafe point(s) to player " + target.getName()); BuilderUtil.sendSysMessage(activeChar, "You set " + value + " PC Cafe point(s) to player " + target.getName());
target.sendPacket(new ExPCCafePointInfo(value, value, 1)); target.sendPacket(new ExPCCafePointInfo(value, value, 1));
break; break;
} }
@@ -105,7 +106,7 @@ public final class AdminPcCafePoints implements IAdminCommandHandler
} }
target.setPcCafePoints(pcCafeCount); target.setPcCafePoints(pcCafeCount);
target.sendMessage("Admin increased your PC Cafe point(s) by " + value + "!"); target.sendMessage("Admin increased your PC Cafe point(s) by " + value + "!");
activeChar.sendMessage("You increased PC Cafe point(s) of " + target.getName() + " by " + value); BuilderUtil.sendSysMessage(activeChar, "You increased PC Cafe point(s) of " + target.getName() + " by " + value);
target.sendPacket(new ExPCCafePointInfo(pcCafeCount, value, 1)); target.sendPacket(new ExPCCafePointInfo(pcCafeCount, value, 1));
break; break;
} }
@@ -121,7 +122,7 @@ public final class AdminPcCafePoints implements IAdminCommandHandler
final int pcCafeCount = Math.max(target.getPcCafePoints() - value, 0); final int pcCafeCount = Math.max(target.getPcCafePoints() - value, 0);
target.setPcCafePoints(pcCafeCount); target.setPcCafePoints(pcCafeCount);
target.sendMessage("Admin decreased your PC Cafe point(s) by " + value + "!"); target.sendMessage("Admin decreased your PC Cafe point(s) by " + value + "!");
activeChar.sendMessage("You decreased PC Cafe point(s) of " + target.getName() + " by " + value); BuilderUtil.sendSysMessage(activeChar, "You decreased PC Cafe point(s) of " + target.getName() + " by " + value);
target.sendPacket(new ExPCCafePointInfo(pcCafeCount, value, 1)); target.sendPacket(new ExPCCafePointInfo(pcCafeCount, value, 1));
break; break;
} }
@@ -139,12 +140,12 @@ public final class AdminPcCafePoints implements IAdminCommandHandler
if (range <= 0) if (range <= 0)
{ {
final int count = increaseForAll(L2World.getInstance().getPlayers(), value); final int count = increaseForAll(L2World.getInstance().getPlayers(), value);
activeChar.sendMessage("You increased PC Cafe point(s) of all online players (" + count + ") by " + value + "."); BuilderUtil.sendSysMessage(activeChar, "You increased PC Cafe point(s) of all online players (" + count + ") by " + value + ".");
} }
else if (range > 0) else if (range > 0)
{ {
final int count = increaseForAll(L2World.getInstance().getVisibleObjects(activeChar, L2PcInstance.class, range), value); final int count = increaseForAll(L2World.getInstance().getVisibleObjects(activeChar, L2PcInstance.class, range), value);
activeChar.sendMessage("You increased PC Cafe point(s) of all players (" + count + ") in range " + range + " by " + value + "."); BuilderUtil.sendSysMessage(activeChar, "You increased PC Cafe point(s) of all players (" + count + ") in range " + range + " by " + value + ".");
} }
break; break;
} }

View File

@@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.PcCondOverride; import com.l2jmobius.gameserver.model.PcCondOverride;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
/** /**
@@ -75,12 +76,12 @@ public class AdminPcCondOverride implements IAdminCommandHandler
if (activeChar.canOverrideCond(ex)) if (activeChar.canOverrideCond(ex))
{ {
activeChar.removeOverridedCond(ex); activeChar.removeOverridedCond(ex);
activeChar.sendMessage("You've disabled " + ex.getDescription()); BuilderUtil.sendSysMessage(activeChar, "You've disabled " + ex.getDescription());
} }
else else
{ {
activeChar.addOverrideCond(ex); activeChar.addOverrideCond(ex);
activeChar.sendMessage("You've enabled " + ex.getDescription()); BuilderUtil.sendSysMessage(activeChar, "You've enabled " + ex.getDescription());
} }
} }
} }
@@ -97,7 +98,7 @@ public class AdminPcCondOverride implements IAdminCommandHandler
activeChar.addOverrideCond(ex); activeChar.addOverrideCond(ex);
} }
} }
activeChar.sendMessage("All condition exceptions have been enabled."); BuilderUtil.sendSysMessage(activeChar, "All condition exceptions have been enabled.");
break; break;
} }
case "disable_all": case "disable_all":
@@ -109,7 +110,7 @@ public class AdminPcCondOverride implements IAdminCommandHandler
activeChar.removeOverridedCond(ex); activeChar.removeOverridedCond(ex);
} }
} }
activeChar.sendMessage("All condition exceptions have been disabled."); BuilderUtil.sendSysMessage(activeChar, "All condition exceptions have been disabled.");
break; break;
} }
} }

View File

@@ -21,6 +21,7 @@ import com.l2jmobius.gameserver.instancemanager.PetitionManager;
import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles commands for GMs to respond to petitions. * This class handles commands for GMs to respond to petitions.
@@ -115,7 +116,7 @@ public class AdminPetition implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Usage: //force_peti text"); BuilderUtil.sendSysMessage(activeChar, "Usage: //force_peti text");
return false; return false;
} }
} }

View File

@@ -27,6 +27,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.GMViewPledgeInfo; import com.l2jmobius.gameserver.network.serverpackets.GMViewPledgeInfo;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* <B>Pledge Manipulation:</B><BR> * <B>Pledge Manipulation:</B><BR>
@@ -65,13 +66,13 @@ public class AdminPledge implements IAdminCommandHandler
{ {
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Missing parameters!"); BuilderUtil.sendSysMessage(activeChar, "Missing parameters!");
break; break;
} }
final String action = st.nextToken(); final String action = st.nextToken();
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Missing parameters!"); BuilderUtil.sendSysMessage(activeChar, "Missing parameters!");
break; break;
} }
final String param = st.nextToken(); final String param = st.nextToken();
@@ -82,7 +83,7 @@ public class AdminPledge implements IAdminCommandHandler
{ {
if (clan != null) if (clan != null)
{ {
activeChar.sendMessage("Target player has clan!"); BuilderUtil.sendSysMessage(activeChar, "Target player has clan!");
break; break;
} }
@@ -91,12 +92,12 @@ public class AdminPledge implements IAdminCommandHandler
clan = ClanTable.getInstance().createClan(targetPlayer, param); clan = ClanTable.getInstance().createClan(targetPlayer, param);
if (clan != null) if (clan != null)
{ {
activeChar.sendMessage("Clan " + param + " created. Leader: " + targetPlayer.getName()); BuilderUtil.sendSysMessage(activeChar, "Clan " + param + " created. Leader: " + targetPlayer.getName());
} }
else else
{ {
targetPlayer.setClanCreateExpiryTime(penalty); targetPlayer.setClanCreateExpiryTime(penalty);
activeChar.sendMessage("There was a problem while creating the clan."); BuilderUtil.sendSysMessage(activeChar, "There was a problem while creating the clan.");
} }
break; break;
} }
@@ -104,7 +105,7 @@ public class AdminPledge implements IAdminCommandHandler
{ {
if (clan == null) if (clan == null)
{ {
activeChar.sendMessage("Target player has no clan!"); BuilderUtil.sendSysMessage(activeChar, "Target player has no clan!");
break; break;
} }
@@ -121,11 +122,11 @@ public class AdminPledge implements IAdminCommandHandler
clan = targetPlayer.getClan(); clan = targetPlayer.getClan();
if (clan == null) if (clan == null)
{ {
activeChar.sendMessage("Clan disbanded."); BuilderUtil.sendSysMessage(activeChar, "Clan disbanded.");
} }
else else
{ {
activeChar.sendMessage("There was a problem while destroying the clan."); BuilderUtil.sendSysMessage(activeChar, "There was a problem while destroying the clan.");
} }
break; break;
} }
@@ -133,7 +134,7 @@ public class AdminPledge implements IAdminCommandHandler
{ {
if (clan == null) if (clan == null)
{ {
activeChar.sendMessage("Target player has no clan!"); BuilderUtil.sendSysMessage(activeChar, "Target player has no clan!");
break; break;
} }
@@ -144,12 +145,12 @@ public class AdminPledge implements IAdminCommandHandler
{ {
if (clan == null) if (clan == null)
{ {
activeChar.sendMessage("Target player has no clan!"); BuilderUtil.sendSysMessage(activeChar, "Target player has no clan!");
break; break;
} }
else if (param == null) else if (param == null)
{ {
activeChar.sendMessage("Usage: //pledge <setlevel|rep> <number>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //pledge <setlevel|rep> <number>");
break; break;
} }
@@ -161,11 +162,11 @@ public class AdminPledge implements IAdminCommandHandler
{ {
member.broadcastUserInfo(UserInfoType.RELATION, UserInfoType.CLAN); member.broadcastUserInfo(UserInfoType.RELATION, UserInfoType.CLAN);
} }
activeChar.sendMessage("You set level " + level + " for clan " + clan.getName()); BuilderUtil.sendSysMessage(activeChar, "You set level " + level + " for clan " + clan.getName());
} }
else else
{ {
activeChar.sendMessage("Level incorrect."); BuilderUtil.sendSysMessage(activeChar, "Level incorrect.");
} }
break; break;
} }
@@ -173,12 +174,12 @@ public class AdminPledge implements IAdminCommandHandler
{ {
if (clan == null) if (clan == null)
{ {
activeChar.sendMessage("Target player has no clan!"); BuilderUtil.sendSysMessage(activeChar, "Target player has no clan!");
break; break;
} }
else if (clan.getLevel() < 5) else if (clan.getLevel() < 5)
{ {
activeChar.sendMessage("Only clans of level 5 or above may receive reputation points."); BuilderUtil.sendSysMessage(activeChar, "Only clans of level 5 or above may receive reputation points.");
showMainPage(activeChar); showMainPage(activeChar);
return false; return false;
} }
@@ -187,11 +188,11 @@ public class AdminPledge implements IAdminCommandHandler
{ {
final int points = Integer.parseInt(param); final int points = Integer.parseInt(param);
clan.addReputationScore(points, true); clan.addReputationScore(points, true);
activeChar.sendMessage("You " + (points > 0 ? "add " : "remove ") + Math.abs(points) + " points " + (points > 0 ? "to " : "from ") + clan.getName() + "'s reputation. Their current score is " + clan.getReputationScore()); BuilderUtil.sendSysMessage(activeChar, "You " + (points > 0 ? "add " : "remove ") + Math.abs(points) + " points " + (points > 0 ? "to " : "from ") + clan.getName() + "'s reputation. Their current score is " + clan.getReputationScore());
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //pledge <rep> <number>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //pledge <rep> <number>");
} }
break; break;
} }

View File

@@ -23,6 +23,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.MagicSkillUse; import com.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
import com.l2jmobius.gameserver.network.serverpackets.SetupGauge; import com.l2jmobius.gameserver.network.serverpackets.SetupGauge;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
/** /**
@@ -102,7 +103,7 @@ public class AdminPolymorph implements IAdminCommandHandler
final String[] parts = command.split(" "); final String[] parts = command.split(" ");
if ((parts.length != 2) || !Util.isDigit(parts[1])) if ((parts.length != 2) || !Util.isDigit(parts[1]))
{ {
activeChar.sendMessage("Usage: //transform <id>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //transform <id>");
return false; return false;
} }
@@ -118,7 +119,7 @@ public class AdminPolymorph implements IAdminCommandHandler
final String[] parts = command.split(" "); final String[] parts = command.split(" ");
if ((parts.length < 2) || !Util.isDigit(parts[1])) if ((parts.length < 2) || !Util.isDigit(parts[1]))
{ {
activeChar.sendMessage("Usage: //polymorph [type] <id>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //polymorph [type] <id>");
return false; return false;
} }
@@ -168,7 +169,7 @@ public class AdminPolymorph implements IAdminCommandHandler
} }
// end of animation // end of animation
obj.broadcastInfo(); obj.broadcastInfo();
activeChar.sendMessage("Polymorph succeed"); BuilderUtil.sendSysMessage(activeChar, "Polymorph succeed");
} }
else else
{ {
@@ -187,7 +188,7 @@ public class AdminPolymorph implements IAdminCommandHandler
{ {
target.getPoly().setPolyInfo(null, "1"); target.getPoly().setPolyInfo(null, "1");
target.broadcastInfo(); target.broadcastInfo();
activeChar.sendMessage("Unpolymorph succeed"); BuilderUtil.sendSysMessage(activeChar, "Unpolymorph succeed");
} }
else else
{ {

View File

@@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.instancemanager.PremiumManager; import com.l2jmobius.gameserver.instancemanager.PremiumManager;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* @author Mobius * @author Mobius
@@ -56,7 +57,7 @@ public class AdminPremium implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Please enter a valid account name."); BuilderUtil.sendSysMessage(activeChar, "Please enter a valid account name.");
} }
} }
else if (command.startsWith("admin_premium_add2")) else if (command.startsWith("admin_premium_add2"))
@@ -67,7 +68,7 @@ public class AdminPremium implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Please enter a valid account name."); BuilderUtil.sendSysMessage(activeChar, "Please enter a valid account name.");
} }
} }
else if (command.startsWith("admin_premium_add3")) else if (command.startsWith("admin_premium_add3"))
@@ -78,7 +79,7 @@ public class AdminPremium implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Please enter a valid account name."); BuilderUtil.sendSysMessage(activeChar, "Please enter a valid account name.");
} }
} }
else if (command.startsWith("admin_premium_info")) else if (command.startsWith("admin_premium_info"))
@@ -89,7 +90,7 @@ public class AdminPremium implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Please enter a valid account name."); BuilderUtil.sendSysMessage(activeChar, "Please enter a valid account name.");
} }
} }
else if (command.startsWith("admin_premium_remove")) else if (command.startsWith("admin_premium_remove"))
@@ -100,7 +101,7 @@ public class AdminPremium implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Please enter a valid account name."); BuilderUtil.sendSysMessage(activeChar, "Please enter a valid account name.");
} }
} }

View File

@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
/** /**
@@ -63,7 +64,7 @@ public final class AdminPrimePoints implements IAdminCommandHandler
catch (Exception e) catch (Exception e)
{ {
showMenuHtml(activeChar); showMenuHtml(activeChar);
activeChar.sendMessage("Invalid Value!"); BuilderUtil.sendSysMessage(activeChar, "Invalid Value!");
return false; return false;
} }
@@ -73,7 +74,7 @@ public final class AdminPrimePoints implements IAdminCommandHandler
{ {
target.setPrimePoints(value); target.setPrimePoints(value);
target.sendMessage("Admin set your Prime Point(s) to " + value + "!"); target.sendMessage("Admin set your Prime Point(s) to " + value + "!");
activeChar.sendMessage("You set " + value + " Prime Point(s) to player " + target.getName()); BuilderUtil.sendSysMessage(activeChar, "You set " + value + " Prime Point(s) to player " + target.getName());
break; break;
} }
case "increase": case "increase":
@@ -92,7 +93,7 @@ public final class AdminPrimePoints implements IAdminCommandHandler
} }
target.setPrimePoints(primeCount); target.setPrimePoints(primeCount);
target.sendMessage("Admin increase your Prime Point(s) by " + value + "!"); target.sendMessage("Admin increase your Prime Point(s) by " + value + "!");
activeChar.sendMessage("You increased Prime Point(s) of " + target.getName() + " by " + value); BuilderUtil.sendSysMessage(activeChar, "You increased Prime Point(s) of " + target.getName() + " by " + value);
break; break;
} }
case "decrease": case "decrease":
@@ -107,7 +108,7 @@ public final class AdminPrimePoints implements IAdminCommandHandler
final int primeCount = Math.max(target.getPrimePoints() - value, 0); final int primeCount = Math.max(target.getPrimePoints() - value, 0);
target.setPrimePoints(primeCount); target.setPrimePoints(primeCount);
target.sendMessage("Admin decreased your Prime Point(s) by " + value + "!"); target.sendMessage("Admin decreased your Prime Point(s) by " + value + "!");
activeChar.sendMessage("You decreased Prime Point(s) of " + target.getName() + " by " + value); BuilderUtil.sendSysMessage(activeChar, "You decreased Prime Point(s) of " + target.getName() + " by " + value);
break; break;
} }
case "rewardOnline": case "rewardOnline":
@@ -124,12 +125,12 @@ public final class AdminPrimePoints implements IAdminCommandHandler
if (range <= 0) if (range <= 0)
{ {
final int count = increaseForAll(L2World.getInstance().getPlayers(), value); final int count = increaseForAll(L2World.getInstance().getPlayers(), value);
activeChar.sendMessage("You increased Prime Point(s) of all online players (" + count + ") by " + value + "."); BuilderUtil.sendSysMessage(activeChar, "You increased Prime Point(s) of all online players (" + count + ") by " + value + ".");
} }
else if (range > 0) else if (range > 0)
{ {
final int count = increaseForAll(L2World.getInstance().getVisibleObjects(activeChar, L2PcInstance.class, range), value); final int count = increaseForAll(L2World.getInstance().getVisibleObjects(activeChar, L2PcInstance.class, range), value);
activeChar.sendMessage("You increased Prime Point(s) of all players (" + count + ") in range " + range + " by " + value + "."); BuilderUtil.sendSysMessage(activeChar, "You increased Prime Point(s) of all players (" + count + ") in range " + range + " by " + value + ".");
} }
break; break;
} }

View File

@@ -35,6 +35,7 @@ import com.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import com.l2jmobius.gameserver.model.punishment.PunishmentTask; import com.l2jmobius.gameserver.model.punishment.PunishmentTask;
import com.l2jmobius.gameserver.model.punishment.PunishmentType; import com.l2jmobius.gameserver.model.punishment.PunishmentType;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.GMAudit; import com.l2jmobius.gameserver.util.GMAudit;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
@@ -102,13 +103,13 @@ public class AdminPunishment implements IAdminCommandHandler
if ((key == null) || (af == null)) if ((key == null) || (af == null))
{ {
activeChar.sendMessage("Not enough data specified!"); BuilderUtil.sendSysMessage(activeChar, "Not enough data specified!");
break; break;
} }
final PunishmentAffect affect = PunishmentAffect.getByName(af); final PunishmentAffect affect = PunishmentAffect.getByName(af);
if (affect == null) if (affect == null)
{ {
activeChar.sendMessage("Incorrect value specified for affect type!"); BuilderUtil.sendSysMessage(activeChar, "Incorrect value specified for affect type!");
break; break;
} }
@@ -167,7 +168,7 @@ public class AdminPunishment implements IAdminCommandHandler
} }
if ((target == null) && ((activeChar.getTarget() == null) || !activeChar.getTarget().isPlayer())) if ((target == null) && ((activeChar.getTarget() == null) || !activeChar.getTarget().isPlayer()))
{ {
activeChar.sendMessage("You must target player!"); BuilderUtil.sendSysMessage(activeChar, "You must target player!");
break; break;
} }
if (target == null) if (target == null)
@@ -223,12 +224,12 @@ public class AdminPunishment implements IAdminCommandHandler
if ((key == null) || (af == null) || (t == null) || (exp == null) || (reason == null)) if ((key == null) || (af == null) || (t == null) || (exp == null) || (reason == null))
{ {
activeChar.sendMessage("Please fill all the fields!"); BuilderUtil.sendSysMessage(activeChar, "Please fill all the fields!");
break; break;
} }
if (!Util.isDigit(exp) && !exp.equals("-1")) if (!Util.isDigit(exp) && !exp.equals("-1"))
{ {
activeChar.sendMessage("Incorrect value specified for expiration time!"); BuilderUtil.sendSysMessage(activeChar, "Incorrect value specified for expiration time!");
break; break;
} }
@@ -242,7 +243,7 @@ public class AdminPunishment implements IAdminCommandHandler
final PunishmentType type = PunishmentType.getByName(t); final PunishmentType type = PunishmentType.getByName(t);
if ((affect == null) || (type == null)) if ((affect == null) || (type == null))
{ {
activeChar.sendMessage("Incorrect value specified for affect/punishment type!"); BuilderUtil.sendSysMessage(activeChar, "Incorrect value specified for affect/punishment type!");
break; break;
} }
@@ -267,7 +268,7 @@ public class AdminPunishment implements IAdminCommandHandler
} }
catch (UnknownHostException e) catch (UnknownHostException e)
{ {
activeChar.sendMessage("You've entered an incorrect IP address!"); BuilderUtil.sendSysMessage(activeChar, "You've entered an incorrect IP address!");
activeChar.sendMessage(e.getMessage()); activeChar.sendMessage(e.getMessage());
break; break;
} }
@@ -276,13 +277,13 @@ public class AdminPunishment implements IAdminCommandHandler
// Check if we already put the same punishment on that guy ^^ // Check if we already put the same punishment on that guy ^^
if (PunishmentManager.getInstance().hasPunishment(key, affect, type)) if (PunishmentManager.getInstance().hasPunishment(key, affect, type))
{ {
activeChar.sendMessage("Target is already affected by that punishment."); BuilderUtil.sendSysMessage(activeChar, "Target is already affected by that punishment.");
break; break;
} }
// Punish him! // Punish him!
PunishmentManager.getInstance().startPunishment(new PunishmentTask(key, affect, type, expirationTime, reason, activeChar.getName())); PunishmentManager.getInstance().startPunishment(new PunishmentTask(key, affect, type, expirationTime, reason, activeChar.getName()));
activeChar.sendMessage("Punishment " + type.name() + " have been applied to: " + affect + " " + name + "!"); BuilderUtil.sendSysMessage(activeChar, "Punishment " + type.name() + " have been applied to: " + affect + " " + name + "!");
GMAudit.auditGMAction(activeChar.getName() + " [" + activeChar.getObjectId() + "]", cmd, affect.name(), name); GMAudit.auditGMAction(activeChar.getName() + " [" + activeChar.getObjectId() + "]", cmd, affect.name(), name);
return useAdminCommand("admin_punishment info " + name + " " + affect.name(), activeChar); return useAdminCommand("admin_punishment info " + name + " " + affect.name(), activeChar);
} }
@@ -296,7 +297,7 @@ public class AdminPunishment implements IAdminCommandHandler
if ((key == null) || (af == null) || (t == null)) if ((key == null) || (af == null) || (t == null))
{ {
activeChar.sendMessage("Not enough data specified!"); BuilderUtil.sendSysMessage(activeChar, "Not enough data specified!");
break; break;
} }
@@ -304,7 +305,7 @@ public class AdminPunishment implements IAdminCommandHandler
final PunishmentType type = PunishmentType.getByName(t); final PunishmentType type = PunishmentType.getByName(t);
if ((affect == null) || (type == null)) if ((affect == null) || (type == null))
{ {
activeChar.sendMessage("Incorrect value specified for affect/punishment type!"); BuilderUtil.sendSysMessage(activeChar, "Incorrect value specified for affect/punishment type!");
break; break;
} }
@@ -316,12 +317,12 @@ public class AdminPunishment implements IAdminCommandHandler
if (!PunishmentManager.getInstance().hasPunishment(key, affect, type)) if (!PunishmentManager.getInstance().hasPunishment(key, affect, type))
{ {
activeChar.sendMessage("Target is not affected by that punishment!"); BuilderUtil.sendSysMessage(activeChar, "Target is not affected by that punishment!");
break; break;
} }
PunishmentManager.getInstance().stopPunishment(key, affect, type); PunishmentManager.getInstance().stopPunishment(key, affect, type);
activeChar.sendMessage("Punishment " + type.name() + " have been stopped to: " + affect + " " + name + "!"); BuilderUtil.sendSysMessage(activeChar, "Punishment " + type.name() + " have been stopped to: " + affect + " " + name + "!");
GMAudit.auditGMAction(activeChar.getName() + " [" + activeChar.getObjectId() + "]", cmd, affect.name(), name); GMAudit.auditGMAction(activeChar.getName() + " [" + activeChar.getObjectId() + "]", cmd, affect.name(), name);
return useAdminCommand("admin_punishment info " + name + " " + affect.name(), activeChar); return useAdminCommand("admin_punishment info " + name + " " + affect.name(), activeChar);
} }

View File

@@ -37,6 +37,7 @@ import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestTimer; import com.l2jmobius.gameserver.model.quest.QuestTimer;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.scripting.ScriptEngineManager; import com.l2jmobius.gameserver.scripting.ScriptEngineManager;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
public class AdminQuest implements IAdminCommandHandler public class AdminQuest implements IAdminCommandHandler
@@ -72,7 +73,7 @@ public class AdminQuest implements IAdminCommandHandler
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Usage: //quest_reload <questName> or <questId>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //quest_reload <questName> or <questId>");
return false; return false;
} }
@@ -80,17 +81,17 @@ public class AdminQuest implements IAdminCommandHandler
final Quest quest = findScript(script); final Quest quest = findScript(script);
if (quest == null) if (quest == null)
{ {
activeChar.sendMessage("The script " + script + " couldn't be found!"); BuilderUtil.sendSysMessage(activeChar, "The script " + script + " couldn't be found!");
return false; return false;
} }
if (!quest.reload()) if (!quest.reload())
{ {
activeChar.sendMessage("Failed to reload " + script + "!"); BuilderUtil.sendSysMessage(activeChar, "Failed to reload " + script + "!");
return false; return false;
} }
activeChar.sendMessage("Script successful reloaded."); BuilderUtil.sendSysMessage(activeChar, "Script successful reloaded.");
} }
else if (command.startsWith("admin_script_load")) else if (command.startsWith("admin_script_load"))
{ {
@@ -99,7 +100,7 @@ public class AdminQuest implements IAdminCommandHandler
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Usage: //script_load path/to/script.java"); BuilderUtil.sendSysMessage(activeChar, "Usage: //script_load path/to/script.java");
return false; return false;
} }
@@ -107,11 +108,11 @@ public class AdminQuest implements IAdminCommandHandler
try try
{ {
ScriptEngineManager.getInstance().executeScript(Paths.get(script)); ScriptEngineManager.getInstance().executeScript(Paths.get(script));
activeChar.sendMessage("Script loaded seccessful!"); BuilderUtil.sendSysMessage(activeChar, "Script loaded seccessful!");
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Failed to load script!"); BuilderUtil.sendSysMessage(activeChar, "Failed to load script!");
LOGGER.log(Level.WARNING, "Failed to load script " + script + "!", e); LOGGER.log(Level.WARNING, "Failed to load script " + script + "!", e);
} }
} }
@@ -122,7 +123,7 @@ public class AdminQuest implements IAdminCommandHandler
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Usage: //script_load path/to/script.java"); BuilderUtil.sendSysMessage(activeChar, "Usage: //script_load path/to/script.java");
return false; return false;
} }
@@ -130,12 +131,12 @@ public class AdminQuest implements IAdminCommandHandler
final Quest quest = findScript(script); final Quest quest = findScript(script);
if (quest == null) if (quest == null)
{ {
activeChar.sendMessage("The script " + script + " couldn't be found!"); BuilderUtil.sendSysMessage(activeChar, "The script " + script + " couldn't be found!");
return false; return false;
} }
quest.unload(); quest.unload();
activeChar.sendMessage("Script successful unloaded!"); BuilderUtil.sendSysMessage(activeChar, "Script successful unloaded!");
} }
else if (command.startsWith("admin_script_dir")) else if (command.startsWith("admin_script_dir"))
{ {
@@ -154,11 +155,11 @@ public class AdminQuest implements IAdminCommandHandler
{ {
if (activeChar.getTarget() == null) if (activeChar.getTarget() == null)
{ {
activeChar.sendMessage("Get a target first."); BuilderUtil.sendSysMessage(activeChar, "Get a target first.");
} }
else if (!activeChar.getTarget().isCharacter()) else if (!activeChar.getTarget().isCharacter())
{ {
activeChar.sendMessage("Invalid Target."); BuilderUtil.sendSysMessage(activeChar, "Invalid Target.");
} }
else else
{ {
@@ -197,7 +198,7 @@ public class AdminQuest implements IAdminCommandHandler
int counter = 0; int counter = 0;
if (quest == null) if (quest == null)
{ {
activeChar.sendMessage("Couldn't find quest or script with name " + questName + " !"); BuilderUtil.sendSysMessage(activeChar, "Couldn't find quest or script with name " + questName + " !");
return false; return false;
} }
@@ -328,7 +329,7 @@ public class AdminQuest implements IAdminCommandHandler
path = new File(ScriptEngineManager.SCRIPT_FOLDER.toFile(), dir); path = new File(ScriptEngineManager.SCRIPT_FOLDER.toFile(), dir);
if (!path.isDirectory()) if (!path.isDirectory())
{ {
activeChar.sendMessage("Wrong path."); BuilderUtil.sendSysMessage(activeChar, "Wrong path.");
return; return;
} }
currentPath = dir; currentPath = dir;

View File

@@ -54,6 +54,7 @@ import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.scripting.ScriptEngineManager; import com.l2jmobius.gameserver.scripting.ScriptEngineManager;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
/** /**
@@ -125,7 +126,7 @@ public class AdminReload implements IAdminCommandHandler
else else
{ {
QuestManager.getInstance().reloadAllScripts(); QuestManager.getInstance().reloadAllScripts();
activeChar.sendMessage("All scripts have been reloaded."); BuilderUtil.sendSysMessage(activeChar, "All scripts have been reloaded.");
AdminData.getInstance().broadcastMessageToGMs(activeChar.getName() + ": Reloaded Quests."); AdminData.getInstance().broadcastMessageToGMs(activeChar.getName() + ": Reloaded Quests.");
} }
break; break;
@@ -133,7 +134,7 @@ public class AdminReload implements IAdminCommandHandler
case "walker": case "walker":
{ {
WalkingManager.getInstance().load(); WalkingManager.getInstance().load();
activeChar.sendMessage("All walkers have been reloaded"); BuilderUtil.sendSysMessage(activeChar, "All walkers have been reloaded");
AdminData.getInstance().broadcastMessageToGMs(activeChar.getName() + ": Reloaded Walkers."); AdminData.getInstance().broadcastMessageToGMs(activeChar.getName() + ": Reloaded Walkers.");
break; break;
} }
@@ -151,13 +152,13 @@ public class AdminReload implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("File or Directory does not exist."); BuilderUtil.sendSysMessage(activeChar, "File or Directory does not exist.");
} }
} }
else else
{ {
HtmCache.getInstance().reload(); HtmCache.getInstance().reload();
activeChar.sendMessage("Cache[HTML]: " + HtmCache.getInstance().getMemoryUsage() + " megabytes on " + HtmCache.getInstance().getLoadedFiles() + " files loaded"); BuilderUtil.sendSysMessage(activeChar, "Cache[HTML]: " + HtmCache.getInstance().getMemoryUsage() + " megabytes on " + HtmCache.getInstance().getLoadedFiles() + " files loaded");
AdminData.getInstance().broadcastMessageToGMs(activeChar.getName() + ": Reloaded Htms."); AdminData.getInstance().broadcastMessageToGMs(activeChar.getName() + ": Reloaded Htms.");
} }
break; break;
@@ -226,7 +227,7 @@ public class AdminReload implements IAdminCommandHandler
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Failed executing effect master handler!", e); LOGGER.log(Level.WARNING, "Failed executing effect master handler!", e);
activeChar.sendMessage("Error reloading effect master handler!"); BuilderUtil.sendSysMessage(activeChar, "Error reloading effect master handler!");
} }
break; break;
} }
@@ -240,7 +241,7 @@ public class AdminReload implements IAdminCommandHandler
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Failed executing master handler!", e); LOGGER.log(Level.WARNING, "Failed executing master handler!", e);
activeChar.sendMessage("Error reloading master handler!"); BuilderUtil.sendSysMessage(activeChar, "Error reloading master handler!");
} }
break; break;
} }
@@ -330,7 +331,7 @@ public class AdminReload implements IAdminCommandHandler
return true; return true;
} }
} }
activeChar.sendMessage("WARNING: There are several known issues regarding this feature. Reloading server data during runtime is STRONGLY NOT RECOMMENDED for live servers, just for developing environments."); BuilderUtil.sendSysMessage(activeChar, "WARNING: There are several known issues regarding this feature. Reloading server data during runtime is STRONGLY NOT RECOMMENDED for live servers, just for developing environments.");
} }
return true; return true;
} }

View File

@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2ControllableMobInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.taskmanager.DecayTaskManager; import com.l2jmobius.gameserver.taskmanager.DecayTaskManager;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - res = resurrects target L2Character * This class handles following admin commands: - res = resurrects target L2Character
@@ -96,12 +97,12 @@ public class AdminRes implements IAdminCommandHandler
doResurrect(knownPlayer); doResurrect(knownPlayer);
}); });
activeChar.sendMessage("Resurrected all players within a " + radius + " unit radius."); BuilderUtil.sendSysMessage(activeChar, "Resurrected all players within a " + radius + " unit radius.");
return; return;
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
activeChar.sendMessage("Enter a valid player name or radius."); BuilderUtil.sendSysMessage(activeChar, "Enter a valid player name or radius.");
return; return;
} }
} }
@@ -146,12 +147,12 @@ public class AdminRes implements IAdminCommandHandler
} }
}); });
activeChar.sendMessage("Resurrected all non-players within a " + radius + " unit radius."); BuilderUtil.sendSysMessage(activeChar, "Resurrected all non-players within a " + radius + " unit radius.");
} }
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
activeChar.sendMessage("Enter a valid radius."); BuilderUtil.sendSysMessage(activeChar, "Enter a valid radius.");
return; return;
} }

View File

@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler; import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* @author * @author
@@ -56,7 +57,7 @@ public class AdminRide implements IAdminCommandHandler
{ {
if (player.isMounted() || player.hasSummon()) if (player.isMounted() || player.hasSummon())
{ {
activeChar.sendMessage("Target already have a summon."); BuilderUtil.sendSysMessage(activeChar, "Target already have a summon.");
return false; return false;
} }
if (command.startsWith("admin_ride_wyvern")) if (command.startsWith("admin_ride_wyvern"))
@@ -99,7 +100,7 @@ public class AdminRide implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Command '" + command + "' not recognized"); BuilderUtil.sendSysMessage(activeChar, "Command '" + command + "' not recognized");
return false; return false;
} }

View File

@@ -33,6 +33,7 @@ import com.l2jmobius.gameserver.model.html.formatters.BypassParserFormatter;
import com.l2jmobius.gameserver.model.html.pagehandlers.NextPrevPageHandler; import com.l2jmobius.gameserver.model.html.pagehandlers.NextPrevPageHandler;
import com.l2jmobius.gameserver.model.html.styles.ButtonsStyle; import com.l2jmobius.gameserver.model.html.styles.ButtonsStyle;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.BypassBuilder; import com.l2jmobius.gameserver.util.BypassBuilder;
import com.l2jmobius.gameserver.util.BypassParser; import com.l2jmobius.gameserver.util.BypassParser;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
@@ -67,7 +68,7 @@ public class AdminScan implements IAdminCommandHandler
{ {
if (!st.hasMoreElements()) if (!st.hasMoreElements())
{ {
activeChar.sendMessage("Usage: //deletenpcbyobjectid objectId=<object_id>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //deletenpcbyobjectid objectId=<object_id>");
return false; return false;
} }
@@ -77,14 +78,14 @@ public class AdminScan implements IAdminCommandHandler
final int objectId = parser.getInt("objectId", 0); final int objectId = parser.getInt("objectId", 0);
if (objectId == 0) if (objectId == 0)
{ {
activeChar.sendMessage("objectId is not set!"); BuilderUtil.sendSysMessage(activeChar, "objectId is not set!");
} }
final L2Object target = L2World.getInstance().findObject(objectId); final L2Object target = L2World.getInstance().findObject(objectId);
final L2Npc npc = target instanceof L2Npc ? (L2Npc) target : null; final L2Npc npc = target instanceof L2Npc ? (L2Npc) target : null;
if (npc == null) if (npc == null)
{ {
activeChar.sendMessage("NPC does not exist or object_id does not belong to an NPC"); BuilderUtil.sendSysMessage(activeChar, "NPC does not exist or object_id does not belong to an NPC");
return false; return false;
} }
@@ -109,7 +110,7 @@ public class AdminScan implements IAdminCommandHandler
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
activeChar.sendMessage("object_id must be a number."); BuilderUtil.sendSysMessage(activeChar, "object_id must be a number.");
return false; return false;
} }

View File

@@ -26,6 +26,7 @@ import com.l2jmobius.gameserver.model.buylist.ProductList;
import com.l2jmobius.gameserver.network.serverpackets.ActionFailed; import com.l2jmobius.gameserver.network.serverpackets.ActionFailed;
import com.l2jmobius.gameserver.network.serverpackets.BuyList; import com.l2jmobius.gameserver.network.serverpackets.BuyList;
import com.l2jmobius.gameserver.network.serverpackets.ExBuySellList; import com.l2jmobius.gameserver.network.serverpackets.ExBuySellList;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: * This class handles following admin commands:
@@ -57,7 +58,7 @@ public class AdminShop implements IAdminCommandHandler
} }
catch (IndexOutOfBoundsException e) catch (IndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Please specify buylist."); BuilderUtil.sendSysMessage(activeChar, "Please specify buylist.");
} }
} }
else if (command.equals("admin_gmshop")) else if (command.equals("admin_gmshop"))
@@ -73,7 +74,7 @@ public class AdminShop implements IAdminCommandHandler
} }
catch (NumberFormatException | IndexOutOfBoundsException e) catch (NumberFormatException | IndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Please specify multisell list ID."); BuilderUtil.sendSysMessage(activeChar, "Please specify multisell list ID.");
} }
} }
else if (command.toLowerCase().startsWith("admin_exc_multisell")) else if (command.toLowerCase().startsWith("admin_exc_multisell"))
@@ -85,7 +86,7 @@ public class AdminShop implements IAdminCommandHandler
} }
catch (NumberFormatException | IndexOutOfBoundsException e) catch (NumberFormatException | IndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Please specify multisell list ID."); BuilderUtil.sendSysMessage(activeChar, "Please specify multisell list ID.");
} }
} }
return true; return true;

View File

@@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
/** /**
@@ -53,7 +54,7 @@ public class AdminShutdown implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Usage: //server_shutdown <seconds>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //server_shutdown <seconds>");
sendHtmlForm(activeChar); sendHtmlForm(activeChar);
} }
} }
@@ -73,7 +74,7 @@ public class AdminShutdown implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Usage: //server_restart <seconds>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //server_restart <seconds>");
sendHtmlForm(activeChar); sendHtmlForm(activeChar);
} }
} }

View File

@@ -36,6 +36,7 @@ import com.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.PledgeSkillList; import com.l2jmobius.gameserver.network.serverpackets.PledgeSkillList;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: * This class handles following admin commands:
@@ -126,7 +127,7 @@ public class AdminSkill implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //add_skill <skill_id> <level>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //add_skill <skill_id> <level>");
} }
} }
else if (command.startsWith("admin_remove_skill")) else if (command.startsWith("admin_remove_skill"))
@@ -139,7 +140,7 @@ public class AdminSkill implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //remove_skill <skill_id>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //remove_skill <skill_id>");
} }
} }
else if (command.equals("admin_get_skills")) else if (command.equals("admin_get_skills"))
@@ -179,7 +180,7 @@ public class AdminSkill implements IAdminCommandHandler
{ {
player.removeSkill(skill); player.removeSkill(skill);
} }
activeChar.sendMessage("You have removed all skills from " + player.getName() + "."); BuilderUtil.sendSysMessage(activeChar, "You have removed all skills from " + player.getName() + ".");
player.sendMessage("Admin removed all skills from you."); player.sendMessage("Admin removed all skills from you.");
player.sendSkillList(); player.sendSkillList();
player.broadcastUserInfo(); player.broadcastUserInfo();
@@ -194,7 +195,7 @@ public class AdminSkill implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //add_clan_skill <skill_id> <level>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //add_clan_skill <skill_id> <level>");
} }
} }
else if (command.startsWith("admin_setskill")) else if (command.startsWith("admin_setskill"))
@@ -207,12 +208,12 @@ public class AdminSkill implements IAdminCommandHandler
{ {
activeChar.addSkill(skill); activeChar.addSkill(skill);
activeChar.sendSkillList(); activeChar.sendSkillList();
activeChar.sendMessage("You added yourself skill " + skill.getName() + "(" + id + ") level " + lvl); BuilderUtil.sendSysMessage(activeChar, "You added yourself skill " + skill.getName() + "(" + id + ") level " + lvl);
activeChar.sendPacket(new AcquireSkillList(activeChar)); activeChar.sendPacket(new AcquireSkillList(activeChar));
} }
else else
{ {
activeChar.sendMessage("No such skill found. Id: " + id + " Level: " + lvl); BuilderUtil.sendSysMessage(activeChar, "No such skill found. Id: " + id + " Level: " + lvl);
} }
} }
else if (command.startsWith("admin_cast")) else if (command.startsWith("admin_cast"))
@@ -221,8 +222,8 @@ public class AdminSkill implements IAdminCommandHandler
command = st.nextToken(); command = st.nextToken();
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Skill Id and level are not specified."); BuilderUtil.sendSysMessage(activeChar, "Skill Id and level are not specified.");
activeChar.sendMessage("Usage: //cast <skillId> <skillLevel>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //cast <skillId> <skillLevel>");
return false; return false;
} }
@@ -233,13 +234,13 @@ public class AdminSkill implements IAdminCommandHandler
final Skill skill = SkillData.getInstance().getSkill(skillId, skillLevel); final Skill skill = SkillData.getInstance().getSkill(skillId, skillLevel);
if (skill == null) if (skill == null)
{ {
activeChar.sendMessage("Skill with id: " + skillId + ", lvl: " + skillLevel + " not found."); BuilderUtil.sendSysMessage(activeChar, "Skill with id: " + skillId + ", lvl: " + skillLevel + " not found.");
return false; return false;
} }
if (command.equalsIgnoreCase("admin_castnow")) if (command.equalsIgnoreCase("admin_castnow"))
{ {
activeChar.sendMessage("Admin instant casting " + skill.getName() + " (" + skillId + "," + skillLevel + ")"); BuilderUtil.sendSysMessage(activeChar, "Admin instant casting " + skill.getName() + " (" + skillId + "," + skillLevel + ")");
final L2Object target = skill.getTarget(activeChar, true, false, true); final L2Object target = skill.getTarget(activeChar, true, false, true);
if (target != null) if (target != null)
{ {
@@ -254,7 +255,7 @@ public class AdminSkill implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Admin casting " + skill.getName() + " (" + skillId + "," + skillLevel + ")"); BuilderUtil.sendSysMessage(activeChar, "Admin casting " + skill.getName() + " (" + skillId + "," + skillLevel + ")");
activeChar.doCast(skill); activeChar.doCast(skill);
} }
@@ -262,8 +263,8 @@ public class AdminSkill implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Failed casting: " + e.getMessage()); BuilderUtil.sendSysMessage(activeChar, "Failed casting: " + e.getMessage());
activeChar.sendMessage("Usage: //cast <skillId> <skillLevel>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //cast <skillId> <skillLevel>");
return false; return false;
} }
} }
@@ -285,7 +286,7 @@ public class AdminSkill implements IAdminCommandHandler
} }
final L2PcInstance player = target.getActingPlayer(); final L2PcInstance player = target.getActingPlayer();
// Notify player and admin // Notify player and admin
activeChar.sendMessage("You gave " + player.giveAvailableSkills(includedByFs, true) + " skills to " + player.getName()); BuilderUtil.sendSysMessage(activeChar, "You gave " + player.giveAvailableSkills(includedByFs, true) + " skills to " + player.getName());
player.sendSkillList(); player.sendSkillList();
player.sendPacket(new AcquireSkillList(player)); player.sendPacket(new AcquireSkillList(player));
} }
@@ -334,7 +335,7 @@ public class AdminSkill implements IAdminCommandHandler
member.sendSkillList(); member.sendSkillList();
} }
activeChar.sendMessage("You gave " + skills.size() + " skills to " + player.getName() + "'s clan " + clan.getName() + "."); BuilderUtil.sendSysMessage(activeChar, "You gave " + skills.size() + " skills to " + player.getName() + "'s clan " + clan.getName() + ".");
player.sendMessage("Your clan received " + skills.size() + " skills."); player.sendMessage("Your clan received " + skills.size() + " skills.");
} }
@@ -444,7 +445,7 @@ public class AdminSkill implements IAdminCommandHandler
{ {
activeChar.addSkill(skill, true); activeChar.addSkill(skill, true);
} }
activeChar.sendMessage("You now have all the skills of " + player.getName() + "."); BuilderUtil.sendSysMessage(activeChar, "You now have all the skills of " + player.getName() + ".");
activeChar.sendSkillList(); activeChar.sendSkillList();
} }
showMainPage(activeChar); showMainPage(activeChar);
@@ -464,7 +465,7 @@ public class AdminSkill implements IAdminCommandHandler
final L2PcInstance player = target.getActingPlayer(); final L2PcInstance player = target.getActingPlayer();
if (adminSkills == null) if (adminSkills == null)
{ {
activeChar.sendMessage("You must get the skills of someone in order to do this."); BuilderUtil.sendSysMessage(activeChar, "You must get the skills of someone in order to do this.");
} }
else else
{ {
@@ -486,7 +487,7 @@ public class AdminSkill implements IAdminCommandHandler
activeChar.addSkill(skill, true); activeChar.addSkill(skill, true);
} }
player.sendMessage("[GM]" + activeChar.getName() + " updated your skills."); player.sendMessage("[GM]" + activeChar.getName() + " updated your skills.");
activeChar.sendMessage("You now have all your skills back."); BuilderUtil.sendSysMessage(activeChar, "You now have all your skills back.");
adminSkills = null; adminSkills = null;
activeChar.sendSkillList(); activeChar.sendSkillList();
player.sendSkillList(); player.sendSkillList();
@@ -536,12 +537,12 @@ public class AdminSkill implements IAdminCommandHandler
player.addSkill(skill, true); player.addSkill(skill, true);
player.sendSkillList(); player.sendSkillList();
// Admin info. // Admin info.
activeChar.sendMessage("You gave the skill " + name + " to " + player.getName() + "."); BuilderUtil.sendSysMessage(activeChar, "You gave the skill " + name + " to " + player.getName() + ".");
activeChar.sendSkillList(); activeChar.sendSkillList();
} }
else else
{ {
activeChar.sendMessage("Error: there is no such skill."); BuilderUtil.sendSysMessage(activeChar, "Error: there is no such skill.");
} }
showMainPage(activeChar); // Back to start showMainPage(activeChar); // Back to start
} }
@@ -567,12 +568,12 @@ public class AdminSkill implements IAdminCommandHandler
player.sendMessage("Admin removed the skill " + skillname + " from your skills list."); player.sendMessage("Admin removed the skill " + skillname + " from your skills list.");
player.removeSkill(skill); player.removeSkill(skill);
// Admin information // Admin information
activeChar.sendMessage("You removed the skill " + skillname + " from " + player.getName() + "."); BuilderUtil.sendSysMessage(activeChar, "You removed the skill " + skillname + " from " + player.getName() + ".");
activeChar.sendSkillList(); activeChar.sendSkillList();
} }
else else
{ {
activeChar.sendMessage("Error: there is no such skill."); BuilderUtil.sendSysMessage(activeChar, "Error: there is no such skill.");
} }
removeSkillsPage(activeChar, 0); // Back to previous page removeSkillsPage(activeChar, 0); // Back to previous page
} }
@@ -602,7 +603,7 @@ public class AdminSkill implements IAdminCommandHandler
} }
if ((id < 370) || (id > 391) || (level < 1) || (level > 3)) if ((id < 370) || (id > 391) || (level < 1) || (level > 3))
{ {
activeChar.sendMessage("Usage: //add_clan_skill <skill_id> <level>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //add_clan_skill <skill_id> <level>");
showMainPage(activeChar); showMainPage(activeChar);
return; return;
} }
@@ -610,7 +611,7 @@ public class AdminSkill implements IAdminCommandHandler
final Skill skill = SkillData.getInstance().getSkill(id, level); final Skill skill = SkillData.getInstance().getSkill(id, level);
if (skill == null) if (skill == null)
{ {
activeChar.sendMessage("Error: there is no such skill."); BuilderUtil.sendSysMessage(activeChar, "Error: there is no such skill.");
return; return;
} }
@@ -621,7 +622,7 @@ public class AdminSkill implements IAdminCommandHandler
final L2Clan clan = player.getClan(); final L2Clan clan = player.getClan();
clan.broadcastToOnlineMembers(sm); clan.broadcastToOnlineMembers(sm);
clan.addNewSkill(skill); clan.addNewSkill(skill);
activeChar.sendMessage("You gave the Clan Skill: " + skillname + " to the clan " + clan.getName() + "."); BuilderUtil.sendSysMessage(activeChar, "You gave the Clan Skill: " + skillname + " to the clan " + clan.getName() + ".");
clan.broadcastToOnlineMembers(new PledgeSkillList(clan)); clan.broadcastToOnlineMembers(new PledgeSkillList(clan));
for (L2PcInstance member : clan.getOnlineMembers(0)) for (L2PcInstance member : clan.getOnlineMembers(0))

View File

@@ -42,6 +42,7 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.Broadcast; import com.l2jmobius.gameserver.util.Broadcast;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - show_spawns = shows menu - spawn_index lvl = shows menu for monsters with respective level - spawn_monster id = spawns monster id on target * This class handles following admin commands: - show_spawns = shows menu - spawn_index lvl = shows menu for monsters with respective level - spawn_monster id = spawns monster id on target
@@ -195,17 +196,17 @@ public class AdminSpawn implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Cannot find instance " + instance); BuilderUtil.sendSysMessage(activeChar, "Cannot find instance " + instance);
} }
} }
else else
{ {
activeChar.sendMessage("Invalid instance number."); BuilderUtil.sendSysMessage(activeChar, "Invalid instance number.");
} }
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage //instance_spawns <instance_number>"); BuilderUtil.sendSysMessage(activeChar, "Usage //instance_spawns <instance_number>");
} }
} }
else if (command.startsWith("admin_unspawnall")) else if (command.startsWith("admin_unspawnall"))
@@ -301,7 +302,7 @@ public class AdminSpawn implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Command format is //list_spawns <npcId|npc_name> [tele_index]"); BuilderUtil.sendSysMessage(activeChar, "Command format is //list_spawns <npcId|npc_name> [tele_index]");
} }
if (command.startsWith("admin_list_positions")) if (command.startsWith("admin_list_positions"))
{ {
@@ -445,7 +446,7 @@ public class AdminSpawn implements IAdminCommandHandler
} }
spawn.getLastSpawn().broadcastInfo(); spawn.getLastSpawn().broadcastInfo();
activeChar.sendMessage("Created " + template1.getName() + " on " + target.getObjectId()); BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId());
} }
catch (Exception e) catch (Exception e)
{ {
@@ -491,7 +492,7 @@ public class AdminSpawn implements IAdminCommandHandler
spawn.stopRespawn(); spawn.stopRespawn();
} }
spawn.getLastSpawn().broadcastInfo(); spawn.getLastSpawn().broadcastInfo();
activeChar.sendMessage("Created " + template1.getName() + " on " + target.getObjectId()); BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId());
} }
catch (Exception e) catch (Exception e)
{ {

View File

@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import com.l2jmobius.gameserver.handler.AdminCommandHandler; import com.l2jmobius.gameserver.handler.AdminCommandHandler;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler; import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* @author poltomb * @author poltomb
@@ -53,7 +54,7 @@ public class AdminSummon implements IAdminCommandHandler
} }
catch (NumberFormatException nfe) catch (NumberFormatException nfe)
{ {
activeChar.sendMessage("Incorrect format for command 'summon'"); BuilderUtil.sendSysMessage(activeChar, "Incorrect format for command 'summon'");
return false; return false;
} }
@@ -66,7 +67,7 @@ public class AdminSummon implements IAdminCommandHandler
{ {
subCommand = "admin_spawn_once"; subCommand = "admin_spawn_once";
activeChar.sendMessage("This is only a temporary spawn. The mob(s) will NOT respawn."); BuilderUtil.sendSysMessage(activeChar, "This is only a temporary spawn. The mob(s) will NOT respawn.");
id -= 1000000; id -= 1000000;
} }

View File

@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler; import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - target name = sets player with respective name as target * This class handles following admin commands: - target name = sets player with respective name as target
@@ -59,12 +60,12 @@ public class AdminTarget implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Player " + targetName + " not found"); BuilderUtil.sendSysMessage(activeChar, "Player " + targetName + " not found");
} }
} }
catch (IndexOutOfBoundsException e) catch (IndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Please specify correct name."); BuilderUtil.sendSysMessage(activeChar, "Please specify correct name.");
} }
} }
} }

View File

@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2StaticObjectInstance; import com.l2jmobius.gameserver.model.actor.instance.L2StaticObjectInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.CreatureSay; import com.l2jmobius.gameserver.network.serverpackets.CreatureSay;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - targetsay <message> = makes talk a L2Character * This class handles following admin commands: - targetsay <message> = makes talk a L2Character
@@ -56,7 +57,7 @@ public class AdminTargetSay implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Usage: //targetsay <text>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //targetsay <text>");
return false; return false;
} }
} }

View File

@@ -151,7 +151,7 @@ public class AdminTeleport implements IAdminCommandHandler
} }
catch (NumberFormatException nfe) catch (NumberFormatException nfe)
{ {
activeChar.sendMessage("Usage: //move_to <x> <y> <z>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //move_to <x> <y> <z>");
AdminHtml.showAdminHtml(activeChar, "teleports.htm"); AdminHtml.showAdminHtml(activeChar, "teleports.htm");
} }
} }
@@ -166,7 +166,7 @@ public class AdminTeleport implements IAdminCommandHandler
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
// Case of empty coordinates // Case of empty coordinates
activeChar.sendMessage("Wrong or no Coordinates given."); BuilderUtil.sendSysMessage(activeChar, "Wrong or no Coordinates given.");
showTeleportCharWindow(activeChar); // back to character teleport showTeleportCharWindow(activeChar); // back to character teleport
} }
} }
@@ -196,7 +196,7 @@ public class AdminTeleport implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Wrong coordinates!"); BuilderUtil.sendSysMessage(activeChar, "Wrong coordinates!");
} }
} }
else if (command.startsWith("admin_recall ")) else if (command.startsWith("admin_recall "))
@@ -206,7 +206,7 @@ public class AdminTeleport implements IAdminCommandHandler
final String[] param = command.split(" "); final String[] param = command.split(" ");
if (param.length != 2) if (param.length != 2)
{ {
activeChar.sendMessage("Usage: //recall <playername>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //recall <playername>");
return false; return false;
} }
final String targetName = param[1]; final String targetName = param[1];
@@ -270,7 +270,7 @@ public class AdminTeleport implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //go<north|south|east|west|up|down> [offset] (default 150)"); BuilderUtil.sendSysMessage(activeChar, "Usage: //go<north|south|east|west|up|down> [offset] (default 150)");
} }
} }
else if (command.startsWith("admin_sendhome")) else if (command.startsWith("admin_sendhome"))
@@ -279,7 +279,7 @@ public class AdminTeleport implements IAdminCommandHandler
st.nextToken(); // Skip command. st.nextToken(); // Skip command.
if (st.countTokens() > 1) if (st.countTokens() > 1)
{ {
activeChar.sendMessage("Usage: //sendhome <playername>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //sendhome <playername>");
} }
else if (st.countTokens() == 1) else if (st.countTokens() == 1)
{ {
@@ -369,11 +369,11 @@ public class AdminTeleport implements IAdminCommandHandler
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
activeChar.teleToLocation(x, y, z, null); activeChar.teleToLocation(x, y, z, null);
activeChar.sendMessage("You have been teleported to " + Coords); BuilderUtil.sendSysMessage(activeChar, "You have been teleported to " + Coords);
} }
catch (NoSuchElementException nsee) catch (NoSuchElementException nsee)
{ {
activeChar.sendMessage("Wrong or no Coordinates given."); BuilderUtil.sendSysMessage(activeChar, "Wrong or no Coordinates given.");
} }
} }
@@ -451,11 +451,11 @@ public class AdminTeleport implements IAdminCommandHandler
// Check for jail // Check for jail
if (player.isJailed()) if (player.isJailed())
{ {
activeChar.sendMessage("Sorry, player " + player.getName() + " is in Jail."); BuilderUtil.sendSysMessage(activeChar, "Sorry, player " + player.getName() + " is in Jail.");
} }
else else
{ {
activeChar.sendMessage("You have recalled " + player.getName()); BuilderUtil.sendSysMessage(activeChar, "You have recalled " + player.getName());
player.sendMessage("Admin is teleporting you."); player.sendMessage("Admin is teleporting you.");
player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
player.teleToLocation(loc, true, activeChar.getInstanceWorld()); player.teleToLocation(loc, true, activeChar.getInstanceWorld());
@@ -480,7 +480,7 @@ public class AdminTeleport implements IAdminCommandHandler
{ {
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
activeChar.teleToLocation(player, true, player.getInstanceWorld()); activeChar.teleToLocation(player, true, player.getInstanceWorld());
activeChar.sendMessage("You have teleported to character " + player.getName() + "."); BuilderUtil.sendSysMessage(activeChar, "You have teleported to character " + player.getName() + ".");
} }
} }
@@ -501,16 +501,16 @@ public class AdminTeleport implements IAdminCommandHandler
statement.close(); statement.close();
if (count == 0) if (count == 0)
{ {
activeChar.sendMessage("Character not found or position unaltered."); BuilderUtil.sendSysMessage(activeChar, "Character not found or position unaltered.");
} }
else else
{ {
activeChar.sendMessage("Player's [" + name + "] position is now set to (" + x + "," + y + "," + z + ")."); BuilderUtil.sendSysMessage(activeChar, "Player's [" + name + "] position is now set to (" + x + "," + y + "," + z + ").");
} }
} }
catch (SQLException se) catch (SQLException se)
{ {
activeChar.sendMessage("SQLException while changing offline character's position"); BuilderUtil.sendSysMessage(activeChar, "SQLException while changing offline character's position");
} }
} }
@@ -525,7 +525,7 @@ public class AdminTeleport implements IAdminCommandHandler
final L2NpcTemplate template1 = NpcData.getInstance().getTemplate(monsterTemplate); final L2NpcTemplate template1 = NpcData.getInstance().getTemplate(monsterTemplate);
if (template1 == null) if (template1 == null)
{ {
activeChar.sendMessage("Incorrect monster template."); BuilderUtil.sendSysMessage(activeChar, "Incorrect monster template.");
LOGGER.warning("ERROR: NPC " + target.getObjectId() + " has a 'null' template."); LOGGER.warning("ERROR: NPC " + target.getObjectId() + " has a 'null' template.");
return; return;
} }
@@ -533,7 +533,7 @@ public class AdminTeleport implements IAdminCommandHandler
L2Spawn spawn = target.getSpawn(); L2Spawn spawn = target.getSpawn();
if (spawn == null) if (spawn == null)
{ {
activeChar.sendMessage("Incorrect monster spawn."); BuilderUtil.sendSysMessage(activeChar, "Incorrect monster spawn.");
LOGGER.warning("ERROR: NPC " + target.getObjectId() + " has a 'null' spawn."); LOGGER.warning("ERROR: NPC " + target.getObjectId() + " has a 'null' spawn.");
return; return;
} }
@@ -559,11 +559,11 @@ public class AdminTeleport implements IAdminCommandHandler
SpawnTable.getInstance().addNewSpawn(spawn, true); SpawnTable.getInstance().addNewSpawn(spawn, true);
spawn.init(); spawn.init();
activeChar.sendMessage("Created " + template1.getName() + " on " + target.getObjectId() + "."); BuilderUtil.sendSysMessage(activeChar, "Created " + template1.getName() + " on " + target.getObjectId() + ".");
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Target is not in game."); BuilderUtil.sendSysMessage(activeChar, "Target is not in game.");
} }
} }
@@ -575,7 +575,7 @@ public class AdminTeleport implements IAdminCommandHandler
final double curMP = target.getCurrentMp(); final double curMP = target.getCurrentMp();
if (spawn == null) if (spawn == null)
{ {
activeChar.sendMessage("Incorrect raid spawn."); BuilderUtil.sendSysMessage(activeChar, "Incorrect raid spawn.");
LOGGER.warning("ERROR: NPC Id" + target.getId() + " has a 'null' spawn."); LOGGER.warning("ERROR: NPC Id" + target.getId() + " has a 'null' spawn.");
return; return;
} }

View File

@@ -28,6 +28,7 @@ import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.network.serverpackets.MagicSkillUse; import com.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* @version $Revision: 1.2 $ $Date: 2004/06/27 08:12:59 $ * @version $Revision: 1.2 $ $Date: 2004/06/27 08:12:59 $
@@ -69,11 +70,11 @@ public class AdminTest implements IAdminCommandHandler
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
activeChar.sendMessage("Command format is //skill_test <ID>"); BuilderUtil.sendSysMessage(activeChar, "Command format is //skill_test <ID>");
} }
catch (NoSuchElementException nsee) catch (NoSuchElementException nsee)
{ {
activeChar.sendMessage("Command format is //skill_test <ID>"); BuilderUtil.sendSysMessage(activeChar, "Command format is //skill_test <ID>");
} }
} }
else if (command.equals("admin_known on")) else if (command.equals("admin_known on"))

View File

@@ -20,6 +20,7 @@ import java.util.logging.Logger;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler; import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: * This class handles following admin commands:
@@ -47,12 +48,12 @@ public class AdminUnblockIp implements IAdminCommandHandler
final String ipAddress = command.substring(16); final String ipAddress = command.substring(16);
if (unblockIp(ipAddress, activeChar)) if (unblockIp(ipAddress, activeChar))
{ {
activeChar.sendMessage("Removed IP " + ipAddress + " from blocklist!"); BuilderUtil.sendSysMessage(activeChar, "Removed IP " + ipAddress + " from blocklist!");
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Usage: //unblockip <ip>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //unblockip <ip>");
} }
} }

View File

@@ -22,6 +22,7 @@ import com.l2jmobius.Config;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler; import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.stat.PcStat; import com.l2jmobius.gameserver.model.actor.stat.PcStat;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* @author Psychokiller1888 * @author Psychokiller1888
@@ -46,7 +47,7 @@ public class AdminVitality implements IAdminCommandHandler
if (!Config.ENABLE_VITALITY) if (!Config.ENABLE_VITALITY)
{ {
activeChar.sendMessage("Vitality is not enabled on the server!"); BuilderUtil.sendSysMessage(activeChar, "Vitality is not enabled on the server!");
return false; return false;
} }
@@ -67,7 +68,7 @@ public class AdminVitality implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Incorrect vitality"); BuilderUtil.sendSysMessage(activeChar, "Incorrect vitality");
} }
target.setVitalityPoints(vitality, true); target.setVitalityPoints(vitality, true);
@@ -86,11 +87,11 @@ public class AdminVitality implements IAdminCommandHandler
else if (cmd.equals("admin_get_vitality")) else if (cmd.equals("admin_get_vitality"))
{ {
vitality = target.getVitalityPoints(); vitality = target.getVitalityPoints();
activeChar.sendMessage("Player vitality points: " + vitality); BuilderUtil.sendSysMessage(activeChar, "Player vitality points: " + vitality);
} }
return true; return true;
} }
activeChar.sendMessage("Target not found or not a player"); BuilderUtil.sendSysMessage(activeChar, "Target not found or not a player");
return false; return false;
} }

View File

@@ -29,6 +29,7 @@ import com.l2jmobius.gameserver.model.zone.L2ZoneType;
import com.l2jmobius.gameserver.model.zone.ZoneId; import com.l2jmobius.gameserver.model.zone.ZoneId;
import com.l2jmobius.gameserver.model.zone.type.L2SpawnTerritory; import com.l2jmobius.gameserver.model.zone.type.L2SpawnTerritory;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* Small typo fix by Zoey76 24/02/2011 * Small typo fix by Zoey76 24/02/2011
@@ -59,9 +60,9 @@ public class AdminZone implements IAdminCommandHandler
if (actualCommand.equalsIgnoreCase("admin_zone_check")) if (actualCommand.equalsIgnoreCase("admin_zone_check"))
{ {
showHtml(activeChar); showHtml(activeChar);
activeChar.sendMessage("MapRegion: x:" + MapRegionManager.getInstance().getMapRegionX(activeChar.getX()) + " y:" + MapRegionManager.getInstance().getMapRegionY(activeChar.getY()) + " (" + MapRegionManager.getInstance().getMapRegionLocId(activeChar) + ")"); BuilderUtil.sendSysMessage(activeChar, "MapRegion: x:" + MapRegionManager.getInstance().getMapRegionX(activeChar.getX()) + " y:" + MapRegionManager.getInstance().getMapRegionY(activeChar.getY()) + " (" + MapRegionManager.getInstance().getMapRegionLocId(activeChar) + ")");
getGeoRegionXY(activeChar); getGeoRegionXY(activeChar);
activeChar.sendMessage("Closest Town: " + MapRegionManager.getInstance().getClosestTownName(activeChar)); BuilderUtil.sendSysMessage(activeChar, "Closest Town: " + MapRegionManager.getInstance().getClosestTownName(activeChar));
// Prevent exit instance variable deletion. // Prevent exit instance variable deletion.
if (!activeChar.isInInstance()) if (!activeChar.isInInstance())
@@ -69,16 +70,16 @@ public class AdminZone implements IAdminCommandHandler
Location loc; Location loc;
loc = MapRegionManager.getInstance().getTeleToLocation(activeChar, TeleportWhereType.CASTLE); loc = MapRegionManager.getInstance().getTeleToLocation(activeChar, TeleportWhereType.CASTLE);
activeChar.sendMessage("TeleToLocation (Castle): x:" + loc.getX() + " y:" + loc.getY() + " z:" + loc.getZ()); BuilderUtil.sendSysMessage(activeChar, "TeleToLocation (Castle): x:" + loc.getX() + " y:" + loc.getY() + " z:" + loc.getZ());
loc = MapRegionManager.getInstance().getTeleToLocation(activeChar, TeleportWhereType.CLANHALL); loc = MapRegionManager.getInstance().getTeleToLocation(activeChar, TeleportWhereType.CLANHALL);
activeChar.sendMessage("TeleToLocation (ClanHall): x:" + loc.getX() + " y:" + loc.getY() + " z:" + loc.getZ()); BuilderUtil.sendSysMessage(activeChar, "TeleToLocation (ClanHall): x:" + loc.getX() + " y:" + loc.getY() + " z:" + loc.getZ());
loc = MapRegionManager.getInstance().getTeleToLocation(activeChar, TeleportWhereType.SIEGEFLAG); loc = MapRegionManager.getInstance().getTeleToLocation(activeChar, TeleportWhereType.SIEGEFLAG);
activeChar.sendMessage("TeleToLocation (SiegeFlag): x:" + loc.getX() + " y:" + loc.getY() + " z:" + loc.getZ()); BuilderUtil.sendSysMessage(activeChar, "TeleToLocation (SiegeFlag): x:" + loc.getX() + " y:" + loc.getY() + " z:" + loc.getZ());
loc = MapRegionManager.getInstance().getTeleToLocation(activeChar, TeleportWhereType.TOWN); loc = MapRegionManager.getInstance().getTeleToLocation(activeChar, TeleportWhereType.TOWN);
activeChar.sendMessage("TeleToLocation (Town): x:" + loc.getX() + " y:" + loc.getY() + " z:" + loc.getZ()); BuilderUtil.sendSysMessage(activeChar, "TeleToLocation (Town): x:" + loc.getX() + " y:" + loc.getY() + " z:" + loc.getZ());
} }
} }
else if (actualCommand.equalsIgnoreCase("admin_zone_visual")) else if (actualCommand.equalsIgnoreCase("admin_zone_visual"))
@@ -168,7 +169,7 @@ public class AdminZone implements IAdminCommandHandler
final int worldY = activeChar.getY(); final int worldY = activeChar.getY();
final int geoX = (((worldX - -327680) >> 4) >> 11) + 10; final int geoX = (((worldX - -327680) >> 4) >> 11) + 10;
final int geoY = (((worldY - -262144) >> 4) >> 11) + 10; final int geoY = (((worldY - -262144) >> 4) >> 11) + 10;
activeChar.sendMessage("GeoRegion: " + geoX + "_" + geoY + ""); BuilderUtil.sendSysMessage(activeChar, "GeoRegion: " + geoX + "_" + geoY + "");
} }
@Override @Override

View File

@@ -55,6 +55,7 @@ import com.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
import com.l2jmobius.gameserver.network.serverpackets.ExServerPrimitive; import com.l2jmobius.gameserver.network.serverpackets.ExServerPrimitive;
import com.l2jmobius.gameserver.network.serverpackets.ExShowTerritory; import com.l2jmobius.gameserver.network.serverpackets.ExShowTerritory;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
import ai.AbstractNpcAI; import ai.AbstractNpcAI;
@@ -177,13 +178,13 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
{ {
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Missing node index!"); BuilderUtil.sendSysMessage(activeChar, "Missing node index!");
break; break;
} }
final String indexToken = st.nextToken(); final String indexToken = st.nextToken();
if (!Util.isDigit(indexToken)) if (!Util.isDigit(indexToken))
{ {
activeChar.sendMessage("Node index should be int!"); BuilderUtil.sendSysMessage(activeChar, "Node index should be int!");
break; break;
} }
final int index = Integer.parseInt(indexToken); final int index = Integer.parseInt(indexToken);
@@ -194,13 +195,13 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
{ {
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Missing node index!"); BuilderUtil.sendSysMessage(activeChar, "Missing node index!");
break; break;
} }
final String indexToken = st.nextToken(); final String indexToken = st.nextToken();
if (!Util.isDigit(indexToken)) if (!Util.isDigit(indexToken))
{ {
activeChar.sendMessage("Node index should be int!"); BuilderUtil.sendSysMessage(activeChar, "Node index should be int!");
break; break;
} }
final int index = Integer.parseInt(indexToken); final int index = Integer.parseInt(indexToken);
@@ -276,7 +277,7 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
*/ */
private void loadZone(L2PcInstance activeChar, String zoneName) private void loadZone(L2PcInstance activeChar, String zoneName)
{ {
activeChar.sendMessage("Searching for zone: " + zoneName); BuilderUtil.sendSysMessage(activeChar, "Searching for zone: " + zoneName);
final List<L2ZoneType> zones = ZoneManager.getInstance().getZones(activeChar); final List<L2ZoneType> zones = ZoneManager.getInstance().getZones(activeChar);
L2ZoneType zoneType = null; L2ZoneType zoneType = null;
for (L2ZoneType zone : zones) for (L2ZoneType zone : zones)
@@ -284,7 +285,7 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
if (zone.getName().equalsIgnoreCase(zoneName)) if (zone.getName().equalsIgnoreCase(zoneName))
{ {
zoneType = zone; zoneType = zone;
activeChar.sendMessage("Zone found: " + zone.getId()); BuilderUtil.sendSysMessage(activeChar, "Zone found: " + zone.getId());
break; break;
} }
} }
@@ -315,7 +316,7 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
{ {
if (name.contains("<") || name.contains(">") || name.contains("&") || name.contains("\\") || name.contains("\"") || name.contains("$")) if (name.contains("<") || name.contains(">") || name.contains("&") || name.contains("\\") || name.contains("\"") || name.contains("$"))
{ {
activeChar.sendMessage("You cannot use symbols like: < > & \" $ \\"); BuilderUtil.sendSysMessage(activeChar, "You cannot use symbols like: < > & \" $ \\");
return; return;
} }
_zones.computeIfAbsent(activeChar.getObjectId(), key -> new ZoneNodeHolder(activeChar)).setName(name); _zones.computeIfAbsent(activeChar.getObjectId(), key -> new ZoneNodeHolder(activeChar)).setName(name);
@@ -329,11 +330,11 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
if (!activeChar.hasAction(PlayerAction.ADMIN_POINT_PICKING)) if (!activeChar.hasAction(PlayerAction.ADMIN_POINT_PICKING))
{ {
activeChar.addAction(PlayerAction.ADMIN_POINT_PICKING); activeChar.addAction(PlayerAction.ADMIN_POINT_PICKING);
activeChar.sendMessage("Point picking mode activated!"); BuilderUtil.sendSysMessage(activeChar, "Point picking mode activated!");
} }
else else
{ {
activeChar.sendMessage("Point picking mode is already activated!"); BuilderUtil.sendSysMessage(activeChar, "Point picking mode is already activated!");
} }
} }
@@ -344,11 +345,11 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
{ {
if (activeChar.removeAction(PlayerAction.ADMIN_POINT_PICKING)) if (activeChar.removeAction(PlayerAction.ADMIN_POINT_PICKING))
{ {
activeChar.sendMessage("Point picking mode deactivated!"); BuilderUtil.sendSysMessage(activeChar, "Point picking mode deactivated!");
} }
else else
{ {
activeChar.sendMessage("Point picking mode was not activated!"); BuilderUtil.sendSysMessage(activeChar, "Point picking mode was not activated!");
} }
} }
@@ -362,7 +363,7 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
{ {
if (holder.getNodes().size() < 3) if (holder.getNodes().size() < 3)
{ {
activeChar.sendMessage("In order to visualize this zone you must have at least 3 points."); BuilderUtil.sendSysMessage(activeChar, "In order to visualize this zone you must have at least 3 points.");
return; return;
} }
final ExServerPrimitive exsp = new ExServerPrimitive("DebugPoint_" + activeChar.getObjectId(), activeChar.getX(), activeChar.getY(), activeChar.getZ()); final ExServerPrimitive exsp = new ExServerPrimitive("DebugPoint_" + activeChar.getObjectId(), activeChar.getX(), activeChar.getY(), activeChar.getZ());
@@ -427,10 +428,10 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
if (loc != null) if (loc != null)
{ {
holder.getNodes().remove(loc); holder.getNodes().remove(loc);
activeChar.sendMessage("Node " + index + " has been removed!"); BuilderUtil.sendSysMessage(activeChar, "Node " + index + " has been removed!");
if (holder.getNodes().isEmpty()) if (holder.getNodes().isEmpty())
{ {
activeChar.sendMessage("Since node list is empty destroying session!"); BuilderUtil.sendSysMessage(activeChar, "Since node list is empty destroying session!");
_zones.remove(activeChar.getObjectId()); _zones.remove(activeChar.getObjectId());
} }
} }
@@ -447,7 +448,7 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
{ {
if (holder.getName().isEmpty()) if (holder.getName().isEmpty())
{ {
activeChar.sendMessage("Set name first!"); BuilderUtil.sendSysMessage(activeChar, "Set name first!");
return; return;
} }
@@ -479,11 +480,11 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
file.getParentFile().mkdirs(); file.getParentFile().mkdirs();
} }
Files.write(file.toPath(), sj.toString().getBytes(StandardCharsets.UTF_8)); Files.write(file.toPath(), sj.toString().getBytes(StandardCharsets.UTF_8));
activeChar.sendMessage("Successfully written on: " + file.getAbsolutePath().replace(new File(".").getCanonicalFile().getAbsolutePath(), "")); BuilderUtil.sendSysMessage(activeChar, "Successfully written on: " + file.getAbsolutePath().replace(new File(".").getCanonicalFile().getAbsolutePath(), ""));
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Failed writing the dump: " + e.getMessage()); BuilderUtil.sendSysMessage(activeChar, "Failed writing the dump: " + e.getMessage());
LOGGER.log(Level.WARNING, "Failed writing point picking dump for " + activeChar.getName() + ":" + e.getMessage(), e); LOGGER.log(Level.WARNING, "Failed writing point picking dump for " + activeChar.getName() + ":" + e.getMessage(), e);
} }
} }
@@ -504,13 +505,13 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
{ {
changeLog.setXYZ(newLocation); changeLog.setXYZ(newLocation);
holder.setChangingLoc(null); holder.setChangingLoc(null);
activeChar.sendMessage("Location " + (holder.indexOf(changeLog) + 1) + " has been updated!"); BuilderUtil.sendSysMessage(activeChar, "Location " + (holder.indexOf(changeLog) + 1) + " has been updated!");
disablePicking(activeChar); disablePicking(activeChar);
} }
else else
{ {
holder.addNode(newLocation); holder.addNode(newLocation);
activeChar.sendMessage("Location " + (holder.indexOf(changeLog) + 1) + " has been added!"); BuilderUtil.sendSysMessage(activeChar, "Location " + (holder.indexOf(changeLog) + 1) + " has been added!");
} }
// Auto visualization when nodes >= 3 // Auto visualization when nodes >= 3
if (holder.getNodes().size() >= 3) if (holder.getNodes().size() >= 3)
@@ -537,7 +538,7 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
final List<Location> list = holder.getNodes(); final List<Location> list = holder.getNodes();
if (list.size() < 3) if (list.size() < 3)
{ {
activeChar.sendMessage("You must have at least 3 nodes to use this option!"); BuilderUtil.sendSysMessage(activeChar, "You must have at least 3 nodes to use this option!");
return; return;
} }
@@ -547,7 +548,7 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
final ExShowTerritory exst = new ExShowTerritory(minZ, maxZ); final ExShowTerritory exst = new ExShowTerritory(minZ, maxZ);
list.forEach(exst::addVertice); list.forEach(exst::addVertice);
activeChar.sendPacket(exst); activeChar.sendPacket(exst);
activeChar.sendMessage("In order to remove the debug you must restart your game client!"); BuilderUtil.sendSysMessage(activeChar, "In order to remove the debug you must restart your game client!");
} }
} }
} }

View File

@@ -32,6 +32,7 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.CreatureSay; import com.l2jmobius.gameserver.network.serverpackets.CreatureSay;
import com.l2jmobius.gameserver.network.serverpackets.ExWorldChatCnt; import com.l2jmobius.gameserver.network.serverpackets.ExWorldChatCnt;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
/** /**
@@ -85,13 +86,13 @@ public class AdminAdmin implements IAdminCommandHandler
else if (command.startsWith("admin_gmliston")) else if (command.startsWith("admin_gmliston"))
{ {
AdminData.getInstance().showGm(activeChar); AdminData.getInstance().showGm(activeChar);
activeChar.sendMessage("Registered into gm list"); BuilderUtil.sendSysMessage(activeChar, "Registered into gm list.");
AdminHtml.showAdminHtml(activeChar, "gm_menu.htm"); AdminHtml.showAdminHtml(activeChar, "gm_menu.htm");
} }
else if (command.startsWith("admin_gmlistoff")) else if (command.startsWith("admin_gmlistoff"))
{ {
AdminData.getInstance().hideGm(activeChar); AdminData.getInstance().hideGm(activeChar);
activeChar.sendMessage("Removed from gm list"); BuilderUtil.sendSysMessage(activeChar, "Removed from gm list.");
AdminHtml.showAdminHtml(activeChar, "gm_menu.htm"); AdminHtml.showAdminHtml(activeChar, "gm_menu.htm");
} }
else if (command.startsWith("admin_silence")) else if (command.startsWith("admin_silence"))
@@ -111,7 +112,7 @@ public class AdminAdmin implements IAdminCommandHandler
else if (command.startsWith("admin_saveolymp")) else if (command.startsWith("admin_saveolymp"))
{ {
Olympiad.getInstance().saveOlympiadStatus(); Olympiad.getInstance().saveOlympiadStatus();
activeChar.sendMessage("olympiad system saved."); BuilderUtil.sendSysMessage(activeChar, "olympiad system saved.");
} }
else if (command.startsWith("admin_endolympiad")) else if (command.startsWith("admin_endolympiad"))
{ {
@@ -123,7 +124,7 @@ public class AdminAdmin implements IAdminCommandHandler
{ {
LOGGER.warning("An error occured while ending olympiad: " + e); LOGGER.warning("An error occured while ending olympiad: " + e);
} }
activeChar.sendMessage("Heroes formed."); BuilderUtil.sendSysMessage(activeChar, "Heroes formed.");
} }
else if (command.startsWith("admin_sethero")) else if (command.startsWith("admin_sethero"))
{ {
@@ -160,13 +161,13 @@ public class AdminAdmin implements IAdminCommandHandler
final L2PcInstance target = activeChar.getTarget().isPlayer() ? activeChar.getTarget().getActingPlayer() : activeChar; final L2PcInstance target = activeChar.getTarget().isPlayer() ? activeChar.getTarget().getActingPlayer() : activeChar;
if (Hero.getInstance().isHero(target.getObjectId())) if (Hero.getInstance().isHero(target.getObjectId()))
{ {
activeChar.sendMessage("This player has already claimed the hero status."); BuilderUtil.sendSysMessage(activeChar, "This player has already claimed the hero status.");
return false; return false;
} }
if (!Hero.getInstance().isUnclaimedHero(target.getObjectId())) if (!Hero.getInstance().isUnclaimedHero(target.getObjectId()))
{ {
activeChar.sendMessage("This player cannot claim the hero status."); BuilderUtil.sendSysMessage(activeChar, "This player cannot claim the hero status.");
return false; return false;
} }
Hero.getInstance().claimHero(target); Hero.getInstance().claimHero(target);
@@ -180,12 +181,12 @@ public class AdminAdmin implements IAdminCommandHandler
if (st.nextToken().equalsIgnoreCase("on")) if (st.nextToken().equalsIgnoreCase("on"))
{ {
activeChar.setDietMode(true); activeChar.setDietMode(true);
activeChar.sendMessage("Diet mode on"); BuilderUtil.sendSysMessage(activeChar, "Diet mode on.");
} }
else if (st.nextToken().equalsIgnoreCase("off")) else if (st.nextToken().equalsIgnoreCase("off"))
{ {
activeChar.setDietMode(false); activeChar.setDietMode(false);
activeChar.sendMessage("Diet mode off"); BuilderUtil.sendSysMessage(activeChar, "Diet mode off.");
} }
} }
catch (Exception ex) catch (Exception ex)
@@ -193,12 +194,12 @@ public class AdminAdmin implements IAdminCommandHandler
if (activeChar.getDietMode()) if (activeChar.getDietMode())
{ {
activeChar.setDietMode(false); activeChar.setDietMode(false);
activeChar.sendMessage("Diet mode off"); BuilderUtil.sendSysMessage(activeChar, "Diet mode off.");
} }
else else
{ {
activeChar.setDietMode(true); activeChar.setDietMode(true);
activeChar.sendMessage("Diet mode on"); BuilderUtil.sendSysMessage(activeChar, "Diet mode on.");
} }
} }
finally finally
@@ -215,12 +216,12 @@ public class AdminAdmin implements IAdminCommandHandler
if (mode.equalsIgnoreCase("on")) if (mode.equalsIgnoreCase("on"))
{ {
activeChar.setTradeRefusal(true); activeChar.setTradeRefusal(true);
activeChar.sendMessage("Trade refusal enabled"); BuilderUtil.sendSysMessage(activeChar, "Trade refusal enabled.");
} }
else if (mode.equalsIgnoreCase("off")) else if (mode.equalsIgnoreCase("off"))
{ {
activeChar.setTradeRefusal(false); activeChar.setTradeRefusal(false);
activeChar.sendMessage("Trade refusal disabled"); BuilderUtil.sendSysMessage(activeChar, "Trade refusal disabled.");
} }
} }
catch (Exception ex) catch (Exception ex)
@@ -228,12 +229,12 @@ public class AdminAdmin implements IAdminCommandHandler
if (activeChar.getTradeRefusal()) if (activeChar.getTradeRefusal())
{ {
activeChar.setTradeRefusal(false); activeChar.setTradeRefusal(false);
activeChar.sendMessage("Trade refusal disabled"); BuilderUtil.sendSysMessage(activeChar, "Trade refusal disabled.");
} }
else else
{ {
activeChar.setTradeRefusal(true); activeChar.setTradeRefusal(true);
activeChar.sendMessage("Trade refusal enabled"); BuilderUtil.sendSysMessage(activeChar, "Trade refusal enabled.");
} }
} }
AdminHtml.showAdminHtml(activeChar, "gm_menu.htm"); AdminHtml.showAdminHtml(activeChar, "gm_menu.htm");
@@ -248,7 +249,7 @@ public class AdminAdmin implements IAdminCommandHandler
final String pValue = st.nextToken(); final String pValue = st.nextToken();
if (Float.valueOf(pValue) == null) if (Float.valueOf(pValue) == null)
{ {
activeChar.sendMessage("Invalid parameter!"); BuilderUtil.sendSysMessage(activeChar, "Invalid parameter!");
return false; return false;
} }
switch (pName) switch (pName)
@@ -289,11 +290,11 @@ public class AdminAdmin implements IAdminCommandHandler
break; break;
} }
} }
activeChar.sendMessage("Config parameter " + pName + " set to " + pValue); BuilderUtil.sendSysMessage(activeChar, "Config parameter " + pName + " set to " + pValue);
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //setconfig <parameter> <value>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setconfig <parameter> <value>");
} }
finally finally
{ {
@@ -330,10 +331,10 @@ public class AdminAdmin implements IAdminCommandHandler
final L2PcInstance targetPlayer = target.getActingPlayer(); final L2PcInstance targetPlayer = target.getActingPlayer();
if (targetPlayer.getLevel() < Config.WORLD_CHAT_MIN_LEVEL) if (targetPlayer.getLevel() < Config.WORLD_CHAT_MIN_LEVEL)
{ {
activeChar.sendMessage("Your target's level is below the minimum: " + Config.WORLD_CHAT_MIN_LEVEL); BuilderUtil.sendSysMessage(activeChar, "Your target's level is below the minimum: " + Config.WORLD_CHAT_MIN_LEVEL);
break; break;
} }
activeChar.sendMessage(targetPlayer.getName() + ": has used world chat " + targetPlayer.getWorldChatUsed() + " times out of maximum " + targetPlayer.getWorldChatPoints() + " times."); BuilderUtil.sendSysMessage(activeChar, targetPlayer.getName() + ": has used world chat " + targetPlayer.getWorldChatUsed() + " times out of maximum " + targetPlayer.getWorldChatPoints() + " times.");
break; break;
} }
case "set": case "set":
@@ -348,24 +349,24 @@ public class AdminAdmin implements IAdminCommandHandler
final L2PcInstance targetPlayer = target.getActingPlayer(); final L2PcInstance targetPlayer = target.getActingPlayer();
if (targetPlayer.getLevel() < Config.WORLD_CHAT_MIN_LEVEL) if (targetPlayer.getLevel() < Config.WORLD_CHAT_MIN_LEVEL)
{ {
activeChar.sendMessage("Your target's level is below the minimum: " + Config.WORLD_CHAT_MIN_LEVEL); BuilderUtil.sendSysMessage(activeChar, "Your target's level is below the minimum: " + Config.WORLD_CHAT_MIN_LEVEL);
break; break;
} }
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <times used>"); BuilderUtil.sendSysMessage(activeChar, "Incorrect syntax, use: //worldchat set <times used>");
break; break;
} }
final String valueToken = st.nextToken(); final String valueToken = st.nextToken();
if (!Util.isDigit(valueToken)) if (!Util.isDigit(valueToken))
{ {
activeChar.sendMessage("Incorrect syntax, use: //worldchat set <times used>"); BuilderUtil.sendSysMessage(activeChar, "Incorrect syntax, use: //worldchat set <times used>");
break; break;
} }
activeChar.sendMessage(targetPlayer.getName() + ": times used changed from " + targetPlayer.getWorldChatPoints() + " to " + valueToken); BuilderUtil.sendSysMessage(activeChar, targetPlayer.getName() + ": times used changed from " + targetPlayer.getWorldChatPoints() + " to " + valueToken);
targetPlayer.setWorldChatUsed(Integer.parseInt(valueToken)); targetPlayer.setWorldChatUsed(Integer.parseInt(valueToken));
if (Config.ENABLE_WORLD_CHAT) if (Config.ENABLE_WORLD_CHAT)
{ {
@@ -375,10 +376,10 @@ public class AdminAdmin implements IAdminCommandHandler
} }
default: default:
{ {
activeChar.sendMessage("Possible commands:"); BuilderUtil.sendSysMessage(activeChar, "Possible commands:");
activeChar.sendMessage(" - Send message: //worldchat shout <text>"); BuilderUtil.sendSysMessage(activeChar, " - Send message: //worldchat shout <text>");
activeChar.sendMessage(" - See your target's points: //worldchat see"); BuilderUtil.sendSysMessage(activeChar, " - See your target's points: //worldchat see");
activeChar.sendMessage(" - Change your target's points: //worldchat set <points>"); BuilderUtil.sendSysMessage(activeChar, " - Change your target's points: //worldchat set <points>");
break; break;
} }
} }

View File

@@ -30,6 +30,7 @@ import com.l2jmobius.gameserver.model.announce.IAnnouncement;
import com.l2jmobius.gameserver.model.html.PageBuilder; import com.l2jmobius.gameserver.model.html.PageBuilder;
import com.l2jmobius.gameserver.model.html.PageResult; import com.l2jmobius.gameserver.model.html.PageResult;
import com.l2jmobius.gameserver.util.Broadcast; import com.l2jmobius.gameserver.util.Broadcast;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
/** /**
@@ -58,7 +59,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
{ {
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announce <text to announce here>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announce <text to announce here>");
return false; return false;
} }
String announce = st.nextToken(); String announce = st.nextToken();
@@ -99,44 +100,44 @@ public class AdminAnnouncements implements IAdminCommandHandler
// ************************************ // ************************************
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
final String annInitDelay = st.nextToken(); final String annInitDelay = st.nextToken();
if (!Util.isDigit(annInitDelay)) if (!Util.isDigit(annInitDelay))
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
final int initDelay = Integer.parseInt(annInitDelay) * 1000; final int initDelay = Integer.parseInt(annInitDelay) * 1000;
// ************************************ // ************************************
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
final String annDelay = st.nextToken(); final String annDelay = st.nextToken();
if (!Util.isDigit(annDelay)) if (!Util.isDigit(annDelay))
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
final int delay = Integer.parseInt(annDelay) * 1000; final int delay = Integer.parseInt(annDelay) * 1000;
if ((delay < (10 * 1000)) && ((type == AnnouncementType.AUTO_NORMAL) || (type == AnnouncementType.AUTO_CRITICAL))) if ((delay < (10 * 1000)) && ((type == AnnouncementType.AUTO_NORMAL) || (type == AnnouncementType.AUTO_CRITICAL)))
{ {
activeChar.sendMessage("Delay cannot be less then 10 seconds!"); BuilderUtil.sendSysMessage(activeChar, "Delay cannot be less then 10 seconds!");
break; break;
} }
// ************************************ // ************************************
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
final String annRepeat = st.nextToken(); final String annRepeat = st.nextToken();
if (!Util.isDigit(annRepeat)) if (!Util.isDigit(annRepeat))
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
int repeat = Integer.parseInt(annRepeat); int repeat = Integer.parseInt(annRepeat);
@@ -147,7 +148,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
// ************************************ // ************************************
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
String content = st.nextToken(); String content = st.nextToken();
@@ -166,27 +167,27 @@ public class AdminAnnouncements implements IAdminCommandHandler
announce = new Announcement(type, content, activeChar.getName()); announce = new Announcement(type, content, activeChar.getName());
} }
AnnouncementsTable.getInstance().addAnnouncement(announce); AnnouncementsTable.getInstance().addAnnouncement(announce);
activeChar.sendMessage("Announcement has been successfully added!"); BuilderUtil.sendSysMessage(activeChar, "Announcement has been successfully added!");
return useAdminCommand("admin_announces list", activeChar); return useAdminCommand("admin_announces list", activeChar);
} }
case "edit": case "edit":
{ {
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announces edit <id>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces edit <id>");
break; break;
} }
final String annId = st.nextToken(); final String annId = st.nextToken();
if (!Util.isDigit(annId)) if (!Util.isDigit(annId))
{ {
activeChar.sendMessage("Syntax: //announces edit <id>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces edit <id>");
break; break;
} }
final int id = Integer.parseInt(annId); final int id = Integer.parseInt(annId);
final IAnnouncement announce = AnnouncementsTable.getInstance().getAnnounce(id); final IAnnouncement announce = AnnouncementsTable.getInstance().getAnnounce(id);
if (announce == null) if (announce == null)
{ {
activeChar.sendMessage("Announcement doesnt exists!"); BuilderUtil.sendSysMessage(activeChar, "Announcement does not exist!");
break; break;
} }
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
@@ -232,7 +233,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
} }
default: default:
{ {
activeChar.sendMessage("Announce type can be changed only to AUTO_NORMAL or AUTO_CRITICAL!"); BuilderUtil.sendSysMessage(activeChar, "Announce type can be changed only to AUTO_NORMAL or AUTO_CRITICAL!");
return false; return false;
} }
} }
@@ -250,7 +251,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
} }
default: default:
{ {
activeChar.sendMessage("Announce type can be changed only to NORMAL or CRITICAL!"); BuilderUtil.sendSysMessage(activeChar, "Announce type can be changed only to NORMAL or CRITICAL!");
return false; return false;
} }
} }
@@ -260,44 +261,44 @@ public class AdminAnnouncements implements IAdminCommandHandler
// ************************************ // ************************************
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
final String annInitDelay = st.nextToken(); final String annInitDelay = st.nextToken();
if (!Util.isDigit(annInitDelay)) if (!Util.isDigit(annInitDelay))
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
final int initDelay = Integer.parseInt(annInitDelay); final int initDelay = Integer.parseInt(annInitDelay);
// ************************************ // ************************************
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
final String annDelay = st.nextToken(); final String annDelay = st.nextToken();
if (!Util.isDigit(annDelay)) if (!Util.isDigit(annDelay))
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
final int delay = Integer.parseInt(annDelay); final int delay = Integer.parseInt(annDelay);
if ((delay < 10) && ((type == AnnouncementType.AUTO_NORMAL) || (type == AnnouncementType.AUTO_CRITICAL))) if ((delay < 10) && ((type == AnnouncementType.AUTO_NORMAL) || (type == AnnouncementType.AUTO_CRITICAL)))
{ {
activeChar.sendMessage("Delay cannot be less then 10 seconds!"); BuilderUtil.sendSysMessage(activeChar, "Delay cannot be less then 10 seconds!");
break; break;
} }
// ************************************ // ************************************
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
final String annRepeat = st.nextToken(); final String annRepeat = st.nextToken();
if (!Util.isDigit(annRepeat)) if (!Util.isDigit(annRepeat))
{ {
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces add <type> <delay> <repeat> <text>");
break; break;
} }
int repeat = Integer.parseInt(annRepeat); int repeat = Integer.parseInt(annRepeat);
@@ -331,30 +332,30 @@ public class AdminAnnouncements implements IAdminCommandHandler
autoAnnounce.setRepeat(repeat); autoAnnounce.setRepeat(repeat);
} }
announce.updateMe(); announce.updateMe();
activeChar.sendMessage("Announcement has been successfully edited!"); BuilderUtil.sendSysMessage(activeChar, "Announcement has been successfully edited!");
return useAdminCommand("admin_announces list", activeChar); return useAdminCommand("admin_announces list", activeChar);
} }
case "remove": case "remove":
{ {
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announces remove <announcement id>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces remove <announcement id>");
break; break;
} }
final String token = st.nextToken(); final String token = st.nextToken();
if (!Util.isDigit(token)) if (!Util.isDigit(token))
{ {
activeChar.sendMessage("Syntax: //announces remove <announcement id>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces remove <announcement id>");
break; break;
} }
final int id = Integer.parseInt(token); final int id = Integer.parseInt(token);
if (AnnouncementsTable.getInstance().deleteAnnouncement(id)) if (AnnouncementsTable.getInstance().deleteAnnouncement(id))
{ {
activeChar.sendMessage("Announcement has been successfully removed!"); BuilderUtil.sendSysMessage(activeChar, "Announcement has been successfully removed!");
} }
else else
{ {
activeChar.sendMessage("Announcement doesnt exists!"); BuilderUtil.sendSysMessage(activeChar, "Announcement does not exist!");
} }
return useAdminCommand("admin_announces list", activeChar); return useAdminCommand("admin_announces list", activeChar);
} }
@@ -370,13 +371,13 @@ public class AdminAnnouncements implements IAdminCommandHandler
autoAnnounce.restartMe(); autoAnnounce.restartMe();
} }
} }
activeChar.sendMessage("Auto announcements has been successfully restarted"); BuilderUtil.sendSysMessage(activeChar, "Auto announcements has been successfully restarted.");
break; break;
} }
final String token = st.nextToken(); final String token = st.nextToken();
if (!Util.isDigit(token)) if (!Util.isDigit(token))
{ {
activeChar.sendMessage("Syntax: //announces show <announcement id>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces show <announcement id>");
break; break;
} }
final int id = Integer.parseInt(token); final int id = Integer.parseInt(token);
@@ -387,16 +388,16 @@ public class AdminAnnouncements implements IAdminCommandHandler
{ {
final AutoAnnouncement autoAnnounce = (AutoAnnouncement) announce; final AutoAnnouncement autoAnnounce = (AutoAnnouncement) announce;
autoAnnounce.restartMe(); autoAnnounce.restartMe();
activeChar.sendMessage("Auto announcement has been successfully restarted"); BuilderUtil.sendSysMessage(activeChar, "Auto announcement has been successfully restarted.");
} }
else else
{ {
activeChar.sendMessage("This option has effect only on auto announcements!"); BuilderUtil.sendSysMessage(activeChar, "This option has effect only on auto announcements!");
} }
} }
else else
{ {
activeChar.sendMessage("Announcement doesnt exists!"); BuilderUtil.sendSysMessage(activeChar, "Announcement does not exist!");
} }
break; break;
} }
@@ -404,13 +405,13 @@ public class AdminAnnouncements implements IAdminCommandHandler
{ {
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //announces show <announcement id>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces show <announcement id>");
break; break;
} }
final String token = st.nextToken(); final String token = st.nextToken();
if (!Util.isDigit(token)) if (!Util.isDigit(token))
{ {
activeChar.sendMessage("Syntax: //announces show <announcement id>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //announces show <announcement id>");
break; break;
} }
final int id = Integer.parseInt(token); final int id = Integer.parseInt(token);
@@ -442,7 +443,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
Util.sendCBHtml(activeChar, content); Util.sendCBHtml(activeChar, content);
break; break;
} }
activeChar.sendMessage("Announcement doesnt exists!"); BuilderUtil.sendSysMessage(activeChar, "Announcement does not exist!");
return useAdminCommand("admin_announces list", activeChar); return useAdminCommand("admin_announces list", activeChar);
} }
case "list": case "list":

View File

@@ -39,6 +39,7 @@ import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.SkillCoolTime; import com.l2jmobius.gameserver.network.serverpackets.SkillCoolTime;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.GMAudit; import com.l2jmobius.gameserver.util.GMAudit;
public class AdminBuffs implements IAdminCommandHandler public class AdminBuffs implements IAdminCommandHandler
@@ -74,8 +75,8 @@ public class AdminBuffs implements IAdminCommandHandler
command = st.nextToken(); command = st.nextToken();
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Skill Id and level are not specified."); BuilderUtil.sendSysMessage(activeChar, "Skill Id and level are not specified.");
activeChar.sendMessage("Usage: //buff <skillId> <skillLevel>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //buff <skillId> <skillLevel>");
return false; return false;
} }
@@ -87,18 +88,18 @@ public class AdminBuffs implements IAdminCommandHandler
final Skill skill = SkillData.getInstance().getSkill(skillId, skillLevel); final Skill skill = SkillData.getInstance().getSkill(skillId, skillLevel);
if (skill == null) if (skill == null)
{ {
activeChar.sendMessage("Skill with id: " + skillId + ", lvl: " + skillLevel + " not found."); BuilderUtil.sendSysMessage(activeChar, "Skill with id: " + skillId + ", lvl: " + skillLevel + " not found.");
return false; return false;
} }
activeChar.sendMessage("Admin buffing " + skill.getName() + " (" + skillId + "," + skillLevel + ")"); BuilderUtil.sendSysMessage(activeChar, "Admin buffing " + skill.getName() + " (" + skillId + "," + skillLevel + ")");
skill.applyEffects(activeChar, target); skill.applyEffects(activeChar, target);
return true; return true;
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Failed buffing: " + e.getMessage()); BuilderUtil.sendSysMessage(activeChar, "Failed buffing: " + e.getMessage());
activeChar.sendMessage("Usage: //buff <skillId> <skillLevel>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //buff <skillId> <skillLevel>");
return false; return false;
} }
} }
@@ -120,7 +121,7 @@ public class AdminBuffs implements IAdminCommandHandler
showBuffs(activeChar, player, page, command.endsWith("_ps")); showBuffs(activeChar, player, page, command.endsWith("_ps"));
return true; return true;
} }
activeChar.sendMessage("The player " + playername + " is not online."); BuilderUtil.sendSysMessage(activeChar, "The player " + playername + " is not online.");
return false; return false;
} }
else if ((activeChar.getTarget() != null) && activeChar.getTarget().isCharacter()) else if ((activeChar.getTarget() != null) && activeChar.getTarget().isCharacter())
@@ -149,8 +150,8 @@ public class AdminBuffs implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Failed removing effect: " + e.getMessage()); BuilderUtil.sendSysMessage(activeChar, "Failed removing effect: " + e.getMessage());
activeChar.sendMessage("Usage: //stopbuff <objectId> <skillId>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //stopbuff <objectId> <skillId>");
return false; return false;
} }
} }
@@ -166,8 +167,8 @@ public class AdminBuffs implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Failed removing all effects: " + e.getMessage()); BuilderUtil.sendSysMessage(activeChar, "Failed removing all effects: " + e.getMessage());
activeChar.sendMessage("Usage: //stopallbuffs <objectId>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //stopallbuffs <objectId>");
return false; return false;
} }
} }
@@ -183,8 +184,8 @@ public class AdminBuffs implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Failed viewing blocked effects: " + e.getMessage()); BuilderUtil.sendSysMessage(activeChar, "Failed viewing blocked effects: " + e.getMessage());
activeChar.sendMessage("Usage: //viewblockedeffects <objectId>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //viewblockedeffects <objectId>");
return false; return false;
} }
} }
@@ -199,12 +200,12 @@ public class AdminBuffs implements IAdminCommandHandler
L2World.getInstance().forEachVisibleObjectInRange(activeChar, L2PcInstance.class, radius, L2Character::stopAllEffects); L2World.getInstance().forEachVisibleObjectInRange(activeChar, L2PcInstance.class, radius, L2Character::stopAllEffects);
activeChar.sendMessage("All effects canceled within radius " + radius); BuilderUtil.sendSysMessage(activeChar, "All effects canceled within radius " + radius);
return true; return true;
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
activeChar.sendMessage("Usage: //areacancel <radius>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //areacancel <radius>");
return false; return false;
} }
} }
@@ -228,7 +229,7 @@ public class AdminBuffs implements IAdminCommandHandler
if (player == null) if (player == null)
{ {
activeChar.sendMessage("The player " + playername + " is not online."); BuilderUtil.sendSysMessage(activeChar, "The player " + playername + " is not online.");
return false; return false;
} }
} }
@@ -247,7 +248,7 @@ public class AdminBuffs implements IAdminCommandHandler
player.resetTimeStamps(); player.resetTimeStamps();
player.resetDisabledSkills(); player.resetDisabledSkills();
player.sendPacket(new SkillCoolTime(player)); player.sendPacket(new SkillCoolTime(player));
activeChar.sendMessage("Skill reuse was removed from " + player.getName() + "."); BuilderUtil.sendSysMessage(activeChar, "Skill reuse was removed from " + player.getName() + ".");
return true; return true;
} }
catch (NullPointerException e) catch (NullPointerException e)
@@ -262,10 +263,10 @@ public class AdminBuffs implements IAdminCommandHandler
final boolean toAuraSkills = activeChar.getKnownSkill(7041) != null; final boolean toAuraSkills = activeChar.getKnownSkill(7041) != null;
switchSkills(activeChar, toAuraSkills); switchSkills(activeChar, toAuraSkills);
activeChar.sendSkillList(); activeChar.sendSkillList();
activeChar.sendMessage("You have succefully changed to target " + (toAuraSkills ? "aura" : "one") + " special skills."); BuilderUtil.sendSysMessage(activeChar, "You have succefully changed to target " + (toAuraSkills ? "aura" : "one") + " special skills.");
return true; return true;
} }
activeChar.sendMessage("There is nothing to switch."); BuilderUtil.sendSysMessage(activeChar, "There is nothing to switch.");
return false; return false;
} }
return true; return true;
@@ -368,7 +369,7 @@ public class AdminBuffs implements IAdminCommandHandler
if (target.isAffectedBySkill(skillId)) if (target.isAffectedBySkill(skillId))
{ {
target.stopSkillEffects(true, skillId); target.stopSkillEffects(true, skillId);
activeChar.sendMessage("Removed skill ID: " + skillId + " effects from " + target.getName() + " (" + objId + ")."); BuilderUtil.sendSysMessage(activeChar, "Removed skill ID: " + skillId + " effects from " + target.getName() + " (" + objId + ").");
} }
showBuffs(activeChar, target, 0, false); showBuffs(activeChar, target, 0, false);
@@ -393,7 +394,7 @@ public class AdminBuffs implements IAdminCommandHandler
if (target != null) if (target != null)
{ {
target.stopAllEffects(); target.stopAllEffects();
activeChar.sendMessage("Removed all effects from " + target.getName() + " (" + objId + ")"); BuilderUtil.sendSysMessage(activeChar, "Removed all effects from " + target.getName() + " (" + objId + ")");
showBuffs(activeChar, target, 0, false); showBuffs(activeChar, target, 0, false);
if (Config.GMAUDIT) if (Config.GMAUDIT)
{ {
@@ -411,7 +412,7 @@ public class AdminBuffs implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Target with object id " + objId + " not found."); BuilderUtil.sendSysMessage(activeChar, "Target with object id " + objId + " not found.");
return; return;
} }

View File

@@ -21,6 +21,7 @@ import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.events.AbstractScript; import com.l2jmobius.gameserver.model.events.AbstractScript;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* Camera commands. * Camera commands.
@@ -52,7 +53,7 @@ public class AdminCamera implements IAdminCommandHandler
{ {
if (com.length != 12) if (com.length != 12)
{ {
activeChar.sendMessage("Usage: //cam force angle1 angle2 time range duration relYaw relPitch isWide relAngle"); BuilderUtil.sendSysMessage(activeChar, "Usage: //cam force angle1 angle2 time range duration relYaw relPitch isWide relAngle");
return false; return false;
} }
AbstractScript.specialCamera(activeChar, target, Integer.parseInt(com[1]), Integer.parseInt(com[2]), Integer.parseInt(com[3]), Integer.parseInt(com[4]), Integer.parseInt(com[5]), Integer.parseInt(com[6]), Integer.parseInt(com[7]), Integer.parseInt(com[8]), Integer.parseInt(com[9]), Integer.parseInt(com[10])); AbstractScript.specialCamera(activeChar, target, Integer.parseInt(com[1]), Integer.parseInt(com[2]), Integer.parseInt(com[3]), Integer.parseInt(com[4]), Integer.parseInt(com[5]), Integer.parseInt(com[6]), Integer.parseInt(com[7]), Integer.parseInt(com[8]), Integer.parseInt(com[9]), Integer.parseInt(com[10]));
@@ -62,7 +63,7 @@ public class AdminCamera implements IAdminCommandHandler
{ {
if (com.length != 10) if (com.length != 10)
{ {
activeChar.sendMessage("Usage: //camex force angle1 angle2 time duration relYaw relPitch isWide relAngle"); BuilderUtil.sendSysMessage(activeChar, "Usage: //camex force angle1 angle2 time duration relYaw relPitch isWide relAngle");
return false; return false;
} }
AbstractScript.specialCameraEx(activeChar, target, Integer.parseInt(com[1]), Integer.parseInt(com[2]), Integer.parseInt(com[3]), Integer.parseInt(com[4]), Integer.parseInt(com[5]), Integer.parseInt(com[6]), Integer.parseInt(com[7]), Integer.parseInt(com[8]), Integer.parseInt(com[9])); AbstractScript.specialCameraEx(activeChar, target, Integer.parseInt(com[1]), Integer.parseInt(com[2]), Integer.parseInt(com[3]), Integer.parseInt(com[4]), Integer.parseInt(com[5]), Integer.parseInt(com[6]), Integer.parseInt(com[7]), Integer.parseInt(com[8]), Integer.parseInt(com[9]));
@@ -72,7 +73,7 @@ public class AdminCamera implements IAdminCommandHandler
{ {
if (com.length != 12) if (com.length != 12)
{ {
activeChar.sendMessage("Usage: //cam3 force angle1 angle2 time range duration relYaw relPitch isWide relAngle unk"); BuilderUtil.sendSysMessage(activeChar, "Usage: //cam3 force angle1 angle2 time range duration relYaw relPitch isWide relAngle unk");
return false; return false;
} }
AbstractScript.specialCamera3(activeChar, target, Integer.parseInt(com[1]), Integer.parseInt(com[2]), Integer.parseInt(com[3]), Integer.parseInt(com[4]), Integer.parseInt(com[5]), Integer.parseInt(com[6]), Integer.parseInt(com[7]), Integer.parseInt(com[8]), Integer.parseInt(com[9]), Integer.parseInt(com[10]), Integer.parseInt(com[11])); AbstractScript.specialCamera3(activeChar, target, Integer.parseInt(com[1]), Integer.parseInt(com[2]), Integer.parseInt(com[3]), Integer.parseInt(com[4]), Integer.parseInt(com[5]), Integer.parseInt(com[6]), Integer.parseInt(com[7]), Integer.parseInt(com[8]), Integer.parseInt(com[9]), Integer.parseInt(com[10]), Integer.parseInt(com[11]));

View File

@@ -29,6 +29,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.Castle; import com.l2jmobius.gameserver.model.entity.Castle;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
/** /**
@@ -65,7 +66,7 @@ public final class AdminCastle implements IAdminCommandHandler
if (castle == null) if (castle == null)
{ {
activeChar.sendMessage("Invalid parameters! Usage: //castlemanage <castleId[1-9] / castleName>"); BuilderUtil.sendSysMessage(activeChar, "Invalid parameters! Usage: //castlemanage <castleId[1-9] / castleName>");
return false; return false;
} }
@@ -140,7 +141,7 @@ public final class AdminCastle implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("There is currently not registered any clan for castle siege!"); BuilderUtil.sendSysMessage(activeChar, "There is currently not registered any clan for castle siege!");
} }
break; break;
} }
@@ -152,7 +153,7 @@ public final class AdminCastle implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Castle siege is not currently in progress!"); BuilderUtil.sendSysMessage(activeChar, "Castle siege is not currently in progress!");
} }
showCastleMenu(activeChar, castle.getResidenceId()); showCastleMenu(activeChar, castle.getResidenceId());
break; break;
@@ -165,15 +166,15 @@ public final class AdminCastle implements IAdminCommandHandler
} }
else if (target.getClan().getCastleId() > 0) else if (target.getClan().getCastleId() > 0)
{ {
activeChar.sendMessage("This clan already have castle!"); BuilderUtil.sendSysMessage(activeChar, "This clan already have castle!");
} }
else if (castle.getOwner() != null) else if (castle.getOwner() != null)
{ {
activeChar.sendMessage("This castle is already taken by another clan!"); BuilderUtil.sendSysMessage(activeChar, "This castle is already taken by another clan!");
} }
else if (!st.hasMoreTokens()) else if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Invalid parameters!!"); BuilderUtil.sendSysMessage(activeChar, "Invalid parameters!!");
} }
else else
{ {
@@ -196,7 +197,7 @@ public final class AdminCastle implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Error during removing castle!"); BuilderUtil.sendSysMessage(activeChar, "Error during removing castle!");
} }
showCastleMenu(activeChar, castle.getResidenceId()); showCastleMenu(activeChar, castle.getResidenceId());
break; break;
@@ -213,7 +214,7 @@ public final class AdminCastle implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("You can't switch sides when is castle neutral!"); BuilderUtil.sendSysMessage(activeChar, "You can't switch sides when is castle neutral!");
} }
showCastleMenu(activeChar, castle.getResidenceId()); showCastleMenu(activeChar, castle.getResidenceId());
break; break;

View File

@@ -28,6 +28,7 @@ import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.Disconnection; import com.l2jmobius.gameserver.network.Disconnection;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* Change access level command handler. * Change access level command handler.
@@ -59,7 +60,7 @@ public final class AdminChangeAccessLevel implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //changelvl <target_new_level> | <player_name> <new_level>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //changelvl <target_new_level> | <player_name> <new_level>");
} }
} }
else if (parts.length == 3) else if (parts.length == 3)
@@ -83,16 +84,16 @@ public final class AdminChangeAccessLevel implements IAdminCommandHandler
statement.close(); statement.close();
if (count == 0) if (count == 0)
{ {
activeChar.sendMessage("Character not found or access level unaltered."); BuilderUtil.sendSysMessage(activeChar, "Character not found or access level unaltered.");
} }
else else
{ {
activeChar.sendMessage("Character's access level is now set to " + lvl); BuilderUtil.sendSysMessage(activeChar, "Character's access level is now set to " + lvl);
} }
} }
catch (SQLException se) catch (SQLException se)
{ {
activeChar.sendMessage("SQLException while changing character's access level"); BuilderUtil.sendSysMessage(activeChar, "SQLException while changing character's access level");
} }
} }
} }
@@ -123,7 +124,7 @@ public final class AdminChangeAccessLevel implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("You are trying to set unexisting access level: " + lvl + " please try again with a valid one!"); BuilderUtil.sendSysMessage(activeChar, "You are trying to set unexisting access level: " + lvl + " please try again with a valid one!");
} }
} }
else else

View File

@@ -31,6 +31,7 @@ import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
/** /**
@@ -157,7 +158,7 @@ public class AdminClan implements IAdminCommandHandler
} }
clan.setNewLeader(member); clan.setNewLeader(member);
activeChar.sendMessage("Task have been forcely executed."); BuilderUtil.sendSysMessage(activeChar, "Task have been forcely executed.");
break; break;
} }
} }

View File

@@ -28,6 +28,7 @@ import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.network.serverpackets.ExAdenaInvenCount; import com.l2jmobius.gameserver.network.serverpackets.ExAdenaInvenCount;
import com.l2jmobius.gameserver.network.serverpackets.GMViewItemList; import com.l2jmobius.gameserver.network.serverpackets.GMViewItemList;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - itemcreate = show menu - create_item <id> [num] = creates num items with respective id, if num is not specified, assumes 1. * This class handles following admin commands: - itemcreate = show menu - create_item <id> [num] = creates num items with respective id, if num is not specified, assumes 1.
@@ -76,11 +77,11 @@ public class AdminCreateItem implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Usage: //create_item <itemId> [amount]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //create_item <itemId> [amount]");
} }
catch (NumberFormatException nfe) catch (NumberFormatException nfe)
{ {
activeChar.sendMessage("Specify a valid number."); BuilderUtil.sendSysMessage(activeChar, "Specify a valid number.");
} }
AdminHtml.showAdminHtml(activeChar, "itemcreation.htm"); AdminHtml.showAdminHtml(activeChar, "itemcreation.htm");
} }
@@ -110,11 +111,11 @@ public class AdminCreateItem implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Usage: //create_coin <name> [amount]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //create_coin <name> [amount]");
} }
catch (NumberFormatException nfe) catch (NumberFormatException nfe)
{ {
activeChar.sendMessage("Specify a valid number."); BuilderUtil.sendSysMessage(activeChar, "Specify a valid number.");
} }
AdminHtml.showAdminHtml(activeChar, "itemcreation.htm"); AdminHtml.showAdminHtml(activeChar, "itemcreation.htm");
} }
@@ -129,7 +130,7 @@ public class AdminCreateItem implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Invalid target."); BuilderUtil.sendSysMessage(activeChar, "Invalid target.");
return false; return false;
} }
@@ -152,11 +153,11 @@ public class AdminCreateItem implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Usage: //give_item_target <itemId> [amount]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //give_item_target <itemId> [amount]");
} }
catch (NumberFormatException nfe) catch (NumberFormatException nfe)
{ {
activeChar.sendMessage("Specify a valid number."); BuilderUtil.sendSysMessage(activeChar, "Specify a valid number.");
} }
AdminHtml.showAdminHtml(activeChar, "itemcreation.htm"); AdminHtml.showAdminHtml(activeChar, "itemcreation.htm");
} }
@@ -183,12 +184,12 @@ public class AdminCreateItem implements IAdminCommandHandler
final L2Item template = ItemTable.getInstance().getTemplate(idval); final L2Item template = ItemTable.getInstance().getTemplate(idval);
if (template == null) if (template == null)
{ {
activeChar.sendMessage("This item doesn't exist."); BuilderUtil.sendSysMessage(activeChar, "This item doesn't exist.");
return false; return false;
} }
if ((numval > 10) && !template.isStackable()) if ((numval > 10) && !template.isStackable())
{ {
activeChar.sendMessage("This item does not stack - Creation aborted."); BuilderUtil.sendSysMessage(activeChar, "This item does not stack - Creation aborted.");
return false; return false;
} }
for (L2PcInstance onlinePlayer : L2World.getInstance().getPlayers()) for (L2PcInstance onlinePlayer : L2World.getInstance().getPlayers())
@@ -228,7 +229,7 @@ public class AdminCreateItem implements IAdminCommandHandler
final L2PcInstance player = L2World.getInstance().getPlayer(ownerId); final L2PcInstance player = L2World.getInstance().getPlayer(ownerId);
if (player == null) if (player == null)
{ {
activeChar.sendMessage("Player is not online."); BuilderUtil.sendSysMessage(activeChar, "Player is not online.");
return false; return false;
} }
@@ -239,11 +240,11 @@ public class AdminCreateItem implements IAdminCommandHandler
player.getInventory().destroyItem("AdminDelete", idval, numval, activeChar, null); player.getInventory().destroyItem("AdminDelete", idval, numval, activeChar, null);
activeChar.sendPacket(new GMViewItemList(player)); activeChar.sendPacket(new GMViewItemList(player));
activeChar.sendMessage("Item deleted."); BuilderUtil.sendSysMessage(activeChar, "Item deleted.");
} }
else else
{ {
activeChar.sendMessage("Item doesn't have owner."); BuilderUtil.sendSysMessage(activeChar, "Item doesn't have owner.");
return false; return false;
} }
} }
@@ -258,7 +259,7 @@ public class AdminCreateItem implements IAdminCommandHandler
final L2PcInstance player = L2World.getInstance().getPlayer(ownerId); final L2PcInstance player = L2World.getInstance().getPlayer(ownerId);
if (player == null) if (player == null)
{ {
activeChar.sendMessage("Player is not online."); BuilderUtil.sendSysMessage(activeChar, "Player is not online.");
return false; return false;
} }
@@ -279,7 +280,7 @@ public class AdminCreateItem implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Item doesn't have owner."); BuilderUtil.sendSysMessage(activeChar, "Item doesn't have owner.");
return false; return false;
} }
} }
@@ -297,12 +298,12 @@ public class AdminCreateItem implements IAdminCommandHandler
final L2Item template = ItemTable.getInstance().getTemplate(id); final L2Item template = ItemTable.getInstance().getTemplate(id);
if (template == null) if (template == null)
{ {
activeChar.sendMessage("This item doesn't exist."); BuilderUtil.sendSysMessage(activeChar, "This item doesn't exist.");
return; return;
} }
if ((num > 10) && !template.isStackable()) if ((num > 10) && !template.isStackable())
{ {
activeChar.sendMessage("This item does not stack - Creation aborted."); BuilderUtil.sendSysMessage(activeChar, "This item does not stack - Creation aborted.");
return; return;
} }
@@ -312,7 +313,7 @@ public class AdminCreateItem implements IAdminCommandHandler
{ {
target.sendMessage("Admin spawned " + num + " " + template.getName() + " in your inventory."); target.sendMessage("Admin spawned " + num + " " + template.getName() + " in your inventory.");
} }
activeChar.sendMessage("You have spawned " + num + " " + template.getName() + "(" + id + ") in " + target.getName() + " inventory."); BuilderUtil.sendSysMessage(activeChar, "You have spawned " + num + " " + template.getName() + "(" + id + ") in " + target.getName() + " inventory.");
target.sendPacket(new ExAdenaInvenCount(target)); target.sendPacket(new ExAdenaInvenCount(target));
} }

View File

@@ -26,6 +26,7 @@ import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - cw_info = displays cursed weapon status - cw_remove = removes a cursed weapon from the world, item id or name must be provided - cw_add = adds a cursed weapon into the world, item id or name must be provided. Target will be the weilder - cw_goto = * This class handles following admin commands: - cw_info = displays cursed weapon status - cw_remove = removes a cursed weapon from the world, item id or name must be provided - cw_add = adds a cursed weapon into the world, item id or name must be provided. Target will be the weilder - cw_goto =
@@ -60,27 +61,27 @@ public class AdminCursedWeapons implements IAdminCommandHandler
{ {
if (!command.contains("menu")) if (!command.contains("menu"))
{ {
activeChar.sendMessage("====== Cursed Weapons: ======"); BuilderUtil.sendSysMessage(activeChar, "====== Cursed Weapons: ======");
for (CursedWeapon cw : cwm.getCursedWeapons()) for (CursedWeapon cw : cwm.getCursedWeapons())
{ {
activeChar.sendMessage("> " + cw.getName() + " (" + cw.getItemId() + ")"); BuilderUtil.sendSysMessage(activeChar, "> " + cw.getName() + " (" + cw.getItemId() + ")");
if (cw.isActivated()) if (cw.isActivated())
{ {
final L2PcInstance pl = cw.getPlayer(); final L2PcInstance pl = cw.getPlayer();
activeChar.sendMessage(" Player holding: " + (pl == null ? "null" : pl.getName())); BuilderUtil.sendSysMessage(activeChar, " Player holding: " + (pl == null ? "null" : pl.getName()));
activeChar.sendMessage(" Player Reputation: " + cw.getPlayerReputation()); BuilderUtil.sendSysMessage(activeChar, " Player Reputation: " + cw.getPlayerReputation());
activeChar.sendMessage(" Time Remaining: " + (cw.getTimeLeft() / 60000) + " min."); BuilderUtil.sendSysMessage(activeChar, " Time Remaining: " + (cw.getTimeLeft() / 60000) + " min.");
activeChar.sendMessage(" Kills : " + cw.getNbKills()); BuilderUtil.sendSysMessage(activeChar, " Kills : " + cw.getNbKills());
} }
else if (cw.isDropped()) else if (cw.isDropped())
{ {
activeChar.sendMessage(" Lying on the ground."); BuilderUtil.sendSysMessage(activeChar, " Lying on the ground.");
activeChar.sendMessage(" Time Remaining: " + (cw.getTimeLeft() / 60000) + " min."); BuilderUtil.sendSysMessage(activeChar, " Time Remaining: " + (cw.getTimeLeft() / 60000) + " min.");
activeChar.sendMessage(" Kills : " + cw.getNbKills()); BuilderUtil.sendSysMessage(activeChar, " Kills : " + cw.getNbKills());
} }
else else
{ {
activeChar.sendMessage(" Don't exist in the world."); BuilderUtil.sendSysMessage(activeChar, " Don't exist in the world.");
} }
activeChar.sendPacket(SystemMessageId.EMPTY_3); activeChar.sendPacket(SystemMessageId.EMPTY_3);
} }
@@ -178,12 +179,12 @@ public class AdminCursedWeapons implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //cw_remove|//cw_goto|//cw_add <itemid|name>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //cw_remove|//cw_goto|//cw_add <itemid|name>");
} }
if (cw == null) if (cw == null)
{ {
activeChar.sendMessage("Unknown cursed weapon ID."); BuilderUtil.sendSysMessage(activeChar, "Unknown cursed weapon ID.");
return false; return false;
} }
@@ -199,7 +200,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
{ {
if (cw.isActive()) if (cw.isActive())
{ {
activeChar.sendMessage("This cursed weapon is already active."); BuilderUtil.sendSysMessage(activeChar, "This cursed weapon is already active.");
} }
else else
{ {
@@ -218,7 +219,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Unknown command."); BuilderUtil.sendSysMessage(activeChar, "Unknown command.");
} }
} }
return true; return true;

View File

@@ -23,6 +23,7 @@ import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2Spawn; import com.l2jmobius.gameserver.model.L2Spawn;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - delete = deletes target * This class handles following admin commands: - delete = deletes target
@@ -75,11 +76,11 @@ public class AdminDelete implements IAdminCommandHandler
} }
} }
activeChar.sendMessage("Deleted " + target.getName() + " from " + target.getObjectId() + "."); BuilderUtil.sendSysMessage(activeChar, "Deleted " + target.getName() + " from " + target.getObjectId() + ".");
} }
else else
{ {
activeChar.sendMessage("Incorrect target."); BuilderUtil.sendSysMessage(activeChar, "Incorrect target.");
} }
} }
} }

View File

@@ -20,6 +20,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.Disconnection; import com.l2jmobius.gameserver.network.Disconnection;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - character_disconnect = disconnects target player * This class handles following admin commands: - character_disconnect = disconnects target player
@@ -63,11 +64,11 @@ public class AdminDisconnect implements IAdminCommandHandler
if (player == activeChar) if (player == activeChar)
{ {
activeChar.sendMessage("You cannot logout your own character."); BuilderUtil.sendSysMessage(activeChar, "You cannot logout your own character.");
} }
else else
{ {
activeChar.sendMessage("Character " + player.getName() + " disconnected from server."); BuilderUtil.sendSysMessage(activeChar, "Character " + player.getName() + " disconnected from server.");
Disconnection.of(player).defaultSequence(false); Disconnection.of(player).defaultSequence(false);
} }

View File

@@ -27,6 +27,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2DoorInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.Castle; import com.l2jmobius.gameserver.model.entity.Castle;
import com.l2jmobius.gameserver.network.serverpackets.ExServerPrimitive; import com.l2jmobius.gameserver.network.serverpackets.ExServerPrimitive;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - open1 = open coloseum door 24190001 - open2 = open coloseum door 24190002 - open3 = open coloseum door 24190003 - open4 = open coloseum door 24190004 - openall = open all coloseum door - close1 = close coloseum door 24190001 - close2 = close coloseum * This class handles following admin commands: - open1 = open coloseum door 24190001 - open2 = open coloseum door 24190002 - open3 = open coloseum door 24190003 - open4 = open coloseum door 24190004 - openall = open all coloseum door - close1 = close coloseum door 24190001 - close2 = close coloseum
@@ -123,7 +124,7 @@ public class AdminDoorControl implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Incorrect target."); BuilderUtil.sendSysMessage(activeChar, "Incorrect target.");
} }
} }
else if (command.equals("admin_close")) else if (command.equals("admin_close"))
@@ -135,7 +136,7 @@ public class AdminDoorControl implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Incorrect target."); BuilderUtil.sendSysMessage(activeChar, "Incorrect target.");
} }
} }
else if (command.equals("admin_showdoors")) else if (command.equals("admin_showdoors"))
@@ -161,7 +162,7 @@ public class AdminDoorControl implements IAdminCommandHandler
packet.addLine(color, door.getX(2), door.getY(2), door.getZMax(), door.getX(3), door.getY(3), door.getZMin()); packet.addLine(color, door.getX(2), door.getY(2), door.getZMax(), door.getX(3), door.getY(3), door.getZMin());
activeChar.sendPacket(packet); activeChar.sendPacket(packet);
// send message // send message
activeChar.sendMessage("Found door " + door.getId()); BuilderUtil.sendSysMessage(activeChar, "Found door " + door.getId());
}); });
} }
} }

View File

@@ -61,6 +61,7 @@ import com.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
import com.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll; import com.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.network.serverpackets.UserInfo; import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* EditChar admin command implementation. * EditChar admin command implementation.
@@ -148,7 +149,7 @@ public class AdminEditChar implements IAdminCommandHandler
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
// Case of empty page number // Case of empty page number
activeChar.sendMessage("Usage: //show_characters <page_number>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //show_characters <page_number>");
} }
} }
else if (command.startsWith("admin_find_character")) else if (command.startsWith("admin_find_character"))
@@ -160,7 +161,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ // Case of empty character name { // Case of empty character name
activeChar.sendMessage("Usage: //find_character <character_name>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //find_character <character_name>");
listCharacters(activeChar, 0); listCharacters(activeChar, 0);
} }
} }
@@ -173,7 +174,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ // Case of empty or malformed IP number { // Case of empty or malformed IP number
activeChar.sendMessage("Usage: //find_ip <www.xxx.yyy.zzz>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //find_ip <www.xxx.yyy.zzz>");
listCharacters(activeChar, 0); listCharacters(activeChar, 0);
} }
} }
@@ -186,7 +187,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ // Case of empty or malformed player name { // Case of empty or malformed player name
activeChar.sendMessage("Usage: //find_account <player_name>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //find_account <player_name>");
listCharacters(activeChar, 0); listCharacters(activeChar, 0);
} }
} }
@@ -220,14 +221,14 @@ public class AdminEditChar implements IAdminCommandHandler
{ {
LOGGER.warning("Set reputation error: " + e); LOGGER.warning("Set reputation error: " + e);
} }
activeChar.sendMessage("Usage: //setreputation <new_reputation_value>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setreputation <new_reputation_value>");
} }
} }
else if (command.startsWith("admin_nokarma")) else if (command.startsWith("admin_nokarma"))
{ {
if ((activeChar.getTarget() == null) || !activeChar.getTarget().isPlayer()) if ((activeChar.getTarget() == null) || !activeChar.getTarget().isPlayer())
{ {
activeChar.sendMessage("You must target a player."); BuilderUtil.sendSysMessage(activeChar, "You must target a player.");
return false; return false;
} }
@@ -263,7 +264,7 @@ public class AdminEditChar implements IAdminCommandHandler
{ {
LOGGER.warning("Set pk error: " + e); LOGGER.warning("Set pk error: " + e);
} }
activeChar.sendMessage("Usage: //setpk <pk_count>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setpk <pk_count>");
} }
} }
else if (command.startsWith("admin_setpvp")) else if (command.startsWith("admin_setpvp"))
@@ -293,7 +294,7 @@ public class AdminEditChar implements IAdminCommandHandler
{ {
LOGGER.warning("Set pvp error: " + e); LOGGER.warning("Set pvp error: " + e);
} }
activeChar.sendMessage("Usage: //setpvp <pvp_count>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setpvp <pvp_count>");
} }
} }
else if (command.startsWith("admin_setfame")) else if (command.startsWith("admin_setfame"))
@@ -323,7 +324,7 @@ public class AdminEditChar implements IAdminCommandHandler
{ {
LOGGER.warning("Set Fame error: " + e); LOGGER.warning("Set Fame error: " + e);
} }
activeChar.sendMessage("Usage: //setfame <new_fame_value>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setfame <new_fame_value>");
} }
} }
else if (command.startsWith("admin_rec")) else if (command.startsWith("admin_rec"))
@@ -350,7 +351,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //rec number"); BuilderUtil.sendSysMessage(activeChar, "Usage: //rec number");
} }
} }
else if (command.startsWith("admin_setclass")) else if (command.startsWith("admin_setclass"))
@@ -440,7 +441,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Usage: //setclass <valid_new_classid>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setclass <valid_new_classid>");
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
@@ -449,7 +450,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
activeChar.sendMessage("Usage: //setclass <valid_new_classid>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setclass <valid_new_classid>");
} }
} }
else if (command.startsWith("admin_settitle")) else if (command.startsWith("admin_settitle"))
@@ -473,7 +474,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ // Case of empty character title { // Case of empty character title
activeChar.sendMessage("You need to specify the new title."); BuilderUtil.sendSysMessage(activeChar, "You need to specify the new title.");
} }
} }
else if (command.startsWith("admin_changename")) else if (command.startsWith("admin_changename"))
@@ -493,7 +494,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
if (CharNameTable.getInstance().getIdByName(val) > 0) if (CharNameTable.getInstance().getIdByName(val) > 0)
{ {
activeChar.sendMessage("Warning, player " + val + " already exists"); BuilderUtil.sendSysMessage(activeChar, "Warning, player " + val + " already exists");
return false; return false;
} }
player.setName(val); player.setName(val);
@@ -503,7 +504,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
player.storeMe(); player.storeMe();
activeChar.sendMessage("Changed name to " + val); BuilderUtil.sendSysMessage(activeChar, "Changed name to " + val);
player.sendMessage("Your name has been changed by a GM."); player.sendMessage("Your name has been changed by a GM.");
player.broadcastUserInfo(); player.broadcastUserInfo();
@@ -527,7 +528,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ // Case of empty character name { // Case of empty character name
activeChar.sendMessage("Usage: //setname new_name_for_target"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setname new_name_for_target");
} }
} }
else if (command.startsWith("admin_setsex")) else if (command.startsWith("admin_setsex"))
@@ -567,7 +568,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ // Case of empty color or invalid hex string { // Case of empty color or invalid hex string
activeChar.sendMessage("You need to specify a valid new color."); BuilderUtil.sendSysMessage(activeChar, "You need to specify a valid new color.");
} }
} }
else if (command.startsWith("admin_settcolor")) else if (command.startsWith("admin_settcolor"))
@@ -591,7 +592,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ // Case of empty color or invalid hex string { // Case of empty color or invalid hex string
activeChar.sendMessage("You need to specify a valid new color."); BuilderUtil.sendSysMessage(activeChar, "You need to specify a valid new color.");
} }
} }
else if (command.startsWith("admin_fullfood")) else if (command.startsWith("admin_fullfood"))
@@ -615,7 +616,7 @@ public class AdminEditChar implements IAdminCommandHandler
final StringTokenizer st = new StringTokenizer(command, " "); final StringTokenizer st = new StringTokenizer(command, " ");
if (st.countTokens() != 3) if (st.countTokens() != 3)
{ {
activeChar.sendMessage("Usage: //remove_clan_penalty join|create charname"); BuilderUtil.sendSysMessage(activeChar, "Usage: //remove_clan_penalty join|create charname");
return false; return false;
} }
@@ -644,7 +645,7 @@ public class AdminEditChar implements IAdminCommandHandler
player.setClanJoinExpiryTime(0); player.setClanJoinExpiryTime(0);
} }
activeChar.sendMessage("Clan penalty successfully removed to character: " + playerName); BuilderUtil.sendSysMessage(activeChar, "Clan penalty successfully removed to character: " + playerName);
} }
catch (Exception e) catch (Exception e)
{ {
@@ -660,7 +661,7 @@ public class AdminEditChar implements IAdminCommandHandler
multibox = Integer.parseInt(val); multibox = Integer.parseInt(val);
if (multibox < 1) if (multibox < 1)
{ {
activeChar.sendMessage("Usage: //find_dualbox [number > 0]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //find_dualbox [number > 0]");
return false; return false;
} }
} }
@@ -678,7 +679,7 @@ public class AdminEditChar implements IAdminCommandHandler
multibox = Integer.parseInt(val); multibox = Integer.parseInt(val);
if (multibox < 1) if (multibox < 1)
{ {
activeChar.sendMessage("Usage: //strict_find_dualbox [number > 0]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //strict_find_dualbox [number > 0]");
return false; return false;
} }
} }
@@ -713,13 +714,13 @@ public class AdminEditChar implements IAdminCommandHandler
final L2GameClient client = pl.getClient(); final L2GameClient client = pl.getClient();
if (client == null) if (client == null)
{ {
activeChar.sendMessage("Client is null."); BuilderUtil.sendSysMessage(activeChar, "Client is null.");
return false; return false;
} }
if (client.isDetached()) if (client.isDetached())
{ {
activeChar.sendMessage("Client is detached."); BuilderUtil.sendSysMessage(activeChar, "Client is detached.");
return false; return false;
} }
@@ -736,7 +737,7 @@ public class AdminEditChar implements IAdminCommandHandler
ip = ip + "."; ip = ip + ".";
} }
} }
activeChar.sendMessage("Hop" + i + ": " + ip); BuilderUtil.sendSysMessage(activeChar, "Hop" + i + ": " + ip);
} }
} }
else if (command.startsWith("admin_summon_info")) else if (command.startsWith("admin_summon_info"))
@@ -748,7 +749,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Invalid target."); BuilderUtil.sendSysMessage(activeChar, "Invalid target.");
} }
} }
else if (command.startsWith("admin_unsummon")) else if (command.startsWith("admin_unsummon"))
@@ -760,7 +761,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Usable only with Pets/Summons"); BuilderUtil.sendSysMessage(activeChar, "Usable only with Pets/Summons");
} }
} }
else if (command.startsWith("admin_summon_setlvl")) else if (command.startsWith("admin_summon_setlvl"))
@@ -791,7 +792,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Usable only with Pets"); BuilderUtil.sendSysMessage(activeChar, "Usable only with Pets");
} }
} }
else if (command.startsWith("admin_show_pet_inv")) else if (command.startsWith("admin_show_pet_inv"))
@@ -814,7 +815,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Usable only with Pets"); BuilderUtil.sendSysMessage(activeChar, "Usable only with Pets");
} }
} }
@@ -843,7 +844,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Not in party."); BuilderUtil.sendSysMessage(activeChar, "Not in party.");
} }
} }
else else
@@ -889,7 +890,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
if (player.getObjectId() != activeChar.getObjectId()) if (player.getObjectId() != activeChar.getObjectId())
{ {
activeChar.sendMessage("You've changed nobless status of: " + player.getName()); BuilderUtil.sendSysMessage(activeChar, "You've changed nobless status of: " + player.getName());
} }
player.broadcastUserInfo(); player.broadcastUserInfo();
} }
@@ -909,7 +910,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //set_hp 1000"); BuilderUtil.sendSysMessage(activeChar, "Usage: //set_hp 1000");
} }
} }
else if (command.startsWith("admin_set_mp")) else if (command.startsWith("admin_set_mp"))
@@ -927,7 +928,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //set_mp 1000"); BuilderUtil.sendSysMessage(activeChar, "Usage: //set_mp 1000");
} }
} }
else if (command.startsWith("admin_set_cp")) else if (command.startsWith("admin_set_cp"))
@@ -945,7 +946,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //set_cp 1000"); BuilderUtil.sendSysMessage(activeChar, "Usage: //set_cp 1000");
} }
} }
else if (command.startsWith("admin_set_pvp_flag")) else if (command.startsWith("admin_set_pvp_flag"))
@@ -963,7 +964,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //set_pvp_flag"); BuilderUtil.sendSysMessage(activeChar, "Usage: //set_pvp_flag");
} }
} }
else if (command.startsWith("admin_setparam")) else if (command.startsWith("admin_setparam"))
@@ -978,13 +979,13 @@ public class AdminEditChar implements IAdminCommandHandler
st.nextToken(); // admin_setparam st.nextToken(); // admin_setparam
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //setparam <stat> <value>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //setparam <stat> <value>");
return false; return false;
} }
final String statName = st.nextToken(); final String statName = st.nextToken();
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //setparam <stat> <value>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //setparam <stat> <value>");
return false; return false;
} }
@@ -1001,7 +1002,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
if (stat == null) if (stat == null)
{ {
activeChar.sendMessage("Couldn't find such stat!"); BuilderUtil.sendSysMessage(activeChar, "Couldn't find such stat!");
return false; return false;
} }
@@ -1011,16 +1012,16 @@ public class AdminEditChar implements IAdminCommandHandler
{ {
targetCreature.getStat().addFixedValue(stat, value); targetCreature.getStat().addFixedValue(stat, value);
targetCreature.getStat().recalculateStats(true); targetCreature.getStat().recalculateStats(true);
activeChar.sendMessage("Fixed stat: " + stat + " has been set to " + value); BuilderUtil.sendSysMessage(activeChar, "Fixed stat: " + stat + " has been set to " + value);
} }
else else
{ {
activeChar.sendMessage("Non negative values are only allowed!"); BuilderUtil.sendSysMessage(activeChar, "Non negative values are only allowed!");
} }
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Syntax: //setparam <stat> <value>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //setparam <stat> <value>");
return false; return false;
} }
} }
@@ -1036,7 +1037,7 @@ public class AdminEditChar implements IAdminCommandHandler
st.nextToken(); // admin_setparam st.nextToken(); // admin_setparam
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //unsetparam <stat>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //unsetparam <stat>");
return false; return false;
} }
final String statName = st.nextToken(); final String statName = st.nextToken();
@@ -1052,14 +1053,14 @@ public class AdminEditChar implements IAdminCommandHandler
} }
if (stat == null) if (stat == null)
{ {
activeChar.sendMessage("Couldn't find such stat!"); BuilderUtil.sendSysMessage(activeChar, "Couldn't find such stat!");
return false; return false;
} }
final L2Character targetCreature = (L2Character) target; final L2Character targetCreature = (L2Character) target;
targetCreature.getStat().removeFixedValue(stat); targetCreature.getStat().removeFixedValue(stat);
targetCreature.getStat().recalculateStats(true); targetCreature.getStat().recalculateStats(true);
activeChar.sendMessage("Fixed stat: " + stat + " has been removed."); BuilderUtil.sendSysMessage(activeChar, "Fixed stat: " + stat + " has been removed.");
} }
return true; return true;
} }
@@ -1132,18 +1133,18 @@ public class AdminEditChar implements IAdminCommandHandler
if (player == null) if (player == null)
{ {
activeChar.sendMessage("Player is null."); BuilderUtil.sendSysMessage(activeChar, "Player is null.");
return; return;
} }
final L2GameClient client = player.getClient(); final L2GameClient client = player.getClient();
if (client == null) if (client == null)
{ {
activeChar.sendMessage("Client is null."); BuilderUtil.sendSysMessage(activeChar, "Client is null.");
} }
else if (client.isDetached()) else if (client.isDetached())
{ {
activeChar.sendMessage("Client is detached."); BuilderUtil.sendSysMessage(activeChar, "Client is detached.");
} }
else else
{ {
@@ -1222,7 +1223,7 @@ public class AdminEditChar implements IAdminCommandHandler
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOUR_REPUTATION_HAS_BEEN_CHANGED_TO_S1); final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOUR_REPUTATION_HAS_BEEN_CHANGED_TO_S1);
sm.addInt(newReputation); sm.addInt(newReputation);
player.sendPacket(sm); player.sendPacket(sm);
activeChar.sendMessage("Successfully Changed karma for " + player.getName() + " from (" + oldReputation + ") to (" + newReputation + ")."); BuilderUtil.sendSysMessage(activeChar, "Successfully Changed karma for " + player.getName() + " from (" + oldReputation + ") to (" + newReputation + ").");
} }
private void editCharacter(L2PcInstance activeChar, String targetName) private void editCharacter(L2PcInstance activeChar, String targetName)

View File

@@ -183,7 +183,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //earthquake <intensity> <duration>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //earthquake <intensity> <duration>");
} }
} }
else if (command.startsWith("admin_atmosphere")) else if (command.startsWith("admin_atmosphere"))
@@ -197,7 +197,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (Exception ex) catch (Exception ex)
{ {
activeChar.sendMessage("Usage: //atmosphere <signsky dawn|dusk>|<sky day|night|red> <duration>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //atmosphere <signsky dawn|dusk>|<sky day|night|red> <duration>");
} }
} }
else if (command.equals("admin_play_sounds")) else if (command.equals("admin_play_sounds"))
@@ -212,7 +212,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Usage: //play_sounds <pagenumber>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //play_sounds <pagenumber>");
} }
} }
else if (command.startsWith("admin_play_sound")) else if (command.startsWith("admin_play_sound"))
@@ -223,7 +223,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {
activeChar.sendMessage("Usage: //play_sound <soundname>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //play_sound <soundname>");
} }
} }
else if (command.equals("admin_para_all")) else if (command.equals("admin_para_all"))
@@ -359,7 +359,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //polyself <npcId>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //polyself <npcId>");
} }
} }
else if (command.startsWith("admin_unpolyself")) else if (command.startsWith("admin_unpolyself"))
@@ -391,7 +391,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //setteam_close <none|blue|red> [radius]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setteam_close <none|blue|red> [radius]");
} }
} }
else if (command.startsWith("admin_setteam")) else if (command.startsWith("admin_setteam"))
@@ -412,7 +412,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //setteam <none|blue|red>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setteam <none|blue|red>");
} }
} }
else if (command.startsWith("admin_social")) else if (command.startsWith("admin_social"))
@@ -445,7 +445,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (NumberFormatException nbe) catch (NumberFormatException nbe)
{ {
activeChar.sendMessage("Incorrect parameter"); BuilderUtil.sendSysMessage(activeChar, "Incorrect parameter");
} }
} }
} }
@@ -469,7 +469,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
else if (!command.contains("menu")) else if (!command.contains("menu"))
{ {
activeChar.sendMessage("Usage: //social <social_id> [player_name|radius]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //social <social_id> [player_name|radius]");
} }
} }
catch (Exception e) catch (Exception e)
@@ -512,7 +512,7 @@ public class AdminEffects implements IAdminCommandHandler
if (radius > 0) if (radius > 0)
{ {
L2World.getInstance().forEachVisibleObjectInRange(activeChar, L2Object.class, radius, object -> performAbnormalVisualEffect(ave, object)); L2World.getInstance().forEachVisibleObjectInRange(activeChar, L2Object.class, radius, object -> performAbnormalVisualEffect(ave, object));
activeChar.sendMessage("Affected all characters in radius " + param2 + " by " + param1 + " abnormal visual effect."); BuilderUtil.sendSysMessage(activeChar, "Affected all characters in radius " + param2 + " by " + param1 + " abnormal visual effect.");
} }
else else
{ {
@@ -538,7 +538,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (NumberFormatException nfe) catch (NumberFormatException nfe)
{ {
activeChar.sendMessage("Incorrect page."); BuilderUtil.sendSysMessage(activeChar, "Incorrect page.");
} }
} }
@@ -561,7 +561,7 @@ public class AdminEffects implements IAdminCommandHandler
html.replace("%abnormals%", result.getBodyTemplate().toString()); html.replace("%abnormals%", result.getBodyTemplate().toString());
activeChar.sendPacket(html); activeChar.sendPacket(html);
activeChar.sendMessage("Usage: //" + command.replace("admin_", "") + " <AbnormalVisualEffect> [radius]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //" + command.replace("admin_", "") + " <AbnormalVisualEffect> [radius]");
return true; return true;
} }
} }
@@ -598,7 +598,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //effect skill [level | level hittime]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //effect skill [level | level hittime]");
} }
} }
else if (command.startsWith("admin_set_displayeffect")) else if (command.startsWith("admin_set_displayeffect"))
@@ -618,7 +618,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //set_displayeffect <id>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //set_displayeffect <id>");
} }
} }
else if (command.startsWith("admin_playmovie")) else if (command.startsWith("admin_playmovie"))
@@ -629,7 +629,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //playmovie <id>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //playmovie <id>");
} }
} }
else if (command.startsWith("admin_event_trigger")) else if (command.startsWith("admin_event_trigger"))
@@ -643,7 +643,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //event_trigger id [true | false]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //event_trigger id [true | false]");
} }
} }
else if (command.startsWith("admin_settargetable")) else if (command.startsWith("admin_settargetable"))
@@ -750,7 +750,7 @@ public class AdminEffects implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Usage: //atmosphere <signsky dawn|dusk>|<sky day|night|red> <duration>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //atmosphere <signsky dawn|dusk>|<sky day|night|red> <duration>");
} }
if (packet != null) if (packet != null)
{ {
@@ -763,7 +763,7 @@ public class AdminEffects implements IAdminCommandHandler
final PlaySound _snd = new PlaySound(1, sound, 0, 0, 0, 0, 0); final PlaySound _snd = new PlaySound(1, sound, 0, 0, 0, 0, 0);
activeChar.sendPacket(_snd); activeChar.sendPacket(_snd);
activeChar.broadcastPacket(_snd); activeChar.broadcastPacket(_snd);
activeChar.sendMessage("Playing " + sound + "."); BuilderUtil.sendSysMessage(activeChar, "Playing " + sound + ".");
} }
@Override @Override

View File

@@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.items.enchant.attribute.AttributeHolder;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - delete = deletes target * This class handles following admin commands: - delete = deletes target
@@ -87,7 +88,7 @@ public class AdminElement implements IAdminCommandHandler
final int value = Integer.parseInt(args[2]); final int value = Integer.parseInt(args[2]);
if ((type == null) || (value < 0) || (value > 450)) if ((type == null) || (value < 0) || (value > 450))
{ {
activeChar.sendMessage("Usage: //setlh/setlc/setlg/setlb/setll/setlw/setls <element> <value>[0-450]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setlh/setlc/setlg/setlb/setll/setlw/setls <element> <value>[0-450]");
return false; return false;
} }
@@ -95,7 +96,7 @@ public class AdminElement implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //setlh/setlc/setlg/setlb/setll/setlw/setls <element>[0-5] <value>[0-450]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //setlh/setlc/setlg/setlb/setll/setlw/setls <element>[0-5] <value>[0-450]");
return false; return false;
} }
} }
@@ -181,7 +182,7 @@ public class AdminElement implements IAdminCommandHandler
player.sendInventoryUpdate(iu); player.sendInventoryUpdate(iu);
// informations // informations
activeChar.sendMessage("Changed elemental power of " + player.getName() + "'s " + itemInstance.getItem().getName() + " from " + old + " to " + current + "."); BuilderUtil.sendSysMessage(activeChar, "Changed elemental power of " + player.getName() + "'s " + itemInstance.getItem().getName() + " from " + old + " to " + current + ".");
if (player != activeChar) if (player != activeChar)
{ {
player.sendMessage(activeChar.getName() + " has changed the elemental power of your " + itemInstance.getItem().getName() + " from " + old + " to " + current + "."); player.sendMessage(activeChar.getName() + " has changed the elemental power of your " + itemInstance.getItem().getName() + " from " + old + " to " + current + ".");

View File

@@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - enchant_armor * This class handles following admin commands: - enchant_armor
@@ -135,7 +136,7 @@ public class AdminEnchant implements IAdminCommandHandler
// check value // check value
if ((ench < 0) || (ench > 127)) if ((ench < 0) || (ench > 127))
{ {
activeChar.sendMessage("You must set the enchant level to be between 0-127."); BuilderUtil.sendSysMessage(activeChar, "You must set the enchant level to be between 0-127.");
} }
else else
{ {
@@ -148,7 +149,7 @@ public class AdminEnchant implements IAdminCommandHandler
{ {
LOGGER.warning("Set enchant error: " + e); LOGGER.warning("Set enchant error: " + e);
} }
activeChar.sendMessage("Please specify a new enchant value."); BuilderUtil.sendSysMessage(activeChar, "Please specify a new enchant value.");
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
@@ -156,7 +157,7 @@ public class AdminEnchant implements IAdminCommandHandler
{ {
LOGGER.warning("Set enchant error: " + e); LOGGER.warning("Set enchant error: " + e);
} }
activeChar.sendMessage("Please specify a valid new enchant value."); BuilderUtil.sendSysMessage(activeChar, "Please specify a valid new enchant value.");
} }
} }
@@ -204,7 +205,7 @@ public class AdminEnchant implements IAdminCommandHandler
player.broadcastUserInfo(); player.broadcastUserInfo();
// informations // informations
activeChar.sendMessage("Changed enchantment of " + player.getName() + "'s " + itemInstance.getItem().getName() + " from " + curEnchant + " to " + ench + "."); BuilderUtil.sendSysMessage(activeChar, "Changed enchantment of " + player.getName() + "'s " + itemInstance.getItem().getName() + " from " + curEnchant + " to " + ench + ".");
player.sendMessage("Admin has changed the enchantment of your " + itemInstance.getItem().getName() + " from " + curEnchant + " to " + ench + "."); player.sendMessage("Admin has changed the enchantment of your " + itemInstance.getItem().getName() + " from " + curEnchant + " to " + ench + ".");
} }
} }

View File

@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.quest.Event; import com.l2jmobius.gameserver.model.quest.Event;
import com.l2jmobius.gameserver.model.quest.Quest; import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
public class AdminEvents implements IAdminCommandHandler public class AdminEvents implements IAdminCommandHandler
{ {
@@ -80,18 +81,18 @@ public class AdminEvents implements IAdminCommandHandler
{ {
if (event.eventStart(activeChar)) if (event.eventStart(activeChar))
{ {
activeChar.sendMessage("Event " + event_name + " started."); BuilderUtil.sendSysMessage(activeChar, "Event " + event_name + " started.");
return true; return true;
} }
activeChar.sendMessage("There is problem starting " + event_name + " event."); BuilderUtil.sendSysMessage(activeChar, "There is problem starting " + event_name + " event.");
return true; return true;
} }
} }
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //event_start <eventname>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //event_start <eventname>");
e.printStackTrace(); e.printStackTrace();
return false; return false;
} }
@@ -107,18 +108,18 @@ public class AdminEvents implements IAdminCommandHandler
{ {
if (event.eventStop()) if (event.eventStop())
{ {
activeChar.sendMessage("Event " + event_name + " stopped."); BuilderUtil.sendSysMessage(activeChar, "Event " + event_name + " stopped.");
return true; return true;
} }
activeChar.sendMessage("There is problem with stoping " + event_name + " event."); BuilderUtil.sendSysMessage(activeChar, "There is problem with stoping " + event_name + " event.");
return true; return true;
} }
} }
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //event_start <eventname>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //event_start <eventname>");
e.printStackTrace(); e.printStackTrace();
return false; return false;
} }
@@ -138,7 +139,7 @@ public class AdminEvents implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //event_bypass <eventname> <bypass>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //event_bypass <eventname> <bypass>");
e.printStackTrace(); e.printStackTrace();
return false; return false;
} }

View File

@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: * This class handles following admin commands:
@@ -51,12 +52,12 @@ public class AdminExpSp implements IAdminCommandHandler
final String val = command.substring(16); final String val = command.substring(16);
if (!adminAddExpSp(activeChar, val)) if (!adminAddExpSp(activeChar, val))
{ {
activeChar.sendMessage("Usage: //add_exp_sp exp sp"); BuilderUtil.sendSysMessage(activeChar, "Usage: //add_exp_sp exp sp");
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ // Case of missing parameter { // Case of missing parameter
activeChar.sendMessage("Usage: //add_exp_sp exp sp"); BuilderUtil.sendSysMessage(activeChar, "Usage: //add_exp_sp exp sp");
} }
} }
else if (command.startsWith("admin_remove_exp_sp")) else if (command.startsWith("admin_remove_exp_sp"))
@@ -66,12 +67,12 @@ public class AdminExpSp implements IAdminCommandHandler
final String val = command.substring(19); final String val = command.substring(19);
if (!adminRemoveExpSP(activeChar, val)) if (!adminRemoveExpSP(activeChar, val))
{ {
activeChar.sendMessage("Usage: //remove_exp_sp exp sp"); BuilderUtil.sendSysMessage(activeChar, "Usage: //remove_exp_sp exp sp");
} }
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ // Case of missing parameter { // Case of missing parameter
activeChar.sendMessage("Usage: //remove_exp_sp exp sp"); BuilderUtil.sendSysMessage(activeChar, "Usage: //remove_exp_sp exp sp");
} }
} }
addExpSp(activeChar); addExpSp(activeChar);
@@ -145,7 +146,7 @@ public class AdminExpSp implements IAdminCommandHandler
player.sendMessage("Admin is adding you " + expval + " xp and " + spval + " sp."); player.sendMessage("Admin is adding you " + expval + " xp and " + spval + " sp.");
player.addExpAndSp(expval, spval); player.addExpAndSp(expval, spval);
// Admin information // Admin information
activeChar.sendMessage("Added " + expval + " xp and " + spval + " sp to " + player.getName() + "."); BuilderUtil.sendSysMessage(activeChar, "Added " + expval + " xp and " + spval + " sp to " + player.getName() + ".");
} }
return true; return true;
} }
@@ -188,7 +189,7 @@ public class AdminExpSp implements IAdminCommandHandler
player.sendMessage("Admin is removing you " + expval + " xp and " + spval + " sp."); player.sendMessage("Admin is removing you " + expval + " xp and " + spval + " sp.");
player.removeExpAndSp(expval, spval); player.removeExpAndSp(expval, spval);
// Admin information // Admin information
activeChar.sendMessage("Removed " + expval + " xp and " + spval + " sp from " + player.getName() + "."); BuilderUtil.sendSysMessage(activeChar, "Removed " + expval + " xp and " + spval + " sp from " + player.getName() + ".");
} }
return true; return true;
} }

View File

@@ -21,6 +21,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.instancemanager.FakePlayerChatManager; import com.l2jmobius.gameserver.instancemanager.FakePlayerChatManager;
import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* @author Mobius * @author Mobius
@@ -40,19 +41,19 @@ public class AdminFakePlayers implements IAdminCommandHandler
final String[] words = command.substring(15).split(" "); final String[] words = command.substring(15).split(" ");
if (words.length < 3) if (words.length < 3)
{ {
activeChar.sendMessage("Usage: //fakechat playername fpcname message"); BuilderUtil.sendSysMessage(activeChar, "Usage: //fakechat playername fpcname message");
return false; return false;
} }
final L2PcInstance player = L2World.getInstance().getPlayer(words[0]); final L2PcInstance player = L2World.getInstance().getPlayer(words[0]);
if (player == null) if (player == null)
{ {
activeChar.sendMessage("Player not found."); BuilderUtil.sendSysMessage(activeChar, "Player not found.");
return false; return false;
} }
final String fpcName = FakePlayerData.getInstance().getProperName(words[1]); final String fpcName = FakePlayerData.getInstance().getProperName(words[1]);
if (fpcName == null) if (fpcName == null)
{ {
activeChar.sendMessage("Fake player not found."); BuilderUtil.sendSysMessage(activeChar, "Fake player not found.");
return false; return false;
} }
String message = ""; String message = "";
@@ -65,7 +66,7 @@ public class AdminFakePlayers implements IAdminCommandHandler
message += (words[i] + " "); message += (words[i] + " ");
} }
FakePlayerChatManager.getInstance().sendChat(player, fpcName, message); FakePlayerChatManager.getInstance().sendChat(player, fpcName, message);
activeChar.sendMessage("Your message has been sent."); BuilderUtil.sendSysMessage(activeChar, "Your message has been sent.");
} }
return true; return true;
} }

View File

@@ -28,6 +28,7 @@ import com.l2jmobius.gameserver.model.entity.Fort;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles all siege commands: Todo: change the class name, and neaten it up * This class handles all siege commands: Todo: change the class name, and neaten it up
@@ -103,7 +104,7 @@ public class AdminFortSiege implements IAdminCommandHandler
} }
else if (command.equalsIgnoreCase("admin_list_fortsiege_clans")) else if (command.equalsIgnoreCase("admin_list_fortsiege_clans"))
{ {
activeChar.sendMessage("Not implemented yet."); BuilderUtil.sendSysMessage(activeChar, "Not implemented yet.");
} }
else if (command.equalsIgnoreCase("admin_setfort")) else if (command.equalsIgnoreCase("admin_setfort"))
{ {
@@ -125,7 +126,7 @@ public class AdminFortSiege implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Unable to remove fort"); BuilderUtil.sendSysMessage(activeChar, "Unable to remove fort");
} }
} }
else if (command.equalsIgnoreCase("admin_spawn_fortdoors")) else if (command.equalsIgnoreCase("admin_spawn_fortdoors"))

View File

@@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.GeoUtils; import com.l2jmobius.gameserver.util.GeoUtils;
/** /**
@@ -59,11 +60,11 @@ public class AdminGeodata implements IAdminCommandHandler
if (GeoEngine.getInstance().hasGeoPos(geoX, geoY)) if (GeoEngine.getInstance().hasGeoPos(geoX, geoY))
{ {
activeChar.sendMessage("WorldX: " + worldX + ", WorldY: " + worldY + ", WorldZ: " + worldZ + ", GeoX: " + geoX + ", GeoY: " + geoY + ", GeoZ: " + GeoEngine.getInstance().getHeight(worldX, worldY, worldZ)); BuilderUtil.sendSysMessage(activeChar, "WorldX: " + worldX + ", WorldY: " + worldY + ", WorldZ: " + worldZ + ", GeoX: " + geoX + ", GeoY: " + geoY + ", GeoZ: " + GeoEngine.getInstance().getHeight(worldX, worldY, worldZ));
} }
else else
{ {
activeChar.sendMessage("There is no geodata at this position."); BuilderUtil.sendSysMessage(activeChar, "There is no geodata at this position.");
} }
break; break;
} }
@@ -77,11 +78,11 @@ public class AdminGeodata implements IAdminCommandHandler
if (GeoEngine.getInstance().hasGeoPos(geoX, geoY)) if (GeoEngine.getInstance().hasGeoPos(geoX, geoY))
{ {
activeChar.sendMessage("WorldX: " + worldX + ", WorldY: " + worldY + ", WorldZ: " + worldZ + ", GeoX: " + geoX + ", GeoY: " + geoY + ", GeoZ: " + GeoEngine.getInstance().getHeight(worldX, worldY, worldZ)); BuilderUtil.sendSysMessage(activeChar, "WorldX: " + worldX + ", WorldY: " + worldY + ", WorldZ: " + worldZ + ", GeoX: " + geoX + ", GeoY: " + geoY + ", GeoZ: " + GeoEngine.getInstance().getHeight(worldX, worldY, worldZ));
} }
else else
{ {
activeChar.sendMessage("There is no geodata at this position."); BuilderUtil.sendSysMessage(activeChar, "There is no geodata at this position.");
} }
break; break;
} }
@@ -92,11 +93,11 @@ public class AdminGeodata implements IAdminCommandHandler
{ {
if (GeoEngine.getInstance().canSeeTarget(activeChar, target)) if (GeoEngine.getInstance().canSeeTarget(activeChar, target))
{ {
activeChar.sendMessage("Can move beeline."); BuilderUtil.sendSysMessage(activeChar, "Can move beeline.");
} }
else else
{ {
activeChar.sendMessage("Can not move beeline!"); BuilderUtil.sendSysMessage(activeChar, "Can not move beeline!");
} }
} }
else else
@@ -112,7 +113,7 @@ public class AdminGeodata implements IAdminCommandHandler
{ {
if (GeoEngine.getInstance().canSeeTarget(activeChar, target)) if (GeoEngine.getInstance().canSeeTarget(activeChar, target))
{ {
activeChar.sendMessage("Can see target."); BuilderUtil.sendSysMessage(activeChar, "Can see target.");
} }
else else
{ {
@@ -134,7 +135,7 @@ public class AdminGeodata implements IAdminCommandHandler
{ {
final int x = ((activeChar.getX() - L2World.MAP_MIN_X) >> 15) + L2World.TILE_X_MIN; final int x = ((activeChar.getX() - L2World.MAP_MIN_X) >> 15) + L2World.TILE_X_MIN;
final int y = ((activeChar.getY() - L2World.MAP_MIN_Y) >> 15) + L2World.TILE_Y_MIN; final int y = ((activeChar.getY() - L2World.MAP_MIN_Y) >> 15) + L2World.TILE_Y_MIN;
activeChar.sendMessage("GeoMap: " + x + "_" + y + " (" + ((x - L2World.TILE_ZERO_COORD_X) * L2World.TILE_SIZE) + "," + ((y - L2World.TILE_ZERO_COORD_Y) * L2World.TILE_SIZE) + " to " + ((((x - L2World.TILE_ZERO_COORD_X) * L2World.TILE_SIZE) + L2World.TILE_SIZE) - 1) + "," + ((((y - L2World.TILE_ZERO_COORD_Y) * L2World.TILE_SIZE) + L2World.TILE_SIZE) - 1) + ")"); BuilderUtil.sendSysMessage(activeChar, "GeoMap: " + x + "_" + y + " (" + ((x - L2World.TILE_ZERO_COORD_X) * L2World.TILE_SIZE) + "," + ((y - L2World.TILE_ZERO_COORD_Y) * L2World.TILE_SIZE) + " to " + ((((x - L2World.TILE_ZERO_COORD_X) * L2World.TILE_SIZE) + L2World.TILE_SIZE) - 1) + "," + ((((y - L2World.TILE_ZERO_COORD_Y) * L2World.TILE_SIZE) + L2World.TILE_SIZE) - 1) + ")");
break; break;
} }
} }

View File

@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import com.l2jmobius.gameserver.data.xml.impl.AdminData; import com.l2jmobius.gameserver.data.xml.impl.AdminData;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler; import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - gm = turns gm mode off * This class handles following admin commands: - gm = turns gm mode off
@@ -38,7 +39,7 @@ public class AdminGm implements IAdminCommandHandler
{ {
AdminData.getInstance().deleteGm(activeChar); AdminData.getInstance().deleteGm(activeChar);
activeChar.setAccessLevel(0, true, false); activeChar.setAccessLevel(0, true, false);
activeChar.sendMessage("You deactivated your GM access for this session, if you login again you will be GM again, in order to remove your access completely please shift yourself and set your accesslevel to 0."); BuilderUtil.sendSysMessage(activeChar, "You deactivated your GM access for this session, if you login again you will be GM again, in order to remove your access completely please shift yourself and set your accesslevel to 0.");
} }
return true; return true;
} }

View File

@@ -30,6 +30,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.quest.Quest; import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.zone.type.L2NoRestartZone; import com.l2jmobius.gameserver.model.zone.type.L2NoRestartZone;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import ai.bosses.Antharas.Antharas; import ai.bosses.Antharas.Antharas;
import ai.bosses.Baium.Baium; import ai.bosses.Baium.Baium;
@@ -93,12 +94,12 @@ public class AdminGrandBoss implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Wrong ID!"); BuilderUtil.sendSysMessage(activeChar, "Wrong ID!");
} }
} }
else else
{ {
activeChar.sendMessage("Usage: //grandboss_skip Id"); BuilderUtil.sendSysMessage(activeChar, "Usage: //grandboss_skip Id");
} }
break; break;
} }
@@ -124,13 +125,13 @@ public class AdminGrandBoss implements IAdminCommandHandler
} }
default: default:
{ {
activeChar.sendMessage("Wrong ID!"); BuilderUtil.sendSysMessage(activeChar, "Wrong ID!");
} }
} }
} }
else else
{ {
activeChar.sendMessage("Usage: //grandboss_respawn Id"); BuilderUtil.sendSysMessage(activeChar, "Usage: //grandboss_respawn Id");
} }
break; break;
} }
@@ -154,13 +155,13 @@ public class AdminGrandBoss implements IAdminCommandHandler
} }
default: default:
{ {
activeChar.sendMessage("Wrong ID!"); BuilderUtil.sendSysMessage(activeChar, "Wrong ID!");
} }
} }
} }
else else
{ {
activeChar.sendMessage("Usage: //grandboss_minions Id"); BuilderUtil.sendSysMessage(activeChar, "Usage: //grandboss_minions Id");
} }
break; break;
} }
@@ -186,13 +187,13 @@ public class AdminGrandBoss implements IAdminCommandHandler
} }
default: default:
{ {
activeChar.sendMessage("Wrong ID!"); BuilderUtil.sendSysMessage(activeChar, "Wrong ID!");
} }
} }
} }
else else
{ {
activeChar.sendMessage("Usage: //grandboss_abort Id"); BuilderUtil.sendSysMessage(activeChar, "Usage: //grandboss_abort Id");
} }
} }
break; break;
@@ -321,7 +322,7 @@ public class AdminGrandBoss implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Wrong ID!"); BuilderUtil.sendSysMessage(activeChar, "Wrong ID!");
} }
} }

View File

@@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - heal = restores HP/MP/CP on target, name or radius * This class handles following admin commands: - heal = restores HP/MP/CP on target, name or radius
@@ -59,7 +60,7 @@ public class AdminHeal implements IAdminCommandHandler
{ {
LOGGER.warning("Heal error: " + e); LOGGER.warning("Heal error: " + e);
} }
activeChar.sendMessage("Incorrect target/radius specified."); BuilderUtil.sendSysMessage(activeChar, "Incorrect target/radius specified.");
} }
} }
return true; return true;
@@ -102,7 +103,7 @@ public class AdminHeal implements IAdminCommandHandler
} }
}); });
activeChar.sendMessage("Healed within " + radius + " unit radius."); BuilderUtil.sendSysMessage(activeChar, "Healed within " + radius + " unit radius.");
return; return;
} }
catch (NumberFormatException nbe) catch (NumberFormatException nbe)

View File

@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.cache.HtmCache;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler; import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* @author NosBit * @author NosBit
@@ -47,7 +48,7 @@ public class AdminHtml implements IAdminCommandHandler
{ {
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Usage: //html path"); BuilderUtil.sendSysMessage(activeChar, "Usage: //html path");
return false; return false;
} }
@@ -59,7 +60,7 @@ public class AdminHtml implements IAdminCommandHandler
{ {
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Usage: //loadhtml path"); BuilderUtil.sendSysMessage(activeChar, "Usage: //loadhtml path");
return false; return false;
} }

View File

@@ -37,6 +37,7 @@ import com.l2jmobius.gameserver.model.instancezone.Instance;
import com.l2jmobius.gameserver.model.instancezone.InstanceTemplate; import com.l2jmobius.gameserver.model.instancezone.InstanceTemplate;
import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.BypassParser; import com.l2jmobius.gameserver.util.BypassParser;
/** /**
@@ -138,7 +139,7 @@ public final class AdminInstance implements IAdminCommandHandler
} }
default: default:
{ {
activeChar.sendMessage("Wrong enter group usage! Please use those values: Alone, Party or CommandChannel."); BuilderUtil.sendSysMessage(activeChar, "Wrong enter group usage! Please use those values: Alone, Party or CommandChannel.");
return true; return true;
} }
} }
@@ -157,7 +158,7 @@ public final class AdminInstance implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Wrong parameters! Please try again."); BuilderUtil.sendSysMessage(activeChar, "Wrong parameters! Please try again.");
return true; return true;
} }
break; break;
@@ -187,7 +188,7 @@ public final class AdminInstance implements IAdminCommandHandler
if (instance != null) if (instance != null)
{ {
instance.getPlayers().forEach(player -> player.sendPacket(new ExShowScreenMessage("Your instance has been destroyed by Game Master!", 10000))); instance.getPlayers().forEach(player -> player.sendPacket(new ExShowScreenMessage("Your instance has been destroyed by Game Master!", 10000)));
activeChar.sendMessage("You destroyed Instance " + instance.getId() + " with " + instance.getPlayersCount() + " players inside."); BuilderUtil.sendSysMessage(activeChar, "You destroyed Instance " + instance.getId() + " with " + instance.getPlayersCount() + " players inside.");
instance.destroy(); instance.destroy();
sendTemplateDetails(activeChar, instance.getTemplateId()); sendTemplateDetails(activeChar, instance.getTemplateId());
} }

View File

@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.GMAudit; import com.l2jmobius.gameserver.util.GMAudit;
public class AdminInstanceZone implements IAdminCommandHandler public class AdminInstanceZone implements IAdminCommandHandler
@@ -51,15 +52,15 @@ public class AdminInstanceZone implements IAdminCommandHandler
final int instanceId = Integer.parseInt(st.nextToken()); final int instanceId = Integer.parseInt(st.nextToken());
final String name = InstanceManager.getInstance().getInstanceName(instanceId); final String name = InstanceManager.getInstance().getInstanceName(instanceId);
InstanceManager.getInstance().deleteInstanceTime(player, instanceId); InstanceManager.getInstance().deleteInstanceTime(player, instanceId);
activeChar.sendMessage("Instance zone " + name + " cleared for player " + player.getName()); BuilderUtil.sendSysMessage(activeChar, "Instance zone " + name + " cleared for player " + player.getName());
player.sendMessage("Admin cleared instance zone " + name + " for you"); player.sendMessage("Admin cleared instance zone " + name + " for you");
return true; return true;
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Failed clearing instance time: " + e.getMessage()); BuilderUtil.sendSysMessage(activeChar, "Failed clearing instance time: " + e.getMessage());
activeChar.sendMessage("Usage: //instancezone_clear <playername> [instanceId]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //instancezone_clear <playername> [instanceId]");
return false; return false;
} }
} }
@@ -87,8 +88,8 @@ public class AdminInstanceZone implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("The player " + playername + " is not online"); BuilderUtil.sendSysMessage(activeChar, "The player " + playername + " is not online");
activeChar.sendMessage("Usage: //instancezone [playername]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //instancezone [playername]");
return false; return false;
} }
} }

View File

@@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.Disconnection; import com.l2jmobius.gameserver.network.Disconnection;
import com.l2jmobius.gameserver.util.BuilderUtil;
public class AdminKick implements IAdminCommandHandler public class AdminKick implements IAdminCommandHandler
{ {
@@ -45,7 +46,7 @@ public class AdminKick implements IAdminCommandHandler
if (plyr != null) if (plyr != null)
{ {
Disconnection.of(plyr).defaultSequence(false); Disconnection.of(plyr).defaultSequence(false);
activeChar.sendMessage("You kicked " + plyr.getName() + " from the game."); BuilderUtil.sendSysMessage(activeChar, "You kicked " + plyr.getName() + " from the game.");
} }
} }
} }
@@ -60,7 +61,7 @@ public class AdminKick implements IAdminCommandHandler
Disconnection.of(player).defaultSequence(false); Disconnection.of(player).defaultSequence(false);
} }
} }
activeChar.sendMessage("Kicked " + counter + " players."); BuilderUtil.sendSysMessage(activeChar, "Kicked " + counter + " players.");
} }
return true; return true;
} }

View File

@@ -27,6 +27,7 @@ import com.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2ControllableMobInstance; import com.l2jmobius.gameserver.model.actor.instance.L2ControllableMobInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - kill = kills target L2Character - kill_monster = kills target non-player - kill <radius> = If radius is specified, then ALL players only in that radius will be killed. - kill_monster <radius> = If radius is specified, then ALL non-players only in * This class handles following admin commands: - kill = kills target L2Character - kill_monster = kills target non-player - kill <radius> = If radius is specified, then ALL players only in that radius will be killed. - kill_monster <radius> = If radius is specified, then ALL non-players only in
@@ -70,12 +71,12 @@ public class AdminKill implements IAdminCommandHandler
kill(activeChar, knownChar); kill(activeChar, knownChar);
}); });
activeChar.sendMessage("Killed all characters within a " + radius + " unit radius."); BuilderUtil.sendSysMessage(activeChar, "Killed all characters within a " + radius + " unit radius.");
return true; return true;
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
activeChar.sendMessage("Invalid radius."); BuilderUtil.sendSysMessage(activeChar, "Invalid radius.");
return false; return false;
} }
} }
@@ -96,12 +97,12 @@ public class AdminKill implements IAdminCommandHandler
kill(activeChar, wo); kill(activeChar, wo);
}); });
activeChar.sendMessage("Killed all characters within a " + radius + " unit radius."); BuilderUtil.sendSysMessage(activeChar, "Killed all characters within a " + radius + " unit radius.");
return true; return true;
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
activeChar.sendMessage("Usage: //kill <player_name | radius>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //kill <player_name | radius>");
return false; return false;
} }
} }

View File

@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Playable; import com.l2jmobius.gameserver.model.actor.L2Playable;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
public class AdminLevel implements IAdminCommandHandler public class AdminLevel implements IAdminCommandHandler
{ {
@@ -57,7 +58,7 @@ public class AdminLevel implements IAdminCommandHandler
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
activeChar.sendMessage("Wrong Number Format"); BuilderUtil.sendSysMessage(activeChar, "Wrong Number Format");
} }
} }
else if (actualCommand.equalsIgnoreCase("admin_set_level")) else if (actualCommand.equalsIgnoreCase("admin_set_level"))
@@ -83,13 +84,13 @@ public class AdminLevel implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("You must specify level between 1 and " + maxLevel + "."); BuilderUtil.sendSysMessage(activeChar, "You must specify level between 1 and " + maxLevel + ".");
return false; return false;
} }
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
activeChar.sendMessage("You must specify level between 1 and " + maxLevel + "."); BuilderUtil.sendSysMessage(activeChar, "You must specify level between 1 and " + maxLevel + ".");
return false; return false;
} }
} }

View File

@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.loginserverpackets.game.ServerStatus; import com.l2jmobius.gameserver.network.loginserverpackets.game.ServerStatus;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles the admin commands that acts on the login * This class handles the admin commands that acts on the login
@@ -47,13 +48,13 @@ public class AdminLogin implements IAdminCommandHandler
if (command.equals("admin_server_gm_only")) if (command.equals("admin_server_gm_only"))
{ {
gmOnly(); gmOnly();
activeChar.sendMessage("Server is now GM only"); BuilderUtil.sendSysMessage(activeChar, "Server is now GM only");
showMainPage(activeChar); showMainPage(activeChar);
} }
else if (command.equals("admin_server_all")) else if (command.equals("admin_server_all"))
{ {
allowToAll(); allowToAll();
activeChar.sendMessage("Server is not GM only anymore"); BuilderUtil.sendSysMessage(activeChar, "Server is not GM only anymore");
showMainPage(activeChar); showMainPage(activeChar);
} }
else if (command.startsWith("admin_server_max_player")) else if (command.startsWith("admin_server_max_player"))
@@ -66,17 +67,17 @@ public class AdminLogin implements IAdminCommandHandler
try try
{ {
LoginServerThread.getInstance().setMaxPlayer(Integer.parseInt(number)); LoginServerThread.getInstance().setMaxPlayer(Integer.parseInt(number));
activeChar.sendMessage("maxPlayer set to " + number); BuilderUtil.sendSysMessage(activeChar, "maxPlayer set to " + number);
showMainPage(activeChar); showMainPage(activeChar);
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
activeChar.sendMessage("Max players must be a number."); BuilderUtil.sendSysMessage(activeChar, "Max players must be a number.");
} }
} }
else else
{ {
activeChar.sendMessage("Format is server_max_player <max>"); BuilderUtil.sendSysMessage(activeChar, "Format is server_max_player <max>");
} }
} }
else if (command.startsWith("admin_server_list_type")) else if (command.startsWith("admin_server_list_type"))
@@ -105,18 +106,18 @@ public class AdminLogin implements IAdminCommandHandler
{ {
Config.SERVER_LIST_TYPE = newType; Config.SERVER_LIST_TYPE = newType;
LoginServerThread.getInstance().sendServerType(); LoginServerThread.getInstance().sendServerType();
activeChar.sendMessage("Server Type changed to " + getServerTypeName(newType)); BuilderUtil.sendSysMessage(activeChar, "Server Type changed to " + getServerTypeName(newType));
showMainPage(activeChar); showMainPage(activeChar);
} }
else else
{ {
activeChar.sendMessage("Server Type is already " + getServerTypeName(newType)); BuilderUtil.sendSysMessage(activeChar, "Server Type is already " + getServerTypeName(newType));
showMainPage(activeChar); showMainPage(activeChar);
} }
} }
else else
{ {
activeChar.sendMessage("Format is server_list_type <normal/relax/test/nolabel/restricted/event/free>"); BuilderUtil.sendSysMessage(activeChar, "Format is server_list_type <normal/relax/test/nolabel/restricted/event/free>");
} }
} }
else if (command.startsWith("admin_server_list_age")) else if (command.startsWith("admin_server_list_age"))
@@ -134,23 +135,23 @@ public class AdminLogin implements IAdminCommandHandler
{ {
Config.SERVER_LIST_TYPE = age; Config.SERVER_LIST_TYPE = age;
LoginServerThread.getInstance().sendServerStatus(ServerStatus.SERVER_AGE, age); LoginServerThread.getInstance().sendServerStatus(ServerStatus.SERVER_AGE, age);
activeChar.sendMessage("Server Age changed to " + age); BuilderUtil.sendSysMessage(activeChar, "Server Age changed to " + age);
showMainPage(activeChar); showMainPage(activeChar);
} }
else else
{ {
activeChar.sendMessage("Server Age is already " + age); BuilderUtil.sendSysMessage(activeChar, "Server Age is already " + age);
showMainPage(activeChar); showMainPage(activeChar);
} }
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
activeChar.sendMessage("Age must be a number"); BuilderUtil.sendSysMessage(activeChar, "Age must be a number");
} }
} }
else else
{ {
activeChar.sendMessage("Format is server_list_age <number>"); BuilderUtil.sendSysMessage(activeChar, "Format is server_list_age <number>");
} }
} }
else if (command.equals("admin_server_login")) else if (command.equals("admin_server_login"))

View File

@@ -31,6 +31,7 @@ import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.Disconnection; import com.l2jmobius.gameserver.network.Disconnection;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* This class handles following admin commands: - handles every admin menu command * This class handles following admin commands: - handles every admin menu command
@@ -100,7 +101,7 @@ public class AdminMenu implements IAdminCommandHandler
} }
if (!player.isInParty()) if (!player.isInParty())
{ {
activeChar.sendMessage("Player is not in party."); BuilderUtil.sendSysMessage(activeChar, "Player is not in party.");
teleportCharacter(player, activeChar.getLocation(), activeChar, "Admin is teleporting you."); teleportCharacter(player, activeChar.getLocation(), activeChar, "Admin is teleporting you.");
return true; return true;
} }
@@ -128,7 +129,7 @@ public class AdminMenu implements IAdminCommandHandler
final L2Clan clan = player.getClan(); final L2Clan clan = player.getClan();
if (clan == null) if (clan == null)
{ {
activeChar.sendMessage("Player is not in a clan."); BuilderUtil.sendSysMessage(activeChar, "Player is not in a clan.");
teleportCharacter(player, activeChar.getLocation(), activeChar, "Admin is teleporting you."); teleportCharacter(player, activeChar.getLocation(), activeChar, "Admin is teleporting you.");
return true; return true;
} }
@@ -225,7 +226,7 @@ public class AdminMenu implements IAdminCommandHandler
if (plyr != null) if (plyr != null)
{ {
target = plyr; target = plyr;
activeChar.sendMessage("You killed " + plyr.getName()); BuilderUtil.sendSysMessage(activeChar, "You killed " + plyr.getName());
} }
} }
if (target != null) if (target != null)
@@ -277,7 +278,7 @@ public class AdminMenu implements IAdminCommandHandler
else else
{ {
activeChar.teleToLocation(player.getLocation(), true, player.getInstanceWorld()); activeChar.teleToLocation(player.getLocation(), true, player.getInstanceWorld());
activeChar.sendMessage("You're teleporting yourself to character " + player.getName()); BuilderUtil.sendSysMessage(activeChar, "You're teleporting yourself to character " + player.getName());
} }
showMainPage(activeChar); showMainPage(activeChar);
} }

View File

@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler; import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
/** /**
@@ -47,7 +48,7 @@ public class AdminMessages implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Command format: //msg <SYSTEM_MSG_ID>"); BuilderUtil.sendSysMessage(activeChar, "Command format: //msg <SYSTEM_MSG_ID>");
} }
} }
else if (command.startsWith("admin_msgx ")) else if (command.startsWith("admin_msgx "))
@@ -55,7 +56,7 @@ public class AdminMessages implements IAdminCommandHandler
final String[] tokens = command.split(" "); final String[] tokens = command.split(" ");
if ((tokens.length <= 2) || !Util.isDigit(tokens[1])) if ((tokens.length <= 2) || !Util.isDigit(tokens[1]))
{ {
activeChar.sendMessage("Command format: //msgx <SYSTEM_MSG_ID> [item:Id] [skill:Id] [npc:Id] [zone:x,y,x] [castle:Id] [str:'text']"); BuilderUtil.sendSysMessage(activeChar, "Command format: //msgx <SYSTEM_MSG_ID> [item:Id] [skill:Id] [npc:Id] [zone:x,y,x] [castle:Id] [str:'text']");
return false; return false;
} }
@@ -99,7 +100,7 @@ public class AdminMessages implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Exception: " + e.getMessage()); BuilderUtil.sendSysMessage(activeChar, "Exception: " + e.getMessage());
continue; continue;
} }
} }

View File

@@ -28,6 +28,7 @@ import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.events.EventType; import com.l2jmobius.gameserver.model.events.EventType;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* @author Mobius * @author Mobius
@@ -55,7 +56,7 @@ public class AdminMissingHtmls implements IAdminCommandHandler
final int topLeftY = (y - L2World.TILE_ZERO_COORD_Y) * L2World.TILE_SIZE; final int topLeftY = (y - L2World.TILE_ZERO_COORD_Y) * L2World.TILE_SIZE;
final int bottomRightX = (((x - L2World.TILE_ZERO_COORD_X) * L2World.TILE_SIZE) + L2World.TILE_SIZE) - 1; final int bottomRightX = (((x - L2World.TILE_ZERO_COORD_X) * L2World.TILE_SIZE) + L2World.TILE_SIZE) - 1;
final int bottomRightY = (((y - L2World.TILE_ZERO_COORD_Y) * L2World.TILE_SIZE) + L2World.TILE_SIZE) - 1; final int bottomRightY = (((y - L2World.TILE_ZERO_COORD_Y) * L2World.TILE_SIZE) + L2World.TILE_SIZE) - 1;
activeChar.sendMessage("GeoMap: " + x + "_" + y + " (" + topLeftX + "," + topLeftY + " to " + bottomRightX + "," + bottomRightY + ")"); BuilderUtil.sendSysMessage(activeChar, "GeoMap: " + x + "_" + y + " (" + topLeftX + "," + topLeftY + " to " + bottomRightX + "," + bottomRightY + ")");
final List<Integer> results = new ArrayList<>(); final List<Integer> results = new ArrayList<>();
for (L2Object obj : L2World.getInstance().getVisibleObjects()) for (L2Object obj : L2World.getInstance().getVisibleObjects())
{ {
@@ -75,14 +76,14 @@ public class AdminMissingHtmls implements IAdminCommandHandler
Collections.sort(results); Collections.sort(results);
for (int id : results) for (int id : results)
{ {
activeChar.sendMessage("NPC " + id + " does not have a default html."); BuilderUtil.sendSysMessage(activeChar, "NPC " + id + " does not have a default html.");
} }
activeChar.sendMessage("Found " + results.size() + " results."); BuilderUtil.sendSysMessage(activeChar, "Found " + results.size() + " results.");
break; break;
} }
case "admin_world_missing_htmls": case "admin_world_missing_htmls":
{ {
activeChar.sendMessage("Missing htmls for the whole world."); BuilderUtil.sendSysMessage(activeChar, "Missing htmls for the whole world.");
final List<Integer> results = new ArrayList<>(); final List<Integer> results = new ArrayList<>();
for (L2Object obj : L2World.getInstance().getVisibleObjects()) for (L2Object obj : L2World.getInstance().getVisibleObjects())
{ {
@@ -102,9 +103,9 @@ public class AdminMissingHtmls implements IAdminCommandHandler
Collections.sort(results); Collections.sort(results);
for (int id : results) for (int id : results)
{ {
activeChar.sendMessage("NPC " + id + " does not have a default html."); BuilderUtil.sendSysMessage(activeChar, "NPC " + id + " does not have a default html.");
} }
activeChar.sendMessage("Found " + results.size() + " results."); BuilderUtil.sendSysMessage(activeChar, "Found " + results.size() + " results.");
break; break;
} }
} }

View File

@@ -28,6 +28,7 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.MagicSkillUse; import com.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
import com.l2jmobius.gameserver.network.serverpackets.SetupGauge; import com.l2jmobius.gameserver.network.serverpackets.SetupGauge;
import com.l2jmobius.gameserver.util.Broadcast; import com.l2jmobius.gameserver.util.Broadcast;
import com.l2jmobius.gameserver.util.BuilderUtil;
/** /**
* @author littlecrow Admin commands handler for controllable mobs * @author littlecrow Admin commands handler for controllable mobs
@@ -154,13 +155,13 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Incorrect command arguments."); BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
return; return;
} }
final MobGroup group = MobGroupTable.getInstance().getGroup(groupId); final MobGroup group = MobGroupTable.getInstance().getGroup(groupId);
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
group.returnGroup(activeChar); group.returnGroup(activeChar);
@@ -176,13 +177,13 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Incorrect command arguments."); BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
return; return;
} }
final MobGroup group = MobGroupTable.getInstance().getGroup(groupId); final MobGroup group = MobGroupTable.getInstance().getGroup(groupId);
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
group.setIdleMode(); group.setIdleMode();
@@ -197,13 +198,13 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Incorrect command arguments."); BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
return; return;
} }
final MobGroup group = MobGroupTable.getInstance().getGroup(groupId); final MobGroup group = MobGroupTable.getInstance().getGroup(groupId);
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
group.setAttackRandom(); group.setAttackRandom();
@@ -218,13 +219,13 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Incorrect command arguments."); BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
return; return;
} }
final MobGroup group = MobGroupTable.getInstance().getGroup(groupId); final MobGroup group = MobGroupTable.getInstance().getGroup(groupId);
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
group.setAttackTarget(target); group.setAttackTarget(target);
@@ -239,13 +240,13 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Incorrect command arguments."); BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
return; return;
} }
final MobGroup group = MobGroupTable.getInstance().getGroup(groupId); final MobGroup group = MobGroupTable.getInstance().getGroup(groupId);
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
group.setFollowMode(target); group.setFollowMode(target);
@@ -267,13 +268,13 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //mobgroup_create <group> <npcid> <count>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_create <group> <npcid> <count>");
return; return;
} }
if (MobGroupTable.getInstance().getGroup(groupId) != null) if (MobGroupTable.getInstance().getGroup(groupId) != null)
{ {
activeChar.sendMessage("Mob group " + groupId + " already exists."); BuilderUtil.sendSysMessage(activeChar, "Mob group " + groupId + " already exists.");
return; return;
} }
@@ -281,14 +282,14 @@ public class AdminMobGroup implements IAdminCommandHandler
if (template == null) if (template == null)
{ {
activeChar.sendMessage("Invalid NPC ID specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid NPC ID specified.");
return; return;
} }
final MobGroup group = new MobGroup(groupId, template, mobCount); final MobGroup group = new MobGroup(groupId, template, mobCount);
MobGroupTable.getInstance().addGroup(groupId, group); MobGroupTable.getInstance().addGroup(groupId, group);
activeChar.sendMessage("Mob group " + groupId + " created."); BuilderUtil.sendSysMessage(activeChar, "Mob group " + groupId + " created.");
} }
private void removeGroup(String command, L2PcInstance activeChar) private void removeGroup(String command, L2PcInstance activeChar)
@@ -301,7 +302,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //mobgroup_remove <groupId>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_remove <groupId>");
return; return;
} }
@@ -309,7 +310,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
@@ -318,7 +319,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (MobGroupTable.getInstance().removeGroup(groupId)) if (MobGroupTable.getInstance().removeGroup(groupId))
{ {
activeChar.sendMessage("Mob group " + groupId + " unspawned and removed."); BuilderUtil.sendSysMessage(activeChar, "Mob group " + groupId + " unspawned and removed.");
} }
} }
@@ -349,7 +350,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //mobgroup_spawn <group> [ x y z ]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_spawn <group> [ x y z ]");
return; return;
} }
@@ -357,7 +358,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
@@ -372,7 +373,7 @@ public class AdminMobGroup implements IAdminCommandHandler
group.spawnGroup(activeChar); group.spawnGroup(activeChar);
} }
activeChar.sendMessage("Mob group " + groupId + " spawned."); BuilderUtil.sendSysMessage(activeChar, "Mob group " + groupId + " spawned.");
} }
private void unspawnGroup(String command, L2PcInstance activeChar) private void unspawnGroup(String command, L2PcInstance activeChar)
@@ -385,7 +386,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //mobgroup_unspawn <groupId>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_unspawn <groupId>");
return; return;
} }
@@ -393,14 +394,14 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
doAnimation(activeChar); doAnimation(activeChar);
group.unspawnGroup(); group.unspawnGroup();
activeChar.sendMessage("Mob group " + groupId + " unspawned."); BuilderUtil.sendSysMessage(activeChar, "Mob group " + groupId + " unspawned.");
} }
private void killGroup(String command, L2PcInstance activeChar) private void killGroup(String command, L2PcInstance activeChar)
@@ -413,7 +414,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //mobgroup_kill <groupId>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_kill <groupId>");
return; return;
} }
@@ -421,7 +422,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
@@ -439,7 +440,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //mobgroup_casting <groupId>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_casting <groupId>");
return; return;
} }
@@ -447,7 +448,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
@@ -466,7 +467,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //mobgroup_nomove <groupId> <on|off>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_nomove <groupId> <on|off>");
return; return;
} }
@@ -474,7 +475,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
@@ -488,7 +489,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Incorrect command arguments."); BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
} }
} }
@@ -510,7 +511,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //mobgroup_attackgrp <groupId> <TargetGroupId>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_attackgrp <groupId> <TargetGroupId>");
return; return;
} }
@@ -518,7 +519,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
@@ -526,7 +527,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (othGroup == null) if (othGroup == null)
{ {
activeChar.sendMessage("Incorrect target group."); BuilderUtil.sendSysMessage(activeChar, "Incorrect target group.");
return; return;
} }
@@ -545,7 +546,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //mobgroup_invul <groupId> <on|off>"); BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_invul <groupId> <on|off>");
return; return;
} }
@@ -553,7 +554,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
@@ -567,7 +568,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
else else
{ {
activeChar.sendMessage("Incorrect command arguments."); BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
} }
} }
@@ -594,7 +595,7 @@ public class AdminMobGroup implements IAdminCommandHandler
} }
catch (Exception e) catch (Exception e)
{ {
activeChar.sendMessage("Usage: //mobgroup_teleport <groupId> [playerName]"); BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_teleport <groupId> [playerName]");
return; return;
} }
@@ -602,7 +603,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null) if (group == null)
{ {
activeChar.sendMessage("Invalid group specified."); BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return; return;
} }
@@ -613,7 +614,7 @@ public class AdminMobGroup implements IAdminCommandHandler
{ {
final MobGroup[] mobGroupList = MobGroupTable.getInstance().getGroups(); final MobGroup[] mobGroupList = MobGroupTable.getInstance().getGroups();
activeChar.sendMessage("======= <Mob Groups> ======="); BuilderUtil.sendSysMessage(activeChar, "======= <Mob Groups> =======");
for (MobGroup mobGroup : mobGroupList) for (MobGroup mobGroup : mobGroupList)
{ {

View File

@@ -30,6 +30,7 @@ import com.l2jmobius.gameserver.model.olympiad.OlympiadGameTask;
import com.l2jmobius.gameserver.model.olympiad.OlympiadManager; import com.l2jmobius.gameserver.model.olympiad.OlympiadManager;
import com.l2jmobius.gameserver.model.olympiad.Participant; import com.l2jmobius.gameserver.model.olympiad.Participant;
import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util; import com.l2jmobius.gameserver.util.Util;
/** /**
@@ -56,7 +57,7 @@ public class AdminOlympiad implements IAdminCommandHandler
{ {
if (!st.hasMoreTokens()) if (!st.hasMoreTokens())
{ {
activeChar.sendMessage("Syntax: //olympiad_game <player name>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //olympiad_game <player name>");
return false; return false;
} }
@@ -107,7 +108,7 @@ public class AdminOlympiad implements IAdminCommandHandler
final int val = parseInt(st, Integer.MIN_VALUE); final int val = parseInt(st, Integer.MIN_VALUE);
if (val == Integer.MIN_VALUE) if (val == Integer.MIN_VALUE)
{ {
activeChar.sendMessage("Syntax: //addolypoints <points>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //addolypoints <points>");
return false; return false;
} }
@@ -118,24 +119,24 @@ public class AdminOlympiad implements IAdminCommandHandler
final int points = Math.max(oldpoints + val, 0); final int points = Math.max(oldpoints + val, 0);
if (points > 1000) if (points > 1000)
{ {
activeChar.sendMessage("You can't set more than 1000 or less than 0 Olympiad points!"); BuilderUtil.sendSysMessage(activeChar, "You can't set more than 1000 or less than 0 Olympiad points!");
return false; return false;
} }
statDat.set(Olympiad.POINTS, points); statDat.set(Olympiad.POINTS, points);
activeChar.sendMessage("Player " + player.getName() + " now has " + points + " Olympiad points."); BuilderUtil.sendSysMessage(activeChar, "Player " + player.getName() + " now has " + points + " Olympiad points.");
} }
else else
{ {
activeChar.sendMessage("This player is not noblesse!"); BuilderUtil.sendSysMessage(activeChar, "This player is not noblesse!");
return false; return false;
} }
} }
else else
{ {
activeChar.sendMessage("Usage: target a player and write the amount of points you would like to add."); BuilderUtil.sendSysMessage(activeChar, "Usage: target a player and write the amount of points you would like to add.");
activeChar.sendMessage("Example: //addolypoints 10"); BuilderUtil.sendSysMessage(activeChar, "Example: //addolypoints 10");
activeChar.sendMessage("However, keep in mind that you can't have less than 0 or more than 1000 points."); BuilderUtil.sendSysMessage(activeChar, "However, keep in mind that you can't have less than 0 or more than 1000 points.");
} }
break; break;
} }
@@ -148,7 +149,7 @@ public class AdminOlympiad implements IAdminCommandHandler
final int val = parseInt(st, Integer.MIN_VALUE); final int val = parseInt(st, Integer.MIN_VALUE);
if (val == Integer.MIN_VALUE) if (val == Integer.MIN_VALUE)
{ {
activeChar.sendMessage("Syntax: //removeolypoints <points>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //removeolypoints <points>");
return false; return false;
} }
@@ -157,7 +158,7 @@ public class AdminOlympiad implements IAdminCommandHandler
final StatsSet playerStat = Olympiad.getNobleStats(player.getObjectId()); final StatsSet playerStat = Olympiad.getNobleStats(player.getObjectId());
if (playerStat == null) if (playerStat == null)
{ {
activeChar.sendMessage("This player hasn't played on Olympiad yet!"); BuilderUtil.sendSysMessage(activeChar, "This player hasn't played on Olympiad yet!");
return false; return false;
} }
@@ -165,19 +166,19 @@ public class AdminOlympiad implements IAdminCommandHandler
final int points = Math.max(oldpoints - val, 0); final int points = Math.max(oldpoints - val, 0);
playerStat.set(Olympiad.POINTS, points); playerStat.set(Olympiad.POINTS, points);
activeChar.sendMessage("Player " + player.getName() + " now has " + points + " Olympiad points."); BuilderUtil.sendSysMessage(activeChar, "Player " + player.getName() + " now has " + points + " Olympiad points.");
} }
else else
{ {
activeChar.sendMessage("This player is not noblesse!"); BuilderUtil.sendSysMessage(activeChar, "This player is not noblesse!");
return false; return false;
} }
} }
else else
{ {
activeChar.sendMessage("Usage: target a player and write the amount of points you would like to remove."); BuilderUtil.sendSysMessage(activeChar, "Usage: target a player and write the amount of points you would like to remove.");
activeChar.sendMessage("Example: //removeolypoints 10"); BuilderUtil.sendSysMessage(activeChar, "Example: //removeolypoints 10");
activeChar.sendMessage("However, keep in mind that you can't have less than 0 or more than 1000 points."); BuilderUtil.sendSysMessage(activeChar, "However, keep in mind that you can't have less than 0 or more than 1000 points.");
} }
break; break;
} }
@@ -190,7 +191,7 @@ public class AdminOlympiad implements IAdminCommandHandler
final int val = parseInt(st, Integer.MIN_VALUE); final int val = parseInt(st, Integer.MIN_VALUE);
if (val == Integer.MIN_VALUE) if (val == Integer.MIN_VALUE)
{ {
activeChar.sendMessage("Syntax: //setolypoints <points>"); BuilderUtil.sendSysMessage(activeChar, "Syntax: //setolypoints <points>");
return false; return false;
} }
@@ -201,24 +202,24 @@ public class AdminOlympiad implements IAdminCommandHandler
final int points = oldpoints - val; final int points = oldpoints - val;
if ((points < 1) && (points > 1000)) if ((points < 1) && (points > 1000))
{ {
activeChar.sendMessage("You can't set more than 1000 or less than 0 Olympiad points! or lower then 0"); BuilderUtil.sendSysMessage(activeChar, "You can't set more than 1000 or less than 0 Olympiad points! or lower then 0");
return false; return false;
} }
statDat.set(Olympiad.POINTS, points); statDat.set(Olympiad.POINTS, points);
activeChar.sendMessage("Player " + player.getName() + " now has " + points + " Olympiad points."); BuilderUtil.sendSysMessage(activeChar, "Player " + player.getName() + " now has " + points + " Olympiad points.");
} }
else else
{ {
activeChar.sendMessage("This player is not noblesse!"); BuilderUtil.sendSysMessage(activeChar, "This player is not noblesse!");
return false; return false;
} }
} }
else else
{ {
activeChar.sendMessage("Usage: target a player and write the amount of points you would like to set."); BuilderUtil.sendSysMessage(activeChar, "Usage: target a player and write the amount of points you would like to set.");
activeChar.sendMessage("Example: //setolypoints 10"); BuilderUtil.sendSysMessage(activeChar, "Example: //setolypoints 10");
activeChar.sendMessage("However, keep in mind that you can't have less than 0 or more than 1000 points."); BuilderUtil.sendSysMessage(activeChar, "However, keep in mind that you can't have less than 0 or more than 1000 points.");
} }
break; break;
} }
@@ -263,22 +264,22 @@ public class AdminOlympiad implements IAdminCommandHandler
{ {
if (player.isSubClassActive()) if (player.isSubClassActive())
{ {
activeChar.sendMessage("Player " + player + " subclass active."); BuilderUtil.sendSysMessage(activeChar, "Player " + player + " subclass active.");
return false; return false;
} }
else if (player.getClassId().level() < 3) else if (player.getClassId().level() < 3)
{ {
activeChar.sendMessage("Player " + player + " has not 3rd class."); BuilderUtil.sendSysMessage(activeChar, "Player " + player + " has not 3rd class.");
return false; return false;
} }
else if (Olympiad.getInstance().getNoblePoints(player) <= 0) else if (Olympiad.getInstance().getNoblePoints(player) <= 0)
{ {
activeChar.sendMessage("Player " + player + " has 0 oly points (add them with (//addolypoints)."); BuilderUtil.sendSysMessage(activeChar, "Player " + player + " has 0 oly points (add them with (//addolypoints).");
return false; return false;
} }
else if (OlympiadManager.getInstance().isRegistered(player)) else if (OlympiadManager.getInstance().isRegistered(player))
{ {
activeChar.sendMessage("Player " + player + " registered to oly."); BuilderUtil.sendSysMessage(activeChar, "Player " + player + " registered to oly.");
return false; return false;
} }
return true; return true;

Some files were not shown because too many files have changed in this diff Show More