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

@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.olympiad.Olympiad;
import com.l2jmobius.gameserver.network.SystemMessageId;
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 -
@ -105,13 +106,13 @@ public class AdminAdmin implements IAdminCommandHandler
case admin_gmliston:
{
GmListTable.getInstance().showGm(activeChar);
activeChar.sendMessage("Registerd into gm list");
BuilderUtil.sendSysMessage(activeChar, "Registerd into gm list");
return true;
}
case admin_gmlistoff:
{
GmListTable.getInstance().hideGm(activeChar);
activeChar.sendMessage("Removed from gm list");
BuilderUtil.sendSysMessage(activeChar, "Removed from gm list");
return true;
}
case admin_silence:
@ -131,7 +132,7 @@ public class AdminAdmin implements IAdminCommandHandler
case admin_saveolymp:
{
Olympiad.getInstance().saveOlympiadStatus();
activeChar.sendMessage("Olympiad stuff saved!");
BuilderUtil.sendSysMessage(activeChar, "Olympiad stuff saved!");
return true;
}
case admin_manualhero:
@ -144,7 +145,7 @@ public class AdminAdmin implements IAdminCommandHandler
{
e.printStackTrace();
}
activeChar.sendMessage("Heroes formed!");
BuilderUtil.sendSysMessage(activeChar, "Heroes formed!");
return true;
}
case admin_diet:
@ -155,12 +156,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");
}
}
else
@ -172,12 +173,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");
}
}
activeChar.refreshOverloaded();
@ -198,7 +199,7 @@ public class AdminAdmin implements IAdminCommandHandler
String pValue = parameter[1].trim();
if (Float.valueOf(pValue) == null)
{
activeChar.sendMessage("Invalid parameter!");
BuilderUtil.sendSysMessage(activeChar, "Invalid parameter!");
return false;
}
switch (pName)
@ -219,7 +220,7 @@ public class AdminAdmin implements IAdminCommandHandler
break;
}
}
activeChar.sendMessage("Config parameter " + pName + " set to " + pValue);
BuilderUtil.sendSysMessage(activeChar, "Config parameter " + pName + " set to " + pValue);
}
else
{
@ -246,7 +247,7 @@ public class AdminAdmin implements IAdminCommandHandler
if (no_token)
{
activeChar.sendMessage("Usage: //set parameter=vaue");
BuilderUtil.sendSysMessage(activeChar, "Usage: //set parameter=vaue");
return false;
}

View File

@ -28,6 +28,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.EtcStatusUpdate;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* Give / Take Status Aio to Player Changes name color and title color if enabled Uses: setaio [<player_name>] [<time_duration in days>] removeaio [<player_name>] If <player_name> is not specified, the current target player is used.
@ -93,13 +94,13 @@ public class AdminAio implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Time must be bigger then 0!");
BuilderUtil.sendSysMessage(activeChar, "Time must be bigger then 0!");
return false;
}
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Time must be a number!");
BuilderUtil.sendSysMessage(activeChar, "Time must be a number!");
return false;
}
}
@ -110,7 +111,7 @@ public class AdminAio implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Player must be online to set AIO status");
BuilderUtil.sendSysMessage(activeChar, "Player must be online to set AIO status");
no_token = true;
}
}
@ -120,7 +121,7 @@ public class AdminAio implements IAdminCommandHandler
}
if (no_token)
{
activeChar.sendMessage("Usage: //setaio <char_name> [time](in days)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setaio <char_name> [time](in days)");
return false;
}
}
@ -141,7 +142,7 @@ public class AdminAio implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Player must be online to remove AIO status");
BuilderUtil.sendSysMessage(activeChar, "Player must be online to remove AIO status");
no_token = true;
}
}
@ -151,7 +152,7 @@ public class AdminAio implements IAdminCommandHandler
}
if (no_token)
{
activeChar.sendMessage("Usage: //removeaio <char_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //removeaio <char_name>");
return false;
}
}
@ -165,7 +166,7 @@ public class AdminAio implements IAdminCommandHandler
final int days = Integer.parseInt(_time);
if (_player == null)
{
activeChar.sendMessage("not found char" + _playername);
BuilderUtil.sendSysMessage(activeChar, "not found char" + _playername);
return;
}

View File

@ -27,6 +27,7 @@ import com.l2jmobius.gameserver.model.entity.Announcements;
import com.l2jmobius.gameserver.network.clientpackets.Say2;
import com.l2jmobius.gameserver.network.serverpackets.CreatureSay;
import com.l2jmobius.gameserver.util.Broadcast;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands: - announce text = announces text to all players - list_announcements = show menu - reload_announcements = reloads announcements from txt file - announce_announcements = announce all stored announcements to all players - add_announcement text = adds
@ -139,7 +140,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
Announcements.getInstance().listAnnouncements(activeChar);
return true;
}
activeChar.sendMessage("You cannot announce Empty message");
BuilderUtil.sendSysMessage(activeChar, "You cannot announce Empty message");
return false;
}
case admin_del_announcement:
@ -153,7 +154,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //del_announcement <index> (number >=0)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //del_announcement <index> (number >=0)");
}
}
if (index >= 0)
@ -162,7 +163,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
Announcements.getInstance().listAnnouncements(activeChar);
return true;
}
activeChar.sendMessage("Usage: //del_announcement <index> (number >=0)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //del_announcement <index> (number >=0)");
return false;
}
case admin_announce:
@ -202,7 +203,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //add_autoannouncement <delay> (Seconds > 30) <Announcements>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //add_autoannouncement <delay> (Seconds > 30) <Announcements>");
return false;
}
if (st.hasMoreTokens())
@ -218,13 +219,13 @@ public class AdminAnnouncements implements IAdminCommandHandler
AutoAnnouncementHandler.getInstance().listAutoAnnouncements(activeChar);
return true;
}
activeChar.sendMessage("Usage: //add_autoannouncement <delay> (Seconds > 30) <Announcements>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //add_autoannouncement <delay> (Seconds > 30) <Announcements>");
return false;
}
activeChar.sendMessage("Usage: //add_autoannouncement <delay> (Seconds > 30) <Announcements>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //add_autoannouncement <delay> (Seconds > 30) <Announcements>");
return false;
}
activeChar.sendMessage("Usage: //add_autoannouncement <delay> (Seconds > 30) <Announcements>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //add_autoannouncement <delay> (Seconds > 30) <Announcements>");
return false;
}
case admin_del_autoannouncement:
@ -237,7 +238,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //del_autoannouncement <index> (number >= 0)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //del_autoannouncement <index> (number >= 0)");
return false;
}
if (index >= 0)
@ -247,13 +248,13 @@ public class AdminAnnouncements implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //del_autoannouncement <index> (number >= 0)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //del_autoannouncement <index> (number >= 0)");
return false;
}
}
else
{
activeChar.sendMessage("Usage: //del_autoannouncement <index> (number >= 0)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //del_autoannouncement <index> (number >= 0)");
return false;
}
}

View File

