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

@@ -27,6 +27,7 @@ import com.l2jmobius.gameserver.model.entity.Hero;
import com.l2jmobius.gameserver.model.olympiad.Olympiad;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands: - admin|admin1/admin2/admin3/admin4/admin5 = slots for the 5 starting admin menus - gmliston/gmlistoff = includes/excludes active character from /gmlist results - silence = toggles private messages acceptance mode - diet = toggles weight penalty mode -
@@ -77,13 +78,13 @@ public class AdminAdmin implements IAdminCommandHandler
else if (command.startsWith("admin_gmliston"))
{
AdminData.getInstance().showGm(activeChar);
activeChar.sendMessage("Registered into gm list");
BuilderUtil.sendSysMessage(activeChar, "Registered into gm list");
AdminHtml.showAdminHtml(activeChar, "gm_menu.htm");
}
else if (command.startsWith("admin_gmlistoff"))
{
AdminData.getInstance().hideGm(activeChar);
activeChar.sendMessage("Removed from gm list");
BuilderUtil.sendSysMessage(activeChar, "Removed from gm list");
AdminHtml.showAdminHtml(activeChar, "gm_menu.htm");
}
else if (command.startsWith("admin_silence"))
@@ -103,7 +104,7 @@ public class AdminAdmin implements IAdminCommandHandler
else if (command.startsWith("admin_saveolymp"))
{
Olympiad.getInstance().saveOlympiadStatus();
activeChar.sendMessage("olympiad system saved.");
BuilderUtil.sendSysMessage(activeChar, "olympiad system saved.");
}
else if (command.startsWith("admin_endolympiad"))
{
@@ -115,7 +116,7 @@ public class AdminAdmin implements IAdminCommandHandler
{
LOGGER.warning("An error occured while ending olympiad: " + e);
}
activeChar.sendMessage("Heroes formed.");
BuilderUtil.sendSysMessage(activeChar, "Heroes formed.");
}
else if (command.startsWith("admin_sethero"))
{
@@ -140,13 +141,13 @@ public class AdminAdmin implements IAdminCommandHandler
final L2PcInstance target = activeChar.getTarget().isPlayer() ? activeChar.getTarget().getActingPlayer() : activeChar;
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;
}
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;
}
Hero.getInstance().claimHero(target);
@@ -160,12 +161,12 @@ public class AdminAdmin implements IAdminCommandHandler
if (st.nextToken().equalsIgnoreCase("on"))
{
activeChar.setDietMode(true);
activeChar.sendMessage("Diet mode on");
BuilderUtil.sendSysMessage(activeChar, "Diet mode on");
}
else if (st.nextToken().equalsIgnoreCase("off"))
{
activeChar.setDietMode(false);
activeChar.sendMessage("Diet mode off");
BuilderUtil.sendSysMessage(activeChar, "Diet mode off");
}
}
catch (Exception ex)
@@ -173,12 +174,12 @@ public class AdminAdmin implements IAdminCommandHandler
if (activeChar.getDietMode())
{
activeChar.setDietMode(false);
activeChar.sendMessage("Diet mode off");
BuilderUtil.sendSysMessage(activeChar, "Diet mode off");
}
else
{
activeChar.setDietMode(true);
activeChar.sendMessage("Diet mode on");
BuilderUtil.sendSysMessage(activeChar, "Diet mode on");
}
}
finally
@@ -195,12 +196,12 @@ public class AdminAdmin implements IAdminCommandHandler
if (mode.equalsIgnoreCase("on"))
{
activeChar.setTradeRefusal(true);
activeChar.sendMessage("Trade refusal enabled");
BuilderUtil.sendSysMessage(activeChar, "Trade refusal enabled");
}
else if (mode.equalsIgnoreCase("off"))
{
activeChar.setTradeRefusal(false);
activeChar.sendMessage("Trade refusal disabled");
BuilderUtil.sendSysMessage(activeChar, "Trade refusal disabled");
}
}
catch (Exception ex)
@@ -208,12 +209,12 @@ public class AdminAdmin implements IAdminCommandHandler
if (activeChar.getTradeRefusal())
{
activeChar.setTradeRefusal(false);
activeChar.sendMessage("Trade refusal disabled");
BuilderUtil.sendSysMessage(activeChar, "Trade refusal disabled");
}
else
{
activeChar.setTradeRefusal(true);
activeChar.sendMessage("Trade refusal enabled");
BuilderUtil.sendSysMessage(activeChar, "Trade refusal enabled");
}
}
AdminHtml.showAdminHtml(activeChar, "gm_menu.htm");
@@ -228,7 +229,7 @@ public class AdminAdmin implements IAdminCommandHandler
final String pValue = st.nextToken();
if (Float.valueOf(pValue) == null)
{
activeChar.sendMessage("Invalid parameter!");
BuilderUtil.sendSysMessage(activeChar, "Invalid parameter!");
return false;
}
switch (pName)
@@ -269,11 +270,11 @@ public class AdminAdmin implements IAdminCommandHandler
break;
}
}
activeChar.sendMessage("Config parameter " + pName + " set to " + pValue);
BuilderUtil.sendSysMessage(activeChar, "Config parameter " + pName + " set to " + pValue);
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //setconfig <parameter> <value>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setconfig <parameter> <value>");
}
finally
{

View File

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

View File

@@ -35,6 +35,7 @@ import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.SkillCoolTime;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.GMAudit;
public class AdminBuffs implements IAdminCommandHandler
@@ -76,7 +77,7 @@ public class AdminBuffs implements IAdminCommandHandler
showBuffs(activeChar, player, page, command.endsWith("_ps"));
return true;
}
activeChar.sendMessage("The player " + playername + " is not online.");
BuilderUtil.sendSysMessage(activeChar, "The player " + playername + " is not online.");
return false;
}
else if ((activeChar.getTarget() != null) && activeChar.getTarget().isCharacter())
@@ -105,8 +106,8 @@ public class AdminBuffs implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Failed removing effect: " + e.getMessage());
activeChar.sendMessage("Usage: //stopbuff <objectId> <skillId>");
BuilderUtil.sendSysMessage(activeChar, "Failed removing effect: " + e.getMessage());
BuilderUtil.sendSysMessage(activeChar, "Usage: //stopbuff <objectId> <skillId>");
return false;
}
}
@@ -122,8 +123,8 @@ public class AdminBuffs implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Failed removing all effects: " + e.getMessage());
activeChar.sendMessage("Usage: //stopallbuffs <objectId>");
BuilderUtil.sendSysMessage(activeChar, "Failed removing all effects: " + e.getMessage());
BuilderUtil.sendSysMessage(activeChar, "Usage: //stopallbuffs <objectId>");
return false;
}
}
@@ -138,12 +139,12 @@ public class AdminBuffs implements IAdminCommandHandler
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;
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //areacancel <radius>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //areacancel <radius>");
return false;
}
}
@@ -183,7 +184,7 @@ public class AdminBuffs implements IAdminCommandHandler
{
creature.sendPacket(new SkillCoolTime(creature.getActingPlayer()));
}
activeChar.sendMessage("Skill reuse was removed from " + creature.getName() + ".");
BuilderUtil.sendSysMessage(activeChar, "Skill reuse was removed from " + creature.getName() + ".");
return true;
}
else if (command.startsWith("admin_switch_gm_buffs"))
@@ -193,10 +194,10 @@ public class AdminBuffs implements IAdminCommandHandler
final boolean toAuraSkills = activeChar.getKnownSkill(7041) != null;
switchSkills(activeChar, toAuraSkills);
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;
}
activeChar.sendMessage("There is nothing to switch.");
BuilderUtil.sendSysMessage(activeChar, "There is nothing to switch.");
return false;
}
return true;
@@ -366,7 +367,7 @@ public class AdminBuffs implements IAdminCommandHandler
if (target.isAffectedBySkill(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, 1, false);
@@ -391,7 +392,7 @@ public class AdminBuffs implements IAdminCommandHandler
if (target != null)
{
target.stopAllEffects();
activeChar.sendMessage("Removed all effects from " + target.getName() + " (" + objId + ")");
BuilderUtil.sendSysMessage(activeChar, "Removed all effects from " + target.getName() + " (" + objId + ")");
showBuffs(activeChar, target, 1, false);
if (Config.GMAUDIT)
{

View File

@@ -29,6 +29,7 @@ import com.l2jmobius.gameserver.model.entity.clanhall.ClanHallSiegeEngine;
import com.l2jmobius.gameserver.model.entity.clanhall.SiegableHall;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.SiegeInfo;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* @author BiggBoss
@@ -61,23 +62,23 @@ public final class AdminCHSiege implements IAdminCommandHandler
SiegableHall hall = null;
if (Config.ALT_DEV_NO_QUESTS)
{
activeChar.sendMessage("AltDevNoQuests = true; Clan Hall Sieges are disabled!");
BuilderUtil.sendSysMessage(activeChar, "AltDevNoQuests = true; Clan Hall Sieges are disabled!");
return false;
}
if (split.length < 2)
{
activeChar.sendMessage("You have to specify the hall id at least");
BuilderUtil.sendSysMessage(activeChar, "You have to specify the hall id at least");
return false;
}
hall = getHall(split[1], activeChar);
if (hall == null)
{
activeChar.sendMessage("Couldnt find he desired siegable hall (" + split[1] + ")");
BuilderUtil.sendSysMessage(activeChar, "Couldnt find he desired siegable hall (" + split[1] + ")");
return false;
}
if (hall.getSiege() == null)
{
activeChar.sendMessage("The given hall dont have any attached siege!");
BuilderUtil.sendSysMessage(activeChar, "The given hall dont have any attached siege!");
return false;
}
@@ -85,7 +86,7 @@ public final class AdminCHSiege implements IAdminCommandHandler
{
if (hall.isInSiege())
{
activeChar.sendMessage("The requested clan hall is alredy in siege!");
BuilderUtil.sendSysMessage(activeChar, "The requested clan hall is alredy in siege!");
}
else
{
@@ -103,7 +104,7 @@ public final class AdminCHSiege implements IAdminCommandHandler
{
if (!hall.isInSiege())
{
activeChar.sendMessage("The requested clan hall isnt in siege!");
BuilderUtil.sendSysMessage(activeChar, "The requested clan hall isnt in siege!");
}
else
{
@@ -114,18 +115,18 @@ public final class AdminCHSiege implements IAdminCommandHandler
{
if (!hall.isRegistering())
{
activeChar.sendMessage("Cannot change siege date while hall is in siege");
BuilderUtil.sendSysMessage(activeChar, "Cannot change siege date while hall is in siege");
}
else if (split.length < 3)
{
activeChar.sendMessage("The date format is incorrect. Try again.");
BuilderUtil.sendSysMessage(activeChar, "The date format is incorrect. Try again.");
}
else
{
final String[] rawDate = split[2].split(";");
if (rawDate.length < 2)
{
activeChar.sendMessage("You have to specify this format DD-MM-YYYY;HH:MM");
BuilderUtil.sendSysMessage(activeChar, "You have to specify this format DD-MM-YYYY;HH:MM");
}
else
{
@@ -133,7 +134,7 @@ public final class AdminCHSiege implements IAdminCommandHandler
final String[] hour = rawDate[1].split(":");
if ((day.length < 3) || (hour.length < 2))
{
activeChar.sendMessage("Incomplete day, hour or both!");
BuilderUtil.sendSysMessage(activeChar, "Incomplete day, hour or both!");
}
else
{
@@ -144,11 +145,11 @@ public final class AdminCHSiege implements IAdminCommandHandler
final int min = parseInt(hour[1]);
if (((month == 2) && (d > 28)) || (d > 31) || (d <= 0) || (month <= 0) || (month > 12) || (year < Calendar.getInstance().get(Calendar.YEAR)))
{
activeChar.sendMessage("Wrong day/month/year gave!");
BuilderUtil.sendSysMessage(activeChar, "Wrong day/month/year gave!");
}
else if ((h <= 0) || (h > 24) || (min < 0) || (min >= 60))
{
activeChar.sendMessage("Wrong hour/minutes gave!");
BuilderUtil.sendSysMessage(activeChar, "Wrong hour/minutes gave!");
}
else
{
@@ -169,7 +170,7 @@ public final class AdminCHSiege implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("The given time is in the past!");
BuilderUtil.sendSysMessage(activeChar, "The given time is in the past!");
}
}
}
@@ -181,7 +182,7 @@ public final class AdminCHSiege implements IAdminCommandHandler
{
if (hall.isInSiege())
{
activeChar.sendMessage("The clan hall is in siege, cannot add attackers now.");
BuilderUtil.sendSysMessage(activeChar, "The clan hall is in siege, cannot add attackers now.");
return false;
}
@@ -192,19 +193,19 @@ public final class AdminCHSiege implements IAdminCommandHandler
L2PcInstance target = null;
if (rawTarget == null)
{
activeChar.sendMessage("You must target a clan member of the attacker!");
BuilderUtil.sendSysMessage(activeChar, "You must target a clan member of the attacker!");
}
else if (!(rawTarget instanceof L2PcInstance))
{
activeChar.sendMessage("You must target a player with clan!");
BuilderUtil.sendSysMessage(activeChar, "You must target a player with clan!");
}
else if ((target = (L2PcInstance) rawTarget).getClan() == null)
{
activeChar.sendMessage("Your target does not have any clan!");
BuilderUtil.sendSysMessage(activeChar, "Your target does not have any clan!");
}
else if (hall.getSiege().checkIsAttacker(target.getClan()))
{
activeChar.sendMessage("Your target's clan is alredy participating!");
BuilderUtil.sendSysMessage(activeChar, "Your target's clan is alredy participating!");
}
else
{
@@ -216,11 +217,11 @@ public final class AdminCHSiege implements IAdminCommandHandler
final L2Clan rawClan = ClanTable.getInstance().getClanByName(split[2]);
if (rawClan == null)
{
activeChar.sendMessage("The given clan does not exist!");
BuilderUtil.sendSysMessage(activeChar, "The given clan does not exist!");
}
else if (hall.getSiege().checkIsAttacker(rawClan))
{
activeChar.sendMessage("The given clan is alredy participating!");
BuilderUtil.sendSysMessage(activeChar, "The given clan is alredy participating!");
}
else
{
@@ -237,7 +238,7 @@ public final class AdminCHSiege implements IAdminCommandHandler
{
if (hall.isInSiege())
{
activeChar.sendMessage("The clan hall is in siege, cannot remove attackers now.");
BuilderUtil.sendSysMessage(activeChar, "The clan hall is in siege, cannot remove attackers now.");
return false;
}
@@ -247,19 +248,19 @@ public final class AdminCHSiege implements IAdminCommandHandler
L2PcInstance target = null;
if (rawTarget == null)
{
activeChar.sendMessage("You must target a clan member of the attacker!");
BuilderUtil.sendSysMessage(activeChar, "You must target a clan member of the attacker!");
}
else if (!(rawTarget instanceof L2PcInstance))
{
activeChar.sendMessage("You must target a player with clan!");
BuilderUtil.sendSysMessage(activeChar, "You must target a player with clan!");
}
else if ((target = (L2PcInstance) rawTarget).getClan() == null)
{
activeChar.sendMessage("Your target does not have any clan!");
BuilderUtil.sendSysMessage(activeChar, "Your target does not have any clan!");
}
else if (!hall.getSiege().checkIsAttacker(target.getClan()))
{
activeChar.sendMessage("Your target's clan is not participating!");
BuilderUtil.sendSysMessage(activeChar, "Your target's clan is not participating!");
}
else
{
@@ -271,11 +272,11 @@ public final class AdminCHSiege implements IAdminCommandHandler
final L2Clan rawClan = ClanTable.getInstance().getClanByName(split[2]);
if (rawClan == null)
{
activeChar.sendMessage("The given clan does not exist!");
BuilderUtil.sendSysMessage(activeChar, "The given clan does not exist!");
}
else if (!hall.getSiege().checkIsAttacker(rawClan))
{
activeChar.sendMessage("The given clan is not participating!");
BuilderUtil.sendSysMessage(activeChar, "The given clan is not participating!");
}
else
{
@@ -287,7 +288,7 @@ public final class AdminCHSiege implements IAdminCommandHandler
{
if (hall.isInSiege())
{
activeChar.sendMessage("The requested hall is in siege right now, cannot clear attacker list!");
BuilderUtil.sendSysMessage(activeChar, "The requested hall is in siege right now, cannot clear attacker list!");
}
else
{

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.events.AbstractScript;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* Camera commands.
@@ -52,7 +53,7 @@ public class AdminCamera implements IAdminCommandHandler
{
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;
}
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)
{
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;
}
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)
{
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;
}
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

@@ -28,6 +28,7 @@ import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.Disconnection;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* Change access level command handler.
@@ -59,7 +60,7 @@ public final class AdminChangeAccessLevel implements IAdminCommandHandler
}
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)
@@ -83,16 +84,16 @@ public final class AdminChangeAccessLevel implements IAdminCommandHandler
statement.close();
if (count == 0)
{
activeChar.sendMessage("Character not found or access level unaltered.");
BuilderUtil.sendSysMessage(activeChar, "Character not found or access level unaltered.");
}
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)
{
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
{
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

View File

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

View File

@@ -23,6 +23,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.items.L2Item;
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.
@@ -69,11 +70,11 @@ public class AdminCreateItem implements IAdminCommandHandler
}
catch (StringIndexOutOfBoundsException e)
{
activeChar.sendMessage("Usage: //create_item <itemId> [amount]");
BuilderUtil.sendSysMessage(activeChar, "Usage: //create_item <itemId> [amount]");
}
catch (NumberFormatException nfe)
{
activeChar.sendMessage("Specify a valid number.");
BuilderUtil.sendSysMessage(activeChar, "Specify a valid number.");
}
AdminHtml.showAdminHtml(activeChar, "itemcreation.htm");
}
@@ -103,11 +104,11 @@ public class AdminCreateItem implements IAdminCommandHandler
}
catch (StringIndexOutOfBoundsException e)
{
activeChar.sendMessage("Usage: //create_coin <name> [amount]");
BuilderUtil.sendSysMessage(activeChar, "Usage: //create_coin <name> [amount]");
}
catch (NumberFormatException nfe)
{
activeChar.sendMessage("Specify a valid number.");
BuilderUtil.sendSysMessage(activeChar, "Specify a valid number.");
}
AdminHtml.showAdminHtml(activeChar, "itemcreation.htm");
}
@@ -122,7 +123,7 @@ public class AdminCreateItem implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Invalid target.");
BuilderUtil.sendSysMessage(activeChar, "Invalid target.");
return false;
}
@@ -145,11 +146,11 @@ public class AdminCreateItem implements IAdminCommandHandler
}
catch (StringIndexOutOfBoundsException e)
{
activeChar.sendMessage("Usage: //give_item_target <itemId> [amount]");
BuilderUtil.sendSysMessage(activeChar, "Usage: //give_item_target <itemId> [amount]");
}
catch (NumberFormatException nfe)
{
activeChar.sendMessage("Specify a valid number.");
BuilderUtil.sendSysMessage(activeChar, "Specify a valid number.");
}
AdminHtml.showAdminHtml(activeChar, "itemcreation.htm");
}
@@ -176,12 +177,12 @@ public class AdminCreateItem implements IAdminCommandHandler
final L2Item template = ItemTable.getInstance().getTemplate(idval);
if (template == null)
{
activeChar.sendMessage("This item doesn't exist.");
BuilderUtil.sendSysMessage(activeChar, "This item doesn't exist.");
return false;
}
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;
}
for (L2PcInstance onlinePlayer : L2World.getInstance().getPlayers())
@@ -209,12 +210,12 @@ public class AdminCreateItem implements IAdminCommandHandler
final L2Item template = ItemTable.getInstance().getTemplate(id);
if (template == null)
{
activeChar.sendMessage("This item doesn't exist.");
BuilderUtil.sendSysMessage(activeChar, "This item doesn't exist.");
return;
}
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;
}
@@ -224,7 +225,7 @@ public class AdminCreateItem implements IAdminCommandHandler
{
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.");
}
private int getCoinId(String name)

View File

@@ -26,6 +26,7 @@ import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
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 =
@@ -60,27 +61,27 @@ public class AdminCursedWeapons implements IAdminCommandHandler
{
if (!command.contains("menu"))
{
activeChar.sendMessage("====== Cursed Weapons: ======");
BuilderUtil.sendSysMessage(activeChar, "====== Cursed Weapons: ======");
for (CursedWeapon cw : cwm.getCursedWeapons())
{
activeChar.sendMessage("> " + cw.getName() + " (" + cw.getItemId() + ")");
BuilderUtil.sendSysMessage(activeChar, "> " + cw.getName() + " (" + cw.getItemId() + ")");
if (cw.isActivated())
{
final L2PcInstance pl = cw.getPlayer();
activeChar.sendMessage(" Player holding: " + (pl == null ? "null" : pl.getName()));
activeChar.sendMessage(" Player karma: " + cw.getPlayerKarma());
activeChar.sendMessage(" Time Remaining: " + (cw.getTimeLeft() / 60000) + " min.");
activeChar.sendMessage(" Kills : " + cw.getNbKills());
BuilderUtil.sendSysMessage(activeChar, " Player holding: " + (pl == null ? "null" : pl.getName()));
BuilderUtil.sendSysMessage(activeChar, " Player karma: " + cw.getPlayerKarma());
BuilderUtil.sendSysMessage(activeChar, " Time Remaining: " + (cw.getTimeLeft() / 60000) + " min.");
BuilderUtil.sendSysMessage(activeChar, " Kills : " + cw.getNbKills());
}
else if (cw.isDropped())
{
activeChar.sendMessage(" Lying on the ground.");
activeChar.sendMessage(" Time Remaining: " + (cw.getTimeLeft() / 60000) + " min.");
activeChar.sendMessage(" Kills : " + cw.getNbKills());
BuilderUtil.sendSysMessage(activeChar, " Lying on the ground.");
BuilderUtil.sendSysMessage(activeChar, " Time Remaining: " + (cw.getTimeLeft() / 60000) + " min.");
BuilderUtil.sendSysMessage(activeChar, " Kills : " + cw.getNbKills());
}
else
{
activeChar.sendMessage(" Don't exist in the world.");
BuilderUtil.sendSysMessage(activeChar, " Don't exist in the world.");
}
activeChar.sendPacket(SystemMessageId.EMPTY_3);
}
@@ -178,12 +179,12 @@ public class AdminCursedWeapons implements IAdminCommandHandler
}
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)
{
activeChar.sendMessage("Unknown cursed weapon ID.");
BuilderUtil.sendSysMessage(activeChar, "Unknown cursed weapon ID.");
return false;
}
@@ -199,7 +200,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
{
if (cw.isActive())
{
activeChar.sendMessage("This cursed weapon is already active.");
BuilderUtil.sendSysMessage(activeChar, "This cursed weapon is already active.");
}
else
{
@@ -218,7 +219,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Unknown command.");
BuilderUtil.sendSysMessage(activeChar, "Unknown command.");
}
}
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.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* 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
{
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.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.Disconnection;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands: - character_disconnect = disconnects target player
@@ -63,11 +64,11 @@ public class AdminDisconnect implements IAdminCommandHandler
if (player == activeChar)
{
activeChar.sendMessage("You cannot logout your own character.");
BuilderUtil.sendSysMessage(activeChar, "You cannot logout your own character.");
}
else
{
activeChar.sendMessage("Character " + player.getName() + " disconnected from server.");
BuilderUtil.sendSysMessage(activeChar, "Character " + player.getName() + " disconnected from server.");
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.entity.Castle;
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
@@ -123,7 +124,7 @@ public class AdminDoorControl implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Incorrect target.");
BuilderUtil.sendSysMessage(activeChar, "Incorrect target.");
}
}
else if (command.equals("admin_close"))
@@ -135,7 +136,7 @@ public class AdminDoorControl implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Incorrect target.");
BuilderUtil.sendSysMessage(activeChar, "Incorrect target.");
}
}
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());
activeChar.sendPacket(packet);
// send message
activeChar.sendMessage("Found door " + door.getId());
BuilderUtil.sendSysMessage(activeChar, "Found door " + door.getId());
});
}
}

