Retail like builder messages.
Adapted from: L2jUnity free files.
This commit is contained in:
		@@ -158,8 +158,6 @@
 | 
			
		||||
	<admin command="admin_earthquake_menu" accessLevel="100" />
 | 
			
		||||
	<admin command="admin_bighead" accessLevel="100" />
 | 
			
		||||
	<admin command="admin_shrinkhead" accessLevel="100" />
 | 
			
		||||
	<admin command="admin_gmspeed" accessLevel="100" />
 | 
			
		||||
	<admin command="admin_gmspeed_menu" accessLevel="100" />
 | 
			
		||||
	<admin command="admin_unpara_all" accessLevel="100" />
 | 
			
		||||
	<admin command="admin_para_all" accessLevel="100" />
 | 
			
		||||
	<admin command="admin_unpara" accessLevel="100" />
 | 
			
		||||
@@ -189,6 +187,13 @@
 | 
			
		||||
	<admin command="admin_set_displayeffect_menu" accessLevel="100" />
 | 
			
		||||
	<admin command="admin_playmovie" accessLevel="100" />
 | 
			
		||||
 | 
			
		||||
	<!-- ADMIN SPEED -->
 | 
			
		||||
	<admin command="admin_gmspeed" accessLevel="100" />
 | 
			
		||||
	<admin command="admin_superhaste" accessLevel="100" />
 | 
			
		||||
	<admin command="admin_superhaste_menu" accessLevel="100" />
 | 
			
		||||
	<admin command="admin_speed" accessLevel="100" />
 | 
			
		||||
	<admin command="admin_speed_menu" accessLevel="100" />
 | 
			
		||||
	
 | 
			
		||||
	<!-- ADMIN ELEMENT -->
 | 
			
		||||
	<admin command="admin_setlh" accessLevel="100" />
 | 
			
		||||
	<admin command="admin_setlc" accessLevel="100" />
 | 
			
		||||
@@ -612,4 +617,7 @@
 | 
			
		||||
	<admin command="banchat" accessLevel="100" />
 | 
			
		||||
	<admin command="debug" accessLevel="100" />
 | 
			
		||||
	<admin command="unbanchat" accessLevel="100" />
 | 
			
		||||
 | 
			
		||||
	<!-- HIDE -->
 | 
			
		||||
	<admin command="admin_hide" accessLevel="100" />
 | 
			
		||||
</list>
 | 
			
		||||
@@ -25,6 +25,10 @@ ServerGMOnly = False
 | 
			
		||||
# Default: False
 | 
			
		||||
GMHeroAura = False
 | 
			
		||||
 | 
			
		||||
# Whether GM logins in builder hide mode by default.
 | 
			
		||||
# Default: True
 | 
			
		||||
GMStartupBuilderHide = True
 | 
			
		||||
 | 
			
		||||
# Auto set invulnerable status to a GM on login.
 | 
			
		||||
# Default: False
 | 
			
		||||
GMStartupInvulnerable = True
 | 
			
		||||
@@ -79,6 +83,11 @@ GMGiveSpecialSkills = False
 | 
			
		||||
# Default: False
 | 
			
		||||
GMGiveSpecialAuraSkills = False
 | 
			
		||||
 | 
			
		||||
# In case you are not satisfied with the retail-like implementation of //gmspeed",
 | 
			
		||||
# with this config you can rollback it to the old custom L2J version of the GM Speed.
 | 
			
		||||
# Default: False
 | 
			
		||||
UseSuperHasteAsGMSpeed = False
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# ---------------------------------------------------------------------------
 | 
			
		||||
# Server Security
 | 
			
		||||
 
 | 
			
		||||
@@ -38,11 +38,11 @@
 | 
			
		||||
</table><br1>
 | 
			
		||||
<table width=270><tr>
 | 
			
		||||
<td><font color="LEVEL">Super Haste:</font></td>
 | 
			
		||||
<td><button value="1" action="bypass -h admin_gmspeed_menu 1" width=35 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
 | 
			
		||||
<td><button value="2" action="bypass -h admin_gmspeed_menu 2" width=35 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
 | 
			
		||||
<td><button value="3" action="bypass -h admin_gmspeed_menu 3" width=35 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
 | 
			
		||||