@ -29,6 +29,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.ServerClose;
import com.l2jmobius.gameserver.thread.LoginServerThread;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.GMAudit;
/**
@ -76,7 +77,7 @@ public class AdminBan implements IAdminCommandHandler
}
catch (NumberFormatException nfe)
{
activeChar.sendMessage("Invalid number format used: " + nfe);
BuilderUtil.sendSysMessage(activeChar, "Invalid number format used: " + nfe);
return false;
}
}
@ -94,7 +95,7 @@ public class AdminBan implements IAdminCommandHandler
if (command.startsWith("admin_ban ") || command.equalsIgnoreCase("admin_ban"))
{
activeChar.sendMessage("Available ban commands: //ban_acc, //ban_char, //ban_chat");
BuilderUtil.sendSysMessage(activeChar, "Available ban commands: //ban_acc, //ban_char, //ban_chat");
return false;
}
else if (command.startsWith("admin_ban_acc"))
@ -103,19 +104,19 @@ public class AdminBan implements IAdminCommandHandler
if ((targetPlayer == null) && player.equals(""))
{
activeChar.sendMessage("Usage: //ban_acc <account_name> (if none, target char's account gets banned)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ban_acc <account_name> (if none, target char's account gets banned)");
return false;
}
else if (targetPlayer == null)
{
LoginServerThread.getInstance().sendAccessLevel(player, -100);
activeChar.sendMessage("Ban request sent for account " + player);
BuilderUtil.sendSysMessage(activeChar, "Ban request sent for account " + player);
auditAction(command, activeChar, player);
}
else
{
targetPlayer.setPunishLevel(L2PcInstance.PunishLevel.ACC, 0);
activeChar.sendMessage("Account " + targetPlayer.getAccountName() + " banned.");
BuilderUtil.sendSysMessage(activeChar, "Account " + targetPlayer.getAccountName() + " banned.");
auditAction(command, activeChar, targetPlayer.getAccountName());
}
}
@ -123,7 +124,7 @@ public class AdminBan implements IAdminCommandHandler
{
if ((targetPlayer == null) && player.equals(""))
{
activeChar.sendMessage("Usage: //ban_char <char_name> (if none, target char is banned)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ban_char <char_name> (if none, target char is banned)");
return false;
}
auditAction(command, activeChar, (targetPlayer == null ? player : targetPlayer.getName()));
@ -133,7 +134,7 @@ public class AdminBan implements IAdminCommandHandler
{
if ((targetPlayer == null) && player.equals(""))
{
activeChar.sendMessage("Usage: //banchat <char_name> [penalty_minutes]");
BuilderUtil.sendSysMessage(activeChar, "Usage: //banchat <char_name> [penalty_minutes]");
return false;
}
if (targetPlayer != null)
@ -163,7 +164,7 @@ public class AdminBan implements IAdminCommandHandler
{
if ((targetPlayer == null) && player.equals(""))
{
activeChar.sendMessage("Usage: //unbanchat <char_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //unbanchat <char_name>");
return false;
}
if (targetPlayer != null)
@ -187,7 +188,7 @@ public class AdminBan implements IAdminCommandHandler
}
else if (command.startsWith("admin_unban ") || command.equalsIgnoreCase("admin_unban"))
{
activeChar.sendMessage("Available unban commands: //unban_acc, //unban_char, //unban_chat");
BuilderUtil.sendSysMessage(activeChar, "Available unban commands: //unban_acc, //unban_char, //unban_chat");
return false;
}
else if (command.startsWith("admin_unban_acc"))
@ -202,12 +203,12 @@ public class AdminBan implements IAdminCommandHandler
else if (!player.equals(""))
{
LoginServerThread.getInstance().sendAccessLevel(player, 0);
activeChar.sendMessage("Unban request sent for account " + player);
BuilderUtil.sendSysMessage(activeChar, "Unban request sent for account " + player);
auditAction(command, activeChar, player);
}
else
{
activeChar.sendMessage("Usage: //unban_acc <account_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //unban_acc <account_name>");
return false;
}
}
@ -215,7 +216,7 @@ public class AdminBan implements IAdminCommandHandler
{
if ((targetPlayer == null) && player.equals(""))
{
activeChar.sendMessage("Usage: //unban_char <char_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //unban_char <char_name>");
return false;
}
else if (targetPlayer != null)
@ -233,13 +234,13 @@ public class AdminBan implements IAdminCommandHandler
{
if ((targetPlayer == null) && player.equals(""))
{
activeChar.sendMessage("Usage: //jail <charname> [penalty_minutes] (if no name is given, selected target is jailed indefinitely)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //jail <charname> [penalty_minutes] (if no name is given, selected target is jailed indefinitely)");
return false;
}
if (targetPlayer != null)
{
targetPlayer.setPunishLevel(L2PcInstance.PunishLevel.JAIL, duration);
activeChar.sendMessage("Character " + targetPlayer.getName() + " jailed for " + (duration > 0 ? duration + " minutes." : "ever!"));
BuilderUtil.sendSysMessage(activeChar, "Character " + targetPlayer.getName() + " jailed for " + (duration > 0 ? duration + " minutes." : "ever!"));
auditAction(command, activeChar, targetPlayer.getName());
if (targetPlayer.getParty() != null)
@ -257,13 +258,13 @@ public class AdminBan implements IAdminCommandHandler
{
if ((targetPlayer == null) && player.equals(""))
{
activeChar.sendMessage("Usage: //unjail <charname> (If no name is given target is used)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //unjail <charname> (If no name is given target is used)");
return false;
}
else if (targetPlayer != null)
{
targetPlayer.setPunishLevel(L2PcInstance.PunishLevel.NONE, 0);
activeChar.sendMessage("Character " + targetPlayer.getName() + " removed from jail");
BuilderUtil.sendSysMessage(activeChar, "Character " + targetPlayer.getName() + " removed from jail");
auditAction(command, activeChar, targetPlayer.getName());
}
else
@ -315,20 +316,20 @@ public class AdminBan implements IAdminCommandHandler
if (count == 0)
{
activeChar.sendMessage("Character not found!");
BuilderUtil.sendSysMessage(activeChar, "Character not found!");
}
else if (ban)
{
activeChar.sendMessage("Character " + name + " chat-banned for " + (delay > 0 ? delay + " minutes." : "ever!"));
BuilderUtil.sendSysMessage(activeChar, "Character " + name + " chat-banned for " + (delay > 0 ? delay + " minutes." : "ever!"));
}
else
{
activeChar.sendMessage("Character " + name + "'s chat-banned lifted");
BuilderUtil.sendSysMessage(activeChar, "Character " + name + "'s chat-banned lifted");
}
}
catch (SQLException se)
{
activeChar.sendMessage("SQLException while chat-banning player");
BuilderUtil.sendSysMessage(activeChar, "SQLException while chat-banning player");
if (Config.DEBUG)
{
se.printStackTrace();
@ -354,16 +355,16 @@ public class AdminBan implements IAdminCommandHandler
if (count == 0)
{
activeChar.sendMessage("Character not found!");
BuilderUtil.sendSysMessage(activeChar, "Character not found!");
}
else
{
activeChar.sendMessage("Character " + name + " jailed for " + (delay > 0 ? delay + " minutes." : "ever!"));
BuilderUtil.sendSysMessage(activeChar, "Character " + name + " jailed for " + (delay > 0 ? delay + " minutes." : "ever!"));
}
}
catch (SQLException se)
{
activeChar.sendMessage("SQLException while jailing player");
BuilderUtil.sendSysMessage(activeChar, "SQLException while jailing player");
if (Config.DEBUG)
{
se.printStackTrace();
@ -387,16 +388,16 @@ public class AdminBan implements IAdminCommandHandler
statement.close();
if (count == 0)
{
activeChar.sendMessage("Character not found!");
BuilderUtil.sendSysMessage(activeChar, "Character not found!");
}
else
{
activeChar.sendMessage("Character " + name + " removed from jail");
BuilderUtil.sendSysMessage(activeChar, "Character " + name + " removed from jail");
}
}
catch (SQLException se)
{
activeChar.sendMessage("SQLException while jailing player");
BuilderUtil.sendSysMessage(activeChar, "SQLException while jailing player");
if (Config.DEBUG)
{
se.printStackTrace();
@ -432,7 +433,7 @@ public class AdminBan implements IAdminCommandHandler
targetPlayer.deleteMe();
activeChar.sendMessage("The character " + targetPlayer.getName() + " has now been banned.");
BuilderUtil.sendSysMessage(activeChar, "The character " + targetPlayer.getName() + " has now been banned.");
output = true;
}
@ -448,7 +449,7 @@ public class AdminBan 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
{
@ -458,7 +459,7 @@ public class AdminBan implements IAdminCommandHandler
}
catch (SQLException se)
{
activeChar.sendMessage("SQLException while changing character's access level");
BuilderUtil.sendSysMessage(activeChar, "SQLException while changing character's access level");
if (Config.DEBUG)
{
se.printStackTrace();

View File

@ -24,6 +24,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.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* @author ProGramMoS
@ -78,7 +79,7 @@ public class AdminBuffs implements IAdminCommandHandler
showBuffs(player, activeChar);
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() instanceof L2PcInstance))
@ -105,7 +106,7 @@ public class AdminBuffs implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //stopbuff <playername> [skillId] (skillId must be a number)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //stopbuff <playername> [skillId] (skillId must be a number)");
return false;
}
if (SkillId > 0)
@ -114,15 +115,15 @@ public class AdminBuffs implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //stopbuff <playername> [skillId] (skillId must be a number > 0)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //stopbuff <playername> [skillId] (skillId must be a number > 0)");
return false;
}
return true;
}
activeChar.sendMessage("Usage: //stopbuff <playername> [skillId]");
BuilderUtil.sendSysMessage(activeChar, "Usage: //stopbuff <playername> [skillId]");
return false;
}
activeChar.sendMessage("Usage: //stopbuff <playername> [skillId]");
BuilderUtil.sendSysMessage(activeChar, "Usage: //stopbuff <playername> [skillId]");
return false;
}
case admin_stopallbuffs:
@ -135,10 +136,10 @@ public class AdminBuffs implements IAdminCommandHandler
removeAllBuffs(activeChar, playername);
return true;
}
activeChar.sendMessage("Usage: //stopallbuffs <playername>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //stopallbuffs <playername>");
return false;
}
activeChar.sendMessage("Usage: //stopallbuffs <playername>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //stopallbuffs <playername>");
return false;
}
case admin_areacancel:
@ -153,7 +154,7 @@ public class AdminBuffs implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //areacancel <radius> (integer value > 0)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //areacancel <radius> (integer value > 0)");
return false;
}
if (radius > 0)
@ -165,13 +166,13 @@ public class AdminBuffs implements IAdminCommandHandler
knownChar.stopAllEffects();
}
}
activeChar.sendMessage("All effects canceled within raidus " + radius);
BuilderUtil.sendSysMessage(activeChar, "All effects canceled within raidus " + radius);
return true;
}
activeChar.sendMessage("Usage: //areacancel <radius> (integer value > 0)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //areacancel <radius> (integer value > 0)");
return false;
}
activeChar.sendMessage("Usage: //areacancel <radius>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //areacancel <radius>");
return false;
}
}

View File

@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.position.Location;
import com.l2jmobius.gameserver.model.entity.event.CTF;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
public class AdminCTFEngine implements IAdminCommandHandler
{
@ -141,10 +142,10 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
return false;
}
activeChar.sendMessage("Usage: //ctf_name <event_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_name <event_name>");
return false;
}
case admin_ctf_desc:
@ -156,10 +157,10 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
return false;
}
activeChar.sendMessage("Usage: //ctf_desc <event_descr>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_desc <event_descr>");
return false;
}
case admin_ctf_join_loc:
@ -171,10 +172,10 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
return false;
}
activeChar.sendMessage("Usage: //ctf_join_loc <event_loc_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_join_loc <event_loc_name>");
return false;
}
case admin_ctf_edit:
@ -199,12 +200,12 @@ public class AdminCTFEngine implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //ctf_minlvl <min_lvl_value>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_minlvl <min_lvl_value>");
return false;
}
if (!CTF.checkMinLevel(lvl))
{
activeChar.sendMessage("Cannot perform requested operation, Min lvl must be lower then Max");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, Min lvl must be lower then Max");
return false;
}
if (CTF.set_minlvl(lvl))
@ -212,10 +213,10 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
return false;
}
activeChar.sendMessage("Usage: //ctf_minlvl <min_lvl_value>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_minlvl <min_lvl_value>");
return false;
}
case admin_ctf_maxlvl:
@ -230,12 +231,12 @@ public class AdminCTFEngine implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //ctf_maxlvl <max_lvl_value>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_maxlvl <max_lvl_value>");
return false;
}
if (!CTF.checkMaxLevel(lvl))
{
activeChar.sendMessage("Cannot perform requested operation, Max lvl must be higher then Min");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, Max lvl must be higher then Min");
return false;
}
if (CTF.set_maxlvl(lvl))
@ -243,10 +244,10 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
return false;
}
activeChar.sendMessage("Usage: //ctf_maxlvl <min_lvl_value>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_maxlvl <min_lvl_value>");
return false;
}
case admin_ctf_tele_npc:
@ -267,11 +268,11 @@ public class AdminCTFEngine implements IAdminCommandHandler
return true;
}
}
activeChar.sendMessage("Usage: //ctf_tele_team <team_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_tele_team <team_name>");
showMainPage(activeChar);
return false;
}
activeChar.sendMessage("Usage: //ctf_tele_team <team_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_tele_team <team_name>");
return false;
}
case admin_ctf_tele_flag:
@ -287,11 +288,11 @@ public class AdminCTFEngine implements IAdminCommandHandler
return true;
}
}
activeChar.sendMessage("Usage: //ctf_tele_flag <team_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_tele_flag <team_name>");
showMainPage(activeChar);
return false;
}
activeChar.sendMessage("Usage: //ctf_tele_flag <team_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_tele_flag <team_name>");
return false;
}
case admin_ctf_npc:
@ -305,7 +306,7 @@ public class AdminCTFEngine implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //ctf_npc <npc_id>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_npc <npc_id>");
return false;
}
if (CTF.set_npcId(id))
@ -313,10 +314,10 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
return false;
}
activeChar.sendMessage("Usage: //ctf_npc <npc_id>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_npc <npc_id>");
return false;
}
case admin_ctf_npc_pos:
@ -336,7 +337,7 @@ public class AdminCTFEngine implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //ctf_reward <reward_id>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_reward <reward_id>");
return false;
}
if (CTF.set_rewardId(id))
@ -344,10 +345,10 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
return false;
}
activeChar.sendMessage("Usage: //ctf_reward <reward_id>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_reward <reward_id>");
return false;
}
case admin_ctf_reward_amount:
@ -361,7 +362,7 @@ public class AdminCTFEngine implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //ctf_reward_amount <reward_amount>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_reward_amount <reward_amount>");
return false;
}
if (CTF.set_rewardAmount(amount))
@ -369,10 +370,10 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
return false;
}
activeChar.sendMessage("Usage: //ctf_reward_amount <reward_amount>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_reward_amount <reward_amount>");
return false;
}
case admin_ctf_team_add:
@ -383,7 +384,7 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Usage: //ctf_team_add <team_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_team_add <team_name>");
return false;
}
case admin_ctf_team_remove:
@ -394,7 +395,7 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Usage: //ctf_team_remove <team_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_team_remove <team_name>");
return false;
}
case admin_ctf_team_pos:
@ -405,7 +406,7 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Usage: //ctf_team_pos <team_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_team_pos <team_name>");
return false;
}
case admin_ctf_team_color:
@ -420,7 +421,7 @@ public class AdminCTFEngine implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //ctf_team_color <colorHex> <teamName>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_team_color <colorHex> <teamName>");
return false;
}
final String team = st.nextToken();
@ -428,7 +429,7 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Usage: //ctf_team_color <colorHex> <teamName>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_team_color <colorHex> <teamName>");
return false;
}
case admin_ctf_team_flag:
@ -439,7 +440,7 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Usage: //ctf_team_flag <teamName>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_team_flag <teamName>");
return false;
}
case admin_ctf_join:
@ -449,7 +450,7 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Cannot startJoin, check LOGGER for info..");
BuilderUtil.sendSysMessage(activeChar, "Cannot startJoin, check LOGGER for info..");
return false;
}
case admin_ctf_teleport:
@ -465,7 +466,7 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Cannot startEvent, check LOGGER for info..");
BuilderUtil.sendSysMessage(activeChar, "Cannot startEvent, check LOGGER for info..");
return false;
}
case admin_ctf_startevent:
@ -476,7 +477,7 @@ public class AdminCTFEngine implements IAdminCommandHandler
}
case admin_ctf_abort:
{
activeChar.sendMessage("Aborting event");
BuilderUtil.sendSysMessage(activeChar, "Aborting event");
CTF.abortEvent();
showMainPage(activeChar);
return true;
@ -522,7 +523,7 @@ public class AdminCTFEngine implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //ctf_jointime <minutes>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_jointime <minutes>");
return false;
}
if (CTF.set_joinTime(time))
@ -530,10 +531,10 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
return false;
}
activeChar.sendMessage("Usage: //ctf_jointime <minutes>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_jointime <minutes>");
return false;
}
case admin_ctf_eventtime:
@ -548,7 +549,7 @@ public class AdminCTFEngine implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //ctf_eventtime <minutes>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_eventtime <minutes>");
return false;
}
if (CTF.set_eventTime(time))
@ -556,10 +557,10 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
return false;
}
activeChar.sendMessage("Usage: //ctf_eventtime <minutes>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_eventtime <minutes>");
return false;
}
case admin_ctf_autoevent:
@ -570,7 +571,7 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Cannot perform requested operation, times not defined");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, times not defined");
return false;
}
case admin_ctf_interval:
@ -585,7 +586,7 @@ public class AdminCTFEngine implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //ctf_interval <minutes>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_interval <minutes>");
return false;
}
if (CTF.set_intervalBetweenMatches(time))
@ -593,10 +594,10 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
return false;
}
activeChar.sendMessage("Usage: //ctf_interval <minutes>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_interval <minutes>");
return false;
}
case admin_ctf_minplayers:
@ -611,7 +612,7 @@ public class AdminCTFEngine implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //ctf_minplayers <number>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_minplayers <number>");
return false;
}
if (CTF.set_minPlayers(min))
@ -619,10 +620,10 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
return false;
}
activeChar.sendMessage("Usage: //ctf_minplayers <number>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_minplayers <number>");
return false;
}
case admin_ctf_maxplayers:
@ -637,7 +638,7 @@ public class AdminCTFEngine implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //ctf_maxplayers <number>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_maxplayers <number>");
return false;
}
if (CTF.set_maxPlayers(max))
@ -645,10 +646,10 @@ public class AdminCTFEngine implements IAdminCommandHandler
showMainPage(activeChar);
return true;
}
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
return false;
}
activeChar.sendMessage("Usage: //ctf_maxplayers <number>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //ctf_maxplayers <number>");
return false;
}
default:

View File

@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.cache.CrestCache;
import com.l2jmobius.gameserver.cache.HtmCache;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* @author Layanere
@ -75,7 +76,7 @@ public class AdminCache implements IAdminCommandHandler
case admin_cache_htm_rebuild:
{
HtmCache.getInstance().reload(Config.DATAPACK_ROOT);
activeChar.sendMessage("Cache[HTML]: " + HtmCache.getInstance().getMemoryUsage() + " MB on " + HtmCache.getInstance().getLoadedFiles() + " file(s) loaded.");
BuilderUtil.sendSysMessage(activeChar, "Cache[HTML]: " + HtmCache.getInstance().getMemoryUsage() + " MB on " + HtmCache.getInstance().getLoadedFiles() + " file(s) loaded.");
return true;
}
case admin_cache_reload_path:
@ -84,10 +85,10 @@ public class AdminCache implements IAdminCommandHandler
{
final String path = st.nextToken();
HtmCache.getInstance().reloadPath(new File(Config.DATAPACK_ROOT, path));
activeChar.sendMessage("Cache[HTML]: " + HtmCache.getInstance().getMemoryUsage() + " MB in " + HtmCache.getInstance().getLoadedFiles() + " file(s) loaded.");
BuilderUtil.sendSysMessage(activeChar, "Cache[HTML]: " + HtmCache.getInstance().getMemoryUsage() + " MB in " + HtmCache.getInstance().getLoadedFiles() + " file(s) loaded.");
return true;
}
activeChar.sendMessage("Usage: //cache_reload_path <path>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //cache_reload_path <path>");
return false;
}
case admin_cache_reload_file:
@ -97,28 +98,28 @@ public class AdminCache implements IAdminCommandHandler
String path = st.nextToken();
if (HtmCache.getInstance().loadFile(new File(Config.DATAPACK_ROOT, path)) != null)
{
activeChar.sendMessage("Cache[HTML]: file was loaded");
BuilderUtil.sendSysMessage(activeChar, "Cache[HTML]: file was loaded");
}
else
{
activeChar.sendMessage("Cache[HTML]: file can't be loaded");
BuilderUtil.sendSysMessage(activeChar, "Cache[HTML]: file can't be loaded");
}
return true;
}
activeChar.sendMessage("Usage: //cache_reload_file <relative_path/file>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //cache_reload_file <relative_path/file>");
return false;
}
case admin_cache_crest_rebuild:
case admin_cache_crest_reload:
{
CrestCache.getInstance().reload();
activeChar.sendMessage("Cache[Crest]: " + String.format("%.3f", CrestCache.getInstance().getMemoryUsage()) + " megabytes on " + CrestCache.getInstance().getLoadedFiles() + " files loaded");
BuilderUtil.sendSysMessage(activeChar, "Cache[Crest]: " + String.format("%.3f", CrestCache.getInstance().getMemoryUsage()) + " megabytes on " + CrestCache.getInstance().getLoadedFiles() + " files loaded");
return true;
}
case admin_cache_crest_fix:
{
CrestCache.getInstance().convertOldPedgeFiles();
activeChar.sendMessage("Cache[Crest]: crests fixed");
BuilderUtil.sendSysMessage(activeChar, "Cache[Crest]: crests fixed");
return true;
}
default:

View File

@ -19,6 +19,7 @@ package com.l2jmobius.gameserver.handler.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;
/**
* <b>This class handles Access Level Management commands:</b><br>
@ -64,7 +65,7 @@ public class AdminChangeAccessLevel implements IAdminCommandHandler
if (activeChar.getTarget() instanceof L2PcInstance)
{
((L2PcInstance) activeChar.getTarget()).setAccessLevel(lvl);
activeChar.sendMessage("You have changed the access level of player " + activeChar.getTarget().getName() + " to " + lvl + " .");
BuilderUtil.sendSysMessage(activeChar, "You have changed the access level of player " + activeChar.getTarget().getName() + " to " + lvl + " .");
}
}
else if (parts.length == 3)
@ -76,7 +77,7 @@ public class AdminChangeAccessLevel implements IAdminCommandHandler
if (player != null)
{
player.setAccessLevel(lvl);
activeChar.sendMessage("You have changed the access level of player " + activeChar.getTarget().getName() + " to " + lvl + " .");
BuilderUtil.sendSysMessage(activeChar, "You have changed the access level of player " + activeChar.getTarget().getName() + " to " + lvl + " .");
}
}
}

View File

@ -30,6 +30,7 @@ import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
import com.l2jmobius.gameserver.network.serverpackets.ItemList;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.templates.item.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.
@ -84,7 +85,7 @@ public class AdminCreateItem implements IAdminCommandHandler
// Command usable only by Administrator
if ((activeChar.getAccessLevel().getLevel() != 1) || !activeChar.isGM())
{
activeChar.sendMessage("Only Administrators can use this command!");
BuilderUtil.sendSysMessage(activeChar, "Only Administrators can use this command!");
return false;
}
L2PcInstance Player = null;
@ -121,7 +122,7 @@ public class AdminCreateItem implements IAdminCommandHandler
Player.getInventory().addItem("Admin", 8874, 10, Player, activeChar); // Einhasad's Holy Water
final ItemList il = new ItemList(Player, true);
Player.sendPacket(il);
activeChar.sendMessage("Items added successfully!");
BuilderUtil.sendSysMessage(activeChar, "Items added successfully!");
activeChar.addSkill(SkillTable.getInstance().getInfo(7029, 4), true);
activeChar.addSkill(SkillTable.getInstance().getInfo(7041, 1), true);
activeChar.addSkill(SkillTable.getInstance().getInfo(7042, 1), true);
@ -150,7 +151,7 @@ public class AdminCreateItem implements IAdminCommandHandler
activeChar.addSkill(SkillTable.getInstance().getInfo(7063, 1), true);
activeChar.addSkill(SkillTable.getInstance().getInfo(7064, 1), true);
activeChar.sendSkillList();
activeChar.sendMessage("Gm skills added successfully!");
BuilderUtil.sendSysMessage(activeChar, "Gm skills added successfully!");
return true;
}
case admin_itemcreate:
@ -175,7 +176,7 @@ public class AdminCreateItem implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //itemcreate <itemId> (number value > 0) [amount] (number value > 0)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //itemcreate <itemId> (number value > 0) [amount] (number value > 0)");
return false;
}
if ((idval > 0) && (numval > 0))
@ -183,7 +184,7 @@ public class AdminCreateItem implements IAdminCommandHandler
createItem(activeChar, idval, numval);
return true;
}
activeChar.sendMessage("Usage: //itemcreate <itemId> (number value > 0) [amount] (number value > 0)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //itemcreate <itemId> (number value > 0) [amount] (number value > 0)");
return false;
}
else if (st.countTokens() == 1)
@ -196,7 +197,7 @@ public class AdminCreateItem implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //itemcreate <itemId> (number value > 0) [amount] (number value > 0)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //itemcreate <itemId> (number value > 0) [amount] (number value > 0)");
return false;
}
if (idval > 0)
@ -204,14 +205,14 @@ public class AdminCreateItem implements IAdminCommandHandler
createItem(activeChar, idval, 1);
return true;
}
activeChar.sendMessage("Usage: //itemcreate <itemId> (number value > 0) [amount] (number value > 0)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //itemcreate <itemId> (number value > 0) [amount] (number value > 0)");
return false;
}
}
else
{
AdminHelpPage.showHelpPage(activeChar, "itemcreation.htm");
// activeChar.sendMessage("Usage: //itemcreate <itemId> [amount]");
// BuilderUtil.sendSysMessage(activeChar, "Usage: //itemcreate <itemId> [amount]");
return true;
}
return false;
@ -233,7 +234,7 @@ public class AdminCreateItem implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //mass_create <itemId> <amount>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //mass_create <itemId> <amount>");
return false;
}
if ((idval > 0) && (numval > 0))
@ -241,7 +242,7 @@ public class AdminCreateItem implements IAdminCommandHandler
massCreateItem(activeChar, idval, numval);
return true;
}
activeChar.sendMessage("Usage: //mass_create <itemId> <amount>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //mass_create <itemId> <amount>");
return false;
}
else if (st.countTokens() == 1)
@ -254,7 +255,7 @@ public class AdminCreateItem implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //mass_create <itemId> <amount>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //mass_create <itemId> <amount>");
return false;
}
if (idval > 0)
@ -262,7 +263,7 @@ public class AdminCreateItem implements IAdminCommandHandler
massCreateItem(activeChar, idval, 1);
return true;
}
activeChar.sendMessage("Usage: //mass_create <itemId> <amount>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //mass_create <itemId> <amount>");
return false;
}
}
@ -294,7 +295,7 @@ public class AdminCreateItem implements IAdminCommandHandler
if ((template != null) && !template.isStackable())
{
activeChar.sendMessage("This item does not stack - Creation aborted.");
BuilderUtil.sendSysMessage(activeChar, "This item does not stack - Creation aborted.");
return;
}
}
@ -311,13 +312,13 @@ public class AdminCreateItem implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("You have not right to create item on another player");
BuilderUtil.sendSysMessage(activeChar, "You have not right to create item on another player");
return;
}
}
else
{
activeChar.sendMessage("You can add an item only to a character.");
BuilderUtil.sendSysMessage(activeChar, "You can add an item only to a character.");
return;
}
}
@ -333,11 +334,11 @@ public class AdminCreateItem implements IAdminCommandHandler
Player.sendPacket(il);
if (activeChar.getName().equalsIgnoreCase(Player.getName()))
{
activeChar.sendMessage("You have spawned " + num + " item(s) number " + id + " in your inventory.");
BuilderUtil.sendSysMessage(activeChar, "You have spawned " + num + " item(s) number " + id + " in your inventory.");
}
else
{
activeChar.sendMessage("You have spawned " + num + " item(s) number " + id + " in " + Player.getName() + "'s inventory.");
BuilderUtil.sendSysMessage(activeChar, "You have spawned " + num + " item(s) number " + id + " in " + Player.getName() + "'s inventory.");
Player.sendMessage("Admin has spawned " + num + " item(s) number " + id + " in your inventory.");
}
}
@ -349,7 +350,7 @@ public class AdminCreateItem implements IAdminCommandHandler
final L2Item template = ItemTable.getInstance().getTemplate(id);
if ((template != null) && !template.isStackable())
{
activeChar.sendMessage("This item does not stack - Creation aborted.");
BuilderUtil.sendSysMessage(activeChar, "This item does not stack - Creation aborted.");
return;
}
}
@ -369,7 +370,7 @@ public class AdminCreateItem implements IAdminCommandHandler
player.sendPacket(sm);
i++;
}
activeChar.sendMessage("Mass-created items in the inventory of " + i + " player(s).");
BuilderUtil.sendSysMessage(activeChar, "Mass-created items in the inventory of " + i + " player(s).");
LOGGER.info("GM " + activeChar.getName() + " mass_created item Id: " + id + " (" + num + ")");
}
@ -383,6 +384,6 @@ public class AdminCreateItem implements IAdminCommandHandler
}
}
activeChar.sendPacket(new ItemList(activeChar, false));
activeChar.sendMessage("Your inventory has been cleared.");
BuilderUtil.sendSysMessage(activeChar, "Your inventory has been cleared.");
}
}

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:<br>
@ -57,29 +58,29 @@ public class AdminCursedWeapons implements IAdminCommandHandler
if (command.equalsIgnoreCase("admin_cw_info"))
{
activeChar.sendMessage("====== Cursed Weapons: ======");
BuilderUtil.sendSysMessage(activeChar, "====== Cursed Weapons: ======");
for (CursedWeapon cw : cursedWeaponsManager.getCursedWeapons())
{
activeChar.sendMessage("> " + cw.getName() + " (" + cw.getItemId() + ")");
BuilderUtil.sendSysMessage(activeChar, "> " + cw.getName() + " (" + cw.getItemId() + ")");
if (cw.isActivated())
{
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.FRIEND_LIST_FOOT);
@ -135,7 +136,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
{
if (!st.hasMoreElements())
{
activeChar.sendMessage("Not enough parameters!");
BuilderUtil.sendSysMessage(activeChar, "Not enough parameters!");
return false;
}
@ -164,14 +165,14 @@ public class AdminCursedWeapons implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Wrong Cursed Weapon Id!");
BuilderUtil.sendSysMessage(activeChar, "Wrong Cursed Weapon Id!");
}
}
else if (command.startsWith("admin_cw_goto"))
{
if (!st.hasMoreElements())
{
activeChar.sendMessage("Not enough parameters!");
BuilderUtil.sendSysMessage(activeChar, "Not enough parameters!");
return false;
}
@ -200,14 +201,14 @@ public class AdminCursedWeapons implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Wrong Cursed Weapon Id!");
BuilderUtil.sendSysMessage(activeChar, "Wrong Cursed Weapon Id!");
}
}
else if (command.startsWith("admin_cw_add"))
{
if (!st.hasMoreElements())
{
activeChar.sendMessage("Not enough parameters!");
BuilderUtil.sendSysMessage(activeChar, "Not enough parameters!");
return false;
}
@ -236,7 +237,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
final CursedWeapon cursedWeapon = cursedWeaponsManager.getCursedWeapon(id);
if (cursedWeapon.isActive())
{
activeChar.sendMessage("This Cursed Weapon is already active!");
BuilderUtil.sendSysMessage(activeChar, "This Cursed Weapon is already active!");
}
else
{
@ -257,7 +258,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Wrong Cursed Weapon Id!");
BuilderUtil.sendSysMessage(activeChar, "Wrong Cursed Weapon Id!");
}
}
return true;

View File

@ -21,6 +21,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.position.Location;
import com.l2jmobius.gameserver.model.entity.event.DM;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
public class AdminDMEngine implements IAdminCommandHandler
{
@ -70,7 +71,7 @@ public class AdminDMEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
@ -83,7 +84,7 @@ public class AdminDMEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
@ -101,7 +102,7 @@ public class AdminDMEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
@ -119,7 +120,7 @@ public class AdminDMEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
@ -132,7 +133,7 @@ public class AdminDMEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
@ -145,7 +146,7 @@ public class AdminDMEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
@ -164,7 +165,7 @@ public class AdminDMEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
@ -177,7 +178,7 @@ public class AdminDMEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
@ -196,7 +197,7 @@ public class AdminDMEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
@ -209,7 +210,7 @@ public class AdminDMEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot startJoin, check LOGGER for info..");
BuilderUtil.sendSysMessage(activeChar, "Cannot startJoin, check LOGGER for info..");
}
}
@ -227,7 +228,7 @@ public class AdminDMEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot startEvent, check LOGGER for info..");
BuilderUtil.sendSysMessage(activeChar, "Cannot startEvent, check LOGGER for info..");
}
}
@ -241,7 +242,7 @@ public class AdminDMEngine implements IAdminCommandHandler
else if (command.equals("admin_dmevent_abort"))
{
activeChar.sendMessage("Aborting event");
BuilderUtil.sendSysMessage(activeChar, "Aborting event");
DM.abortEvent();
showMainPage(activeChar);
}

View File

@ -27,6 +27,7 @@ import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.Announcements;
import com.l2jmobius.gameserver.network.serverpackets.SocialAction;
import com.l2jmobius.gameserver.util.BuilderUtil;
public class AdminDonator implements IAdminCommandHandler
{
@ -79,7 +80,7 @@ public class AdminDonator implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Impossible to set a non Player Target as Donator.");
BuilderUtil.sendSysMessage(activeChar, "Impossible to set a non Player Target as Donator.");
LOGGER.info("GM: " + activeChar.getName() + " is trying to set a non Player Target as Donator.");
return false;

View File

@ -23,6 +23,7 @@ import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2DoorInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.siege.Castle;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands:<br>
@ -90,7 +91,7 @@ public class AdminDoorControl implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Wrong ID door.");
BuilderUtil.sendSysMessage(activeChar, "Wrong ID door.");
e.printStackTrace();
return false;
}
@ -105,7 +106,7 @@ public class AdminDoorControl implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Incorrect target.");
BuilderUtil.sendSysMessage(activeChar, "Incorrect target.");
}
}
else if (command.startsWith("admin_open ")) // id
@ -131,7 +132,7 @@ public class AdminDoorControl implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Wrong ID door.");
BuilderUtil.sendSysMessage(activeChar, "Wrong ID door.");
e.printStackTrace();
return false;
}
@ -146,7 +147,7 @@ public class AdminDoorControl implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Incorrect target.");
BuilderUtil.sendSysMessage(activeChar, "Incorrect target.");
}
}

View File

@ -50,6 +50,7 @@ import com.l2jmobius.gameserver.network.serverpackets.SetSummonRemainTime;
import com.l2jmobius.gameserver.network.serverpackets.SocialAction;
import com.l2jmobius.gameserver.network.serverpackets.StatusUpdate;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.Util;
public class AdminEditChar implements IAdminCommandHandler
@ -154,7 +155,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //changename|setname <new_name_for_target>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //changename|setname <new_name_for_target>");
return false;
}
final L2Object target = activeChar.getTarget();
@ -202,7 +203,7 @@ public class AdminEditChar implements IAdminCommandHandler
activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET);
return false;
}
activeChar.sendMessage("Name changed from " + oldName + " to " + val);
BuilderUtil.sendSysMessage(activeChar, "Name changed from " + oldName + " to " + val);
return true;
} // changes char name
case admin_edit_character:
@ -232,13 +233,13 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //setkarma new_karma_for_target(number)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setkarma new_karma_for_target(number)");
return false;
}
}
else
{
activeChar.sendMessage("Usage: //setkarma new_karma_for_target");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setkarma new_karma_for_target");
return false;
}
setTargetKarma(activeChar, karma);
@ -264,7 +265,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //character_info <player_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //character_info <player_name>");
return false;
}
final L2PcInstance target = L2World.getInstance().getPlayer(val);
@ -290,12 +291,12 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //show_characters <page_number>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //show_characters <page_number>");
listCharacters(activeChar, 0);
return false;
}
}
activeChar.sendMessage("Usage: //show_characters <page_number>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //show_characters <page_number>");
listCharacters(activeChar, 0);
return false;
}
@ -318,7 +319,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //find_character <player_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //find_character <player_name>");
listCharacters(activeChar, 0);
return false;
}
@ -338,7 +339,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //find_dualbox <boxes_number>(default 2)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //find_dualbox <boxes_number>(default 2)");
listCharacters(activeChar, 0);
return false;
}
@ -355,7 +356,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //find_ip <ip>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //find_ip <ip>");
listCharacters(activeChar, 0);
return false;
}
@ -365,7 +366,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (IllegalArgumentException e)
{
activeChar.sendMessage("Usage: //find_ip <ip>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //find_ip <ip>");
listCharacters(activeChar, 0);
return false;
}
@ -380,7 +381,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //find_account <account_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //find_account <account_name>");
listCharacters(activeChar, 0);
return false;
}
@ -406,7 +407,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //save_modifications <mods>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //save_modifications <mods>");
listCharacters(activeChar, 0);
return false;
}
@ -426,13 +427,13 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //rec <value>(default 1)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //rec <value>(default 1)");
return false;
}
}
else
{
activeChar.sendMessage("Usage: //rec <value>(default 1)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //rec <value>(default 1)");
return false;
}
L2Object target = activeChar.getTarget();
@ -443,7 +444,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Select player before. Usage: //rec <value>(default 1)");
BuilderUtil.sendSysMessage(activeChar, "Select player before. Usage: //rec <value>(default 1)");
listCharacters(activeChar, 0);
return false;
}
@ -467,7 +468,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //setclass <value>(default 1)");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setclass <value>(default 1)");
return false;
}
}
@ -515,7 +516,7 @@ public class AdminEditChar implements IAdminCommandHandler
activeChar.sendMessage(player.getName() + " changed to " + newclass);
return true;
}
activeChar.sendMessage("Usage: //setclass <valid_new_classid>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setclass <valid_new_classid>");
return false;
}
case admin_settitle:
@ -537,7 +538,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //settitle <new_title>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //settitle <new_title>");
return false;
}
L2Object target = activeChar.getTarget();
@ -557,7 +558,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Select your target before the command");
BuilderUtil.sendSysMessage(activeChar, "Select your target before the command");
return false;
}
if (player != null)
@ -586,7 +587,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Select player before command");
BuilderUtil.sendSysMessage(activeChar, "Select player before command");
return false;
}
player.getAppearance().setSex(player.getAppearance().getSex() ? false : true);
@ -606,18 +607,18 @@ public class AdminEditChar implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //setcolor <new_color>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setcolor <new_color>");
return false;
}
L2Object target = activeChar.getTarget();
if (target == null)
{
activeChar.sendMessage("You have to select a player!");
BuilderUtil.sendSysMessage(activeChar, "You have to select a player!");
return false;
}
if (!(target instanceof L2PcInstance))
{
activeChar.sendMessage("Your target is not a player!");
BuilderUtil.sendSysMessage(activeChar, "Your target is not a player!");
return false;
}
L2PcInstance player = (L2PcInstance) target;
@ -652,18 +653,18 @@ public class AdminEditChar implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("You have to select a player!");
BuilderUtil.sendSysMessage(activeChar, "You have to select a player!");
return false;
}
if (player.getClan() == null)
{
player.setClanJoinExpiryTime(0);
player.sendMessage("A GM Has reset your clan wait time, You may now join another clan.");
activeChar.sendMessage("You have reset " + player.getName() + "'s wait time to join another clan.");
BuilderUtil.sendSysMessage(activeChar, "You have reset " + player.getName() + "'s wait time to join another clan.");
}
else
{
activeChar.sendMessage("Sorry, but " + player.getName() + " must not be in a clan. Player must leave clan before the wait limit can be reset.");
BuilderUtil.sendSysMessage(activeChar, "Sorry, but " + player.getName() + " must not be in a clan. Player must leave clan before the wait limit can be reset.");
return false;
}
return true;
@ -681,14 +682,14 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Value must be an integer");
activeChar.sendMessage("Usage: //setcp <new_value>");
BuilderUtil.sendSysMessage(activeChar, "Value must be an integer");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setcp <new_value>");
return false;
}
}
else
{
activeChar.sendMessage("Usage: //setcp <new_value>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setcp <new_value>");
return false;
}
activeChar.getStatus().setCurrentCp(value);
@ -707,14 +708,14 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Value must be an integer");
activeChar.sendMessage("Usage: //sethp <new_value>");
BuilderUtil.sendSysMessage(activeChar, "Value must be an integer");
BuilderUtil.sendSysMessage(activeChar, "Usage: //sethp <new_value>");
return false;
}
}
else
{
activeChar.sendMessage("Usage: //sethp <new_value>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //sethp <new_value>");
return false;
}
activeChar.getStatus().setCurrentHp(value);
@ -733,14 +734,14 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Value must be an integer");
activeChar.sendMessage("Usage: //setmp <new_value>");
BuilderUtil.sendSysMessage(activeChar, "Value must be an integer");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setmp <new_value>");
return false;
}
}
else
{
activeChar.sendMessage("Usage: //setmp <new_value>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setmp <new_value>");
return false;
}
activeChar.getStatus().setCurrentMp(value);
@ -759,14 +760,14 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Value must be an integer");
activeChar.sendMessage("Usage: //setchar_cp <new_value>");
BuilderUtil.sendSysMessage(activeChar, "Value must be an integer");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setchar_cp <new_value>");
return false;
}
}
else
{
activeChar.sendMessage("Usage: //setchar_cp <new_value>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setchar_cp <new_value>");
return false;
}
if (activeChar.getTarget() instanceof L2PcInstance)
@ -798,14 +799,14 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Value must be an integer");
activeChar.sendMessage("Usage: //setchar_hp <new_value>");
BuilderUtil.sendSysMessage(activeChar, "Value must be an integer");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setchar_hp <new_value>");
return false;
}
}
else
{
activeChar.sendMessage("Usage: //setchar_hp <new_value>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setchar_hp <new_value>");
return false;
}
if (activeChar.getTarget() instanceof L2PcInstance)
@ -837,14 +838,14 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Value must be an integer");
activeChar.sendMessage("Usage: //setchar_mp <new_value>");
BuilderUtil.sendSysMessage(activeChar, "Value must be an integer");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setchar_mp <new_value>");
return false;
}
}
else
{
activeChar.sendMessage("Usage: //setchar_mp <new_value>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //setchar_mp <new_value>");
return false;
}
if (activeChar.getTarget() instanceof L2PcInstance)
@ -923,7 +924,7 @@ public class AdminEditChar implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Example: //sethero <trigger> <save>");
BuilderUtil.sendSysMessage(activeChar, "Example: //sethero <trigger> <save>");
}
}
}
@ -1112,13 +1113,13 @@ public class AdminEditChar implements IAdminCommandHandler
// Admin information
if (player != activeChar)
{
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

@ -48,6 +48,7 @@ import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.templates.StatsSet;
import com.l2jmobius.gameserver.templates.chars.L2NpcTemplate;
import com.l2jmobius.gameserver.templates.item.L2Item;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* @author terry Window - Preferences - Java - Code Style - Code Templates
@ -119,7 +120,7 @@ public class AdminEditNpc implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Wrong usage: //edit_npc <npcId>");
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //edit_npc <npcId>");
}
}
else if (activeChar.getTarget() instanceof L2NpcInstance)
@ -141,7 +142,7 @@ public class AdminEditNpc implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //load_npc <id>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //load_npc <id>");
}
if (id > 0)
{
@ -166,7 +167,7 @@ public class AdminEditNpc implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //show_droplist <npc_id>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //show_droplist <npc_id>");
}
}
else if (command.startsWith("admin_addShopItem "))
@ -205,7 +206,7 @@ public class AdminEditNpc implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //save_npc <npc_id> <npc_stat> <npc_stat_value>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //save_npc <npc_id> <npc_stat> <npc_stat_value>");
}
}
else if (command.startsWith("admin_show_skilllist_npc "))
@ -233,12 +234,12 @@ public class AdminEditNpc implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //show_skilllist_npc <npc_id> <page>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //show_skilllist_npc <npc_id> <page>");
}
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //show_skilllist_npc <npc_id> <page>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //show_skilllist_npc <npc_id> <page>");
}
}
else if (command.startsWith("admin_edit_skill_npc "))
@ -276,12 +277,12 @@ public class AdminEditNpc implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //edit_skill_npc <npc_id> <item_id> [<level>]");
BuilderUtil.sendSysMessage(activeChar, "Usage: //edit_skill_npc <npc_id> <item_id> [<level>]");
}
}
catch (StringIndexOutOfBoundsException e)
{
activeChar.sendMessage("Usage: //edit_skill_npc <npc_id> <item_id> [<level>]");
BuilderUtil.sendSysMessage(activeChar, "Usage: //edit_skill_npc <npc_id> <item_id> [<level>]");
}
}
else if (command.startsWith("admin_add_skill_npc "))
@ -328,12 +329,12 @@ public class AdminEditNpc implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //add_skill_npc <npc_id> [<level>]");
BuilderUtil.sendSysMessage(activeChar, "Usage: //add_skill_npc <npc_id> [<level>]");
}
}
catch (StringIndexOutOfBoundsException e)
{
activeChar.sendMessage("Usage: //add_skill_npc <npc_id> [<level>]");
BuilderUtil.sendSysMessage(activeChar, "Usage: //add_skill_npc <npc_id> [<level>]");
}
}
else if (command.startsWith("admin_del_skill_npc "))
@ -358,7 +359,7 @@ public class AdminEditNpc implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //del_skill_npc <npc_id> <skill_id>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //del_skill_npc <npc_id> <skill_id>");
}
}
else if (command.startsWith("admin_edit_drop "))
@ -400,12 +401,12 @@ public class AdminEditNpc implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //edit_drop <npc_id> <item_id> <category> [<min> <max> <chance>]");
BuilderUtil.sendSysMessage(activeChar, "Usage: //edit_drop <npc_id> <item_id> <category> [<min> <max> <chance>]");
}
}
catch (StringIndexOutOfBoundsException e)
{
activeChar.sendMessage("Usage: //edit_drop <npc_id> <item_id> <category> [<min> <max> <chance>]");
BuilderUtil.sendSysMessage(activeChar, "Usage: //edit_drop <npc_id> <item_id> <category> [<min> <max> <chance>]");
}
}
else if (command.startsWith("admin_add_drop "))
@ -457,12 +458,12 @@ public class AdminEditNpc implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //add_drop <npc_id> [<item_id> <category> <min> <max> <chance>]");
BuilderUtil.sendSysMessage(activeChar, "Usage: //add_drop <npc_id> [<item_id> <category> <min> <max> <chance>]");
}
}
catch (StringIndexOutOfBoundsException e)
{
activeChar.sendMessage("Usage: //add_drop <npc_id> [<item_id> <category> <min> <max> <chance>]");
BuilderUtil.sendSysMessage(activeChar, "Usage: //add_drop <npc_id> [<item_id> <category> <min> <max> <chance>]");
}
}
else if (command.startsWith("admin_del_drop "))
@ -489,7 +490,7 @@ public class AdminEditNpc implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //del_drop <npc_id> <item_id> <category>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //del_drop <npc_id> <item_id> <category>");
}
}
else if (command.startsWith("admin_box_access"))
@ -559,7 +560,7 @@ public class AdminEditNpc implements IAdminCommandHandler
tradeList.replaceItem(itemID, Integer.parseInt(args[3]));
updateTradeList(itemID, price, tradeListID, order);
activeChar.sendMessage("Updated price for " + item.getName() + " in Trade List " + tradeListID);
BuilderUtil.sendSysMessage(activeChar, "Updated price for " + item.getName() + " in Trade List " + tradeListID);
showShopList(activeChar, tradeListID, 1);
return;
}
@ -605,7 +606,7 @@ public class AdminEditNpc implements IAdminCommandHandler
tradeList.removeItem(itemID);
deleteTradeList(tradeListID, order);
activeChar.sendMessage("Deleted " + ItemTable.getInstance().getTemplate(itemID).getName() + " from Trade List " + tradeListID);
BuilderUtil.sendSysMessage(activeChar, "Deleted " + ItemTable.getInstance().getTemplate(itemID).getName() + " from Trade List " + tradeListID);
showShopList(activeChar, tradeListID, 1);
return;
}
@ -640,7 +641,7 @@ public class AdminEditNpc implements IAdminCommandHandler
if (tradeList == null)
{
activeChar.sendMessage("TradeList not found!");
BuilderUtil.sendSysMessage(activeChar, "TradeList not found!");
return;
}
@ -662,7 +663,7 @@ public class AdminEditNpc implements IAdminCommandHandler
tradeList.addItem(newItem);
storeTradeList(itemID, price, tradeListID, order);
activeChar.sendMessage("Added " + newItem.getItem().getName() + " to Trade List " + tradeList.getListId());
BuilderUtil.sendSysMessage(activeChar, "Added " + newItem.getItem().getName() + " to Trade List " + tradeList.getListId());
showShopList(activeChar, tradeListID, 1);
return;
@ -763,7 +764,7 @@ public class AdminEditNpc implements IAdminCommandHandler
if (tradeLists == null)
{
activeChar.sendMessage("Unknown npc template ID" + merchantID);
BuilderUtil.sendSysMessage(activeChar, "Unknown npc template ID" + merchantID);
return;
}
@ -901,7 +902,7 @@ public class AdminEditNpc implements IAdminCommandHandler
{
if (npc.isCustom())
{
activeChar.sendMessage("You are going to modify Custom NPC");
BuilderUtil.sendSysMessage(activeChar, "You are going to modify Custom NPC");
}
NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
@ -1188,7 +1189,7 @@ public class AdminEditNpc implements IAdminCommandHandler
if (old.isCustom())
{
activeChar.sendMessage("You are going to save Custom NPC");
BuilderUtil.sendSysMessage(activeChar, "You are going to save Custom NPC");
}
NpcTable.getInstance().saveNpc(newNpcData);
@ -1204,7 +1205,7 @@ public class AdminEditNpc implements IAdminCommandHandler
if (npcData == null)
{
activeChar.sendMessage("unknown npc template id" + npcId);
BuilderUtil.sendSysMessage(activeChar, "unknown npc template id" + npcId);
return;
}
@ -1349,7 +1350,7 @@ public class AdminEditNpc implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("unknown error!");
BuilderUtil.sendSysMessage(activeChar, "unknown error!");
}
}
catch (Exception e)
@ -1468,7 +1469,7 @@ public class AdminEditNpc implements IAdminCommandHandler
final L2NpcTemplate npcData = NpcTable.getInstance().getTemplate(npcId);
if (npcData == null)
{
activeChar.sendMessage("Template id unknown: " + npcId);
BuilderUtil.sendSysMessage(activeChar, "Template id unknown: " + npcId);
return;
}
@ -1635,7 +1636,7 @@ public class AdminEditNpc implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Unknown error");
BuilderUtil.sendSysMessage(activeChar, "Unknown error");
}
}
catch (Exception e)

View File

@ -154,7 +154,7 @@ public class AdminEffects implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Use: //earthquake <intensity> <duration>");
BuilderUtil.sendSysMessage(activeChar, "Use: //earthquake <intensity> <duration>");
}
}
@ -180,12 +180,12 @@ public class AdminEffects implements IAdminCommandHandler
if (activeChar.getSayMode() != null)
{
activeChar.setSayMode(null);
activeChar.sendMessage("NpcSay mode off");
BuilderUtil.sendSysMessage(activeChar, "NpcSay mode off");
}
else if ((target != null) && (target instanceof L2NpcInstance))
{
activeChar.setSayMode(target);
activeChar.sendMessage("NpcSay mode on for " + target.getName());
BuilderUtil.sendSysMessage(activeChar, "NpcSay mode on for " + target.getName());
}
else
{
@ -196,7 +196,7 @@ public class AdminEffects implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Target Npc before. Use: //npc_say");
BuilderUtil.sendSysMessage(activeChar, "Target Npc before. Use: //npc_say");
}
}
@ -505,7 +505,7 @@ public class AdminEffects implements IAdminCommandHandler
}
catch (NumberFormatException nbe)
{
activeChar.sendMessage("Incorrect parameter");
BuilderUtil.sendSysMessage(activeChar, "Incorrect parameter");
}
}
}
@ -530,7 +530,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)
@ -549,7 +549,7 @@ public class AdminEffects implements IAdminCommandHandler
{
player = (L2Character) target;
player.stopAllEffects();
activeChar.sendMessage("Effects has been cleared from " + player + ".");
BuilderUtil.sendSysMessage(activeChar, "Effects has been cleared from " + player + ".");
}
}
catch (Exception e)
@ -605,7 +605,7 @@ public class AdminEffects implements IAdminCommandHandler
}
catch (NumberFormatException nbe)
{
activeChar.sendMessage("Usage: //abnormal <hex_abnormal_mask> [player|radius]");
BuilderUtil.sendSysMessage(activeChar, "Usage: //abnormal <hex_abnormal_mask> [player|radius]");
}
}
}
@ -630,7 +630,7 @@ public class AdminEffects implements IAdminCommandHandler
}
else if (!command.contains("menu"))
{
activeChar.sendMessage("Usage: //abnormal <abnormal_mask> [player_name|radius]");
BuilderUtil.sendSysMessage(activeChar, "Usage: //abnormal <abnormal_mask> [player_name|radius]");
}
}
catch (Exception e)
@ -677,7 +677,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]");
}
}
@ -796,7 +796,7 @@ public class AdminEffects implements IAdminCommandHandler
}
default:
{
activeChar.sendMessage("Usage: //atmosphere <signsky dawn|dusk>|<sky day|night|red>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //atmosphere <signsky dawn|dusk>|<sky day|night|red>");
break;
}
}
@ -815,7 +815,7 @@ public class AdminEffects implements IAdminCommandHandler
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

@ -26,6 +26,7 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.CharInfo;
import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.IllegalPlayerAction;
import com.l2jmobius.gameserver.util.Util;
@ -137,7 +138,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
{
@ -146,11 +147,11 @@ public class AdminEnchant implements IAdminCommandHandler
}
catch (StringIndexOutOfBoundsException e)
{
activeChar.sendMessage("Please specify a new enchant value.");
BuilderUtil.sendSysMessage(activeChar, "Please specify a new enchant value.");
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Please specify a valid new enchant value.");
BuilderUtil.sendSysMessage(activeChar, "Please specify a valid new enchant value.");
}
}
@ -216,7 +217,7 @@ public class AdminEnchant implements IAdminCommandHandler
{
player.sendMessage("A GM tried to overenchant you. You will both be banned.");
Util.handleIllegalPlayerAction(player, "The player " + player.getName() + " has been edited. BAN!", IllegalPlayerAction.PUNISH_KICKBAN);
activeChar.sendMessage("You tried to overenchant somebody. You will both be banned.");
BuilderUtil.sendSysMessage(activeChar, "You tried to overenchant somebody. You will both be banned.");
Util.handleIllegalPlayerAction(activeChar, "The GM " + activeChar.getName() + " has overenchanted the player " + player.getName() + ". BAN!", IllegalPlayerAction.PUNISH_KICKBAN);
}
else
@ -234,7 +235,7 @@ public class AdminEnchant implements IAdminCommandHandler
player.sendPacket(new UserInfo(player));
// 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

@ -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:
@ -60,13 +61,13 @@ public class AdminExpSp implements IAdminCommandHandler
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"))
@ -77,13 +78,13 @@ public class AdminExpSp implements IAdminCommandHandler
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");
}
}
@ -167,7 +168,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() + ".");
if (Config.DEBUG)
{
@ -222,7 +223,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() + ".");
if (Config.DEBUG)
{

View File

@ -27,6 +27,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.siege.Fort;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles all siege commands: Todo: change the class name, and neaten it up
@ -126,7 +127,7 @@ public class AdminFortSiege implements IAdminCommandHandler
// }
// catch (Exception e)
// {
// activeChar.sendMessage("Usage: //add_guard npcId");
// BuilderUtil.sendSysMessage(activeChar, "Usage: //add_guard npcId");
// }
// }
else if (command.equalsIgnoreCase("admin_clear_fortsiege_list"))
@ -145,7 +146,7 @@ public class AdminFortSiege implements IAdminCommandHandler
}
else if (command.equalsIgnoreCase("admin_move_fortdefenders"))
{
activeChar.sendMessage("Not implemented yet.");
BuilderUtil.sendSysMessage(activeChar, "Not implemented yet.");
}
else if (command.equalsIgnoreCase("admin_setfort"))
{
@ -168,7 +169,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.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
import com.l2jmobius.gameserver.util.GeoUtils;
/**
@ -61,11 +62,11 @@ public class AdminGeodata implements IAdminCommandHandler
if (GeoData.getInstance().hasGeoPos(geoX, geoY))
{
activeChar.sendMessage("WorldX: " + worldX + ", WorldY: " + worldY + ", WorldZ: " + worldZ + ", GeoX: " + geoX + ", GeoY: " + geoY + ", GeoZ: " + GeoData.getInstance().getNearestZ(geoX, geoY, worldZ));
BuilderUtil.sendSysMessage(activeChar, "WorldX: " + worldX + ", WorldY: " + worldY + ", WorldZ: " + worldZ + ", GeoX: " + geoX + ", GeoY: " + geoY + ", GeoZ: " + GeoData.getInstance().getNearestZ(geoX, geoY, worldZ));
}
else
{
activeChar.sendMessage("There is no geodata at this position.");
BuilderUtil.sendSysMessage(activeChar, "There is no geodata at this position.");
}
}
else if (command.equals("admin_geo_spawn_pos"))
@ -78,11 +79,11 @@ public class AdminGeodata implements IAdminCommandHandler
if (GeoData.getInstance().hasGeoPos(geoX, geoY))
{
activeChar.sendMessage("WorldX: " + worldX + ", WorldY: " + worldY + ", WorldZ: " + worldZ + ", GeoX: " + geoX + ", GeoY: " + geoY + ", GeoZ: " + GeoData.getInstance().getSpawnHeight(worldX, worldY, worldZ));
BuilderUtil.sendSysMessage(activeChar, "WorldX: " + worldX + ", WorldY: " + worldY + ", WorldZ: " + worldZ + ", GeoX: " + geoX + ", GeoY: " + geoY + ", GeoZ: " + GeoData.getInstance().getSpawnHeight(worldX, worldY, worldZ));
}
else
{
activeChar.sendMessage("There is no geodata at this position.");
BuilderUtil.sendSysMessage(activeChar, "There is no geodata at this position.");
}
}
else if (command.equals("admin_geo_can_move"))
@ -92,16 +93,16 @@ public class AdminGeodata implements IAdminCommandHandler
{
if (GeoData.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
{
activeChar.sendMessage("Incorrect Target.");
BuilderUtil.sendSysMessage(activeChar, "Incorrect Target.");
}
}
else if (command.equals("admin_geo_can_see"))
@ -111,16 +112,16 @@ public class AdminGeodata implements IAdminCommandHandler
{
if (GeoData.getInstance().canSeeTarget(activeChar, target))
{
activeChar.sendMessage("Can see target.");
BuilderUtil.sendSysMessage(activeChar, "Can see target.");
}
else
{
activeChar.sendMessage("Cannot see Target.");
BuilderUtil.sendSysMessage(activeChar, "Cannot see Target.");
}
}
else
{
activeChar.sendMessage("Incorrect Target.");
BuilderUtil.sendSysMessage(activeChar, "Incorrect Target.");
}
}
else if (command.equals("admin_geogrid"))
@ -131,7 +132,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);
}
else
{

View File

@ -22,6 +22,7 @@ import com.l2jmobius.Config;
import com.l2jmobius.gameserver.datatables.GmListTable;
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 on/off
@ -64,7 +65,7 @@ public class AdminGm implements IAdminCommandHandler
GmListTable.getInstance().deleteGm(activeChar);
// activeChar.setIsGM(false);
activeChar.sendMessage("You no longer have GM status.");
BuilderUtil.sendSysMessage(activeChar, "You no longer have GM status.");
if (Config.DEBUG)
{
@ -76,7 +77,7 @@ public class AdminGm implements IAdminCommandHandler
GmListTable.getInstance().addGm(activeChar, false);
// activeChar.setIsGM(true);
activeChar.sendMessage("You now have GM status.");
BuilderUtil.sendSysMessage(activeChar, "You now have GM status.");
if (Config.DEBUG)
{

View File

@ -26,6 +26,7 @@ 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.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands: - heal = restores HP/MP/CP on target, name or radius
@ -105,7 +106,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

@ -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.serverpackets.LeaveWorld;
import com.l2jmobius.gameserver.util.BuilderUtil;
public class AdminKick implements IAdminCommandHandler
{
@ -45,7 +46,7 @@ public class AdminKick implements IAdminCommandHandler
if (activeChar.getTarget() != null)
{
activeChar.sendMessage("Type //kick name");
BuilderUtil.sendSysMessage(activeChar, "Type //kick name");
}
if (st.countTokens() > 1)
@ -58,13 +59,13 @@ public class AdminKick implements IAdminCommandHandler
if (plyr != null)
{
plyr.logout(true);
activeChar.sendMessage("You kicked " + plyr.getName() + " from the game.");
BuilderUtil.sendSysMessage(activeChar, "You kicked " + plyr.getName() + " from the game.");
}
if ((plyr != null) && plyr.isInOfflineMode())
{
plyr.deleteMe();
activeChar.sendMessage("You kicked Offline Player " + plyr.getName() + " from the game.");
BuilderUtil.sendSysMessage(activeChar, "You kicked Offline Player " + plyr.getName() + " from the game.");
}
}
}
@ -82,7 +83,7 @@ public class AdminKick implements IAdminCommandHandler
player.logout(true);
}
}
activeChar.sendMessage("Kicked " + counter + " players");
BuilderUtil.sendSysMessage(activeChar, "Kicked " + counter + " players");
}
return true;
}

View File

@ -27,6 +27,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
@ -79,13 +80,13 @@ 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;
}
}
@ -107,13 +108,13 @@ 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("Usage: //kill <player_name | radius>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //kill <player_name | radius>");
return false;
}
}

View File

@ -25,6 +25,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
{
@ -63,7 +64,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"))
@ -102,13 +103,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.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.gameserverpackets.ServerStatus;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.thread.LoginServerThread;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles the admin commands that acts on the login
@ -57,13 +58,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"))
@ -76,17 +77,17 @@ public class AdminLogin implements IAdminCommandHandler
try
{
LoginServerThread.getInstance().setMaxPlayer(Integer.parseInt(number));
activeChar.sendMessage("maxPlayer set to " + Integer.parseInt(number));
BuilderUtil.sendSysMessage(activeChar, "maxPlayer set to " + Integer.parseInt(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_clock"))
@ -103,7 +104,7 @@ public class AdminLogin implements IAdminCommandHandler
case "on":
{
LoginServerThread.getInstance().sendServerStatus(ServerStatus.SERVER_LIST_CLOCK, ServerStatus.ON);
activeChar.sendMessage("A clock will now be displayed next to the server name");
BuilderUtil.sendSysMessage(activeChar, "A clock will now be displayed next to the server name");
Config.SERVER_LIST_CLOCK = true;
showMainPage(activeChar);
break;
@ -112,20 +113,20 @@ public class AdminLogin implements IAdminCommandHandler
{
LoginServerThread.getInstance().sendServerStatus(ServerStatus.SERVER_LIST_CLOCK, ServerStatus.OFF);
Config.SERVER_LIST_CLOCK = false;
activeChar.sendMessage("The clock will not be displayed");
BuilderUtil.sendSysMessage(activeChar, "The clock will not be displayed");
showMainPage(activeChar);
break;
}
default:
{
activeChar.sendMessage("Format is server_list_clock <on/off>");
BuilderUtil.sendSysMessage(activeChar, "Format is server_list_clock <on/off>");
break;
}
}
}
else
{
activeChar.sendMessage("Format is server_list_clock <on/off>");
BuilderUtil.sendSysMessage(activeChar, "Format is server_list_clock <on/off>");
}
}
else if (command.equals("admin_server_login"))

View File

@ -28,6 +28,7 @@ import com.l2jmobius.gameserver.model.entity.sevensigns.SevenSigns;
import com.l2jmobius.gameserver.model.spawn.AutoSpawn;
import com.l2jmobius.gameserver.model.spawn.AutoSpawn.AutoSpawnInstance;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* Admin Command Handler for Mammon NPCs
@ -71,12 +72,12 @@ 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)");
}
if (!_isSealValidation)
{
activeChar.sendMessage("The competition period is currently in effect.");
BuilderUtil.sendSysMessage(activeChar, "The competition period is currently in effect.");
return true;
}
@ -86,7 +87,7 @@ public class AdminMammon implements IAdminCommandHandler
if (blackInst.length > 0)
{
final int x1 = blackInst[0].getX(), y1 = blackInst[0].getY(), z1 = blackInst[0].getZ();
activeChar.sendMessage("Blacksmith of Mammon: " + x1 + " " + y1 + " " + z1);
BuilderUtil.sendSysMessage(activeChar, "Blacksmith of Mammon: " + x1 + " " + y1 + " " + z1);
if (teleportIndex == 1)
{
@ -96,7 +97,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)
@ -107,7 +108,7 @@ public class AdminMammon implements IAdminCommandHandler
{
final int x2 = merchInst[0].getX(), y2 = merchInst[0].getY(), z2 = merchInst[0].getZ();
activeChar.sendMessage("Merchant of Mammon: " + x2 + " " + y2 + " " + z2);
BuilderUtil.sendSysMessage(activeChar, "Merchant of Mammon: " + x2 + " " + y2 + " " + z2);
if (teleportIndex == 2)
{
@ -117,7 +118,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.");
}
}
@ -125,28 +126,28 @@ public class AdminMammon implements IAdminCommandHandler
{
if (!_isSealValidation)
{
activeChar.sendMessage("The competition period is currently in effect.");
BuilderUtil.sendSysMessage(activeChar, "The competition period is currently in effect.");
return true;
}
if (merchSpawnInst != null)
{
final long merchRespawn = AutoSpawn.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 = AutoSpawn.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.");
}
}
@ -193,7 +194,7 @@ public class AdminMammon implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Command format: //msg <SYSTEM_MSG_ID>");
BuilderUtil.sendSysMessage(activeChar, "Command format: //msg <SYSTEM_MSG_ID>");
return true;
}
activeChar.sendPacket(new SystemMessage(msgId));

View File

@ -28,6 +28,7 @@ import com.l2jmobius.gameserver.instancemanager.CastleManorManager.SeedProductio
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.siege.Castle;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* Admin comand handler for Manor System This class handles following admin commands: - manor_info = shows info about current manor state - manor_approve = approves settings for the next manor period - manor_setnext = changes manor settings to the next day's - manor_reset castle = resets all manor
@ -79,7 +80,7 @@ public class AdminManor implements IAdminCommandHandler
castle.saveCropData();
castle.saveSeedData();
}
activeChar.sendMessage("Manor data for " + castle.getName() + " was nulled");
BuilderUtil.sendSysMessage(activeChar, "Manor data for " + castle.getName() + " was nulled");
}
else
{
@ -95,7 +96,7 @@ public class AdminManor implements IAdminCommandHandler
castle.saveSeedData();
}
}
activeChar.sendMessage("Manor data was nulled");
BuilderUtil.sendSysMessage(activeChar, "Manor data was nulled");
}
showMainPage(activeChar);
break;
@ -103,7 +104,7 @@ public class AdminManor implements IAdminCommandHandler
case "admin_manor_save":
{
CastleManorManager.getInstance().save();
activeChar.sendMessage("Manor System: all data saved");
BuilderUtil.sendSysMessage(activeChar, "Manor System: all data saved");
showMainPage(activeChar);
break;
}
@ -113,11 +114,11 @@ public class AdminManor implements IAdminCommandHandler
CastleManorManager.getInstance().setDisabled(!mode);
if (mode)
{
activeChar.sendMessage("Manor System: enabled");
BuilderUtil.sendSysMessage(activeChar, "Manor System: enabled");
}
else
{
activeChar.sendMessage("Manor System: disabled");
BuilderUtil.sendSysMessage(activeChar, "Manor System: disabled");
}
showMainPage(activeChar);
break;

View File

@ -21,6 +21,7 @@ import java.util.StringTokenizer;
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;
/**
* <b>This class handles Admin mass commands:</b><br>
@ -61,7 +62,7 @@ public class AdminMassControl implements IAdminCommandHandler
counter++;
player.getStatus().setCurrentHp(0);
player.doDie(player);
activeChar.sendMessage("You've Killed " + counter + " players.");
BuilderUtil.sendSysMessage(activeChar, "You've Killed " + counter + " players.");
}
}
}
@ -75,7 +76,7 @@ public class AdminMassControl implements IAdminCommandHandler
{
counter++;
player.doRevive();
activeChar.sendMessage("You've Ressurected " + counter + " players.");
BuilderUtil.sendSysMessage(activeChar, "You've Ressurected " + counter + " players.");
}
}
}

View File

@ -23,6 +23,7 @@ import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.L2Party;
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: - recallparty - recallclan - recallally
@ -55,7 +56,7 @@ public class AdminMassRecall implements IAdminCommandHandler
if (clan == null)
{
activeChar.sendMessage("This clan doesn't exists.");
BuilderUtil.sendSysMessage(activeChar, "This clan doesn't exists.");
return true;
}
@ -68,7 +69,7 @@ public class AdminMassRecall implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Error in recallclan command.");
BuilderUtil.sendSysMessage(activeChar, "Error in recallclan command.");
}
}
else if (command.startsWith("admin_recallally"))
@ -80,7 +81,7 @@ public class AdminMassRecall implements IAdminCommandHandler
if (clan == null)
{
activeChar.sendMessage("This clan doesn't exists.");
BuilderUtil.sendSysMessage(activeChar, "This clan doesn't exists.");
return true;
}
@ -113,7 +114,7 @@ public class AdminMassRecall implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Error in recallally command.");
BuilderUtil.sendSysMessage(activeChar, "Error in recallally command.");
}
}
else if (command.startsWith("admin_recallparty"))
@ -125,13 +126,13 @@ public class AdminMassRecall implements IAdminCommandHandler
if (player == null)
{
activeChar.sendMessage("Target error.");
BuilderUtil.sendSysMessage(activeChar, "Target error.");
return true;
}
if (!player.isInParty())
{
activeChar.sendMessage("Player is not in party.");
BuilderUtil.sendSysMessage(activeChar, "Player is not in party.");
return true;
}
@ -144,7 +145,7 @@ public class AdminMassRecall implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Error in recallparty command.");
BuilderUtil.sendSysMessage(activeChar, "Error in recallparty command.");
}
}
return true;

View File

@ -33,6 +33,7 @@ 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.thread.LoginServerThread;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands: - handles every admin menu command
@ -114,7 +115,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, x, y, z, activeChar, "Admin is teleporting you.");
return true;
}
@ -145,7 +146,7 @@ public class AdminMenu implements IAdminCommandHandler
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, x, y, z, activeChar, "Admin is teleporting you.");
return true;
@ -263,7 +264,7 @@ public class AdminMenu implements IAdminCommandHandler
if (plyr != null)
{
target = plyr;
activeChar.sendMessage("You killed " + player);
BuilderUtil.sendSysMessage(activeChar, "You killed " + player);
}
}
@ -323,7 +324,7 @@ public class AdminMenu implements IAdminCommandHandler
else
{
activeChar.teleToLocation(player.getX(), player.getY(), player.getZ(), true);
activeChar.sendMessage("You're teleporting yourself to character " + player.getName());
BuilderUtil.sendSysMessage(activeChar, "You're teleporting yourself to character " + player.getName());
}
showMainPage(activeChar);
@ -365,7 +366,7 @@ public class AdminMenu implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Specified player name didn't lead to a valid account.");
BuilderUtil.sendSysMessage(activeChar, "Specified player name didn't lead to a valid account.");
}
statement.close();

View File

@ -28,6 +28,7 @@ import com.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
import com.l2jmobius.gameserver.network.serverpackets.SetupGauge;
import com.l2jmobius.gameserver.templates.chars.L2NpcTemplate;
import com.l2jmobius.gameserver.util.Broadcast;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* @author littlecrow Admin commands handler for controllable mobs
@ -174,7 +175,7 @@ public class AdminMobGroup implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Incorrect command arguments.");
BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
return;
}
@ -182,7 +183,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null)
{
activeChar.sendMessage("Invalid group specified.");
BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return;
}
@ -199,7 +200,7 @@ public class AdminMobGroup implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Incorrect command arguments.");
BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
return;
}
@ -207,7 +208,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null)
{
activeChar.sendMessage("Invalid group specified.");
BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return;
}
@ -224,7 +225,7 @@ public class AdminMobGroup implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Incorrect command arguments.");
BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
return;
}
@ -232,7 +233,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null)
{
activeChar.sendMessage("Invalid group specified.");
BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return;
}
@ -249,7 +250,7 @@ public class AdminMobGroup implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Incorrect command arguments.");
BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
return;
}
@ -257,7 +258,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null)
{
activeChar.sendMessage("Invalid group specified.");
BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return;
}
@ -274,7 +275,7 @@ public class AdminMobGroup implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Incorrect command arguments.");
BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
return;
}
@ -282,7 +283,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null)
{
activeChar.sendMessage("Invalid group specified.");
BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return;
}
@ -305,13 +306,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;
}
@ -319,14 +320,14 @@ public class AdminMobGroup implements IAdminCommandHandler
if (template == null)
{
activeChar.sendMessage("Invalid NPC ID specified.");
BuilderUtil.sendSysMessage(activeChar, "Invalid NPC ID specified.");
return;
}
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)
@ -339,7 +340,7 @@ public class AdminMobGroup implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //mobgroup_remove <groupId>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_remove <groupId>");
return;
}
@ -347,7 +348,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null)
{
activeChar.sendMessage("Invalid group specified.");
BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return;
}
@ -356,7 +357,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.");
}
}
@ -388,7 +389,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;
}
@ -396,7 +397,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null)
{
activeChar.sendMessage("Invalid group specified.");
BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return;
}
@ -411,7 +412,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)
@ -424,7 +425,7 @@ public class AdminMobGroup implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //mobgroup_unspawn <groupId>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_unspawn <groupId>");
return;
}
@ -432,14 +433,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)
@ -452,7 +453,7 @@ public class AdminMobGroup implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //mobgroup_kill <groupId>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_kill <groupId>");
return;
}
@ -460,7 +461,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null)
{
activeChar.sendMessage("Invalid group specified.");
BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return;
}
@ -478,7 +479,7 @@ public class AdminMobGroup implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //mobgroup_casting <groupId>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //mobgroup_casting <groupId>");
return;
}
@ -486,7 +487,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null)
{
activeChar.sendMessage("Invalid group specified.");
BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return;
}
@ -506,7 +507,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;
}
@ -514,7 +515,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null)
{
activeChar.sendMessage("Invalid group specified.");
BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return;
}
@ -528,7 +529,7 @@ public class AdminMobGroup implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Incorrect command arguments.");
BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
}
}
@ -550,7 +551,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;
}
@ -558,7 +559,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null)
{
activeChar.sendMessage("Invalid group specified.");
BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return;
}
@ -566,7 +567,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (othGroup == null)
{
activeChar.sendMessage("Incorrect target group.");
BuilderUtil.sendSysMessage(activeChar, "Incorrect target group.");
return;
}
@ -586,7 +587,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;
}
@ -594,7 +595,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null)
{
activeChar.sendMessage("Invalid group specified.");
BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return;
}
@ -608,7 +609,7 @@ public class AdminMobGroup implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Incorrect command arguments.");
BuilderUtil.sendSysMessage(activeChar, "Incorrect command arguments.");
}
}
@ -635,7 +636,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;
}
@ -643,7 +644,7 @@ public class AdminMobGroup implements IAdminCommandHandler
if (group == null)
{
activeChar.sendMessage("Invalid group specified.");
BuilderUtil.sendSysMessage(activeChar, "Invalid group specified.");
return;
}
@ -654,7 +655,7 @@ public class AdminMobGroup implements IAdminCommandHandler
{
MobGroup[] mobGroupList = MobGroupTable.getInstance().getGroups();
activeChar.sendMessage("======= <Mob Groups> =======");
BuilderUtil.sendSysMessage(activeChar, "======= <Mob Groups> =======");
for (MobGroup mobGroup : mobGroupList)
{

View File

@ -26,6 +26,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.serverpackets.SocialAction;
import com.l2jmobius.gameserver.util.BuilderUtil;
public class AdminNoble implements IAdminCommandHandler
{
@ -77,7 +78,7 @@ public class AdminNoble implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Impossible to set a non Player Target as noble.");
BuilderUtil.sendSysMessage(activeChar, "Impossible to set a non Player Target as noble.");
LOGGER.info("GM: " + activeChar.getName() + " is trying to set a non Player Target as noble.");
return false;

View File

@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
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
@ -61,7 +62,7 @@ public class AdminPForge implements IAdminCommandHandler
catch (Exception ex)
{
ex.printStackTrace();
activeChar.sendMessage("Usage: //forge2 format");
BuilderUtil.sendSysMessage(activeChar, "Usage: //forge2 format");
}
}
else if (command.startsWith("admin_forge3"))

View File

@ -22,6 +22,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.instancemanager.PetitionManager;
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.
@ -77,7 +78,7 @@ public class AdminPetition implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //admin_view_petition petition_id");
BuilderUtil.sendSysMessage(activeChar, "Usage: //admin_view_petition petition_id");
return false;
}
}
@ -100,7 +101,7 @@ public class AdminPetition implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //admin_accept_petition petition_id");
BuilderUtil.sendSysMessage(activeChar, "Usage: //admin_accept_petition petition_id");
return false;
}
}
@ -127,7 +128,7 @@ public class AdminPetition implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //admin_reject_petition petition_id");
BuilderUtil.sendSysMessage(activeChar, "Usage: //admin_reject_petition petition_id");
return false;
}
}

View File

@ -28,6 +28,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>
@ -103,7 +104,7 @@ public class AdminPledge implements IAdminCommandHandler
action = ActionEnum.valueOf(st.nextToken()); // create|info|dismiss|setlevel|rep
if (action == null)
{
activeChar.sendMessage("Not allowed Action on Clan");
BuilderUtil.sendSysMessage(activeChar, "Not allowed Action on Clan");
showMainPage(activeChar);
return false;
}
@ -126,7 +127,7 @@ public class AdminPledge implements IAdminCommandHandler
{
if ((parameter == null) || (parameter.length() == 0))
{
activeChar.sendMessage("Please, enter clan name.");
BuilderUtil.sendSysMessage(activeChar, "Please, enter clan name.");
showMainPage(activeChar);
return false;
}
@ -135,11 +136,11 @@ 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());
return true;
}
player.setClanCreateExpiryTime(cet);
activeChar.sendMessage("There was a problem while creating the clan.");
BuilderUtil.sendSysMessage(activeChar, "There was a problem while creating the clan.");
showMainPage(activeChar);
return false;
}
@ -149,10 +150,10 @@ public class AdminPledge implements IAdminCommandHandler
final L2Clan clan = player.getClan();
if (clan == null)
{
activeChar.sendMessage("Clan disbanded.");
BuilderUtil.sendSysMessage(activeChar, "Clan disbanded.");
return true;
}
activeChar.sendMessage("There was a problem while destroying the clan.");
BuilderUtil.sendSysMessage(activeChar, "There was a problem while destroying the clan.");
showMainPage(activeChar);
return false;
}
@ -165,7 +166,7 @@ public class AdminPledge implements IAdminCommandHandler
{
if (parameter == null)
{
activeChar.sendMessage("Usage: //pledge <setlevel|rep> <number>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //pledge <setlevel|rep> <number>");
showMainPage(activeChar);
return false;
}
@ -176,27 +177,27 @@ public class AdminPledge implements IAdminCommandHandler
}
catch (NumberFormatException nfe)
{
activeChar.sendMessage("Points incorrect.");
activeChar.sendMessage("Usage: //pledge <setlevel|rep> <number>");
BuilderUtil.sendSysMessage(activeChar, "Points incorrect.");
BuilderUtil.sendSysMessage(activeChar, "Usage: //pledge <setlevel|rep> <number>");
showMainPage(activeChar);
return false;
}
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.setReputationScore(clan.getReputationScore() + 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());
return true;
}
case setlevel:
{
if (parameter == null)
{
activeChar.sendMessage("Usage: //pledge <setlevel|rep> <number>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //pledge <setlevel|rep> <number>");
showMainPage(activeChar);
return false;
}
@ -207,25 +208,25 @@ public class AdminPledge implements IAdminCommandHandler
}
catch (NumberFormatException nfe)
{
activeChar.sendMessage("Level incorrect.");
activeChar.sendMessage("Usage: //pledge <setlevel|rep> <number>");
BuilderUtil.sendSysMessage(activeChar, "Level incorrect.");
BuilderUtil.sendSysMessage(activeChar, "Usage: //pledge <setlevel|rep> <number>");
showMainPage(activeChar);
return false;
}
if ((level >= 0) && (level < 9))
{
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());
return true;
}
activeChar.sendMessage("Level incorrect.");
activeChar.sendMessage("Usage: //pledge <setlevel|rep> <number>");
BuilderUtil.sendSysMessage(activeChar, "Level incorrect.");
BuilderUtil.sendSysMessage(activeChar, "Usage: //pledge <setlevel|rep> <number>");
showMainPage(activeChar);
return false;
}
default:
{
activeChar.sendMessage("Clan Action not allowed...");
BuilderUtil.sendSysMessage(activeChar, "Clan Action not allowed...");
showMainPage(activeChar);
return false;
}
@ -238,7 +239,7 @@ public class AdminPledge implements IAdminCommandHandler
}
default:
{
activeChar.sendMessage("Clan command not allowed");
BuilderUtil.sendSysMessage(activeChar, "Clan command not allowed");
showMainPage(activeChar);
return false;
}

View File

@ -25,6 +25,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;
/**
* This class handles following admin commands: polymorph
@ -71,7 +72,7 @@ public class AdminPolymorph implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //polymorph [type] <id>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //polymorph [type] <id>");
}
}
else if (command.equals("admin_unpolymorph"))
@ -118,7 +119,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
{
@ -137,7 +138,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

@ -19,6 +19,7 @@ package com.l2jmobius.gameserver.handler.admincommandhandlers;
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.instancemanager.QuestManager;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.util.BuilderUtil;
public class AdminQuest implements IAdminCommandHandler
{
@ -54,7 +55,7 @@ public class AdminQuest implements IAdminCommandHandler
if (parts.length < 2)
{
activeChar.sendMessage("Syntax: //quest_reload <questFolder>.<questSubFolders...>.questName> or //quest_reload <id>");
BuilderUtil.sendSysMessage(activeChar, "Syntax: //quest_reload <questFolder>.<questSubFolders...>.questName> or //quest_reload <id>");
}
else
{
@ -65,22 +66,22 @@ public class AdminQuest implements IAdminCommandHandler
if (QuestManager.getInstance().reload(questId))
{
activeChar.sendMessage("Quest Reloaded Successfully.");
BuilderUtil.sendSysMessage(activeChar, "Quest Reloaded Successfully.");
}
else
{
activeChar.sendMessage("Quest Reloaded Failed");
BuilderUtil.sendSysMessage(activeChar, "Quest Reloaded Failed");
}
}
catch (NumberFormatException e)
{
if (QuestManager.getInstance().reload(parts[1]))
{
activeChar.sendMessage("Quest Reloaded Successfully.");
BuilderUtil.sendSysMessage(activeChar, "Quest Reloaded Successfully.");
}
else
{
activeChar.sendMessage("Quest Reloaded Failed");
BuilderUtil.sendSysMessage(activeChar, "Quest Reloaded Failed");
}
}
}

View File

@ -34,6 +34,7 @@ import com.l2jmobius.gameserver.instancemanager.QuestManager;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.multisell.L2Multisell;
import com.l2jmobius.gameserver.scripting.L2ScriptEngineManager;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* @author KidZor
@ -56,7 +57,7 @@ public class AdminReload implements IAdminCommandHandler
if (!st.hasMoreTokens())
{
activeChar.sendMessage("Usage: //reload <type>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //reload <type>");
return false;
}
@ -68,87 +69,87 @@ public class AdminReload implements IAdminCommandHandler
{
L2Multisell.getInstance().reload();
sendReloadPage(activeChar);
activeChar.sendMessage("Multisell reloaded.");
BuilderUtil.sendSysMessage(activeChar, "Multisell reloaded.");
}
else if (type.startsWith("teleport"))
{
TeleportLocationTable.getInstance().reloadAll();
sendReloadPage(activeChar);
activeChar.sendMessage("Teleport location table reloaded.");
BuilderUtil.sendSysMessage(activeChar, "Teleport location table reloaded.");
}
else if (type.startsWith("skill"))
{
SkillTable.getInstance().reload();
sendReloadPage(activeChar);
activeChar.sendMessage("Skills reloaded.");
BuilderUtil.sendSysMessage(activeChar, "Skills reloaded.");
}
else if (type.equals("npc"))
{
NpcTable.getInstance().reloadAllNpc();
sendReloadPage(activeChar);
activeChar.sendMessage("Npcs reloaded.");
BuilderUtil.sendSysMessage(activeChar, "Npcs reloaded.");
}
else if (type.startsWith("htm"))
{
HtmCache.getInstance().reload();
sendReloadPage(activeChar);
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");
}
else if (type.startsWith("item"))
{
ItemTable.getInstance().reload();
sendReloadPage(activeChar);
activeChar.sendMessage("Item templates reloaded");
BuilderUtil.sendSysMessage(activeChar, "Item templates reloaded");
}
else if (type.startsWith("instancemanager"))
{
Manager.reloadAll();
sendReloadPage(activeChar);
activeChar.sendMessage("All instance manager has been reloaded");
BuilderUtil.sendSysMessage(activeChar, "All instance manager has been reloaded");
}
else if (type.startsWith("npcwalkers"))
{
NpcWalkerRoutesTable.getInstance().load();
sendReloadPage(activeChar);
activeChar.sendMessage("All NPC walker routes have been reloaded");
BuilderUtil.sendSysMessage(activeChar, "All NPC walker routes have been reloaded");
}
else if (type.startsWith("quests"))
{
final String folder = "quests";
QuestManager.getInstance().reload(folder);
sendReloadPage(activeChar);
activeChar.sendMessage("Quests Reloaded.");
BuilderUtil.sendSysMessage(activeChar, "Quests Reloaded.");
}
else if (type.startsWith("npcbuffers"))
{
DatatablesManager.reloadAll();
sendReloadPage(activeChar);
activeChar.sendMessage("All Buffer skills tables have been reloaded");
BuilderUtil.sendSysMessage(activeChar, "All Buffer skills tables have been reloaded");
}
else if (type.equals("configs"))
{
Config.load();
sendReloadPage(activeChar);
activeChar.sendMessage("Server Config Reloaded.");
BuilderUtil.sendSysMessage(activeChar, "Server Config Reloaded.");
}
else if (type.equals("tradelist"))
{
TradeController.reload();
sendReloadPage(activeChar);
activeChar.sendMessage("TradeList Table reloaded.");
BuilderUtil.sendSysMessage(activeChar, "TradeList Table reloaded.");
}
else if (type.equals("dbs"))
{
DatatablesManager.reloadAll();
sendReloadPage(activeChar);
activeChar.sendMessage("BufferSkillsTable reloaded.");
activeChar.sendMessage("NpcBufferSkillIdsTable reloaded.");
activeChar.sendMessage("AccessLevels reloaded.");
activeChar.sendMessage("AdminCommandAccessRights reloaded.");
activeChar.sendMessage("GmListTable reloaded.");
activeChar.sendMessage("ClanTable reloaded.");
activeChar.sendMessage("AugmentationData reloaded.");
activeChar.sendMessage("HelperBuffTable reloaded.");
BuilderUtil.sendSysMessage(activeChar, "BufferSkillsTable reloaded.");
BuilderUtil.sendSysMessage(activeChar, "NpcBufferSkillIdsTable reloaded.");
BuilderUtil.sendSysMessage(activeChar, "AccessLevels reloaded.");
BuilderUtil.sendSysMessage(activeChar, "AdminCommandAccessRights reloaded.");
BuilderUtil.sendSysMessage(activeChar, "GmListTable reloaded.");
BuilderUtil.sendSysMessage(activeChar, "ClanTable reloaded.");
BuilderUtil.sendSysMessage(activeChar, "AugmentationData reloaded.");
BuilderUtil.sendSysMessage(activeChar, "HelperBuffTable reloaded.");
}
else if (type.startsWith("scripts_custom"))
{
@ -159,15 +160,15 @@ public class AdminReload implements IAdminCommandHandler
}
catch (Exception ioe)
{
activeChar.sendMessage("Failed loading " + Config.DATAPACK_ROOT + "/data/scripts/custom scripts, no script going to be loaded");
BuilderUtil.sendSysMessage(activeChar, "Failed loading " + Config.DATAPACK_ROOT + "/data/scripts/custom scripts, no script going to be loaded");
ioe.printStackTrace();
}
}
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.");
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //reload <type>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //reload <type>");
}
}
return true;

View File

@ -27,6 +27,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
@ -105,12 +106,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;
}
}
@ -160,12 +161,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

@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.L2TradeList;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.ActionFailed;
import com.l2jmobius.gameserver.network.serverpackets.BuyList;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles following admin commands: - gmshop = shows menu - buy id = shows shop with respective id
@ -56,7 +57,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

@ -27,6 +27,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;
/**
* This class handles following admin commands: - server_shutdown [sec] = shows menu or shuts down server in sec seconds
@ -76,7 +77,7 @@ public class AdminShutdown implements IAdminCommandHandler
serverShutdown(activeChar, val, false);
return true;
}
activeChar.sendMessage("Negative Value is not allowed");
BuilderUtil.sendSysMessage(activeChar, "Negative Value is not allowed");
return false;
}
catch (StringIndexOutOfBoundsException e)
@ -101,7 +102,7 @@ public class AdminShutdown implements IAdminCommandHandler
serverShutdown(activeChar, val, true);
return true;
}
activeChar.sendMessage("Negative Value is not allowed");
BuilderUtil.sendSysMessage(activeChar, "Negative Value is not allowed");
return false;
}
catch (StringIndexOutOfBoundsException e)

View File

@ -33,6 +33,7 @@ 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.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class handles all siege commands: TODO: change the class name, and neaten it up
@ -118,7 +119,7 @@ public class AdminSiege implements IAdminCommandHandler
}
else if (SiegeManager.getInstance().checkIsRegistered(player.getClan(), castle.getCastleId()))
{
activeChar.sendMessage("Clan is already registered!");
BuilderUtil.sendSysMessage(activeChar, "Clan is already registered!");
}
else
{
@ -145,7 +146,7 @@ public class AdminSiege implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //add_guard npcId");
BuilderUtil.sendSysMessage(activeChar, "Usage: //add_guard npcId");
}
}
else if (command.equalsIgnoreCase("admin_clear_siege_list"))
@ -187,7 +188,7 @@ public class AdminSiege implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Unable to remove castle");
BuilderUtil.sendSysMessage(activeChar, "Unable to remove castle");
}
}
else if (command.equalsIgnoreCase("admin_clanhallset"))
@ -198,7 +199,7 @@ public class AdminSiege implements IAdminCommandHandler
}
else if (!ClanHallManager.getInstance().isFree(clanhall.getId()))
{
activeChar.sendMessage("This ClanHall isn't free!");
BuilderUtil.sendSysMessage(activeChar, "This ClanHall isn't free!");
}
else if (player.getClan().getHasHideout() == 0)
{
@ -211,7 +212,7 @@ public class AdminSiege implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("You have already a ClanHall!");
BuilderUtil.sendSysMessage(activeChar, "You have already a ClanHall!");
}
}
else if (command.equalsIgnoreCase("admin_clanhalldel"))
@ -223,7 +224,7 @@ public class AdminSiege implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("This ClanHall is already Free!");
BuilderUtil.sendSysMessage(activeChar, "This ClanHall is already Free!");
}
}
else if (command.equalsIgnoreCase("admin_clanhallopendoors"))

View File

@ -31,6 +31,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: - show_skills - remove_skills - skill_list - skill_index - add_skill - remove_skill - get_skills - reset_skills - give_all_skills - remove_all_skills - add_clan_skills
@ -108,7 +109,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"))
@ -126,7 +127,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"))
@ -159,7 +160,7 @@ public class AdminSkill implements IAdminCommandHandler
player.removeSkill(skill);
}
activeChar.sendMessage("You removed all skills from " + player.getName());
BuilderUtil.sendSysMessage(activeChar, "You removed all skills from " + player.getName());
player.sendMessage("Admin removed all skills from you.");
player.sendSkillList();
}
@ -177,7 +178,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>");
}
}
return true;
@ -238,7 +239,7 @@ public class AdminSkill implements IAdminCommandHandler
// Notify player and admin
player.sendMessage("A GM gave you " + skillCounter + " skills.");
activeChar.sendMessage("You gave " + skillCounter + " skills to " + player.getName());
BuilderUtil.sendSysMessage(activeChar, "You gave " + skillCounter + " skills to " + player.getName());
player.sendSkillList();
}
@ -389,7 +390,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();
}
@ -413,7 +414,7 @@ public class AdminSkill implements IAdminCommandHandler
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
{
@ -440,7 +441,7 @@ public class AdminSkill implements IAdminCommandHandler
}
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.");
activeChar.sendSkillList();
}
@ -502,7 +503,7 @@ public class AdminSkill implements IAdminCommandHandler
player.sendMessage("Admin gave you the skill " + name + ".");
player.addSkill(skill, true);
// Admin information
activeChar.sendMessage("You gave the skill " + name + " to " + player.getName() + ".");
BuilderUtil.sendSysMessage(activeChar, "You gave the skill " + name + " to " + player.getName() + ".");
if (Config.DEBUG)
{
@ -513,7 +514,7 @@ public class AdminSkill implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Error: there is no such skill.");
BuilderUtil.sendSysMessage(activeChar, "Error: there is no such skill.");
}
showMainPage(activeChar); // Back to start
@ -543,7 +544,7 @@ 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() + ".");
if (Config.DEBUG)
{
@ -554,7 +555,7 @@ public class AdminSkill implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Error: there is no such skill.");
BuilderUtil.sendSysMessage(activeChar, "Error: there is no such skill.");
}
// Back to previous page
@ -588,7 +589,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;
@ -603,7 +604,7 @@ public class AdminSkill implements IAdminCommandHandler
player.sendPacket(sm);
player.getClan().broadcastToOnlineMembers(sm);
player.getClan().addNewSkill(skill);
activeChar.sendMessage("You gave the Clan Skill: " + skillname + " to the clan " + player.getClan().getName() + ".");
BuilderUtil.sendSysMessage(activeChar, "You gave the Clan Skill: " + skillname + " to the clan " + player.getClan().getName() + ".");
activeChar.getClan().broadcastToOnlineMembers(new PledgeSkillList(activeChar.getClan()));
@ -615,6 +616,6 @@ public class AdminSkill implements IAdminCommandHandler
showMainPage(activeChar);
return;
}
activeChar.sendMessage("Error: there is no such skill.");
BuilderUtil.sendSysMessage(activeChar, "Error: there is no such skill.");
}
}

View File

@ -37,6 +37,7 @@ import com.l2jmobius.gameserver.model.spawn.L2Spawn;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.templates.chars.L2NpcTemplate;
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
@ -236,7 +237,7 @@ public class AdminSpawn implements IAdminCommandHandler
if (template1 == null)
{
activeChar.sendMessage("Attention, wrong NPC ID/Name");
BuilderUtil.sendSysMessage(activeChar, "Attention, wrong NPC ID/Name");
return;
}
@ -256,9 +257,9 @@ public class AdminSpawn implements IAdminCommandHandler
if (RaidBossSpawnManager.getInstance().isDefined(spawn.getNpcId()) || GrandBossManager.getInstance().isDefined(spawn.getNpcId()))
{
activeChar.sendMessage("Another instance of " + template1.name + " already present into database:");
activeChar.sendMessage("It will be spawned but not saved on Database");
activeChar.sendMessage("After server restart or raid dead, the spawned npc will desappear");
BuilderUtil.sendSysMessage(activeChar, "Another instance of " + template1.name + " already present into database:");
BuilderUtil.sendSysMessage(activeChar, "It will be spawned but not saved on Database");
BuilderUtil.sendSysMessage(activeChar, "After server restart or raid dead, the spawned npc will desappear");
permanent = false;
spawn.set_customBossInstance(true); // for raids, this value is used in order to segnalate to not save respawn time - status for custom instance
}
@ -280,7 +281,7 @@ public class AdminSpawn implements IAdminCommandHandler
spawn.stopRespawn();
}
activeChar.sendMessage("Created " + template1.name + " on " + target.getObjectId());
BuilderUtil.sendSysMessage(activeChar, "Created " + template1.name + " on " + target.getObjectId());
// }
}
catch (Exception e)

View File

@ -114,7 +114,7 @@ public class AdminTeleport implements IAdminCommandHandler
final String[] param = command.split(" ");
if (param.length != 2)
{
activeChar.sendMessage("Usage: //sendhome <playername>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //sendhome <playername>");
return false;
}
final String targetName = param[1];
@ -127,7 +127,7 @@ public class AdminTeleport implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("User is not online.");
BuilderUtil.sendSysMessage(activeChar, "User is not online.");
}
}
catch (StringIndexOutOfBoundsException e)
@ -170,14 +170,14 @@ public class AdminTeleport implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //teleportto <char_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //teleportto <char_name>");
return false;
}
L2PcInstance player = L2World.getInstance().getPlayer(val);
if (player == null)
{
activeChar.sendMessage("ATTENTION: char_name must be valid character");
activeChar.sendMessage("Usage: //teleportto <char_name>");
BuilderUtil.sendSysMessage(activeChar, "ATTENTION: char_name must be valid character");
BuilderUtil.sendSysMessage(activeChar, "Usage: //teleportto <char_name>");
return false;
}
teleportToCharacter(activeChar, player);
@ -196,31 +196,31 @@ public class AdminTeleport implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //recall_party <party_leader_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //recall_party <party_leader_name>");
return false;
}
if (val.equals(""))
{
activeChar.sendMessage("Usage: //recall_party <party_leader_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //recall_party <party_leader_name>");
return false;
}
final L2PcInstance player = L2World.getInstance().getPlayer(val);
if (player == null)
{
activeChar.sendMessage("ATTENTION: party_leader_name must be valid character");
activeChar.sendMessage("//recall_party <party_leader_name>");
BuilderUtil.sendSysMessage(activeChar, "ATTENTION: party_leader_name must be valid character");
BuilderUtil.sendSysMessage(activeChar, "//recall_party <party_leader_name>");
return false;
}
if (player.getParty() == null)
{
activeChar.sendMessage("The player must have a party");
activeChar.sendMessage("//recall_party <party_leader_name>");
BuilderUtil.sendSysMessage(activeChar, "The player must have a party");
BuilderUtil.sendSysMessage(activeChar, "//recall_party <party_leader_name>");
return false;
}
if (!player.getParty().isLeader(player))
{
activeChar.sendMessage("The player must be the party_leader");
activeChar.sendMessage("//recall_party <party_leader_name>");
BuilderUtil.sendSysMessage(activeChar, "The player must be the party_leader");
BuilderUtil.sendSysMessage(activeChar, "//recall_party <party_leader_name>");
return false;
}
for (L2PcInstance partyMember : player.getParty().getPartyMembers())
@ -248,20 +248,20 @@ public class AdminTeleport implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //move_to <coordinates>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //move_to <coordinates>");
AdminHelpPage.showHelpPage(activeChar, "teleports.htm");
return false;
}
}
else
{
activeChar.sendMessage("Usage: //move_to <coordinates>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //move_to <coordinates>");
AdminHelpPage.showHelpPage(activeChar, "teleports.htm");
return false;
}
if ((x == 0) && (y == 0))
{
activeChar.sendMessage("Usage: //move_to <valid_coordinates>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //move_to <valid_coordinates>");
AdminHelpPage.showHelpPage(activeChar, "teleports.htm");
return false;
}
@ -286,20 +286,20 @@ public class AdminTeleport implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //teleport_character <coordinates>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //teleport_character <coordinates>");
showTeleportCharWindow(activeChar);
return false;
}
}
else
{
activeChar.sendMessage("Usage: //teleport_character <coordinates>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //teleport_character <coordinates>");
showTeleportCharWindow(activeChar);
return false;
}
if ((x == 0) && (y == 0))
{
activeChar.sendMessage("Usage: //teleport_character <valid_coordinates>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //teleport_character <valid_coordinates>");
showTeleportCharWindow(activeChar);
return false;
}
@ -312,8 +312,8 @@ public class AdminTeleport implements IAdminCommandHandler
}
if (player == null)
{
activeChar.sendMessage("Select valid player");
activeChar.sendMessage("Usage: //teleport_character <valid_coordinates>");
BuilderUtil.sendSysMessage(activeChar, "Select valid player");
BuilderUtil.sendSysMessage(activeChar, "Usage: //teleport_character <valid_coordinates>");
showTeleportCharWindow(activeChar);
return false;
}
@ -329,19 +329,19 @@ public class AdminTeleport implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Usage: //recall <char_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //recall <char_name>");
return false;
}
if (val.equals(""))
{
activeChar.sendMessage("Usage: //recall <char_name>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //recall <char_name>");
return false;
}
final L2PcInstance player = L2World.getInstance().getPlayer(val);
if (player == null)
{
activeChar.sendMessage("ATTENTION: char_name must be valid character");
activeChar.sendMessage("Usage: //recall <char_name>");
BuilderUtil.sendSysMessage(activeChar, "ATTENTION: char_name must be valid character");
BuilderUtil.sendSysMessage(activeChar, "Usage: //recall <char_name>");
return false;
}
teleportTo(player, activeChar.getX(), activeChar.getY(), activeChar.getZ());
@ -365,18 +365,18 @@ public class AdminTeleport implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("Usage: //walk <coordinates>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //walk <coordinates>");
return false;
}
}
else
{
activeChar.sendMessage("Usage: //walk <coordinates>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //walk <coordinates>");
return false;
}
if ((x == 0) && (y == 0))
{
activeChar.sendMessage("Usage: //walk <valid_coordinates>");
BuilderUtil.sendSysMessage(activeChar, "Usage: //walk <valid_coordinates>");
return false;
}
final Location pos = new Location(x, y, z, 0);
@ -447,7 +447,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)");
return false;
}
}
@ -483,7 +483,7 @@ public class AdminTeleport implements IAdminCommandHandler
}
default:
{
activeChar.sendMessage("Defined mode not allowed..");
BuilderUtil.sendSysMessage(activeChar, "Defined mode not allowed..");
return false;
}
}
@ -582,9 +582,9 @@ public class AdminTeleport implements IAdminCommandHandler
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
activeChar.teleToLocation(x, y, z, true);
activeChar.sendMessage("You have teleported to character " + player.getName() + ".");
BuilderUtil.sendSysMessage(activeChar, "You have teleported to character " + player.getName() + ".");
} /*
* else if(npc!=null) { int x = npc.getX(); int y = npc.getY(); int z = npc.getZ(); activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); activeChar.teleToLocation(x, y, z, true); activeChar.sendMessage("You have teleported to npc " + npc.getName() + "."); }
* else if(npc!=null) { int x = npc.getX(); int y = npc.getY(); int z = npc.getZ(); activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); activeChar.teleToLocation(x, y, z, true); BuilderUtil.sendSysMessage(activeChar, "You have teleported to npc " + npc.getName() + "."); }
*/
}
@ -602,7 +602,7 @@ public class AdminTeleport implements IAdminCommandHandler
if (template1 == null)
{
activeChar.sendMessage("Incorrect monster template.");
BuilderUtil.sendSysMessage(activeChar, "Incorrect monster template.");
LOGGER.warning("ERROR: NPC " + target.getObjectId() + " has a 'null' template.");
return;
}
@ -611,7 +611,7 @@ public class AdminTeleport implements IAdminCommandHandler
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;
}
@ -651,7 +651,7 @@ public class AdminTeleport implements IAdminCommandHandler
}
catch (Exception e)
{
activeChar.sendMessage("Target is not in game.");
BuilderUtil.sendSysMessage(activeChar, "Target is not in game.");
}
}
else