View File

@@ -55,6 +55,7 @@ import com.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
import com.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.HtmlUtil;
import com.l2jmobius.gameserver.util.Util;
@@ -142,7 +143,7 @@ public class AdminEditChar implements IAdminCommandHandler
catch (StringIndexOutOfBoundsException e)
{
// 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"))
@@ -154,7 +155,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (StringIndexOutOfBoundsException e)
{ // Case of empty character name
activeChar.sendMessage("Usage: //find_character <character_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //find_character <character_name>");
listCharacters(activeChar, 0);
}
}
@@ -167,7 +168,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (Exception e)
{ // 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);
}
}
@@ -180,7 +181,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (Exception e)
{ // 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);
}
}
@@ -219,7 +220,7 @@ public class AdminEditChar implements IAdminCommandHandler
{
LOGGER.warning("Set karma error: " + e);
}
activeChar.sendMessage("Usage: //setkarma <new_karma_value>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setkarma <new_karma_value>");
}
}
else if (command.startsWith("admin_setpk"))
@@ -250,7 +251,7 @@ public class AdminEditChar implements IAdminCommandHandler
{
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"))
@@ -281,7 +282,7 @@ public class AdminEditChar implements IAdminCommandHandler
{
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"))
@@ -312,7 +313,7 @@ public class AdminEditChar implements IAdminCommandHandler
{
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"))
@@ -340,7 +341,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //rec number");
BuilderUtil.sendSysMessage(activeChar, "Usage: //rec number");
}
}
else if (command.startsWith("admin_setclass"))
@@ -429,7 +430,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //setclass <valid_new_classid>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setclass <valid_new_classid>");
}
}
catch (StringIndexOutOfBoundsException e)
@@ -438,7 +439,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //setclass <valid_new_classid>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setclass <valid_new_classid>");
}
}
else if (command.startsWith("admin_settitle"))
@@ -462,7 +463,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (StringIndexOutOfBoundsException e)
{ // 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"))
@@ -482,13 +483,13 @@ public class AdminEditChar implements IAdminCommandHandler
}
if (CharNameTable.getInstance().getIdByName(val) > 0)
{
activeChar.sendMessage("Warning, player " + val + " already exists");
BuilderUtil.sendSysMessage(activeChar, "Warning, player " + val + " already exists");
return false;
}
player.setName(val);
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.broadcastUserInfo();
@@ -512,7 +513,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (StringIndexOutOfBoundsException e)
{ // 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"))
@@ -556,7 +557,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (Exception e)
{ // 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"))
@@ -580,7 +581,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (Exception e)
{ // 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"))
@@ -604,7 +605,7 @@ public class AdminEditChar implements IAdminCommandHandler
final StringTokenizer st = new StringTokenizer(command, " ");
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;
}
@@ -637,7 +638,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
}
activeChar.sendMessage("Clan penalty successfully removed to character: " + playerName);
BuilderUtil.sendSysMessage(activeChar, "Clan penalty successfully removed to character: " + playerName);
}
catch (Exception e)
{
@@ -653,7 +654,7 @@ public class AdminEditChar implements IAdminCommandHandler
multibox = Integer.parseInt(val);
if (multibox < 1)
{
activeChar.sendMessage("Usage: //find_dualbox [number > 0]");
BuilderUtil.sendSysMessage(activeChar, "Usage: //find_dualbox [number > 0]");
return false;
}
}
@@ -671,7 +672,7 @@ public class AdminEditChar implements IAdminCommandHandler
multibox = Integer.parseInt(val);
if (multibox < 1)
{
activeChar.sendMessage("Usage: //strict_find_dualbox [number > 0]");
BuilderUtil.sendSysMessage(activeChar, "Usage: //strict_find_dualbox [number > 0]");
return false;
}
}
@@ -706,13 +707,13 @@ public class AdminEditChar implements IAdminCommandHandler
final L2GameClient client = pl.getClient();
if (client == null)
{
activeChar.sendMessage("Client is null.");
BuilderUtil.sendSysMessage(activeChar, "Client is null.");
return false;
}
if (client.isDetached())
{
activeChar.sendMessage("Client is detached.");
BuilderUtil.sendSysMessage(activeChar, "Client is detached.");
return false;
}
@@ -729,7 +730,7 @@ public class AdminEditChar implements IAdminCommandHandler
ip = ip + ".";
}
}
activeChar.sendMessage("Hop" + i + ": " + ip);
BuilderUtil.sendSysMessage(activeChar, "Hop" + i + ": " + ip);
}
}
else if (command.startsWith("admin_summon_info"))
@@ -741,7 +742,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Invalid target.");
BuilderUtil.sendSysMessage(activeChar, "Invalid target.");
}
}
else if (command.startsWith("admin_unsummon"))
@@ -753,7 +754,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usable only with Pets/Summons");
BuilderUtil.sendSysMessage(activeChar, "Usable only with Pets/Summons");
}
}
else if (command.startsWith("admin_summon_setlvl"))
@@ -784,7 +785,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usable only with Pets");
BuilderUtil.sendSysMessage(activeChar, "Usable only with Pets");
}
}
else if (command.startsWith("admin_show_pet_inv"))
@@ -807,7 +808,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usable only with Pets");
BuilderUtil.sendSysMessage(activeChar, "Usable only with Pets");
}
}
@@ -836,7 +837,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Not in party.");
BuilderUtil.sendSysMessage(activeChar, "Not in party.");
}
}
else
@@ -862,7 +863,7 @@ public class AdminEditChar implements IAdminCommandHandler
player.setNoble(!player.isNoble());
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.sendMessage("GM changed your nobless status!");
}
@@ -882,7 +883,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //set_hp 1000");
BuilderUtil.sendSysMessage(activeChar, "Usage: //set_hp 1000");
}
}
else if (command.startsWith("admin_set_mp"))
@@ -900,7 +901,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //set_mp 1000");
BuilderUtil.sendSysMessage(activeChar, "Usage: //set_mp 1000");
}
}
else if (command.startsWith("admin_set_cp"))
@@ -918,7 +919,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //set_cp 1000");
BuilderUtil.sendSysMessage(activeChar, "Usage: //set_cp 1000");
}
}
else if (command.startsWith("admin_set_pvp_flag"))
@@ -936,7 +937,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //set_pvp_flag");
BuilderUtil.sendSysMessage(activeChar, "Usage: //set_pvp_flag");
}
}
return true;
@@ -1016,18 +1017,18 @@ public class AdminEditChar implements IAdminCommandHandler
if (player == null)
{
activeChar.sendMessage("Player is null.");
BuilderUtil.sendSysMessage(activeChar, "Player is null.");
return;
}
final L2GameClient client = player.getClient();
if (client == null)
{
activeChar.sendMessage("Client is null.");
BuilderUtil.sendSysMessage(activeChar, "Client is null.");
}
else if (client.isDetached())
{
activeChar.sendMessage("Client is detached.");
BuilderUtil.sendSysMessage(activeChar, "Client is detached.");
}
else
{
@@ -1111,12 +1112,12 @@ public class AdminEditChar implements IAdminCommandHandler
sm.addInt(newKarma);
player.sendPacket(sm);
// Admin information
activeChar.sendMessage("Successfully Changed karma for " + player.getName() + " from (" + oldKarma + ") to (" + newKarma + ").");
BuilderUtil.sendSysMessage(activeChar, "Successfully Changed karma for " + player.getName() + " from (" + oldKarma + ") to (" + newKarma + ").");
}
else
{
// tell admin of mistake
activeChar.sendMessage("You must enter a value for karma greater than or equal to 0.");
BuilderUtil.sendSysMessage(activeChar, "You must enter a value for karma greater than or equal to 0.");
}
}

