Свернуть ↑
Index: config/administration/admin.properties
================================================== =================
--- config/administration/admin.properties (revision 2180)
+++ config/administration/admin.properties (working copy)
@@ -76,6 +76,9 @@
# Give missin skills to self
gameserver.administration.command.givemissingskill s = 3
+# GM Mode open/close
+gameserver.administration.command.gmmode=1
+
# Restores target hp/mp/dp
gameserver.administration.command.heal = 3
Index: data/scripts/system/handlers/admincommands/GmMode.java
================================================== =================
--- data/scripts/system/handlers/admincommands/GmMode.java (revision 0)
+++ data/scripts/system/handlers/admincommands/GmMode.java (revision 0)
@@ -0,0 +1,58 @@
+/*
+* 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_PLAYER_INFO;
+import com.aionemu.gameserver.utils.PacketSendUtility;
+import com.aionemu.gameserver.utils.chathandlers.AdminCom mand;
+import com.aionemu.gameserver.world.KnownList;
+/**
+* @author Aionchs-Wylovech
+*
+*/
+public class GmMode extends AdminCommand
+{
+ public GmMode()
+ {
+ super("gmmode");
+ }
+
+ @Override
+ public void executeCommand(Player admin, String[] params)
+ {
+ if(admin.getAccessLevel() < AdminConfig.COMMAND_GMMODE)
+ {
+ PacketSendUtility.sendMessage(admin, "You dont have enough rights to execute this command");
+ return;
+ }
+ if(admin.getGmMode())
+ {
+ admin.setGmMode(false);
+ PacketSendUtility.sendMessage(admin, "Close GM mode!");
+ }
+ else
+ {
+ admin.setGmMode(true);
+ PacketSendUtility.sendMessage(admin, "Open GM mode!");
+ }
+ admin.clearKnownlist();
+ PacketSendUtility.sendPacket(admin, new SM_PLAYER_INFO(admin, false));
+ admin.updateKnownlist();
+ }
+}
Index: src/com/aionemu/gameserver/configs/administration/AdminConfig.java
================================================== =================
--- src/com/aionemu/gameserver/configs/administration/AdminConfig.java (revision 2180)
+++ src/com/aionemu/gameserver/configs/administration/AdminConfig.java (working copy)
@@ -68,6 +68,9 @@
@Property(key = "gameserver.administration.command.givemissingskil ls", defaultValue = "3")
public static int COMMAND_GIVEMISSINGSKILLS;
+ @Property(key = "gameserver.administration.command.gmmode", defaultValue = "1")
+ public static int COMMAND_GMMODE;
+
@Property(key = "gameserver.administration.command.heal", defaultValue = "3")
public static int COMMAND_HEAL;
Index: src/com/aionemu/gameserver/model/gameobjects/player/Player.java
================================================== =================
--- src/com/aionemu/gameserver/model/gameobjects/player/Player.java (revision 2180)
+++ src/com/aionemu/gameserver/model/gameobjects/player/Player.java (working copy)
@@ -73,6 +73,7 @@
private BlockList blockList;
private ResponseRequester requester;
private boolean lookingForGroup = false;
+ private boolean isGmMode = false;
private Storage inventory;
private Storage regularWarehouse;
private Storage accountWarehouse;
@@ -1160,4 +1161,14 @@
{
return this.kisk;
}
+
+ public boolean getGmMode()
+ {
+ return isGmMode;
+ }
+
+ public void setGmMode(boolean isGmMode)
+ {
+ this.isGmMode = isGmMode;
+ }
}
Index: src/com/aionemu/gameserver/network/aion/clientpackets/CM_CHAT_MESSAGE_WHISPER.java
================================================== =================
--- src/com/aionemu/gameserver/network/aion/clientpackets/CM_CHAT_MESSAGE_WHISPER.java (revision 2180)
+++ src/com/aionemu/gameserver/network/aion/clientpackets/CM_CHAT_MESSAGE_WHISPER.java (working copy)
@@ -81,6 +81,9 @@
@Override
protected void runImpl()
{
+ String checkIfGmName[] = name.split(" ");
+ if (checkIfGmName.length > 1)
+ name = checkIfGmName[1];
String formatname = Util.convertName(name);
Player sender = getConnection().getActivePlayer();
Index: src/com/aionemu/gameserver/network/aion/clientpackets/CM_FRIEND_ADD.java
================================================== =================
--- src/com/aionemu/gameserver/network/aion/clientpackets/CM_FRIEND_ADD.java (revision 2180)
+++ src/com/aionemu/gameserver/network/aion/clientpackets/CM_FRIEND_ADD.java (working copy)
@@ -64,6 +64,9 @@
{
final Player activePlayer = getConnection().getActivePlayer();
+ String checkIfGmName[] = targetName.split(" ");
+ if (checkIfGmName.length > 1)
+ targetName = checkIfGmName[1];
final Player targetPlayer = world.findPlayer(targetName);
Index: src/com/aionemu/gameserver/network/aion/clientpackets/CM_INVITE_TO_GROUP.java
================================================== =================
--- src/com/aionemu/gameserver/network/aion/clientpackets/CM_INVITE_TO_GROUP.java (revision 2180)
+++ src/com/aionemu/gameserver/network/aion/clientpackets/CM_INVITE_TO_GROUP.java (working copy)
@@ -60,6 +60,9 @@
@Override
protected void runImpl()
{
+ String checkIfGmName[] = name.split(" ");
+ if (checkIfGmName.length > 1)
+ name = checkIfGmName[1];
final String playerName = Util.convertName(name);
final Player inviter = getConnection().getActivePlayer();
Index: src/com/aionemu/gameserver/network/aion/clientpackets/CM_LEGION.java
================================================== =================
--- src/com/aionemu/gameserver/network/aion/clientpackets/CM_LEGION.java (revision 2180)
+++ src/com/aionemu/gameserver/network/aion/clientpackets/CM_LEGION.java (working copy)
@@ -81,6 +81,9 @@
case 0x01:
readD(); // empty
charName = readS();
+ String checkIfGmName[] = charName.split(" ");
+ if (checkIfGmName.length > 1)
+ charName = checkIfGmName[1];
break;
/** Leave legion **/
case 0x02:
Index: src/com/aionemu/gameserver/network/aion/serverpackets/SM_PLAYER_INFO.java
================================================== =================
--- src/com/aionemu/gameserver/network/aion/serverpackets/SM_PLAYER_INFO.java (revision 2180)
+++ src/com/aionemu/gameserver/network/aion/serverpackets/SM_PLAYER_INFO.java (working copy)
@@ -62,7 +62,26 @@
protected void writeImpl(AionConnection con, ByteBuffer buf)
{
PlayerCommonData pcd = player.getCommonData();
+ String playername = player.getName();
+ if(player.getAccessLevel() > 0 && player.getGmMode())
+ {
+ if(enemy)
+ enemy = false;
+ switch (player.getAccessLevel())
+ {
+ case 1:
+ playername = "GM " + player.getName();
+ break;
+ case 2:
+ playername = "HGM " + player.getName();
+ break;
+ case 3:
+ playername = "ADMIN " + player.getName();
+ break;
+ }
+ }
+
final int raceId = pcd.getRace().getRaceId();
final int genderId = pcd.getGender().getGenderId();
final PlayerAppearance playerAppearance = player.getPlayerAppearance();
@@ -93,7 +112,7 @@
writeC(buf, player.getHeading());
- writeS(buf, player.getName());
+ writeS(buf, playername);
writeD(buf, pcd.getTitleId());
writeC(buf, 0x0);// if set 0x1 can't jump and fly..