<td><button value="4" action="bypass -h admin_gmspeed_menu 4" width=35 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
 | 
			
		||||
<td><button value="Off" action="bypass -h admin_gmspeed_menu 0" width=35 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
 | 
			
		||||
<td><button value="1" action="bypass -h admin_superhaste 1" width=30 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
 | 
			
		||||
<td><button value="2" action="bypass -h admin_superhaste 2" width=30 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
 | 
			
		||||
<td><button value="3" action="bypass -h admin_superhaste 3" width=30 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
 | 
			
		||||
<td><button value="4" action="bypass -h admin_superhaste 4" width=30 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
 | 
			
		||||
<td><button value="Off" action="bypass -h admin_superhaste 0" width=30 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
 | 
			
		||||
</tr></table><br>
 | 
			
		||||
<center><multiedit var="new_announcement" width=250 height=80></center>
 | 
			
		||||
<table width="160"><tr>
 | 
			
		||||
 
 | 
			
		||||
@@ -84,9 +84,11 @@ import handlers.admincommandhandlers.AdminFortSiege;
 | 
			
		||||
import handlers.admincommandhandlers.AdminGeodata;
 | 
			
		||||
import handlers.admincommandhandlers.AdminGm;
 | 
			
		||||
import handlers.admincommandhandlers.AdminGmChat;
 | 
			
		||||
import handlers.admincommandhandlers.AdminGmSpeed;
 | 
			
		||||
import handlers.admincommandhandlers.AdminGraciaSeeds;
 | 
			
		||||
import handlers.admincommandhandlers.AdminGrandBoss;
 | 
			
		||||
import handlers.admincommandhandlers.AdminHeal;
 | 
			
		||||
import handlers.admincommandhandlers.AdminHide;
 | 
			
		||||
import handlers.admincommandhandlers.AdminHtml;
 | 
			
		||||
import handlers.admincommandhandlers.AdminHwid;
 | 
			
		||||
import handlers.admincommandhandlers.AdminInstance;
 | 
			
		||||
@@ -125,6 +127,7 @@ import handlers.admincommandhandlers.AdminShutdown;
 | 
			
		||||
import handlers.admincommandhandlers.AdminSkill;
 | 
			
		||||
import handlers.admincommandhandlers.AdminSpawn;
 | 
			
		||||
import handlers.admincommandhandlers.AdminSummon;
 | 
			
		||||
import handlers.admincommandhandlers.AdminSuperHaste;
 | 
			
		||||
import handlers.admincommandhandlers.AdminTarget;
 | 
			
		||||
import handlers.admincommandhandlers.AdminTargetSay;
 | 
			
		||||
import handlers.admincommandhandlers.AdminTeleport;
 | 
			
		||||
@@ -415,9 +418,11 @@ public class MasterHandler
 | 
			
		||||
			AdminGeodata.class,
 | 
			
		||||
			AdminGm.class,
 | 
			
		||||
			AdminGmChat.class,
 | 
			
		||||
			AdminGmSpeed.class,
 | 
			
		||||
			AdminGraciaSeeds.class,
 | 
			
		||||
			AdminGrandBoss.class,
 | 
			
		||||
			AdminHeal.class,
 | 
			
		||||
			AdminHide.class,
 | 
			
		||||
			AdminHtml.class,
 | 
			
		||||
			AdminHwid.class,
 | 
			
		||||
			AdminInstance.class,
 | 
			
		||||
@@ -456,6 +461,7 @@ public class MasterHandler
 | 
			
		||||
			AdminSkill.class,
 | 
			
		||||
			AdminSpawn.class,
 | 
			
		||||
			AdminSummon.class,
 | 
			
		||||
			AdminSuperHaste.class,
 | 
			
		||||
			AdminTarget.class,
 | 
			
		||||
			AdminTargetSay.class,
 | 
			
		||||
			AdminTeleport.class,
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,6 @@ package handlers.actionshifthandlers;
 | 
			
		||||
import com.l2jmobius.gameserver.enums.InstanceType;
 | 
			
		||||
import com.l2jmobius.gameserver.handler.AdminCommandHandler;
 | 
			
		||||
import com.l2jmobius.gameserver.handler.IActionShiftHandler;
 | 
			
		||||
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
 | 
			
		||||