View File

@@ -171,7 +171,7 @@ public class AdminEffects implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //earthquake <intensity> <duration>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //earthquake <intensity> <duration>");
}
}
else if (command.startsWith("admin_atmosphere"))
@@ -185,7 +185,7 @@ public class AdminEffects implements IAdminCommandHandler
}
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"))
@@ -200,7 +200,7 @@ public class AdminEffects implements IAdminCommandHandler
}
catch (StringIndexOutOfBoundsException e)
{
activeChar.sendMessage("Usage: //play_sounds <pagenumber>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //play_sounds <pagenumber>");
}
}
else if (command.startsWith("admin_play_sound"))
@@ -211,7 +211,7 @@ public class AdminEffects implements IAdminCommandHandler
}
catch (StringIndexOutOfBoundsException e)
{
activeChar.sendMessage("Usage: //play_sound <soundname>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //play_sound <soundname>");
}
}
else if (command.equals("admin_para_all"))
@@ -343,7 +343,7 @@ public class AdminEffects implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //polyself <npcId>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //polyself <npcId>");
}
}
else if (command.startsWith("admin_unpolyself"))
@@ -377,7 +377,7 @@ public class AdminEffects implements IAdminCommandHandler
}
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"))
@@ -398,7 +398,7 @@ public class AdminEffects implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //setteam <none|blue|red>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setteam <none|blue|red>");
}
}
else if (command.startsWith("admin_social"))
@@ -431,7 +431,7 @@ public class AdminEffects implements IAdminCommandHandler
}
catch (NumberFormatException nbe)
{
activeChar.sendMessage("Incorrect parameter");
BuilderUtil.sendSysMessage(activeChar, "Incorrect parameter");
}
}
}
@@ -455,7 +455,7 @@ public class AdminEffects implements IAdminCommandHandler
}
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)
@@ -493,7 +493,7 @@ public class AdminEffects implements IAdminCommandHandler
if (radius > 0)
{
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
{
@@ -510,7 +510,7 @@ public class AdminEffects implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //" + command.replace("admin_", "") + " <AbnormalVisualEffect> [radius]");
BuilderUtil.sendSysMessage(activeChar, "Usage: //" + command.replace("admin_", "") + " <AbnormalVisualEffect> [radius]");
}
}
else if (command.startsWith("admin_effect"))
@@ -546,7 +546,7 @@ public class AdminEffects implements IAdminCommandHandler
}
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"))
@@ -566,7 +566,7 @@ public class AdminEffects implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //set_displayeffect <id>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //set_displayeffect <id>");
}
}
@@ -680,7 +680,7 @@ public class AdminEffects implements IAdminCommandHandler
}
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)
{
@@ -693,7 +693,7 @@ public class AdminEffects implements IAdminCommandHandler
final PlaySound _snd = new PlaySound(1, sound, 0, 0, 0, 0, 0);
activeChar.sendPacket(_snd);
activeChar.broadcastPacket(_snd);
activeChar.sendMessage("Playing " + sound + ".");
BuilderUtil.sendSysMessage(activeChar, "Playing " + sound + ".");
}
@Override

View File

@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands: - delete = deletes target
@@ -86,7 +87,7 @@ public class AdminElement implements IAdminCommandHandler
final int value = Integer.parseInt(args[2]);
if ((element < -1) || (element > 5) || (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;
}
@@ -94,7 +95,7 @@ public class AdminElement implements IAdminCommandHandler
}
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;
}
}
@@ -176,7 +177,7 @@ public class AdminElement implements IAdminCommandHandler
player.sendPacket(iu);
// 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)
{
player.sendMessage(activeChar.getName() + " has changed the elemental power of your " + itemInstance.getItem().getName() + " from " + old + " to " + current + ".");

View File

@@ -26,6 +26,7 @@ import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands: - enchant_armor
@@ -136,7 +137,7 @@ public class AdminEnchant implements IAdminCommandHandler
// check value
if ((ench < 0) || (ench > 65535))
{
activeChar.sendMessage("You must set the enchant level to be between 0-65535.");
BuilderUtil.sendSysMessage(activeChar, "You must set the enchant level to be between 0-65535.");
}
else
{
@@ -149,7 +150,7 @@ public class AdminEnchant implements IAdminCommandHandler
{
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)
{
@@ -157,7 +158,7 @@ public class AdminEnchant implements IAdminCommandHandler
{
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.");
}
}
@@ -214,7 +215,7 @@ public class AdminEnchant implements IAdminCommandHandler
player.broadcastUserInfo();
// 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 + ".");
}
}

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

View File

@@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands:
@@ -52,12 +53,12 @@ public class AdminExpSp implements IAdminCommandHandler
final String val = command.substring(16);
if (!adminAddExpSp(activeChar, val))
{
activeChar.sendMessage("Usage: //add_exp_sp exp sp");
BuilderUtil.sendSysMessage(activeChar, "Usage: //add_exp_sp exp sp");
}
}
catch (StringIndexOutOfBoundsException e)
{ // 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"))
@@ -67,12 +68,12 @@ public class AdminExpSp implements IAdminCommandHandler
final String val = command.substring(19);
if (!adminRemoveExpSP(activeChar, val))
{
activeChar.sendMessage("Usage: //remove_exp_sp exp sp");
BuilderUtil.sendSysMessage(activeChar, "Usage: //remove_exp_sp exp sp");
}
}
catch (StringIndexOutOfBoundsException e)
{ // Case of missing parameter
activeChar.sendMessage("Usage: //remove_exp_sp exp sp");
BuilderUtil.sendSysMessage(activeChar, "Usage: //remove_exp_sp exp sp");
}
}
addExpSp(activeChar);
@@ -146,7 +147,7 @@ public class AdminExpSp implements IAdminCommandHandler
player.sendMessage("Admin is adding you " + expval + " xp and " + spval + " sp.");
player.addExpAndSp(expval, spval);
// 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;
}
@@ -189,7 +190,7 @@ public class AdminExpSp implements IAdminCommandHandler
player.sendMessage("Admin is removing you " + expval + " xp and " + spval + " sp.");
player.removeExpAndSp(expval, spval);
// 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;
}

View File

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

View File