View File

@ -29,6 +29,7 @@ import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* This class ...
@ -64,25 +65,25 @@ public class AdminTest implements IAdminCommandHandler
{
final L2Character target = (L2Character) activeChar.getTarget();
activeChar.sendMessage("Activechar Mcrit " + activeChar.getMCriticalHit(null, null));
activeChar.sendMessage("Activechar baseMCritRate " + activeChar.getTemplate().baseMCritRate);
BuilderUtil.sendSysMessage(activeChar, "Activechar Mcrit " + activeChar.getMCriticalHit(null, null));
BuilderUtil.sendSysMessage(activeChar, "Activechar baseMCritRate " + activeChar.getTemplate().baseMCritRate);
if (target != null)
{
activeChar.sendMessage("Target Mcrit " + target.getMCriticalHit(null, null));
activeChar.sendMessage("Target baseMCritRate " + target.getTemplate().baseMCritRate);
BuilderUtil.sendSysMessage(activeChar, "Target Mcrit " + target.getMCriticalHit(null, null));
BuilderUtil.sendSysMessage(activeChar, "Target baseMCritRate " + target.getTemplate().baseMCritRate);
}
}
if (command.equals("admin_addbufftest"))
{
final L2Character target = (L2Character) activeChar.getTarget();
activeChar.sendMessage("cast");
BuilderUtil.sendSysMessage(activeChar, "cast");
final L2Skill skill = SkillTable.getInstance().getInfo(1085, 3);
if (target != null)
{
activeChar.sendMessage("target locked");
BuilderUtil.sendSysMessage(activeChar, "target locked");
for (int i = 0; i < 100;)
{
@ -91,7 +92,7 @@ public class AdminTest implements IAdminCommandHandler
continue;
}
activeChar.sendMessage("Casting " + i);
BuilderUtil.sendSysMessage(activeChar, "Casting " + i);
activeChar.useMagic(skill, false, false);
i++;
}
@ -110,23 +111,23 @@ public class AdminTest implements IAdminCommandHandler
}
catch (NumberFormatException | NoSuchElementException e)
{
activeChar.sendMessage("Command format is //skill_test <ID>");
BuilderUtil.sendSysMessage(activeChar, "Command format is //skill_test <ID>");
}
}
else if (command.equals("admin_mp on"))
{
// .startPacketMonitor();
activeChar.sendMessage("command not working");
BuilderUtil.sendSysMessage(activeChar, "command not working");
}
else if (command.equals("admin_mp off"))
{
// .stopPacketMonitor();
activeChar.sendMessage("command not working");
BuilderUtil.sendSysMessage(activeChar, "command not working");
}
else if (command.equals("admin_mp dump"))
{
// .dumpPacketHistory();
activeChar.sendMessage("command not working");
BuilderUtil.sendSysMessage(activeChar, "command not working");
}
else if (command.equals("admin_known on"))
{
@ -138,13 +139,13 @@ public class AdminTest implements IAdminCommandHandler
}
else if (command.equals("admin_test"))
{
activeChar.sendMessage("Now the server will send a packet that client cannot read correctly");
activeChar.sendMessage("generating a critical error..");
BuilderUtil.sendSysMessage(activeChar, "Now the server will send a packet that client cannot read correctly");
BuilderUtil.sendSysMessage(activeChar, "generating a critical error..");
int i = 5;
while (i > 0)
{
activeChar.sendMessage("Client will crash in " + i + " seconds");
BuilderUtil.sendSysMessage(activeChar, "Client will crash in " + i + " seconds");
try
{

View File

@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.position.Location;
import com.l2jmobius.gameserver.model.entity.event.TvT;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
public class AdminTvTEngine implements IAdminCommandHandler
{
@ -83,7 +84,7 @@ public class AdminTvTEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
else if (command.startsWith("admin_tvt_desc "))
@ -94,7 +95,7 @@ public class AdminTvTEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
else if (command.startsWith("admin_tvt_minlvl "))
@ -110,7 +111,7 @@ public class AdminTvTEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
else if (command.startsWith("admin_tvt_maxlvl "))
@ -126,7 +127,7 @@ public class AdminTvTEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
else if (command.startsWith("admin_tvt_minplayers "))
@ -137,7 +138,7 @@ public class AdminTvTEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
else if (command.startsWith("admin_tvt_maxplayers "))
@ -148,7 +149,7 @@ public class AdminTvTEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
else if (command.startsWith("admin_tvt_join_loc "))
@ -159,7 +160,7 @@ public class AdminTvTEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
else if (command.startsWith("admin_tvt_npc "))
@ -170,7 +171,7 @@ public class AdminTvTEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
else if (command.equals("admin_tvt_npc_pos"))
@ -186,7 +187,7 @@ public class AdminTvTEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
else if (command.startsWith("admin_tvt_reward_amount "))
@ -197,7 +198,7 @@ public class AdminTvTEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
else if (command.startsWith("admin_tvt_jointime "))
@ -208,7 +209,7 @@ public class AdminTvTEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
else if (command.startsWith("admin_tvt_eventtime "))
@ -219,7 +220,7 @@ public class AdminTvTEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
else if (command.startsWith("admin_tvt_interval "))
@ -230,7 +231,7 @@ public class AdminTvTEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot perform requested operation, event in progress");
BuilderUtil.sendSysMessage(activeChar, "Cannot perform requested operation, event in progress");
}
}
else if (command.startsWith("admin_tvt_team_add "))
@ -262,7 +263,7 @@ public class AdminTvTEngine implements IAdminCommandHandler
if (params.length != 3)
{
activeChar.sendMessage("Wrong usege: //tvt_team_color <colorHex> <teamName>");
BuilderUtil.sendSysMessage(activeChar, "Wrong usege: //tvt_team_color <colorHex> <teamName>");
return false;
}
@ -277,7 +278,7 @@ public class AdminTvTEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot startJoin, check LOGGER for info..");
BuilderUtil.sendSysMessage(activeChar, "Cannot startJoin, check LOGGER for info..");
}
}
else if (command.equals("admin_tvt_teleport"))
@ -293,7 +294,7 @@ public class AdminTvTEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Cannot startEvent, check LOGGER for info..");
BuilderUtil.sendSysMessage(activeChar, "Cannot startEvent, check LOGGER for info..");
}
}
else if (command.equals("admin_tvt_startevent"))
@ -303,7 +304,7 @@ public class AdminTvTEngine implements IAdminCommandHandler
}
else if (command.equals("admin_tvt_abort"))
{
activeChar.sendMessage("Aborting event");
BuilderUtil.sendSysMessage(activeChar, "Aborting event");
TvT.abortEvent();
showMainPage(activeChar);
}
@ -330,7 +331,7 @@ public class AdminTvTEngine implements IAdminCommandHandler
}
else
{
activeChar.sendMessage("Wrong usege: join time or event time invalid.");
BuilderUtil.sendSysMessage(activeChar, "Wrong usege: join time or event time invalid.");
}
showMainPage(activeChar);
@ -355,11 +356,11 @@ public class AdminTvTEngine implements IAdminCommandHandler
if (playerToKick != null)
{
TvT.kickPlayerFromTvt(playerToKick);
activeChar.sendMessage("You kicked " + playerToKick.getName() + " from the TvT.");
BuilderUtil.sendSysMessage(activeChar, "You kicked " + playerToKick.getName() + " from the TvT.");
}
else
{
activeChar.sendMessage("Wrong usege: //tvtkick <player>");
BuilderUtil.sendSysMessage(activeChar, "Wrong usege: //tvtkick <player>");
}
}
}