import com.l2jmobius.gameserver.model.L2Object;
 | 
			
		||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
 | 
			
		||||
 | 
			
		||||
@@ -37,11 +36,7 @@ public class L2PcInstanceActionShift implements IActionShiftHandler
 | 
			
		||||
				activeChar.setTarget(target);
 | 
			
		||||
			}
 | 
			
		||||
			
 | 
			
		||||
			final IAdminCommandHandler ach = AdminCommandHandler.getInstance().getHandler("admin_character_info");
 | 
			
		||||
			if (ach != null)
 | 
			
		||||
			{
 | 
			
		||||
				ach.useAdminCommand("admin_character_info " + target.getName(), activeChar);
 | 
			
		||||
			}
 | 
			
		||||
			AdminCommandHandler.getInstance().useAdminCommand(activeChar, "admin_character_info " + target.getName(), true);
 | 
			
		||||
		}
 | 
			
		||||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,6 @@ package handlers.actionshifthandlers;
 | 
			
		||||
import com.l2jmobius.gameserver.enums.InstanceType;
 | 
			
		||||
import com.l2jmobius.gameserver.handler.AdminCommandHandler;
 | 
			
		||||
import com.l2jmobius.gameserver.handler.IActionShiftHandler;
 | 
			
		||||
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
 | 
			
		||||
import com.l2jmobius.gameserver.model.L2Object;
 | 
			
		||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
 | 
			
		||||
 | 
			
		||||
@@ -36,11 +35,7 @@ public class L2SummonActionShift implements IActionShiftHandler
 | 
			
		||||
				activeChar.setTarget(target);
 | 
			
		||||
			}
 | 
			
		||||
			
 | 
			
		||||
			final IAdminCommandHandler ach = AdminCommandHandler.getInstance().getHandler("admin_summon_info");
 | 
			
		||||
			if (ach != null)
 | 
			
		||||
			{
 | 
			
		||||
				ach.useAdminCommand("admin_summon_info", activeChar);
 | 
			
		||||
			}
 | 
			
		||||
			AdminCommandHandler.getInstance().useAdminCommand(activeChar, "admin_summon_info", true);
 | 
			
		||||
		}
 | 
			
		||||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,6 @@ package handlers.admincommandhandlers;
 | 
			
		||||
import java.util.Arrays;
 | 
			
		||||
import java.util.StringTokenizer;
 | 
			
		||||
 | 
			
		||||
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
 | 
			
		||||
import com.l2jmobius.gameserver.enums.Movie;
 | 
			
		||||
import com.l2jmobius.gameserver.enums.Team;
 | 
			
		||||
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
 | 
			
		||||
@@ -34,7 +33,6 @@ import com.l2jmobius.gameserver.model.html.PageBuilder;
 | 
			
		||||
import com.l2jmobius.gameserver.model.html.PageResult;
 | 
			
		||||
import com.l2jmobius.gameserver.model.html.styles.ButtonsStyle;
 | 
			
		||||
import com.l2jmobius.gameserver.model.skills.AbnormalVisualEffect;
 | 
			
		||||
import com.l2jmobius.gameserver.model.skills.Skill;
 | 
			
		||||
import com.l2jmobius.gameserver.network.SystemMessageId;
 | 
			
		||||
import com.l2jmobius.gameserver.network.serverpackets.Earthquake;
 | 
			
		||||
import com.l2jmobius.gameserver.network.serverpackets.ExRedSky;
 | 
			
		||||
@@ -81,8 +79,6 @@ public class AdminEffects implements IAdminCommandHandler
 | 
			
		||||
		"admin_earthquake_menu",
 | 
			
		||||
		"admin_bighead",
 | 
			
		||||
		"admin_shrinkhead",
 | 
			
		||||
		"admin_gmspeed",
 | 
			
		||||
		"admin_gmspeed_menu",
 | 
			
		||||
		"admin_unpara_all",
 | 
			
		||||
		"admin_para_all",
 | 
			
		||||
		"admin_unpara",
 | 
			
		||||