@@ -21,6 +21,7 @@ import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* Admin game point commands.
@@ -47,12 +48,12 @@ public class AdminGamePoints implements IAdminCommandHandler
String val = command.substring(22);
if (!addGamePoints(activeChar, val))
{
activeChar.sendMessage("Usage: //add_game_points count");
BuilderUtil.sendSysMessage(activeChar, "Usage: //add_game_points count");
}
}
catch (StringIndexOutOfBoundsException e)
{ // Case of missing parameter
activeChar.sendMessage("Usage: //add_game_points count");
BuilderUtil.sendSysMessage(activeChar, "Usage: //add_game_points count");
}
}
else if (command.equals("admin_count_game_points"))
@@ -64,7 +65,7 @@ public class AdminGamePoints implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("You must select a player first.");
BuilderUtil.sendSysMessage(activeChar, "You must select a player first.");
}
}
else if (command.equals("admin_gamepoints"))
@@ -78,12 +79,12 @@ public class AdminGamePoints implements IAdminCommandHandler
String val = command.substring(22);
if (!setGamePoints(activeChar, val))
{
activeChar.sendMessage("Usage: //set_game_points count");
BuilderUtil.sendSysMessage(activeChar, "Usage: //set_game_points count");
}
}
catch (StringIndexOutOfBoundsException e)
{ // Case of missing parameter
activeChar.sendMessage("Usage: //set_game_points count");
BuilderUtil.sendSysMessage(activeChar, "Usage: //set_game_points count");
}
}
else if (command.startsWith("admin_subtract_game_points"))
@@ -93,12 +94,12 @@ public class AdminGamePoints implements IAdminCommandHandler
String val = command.substring(27);
if (!subtractGamePoints(activeChar, val))
{
activeChar.sendMessage("Usage: //subtract_game_points count");
BuilderUtil.sendSysMessage(activeChar, "Usage: //subtract_game_points count");
}
}
catch (StringIndexOutOfBoundsException e)
{ // Case of missing parameter
activeChar.sendMessage("Usage: //subtract_game_points count");
BuilderUtil.sendSysMessage(activeChar, "Usage: //subtract_game_points count");
}
}
return true;

View File

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

View File

@@ -21,6 +21,7 @@ import java.util.logging.Logger;
import com.l2jmobius.gameserver.data.xml.impl.AdminData;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
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
@@ -41,7 +42,7 @@ public class AdminGm implements IAdminCommandHandler
{
AdminData.getInstance().deleteGm(activeChar);
activeChar.setAccessLevel(0);
activeChar.sendMessage("You no longer have GM status.");
BuilderUtil.sendSysMessage(activeChar, "You no longer have GM status.");
LOGGER.info("GM: " + activeChar.getName() + "(" + activeChar.getObjectId() + ") turned his GM status off");
}
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.zone.type.L2NoRestartZone;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import ai.bosses.Antharas.Antharas;
import ai.bosses.Baium.Baium;
@@ -93,12 +94,12 @@ public class AdminGrandBoss implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Wrong ID!");
BuilderUtil.sendSysMessage(activeChar, "Wrong ID!");
}
}
else
{
activeChar.sendMessage("Usage: //grandboss_skip Id");
BuilderUtil.sendSysMessage(activeChar, "Usage: //grandboss_skip Id");
}
break;
}
@@ -124,13 +125,13 @@ public class AdminGrandBoss implements IAdminCommandHandler
}
default:
{
activeChar.sendMessage("Wrong ID!");
BuilderUtil.sendSysMessage(activeChar, "Wrong ID!");
}
}
}
else
{
activeChar.sendMessage("Usage: //grandboss_respawn Id");
BuilderUtil.sendSysMessage(activeChar, "Usage: //grandboss_respawn Id");
}
break;
}
@@ -154,13 +155,13 @@ public class AdminGrandBoss implements IAdminCommandHandler
}
default:
{
activeChar.sendMessage("Wrong ID!");
BuilderUtil.sendSysMessage(activeChar, "Wrong ID!");
}
}
}
else
{
activeChar.sendMessage("Usage: //grandboss_minions Id");
BuilderUtil.sendSysMessage(activeChar, "Usage: //grandboss_minions Id");
}
break;
}
@@ -186,13 +187,13 @@ public class AdminGrandBoss implements IAdminCommandHandler
}
default:
{
activeChar.sendMessage("Wrong ID!");
BuilderUtil.sendSysMessage(activeChar, "Wrong ID!");
}
}
}
else
{
activeChar.sendMessage("Usage: //grandboss_abort Id");
BuilderUtil.sendSysMessage(activeChar, "Usage: //grandboss_abort Id");
}
}
break;
@@ -311,7 +312,7 @@ public class AdminGrandBoss implements IAdminCommandHandler
}
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.instance.L2PcInstance;
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
@@ -58,7 +59,7 @@ public class AdminHeal implements IAdminCommandHandler
{
LOGGER.warning("Heal error: " + e);
}
activeChar.sendMessage("Incorrect target/radius specified.");
BuilderUtil.sendSysMessage(activeChar, "Incorrect target/radius specified.");
}
}
return true;
@@ -101,7 +102,7 @@ public class AdminHeal implements IAdminCommandHandler
}
});
activeChar.sendMessage("Healed within " + radius + " unit radius.");
BuilderUtil.sendSysMessage(activeChar, "Healed within " + radius + " unit radius.");
return;
}
catch (NumberFormatException nbe)

View File

@@ -21,6 +21,7 @@ import java.util.StringTokenizer;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import ai.areas.Hellbound.HellboundEngine;
@@ -63,12 +64,12 @@ public class AdminHellbound implements IAdminCommandHandler
}
HellboundEngine.getInstance().setLevel(level);
activeChar.sendMessage("Hellbound level set to " + level);
BuilderUtil.sendSysMessage(activeChar, "Hellbound level set to " + level);
return true;
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //hellbound_setlevel 0-11");
BuilderUtil.sendSysMessage(activeChar, "Usage: //hellbound_setlevel 0-11");
return false;
}
}

View File

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

View File

