Свернуть ↑
Index: config/administration/admin.properties
================================================== =================
--- config/administration/admin.properties (revision 2111)
+++ config/administration/admin.properties (working copy)
@@ -94,6 +94,9 @@
# Kill target
gameserver.administration.command.kill = 3
+# Morph command
+gameserver.administration.command.morph = 3
+
# Move player1 to player2 location
gameserver.administration.command.moveplayertoplay er = 3
Index: data/scripts/system/handlers/admincommands/Morph.java
================================================== =================
--- data/scripts/system/handlers/admincommands/Morph.java (revision 0)
+++ data/scripts/system/handlers/admincommands/Morph.java (revision 0)
@@ -0,0 +1,102 @@
+/*
+* This file is part of aion-unique <aion-unique.org>.aionchs.com
+*
+* aion-unique 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.
+*
+* aion-unique 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 aion-unique. If not, see <http://www.gnu.org/licenses/>.
+*/
+package admincommands;
+
+import com.aionemu.gameserver.configs.administration.Admi nConfig;
+import com.aionemu.gameserver.model.gameobjects.player.Pl ayer;
+import com.aionemu.gameserver.network.aion.serverpackets. SM_TRANSFORM;
+import com.aionemu.gameserver.utils.PacketSendUtility;
+import com.aionemu.gameserver.utils.chathandlers.AdminCom mand;
+/**
+* @author ATracer
+* @modified By aionchs- Wylovech
+*/
+public class Morph extends AdminCommand
+{
+
+ public Morph()
+ {
+ super("morph");
+ }
+
+ @Override
+ public void executeCommand(Player admin, String[] params)
+ {
+ if(admin.getAccessLevel() < AdminConfig.COMMAND_MORPH)
+ {
+ PacketSendUtility.sendMessage(admin, "You dont have enough rights to execute this command");
+ return;
+ }
+
+ if (params.length != 1)
+ {
+ PacketSendUtility.sendMessage(admin, "syntax //morph <NPC Id | cancel> ");
+ return;
+ }
+
+ Player player = admin;
+ int param = 0;
+
+ if (admin.getAccessLevel() > 0 && (admin.getTarget() instanceof Player))
+ player = (Player) admin.getTarget();
+
+ if( !(params[0].toLowerCase().equals("cancel")))
+ {
+ try
+ {
+ param = Integer.parseInt(params[0]);
+
+ }
+ catch(NumberFormatException e)
+ {
+ PacketSendUtility.sendMessage(admin, "Parameter need to be an integer!");
+ return;
+ }
+ }
+
+ if( (param != 0 && param < 200000) || param > 298021)
+ {
+ PacketSendUtility.sendMessage(admin, "Something wrong with the NPC Id!");
+ return;
+ }
+
+ player.setTransformedModelId(param);
+ PacketSendUtility.broadcastPacketAndReceive(player , new SM_TRANSFORM(player));
+ if (param != 0)
+ {
+ if (player != admin)
+ {
+ PacketSendUtility.sendMessage(player,"You get a morph by " + admin.getName() + " ! ");
+ PacketSendUtility.sendMessage(admin, "You give a morph to " + player.getName() + " !");
+ }
+ else
+ PacketSendUtility.sendMessage(player, "Morph success!");
+ }
+ else
+ {
+ if (player != admin)
+ {
+ PacketSendUtility.sendMessage(player,"Your morph has been caneled by " + admin.getName() + " ! ");
+ PacketSendUtility.sendMessage(admin, "You have canceled " + player.getName() + "'s morph!");
+ }
+ else
+ PacketSendUtility.sendMessage(player, "Morph cancel success!");
+
+ }
+
+ }
+}
Index: src/com/aionemu/gameserver/configs/administration/AdminConfig.java
================================================== =================
--- src/com/aionemu/gameserver/configs/administration/AdminConfig.java (revision 2111)
+++ src/com/aionemu/gameserver/configs/administration/AdminConfig.java (working copy)
@@ -86,6 +86,9 @@
@Property(key = "gameserver.administration.command.kill", defaultValue = "3")
public static int COMMAND_KILL;
+ @Property(key = "gameserver.administration.command.morph", defaultValue = "3")
+ public static int COMMAND_MORPH;
+
@Property(key = "gameserver.administration.command.moveplayertopla yer", defaultValue = "3")
public static int COMMAND_MOVEPLAYERTOPLAYER;