GM.java
上传用户:gwt600
上传日期:2021-06-03
资源大小:704k
文件大小:73k
- /*
- This file is part of the OdinMS Maple Story Server
- Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
- Matthias Butz <matze@odinms.de>
- Jan Christian Meyer <vimes@odinms.de>
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License version 3
- as published by the Free Software Foundation. You may not use, modify
- or distribute this program under any other version of the
- GNU Affero General Public License.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; withnout even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- package net.sf.odinms.client.messages.commands;
- import java.awt.Point;
- import java.io.BufferedReader;
- import java.io.FileReader;
- import java.io.IOException;
- import java.rmi.RemoteException;
- import net.sf.odinms.client.MapleCharacter;
- import net.sf.odinms.client.MapleClient;
- import net.sf.odinms.client.MaplePet;
- import net.sf.odinms.client.MapleStat;
- import net.sf.odinms.client.messages.Command;
- import net.sf.odinms.client.messages.MessageCallback;
- import static net.sf.odinms.client.messages.CommandProcessor.joinAfterString;
- import net.sf.odinms.tools.MaplePacketCreator;
- import net.sf.odinms.net.channel.ChannelServer;
- import java.sql.Connection;
- import java.sql.PreparedStatement;
- import java.sql.ResultSet;
- import java.sql.SQLException;
- import java.text.DateFormat;
- import java.util.Arrays;
- import java.util.Calendar;
- import java.util.Collection;
- import java.util.HashMap;
- import java.util.LinkedList;
- import java.util.List;
- import java.util.Map;
- import net.sf.odinms.client.MapleCharacterUtil;
- import net.sf.odinms.client.MapleDisease;
- import net.sf.odinms.client.MapleJob;
- import net.sf.odinms.client.SkillFactory;
- import net.sf.odinms.database.DatabaseConnection;
- import net.sf.odinms.net.world.remote.CheaterData;
- import net.sf.odinms.server.MaplePortal;
- import net.sf.odinms.server.MapleShopFactory;
- import net.sf.odinms.server.life.MapleLifeFactory;
- import net.sf.odinms.server.life.MapleMonster;
- import net.sf.odinms.server.life.MobSkillFactory;
- import net.sf.odinms.server.maps.MapleMap;
- import net.sf.odinms.server.maps.MapleMapObject;
- import net.sf.odinms.server.maps.MapleMapObjectType;
- import net.sf.odinms.client.messages.CommandDefinition;
- import net.sf.odinms.net.MaplePacket;
- import net.sf.odinms.server.maps.FakeCharacter;
- import static net.sf.odinms.client.messages.CommandProcessor.getNamedIntArg;
- import static net.sf.odinms.client.messages.CommandProcessor.getOptionalIntArg;
- import net.sf.odinms.tools.StringUtil;
- public class GM implements Command {
- private static String getBannedReason(String name) { // Very horrible way to do this, but works so ehh fuck you ;D
- Connection con = DatabaseConnection.getConnection();
- try {
- PreparedStatement ps;
- ResultSet rs;
- ps = con.prepareStatement("SELECT name, banned, banreason, macs FROM accounts WHERE name = ?");
- ps.setString(1, name);
- rs = ps.executeQuery();
- if (rs.next()) {
- if (rs.getInt("banned") > 0) {
- return "username: " + rs.getString("name") + " | banreason: " + rs.getString("banreason") + " | macs: " + rs.getString("macs");
- } else {
- return "Player is not banned";
- }
- }
- int accid;
- ps = con.prepareStatement("SELECT accountid FROM characters WHERE name = ?");
- ps.setString(1, name);
- rs = ps.executeQuery();
- if (!rs.next()) {
- return "This character / account does not exist.";
- } else {
- accid = rs.getInt("accountid");
- }
- ps = con.prepareStatement("SELECT name, banned, banreason, macs FROM accounts WHERE id = ?");
- ps.setInt(1, accid);
- rs = ps.executeQuery();
- if (rs.getInt("banned") > 0) {
- return "username: " + rs.getString("name") + " | banreason: " + rs.getString("banreason") + " | macs: " + rs.getString("macs");
- } else {
- return "Player is not banned";
- }
- } catch (SQLException exe) {
- }
- return null;
- }
- @Override
- public void execute(MapleClient c, MessageCallback mc, String[] splitted) throws Exception {
- ChannelServer cserv = c.getChannelServer();
- Collection<ChannelServer> cservs = ChannelServer.getAllInstances();
- MapleCharacter player = c.getPlayer();
- splitted[0] = splitted[0].toLowerCase();
- String themapname = player.getMap().getMapName();
- if (splitted[0].equalsIgnoreCase("!lowhp")) {
- player.setHp(1);
- player.updateSingleStat(MapleStat.HP, 1);
- } else if (splitted[0].equalsIgnoreCase("!sp")) {
- if (splitted.length != 2) {
- return;
- }
- int sp;
- try {
- sp = Integer.parseInt(splitted[1]);
- } catch (NumberFormatException asd) {
- return;
- }
- player.setRemainingSp(sp + player.getRemainingSp());
- player.updateSingleStat(MapleStat.AVAILABLESP, player.getRemainingSp());
- } else if (splitted[0].equalsIgnoreCase("!ap")) {
- if (splitted.length != 2) {
- return;
- }
- int ap;
- try {
- ap = Integer.parseInt(splitted[1]);
- } catch (NumberFormatException asd) {
- return;
- }
- player.setRemainingAp(ap + player.getRemainingAp());
- player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
- } else if (splitted[0].equalsIgnoreCase("!job")) {
- if (splitted.length != 2) {
- //return;
- mc.dropMessage("--------------职 业 代 码--------------");
- mc.dropMessage("0 新手,100 战士,200 法师,300 射手,400 飞侠,500 海盗 || 900 管理员,910 超级管理员 ");
- mc.dropMessage("110-112 英雄,120-122 圣骑,130-132 黑骑 || 210-212 火毒,220-222 冰雷,230-232 主教 ");
- mc.dropMessage("310-312 射手,320-322 游侠 || 410-412 隐士,420-422 侠盗 || 510-512 冲锋,520-522 船长");
- }
- int job;
- try {
- job = Integer.parseInt(splitted[1]);
- } catch (NumberFormatException asd) {
- return;
- }
- player.setJob(job);
- } else if (splitted[0].equalsIgnoreCase("!whereami")) {
- mc.dropMessage("You are on map " + player.getMap().getId());
-
- } else if (splitted[0].equalsIgnoreCase("!levelup")) {
- player.levelUp();
- player.setExp(0);
- player.updateSingleStat(MapleStat.EXP, 0);
- } else if (splitted[0].equalsIgnoreCase("!setmaxmp")) {
- if (splitted.length != 2) {
- return;
- }
- int amt;
- try {
- amt = Integer.parseInt(splitted[1]);
- } catch (NumberFormatException asd) {
- return;
- }
- player.setMaxMp(amt);
- player.updateSingleStat(MapleStat.MAXMP, player.getMaxMp());
- } else if (splitted[0].equalsIgnoreCase("!setmaxhp")) {
- if (splitted.length != 2) {
- return;
- }
- int amt;
- try {
- amt = Integer.parseInt(splitted[1]);
- } catch (NumberFormatException asd) {
- return;
- }
- player.setMaxHp(amt);
- player.updateSingleStat(MapleStat.MAXHP, player.getMaxHp());
- } else if (splitted[0].equalsIgnoreCase("!healmap")) {
- for (MapleCharacter map : player.getMap().getCharacters()) {
- if (map != null) {
- map.setHp(map.getCurrentMaxHp());
- map.updateSingleStat(MapleStat.HP, map.getHp());
- map.setMp(map.getCurrentMaxMp());
- map.updateSingleStat(MapleStat.MP, map.getMp());
- }
- }
-
- } else if (splitted[0].equalsIgnoreCase("!level")) {
- if (splitted.length != 2) {
- return;
- }
- int level;
- try {
- level = Integer.parseInt(splitted[1]);
- } catch (NumberFormatException asd) {
- return;
- }
- player.setLevel(level);
- player.levelUp();
- player.setExp(0);
- player.updateSingleStat(MapleStat.EXP, 0);
- } else if (splitted[0].equalsIgnoreCase("!online")) {
- int i = 0;
- for (ChannelServer cs : ChannelServer.getAllInstances()) {
- if (cs.getPlayerStorage().getAllCharacters().size() > 0) {
- StringBuilder sb = new StringBuilder();
- mc.dropMessage("Channel " + cs.getChannel());
- for (MapleCharacter chr : cs.getPlayerStorage().getAllCharacters()) {
- i++;
- if (sb.length() > 150) { // Chars per line. Could be more or less
- mc.dropMessage(sb.toString());
- sb = new StringBuilder();
- }
- sb.append(MapleCharacterUtil.makeMapleReadable(chr.getName() + " "));
- }
- mc.dropMessage(sb.toString());
- }
- }
- } else if (splitted[0].equalsIgnoreCase("!banreason")) {
- if (splitted.length != 2) {
- return;
- }
- mc.dropMessage(getBannedReason(splitted[1]));
- } else if (splitted[0].equalsIgnoreCase("!joinguild")) {
- if (splitted.length != 2) {
- return;
- }
- Connection con = DatabaseConnection.getConnection();
- try {
- PreparedStatement ps = con.prepareStatement("SELECT guildid FROM guilds WHERE name = ?");
- ps.setString(1, splitted[1]);
- ResultSet rs = ps.executeQuery();
- if (rs.next()) {
- if (player.getGuildId() > 0) {
- try {
- cserv.getWorldInterface().leaveGuild(player.getMGC());
- } catch (java.rmi.RemoteException re) {
- c.getSession().write(MaplePacketCreator.serverNotice(5, "Unable to connect to the World Server. Please try again later."));
- return;
- }
- c.getSession().write(MaplePacketCreator.showGuildInfo(null));
- player.setGuildId(0);
- player.saveGuildStatus();
- }
- player.setGuildId(rs.getInt("guildid"));
- player.setGuildRank(2); // Jr.master :D
- try {
- cserv.getWorldInterface().addGuildMember(player.getMGC());
- } catch (RemoteException e) {
- cserv.reconnectWorld();
- }
- c.getSession().write(MaplePacketCreator.showGuildInfo(player));
- player.getMap().broadcastMessage(player, MaplePacketCreator.removePlayerFromMap(player.getId()), false);
- player.getMap().broadcastMessage(player, MaplePacketCreator.spawnPlayerMapobject(player), false);
- if (player.getNoPets() > 0) {
- for (MaplePet pet : player.getPets()) {
- player.getMap().broadcastMessage(player, MaplePacketCreator.showPet(player, pet, false, false), false);
- }
- }
- player.saveGuildStatus();
- } else {
- mc.dropMessage("Guild name does not exist.");
- }
- rs.close();
- ps.close();
- } catch (SQLException e) {
- return;
- }
- } else if (splitted[0].equalsIgnoreCase("!unbuffmap")) {
- for (MapleCharacter map : player.getMap().getCharacters()) {
- if (map != null && map != player) {
- map.cancelAllBuffs();
- }
- }
- } else if (splitted[0].equalsIgnoreCase("!mxb")) {
- if (splitted.length != 2) {
- return;
- }
- int meso;
- try {
- meso = Integer.parseInt(splitted[1]);
- } catch (NumberFormatException sex) {
- return;
- }
- player.setMeso(meso);
-
- } else if (splitted[0].equalsIgnoreCase("!ariantpq")) {
- if (splitted.length < 2) {
- player.getMap().AriantPQStart();
- } else {
- c.getSession().write(MaplePacketCreator.updateAriantPQRanking(splitted[1], 5, false));
- }
- } else if (splitted[0].equalsIgnoreCase("!scoreboard")) {
- player.getMap().broadcastMessage(MaplePacketCreator.showAriantScoreBoard());
- } else if (splitted[0].equalsIgnoreCase("!array")) {
- if (splitted.length >= 2) {
- if (splitted[1].equalsIgnoreCase("*CLEAR")) {
- cserv.setArrayString("");
- mc.dropMessage("Array flushed.");
- } else {
- cserv.setArrayString(cserv.getArrayString() + StringUtil.joinStringFrom(splitted, 1));
- mc.dropMessage("Added " + StringUtil.joinStringFrom(splitted, 1) + " to the array. Use !array to check.");
- }
- } else {
- mc.dropMessage("Array: " + cserv.getArrayString());
- }
- } else if (splitted[0].equalsIgnoreCase("!slap")) {
- MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
- int damage;
- try {
- damage = Integer.parseInt(splitted[2]);
- } catch (NumberFormatException sex) {
- return;
- }
- if (victim.getHp() > damage) {
- victim.setHp(victim.getHp() - damage);
- victim.updateSingleStat(MapleStat.HP, victim.getHp());
- victim.dropMessage(5, player.getName() + " picked up a big fish and slapped you across the head. You've lost " + damage + " hp");
- mc.dropMessage(victim.getName() + " has " + victim.getHp() + " HP left");
- } else {
- victim.setHp(0);
- victim.updateSingleStat(MapleStat.HP, 0);
- victim.dropMessage(5, player.getName() + " gave you a headshot with a fish (:");
- }
- } else if (splitted[0].equalsIgnoreCase("!rreactor")) {
- player.getMap().resetReactors();
- } else if (splitted[0].equalsIgnoreCase("!sha2")) {
- String mapMessage = "";
- MapleMap map = player.getMap();
- double range = Double.POSITIVE_INFINITY;
- if (splitted.length > 1) {
- int irange = Integer.parseInt(splitted[1]);
- if (splitted.length <= 2) {
- range = irange * irange;
- } else {
- map = cserv.getMapFactory().getMap(Integer.parseInt(splitted[2]));
- mapMessage = " in " + map.getStreetName() + " : " + map.getMapName();
- }
- }
- List<MapleMapObject> monsters = map.getMapObjectsInRange(player.getPosition(), range, Arrays.asList(MapleMapObjectType.MONSTER));
- for (MapleMapObject monstermo : monsters) {
- MapleMonster monster = (MapleMonster) monstermo;
- map.killMonster(monster, player, false);
- }
- mc.dropMessage("杀死了 " + monsters.size() + " 只怪物" + mapMessage + ".");
- } else if (splitted[0].equals("!sha") || splitted[0].equals("!monsterdebug")) {
- MapleMap map = c.getPlayer().getMap();
- double range = Double.POSITIVE_INFINITY;
- List<MapleMapObject> monsters = map.getMapObjectsInRange(c.getPlayer().getPosition(), range, Arrays.asList(MapleMapObjectType.MONSTER));
- boolean kill = splitted[0].equals("!sha");
- for (MapleMapObject monstermo : monsters) {
- MapleMonster monster = (MapleMonster) monstermo;
- if (kill) {
- map.killMonster(monster, c.getPlayer(), true);
- monster.giveExpToCharacter(c.getPlayer(), monster.getExp(), true, 1);
- } else {
- mc.dropMessage("怪物 " + monster.toString());
- }
- }
- if (kill) {
- mc.dropMessage("杀死了 " + monsters.size() + " 只怪物.");
- }
- } else if (splitted[0].equalsIgnoreCase("!say")) {
- if (splitted.length > 1) {
- try {
- cserv.getWorldInterface().broadcastMessage(player.getName(), MaplePacketCreator.serverNotice(6, "[" + player.getName() + "] " + StringUtil.joinStringFrom(splitted, 1)).getBytes());
- } catch (RemoteException e) {
- cserv.reconnectWorld();
- }
- } else {
- mc.dropMessage("Syntax: !say <message>");
- }
- } else if (splitted[0].equalsIgnoreCase("!gender")) {
- MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
- if (victim != null) {
- victim.setGender(victim.getGender() == 1 ? 0 : 1);
- victim.getClient().getSession().write(MaplePacketCreator.getCharInfo(victim));
- victim.getMap().removePlayer(victim);
- victim.getMap().addPlayer(victim);
- } else {
- mc.dropMessage("Player is not on.");
- }
- } else if (splitted[0].equalsIgnoreCase("!spy")) {
- MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
- if (victim != null) {
- mc.dropMessage("Players stats are:");
- mc.dropMessage("Level: " + victim.getLevel() + " || Rebirthed: " + victim.getReborns());
- mc.dropMessage("Fame: " + victim.getFame());
- mc.dropMessage("Str: " + victim.getStr() + " || Dex: " + victim.getDex() + " || Int: " + victim.getInt() + " || Luk: " + victim.getLuk());
- mc.dropMessage("Player has " + victim.getMeso() + " mesos.");
- mc.dropMessage("Hp: " + victim.getHp() + "/" + victim.getCurrentMaxHp() + " || Mp: " + victim.getMp() + "/" + victim.getCurrentMaxMp());
- mc.dropMessage("NX Cash: " + victim.getCSPoints(0));
- } else {
- mc.dropMessage("Player not found.");
- }
-
- } else if (splitted[0].equalsIgnoreCase("!skill")) {
- int skill;
- try {
- skill = Integer.parseInt(splitted[1]);
- } catch (NumberFormatException asd) {
- return;
- }
- int maxlevel = SkillFactory.getSkill(skill).getMaxLevel();
- int level = getOptionalIntArg(splitted, 2, maxlevel);
- int masterlevel = getOptionalIntArg(splitted, 3, maxlevel);
- if (splitted.length == 4) {
- player.changeSkillLevel(SkillFactory.getSkill(skill), level, masterlevel);
- } else if (splitted.length == 5) {
- MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[4]);
- if (victim != null) {
- victim.changeSkillLevel(SkillFactory.getSkill(skill), level, masterlevel);
- } else {
- mc.dropMessage("Victim was not found.");
- }
- }
-
- } else if (splitted[0].equalsIgnoreCase("!maxskills")) {
- player.maxAllSkills();
-
- } else if (splitted[0].equalsIgnoreCase("!unhide")) {
- MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
- if (victim != null) {
- victim.dispelSkill(9101004);
- } else {
- mc.dropMessage("Player not found");
- }
- } else if (splitted[0].equalsIgnoreCase("!heal")) {
- MapleCharacter heal = null;
- if (splitted.length == 2) {
- heal = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
- if (heal == null) {
- mc.dropMessage("Player was not found");
- }
- } else {
- heal = player;
- }
- heal.setHp(heal.getCurrentMaxHp());
- heal.setMp(heal.getCurrentMaxMp());
- heal.updateSingleStat(MapleStat.HP, heal.getCurrentMaxHp());
- heal.updateSingleStat(MapleStat.MP, heal.getCurrentMaxMp());
- } else if (splitted[0].equalsIgnoreCase("!unbuff")) {
- MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
- if (victim != null) {
- victim.cancelAllBuffs();
- } else {
- mc.dropMessage("Player not found");
- }
- } else if (splitted[0].equalsIgnoreCase("!sendhint")) {
- MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
- if (victim != null) {
- String message = StringUtil.joinStringFrom(splitted, 2);
- victim.getMap().broadcastMessage(victim, MaplePacketCreator.sendHint(message, 0, 0), false);
- } else {
- mc.dropMessage("Player not found");
- }
- } else if (splitted[0].equalsIgnoreCase("!smega")) {
- if (splitted.length > 3) {
- MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
- if (victim != null) {
- String type = splitted[2];
- String text = StringUtil.joinStringFrom(splitted, 3);
- int itemID = 5390002; // default.
- if (type.equalsIgnoreCase("love")) {
- itemID = 5390002;
- } else if (type.equalsIgnoreCase("cloud")) {
- itemID = 5390001;
- } else if (type.equalsIgnoreCase("diablo")) {
- itemID = 5390000;
- }
- String[] lines = {"", "", "", ""};
- if (text.length() > 30) {
- lines[0] = text.substring(0, 10);
- lines[1] = text.substring(10, 20);
- lines[2] = text.substring(20, 30);
- lines[3] = text.substring(30);
- } else if (text.length() > 20) {
- lines[0] = text.substring(0, 10);
- lines[1] = text.substring(10, 20);
- lines[2] = text.substring(20);
- } else if (text.length() > 10) {
- lines[0] = text.substring(0, 10);
- lines[1] = text.substring(10);
- } else if (text.length() <= 10) {
- lines[0] = text;
- }
- LinkedList<String> list = new LinkedList<String>();
- list.add(lines[0]);
- list.add(lines[1]);
- list.add(lines[2]);
- list.add(lines[3]);
- try {
- victim.getClient().getChannelServer().getWorldInterface().broadcastSMega(null, MaplePacketCreator.getAvatarMega(victim, c.getChannel(), itemID, list, false).getBytes());
- } catch (RemoteException e) {
- cserv.reconnectWorld();
- }
- } else {
- mc.dropMessage("Player not found.");
- }
- } else {
- mc.dropMessage("Syntax: !smega <player> <love/diablo/cloud> text");
- }
- } else if (splitted[0].equalsIgnoreCase("!mutesmega")) {
- MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
- if (victim != null) {
- victim.setCanSmega(!victim.getCanSmega());
- victim.dropMessage(5, "Your smega ability is now " + (victim.getCanSmega() ? "on" : "off"));
- player.dropMessage(6, "Player's smega ability is now set to " + victim.getCanSmega());
- } else {
- mc.dropMessage("Player not found");
- }
- } else if (splitted[0].equalsIgnoreCase("!mute")) {
- MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
- if (victim != null) {
- victim.canTalk(!victim.getCanTalk());
- victim.dropMessage(5, "Your chatting ability is now " + (victim.getCanTalk() ? "on" : "off"));
- player.dropMessage(6, "Player's chatting ability is now set to " + victim.getCanTalk());
- } else {
- mc.dropMessage("Player not found");
- }
- } else if (splitted[0].equalsIgnoreCase("!givedisease")) {
- MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
- int type;
- if (splitted[2].equalsIgnoreCase("SEAL")) {
- type = 120;
- } else if (splitted[2].equalsIgnoreCase("DARKNESS")) {
- type = 121;
- } else if (splitted[2].equalsIgnoreCase("WEAKEN")) {
- type = 122;
- } else if (splitted[2].equalsIgnoreCase("STUN")) {
- type = 123;
- } else if (splitted[2].equalsIgnoreCase("POISON")) {
- type = 125;
- } else if (splitted[2].equalsIgnoreCase("SEDUCE")) {
- type = 128;
- } else {
- mc.dropMessage("ERROR.");
- return;
- }
- victim.giveDebuff(MapleDisease.getType(type), MobSkillFactory.getMobSkill(type, 1));
- } else if (splitted[0].equalsIgnoreCase("!dc")) {
- MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
- victim.getClient().disconnect();
- victim.getClient().getSession().close();
- } else if (splitted[0].equalsIgnoreCase("!charinfo")) {
- StringBuilder builder = new StringBuilder();
- MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
- if (victim == null) {
- return;
- }
- builder.append(MapleClient.getLogMessage(victim, "")); // Could use null i think ?
- mc.dropMessage(builder.toString());
- builder = new StringBuilder();
- builder.append("Positions: X: ");
- builder.append(victim.getPosition().x);
- builder.append(" Y: ");
- builder.append(victim.getPosition().y);
- builder.append(" | RX0: ");
- builder.append(victim.getPosition().x + 50);
- builder.append(" | RX1: ");
- builder.append(victim.getPosition().x - 50);
- builder.append(" | FH: ");
- builder.append(victim.getMap().getFootholds().findBelow(player.getPosition()).getId());
- mc.dropMessage(builder.toString());
- builder = new StringBuilder();
- builder.append("HP: ");
- builder.append(victim.getHp());
- builder.append("/");
- builder.append(victim.getCurrentMaxHp());
- builder.append(" | MP: ");
- builder.append(victim.getMp());
- builder.append("/");
- builder.append(victim.getCurrentMaxMp());
- builder.append(" | EXP: ");
- builder.append(victim.getExp());
- builder.append(" | In a Party: ");
- builder.append(victim.getParty() != null);
- builder.append(" | In a Trade: ");
- builder.append(victim.getTrade() != null);
- mc.dropMessage(builder.toString());
- builder = new StringBuilder();
- builder.append("Remote Address: ");
- builder.append(victim.getClient().getSession().getRemoteAddress());
- mc.dropMessage(builder.toString());
- victim.getClient().dropDebugMessage(mc);
- } else if (splitted[0].equalsIgnoreCase("!connected")) {
- try {
- Map<Integer, Integer> connected = cserv.getWorldInterface().getConnected();
- StringBuilder conStr = new StringBuilder();
- mc.dropMessage("Connected Clients: ");
- for (int i : connected.keySet()) {
- if (i == 0) {
- conStr.append("Total: "); // I HAVE NO CLUE WHY.
- conStr.append(connected.get(i));
- } else {
- conStr.append("Channel ");
- conStr.append(i);
- conStr.append(": ");
- conStr.append(connected.get(i));
- }
- }
- mc.dropMessage(conStr.toString());
- } catch (RemoteException e) {
- cserv.reconnectWorld();
- }
- } else if (splitted[0].equalsIgnoreCase("!clock")) {
- player.getMap().broadcastMessage(MaplePacketCreator.getClock(getOptionalIntArg(splitted, 1, 60)));
-
- } else if (splitted[0].equalsIgnoreCase("!jail")) {
- MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
- if (victim != null) {
- victim.changeMap(980000404, 0);
- mc.dropMessage(victim.getName() + " was jailed!");
- victim.dropMessage("You've been jailed bitch.");
- } else {
- mc.dropMessage(splitted[1] + " not found!");
- }
- } else if (splitted[0].equalsIgnoreCase("!goto")) {
- Map<String, Integer> maps = new HashMap<String, Integer>();
- maps.put("gmmap", 180000000);
- maps.put("southperry", 60000);
- maps.put("amherst", 1010000);
- maps.put("henesys", 100000000);
- maps.put("ellinia", 101000000);
- maps.put("perion", 102000000);
- maps.put("kerning", 103000000);
- maps.put("lith", 104000000);
- maps.put("sleepywood", 105040300);
- maps.put("florina", 110000000);
- maps.put("orbis", 200000000);
- maps.put("happy", 209000000);
- maps.put("elnath", 211000000);
- maps.put("ludi", 220000000);
- maps.put("aqua", 230000000);
- maps.put("leafre", 240000000);
- maps.put("mulung", 250000000);
- maps.put("herb", 251000000);
- maps.put("omega", 221000000);
- maps.put("korean", 222000000);
- maps.put("nlc", 600000000);
- maps.put("excavation", 990000000);
- maps.put("pianus", 230040420);
- maps.put("horntail", 240060200);
- maps.put("mushmom", 100000005);
- maps.put("griffey", 240020101);
- maps.put("manon", 240020401);
- maps.put("headless", 682000001);
- maps.put("balrog", 105090900);
- maps.put("zakum", 280030000);
- maps.put("papu", 220080001);
- maps.put("showa", 801000000);
- maps.put("guild", 200000301);
- maps.put("shrine", 800000000);
- maps.put("fm", 910000000);
- maps.put("skelegon", 240040511);
- maps.put("ariant", 260000100);
- //Function
- if (splitted.length < 2) { //If no arguments, list options.
- mc.dropMessage("Syntax: !goto <mapname> <optional_target>, where target is char name and mapname is one of:");
- StringBuilder builder = new StringBuilder();
- int i = 0;
- for (String mapss : maps.keySet()) {
- if (1 % 10 == 0) {// 10 maps per line
- mc.dropMessage(builder.toString());
- } else {
- builder.append(mapss + ", ");
- }
- }
- mc.dropMessage(builder.toString());
- } else {
- String message = splitted[1];
- if (maps.containsKey(message)) {
- if (splitted.length == 2) { //If no target name, continue
- player.changeMap(maps.get(message));
- } else if (splitted.length == 3) { //If target name, new target
- MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[2]);
- victim.changeMap(maps.get(message));
- }
- } else {
- mc.dropMessage("Could not find map");
- }
- }
- maps.clear();
-
- } else if (splitted[0].equalsIgnoreCase("!servermessage")) {
- String outputMessage = StringUtil.joinStringFrom(splitted, 1);
- if (outputMessage.equalsIgnoreCase("!array")) {
- outputMessage = cserv.getArrayString();
- }
- cserv.setServerMessage(outputMessage);
- } else if (splitted[0].equals("!gmsay")) { try {
- BufferedReader in = new BufferedReader(
- new FileReader("D:\gmsay.txt"));
- String s1 , s = new String();
- while( (s1 = in.readLine()) != null ){
- s += s1 ;
- }
- String[] contents = s.split(("\*"));
- for (int i = 0; i < contents.length; i++) {
- if (splitted[1].equals(""+(i+1))) {
- MaplePacket packet = MaplePacketCreator.serverNotice(6,"[系统公告] " + contents[i] );
- try {
- ChannelServer.getInstance(c.getChannel()).getWorldInterface().broadcastMessage(
- c.getPlayer().getName(), packet.getBytes());
- } catch (RemoteException e) {
- c.getChannelServer().reconnectWorld();
- }
- mc.dropMessage("[管理员公告] " + contents[i]);
- }
- }
- } catch (IOException e) {
- System.err.println(e);
- }
- } else if (splitted[0].equalsIgnoreCase("!whosthere")) {
- StringBuilder builder = new StringBuilder();
- mc.dropMessage("Players on Map: ");
- for (MapleCharacter chr : player.getMap().getCharacters()) {
- if (builder.length() > 150) { // wild guess :o
- mc.dropMessage(builder.toString());
- builder = new StringBuilder();
- }
- builder.append(MapleCharacterUtil.makeMapleReadable(chr.getName()));
- builder.append(", ");
- }
- player.dropMessage(6, builder.toString());
- } else if (splitted[0].equalsIgnoreCase("!cheaters")) {
- try {
- List<CheaterData> cheaters = cserv.getWorldInterface().getCheaters();
- for (CheaterData cheater : cheaters) {
- mc.dropMessage(cheater.getInfo());
- }
- } catch (RemoteException e) {
- cserv.reconnectWorld();
- }
-
- } else if (splitted[0].equalsIgnoreCase("!nearestPortal")) {
- final MaplePortal portal = player.getMap().findClosestSpawnpoint(player.getPosition());
- mc.dropMessage(portal.getName() + " id: " + portal.getId() + " script: " + portal.getScriptName());
- } else if (splitted[0].equalsIgnoreCase("!unban")) {
- if (MapleCharacter.unban(splitted[1])) {
- mc.dropMessage("Sucess!");
- } else {
- mc.dropMessage("Error while unbanning.");
- }
-
- } else if (splitted[0].equals("!ban")) {
- String originalReason = StringUtil.joinStringFrom(splitted, 2);
- String reason = player.getName() + " banned " + splitted[1] + ": " + originalReason;
- MapleCharacter target = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
- if (target != null) {
- if (!target.isGM() || player.getGMLevel() > 3) {
- String readableTargetName = MapleCharacterUtil.makeMapleReadable(target.getName());
- String ip = target.getClient().getSession().getRemoteAddress().toString().split(":")[0];
- reason += " IP: " + ip;
- target.ban(reason, false);
- try {
- cserv.getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(6, readableTargetName + " has been banned for " + originalReason).getBytes());
- } catch (RemoteException e) {
- cserv.reconnectWorld();
- }
- } else {
- mc.dropMessage("Please dont ban " + cserv.getServerName() + " GMs");
- }
- } else {
- if (MapleCharacter.ban(splitted[1], reason, false)) {
- String readableTargetName = MapleCharacterUtil.makeMapleReadable(target.getName());
- String ip = target.getClient().getSession().getRemoteAddress().toString().split(":")[0];
- reason += " (IP: " + ip + ")";
- try {
- cserv.getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(6, readableTargetName + " has been banned for " + originalReason).getBytes());
- } catch (RemoteException e) {
- cserv.reconnectWorld();
- }
- } else {
- mc.dropMessage("Failed to ban " + splitted[1]);
- }
- }
- } else if (splitted[0].equals("!tempban")) {
- Calendar tempB = Calendar.getInstance();
- String originalReason = joinAfterString(splitted, ":");
- if (splitted.length < 4 || originalReason == null) {
- mc.dropMessage("Syntax helper: !tempban <name> [i / m / w / d / h] <amount> [r [reason id] : Text Reason");
- return;
- }
- int yChange = getNamedIntArg(splitted, 1, "y", 0);
- int mChange = getNamedIntArg(splitted, 1, "m", 0);
- int wChange = getNamedIntArg(splitted, 1, "w", 0);
- int dChange = getNamedIntArg(splitted, 1, "d", 0);
- int hChange = getNamedIntArg(splitted, 1, "h", 0);
- int iChange = getNamedIntArg(splitted, 1, "i", 0);
- int gReason = getNamedIntArg(splitted, 1, "r", 7);
- String reason = player.getName() + " tempbanned " + splitted[1] + ": " + originalReason;
- if (gReason > 14) {
- mc.dropMessage("You have entered an incorrect ban reason ID, please try again.");
- return;
- }
- DateFormat df = DateFormat.getInstance();
- tempB.set(tempB.get(Calendar.YEAR) + yChange, tempB.get(Calendar.MONTH) + mChange, tempB.get(Calendar.DATE) +
- (wChange * 7) + dChange, tempB.get(Calendar.HOUR_OF_DAY) + hChange, tempB.get(Calendar.MINUTE) +
- iChange);
- MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
- if (victim == null) {
- int accId = MapleClient.findAccIdForCharacterName(splitted[1]);
- if (accId >= 0 && MapleCharacter.tempban(reason, tempB, gReason, accId)) {
- String readableTargetName = MapleCharacterUtil.makeMapleReadable(victim.getName());
- cserv.broadcastPacket(MaplePacketCreator.serverNotice(6, readableTargetName + " has been banned for " + originalReason));
- } else {
- mc.dropMessage("There was a problem offline banning character " + splitted[1] + ".");
- }
- } else {
- victim.tempban(reason, tempB, gReason);
- mc.dropMessage("The character " + splitted[1] + " has been successfully tempbanned till " + df.format(tempB.getTime()));
- }
-
- } else if (splitted[0].equalsIgnoreCase("!mynpcpos")) {
- Point pos = player.getPosition();
- mc.dropMessage("X: " + pos.x + " | Y: " + pos.y + " | RX0: " + (pos.x + 50) + " | RX1: " + (pos.x - 50) + " | FH: " + player.getMap().getFootholds().findBelow(pos).getId());
- } else if (splitted[0].equalsIgnoreCase("!qingchu")||splitted[0].equalsIgnoreCase("!laji")) {
- MapleMap map = player.getMap();
- double range = Double.POSITIVE_INFINITY;
- java.util.List<MapleMapObject> items = map.getMapObjectsInRange(player.getPosition(), range, Arrays.asList(MapleMapObjectType.ITEM));
- for (MapleMapObject itemmo : items) {
- map.removeMapObject(itemmo);
- map.broadcastMessage(MaplePacketCreator.removeItemFromMap(itemmo.getObjectId(), 0, player.getId()));
- }
- mc.dropMessage("You have destroyed " + items.size() + " items on the ground.");
- } else if (splitted[0].equalsIgnoreCase("!chongzhishangdian")) {
- MapleShopFactory.getInstance().clear();
- } else if (splitted[0].equalsIgnoreCase("!chongzhishijian")) {
- for (ChannelServer instance : ChannelServer.getAllInstances()) {
- instance.reloadEvents();
- }
- } else if (splitted[0].equalsIgnoreCase("!feng")) {
- String name = splitted[1];
- String reason = StringUtil.joinStringFrom(splitted, 2);
- MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(name);
- if (victim != null) {
- if (!victim.isGM()) {
- victim.ban(reason, true);
- mc.dropMessage("成功!此角色已经被封!");
- } else {
- mc.dropMessage("你不能封GM!");
- }
- } else {
- if (MapleCharacter.ban(name, reason, false)) {
- mc.dropMessage("Permanently banned sucessfully");
- } else {
- mc.dropMessage("Error while banning.");
- }
- }
- } else if (splitted[0].equalsIgnoreCase("!emote")) {
- String name = splitted[1];
- int emote;
- try {
- emote = Integer.parseInt(splitted[2]);
- } catch (NumberFormatException nfe) {
- return;
- }
- MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(name);
- if (victim != null) {
- victim.getMap().broadcastMessage(victim, MaplePacketCreator.facialExpression(victim, emote), victim.getPosition());
- } else {
- mc.dropMessage("Player was not found");
- }
-
- } else if (splitted[0].equals("!addclones")) {
- if (splitted.length < 2) {
- return;
- }
- int clones;
- try {
- clones = getOptionalIntArg(splitted, 1, 1);
- } catch (NumberFormatException asdasd) {
- return;
- }
- if (player.getFakeChars().size() >= 5) {
- mc.dropMessage("You are not allowed to clone yourself over 5 times.");
- } else {
- for (int i = 0; i < clones && i + player.getFakeChars().size() <= 6; i++) {
- FakeCharacter fc = new FakeCharacter(player, player.getId() + player.getFakeChars().size() + clones + i);
- player.getFakeChars().add(fc);
- c.getChannelServer().addClone(fc);
- }
- mc.dropMessage("You have cloned yourself " + player.getFakeChars().size() + " times so far.");
- }
- } else if (splitted[0].equals("!removeclones")) {
- for (FakeCharacter fc : player.getFakeChars()) {
- if (fc.getFakeChar().getMap() == player.getMap()) {
- c.getChannelServer().getAllClones().remove(fc);
- player.getMap().removePlayer(fc.getFakeChar());
- }
- }
- player.getFakeChars().clear();
- mc.dropMessage("All your clones in the map removed.");
- } else if (splitted[0].equals("!removeallclones")) {
- for (FakeCharacter fc : c.getChannelServer().getAllClones()) {
- if (fc.getOwner() != null) {
- fc.getOwner().getFakeChars().remove(fc);
- }
- fc.getFakeChar().getMap().removePlayer(fc.getFakeChar());
- }
- c.getChannelServer().getAllClones().clear();
- mc.dropMessage("ALL clones have been removed.");
- } else if (splitted[0].equals("!follow")) {
- int slot = Integer.parseInt(splitted[1]);
- FakeCharacter fc = player.getFakeChars().get(slot);
- if (fc == null) {
- mc.dropMessage("Clone does not exist.");
- } else {
- fc.setFollow(true);
- }
- } else if (splitted[0].equals("!pause")) {
- int slot = Integer.parseInt(splitted[1]);
- FakeCharacter fc = player.getFakeChars().get(slot);
- if (fc == null) {
- mc.dropMessage("Clone does not exist.");
- } else {
- fc.setFollow(false);
- }
- } else if (splitted[0].equals("!stance")) {
- if (splitted.length == 3) {
- int slot = Integer.parseInt(splitted[1]);
- int stance = Integer.parseInt(splitted[2]);
- player.getFakeChars().get(slot).getFakeChar().setStance(stance);
- }
- } else if (splitted[0].equalsIgnoreCase("!killmonster")) {
- if (splitted.length == 2) {
- MapleMap map = c.getPlayer().getMap();
- int targetId = Integer.parseInt(splitted[1]);
- List<MapleMapObject> monsters = map.getMapObjectsInRange(c.getPlayer().getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER));
- for (MapleMapObject monsterm : monsters) {
- MapleMonster monster = (MapleMonster) monsterm;
- if (monster.getId() == targetId) {
- map.killMonster(monster, player, false);
- break;
- }
- }
- }
- } else if (splitted[0].equalsIgnoreCase("!removeoid")) {
- if (splitted.length == 2) {
- MapleMap map = c.getPlayer().getMap();
- int oid = Integer.parseInt(splitted[1]);
- MapleMapObject obj = map.getMapObject(oid);
- if (obj == null) {
- mc.dropMessage("This oid does not exist.");
- } else {
- map.removeMapObject(obj);
- }
- }
-
- } else if (splitted[0].equalsIgnoreCase("!currentdate")) {
- Calendar cal = Calendar.getInstance();
- int day = cal.get(Calendar.DATE);
- int month = cal.get(Calendar.MONTH) + 1; // its an array of months.
- int year = cal.get(Calendar.YEAR);
- mc.dropMessage(day + "/" + month + "/" + year);
- } else if (splitted[0].equalsIgnoreCase("!maxmesos")) {
- player.gainMeso(Integer.MAX_VALUE - player.getMeso());
- } else if (splitted[0].equalsIgnoreCase("!fullcharge")) {
- player.setEnergyBar(10000);
- c.getSession().write(MaplePacketCreator.giveEnergyCharge(10000));
- } else if (splitted[0].equals("!youlose")) {
- for (MapleCharacter victim : player.getMap().getCharacters()) {
- if (victim != null) {
- if (victim.getHp() <= 0) {
- victim.dropMessage("You have lost the event.");
- victim.changeMap(100000000);
- } else {
- victim.setHp(victim.getCurrentMaxHp());
- victim.updateSingleStat(MapleStat.HP, victim.getHp());
- victim.setMp(victim.getCurrentMaxMp());
- victim.updateSingleStat(MapleStat.MP, victim.getMp());
- }
- }
- }
-
- } else if (splitted[0].equals("!changejob")) {
- //change this command to public if u want.
- int id = c.getPlayer().getId();
- int job = Integer.parseInt(splitted[1]);
- Connection con = DatabaseConnection.getConnection();
- PreparedStatement ps;
- try {
- ps = con.prepareStatement("select * from jobs where characterid = ? and jobid = ?");
- ps.setInt(1, id);
- ps.setInt(2, job);
- ResultSet rs = ps.executeQuery();
- if (!rs.next()) {
- mc.dropMessage("You don't have the following job before you rebirthed.");
- ps.close();
- }
- job = rs.getInt("jobid");
- c.getPlayer().changeJob(MapleJob.getById(job));
- ps.close();
- } catch (SQLException e) {
- System.out.println("SQL Exception: " + e);
- }
- } else if (splitted[0].equalsIgnoreCase("!coke")) {
- int[] ids = {9500144, 9500151, 9500152, 9500153, 9500154, 9500143, 9500145, 9500149, 9500147};
- for (int a : ids) {
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(a), player.getPosition());
- }
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意: 可乐怪已经召唤,请大家速度到<" + themapname + ">集合."));
- } else if (splitted[0].equals("!balrog")) {
- int[] ids = {8130100, 8150000, 9400536};
- for (int a : ids) {
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(a), player.getPosition());
- }
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意: 蝙蝠怪已经召唤,请大家速度到<" + themapname + ">集合."));
- } else if (splitted[0].equals("!mushmom")) {//蘑菇群
- int[] ids = {6130101, 6300005, 9400205};
- for (int a : ids) {
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(a), player.getPosition());
- }
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意,蘑菇群已经召唤,请大家速度到<" + themapname + ">集合."));
- } else if (splitted[0].equals("!shuyao")) {
- int[] ids = {2130100, 1110101, 1130100, 130100, 1140100, 3220000, 3220000, 3220000};
- for (int a : ids) {
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(a), player.getPosition());
- }
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意,树王已经召唤,请大家速度到<" + themapname + ">集合."));
- } else if (splitted[0].equals("!dragon")) {
- int[] ids = {8150300, 8150301, 8150302};
- for (int a : ids) {
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(a), player.getPosition());
- }
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意,飞龙群已经召唤,请大家速度到<" + themapname + ">集合."));
- } else if (splitted[0].equals("!pianus")) {
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8510000), player.getPosition());
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意,鱼王右已经召唤,请大家速度到<" + themapname + ">集合."));
- } else if (splitted[0].equals("!pianus2")) {
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8520000), player.getPosition());
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意,鱼王左已经召唤,请大家速度到<" + themapname + ">集合."));
- } else if (splitted[0].equals("!anego")) {
- int[] ids = {9400121, 9400120, 9400122, 9400110, 9400111, 9400103, 9400102, 9400101, 9400100};
- for (int a : ids) {
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(a), player.getPosition());
- }
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意,日本御姐已经召唤,请大家速度到<" + themapname + ">集合."));
- } else if (splitted[0].equals("!blackcrow")) {
- for (int amnt = getOptionalIntArg(splitted, 1, 1); amnt > 0; amnt--) {
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9400567), player.getPosition());
- }
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意,天狗已经召唤,请大家速度到<" + themapname + ">集合."));
- } else if (splitted[0].equals("!papu")) {//闹钟
- for (int amnt = getOptionalIntArg(splitted, 1, 1); amnt > 0; amnt--) {
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8500001), player.getPosition());
- }
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意,闹钟已经召唤,请大家速度到<" + themapname + ">集合."));
- } else if (splitted[0].equals("!papu2")) {
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8500000), player.getPosition());
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意,闹钟的保护罩已经召唤,打破它即可挑战闹钟,请大家速度到<" + themapname + ">集合."));
- } else if (splitted[0].equals("!ludimini")) {//时间门神
- for (int amnt = getOptionalIntArg(splitted, 1, 1); amnt > 0; amnt--) {
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8160000), player.getPosition());
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8170000), player.getPosition());
- }
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意,时间门神已经召唤,打破它即可挑战闹钟,请大家速度到<" + themapname + ">集合."));
- } else if (splitted[0].equals("!baobiao")) {
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9400112), player.getPosition());
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意,保镖A 已经召唤,杀死它一次,就会变身成保镖B,再杀死一次,它就会变身成冒险岛里最厉害的BOSS恶僧,请大家速度到<" + themapname + ">集合."));
- } else if (splitted[0].equals("!theboss")) {//恶僧
- for (int amnt = getOptionalIntArg(splitted, 1, 1); amnt > 0; amnt--) {
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9400300), player.getPosition());
- }
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意,恶僧已经召唤,请大家速度到<" + themapname + ">集合."));
- } else if (splitted[0].equals("!ergoth")) {//死灵法师
- for (int amnt = getOptionalIntArg(splitted, 1, 1); amnt > 0; amnt--) {
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9300028), player.getPosition());
- }
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意,死灵法师已经召唤,请大家速度到<" + themapname + ">集合."));
- } else if (splitted[0].equals("!pirate")) {//海盗
- int[] ids = {9300119, 9300107, 9300105, 9300106};
- for (int a : ids) {
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(a), player.getPosition());
- }
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意,海盗已经召唤,请大家速度到<" + themapname + ">集合."));
- } else if (splitted[0].equals("!bird")) {//凤凰
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9300090), player.getPosition());
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9300089), player.getPosition());
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意,凤凰已经召唤,请大家速度到<" + themapname + ">集合."));
- } else if (splitted[0].equals("!jinzhu")) {
- for (int amnt = getOptionalIntArg(splitted, 1, 1); amnt > 0; amnt--) {
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9500167), player.getPosition());
- }
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意,黄金猪猪已经召唤,请大家速度到<" + themapname + ">集合."));
- } else if (splitted[0].equals("!xueren")) {
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9400708), player.getPosition());
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意,雪人已经召唤,请大家速度到<" + themapname + ">集合."));
- } else if (splitted[0].equals("!bob")) {//超级蜗牛
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9400551), player.getPosition());
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意,超级蜗牛已经召唤,请大家速度到<" + themapname + ">集合."));
- } else if (splitted[0].equals("!clone")) {//五职业教官
- int[] ids = {9001002, 9001000, 9001003, 9001001};
- for (int a : ids) {
- player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(a), player.getPosition());
- }
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "请注意,五职业教官已经召唤,请大家速度到<" + themapname + ">集合."));
-
- } else if (splitted[0].equals("!daima")) {
- mc.dropMessage("GM指令[查代码] !daima");
- mc.dropMessage("--------------职 业 代 码--------------");
- mc.dropMessage("0 新手,100 战士,200 法师,300 射手,400 飞侠,500 海盗 || 900 管理员,910 超级管理员 ");
- mc.dropMessage("110-112 英雄,120-122 圣骑,130-132 黑骑 || 210-212 火毒,220-222 冰雷,230-232 主教 ");
- mc.dropMessage("310-312 射手,320-322 游侠 || 410-412 隐士,420-422 侠盗 || 510-512 冲锋,520-522 船长");
- mc.dropMessage("--------------地 图 代 码--------------");
- mc.dropMessage("10000 新手训练(老版),2 新手训练(新版)");
- mc.dropMessage("209000000 幸福村,209000001-15 幸福村隐藏地图");
- mc.dropMessage("180000000 GM地图,200000301 家族中心,109030001 封号地图");
- mc.dropMessage("--------------椅 子 代 码--------------");
- mc.dropMessage("3010009 粉色爱心马桶,3010007 粉色海狗靠垫,3010012 蓝色高靠背椅,3010003 红色時尚转椅");
- mc.dropMessage("3011000 钓鱼椅,3010013 悠长假期,3010014 月亮弯弯");
- mc.dropMessage("--------------装 备 代 码--------------");
- mc.dropMessage("1002140 维泽特帽,1322013 维泽特提包,1042003 维泽特西装,1062007 维泽特西裤");
- mc.dropMessage("1002562 新手帽子,1052081 新手衣服,1082230 白色闪光手套");
- mc.dropMessage("1122000 黑龙项链, 2041200 暗黑龙王石(给黑龙项链升级)");
- mc.dropMessage("1002357 扎昆头盔1, 1002390 扎昆头盔2,1002430 扎昆头盔3");
- mc.dropMessage("1032053 四叶草耳环,1032038 雪花耳钉,1032029 925银耳环,1102142 火焰披风");
- mc.dropMessage("1092033 四叶草盾牌,1092044 爱慢速变化球,1092031 瓢虫盾,1092008 锅盖");
- mc.dropMessage("1092021 光子盾, 1092029 电磁光盾, 1092045 冒险岛魔法师盾牌,");
- mc.dropMessage("1092018-20 飞侠盾牌,1092049 热情剑盾,1092050 冷艳剑盾,1092047 冒险岛飞侠盾牌");
- mc.dropMessage("1032019 水仙耳环,1032042 冒险岛耳环,1032030 勇气耳环,1032031 坚毅耳环");
- mc.dropMessage("--------------玩具武器代码--------------");
- mc.dropMessage("1302063 燃烧的火焰刀,1402044 南瓜灯笼,1422036 玩具匠人的锤子,1382016 香菇,1402029 鬼刺狼牙棒");
- mc.dropMessage("1442018 冻冻鱼,1432039 钓鱼竿,1442023 黑拖把,1302013 红鞭子,1432009 木精灵枪,");
- mc.dropMessage("1302058 冒险岛伞,1302066 枫叶庆典旗,1302049 光线鞭子,1322051 七夕,1372017 领路灯");
- mc.dropMessage("1322026 彩虹游泳圈,1332020 太极扇,1332053 野外烧烤串,1332054 闪电飞刀,1402017 船长佩剑");
- mc.dropMessage("1442046 超级雪板,1442061 仙人掌之矛,1432046 圣诞枪,1302080 闪光彩灯鞭");
- mc.dropMessage("1452054-6 鸟弓,1462047-9 鸟弩,1472065-7 鸟拳,1442047-50 玫瑰");
- mc.dropMessage("--------------现金武器代码--------------");
- mc.dropMessage("1702165 同班男生,1702169 同班女生,1702174 蝴蝶扇,1702114 荷叶青蛙,1702140 花");
- mc.dropMessage("1702179 云彩9枕头,1702000 双刃激光剑(短剑),1702034 关公大刀,1702155 星星");
- mc.dropMessage("1702081 紫色燃烧的剑,1702151 绿色的杖,1702025 蓝色的竖琴(弓),1702161 狗(拳套)");
- mc.dropMessage("1082229 飘飘手套,1082227 海盗手套,1102159 猴子气球");
- mc.dropMessage("--------------职业武器代码--------------");
- mc.dropMessage("1302056 一刀两段(单手剑),1402037 龙背刃,1402005 斩魔刀,1402035 斩天刀");
- mc.dropMessage("1312015 战魂之斧, 1312031 狂龙怒斩斧,1412010 项羽之斧 1322052 狂龙地锤");
- mc.dropMessage("1432011 寒冰破魔枪,1432030 红莲落神枪,1432038 盘龙七冲枪,1442045 血龙神斧");
- mc.dropMessage("1452044 金龙震翅弓,1462039 黄金飞龙弩,1452019 天鹰弓白, 1462015 光圣鹞弩白");
- mc.dropMessage("1372031 圣贤短杖,1382037 偃月之杖,1382035 冰肌玲珑杖,1382036 黑精灵王杖");
- mc.dropMessage("1332050 半月龙鳞裂,1472051 寒木升龙拳,2070006 齿轮镖,2070007 月牙镖,2070016 水晶齿轮");
- mc.dropMessage("--------------物 品 代 码--------------");
- mc.dropMessage("1912000 皮鞍子,1902000-2 骑宠,!skill 1004 0 骑宠技能, 1932000 海盗船(MFC060版)");
- mc.dropMessage("4001017 火眼,4031179 D片,4006000 魔法石,4006001 召回石,4001129 纪念币");
- mc.dropMessage("4030000-09 换取棋盘的材料, 4030010-16 记忆大考验, 4080000-11 五子棋");
- mc.dropMessage("2000005 超级药水,2050004 万能药水,2022199 全恢复,2050006 恢复视野药水");
- mc.dropMessage("5300000 蘑菇变身卡,5300001 漂漂猪变身卡,5300002 外星人变身卡");
- mc.dropMessage("5390000 炽热情景喇叭,5390001 绚烂情景喇叭,5390002 爱心情景喇叭");
- mc.dropMessage("VIP兑换道具代码:4001120(普通), 4001121(高级)");
- mc.dropMessage("============GM常用代码查看1=============");
- } else if (splitted[0].equals("!daima2")) {
- mc.dropMessage("GM指令[查代码2] !daima2 (059版新代码)");
- mc.dropMessage("--------------装 备 代 码--------------");
- mc.dropMessage("1382060 红杖,1432048 沙僧,1442068 关羽,1302088-94 玩具蝙蝠 || 1022058 狸猫面具");
- mc.dropMessage("1482023 指节,1492013 手枪,2330005 子弹,2331000 火方块,2332000 冰方块");
- mc.dropMessage("1702180 黑球(83 黄 84白 85橙 87彩 88紫)");
- mc.dropMessage("--------------物 品 代 码--------------");
- mc.dropMessage("2210000-03 && 2210005-12 变身药水");
- mc.dropMessage("============GM常用代码查看2=============");
- } else if (splitted[0].equals("!back3")) {
- MapleMap target = cserv.getMapFactory().getMap(100000000);
- MaplePortal targetPortal = target.getPortal(0);
- player.changeMap(target, targetPortal);
- } else if (splitted[0].equals("!testcom3")) {
- mc.dropMessage("If this works, then GM Commands work.");
- }
- }
- @Override
- public CommandDefinition[] getDefinition() {
- return new CommandDefinition[]{
- new CommandDefinition("lowhp", 3, "血降到1."),
- new CommandDefinition("sp", 3, "<数量> - 增加技能点"),
- new CommandDefinition("ap", 3, "<数量> - 增加属性点"),
- new CommandDefinition("job", 3, "<职业ID> - 转成指定职业"),
- new CommandDefinition("whereami", 3, "查看本地图ID"),
- new CommandDefinition("levelup", 3, "升级了"),
- new CommandDefinition("setmaxmp", 3, "设置MP上限"),
- new CommandDefinition("setmaxhp", 3, "设置HP上限"),
- new CommandDefinition("healmap", 3, "治疗该地图的玩家"),
- new CommandDefinition("level", 3, "<数值> 设置自己的等级"),
- new CommandDefinition("online", 3, "查看在线玩家"),
- new CommandDefinition("banreason", 3),
- new CommandDefinition("whitechat", 3),
- new CommandDefinition("joinguild", 3),
- new CommandDefinition("unbuffmap", 3),
- new CommandDefinition("mxb", 3, "<数值> 设置自己的金钱"),
- new CommandDefinition("ariantpq", 3),
- new CommandDefinition("scoreboard", 3),
- new CommandDefinition("array", 3),
- new CommandDefinition("slap", 3, "<玩家名字> <数值> 让某玩家丢失指定数值的HP"),
- new CommandDefinition("rreactor", 3),
- new CommandDefinition("sha2", 3, "杀死该地图全部怪物"),
- new CommandDefinition("sha", 3, "杀死该地图全部怪物并获得经念和物品"),
- new CommandDefinition("say", 3, "<内容> 发送蓝字公告"),
- new CommandDefinition("gender", 3, "<玩家名字> <数值0或1> 改变玩家性别"),
- new CommandDefinition("spy", 3, "<玩家名字> 查看玩家属性和一些资料"),
- new CommandDefinition("skill", 3, "<技能ID> <等级> <技能等级> - 增加技能"),
- new CommandDefinition("maxskills", 3, "技能全部学会"),
- new CommandDefinition("unhide", 3, "<玩家名字> 使某玩家取消隐身状态"),
- new CommandDefinition("heal", 3, "<玩家名字||null> 恢复自己的HP和MP"),
- new CommandDefinition("unbuff", 3, "<玩家名字> 去掉某玩家的辅助状态"),
- new CommandDefinition("sendhint", 3, "<玩家名字> <内容> 给某玩家发送信息(貌似无效)"),
- new CommandDefinition("smega", 3, "<玩家名字> <喇叭类型:love,cloud,diablo> <信息> 刷喇叭"),
- new CommandDefinition("mutesmega", 3, "<玩家名字> 开启或关闭某玩家能否使用情景喇叭喊话"),
- new CommandDefinition("mute", 3, "<玩家名字> 开启或关闭某玩家能否使用小喇叭喊话"),
- new CommandDefinition("givedisease", 3),
- new CommandDefinition("dc", 3, "<玩家名字> 踢某玩家下线"),
- new CommandDefinition("charinfo", 3, "<玩家名字> 查看某玩家坐标值之类的"),
- new CommandDefinition("connected", 3, "显示连接数"),
- new CommandDefinition("clock", 3, "<数值||null> 在地图上设置一个时间"),
- new CommandDefinition("jail", 3, "<玩家名字> 将某玩家关进监狱"),
- new CommandDefinition("goto", 3, "<预设地图名> 传送到预设的地图名"),
- new CommandDefinition("servermessage", 3, "<信息> 更改系统公告"),
- new CommandDefinition("gmsay", 3, "<D盘gmsay.txt所需发布公告的行数> - 发布系统公告"),
- new CommandDefinition("whosthere", 3, "查看该地图的玩家"),
- new CommandDefinition("cheaters", 3, "方便查看使用吸怪的玩家"),
- new CommandDefinition("nearestportal", 3),
- new CommandDefinition("unban", 3, "<玩家名字> 解封"),
- new CommandDefinition("ban", 3, "<玩家名字> <封IP理由>"),
- new CommandDefinition("tempban", 3),
- new CommandDefinition("mynpcpos", 3, "我的坐标"),
- new CommandDefinition("qingchu", 3, "清除地上物品"),
- new CommandDefinition("laji", 3, "清除地上物品"),
- new CommandDefinition("chongzhishangdian", 3),
- new CommandDefinition("chongzhishijian", 3, "重置所有事件"),
- new CommandDefinition("feng", 3, "<玩家名字> <封号理由>"),
- new CommandDefinition("emote", 3),
- new CommandDefinition("addclones", 3, "克隆人,貌似未生效"),
- new CommandDefinition("removeclones", 3, "移除克隆人,貌似未生效"),
- new CommandDefinition("removeallclones", 3, "移除所有人的克隆人,貌似未生效"),
- new CommandDefinition("follow", 3, "和克隆人相关的,貌似未生效"),
- new CommandDefinition("pause", 3, "和克隆人相关的,貌似未生效"),
- new CommandDefinition("stance", 3, "和克隆人相关的,貌似未生效"),
- new CommandDefinition("killmonster", 3, "<怪物ID> 杀死指定ID的怪物"),
- new CommandDefinition("removeoid", 3),
- new CommandDefinition("currentdate", 3, "显示日期"),
- new CommandDefinition("maxmesos", 3, "把自己的金钱加满"),
- new CommandDefinition("fullcharge", 3, "把海盗的能量获取加满"),
- new CommandDefinition("youlose", 3, "输了,HP=0时传送到射手村并加满血和蓝"),
- new CommandDefinition("changejob", 3, "<职业ID> - 转成指定职业"),
- new CommandDefinition("coke", 3, "召唤可乐怪"),
- new CommandDefinition("balrog", 3, "召唤蝙蝠怪"),
- new CommandDefinition("mushmom", 3, "召唤蘑菇王"),
- new CommandDefinition("shuyao", 3, "召唤树妖王"),
- new CommandDefinition("dragon", 3, "召唤飞龙"),
- new CommandDefinition("pianus", 3, "召唤鱼王(右)"),
- new CommandDefinition("pianus2", 3, "召唤鱼王(左)"),
- new CommandDefinition("anego", 3, "召唤日本御姐"),
- new CommandDefinition("blackcrow", 3, "召唤天狗"),
- new CommandDefinition("papu", 3, "召唤闹钟"),
- new CommandDefinition("papu2", 3, "召唤闹钟的封印石"),
- new CommandDefinition("ludimini", 3, "召唤时间门神"),
- new CommandDefinition("baobiao", 3, "召唤保镖A(打死2次后变身成恶僧)"),
- new CommandDefinition("theboss", 3, "召唤恶僧"),
- new CommandDefinition("ergoth", 3, "召唤死灵法师"),
- new CommandDefinition("pirate", 3, "召唤海盗"),
- new CommandDefinition("bird", 3, "召唤凤凰"),
- new CommandDefinition("jinzhu", 3, "召唤金猪"),
- new CommandDefinition("xueren", 3, "召唤雪人"),
- new CommandDefinition("bob", 3, "召唤超级蜗牛"),
- new CommandDefinition("clone", 3, "召唤5职业教练"),
- new CommandDefinition("back3", 3, "回射手村"),
- new CommandDefinition("daima", 3, "查看常用代码"),
- new CommandDefinition("daima2", 3, "查看常用代码2"),
- new CommandDefinition("testcom3", 3)
- };
- }
- }