@@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.actor.L2Summon;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.instancezone.Instance;
import com.l2jmobius.gameserver.model.instancezone.InstanceWorld;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util;
/**
@@ -54,7 +55,7 @@ public class AdminInstance implements IAdminCommandHandler
final String[] parts = command.split(" ");
if ((parts.length != 3) || !Util.isDigit(parts[2]))
{
activeChar.sendMessage("Example: //createinstance <id> <templateId> - ids => 300000 are reserved for dynamic instances");
BuilderUtil.sendSysMessage(activeChar, "Example: //createinstance <id> <templateId> - ids => 300000 are reserved for dynamic instances");
}
else
{
@@ -63,17 +64,17 @@ public class AdminInstance implements IAdminCommandHandler
final int id = Integer.parseInt(parts[1]);
if ((id < 300000) && InstanceManager.getInstance().createInstanceFromTemplate(id, Integer.parseInt(parts[2])))
{
activeChar.sendMessage("Instance created.");
BuilderUtil.sendSysMessage(activeChar, "Instance created.");
}
else
{
activeChar.sendMessage("Failed to create instance.");
BuilderUtil.sendSysMessage(activeChar, "Failed to create instance.");
}
return true;
}
catch (Exception e)
{
activeChar.sendMessage("Failed loading: " + parts[1] + " " + parts[2]);
BuilderUtil.sendSysMessage(activeChar, "Failed loading: " + parts[1] + " " + parts[2]);
return false;
}
}
@@ -87,12 +88,12 @@ public class AdminInstance implements IAdminCommandHandler
if (world != null)
{
counter++;
activeChar.sendMessage("Id: " + instance.getId() + " Name: " + InstanceManager.getInstance().getInstanceIdName(world.getTemplateId()));
BuilderUtil.sendSysMessage(activeChar, "Id: " + instance.getId() + " Name: " + InstanceManager.getInstance().getInstanceIdName(world.getTemplateId()));
}
}
if (counter == 0)
{
activeChar.sendMessage("No active instances.");
BuilderUtil.sendSysMessage(activeChar, "No active instances.");
}
}
else if (command.startsWith("admin_setinstance"))
@@ -102,14 +103,14 @@ public class AdminInstance implements IAdminCommandHandler
final int val = Integer.parseInt(st.nextToken());
if (InstanceManager.getInstance().getInstance(val) == null)
{
activeChar.sendMessage("Instance " + val + " doesnt exist.");
BuilderUtil.sendSysMessage(activeChar, "Instance " + val + " doesnt exist.");
return false;
}
final L2Object target = activeChar.getTarget();
if ((target == null) || (target instanceof L2Summon)) // Don't separate summons from masters
{
activeChar.sendMessage("Incorrect target.");
BuilderUtil.sendSysMessage(activeChar, "Incorrect target.");
return false;
}
target.setInstanceId(val);
@@ -119,12 +120,12 @@ public class AdminInstance implements IAdminCommandHandler
player.sendMessage("Admin set your instance to:" + val);
player.teleToLocation(player.getLocation());
}
activeChar.sendMessage("Moved " + target.getName() + " to instance " + target.getInstanceId() + ".");
BuilderUtil.sendSysMessage(activeChar, "Moved " + target.getName() + " to instance " + target.getInstanceId() + ".");
return true;
}
catch (Exception e)
{
activeChar.sendMessage("Use //setinstance id");
BuilderUtil.sendSysMessage(activeChar, "Use //setinstance id");
}
}
else if (command.startsWith("admin_destroyinstance"))
@@ -133,11 +134,11 @@ public class AdminInstance implements IAdminCommandHandler
{
final int val = Integer.parseInt(st.nextToken());
InstanceManager.getInstance().destroyInstance(val);
activeChar.sendMessage("Instance destroyed");
BuilderUtil.sendSysMessage(activeChar, "Instance destroyed");
}
catch (Exception e)
{
activeChar.sendMessage("Use //destroyinstance id");
BuilderUtil.sendSysMessage(activeChar, "Use //destroyinstance id");
}
}
@@ -149,7 +150,7 @@ public class AdminInstance implements IAdminCommandHandler
else if (command.startsWith("admin_ghoston"))
{
activeChar.getAppearance().setGhostMode(true);
activeChar.sendMessage("Ghost mode enabled");
BuilderUtil.sendSysMessage(activeChar, "Ghost mode enabled");
activeChar.broadcastUserInfo();
activeChar.decayMe();
activeChar.spawnMe();
@@ -158,7 +159,7 @@ public class AdminInstance implements IAdminCommandHandler
else if (command.startsWith("admin_ghostoff"))
{
activeChar.getAppearance().setGhostMode(false);
activeChar.sendMessage("Ghost mode disabled");
BuilderUtil.sendSysMessage(activeChar, "Ghost mode disabled");
activeChar.broadcastUserInfo();
activeChar.decayMe();
activeChar.spawnMe();

View File

@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.GMAudit;
public class AdminInstanceZone implements IAdminCommandHandler
@@ -51,15 +52,15 @@ public class AdminInstanceZone implements IAdminCommandHandler
final int instanceId = Integer.parseInt(st.nextToken());
final String name = InstanceManager.getInstance().getInstanceIdName(instanceId);
InstanceManager.getInstance().deleteInstanceTime(player.getObjectId(), 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");
return true;
}
catch (Exception e)
{
activeChar.sendMessage("Failed clearing instance time: " + e.getMessage());
activeChar.sendMessage("Usage: //instancezone_clear <playername> [instanceId]");
BuilderUtil.sendSysMessage(activeChar, "Failed clearing instance time: " + e.getMessage());
BuilderUtil.sendSysMessage(activeChar, "Usage: //instancezone_clear <playername> [instanceId]");
return false;
}
}
@@ -87,8 +88,8 @@ public class AdminInstanceZone implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("The player " + playername + " is not online");
activeChar.sendMessage("Usage: //instancezone [playername]");
BuilderUtil.sendSysMessage(activeChar, "The player " + playername + " is not online");
BuilderUtil.sendSysMessage(activeChar, "Usage: //instancezone [playername]");
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.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.Disconnection;
import com.l2jmobius.gameserver.util.BuilderUtil;
public class AdminKick implements IAdminCommandHandler
{
@@ -45,7 +46,7 @@ public class AdminKick implements IAdminCommandHandler
if (plyr != null)
{
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);
}
}
activeChar.sendMessage("Kicked " + counter + " players.");
BuilderUtil.sendSysMessage(activeChar, "Kicked " + counter + " players.");
}
return true;
}

View File

@@ -26,6 +26,7 @@ import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2ControllableMobInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
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
@@ -69,12 +70,12 @@ public class AdminKill implements IAdminCommandHandler
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;
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Invalid radius.");
BuilderUtil.sendSysMessage(activeChar, "Invalid radius.");
return false;
}
}
@@ -95,12 +96,12 @@ public class AdminKill implements IAdminCommandHandler
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;
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //kill <player_name | radius>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //kill <player_name | radius>");
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.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
public class AdminLevel implements IAdminCommandHandler
{
@@ -57,7 +58,7 @@ public class AdminLevel implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Wrong Number Format");
BuilderUtil.sendSysMessage(activeChar, "Wrong Number Format");
}
}
else if (actualCommand.equalsIgnoreCase("admin_set_level"))
@@ -88,13 +89,13 @@ public class AdminLevel implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("You must specify level between 1 and " + ExperienceData.getInstance().getMaxLevel() + ".");
BuilderUtil.sendSysMessage(activeChar, "You must specify level between 1 and " + ExperienceData.getInstance().getMaxLevel() + ".");
return false;
}
}
catch (NumberFormatException e)
{
activeChar.sendMessage("You must specify level between 1 and " + ExperienceData.getInstance().getMaxLevel() + ".");
BuilderUtil.sendSysMessage(activeChar, "You must specify level between 1 and " + ExperienceData.getInstance().getMaxLevel() + ".");
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.network.loginserverpackets.game.ServerStatus;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* 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"))
{
gmOnly();
activeChar.sendMessage("Server is now GM only");
BuilderUtil.sendSysMessage(activeChar, "Server is now GM only");
showMainPage(activeChar);
}
else if (command.equals("admin_server_all"))
{
allowToAll();
activeChar.sendMessage("Server is not GM only anymore");
BuilderUtil.sendSysMessage(activeChar, "Server is not GM only anymore");
showMainPage(activeChar);
}
else if (command.startsWith("admin_server_max_player"))
@@ -66,17 +67,17 @@ public class AdminLogin implements IAdminCommandHandler
try
{
LoginServerThread.getInstance().setMaxPlayer(Integer.parseInt(number));
activeChar.sendMessage("maxPlayer set to " + number);
BuilderUtil.sendSysMessage(activeChar, "maxPlayer set to " + number);
showMainPage(activeChar);
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Max players must be a number.");
BuilderUtil.sendSysMessage(activeChar, "Max players must be a number.");
}
}
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"))
@@ -105,18 +106,18 @@ public class AdminLogin implements IAdminCommandHandler
{
Config.SERVER_LIST_TYPE = newType;
LoginServerThread.getInstance().sendServerType();
activeChar.sendMessage("Server Type changed to " + getServerTypeName(newType));
BuilderUtil.sendSysMessage(activeChar, "Server Type changed to " + getServerTypeName(newType));
showMainPage(activeChar);
}
else
{
activeChar.sendMessage("Server Type is already " + getServerTypeName(newType));
BuilderUtil.sendSysMessage(activeChar, "Server Type is already " + getServerTypeName(newType));
showMainPage(activeChar);
}
}
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"))
@@ -134,23 +135,23 @@ public class AdminLogin implements IAdminCommandHandler
{
Config.SERVER_LIST_TYPE = 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);
}
else
{
activeChar.sendMessage("Server Age is already " + age);
BuilderUtil.sendSysMessage(activeChar, "Server Age is already " + age);
showMainPage(activeChar);
}
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Age must be a number");
BuilderUtil.sendSysMessage(activeChar, "Age must be a number");
}
}
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"))

View File

@@ -23,6 +23,7 @@ import com.l2jmobius.gameserver.model.AutoSpawnHandler.AutoSpawnInstance;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* Admin Command Handler for Mammon NPCs
@@ -56,7 +57,7 @@ public class AdminMammon implements IAdminCommandHandler
}
catch (Exception NumberFormatException)
{
activeChar.sendMessage("Usage: //mammon_find [teleportIndex] (where 1 = Blacksmith, 2 = Merchant)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //mammon_find [teleportIndex] (where 1 = Blacksmith, 2 = Merchant)");
return false;
}
@@ -71,7 +72,7 @@ public class AdminMammon implements IAdminCommandHandler
final L2Npc blackInst = blackSpawnInst.getNPCInstanceList().peek();
if (blackInst != null)
{
activeChar.sendMessage("Blacksmith of Mammon: " + blackInst.getX() + " " + blackInst.getY() + " " + blackInst.getZ());
BuilderUtil.sendSysMessage(activeChar, "Blacksmith of Mammon: " + blackInst.getX() + " " + blackInst.getY() + " " + blackInst.getZ());
if (teleportIndex == 1)
{
activeChar.teleToLocation(blackInst.getLocation(), true);
@@ -80,7 +81,7 @@ public class AdminMammon implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Blacksmith of Mammon isn't registered for spawn.");
BuilderUtil.sendSysMessage(activeChar, "Blacksmith of Mammon isn't registered for spawn.");
}
if (merchSpawnInst != null)
@@ -88,7 +89,7 @@ public class AdminMammon implements IAdminCommandHandler
final L2Npc merchInst = merchSpawnInst.getNPCInstanceList().peek();
if (merchInst != null)
{
activeChar.sendMessage("Merchant of Mammon: " + merchInst.getX() + " " + merchInst.getY() + " " + merchInst.getZ());
BuilderUtil.sendSysMessage(activeChar, "Merchant of Mammon: " + merchInst.getX() + " " + merchInst.getY() + " " + merchInst.getZ());
if (teleportIndex == 2)
{
activeChar.teleToLocation(merchInst.getLocation(), true);
@@ -97,7 +98,7 @@ public class AdminMammon implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Merchant of Mammon isn't registered for spawn.");
BuilderUtil.sendSysMessage(activeChar, "Merchant of Mammon isn't registered for spawn.");
}
}
else if (command.startsWith("admin_mammon_respawn"))
@@ -111,21 +112,21 @@ public class AdminMammon implements IAdminCommandHandler
if (merchSpawnInst != null)
{
final long merchRespawn = AutoSpawnHandler.getInstance().getTimeToNextSpawn(merchSpawnInst);
activeChar.sendMessage("The Merchant of Mammon will respawn in " + (merchRespawn / 60000) + " minute(s).");
BuilderUtil.sendSysMessage(activeChar, "The Merchant of Mammon will respawn in " + (merchRespawn / 60000) + " minute(s).");
}
else
{
activeChar.sendMessage("Merchant of Mammon isn't registered for spawn.");
BuilderUtil.sendSysMessage(activeChar, "Merchant of Mammon isn't registered for spawn.");
}
if (blackSpawnInst != null)
{
final long blackRespawn = AutoSpawnHandler.getInstance().getTimeToNextSpawn(blackSpawnInst);
activeChar.sendMessage("The Blacksmith of Mammon will respawn in " + (blackRespawn / 60000) + " minute(s).");
BuilderUtil.sendSysMessage(activeChar, "The Blacksmith of Mammon will respawn in " + (blackRespawn / 60000) + " minute(s).");
}
else
{
activeChar.sendMessage("Blacksmith of Mammon isn't registered for spawn.");
BuilderUtil.sendSysMessage(activeChar, "Blacksmith of Mammon isn't registered for spawn.");
}
}
return true;

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.network.Disconnection;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands: - handles every admin menu command
@@ -100,7 +101,7 @@ public class AdminMenu implements IAdminCommandHandler
}
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.");
return true;
}
@@ -128,7 +129,7 @@ public class AdminMenu implements IAdminCommandHandler
final L2Clan clan = player.getClan();
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.");
return true;
}
@@ -227,7 +228,7 @@ public class AdminMenu implements IAdminCommandHandler
if (plyr != null)
{
target = plyr;
activeChar.sendMessage("You killed " + plyr.getName());
BuilderUtil.sendSysMessage(activeChar, "You killed " + plyr.getName());
}
}
if (target != null)
@@ -283,7 +284,7 @@ public class AdminMenu implements IAdminCommandHandler
{
activeChar.setInstanceId(player.getInstanceId());
activeChar.teleToLocation(player.getLocation(), true);
activeChar.sendMessage("You're teleporting yourself to character " + player.getName());
BuilderUtil.sendSysMessage(activeChar, "You're teleporting yourself to character " + player.getName());
}
showMainPage(activeChar);
}

View File

@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util;
/**
@@ -47,7 +48,7 @@ public class AdminMessages implements IAdminCommandHandler
}
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 "))
@@ -55,7 +56,7 @@ public class AdminMessages implements IAdminCommandHandler
final String[] tokens = command.split(" ");
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;
}
@@ -99,7 +100,7 @@ public class AdminMessages implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Exception: " + e.getMessage());
BuilderUtil.sendSysMessage(activeChar, "Exception: " + e.getMessage());
continue;
}
}

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

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.network.serverpackets.AdminForgePacket;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles commands for gm to forge packets
@@ -195,13 +196,13 @@ public final class AdminPForge implements IAdminCommandHandler
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);
}
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)
{
showMainPage(activeChar);
@@ -300,7 +301,7 @@ public final class AdminPForge implements IAdminCommandHandler
final String[] opCodes = getOpCodes(st);
if (!validateOpCodes(opCodes))
{
activeChar.sendMessage("Invalid op codes!");
BuilderUtil.sendSysMessage(activeChar, "Invalid op codes!");
showValuesUsage(activeChar);
return false;
}
@@ -311,7 +312,7 @@ public final class AdminPForge implements IAdminCommandHandler
format = st.nextToken();
if (!validateFormat(format))
{
activeChar.sendMessage("Format invalid!");
BuilderUtil.sendSysMessage(activeChar, "Format invalid!");
showValuesUsage(activeChar);
return false;
}
@@ -342,7 +343,7 @@ public final class AdminPForge implements IAdminCommandHandler
final String method = st.nextToken();
if (!validateMethod(method))
{
activeChar.sendMessage("Invalid method!");
BuilderUtil.sendSysMessage(activeChar, "Invalid method!");
showSendUsage(activeChar, null, null);
return false;
}
@@ -350,7 +351,7 @@ public final class AdminPForge implements IAdminCommandHandler
final String[] opCodes = st.nextToken().split(";");
if (!validateOpCodes(opCodes))
{
activeChar.sendMessage("Invalid op codes!");
BuilderUtil.sendSysMessage(activeChar, "Invalid op codes!");
showSendUsage(activeChar, null, null);
return false;
}
@@ -361,7 +362,7 @@ public final class AdminPForge implements IAdminCommandHandler
format = st.nextToken();
if (!validateFormat(format))
{
activeChar.sendMessage("Format invalid!");
BuilderUtil.sendSysMessage(activeChar, "Format invalid!");
showSendUsage(activeChar, null, null);
return false;
}
@@ -408,7 +409,7 @@ public final class AdminPForge implements IAdminCommandHandler
{
if (!st.hasMoreTokens())
{
activeChar.sendMessage("Not enough values!");
BuilderUtil.sendSysMessage(activeChar, "Not enough values!");
showSendUsage(activeChar, null, null);
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.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
public class AdminPathNode implements IAdminCommandHandler
{
@@ -41,13 +42,13 @@ public class AdminPathNode implements IAdminCommandHandler
List<Location> path = GeoEngine.getInstance().findPath(activeChar.getX(), activeChar.getY(), (short) activeChar.getZ(), activeChar.getTarget().getX(), activeChar.getTarget().getY(), (short) activeChar.getTarget().getZ(), activeChar.getInstanceId());
if (path == null)
{
activeChar.sendMessage("No route found or pathfinding disabled.");
BuilderUtil.sendSysMessage(activeChar, "No route found or pathfinding disabled.");
}
else
{
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

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

View File

@@ -21,6 +21,7 @@ import com.l2jmobius.gameserver.instancemanager.PetitionManager;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles commands for GMs to respond to petitions.
@@ -115,7 +116,7 @@ public class AdminPetition implements IAdminCommandHandler
}
catch (StringIndexOutOfBoundsException e)
{
activeChar.sendMessage("Usage: //force_peti text");
BuilderUtil.sendSysMessage(activeChar, "Usage: //force_peti text");
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.serverpackets.GMViewPledgeInfo;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* <B>Pledge Manipulation:</B><BR>
@@ -84,12 +85,12 @@ public class AdminPledge implements IAdminCommandHandler
final L2Clan clan = ClanTable.getInstance().createClan(player, parameter);
if (clan != null)
{
activeChar.sendMessage("Clan " + parameter + " created. Leader: " + player.getName());
BuilderUtil.sendSysMessage(activeChar, "Clan " + parameter + " created. Leader: " + player.getName());
}
else
{
player.setClanCreateExpiryTime(cet);
activeChar.sendMessage("There was a problem while creating the clan.");
BuilderUtil.sendSysMessage(activeChar, "There was a problem while creating the clan.");
}
}
else if (!player.isClanLeader())
@@ -106,11 +107,11 @@ public class AdminPledge implements IAdminCommandHandler
final L2Clan clan = player.getClan();
if (clan == null)
{
activeChar.sendMessage("Clan disbanded.");
BuilderUtil.sendSysMessage(activeChar, "Clan disbanded.");
}
else
{
activeChar.sendMessage("There was a problem while destroying the clan.");
BuilderUtil.sendSysMessage(activeChar, "There was a problem while destroying the clan.");
}
}
else if (action.equals("info"))
@@ -119,7 +120,7 @@ public class AdminPledge implements IAdminCommandHandler
}
else if (parameter == null)
{
activeChar.sendMessage("Usage: //pledge <setlevel|rep> <number>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //pledge <setlevel|rep> <number>");
}
else if (action.equals("setlevel"))
{
@@ -127,11 +128,11 @@ public class AdminPledge implements IAdminCommandHandler
if ((level >= 0) && (level < 12))
{
player.getClan().changeLevel(level);
activeChar.sendMessage("You set level " + level + " for clan " + player.getClan().getName());
BuilderUtil.sendSysMessage(activeChar, "You set level " + level + " for clan " + player.getClan().getName());
}
else
{
activeChar.sendMessage("Level incorrect.");
BuilderUtil.sendSysMessage(activeChar, "Level incorrect.");
}
}
else if (action.startsWith("rep"))
@@ -142,16 +143,16 @@ public class AdminPledge implements IAdminCommandHandler
final L2Clan clan = player.getClan();
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);
return false;
}
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)
{
activeChar.sendMessage("Usage: //pledge <rep> <number>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //pledge <rep> <number>");
}
}
}

View File

@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
import com.l2jmobius.gameserver.network.serverpackets.SetupGauge;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util;
/**
@@ -103,7 +104,7 @@ public class AdminPolymorph implements IAdminCommandHandler
final String[] parts = command.split(" ");
if ((parts.length != 2) || !Util.isDigit(parts[1]))
{
activeChar.sendMessage("Usage: //transform <id>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //transform <id>");
return false;
}
@@ -119,7 +120,7 @@ public class AdminPolymorph implements IAdminCommandHandler
final String[] parts = command.split(" ");
if ((parts.length < 2) || !Util.isDigit(parts[1]))
{
activeChar.sendMessage("Usage: //polymorph [type] <id>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //polymorph [type] <id>");
return false;
}
@@ -170,7 +171,7 @@ public class AdminPolymorph implements IAdminCommandHandler
// end of animation
obj.decayMe();
obj.spawnMe(obj.getX(), obj.getY(), obj.getZ());
activeChar.sendMessage("Polymorph succeed");
BuilderUtil.sendSysMessage(activeChar, "Polymorph succeed");
}
else
{
@@ -190,7 +191,7 @@ public class AdminPolymorph implements IAdminCommandHandler
target.getPoly().setPolyInfo(null, "1");
target.decayMe();
target.spawnMe(target.getX(), target.getY(), target.getZ());
activeChar.sendMessage("Unpolymorph succeed");
BuilderUtil.sendSysMessage(activeChar, "Unpolymorph succeed");
}
else
{

View File

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

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.PunishmentType;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.GMAudit;
import com.l2jmobius.gameserver.util.Util;
@@ -102,13 +103,13 @@ public class AdminPunishment implements IAdminCommandHandler
if ((key == null) || (af == null))
{
activeChar.sendMessage("Not enough data specified!");
BuilderUtil.sendSysMessage(activeChar, "Not enough data specified!");
break;
}
final PunishmentAffect affect = PunishmentAffect.getByName(af);
if (affect == null)
{
activeChar.sendMessage("Incorrect value specified for affect type!");
BuilderUtil.sendSysMessage(activeChar, "Incorrect value specified for affect type!");
break;
}
@@ -167,7 +168,7 @@ public class AdminPunishment implements IAdminCommandHandler
}
if ((target == null) && ((activeChar.getTarget() == null) || !activeChar.getTarget().isPlayer()))
{
activeChar.sendMessage("You must target player!");
BuilderUtil.sendSysMessage(activeChar, "You must target player!");
break;
}
if (target == null)
@@ -223,12 +224,12 @@ public class AdminPunishment implements IAdminCommandHandler
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;
}
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;
}
@@ -242,7 +243,7 @@ public class AdminPunishment implements IAdminCommandHandler
final PunishmentType type = PunishmentType.getByName(t);
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;
}
@@ -267,7 +268,7 @@ public class AdminPunishment implements IAdminCommandHandler
}
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());
break;
}
@@ -276,13 +277,13 @@ public class AdminPunishment implements IAdminCommandHandler
// Check if we already put the same punishment on that guy ^^
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;
}
// Punish him!
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);
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))
{
activeChar.sendMessage("Not enough data specified!");
BuilderUtil.sendSysMessage(activeChar, "Not enough data specified!");
break;
}
@@ -304,7 +305,7 @@ public class AdminPunishment implements IAdminCommandHandler
final PunishmentType type = PunishmentType.getByName(t);
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;
}
@@ -316,12 +317,12 @@ public class AdminPunishment implements IAdminCommandHandler
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;
}
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);
return useAdminCommand("admin_punishment info " + name + " " + affect.name(), activeChar);
}

View File

@@ -35,6 +35,7 @@ import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestTimer;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.scripting.ScriptEngineManager;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util;
public class AdminQuest implements IAdminCommandHandler
@@ -69,7 +70,7 @@ public class AdminQuest implements IAdminCommandHandler
if (!st.hasMoreTokens())
{
activeChar.sendMessage("Usage: //quest_reload <questName> or <questId>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //quest_reload <questName> or <questId>");
return false;
}
@@ -77,17 +78,17 @@ public class AdminQuest implements IAdminCommandHandler
Quest quest = findScript(script);
if (quest == null)
{
activeChar.sendMessage("The script " + script + " couldn't be found!");
BuilderUtil.sendSysMessage(activeChar, "The script " + script + " couldn't be found!");
return false;
}
if (!quest.reload())
{
activeChar.sendMessage("Failed to reload " + script + "!");
BuilderUtil.sendSysMessage(activeChar, "Failed to reload " + script + "!");
return false;
}
activeChar.sendMessage("Script successful reloaded.");
BuilderUtil.sendSysMessage(activeChar, "Script successful reloaded.");
}
else if (command.startsWith("admin_script_load"))
{
@@ -96,7 +97,7 @@ public class AdminQuest implements IAdminCommandHandler
if (!st.hasMoreTokens())
{
activeChar.sendMessage("Usage: //script_load path/to/script.java");
BuilderUtil.sendSysMessage(activeChar, "Usage: //script_load path/to/script.java");
return false;
}
@@ -104,11 +105,11 @@ public class AdminQuest implements IAdminCommandHandler
try
{
ScriptEngineManager.getInstance().executeScript(Paths.get(script));
activeChar.sendMessage("Script loaded seccessful!");
BuilderUtil.sendSysMessage(activeChar, "Script loaded seccessful!");
}
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);
}
}
@@ -119,7 +120,7 @@ public class AdminQuest implements IAdminCommandHandler
if (!st.hasMoreTokens())
{
activeChar.sendMessage("Usage: //script_load path/to/script.java");
BuilderUtil.sendSysMessage(activeChar, "Usage: //script_load path/to/script.java");
return false;
}
@@ -127,22 +128,22 @@ public class AdminQuest implements IAdminCommandHandler
Quest quest = findScript(script);
if (quest == null)
{
activeChar.sendMessage("The script " + script + " couldn't be found!");
BuilderUtil.sendSysMessage(activeChar, "The script " + script + " couldn't be found!");
return false;
}
quest.unload();
activeChar.sendMessage("Script successful unloaded!");
BuilderUtil.sendSysMessage(activeChar, "Script successful unloaded!");
}
else if (command.startsWith("admin_show_quests"))
{
if (activeChar.getTarget() == null)
{
activeChar.sendMessage("Get a target first.");
BuilderUtil.sendSysMessage(activeChar, "Get a target first.");
}
else if (!activeChar.getTarget().isCharacter())
{
activeChar.sendMessage("Invalid Target.");
BuilderUtil.sendSysMessage(activeChar, "Invalid Target.");
}
else
{
@@ -181,7 +182,7 @@ public class AdminQuest implements IAdminCommandHandler
int counter = 0;
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;
}

View File

@@ -47,6 +47,7 @@ import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.scripting.ScriptEngineManager;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util;
/**
@@ -118,7 +119,7 @@ public class AdminReload implements IAdminCommandHandler
else
{
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.");
}
break;
@@ -126,7 +127,7 @@ public class AdminReload implements IAdminCommandHandler
case "walker":
{
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.");
break;
}
@@ -144,13 +145,13 @@ public class AdminReload implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("File or Directory does not exist.");
BuilderUtil.sendSysMessage(activeChar, "File or Directory does not exist.");
}
}
else
{
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.");
}
break;
@@ -219,7 +220,7 @@ public class AdminReload implements IAdminCommandHandler
catch (Exception 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;
}
@@ -233,7 +234,7 @@ public class AdminReload implements IAdminCommandHandler
catch (Exception e)
{
LOGGER.log(Level.WARNING, "Failed executing master handler!", e);
activeChar.sendMessage("Error reloading master handler!");
BuilderUtil.sendSysMessage(activeChar, "Error reloading master handler!");
}
break;
}
@@ -282,7 +283,7 @@ public class AdminReload implements IAdminCommandHandler
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;
}

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

View File

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

View File

@@ -28,6 +28,7 @@ import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* @author NosBit
@@ -60,7 +61,7 @@ public class AdminScan implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //scan [radius]");
BuilderUtil.sendSysMessage(activeChar, "Usage: //scan [radius]");
return false;
}
}
@@ -72,7 +73,7 @@ public class AdminScan implements IAdminCommandHandler
{
if (!st.hasMoreElements())
{
activeChar.sendMessage("Usage: //deletenpcbyobjectid <object_id>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //deletenpcbyobjectid <object_id>");
return false;
}
@@ -84,7 +85,7 @@ public class AdminScan implements IAdminCommandHandler
final L2Npc npc = target instanceof L2Npc ? (L2Npc) target : 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;
}
@@ -109,7 +110,7 @@ public class AdminScan implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("object_id must be a number.");
BuilderUtil.sendSysMessage(activeChar, "object_id must be a number.");
return false;
}

View File

@@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.buylist.L2BuyList;
import com.l2jmobius.gameserver.network.serverpackets.ActionFailed;
import com.l2jmobius.gameserver.network.serverpackets.BuyList;
import com.l2jmobius.gameserver.network.serverpackets.ExBuySellList;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands:
@@ -54,7 +55,7 @@ public class AdminShop implements IAdminCommandHandler
}
catch (IndexOutOfBoundsException e)
{
activeChar.sendMessage("Please specify buylist.");
BuilderUtil.sendSysMessage(activeChar, "Please specify buylist.");
}
}
else if (command.equals("admin_gmshop"))

View File

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

View File

@@ -34,6 +34,7 @@ import com.l2jmobius.gameserver.model.entity.clanhall.SiegableHall;
import com.l2jmobius.gameserver.model.zone.type.L2ClanHallZone;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util;
/**
@@ -102,13 +103,13 @@ public class AdminSiege implements IAdminCommandHandler
}
if (clanhall.getOwnerId() > 0)
{
activeChar.sendMessage("This Clan Hall is not free!");
BuilderUtil.sendSysMessage(activeChar, "This Clan Hall is not free!");
return false;
}
clan = player.getClan();
if (clan.getHideoutId() > 0)
{
activeChar.sendMessage("You have already a Clan Hall!");
BuilderUtil.sendSysMessage(activeChar, "You have already a Clan Hall!");
return false;
}
if (!clanhall.isSiegableHall())
@@ -137,7 +138,7 @@ public class AdminSiege implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("This Clan Hall is already free!");
BuilderUtil.sendSysMessage(activeChar, "This Clan Hall is already free!");
}
}
else
@@ -231,7 +232,7 @@ public class AdminSiege implements IAdminCommandHandler
}
}
// If doesn't have more tokens or token is not a number.
activeChar.sendMessage("Usage: //add_guard castle npcId");
BuilderUtil.sendSysMessage(activeChar, "Usage: //add_guard castle npcId");
break;
}
case "admin_clear_siege_list":
@@ -251,7 +252,7 @@ public class AdminSiege implements IAdminCommandHandler
}
case "admin_move_defenders":
{
activeChar.sendMessage("Not implemented yet.");
BuilderUtil.sendSysMessage(activeChar, "Not implemented yet.");
break;
}
case "admin_setcastle":
@@ -275,7 +276,7 @@ public class AdminSiege implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Unable to remove castle.");
BuilderUtil.sendSysMessage(activeChar, "Unable to remove castle.");
}
break;
}
@@ -291,7 +292,7 @@ public class AdminSiege implements IAdminCommandHandler
final int month = cal.get(Calendar.MONTH) + Integer.parseInt(st.nextToken());
if ((cal.getActualMinimum(Calendar.MONTH) > month) || (cal.getActualMaximum(Calendar.MONTH) < month))
{
activeChar.sendMessage("Unable to change Siege Date - Incorrect month value only " + cal.getActualMinimum(Calendar.MONTH) + "-" + cal.getActualMaximum(Calendar.MONTH) + " is accepted!");
BuilderUtil.sendSysMessage(activeChar, "Unable to change Siege Date - Incorrect month value only " + cal.getActualMinimum(Calendar.MONTH) + "-" + cal.getActualMaximum(Calendar.MONTH) + " is accepted!");
return false;
}
cal.set(Calendar.MONTH, month);
@@ -301,7 +302,7 @@ public class AdminSiege implements IAdminCommandHandler
final int day = Integer.parseInt(st.nextToken());
if ((cal.getActualMinimum(Calendar.DAY_OF_MONTH) > day) || (cal.getActualMaximum(Calendar.DAY_OF_MONTH) < day))
{
activeChar.sendMessage("Unable to change Siege Date - Incorrect day value only " + cal.getActualMinimum(Calendar.DAY_OF_MONTH) + "-" + cal.getActualMaximum(Calendar.DAY_OF_MONTH) + " is accepted!");
BuilderUtil.sendSysMessage(activeChar, "Unable to change Siege Date - Incorrect day value only " + cal.getActualMinimum(Calendar.DAY_OF_MONTH) + "-" + cal.getActualMaximum(Calendar.DAY_OF_MONTH) + " is accepted!");
return false;
}
cal.set(Calendar.DAY_OF_MONTH, day);
@@ -311,7 +312,7 @@ public class AdminSiege implements IAdminCommandHandler
final int hour = Integer.parseInt(st.nextToken());
if ((cal.getActualMinimum(Calendar.HOUR_OF_DAY) > hour) || (cal.getActualMaximum(Calendar.HOUR_OF_DAY) < hour))
{
activeChar.sendMessage("Unable to change Siege Date - Incorrect hour value only " + cal.getActualMinimum(Calendar.HOUR_OF_DAY) + "-" + cal.getActualMaximum(Calendar.HOUR_OF_DAY) + " is accepted!");
BuilderUtil.sendSysMessage(activeChar, "Unable to change Siege Date - Incorrect hour value only " + cal.getActualMinimum(Calendar.HOUR_OF_DAY) + "-" + cal.getActualMaximum(Calendar.HOUR_OF_DAY) + " is accepted!");
return false;
}
cal.set(Calendar.HOUR_OF_DAY, hour);
@@ -321,20 +322,20 @@ public class AdminSiege implements IAdminCommandHandler
final int min = Integer.parseInt(st.nextToken());
if ((cal.getActualMinimum(Calendar.MINUTE) > min) || (cal.getActualMaximum(Calendar.MINUTE) < min))
{
activeChar.sendMessage("Unable to change Siege Date - Incorrect minute value only " + cal.getActualMinimum(Calendar.MINUTE) + "-" + cal.getActualMaximum(Calendar.MINUTE) + " is accepted!");
BuilderUtil.sendSysMessage(activeChar, "Unable to change Siege Date - Incorrect minute value only " + cal.getActualMinimum(Calendar.MINUTE) + "-" + cal.getActualMaximum(Calendar.MINUTE) + " is accepted!");
return false;
}
cal.set(Calendar.MINUTE, min);
}
if (cal.getTimeInMillis() < Calendar.getInstance().getTimeInMillis())
{
activeChar.sendMessage("Unable to change Siege Date");
BuilderUtil.sendSysMessage(activeChar, "Unable to change Siege Date");
}
else if (cal.getTimeInMillis() != castle.getSiegeDate().getTimeInMillis())
{
castle.getSiegeDate().setTimeInMillis(cal.getTimeInMillis());
castle.getSiege().saveSiegeDate();
activeChar.sendMessage("Castle siege time for castle " + castle.getName() + " has been changed.");
BuilderUtil.sendSysMessage(activeChar, "Castle siege time for castle " + castle.getName() + " has been changed.");
}
}
showSiegeTimePage(activeChar, castle);

View File

@@ -34,6 +34,7 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.PledgeSkillList;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands:
@@ -122,7 +123,7 @@ public class AdminSkill implements IAdminCommandHandler
}
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"))
@@ -135,7 +136,7 @@ public class AdminSkill implements IAdminCommandHandler
}
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"))
@@ -175,7 +176,7 @@ public class AdminSkill implements IAdminCommandHandler
{
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.sendSkillList();
player.broadcastUserInfo();
@@ -189,7 +190,7 @@ public class AdminSkill implements IAdminCommandHandler
}
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"))
@@ -200,7 +201,7 @@ public class AdminSkill implements IAdminCommandHandler
final Skill skill = SkillData.getInstance().getSkill(id, lvl);
activeChar.addSkill(skill);
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);
}
return true;
}
@@ -220,7 +221,7 @@ public class AdminSkill implements IAdminCommandHandler
}
final L2PcInstance player = target.getActingPlayer();
// 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();
}
@@ -268,7 +269,7 @@ public class AdminSkill implements IAdminCommandHandler
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.");
}
@@ -378,7 +379,7 @@ public class AdminSkill implements IAdminCommandHandler
{
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();
}
showMainPage(activeChar);
@@ -398,7 +399,7 @@ public class AdminSkill implements IAdminCommandHandler
final L2PcInstance player = target.getActingPlayer();
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
{
@@ -420,7 +421,7 @@ public class AdminSkill implements IAdminCommandHandler
activeChar.addSkill(skill, true);
}
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;
activeChar.sendSkillList();
player.sendSkillList();
@@ -470,12 +471,12 @@ public class AdminSkill implements IAdminCommandHandler
player.addSkill(skill, true);
player.sendSkillList();
// 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();
}
else
{
activeChar.sendMessage("Error: there is no such skill.");
BuilderUtil.sendSysMessage(activeChar, "Error: there is no such skill.");
}
showMainPage(activeChar); // Back to start
}
@@ -501,12 +502,12 @@ public class AdminSkill implements IAdminCommandHandler
player.sendMessage("Admin removed the skill " + skillname + " from your skills list.");
player.removeSkill(skill);
// 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();
}
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
}
@@ -536,7 +537,7 @@ public class AdminSkill implements IAdminCommandHandler
}
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);
return;
}
@@ -544,7 +545,7 @@ public class AdminSkill implements IAdminCommandHandler
final Skill skill = SkillData.getInstance().getSkill(id, level);
if (skill == null)
{
activeChar.sendMessage("Error: there is no such skill.");
BuilderUtil.sendSysMessage(activeChar, "Error: there is no such skill.");
return;
}
@@ -555,7 +556,7 @@ public class AdminSkill implements IAdminCommandHandler
final L2Clan clan = player.getClan();
clan.broadcastToOnlineMembers(sm);
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));
for (L2PcInstance member : clan.getOnlineMembers(0))

View File

@@ -45,6 +45,7 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
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
@@ -199,17 +200,17 @@ public class AdminSpawn implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot find instance " + instance);
BuilderUtil.sendSysMessage(activeChar, "Cannot find instance " + instance);
}
}
else
{
activeChar.sendMessage("Invalid instance number.");
BuilderUtil.sendSysMessage(activeChar, "Invalid instance number.");
}
}
catch (Exception e)
{
activeChar.sendMessage("Usage //instance_spawns <instance_number>");
BuilderUtil.sendSysMessage(activeChar, "Usage //instance_spawns <instance_number>");
}
}
else if (command.startsWith("admin_unspawnall"))
@@ -299,7 +300,7 @@ public class AdminSpawn implements IAdminCommandHandler
}
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"))
{
@@ -441,7 +442,7 @@ public class AdminSpawn implements IAdminCommandHandler
// TODO add checks for GrandBossSpawnManager
if (RaidBossSpawnManager.getInstance().isDefined(spawn.getId()))
{
activeChar.sendMessage("You cannot spawn another instance of " + template.getName() + ".");
BuilderUtil.sendSysMessage(activeChar, "You cannot spawn another instance of " + template.getName() + ".");
}
else
{
@@ -460,7 +461,7 @@ public class AdminSpawn implements IAdminCommandHandler
{
spawn.stopRespawn();
}
activeChar.sendMessage("Created " + template.getName() + " on " + target.getObjectId());
BuilderUtil.sendSysMessage(activeChar, "Created " + template.getName() + " on " + target.getObjectId());
}
}
catch (Exception e)

View File

@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import com.l2jmobius.gameserver.handler.AdminCommandHandler;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* @author poltomb
@@ -53,7 +54,7 @@ public class AdminSummon implements IAdminCommandHandler
}
catch (NumberFormatException nfe)
{
activeChar.sendMessage("Incorrect format for command 'summon'");
BuilderUtil.sendSysMessage(activeChar, "Incorrect format for command 'summon'");
return false;
}
@@ -66,7 +67,7 @@ public class AdminSummon implements IAdminCommandHandler
{
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;
}

View File

@@ -19,6 +19,7 @@ package handlers.admincommandhandlers;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2World;
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
@@ -59,12 +60,12 @@ public class AdminTarget implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Player " + targetName + " not found");
BuilderUtil.sendSysMessage(activeChar, "Player " + targetName + " not found");
}
}
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.network.SystemMessageId;
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
@@ -56,7 +57,7 @@ public class AdminTargetSay implements IAdminCommandHandler
}
catch (StringIndexOutOfBoundsException e)
{
activeChar.sendMessage("Usage: //targetsay <text>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //targetsay <text>");
return false;
}
}

View File

@@ -145,7 +145,7 @@ public class AdminTeleport implements IAdminCommandHandler
}
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");
}
}
@@ -160,7 +160,7 @@ public class AdminTeleport implements IAdminCommandHandler
catch (StringIndexOutOfBoundsException e)
{
// 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
}
}
@@ -183,7 +183,7 @@ public class AdminTeleport implements IAdminCommandHandler
final String[] param = command.split(" ");
if (param.length != 2)
{
activeChar.sendMessage("Usage: //recall <playername>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //recall <playername>");
return false;
}
final String targetName = param[1];
@@ -247,7 +247,7 @@ public class AdminTeleport implements IAdminCommandHandler
}
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"))
@@ -256,7 +256,7 @@ public class AdminTeleport implements IAdminCommandHandler
st.nextToken(); // Skip command.
if (st.countTokens() > 1)
{
activeChar.sendMessage("Usage: //sendhome <playername>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //sendhome <playername>");
}
else if (st.countTokens() == 1)
{
@@ -352,11 +352,11 @@ public class AdminTeleport implements IAdminCommandHandler
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
activeChar.teleToLocation(x, y, z);
activeChar.sendMessage("You have been teleported to " + Coords);
BuilderUtil.sendSysMessage(activeChar, "You have been teleported to " + Coords);
}
catch (NoSuchElementException nsee)
{
activeChar.sendMessage("Wrong or no Coordinates given.");
BuilderUtil.sendSysMessage(activeChar, "Wrong or no Coordinates given.");
}
}
@@ -434,7 +434,7 @@ public class AdminTeleport implements IAdminCommandHandler
// Check for jail
if (player.isJailed())
{
activeChar.sendMessage("Sorry, player " + player.getName() + " is in Jail.");
BuilderUtil.sendSysMessage(activeChar, "Sorry, player " + player.getName() + " is in Jail.");
}
else
{
@@ -442,7 +442,7 @@ public class AdminTeleport implements IAdminCommandHandler
if ((activeChar != null) && (activeChar.getInstanceId() >= 0))
{
player.setInstanceId(activeChar.getInstanceId());
activeChar.sendMessage("You have recalled " + player.getName());
BuilderUtil.sendSysMessage(activeChar, "You have recalled " + player.getName());
}
else
{
@@ -490,7 +490,7 @@ public class AdminTeleport implements IAdminCommandHandler
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
activeChar.teleToLocation(new Location(x, y, z), true);
activeChar.sendMessage("You have teleported to character " + player.getName() + ".");
BuilderUtil.sendSysMessage(activeChar, "You have teleported to character " + player.getName() + ".");
}
}
@@ -511,16 +511,16 @@ public class AdminTeleport implements IAdminCommandHandler
statement.close();
if (count == 0)
{
activeChar.sendMessage("Character not found or position unaltered.");
BuilderUtil.sendSysMessage(activeChar, "Character not found or position unaltered.");
}
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)
{
activeChar.sendMessage("SQLException while changing offline character's position");
BuilderUtil.sendSysMessage(activeChar, "SQLException while changing offline character's position");
}
}
@@ -533,7 +533,7 @@ public class AdminTeleport implements IAdminCommandHandler
L2Spawn spawn = target.getSpawn();
if (spawn == null)
{
activeChar.sendMessage("Incorrect monster spawn.");
BuilderUtil.sendSysMessage(activeChar, "Incorrect monster spawn.");
LOGGER.warning("ERROR: NPC " + target.getObjectId() + " has a 'null' spawn.");
return;
}
@@ -563,11 +563,11 @@ public class AdminTeleport implements IAdminCommandHandler
SpawnTable.getInstance().addNewSpawn(spawn, true);
spawn.init();
activeChar.sendMessage("Created " + target.getTemplate().getName() + " on " + target.getObjectId() + ".");
BuilderUtil.sendSysMessage(activeChar, "Created " + target.getTemplate().getName() + " on " + target.getObjectId() + ".");
}
catch (Exception e)
{
activeChar.sendMessage("Target is not in game.");
BuilderUtil.sendSysMessage(activeChar, "Target is not in game.");
}
}
@@ -579,7 +579,7 @@ public class AdminTeleport implements IAdminCommandHandler
final double curMP = target.getCurrentMp();
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.");
return;
}

View File

@@ -26,6 +26,7 @@ import com.l2jmobius.gameserver.instancemanager.TerritoryWarManager;
import com.l2jmobius.gameserver.model.TerritoryWard;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* Admin comand handler for Territory War System This class handles following admin commands:
@@ -65,7 +66,7 @@ public class AdminTerritoryWar implements IAdminCommandHandler
final int month = cal.get(Calendar.MONTH) + Integer.parseInt(st.nextToken());
if ((cal.getActualMinimum(Calendar.MONTH) > month) || (cal.getActualMaximum(Calendar.MONTH) < month))
{
activeChar.sendMessage("Unable to change Siege Date - Incorrect month value only " + cal.getActualMinimum(Calendar.MONTH) + "-" + cal.getActualMaximum(Calendar.MONTH) + " is accepted!");
BuilderUtil.sendSysMessage(activeChar, "Unable to change Siege Date - Incorrect month value only " + cal.getActualMinimum(Calendar.MONTH) + "-" + cal.getActualMaximum(Calendar.MONTH) + " is accepted!");
return false;
}
cal.set(Calendar.MONTH, month);
@@ -75,7 +76,7 @@ public class AdminTerritoryWar implements IAdminCommandHandler
final int day = Integer.parseInt(st.nextToken());
if ((cal.getActualMinimum(Calendar.DAY_OF_MONTH) > day) || (cal.getActualMaximum(Calendar.DAY_OF_MONTH) < day))
{
activeChar.sendMessage("Unable to change Siege Date - Incorrect day value only " + cal.getActualMinimum(Calendar.DAY_OF_MONTH) + "-" + cal.getActualMaximum(Calendar.DAY_OF_MONTH) + " is accepted!");
BuilderUtil.sendSysMessage(activeChar, "Unable to change Siege Date - Incorrect day value only " + cal.getActualMinimum(Calendar.DAY_OF_MONTH) + "-" + cal.getActualMaximum(Calendar.DAY_OF_MONTH) + " is accepted!");
return false;
}
cal.set(Calendar.DAY_OF_MONTH, day);
@@ -85,7 +86,7 @@ public class AdminTerritoryWar implements IAdminCommandHandler
final int hour = Integer.parseInt(st.nextToken());
if ((cal.getActualMinimum(Calendar.HOUR_OF_DAY) > hour) || (cal.getActualMaximum(Calendar.HOUR_OF_DAY) < hour))
{
activeChar.sendMessage("Unable to change Siege Date - Incorrect hour value only " + cal.getActualMinimum(Calendar.HOUR_OF_DAY) + "-" + cal.getActualMaximum(Calendar.HOUR_OF_DAY) + " is accepted!");
BuilderUtil.sendSysMessage(activeChar, "Unable to change Siege Date - Incorrect hour value only " + cal.getActualMinimum(Calendar.HOUR_OF_DAY) + "-" + cal.getActualMaximum(Calendar.HOUR_OF_DAY) + " is accepted!");
return false;
}
cal.set(Calendar.HOUR_OF_DAY, hour);
@@ -95,7 +96,7 @@ public class AdminTerritoryWar implements IAdminCommandHandler
final int min = Integer.parseInt(st.nextToken());
if ((cal.getActualMinimum(Calendar.MINUTE) > min) || (cal.getActualMaximum(Calendar.MINUTE) < min))
{
activeChar.sendMessage("Unable to change Siege Date - Incorrect minute value only " + cal.getActualMinimum(Calendar.MINUTE) + "-" + cal.getActualMaximum(Calendar.MINUTE) + " is accepted!");
BuilderUtil.sendSysMessage(activeChar, "Unable to change Siege Date - Incorrect minute value only " + cal.getActualMinimum(Calendar.MINUTE) + "-" + cal.getActualMaximum(Calendar.MINUTE) + " is accepted!");
return false;
}
cal.set(Calendar.MINUTE, min);
@@ -103,7 +104,7 @@ public class AdminTerritoryWar implements IAdminCommandHandler
if (cal.getTimeInMillis() < Calendar.getInstance().getTimeInMillis())
{
activeChar.sendMessage("Unable to change TW Date!");
BuilderUtil.sendSysMessage(activeChar, "Unable to change TW Date!");
}
else if (cal.getTimeInMillis() != TerritoryWarManager.getInstance().getTWStartTimeInMillis())
{

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.skills.Skill;
import com.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* @version $Revision: 1.2 $ $Date: 2004/06/27 08:12:59 $
@@ -69,11 +70,11 @@ public class AdminTest implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Command format is //skill_test <ID>");
BuilderUtil.sendSysMessage(activeChar, "Command format is //skill_test <ID>");
}
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"))

View File

@@ -23,6 +23,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.TvTEvent;
import com.l2jmobius.gameserver.model.entity.TvTEventTeleporter;
import com.l2jmobius.gameserver.model.entity.TvTManager;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* @author HorridoJoho
@@ -45,7 +46,7 @@ public class AdminTvTEvent implements IAdminCommandHandler
if (!(target instanceof L2PcInstance))
{
activeChar.sendMessage("You should select a player!");
BuilderUtil.sendSysMessage(activeChar, "You should select a player!");
return true;
}
@@ -57,7 +58,7 @@ public class AdminTvTEvent implements IAdminCommandHandler
if (!(target instanceof L2PcInstance))
{
activeChar.sendMessage("You should select a player!");
BuilderUtil.sendSysMessage(activeChar, "You should select a player!");
return true;
}
@@ -81,13 +82,13 @@ public class AdminTvTEvent implements IAdminCommandHandler
{
if (playerInstance.isOnEvent())
{
activeChar.sendMessage("Player already participated in the event!");
BuilderUtil.sendSysMessage(activeChar, "Player already participated in the event!");
return;
}
if (!TvTEvent.addParticipant(playerInstance))
{
activeChar.sendMessage("Player instance could not be added, it seems to be null!");
BuilderUtil.sendSysMessage(activeChar, "Player instance could not be added, it seems to be null!");
return;
}
@@ -101,7 +102,7 @@ public class AdminTvTEvent implements IAdminCommandHandler
{
if (!TvTEvent.removeParticipant(playerInstance.getObjectId()))
{
activeChar.sendMessage("Player is not part of the event!");
BuilderUtil.sendSysMessage(activeChar, "Player is not part of the event!");
return;
}

View File

@@ -20,6 +20,7 @@ import java.util.logging.Logger;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands:
@@ -48,12 +49,12 @@ public class AdminUnblockIp implements IAdminCommandHandler
final String ipAddress = command.substring(16);
if (unblockIp(ipAddress, activeChar))
{
activeChar.sendMessage("Removed IP " + ipAddress + " from blocklist!");
BuilderUtil.sendSysMessage(activeChar, "Removed IP " + ipAddress + " from blocklist!");
}
}
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.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.stat.PcStat;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* @author Psychokiller1888
@@ -48,7 +49,7 @@ public class AdminVitality implements IAdminCommandHandler
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;
}
@@ -71,7 +72,7 @@ public class AdminVitality implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Incorrect vitality");
BuilderUtil.sendSysMessage(activeChar, "Incorrect vitality");
}
target.setVitalityPoints(vitality, true);
@@ -85,7 +86,7 @@ public class AdminVitality implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Incorrect vitality level (0-4)");
BuilderUtil.sendSysMessage(activeChar, "Incorrect vitality level (0-4)");
}
if ((level >= 0) && (level <= 4))
@@ -103,7 +104,7 @@ public class AdminVitality implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Incorrect vitality level (0-4)");
BuilderUtil.sendSysMessage(activeChar, "Incorrect vitality level (0-4)");
}
}
else if (cmd.equals("admin_full_vitality"))
@@ -121,12 +122,12 @@ public class AdminVitality implements IAdminCommandHandler
level = target.getVitalityLevel();
vitality = target.getVitalityPoints();
activeChar.sendMessage("Player vitality level: " + level);
activeChar.sendMessage("Player vitality points: " + vitality);
BuilderUtil.sendSysMessage(activeChar, "Player vitality level: " + level);
BuilderUtil.sendSysMessage(activeChar, "Player vitality points: " + vitality);
}
return true;
}
activeChar.sendMessage("Target not found or not a player");
BuilderUtil.sendSysMessage(activeChar, "Target not found or not a player");
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.type.NpcSpawnTerritory;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* Small typo fix by Zoey76 24/02/2011
@@ -59,9 +60,9 @@ public class AdminZone implements IAdminCommandHandler
if (actualCommand.equalsIgnoreCase("admin_zone_check"))
{
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);
activeChar.sendMessage("Closest Town: " + MapRegionManager.getInstance().getClosestTownName(activeChar));
BuilderUtil.sendSysMessage(activeChar, "Closest Town: " + MapRegionManager.getInstance().getClosestTownName(activeChar));
// Prevent exit instance variable deletion.
if (activeChar.getInstanceId() == 0)
@@ -69,16 +70,16 @@ public class AdminZone implements IAdminCommandHandler
Location loc;
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);
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);
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);
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"))
@@ -167,7 +168,7 @@ public class AdminZone implements IAdminCommandHandler
final int worldY = activeChar.getY();
final int geoX = (((worldX - -327680) >> 4) >> 11) + 10;
final int geoY = (((worldY - -262144) >> 4) >> 11) + 10;
activeChar.sendMessage("GeoRegion: " + geoX + "_" + geoY + "");
BuilderUtil.sendSysMessage(activeChar, "GeoRegion: " + geoX + "_" + geoY + "");
}
@Override

View File

@@ -52,6 +52,7 @@ import com.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
import com.l2jmobius.gameserver.network.serverpackets.ExServerPrimitive;
import com.l2jmobius.gameserver.network.serverpackets.ExShowTerritory;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.HtmlUtil;
import com.l2jmobius.gameserver.util.Util;
@@ -157,13 +158,13 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
{
if (!st.hasMoreTokens())
{
activeChar.sendMessage("Missing node index!");
BuilderUtil.sendSysMessage(activeChar, "Missing node index!");
break;
}
final String indexToken = st.nextToken();
if (!Util.isDigit(indexToken))
{
activeChar.sendMessage("Node index should be int!");
BuilderUtil.sendSysMessage(activeChar, "Node index should be int!");
break;
}
final int index = Integer.parseInt(indexToken);
@@ -174,13 +175,13 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
{
if (!st.hasMoreTokens())
{
activeChar.sendMessage("Missing node index!");
BuilderUtil.sendSysMessage(activeChar, "Missing node index!");
break;
}
final String indexToken = st.nextToken();
if (!Util.isDigit(indexToken))
{
activeChar.sendMessage("Node index should be int!");
BuilderUtil.sendSysMessage(activeChar, "Node index should be int!");
break;
}
final int index = Integer.parseInt(indexToken);
@@ -238,7 +239,7 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
*/
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);
L2ZoneType zoneType = null;
for (L2ZoneType zone : zones)
@@ -246,7 +247,7 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
if (zone.getName().equalsIgnoreCase(zoneName))
{
zoneType = zone;
activeChar.sendMessage("Zone found: " + zone.getId());
BuilderUtil.sendSysMessage(activeChar, "Zone found: " + zone.getId());
break;
}
}
@@ -275,7 +276,7 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
{
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;
}
_zones.computeIfAbsent(activeChar.getObjectId(), key -> new ZoneNodeHolder()).setName(name);
@@ -289,11 +290,11 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
if (!activeChar.hasAction(PlayerAction.ADMIN_POINT_PICKING))
{
activeChar.addAction(PlayerAction.ADMIN_POINT_PICKING);
activeChar.sendMessage("Point picking mode activated!");
BuilderUtil.sendSysMessage(activeChar, "Point picking mode activated!");
}
else
{
activeChar.sendMessage("Point picking mode is already activated!");
BuilderUtil.sendSysMessage(activeChar, "Point picking mode is already activated!");
}
}
@@ -304,11 +305,11 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
{
if (activeChar.removeAction(PlayerAction.ADMIN_POINT_PICKING))
{
activeChar.sendMessage("Point picking mode deactivated!");
BuilderUtil.sendSysMessage(activeChar, "Point picking mode deactivated!");
}
else
{
activeChar.sendMessage("Point picking mode was not activated!");
BuilderUtil.sendSysMessage(activeChar, "Point picking mode was not activated!");
}
}
@@ -322,7 +323,7 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
{
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;
}
final ExServerPrimitive exsp = new ExServerPrimitive("DebugPoint_" + activeChar.getObjectId(), activeChar.getX(), activeChar.getY(), activeChar.getZ());
@@ -375,10 +376,10 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
if (loc != null)
{
holder.getNodes().remove(loc);
activeChar.sendMessage("Node " + index + " has been removed!");
BuilderUtil.sendSysMessage(activeChar, "Node " + index + " has been removed!");
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());
}
}
@@ -395,7 +396,7 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
{
if (holder.getName().isEmpty())
{
activeChar.sendMessage("Set name first!");
BuilderUtil.sendSysMessage(activeChar, "Set name first!");
return;
}
@@ -426,11 +427,11 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
file.getParentFile().mkdirs();
}
Files.write(file.toPath(), sb.toString().getBytes(StandardCharsets.UTF_8));
activeChar.sendMessage("Successfully written on: " + file.getAbsolutePath().replace(Config.DATAPACK_ROOT.getAbsolutePath(), ""));
BuilderUtil.sendSysMessage(activeChar, "Successfully written on: " + file.getAbsolutePath().replace(Config.DATAPACK_ROOT.getAbsolutePath(), ""));
}
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);
}
}
@@ -451,13 +452,13 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
{
changeLog.setXYZ(newLocation);
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);
}
else
{
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
if (holder.getNodes().size() >= 3)
@@ -484,7 +485,7 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
final List<Location> list = holder.getNodes();
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;
}
@@ -492,7 +493,7 @@ public class AdminZones extends AbstractNpcAI implements IAdminCommandHandler
final ExShowTerritory exst = new ExShowTerritory(firstLoc.getZ() - 100, firstLoc.getZ() + 100);
list.forEach(exst::addVertice);
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!");
}
}
}