@@ -351,35 +347,6 @@ public class AdminEffects implements IAdminCommandHandler
 | 
			
		||||
			{
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		else if (command.startsWith("admin_gmspeed"))
 | 
			
		||||
		{
 | 
			
		||||
			try
 | 
			
		||||
			{
 | 
			
		||||
				final int val = Integer.parseInt(st.nextToken());
 | 
			
		||||
				final boolean sendMessage = activeChar.isAffectedBySkill(7029);
 | 
			
		||||
				activeChar.stopSkillEffects((val == 0) && sendMessage, 7029);
 | 
			
		||||
				if ((val >= 1) && (val <= 4))
 | 
			
		||||
				{
 | 
			
		||||
					int time = 0;
 | 
			
		||||
					if (st.hasMoreTokens())
 | 
			
		||||
					{
 | 
			
		||||
						time = Integer.parseInt(st.nextToken());
 | 
			
		||||
					}
 | 
			
		||||
					
 | 
			
		||||
					final Skill gmSpeedSkill = SkillData.getInstance().getSkill(7029, val);
 | 
			
		||||
					gmSpeedSkill.applyEffects(activeChar, activeChar, true, time);
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			catch (Exception e)
 | 
			
		||||
			{
 | 
			
		||||
				activeChar.sendMessage("Usage: //gmspeed <Effect level (0-4)> <Time in seconds>");
 | 
			
		||||
			}
 | 
			
		||||
			if (command.contains("_menu"))
 | 
			
		||||
			{
 | 
			
		||||
				command = "";
 | 
			
		||||
				AdminHtml.showAdminHtml(activeChar, "gm_menu.htm");
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		else if (command.startsWith("admin_polyself"))
 | 
			
		||||
		{
 | 
			
		||||
			try
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,119 @@
 | 
			
		||||
/*
 | 
			
		||||
 * This file is part of the L2J Mobius project.
 | 
			
		||||
 * 
 | 
			
		||||
 * This program is free software: you can redistribute it and/or modify
 | 
			
		||||
 * it under the terms of the GNU General Public License as published by
 | 
			
		||||
 * the Free Software Foundation, either version 3 of the License, or
 | 
			
		||||
 * (at your option) any later version.
 | 
			
		||||
 * 
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 | 
			
		||||
 * General Public License for more details.
 | 
			
		||||
 * 
 | 
			
		||||
 * You should have received a copy of the GNU General Public License
 | 
			
		||||
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
package handlers.admincommandhandlers;
 | 
			
		||||
 | 
			
		||||
import java.util.EnumSet;
 | 
			
		||||
import java.util.Set;
 | 
			
		||||
import java.util.StringTokenizer;
 | 
			
		||||
 | 
			
		||||
import com.l2jmobius.Config;
 | 
			
		||||
import com.l2jmobius.gameserver.handler.AdminCommandHandler;
 | 
			
		||||
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
 | 
			
		||||
import com.l2jmobius.gameserver.model.L2Object;
 | 
			
		||||
import com.l2jmobius.gameserver.model.actor.L2Character;
 | 
			
		||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
 | 
			
		||||
import com.l2jmobius.gameserver.model.stats.Stats;
 | 
			
		||||
import com.l2jmobius.gameserver.util.BuilderUtil;
 | 
			
		||||
import com.l2jmobius.gameserver.util.Util;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * A retail-like implementation of //gmspeed builder command.
 | 
			
		||||
 * @author lord_rex
 | 
			
		||||
 */
 | 
			
		||||
public final class AdminGmSpeed implements IAdminCommandHandler
 | 
			
		||||
{
 | 
			
		||||
	private static final String[] ADMIN_COMMANDS =
 | 
			
		||||
	{
 | 
			
		||||
		"admin_gmspeed",
 | 
			
		||||
	};
 | 
			
		||||
	
 | 
			
		||||
	private static final Set<Stats> SPEED_STATS = EnumSet.of(Stats.RUN_SPEED, Stats.WALK_SPEED, Stats.SWIM_RUN_SPEED, Stats.SWIM_WALK_SPEED, Stats.FLY_RUN_SPEED, Stats.FLY_WALK_SPEED);
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public boolean useAdminCommand(String command, L2PcInstance player)
 | 
			
		||||
	{
 | 
			
		||||
		final StringTokenizer st = new StringTokenizer(command);
 | 
			
		||||
		final String cmd = st.nextToken();
 | 
			
		||||
		
 | 
			
		||||
		if (cmd.equals("admin_gmspeed"))
 | 
			
		||||
		{
 | 
			
		||||
			if (!st.hasMoreTokens())
 | 
			
		||||
			{
 | 
			
		||||
				BuilderUtil.sendSysMessage(player, "//gmspeed [0...10]");
 | 
			
		||||
				return false;
 | 
			
		||||
			}
 | 
			
		||||
			final String token = st.nextToken();
 | 
			
		||||
			
 | 
			
		||||
			// Rollback feature for old custom way, in order to make everyone happy.
 | 
			
		||||
			if (Config.USE_SUPER_HASTE_AS_GM_SPEED)
 | 
			
		||||
			{
 | 
			
		||||
				AdminCommandHandler.getInstance().useAdminCommand(player, AdminSuperHaste.ADMIN_COMMANDS[0] + " " + token, false);
 | 
			
		||||
				return true;
 | 
			
		||||
			}
 | 
			
		||||
			
 | 
			
		||||
			if (!Util.isDouble(token))
 | 
			
		||||
			{
 | 
			
		||||
				BuilderUtil.sendSysMessage(player, "//gmspeed [0...10]");
 | 
			
		||||
				return false;
 | 
			
		||||
			}
 | 
			
		||||
			final double runSpeedBoost = Double.parseDouble(token);
 | 
			
		||||
			if ((runSpeedBoost < 0) || (runSpeedBoost > 10))
 | 
			
		||||
			{
 | 
			
		||||
				// Custom limit according to SDW's request - real retail limit is unknown.
 | 
			
		||||
				BuilderUtil.sendSysMessage(player, "//gmspeed [0...10]");
 | 
			
		||||
				return false;
 | 
			
		||||
			}
 | 
			
		||||
			
 | 
			
		||||
			final L2Character targetCharacter;
 | 
			
		||||
			final L2Object target = player.getTarget();
 | 
			
		||||
			if ((target != null) && target.isCharacter())
 | 
			
		||||
			{
 | 
			
		||||
				targetCharacter = (L2Character) target;
 | 
			
		||||
			}
 | 
			
		||||
			else
 | 
			
		||||
			{
 | 
			
		||||
				// If there is no target, let's use the command executer.
 | 
			
		||||
				targetCharacter = player;
 | 
			
		||||
			}
 | 
			
		||||
			
 | 
			
		||||
			SPEED_STATS.forEach(speedStat -> targetCharacter.getStat().removeFixedValue(speedStat));
 | 
			
		||||
			if (runSpeedBoost > 0)
 | 
			
		||||
			{
 | 
			
		||||
				SPEED_STATS.forEach(speedStat -> targetCharacter.getStat().addFixedValue(speedStat, targetCharacter.getTemplate().getBaseValue(speedStat, 120) * runSpeedBoost));
 | 
			
		||||
			}
 | 
			
		||||
			
 | 
			
		||||
			targetCharacter.getStat().recalculateStats(false);
 | 
			
		||||
			if (targetCharacter.isPlayer())
 | 
			
		||||
			{
 | 
			
		||||
				((L2PcInstance) targetCharacter).broadcastUserInfo();
 | 
			
		||||
			}
 | 
			
		||||
			else
 | 
			
		||||
			{
 | 
			
		||||
				targetCharacter.broadcastInfo();
 | 
			
		||||
			}
 | 
			
		||||
			
 | 
			
		||||
			BuilderUtil.sendSysMessage(player, "[" + targetCharacter.getName() + "] speed is [" + (runSpeedBoost * 100) + "0]% fast.");
 | 
			
		||||
		}
 | 
			
		||||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public String[] getAdminCommandList()
 | 
			
		||||
	{
 | 
			
		||||
		return ADMIN_COMMANDS;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,87 @@
 | 
			
		||||
/*
 | 
			
		||||
 * This file is part of the L2J Mobius project.
 | 
			
		||||
 * 
 | 
			
		||||
 * This program is free software: you can redistribute it and/or modify
 | 
			
		||||
 * it under the terms of the GNU General Public License as published by
 | 
			
		||||
 * the Free Software Foundation, either version 3 of the License, or
 | 
			
		||||
 * (at your option) any later version.
 | 
			
		||||
 * 
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 | 
			
		||||
 * General Public License for more details.
 | 
			
		||||
 * 
 | 
			
		||||
 * You should have received a copy of the GNU General Public License
 | 
			
		||||
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
package handlers.admincommandhandlers;
 | 
			
		||||
 | 
			
		||||
import java.util.StringTokenizer;
 | 
			
		||||
 | 
			
		||||
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
 | 
			
		||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
 | 
			
		||||
import com.l2jmobius.gameserver.util.BuilderUtil;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author lord_rex
 | 
			
		||||
 */
 | 
			
		||||
public final class AdminHide implements IAdminCommandHandler
 | 
			
		||||
{
 | 
			
		||||
	private static final String[] ADMIN_COMMANDS =
 | 
			
		||||
	{
 | 
			
		||||
		"admin_hide"
 | 
			
		||||
	};
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public boolean useAdminCommand(String command, L2PcInstance player)
 | 
			
		||||
	{
 | 
			
		||||
		final StringTokenizer st = new StringTokenizer(command);
 | 
			
		||||
		st.nextToken();
 | 
			
		||||
		
 | 
			
		||||
		try
 | 
			
		||||
		{
 | 
			
		||||
			final String param = st.nextToken();
 | 
			
		||||
			switch (param)
 | 
			
		||||
			{
 | 
			
		||||
				case "on":
 | 
			
		||||
				{
 | 
			
		||||
					if (!BuilderUtil.setHiding(player, true))
 | 
			
		||||
					{
 | 
			
		||||
						BuilderUtil.sendSysMessage(player, "Currently, you cannot be seen.");
 | 
			
		||||
						return true;
 | 
			
		||||
					}
 | 
			
		||||
					
 | 
			
		||||
					BuilderUtil.sendSysMessage(player, "Now, you cannot be seen.");
 | 
			
		||||
					return true;
 | 
			
		||||
				}
 | 
			
		||||
				case "off":
 | 
			
		||||
				{
 | 
			
		||||
					if (!BuilderUtil.setHiding(player, false))
 | 
			
		||||
					{
 | 
			
		||||
						BuilderUtil.sendSysMessage(player, "Currently, you can be seen.");
 | 
			
		||||
						return true;
 | 
			
		||||
					}
 | 
			
		||||
					
 | 
			
		||||
					BuilderUtil.sendSysMessage(player, "Now, you can be seen.");
 | 
			
		||||
					return true;
 | 
			
		||||
				}
 | 
			
		||||
				default:
 | 
			
		||||
				{
 | 
			
		||||
					BuilderUtil.sendSysMessage(player, "//hide [on|off]");
 | 
			
		||||
					return true;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		catch (final Exception e)
 | 
			
		||||
		{
 | 
			
		||||
			BuilderUtil.sendSysMessage(player, "//hide [on|off]");
 | 
			
		||||
			return true;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public String[] getAdminCommandList()
 | 
			
		||||
	{
 | 
			
		||||
		return ADMIN_COMMANDS;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -21,7 +21,6 @@ import java.util.logging.Level;
 | 
			
		||||
import java.util.logging.Logger;
 | 
			
		||||
 | 
			
		||||
import com.l2jmobius.Config;
 | 
			
		||||
import com.l2jmobius.gameserver.data.xml.impl.AdminData;
 | 
			
		||||
import com.l2jmobius.gameserver.handler.AdminCommandHandler;
 | 
			
		||||
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
 | 
			
		||||
import com.l2jmobius.gameserver.model.L2Clan;
 | 
			
		||||
@@ -187,14 +186,7 @@ public class AdminMenu implements IAdminCommandHandler
 | 
			
		||||
			if (st.countTokens() > 1)
 | 
			
		||||
			{
 | 
			
		||||
				final String subCommand = "admin_ban_char";
 | 
			
		||||
				if (!AdminData.getInstance().hasAccess(subCommand, activeChar.getAccessLevel()))
 | 
			
		||||
				{
 | 
			
		||||
					activeChar.sendMessage("You don't have the access right to use this command!");
 | 
			
		||||
					LOGGER.warning("Character " + activeChar.getName() + " tryed to use admin command " + subCommand + ", but have no access to it!");
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
				final IAdminCommandHandler ach = AdminCommandHandler.getInstance().getHandler(subCommand);
 | 
			
		||||
				ach.useAdminCommand(subCommand + command.substring(14), activeChar);
 | 
			
		||||
				AdminCommandHandler.getInstance().useAdminCommand(activeChar, subCommand + command.substring(14), true);
 | 
			
		||||
			}
 | 
			
		||||
			showMainPage(activeChar);
 | 
			
		||||
		}
 | 
			
		||||
@@ -204,14 +196,7 @@ public class AdminMenu implements IAdminCommandHandler
 | 
			
		||||
			if (st.countTokens() > 1)
 | 
			
		||||
			{
 | 
			
		||||
				final String subCommand = "admin_unban_char";
 | 
			
		||||
				if (!AdminData.getInstance().hasAccess(subCommand, activeChar.getAccessLevel()))
 | 
			
		||||
				{
 | 
			
		||||
					activeChar.sendMessage("You don't have the access right to use this command!");
 | 
			
		||||
					LOGGER.warning("Character " + activeChar.getName() + " tryed to use admin command " + subCommand + ", but have no access to it!");
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
				final IAdminCommandHandler ach = AdminCommandHandler.getInstance().getHandler(subCommand);
 | 
			
		||||
				ach.useAdminCommand(subCommand + command.substring(16), activeChar);
 | 
			
		||||
				AdminCommandHandler.getInstance().useAdminCommand(activeChar, subCommand + command.substring(16), true);
 | 
			
		||||
			}
 | 
			
		||||
			showMainPage(activeChar);
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -16,9 +16,6 @@
 | 
			
		||||
 */
 | 
			
		||||
package handlers.admincommandhandlers;
 | 
			
		||||
 | 
			
		||||
import java.util.logging.Logger;
 | 
			
		||||
 | 
			
		||||
import com.l2jmobius.gameserver.data.xml.impl.AdminData;
 | 
			
		||||
import com.l2jmobius.gameserver.handler.AdminCommandHandler;
 | 
			
		||||
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
 | 
			
		||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
 | 
			
		||||
@@ -28,8 +25,6 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
 | 
			
		||||
 */
 | 
			
		||||
public class AdminSummon implements IAdminCommandHandler
 | 
			
		||||
{
 | 
			
		||||
	private static final Logger LOGGER = Logger.getLogger(AdminSummon.class.getName());
 | 
			
		||||
	
 | 
			
		||||
	public static final String[] ADMIN_COMMANDS =
 | 
			
		||||
	{
 | 
			
		||||
		"admin_summon"
 | 
			
		||||
@@ -62,34 +57,24 @@ public class AdminSummon implements IAdminCommandHandler
 | 
			
		||||
			return false;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		String subCommand;
 | 
			
		||||
		final String subCommand;
 | 
			
		||||
		if (id < 1000000)
 | 
			
		||||
		{
 | 
			
		||||
			subCommand = "admin_create_item";
 | 
			
		||||
			if (!AdminData.getInstance().hasAccess(subCommand, activeChar.getAccessLevel()))
 | 
			
		||||
			{
 | 
			
		||||
				activeChar.sendMessage("You don't have the access right to use this command!");
 | 
			
		||||
				LOGGER.warning("Character " + activeChar.getName() + " tryed to use admin command " + subCommand + ", but have no access to it!");
 | 
			
		||||
				return false;
 | 
			
		||||
			}
 | 
			
		||||
			final IAdminCommandHandler ach = AdminCommandHandler.getInstance().getHandler(subCommand);
 | 
			
		||||
			ach.useAdminCommand(subCommand + " " + id + " " + count, activeChar);
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
		{
 | 
			
		||||
			subCommand = "admin_spawn_once";
 | 
			
		||||
			if (!AdminData.getInstance().hasAccess(subCommand, activeChar.getAccessLevel()))
 | 
			
		||||
			{
 | 
			
		||||
				activeChar.sendMessage("You don't have the access right to use this command!");
 | 
			
		||||
				LOGGER.warning("Character " + activeChar.getName() + " tryed to use admin command " + subCommand + ", but have no access to it!");
 | 
			
		||||
				return false;
 | 
			
		||||
			}
 | 
			
		||||
			final IAdminCommandHandler ach = AdminCommandHandler.getInstance().getHandler(subCommand);
 | 
			
		||||
			
 | 
			
		||||
			activeChar.sendMessage("This is only a temporary spawn.  The mob(s) will NOT respawn.");
 | 
			
		||||
			id -= 1000000;
 | 
			
		||||
			ach.useAdminCommand(subCommand + " " + id + " " + count, activeChar);
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		if ((id > 0) && (count > 0))
 | 
			
		||||
		{
 | 
			
		||||
			AdminCommandHandler.getInstance().useAdminCommand(activeChar, subCommand + " " + id + " " + count, true);
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,92 @@
 | 
			
		||||
/*
 | 
			
		||||
 * This file is part of the L2J Mobius project.
 | 
			
		||||
 * 
 | 
			
		||||
 * This program is free software: you can redistribute it and/or modify
 | 
			
		||||
 * it under the terms of the GNU General Public License as published by
 | 
			
		||||
 * the Free Software Foundation, either version 3 of the License, or
 | 
			
		||||
 * (at your option) any later version.
 | 
			
		||||
 * 
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 | 
			
		||||
 * General Public License for more details.
 | 
			
		||||
 * 
 | 
			
		||||
 * You should have received a copy of the GNU General Public License
 | 
			
		||||
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
package handlers.admincommandhandlers;
 | 
			
		||||
 | 
			
		||||
import java.util.StringTokenizer;
 | 
			
		||||
 | 
			
		||||
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
 | 
			
		||||
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
 | 
			
		||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
 | 
			
		||||
import com.l2jmobius.gameserver.model.skills.Skill;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * The classical custom L2J implementation of the old //gmspeed GM command.
 | 
			
		||||
 * @author lord_rex (No, it wasn't me at all. Eclipse added my name there.)
 | 
			
		||||
 */
 | 
			
		||||
public final class AdminSuperHaste implements IAdminCommandHandler
 | 
			
		||||
{
 | 
			
		||||
	public static final String[] ADMIN_COMMANDS =
 | 
			
		||||
	{
 | 
			
		||||
		"admin_superhaste",
 | 
			
		||||
		"admin_superhaste_menu",
 | 
			
		||||
		"admin_speed",
 | 
			
		||||
		"admin_speed_menu",
 | 
			
		||||
	};
 | 
			
		||||
	
 | 
			
		||||
	private static final int SUPER_HASTE_ID = 7029;
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public boolean useAdminCommand(String command, L2PcInstance player)
 | 
			
		||||
	{
 | 
			
		||||
		final StringTokenizer st = new StringTokenizer(command);
 | 
			
		||||
		final String cmd = st.nextToken();
 | 
			
		||||
		switch (cmd)
 | 
			
		||||
		{
 | 
			
		||||
			case "admin_superhaste":
 | 
			
		||||
			case "admin_speed":
 | 
			
		||||
			{
 | 
			
		||||
				try
 | 
			
		||||
				{
 | 
			
		||||
					final int val = Integer.parseInt(st.nextToken());
 | 
			
		||||
					final boolean sendMessage = player.isAffectedBySkill(SUPER_HASTE_ID);
 | 
			
		||||
					player.stopSkillEffects((val == 0) && sendMessage, SUPER_HASTE_ID);
 | 
			
		||||
					if ((val >= 1) && (val <= 4))
 | 
			
		||||
					{
 | 
			
		||||
						int time = 0;
 | 
			
		||||
						if (st.hasMoreTokens())
 | 
			
		||||
						{
 | 
			
		||||
							time = Integer.parseInt(st.nextToken());
 | 
			
		||||
						}
 | 
			
		||||
						
 | 
			
		||||
						final Skill superHasteSkill = SkillData.getInstance().getSkill(SUPER_HASTE_ID, val);
 | 
			
		||||
						superHasteSkill.applyEffects(player, player, true, time);
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
				catch (final Exception e)
 | 
			
		||||
				{
 | 
			
		||||
					player.sendMessage("Usage: //superhaste <Effect level (0-4)> <Time in seconds>");
 | 
			
		||||
				}
 | 
			
		||||
				
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
			case "admin_superhaste_menu":
 | 
			
		||||
			case "admin_speed_menu":
 | 
			
		||||
			{
 | 
			
		||||
				AdminHtml.showAdminHtml(player, "gm_menu.htm");
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public String[] getAdminCommandList()
 | 
			
		||||
	{
 | 
			
		||||
		return ADMIN_COMMANDS;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user