View File

@ -20,6 +20,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.event.VIP;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.util.BuilderUtil;
public class AdminVIPEngine implements IAdminCommandHandler
{
@ -60,7 +61,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
// if(VIP._started == true || VIP._joining == true)
if (VIP._inProgress)
{
activeChar.sendMessage("Cannot change variables when event has already started");
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
return false;
}
@ -69,7 +70,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
if (params.length != 2)
{
activeChar.sendMessage("Wrong usage: //vip_setteam <team>");
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_setteam <team>");
return false;
}
@ -81,7 +82,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
{
if (VIP._started || VIP._joining)
{
activeChar.sendMessage("Cannot change variables when event has already started");
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
return false;
}
@ -94,7 +95,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
// if(VIP._started == true || VIP._joining == true)
if (VIP._inProgress)
{
activeChar.sendMessage("Cannot change variables when event has already started");
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
return false;
}
@ -103,7 +104,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
if (params.length != 2)
{
activeChar.sendMessage("Wrong usage: //vip_settime <time>");
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_settime <time>");
return false;
}
@ -116,7 +117,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
// if(VIP._started == true || VIP._joining == true)
if (VIP._inProgress)
{
activeChar.sendMessage("Cannot change variables when event has already started");
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
return false;
}
@ -125,7 +126,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
if (params.length != 2)
{
activeChar.sendMessage("Wrong usage: //vip_endnpc <npc>");
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_endnpc <npc>");
return false;
}
@ -138,7 +139,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
// if(VIP._started == true || VIP._joining == true)
if (VIP._inProgress)
{
activeChar.sendMessage("Cannot change variables when event has already started");
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
return false;
}
@ -147,7 +148,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
if (params.length != 2)
{
activeChar.sendMessage("Wrong usage: //vip_joinnpc <npc>");
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_joinnpc <npc>");
return false;
}
@ -160,7 +161,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
// if(VIP._started == true || VIP._joining == true)
if (VIP._inProgress)
{
activeChar.sendMessage("Cannot change variables when event has already started");
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
return false;
}
@ -169,7 +170,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
if (params.length != 2)
{
activeChar.sendMessage("Wrong usage: //vip_setdelay <time>");
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_setdelay <time>");
return false;
}
@ -187,7 +188,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
// if(VIP._started == true || VIP._joining == true)
if (VIP._inProgress)
{
activeChar.sendMessage("Cannot change variables when event has already started");
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
return false;
}
@ -196,7 +197,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
if (params.length != 4)
{
activeChar.sendMessage("Wrong usage: //vip_joinlocxyz <x> <y> <z>");
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_joinlocxyz <x> <y> <z>");
return false;
}
@ -209,7 +210,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
// if(VIP._started == true || VIP._joining == true)
if (VIP._inProgress)
{
activeChar.sendMessage("Cannot change variables when event has already started");
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
return false;
}
@ -218,7 +219,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
if (params.length != 2)
{
activeChar.sendMessage("Wrong usage: //vip_joinnpc <npc>");
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_joinnpc <npc>");
return false;
}
@ -231,7 +232,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
// if(VIP._started == true || VIP._joining == true)
if (VIP._inProgress)
{
activeChar.sendMessage("Cannot change variables when event has already started");
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
return false;
}
@ -240,7 +241,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
if (params.length != 2)
{
activeChar.sendMessage("Wrong usage: //vip_setarea <Area>");
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_setarea <Area>");
return false;
}
VIP._joinArea = params[1];
@ -252,7 +253,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
// if(VIP._started == true || VIP._joining == true)
if (VIP._inProgress)
{
activeChar.sendMessage("Cannot change variables when event has already started");
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
return false;
}
@ -261,7 +262,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
if (params.length != 2)
{
activeChar.sendMessage("Wrong usage: //vip_vipreward <id>");
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_vipreward <id>");
return false;
}
@ -274,7 +275,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
// if(VIP._started == true || VIP._joining == true)
if (VIP._inProgress)
{
activeChar.sendMessage("Cannot change variables when event has already started");
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
return false;
}
@ -283,7 +284,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
if (params.length != 2)
{
activeChar.sendMessage("Wrong usage: //vip_viprewardamount <amount>");
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_viprewardamount <amount>");
return false;
}
@ -296,7 +297,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
// if(VIP._started == true || VIP._joining == true)
if (VIP._inProgress)
{
activeChar.sendMessage("Cannot change variables when event has already started");
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
return false;
}
@ -305,7 +306,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
if (params.length != 2)
{
activeChar.sendMessage("Wrong usage: //vip_notvipreward <id>");
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_notvipreward <id>");
return false;
}
@ -318,7 +319,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
// if(VIP._started == true || VIP._joining == true)
if (VIP._inProgress)
{
activeChar.sendMessage("Cannot change variables when event has already started");
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
return false;
}
@ -327,7 +328,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
if (params.length != 2)
{
activeChar.sendMessage("Wrong usage: //vip_notviprewardamount <amount>");
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_notviprewardamount <amount>");
return false;
}
@ -340,7 +341,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
// if(VIP._started == true || VIP._joining == true)
if (VIP._inProgress)
{
activeChar.sendMessage("Cannot change variables when event has already started");
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
return false;
}
@ -349,7 +350,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
if (params.length != 2)
{
activeChar.sendMessage("Wrong usage: //vip_thevipreward <id>");
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_thevipreward <id>");
return false;
}
@ -362,7 +363,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
// if(VIP._started == true || VIP._joining == true)
if (VIP._inProgress)
{
activeChar.sendMessage("Cannot change variables when event has already started");
BuilderUtil.sendSysMessage(activeChar, "Cannot change variables when event has already started");
return false;
}
@ -371,7 +372,7 @@ public class AdminVIPEngine implements IAdminCommandHandler
if (params.length != 2)
{
activeChar.sendMessage("Wrong usage: //vip_theviprewardamount <amount>");
BuilderUtil.sendSysMessage(activeChar, "Wrong usage: //vip_theviprewardamount <amount>");
return false;
}

View File

@ -24,6 +24,7 @@ import com.l2jmobius.commons.database.DatabaseFactory;
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 Blaze
@ -75,7 +76,7 @@ public class AdminWalker implements IAdminCommandHandler
if (rset.next())
{
activeChar.sendMessage("Such NPC already was, we add routes");
BuilderUtil.sendSysMessage(activeChar, "Such NPC already was, we add routes");
_routeid = rset.getInt("route_id");
}
else
@ -101,7 +102,7 @@ public class AdminWalker implements IAdminCommandHandler
}
catch (NumberFormatException e)
{
activeChar.sendMessage("The incorrect identifier");
BuilderUtil.sendSysMessage(activeChar, "The incorrect identifier");
}
mainMenu(activeChar);

View File

@ -19,6 +19,7 @@ package com.l2jmobius.gameserver.handler.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;
public class AdminWho implements IAdminCommandHandler
{
@ -32,7 +33,7 @@ public class AdminWho implements IAdminCommandHandler
{
if (command.equalsIgnoreCase("admin_who"))
{
activeChar.sendMessage("SYS: current(" + L2World.getInstance().getAllPlayers().size() + "), playing(" + L2World.getInstance().getAllPlayers().size() + ")");
BuilderUtil.sendSysMessage(activeChar, "SYS: current(" + L2World.getInstance().getAllPlayers().size() + "), playing(" + L2World.getInstance().getAllPlayers().size() + ")");
}
return true;
}

View File

@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.position.Location;
import com.l2jmobius.gameserver.model.zone.ZoneId;
import com.l2jmobius.gameserver.util.BuilderUtil;
/**
* @author luisantonioa
@ -53,48 +54,48 @@ public class AdminZone implements IAdminCommandHandler
{
if (activeChar.isInsideZone(ZoneId.PVP))
{
activeChar.sendMessage("This is a PvP zone.");
BuilderUtil.sendSysMessage(activeChar, "This is a PvP zone.");
}
else
{
activeChar.sendMessage("This is NOT a PvP zone.");
BuilderUtil.sendSysMessage(activeChar, "This is NOT a PvP zone.");
}
if (activeChar.isInsideZone(ZoneId.NOLANDING))
{
activeChar.sendMessage("This is a no landing zone.");
BuilderUtil.sendSysMessage(activeChar, "This is a no landing zone.");
}
else
{
activeChar.sendMessage("This is NOT a no landing zone.");
BuilderUtil.sendSysMessage(activeChar, "This is NOT a no landing zone.");
}
if (activeChar.isInsideZone(ZoneId.NOSTORE))
{
activeChar.sendMessage("This is a no-store zone.");
BuilderUtil.sendSysMessage(activeChar, "This is a no-store zone.");
}
else
{
activeChar.sendMessage("This is NOT a no-store zone.");
BuilderUtil.sendSysMessage(activeChar, "This is NOT a no-store zone.");
}
activeChar.sendMessage("MapRegion: x:" + MapRegionTable.getInstance().getMapRegionX(activeChar.getX()) + " y:" + MapRegionTable.getInstance().getMapRegionX(activeChar.getY()));
BuilderUtil.sendSysMessage(activeChar, "MapRegion: x:" + MapRegionTable.getInstance().getMapRegionX(activeChar.getX()) + " y:" + MapRegionTable.getInstance().getMapRegionX(activeChar.getY()));
activeChar.sendMessage("Closest Town: " + MapRegionTable.getInstance().getClosestTownName(activeChar));
BuilderUtil.sendSysMessage(activeChar, "Closest Town: " + MapRegionTable.getInstance().getClosestTownName(activeChar));
Location loc;
loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, MapRegionTable.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 = MapRegionTable.getInstance().getTeleToLocation(activeChar, MapRegionTable.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 = MapRegionTable.getInstance().getTeleToLocation(activeChar, MapRegionTable.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 = MapRegionTable.getInstance().getTeleToLocation(activeChar, MapRegionTable.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_reload"))
{