Merge branch 'master' into credits_update

This commit is contained in:
ronancpl
2019-06-15 15:56:15 -03:00
146 changed files with 7810 additions and 2802 deletions

View File

@@ -93,6 +93,10 @@ public class CommandsExecutor {
}
private void handleInternal(MapleClient client, String message){
if (client.getPlayer().getMapId() == 300000012) {
client.getPlayer().yellowMessage("You not have permission to use this command while in jail.");
return;
}
final String splitRegex = "[ ]";
String[] splitedMessage = message.substring(1).split(splitRegex, 2);
if (splitedMessage.length < 2) {
@@ -259,6 +263,7 @@ public class CommandsExecutor {
addCommand("job", 2, JobCommand.class);
addCommand("unbug", 2, UnBugCommand.class);
addCommand("id", 2, IdCommand.class);
addCommand("gachalist", GachaListCommand.class);
commandsNameDesc.add(levelCommandsCursor);
}

View File

@@ -33,7 +33,7 @@ import net.server.Server;
import server.MaplePortal;
import server.maps.FieldLimit;
import server.maps.MapleMap;
import server.maps.MapleMapFactory;
import server.maps.MapleMapManager;
import server.maps.MapleMiniDungeonInfo;
import java.util.Comparator;
@@ -47,18 +47,18 @@ public class GotoCommand extends Command {
{
setDescription("");
MapleMapFactory mapFactory = Server.getInstance().getWorlds().get(0).getChannels().get(0).getMapFactory();
MapleMapManager mapManager = Server.getInstance().getWorlds().get(0).getChannels().get(0).getMapFactory();
List<Entry<String, Integer>> towns = new ArrayList<>(GameConstants.GOTO_TOWNS.entrySet());
sortGotoEntries(towns);
for (Map.Entry<String, Integer> e : towns) {
GOTO_TOWNS_INFO += ("'" + e.getKey() + "' - #b" + (mapFactory.getMap(e.getValue()).getMapName()) + "#k\r\n");
GOTO_TOWNS_INFO += ("'" + e.getKey() + "' - #b" + (mapManager.getMap(e.getValue()).getMapName()) + "#k\r\n");
}
List<Entry<String, Integer>> areas = new ArrayList<>(GameConstants.GOTO_AREAS.entrySet());
sortGotoEntries(areas);
for (Map.Entry<String, Integer> e : areas) {
GOTO_AREAS_INFO += ("'" + e.getKey() + "' - #b" + (mapFactory.getMap(e.getValue()).getMapName()) + "#k\r\n");
GOTO_AREAS_INFO += ("'" + e.getKey() + "' - #b" + (mapManager.getMap(e.getValue()).getMapName()) + "#k\r\n");
}
}
@@ -103,6 +103,7 @@ public class GotoCommand extends Command {
HashMap<String, Integer> gotomaps;
if (player.isGM()) {
gotomaps = new HashMap<>(GameConstants.GOTO_AREAS); // distinct map registry for GM/users suggested thanks to Vcoc
gotomaps.putAll(GameConstants.GOTO_TOWNS); // thanks Halcyon for pointing out duplicates on listed entries functionality
} else {
gotomaps = new HashMap<>(GameConstants.GOTO_TOWNS);
}

View File

@@ -0,0 +1,38 @@
/*
This file is part of the HeavenMS MapleStory Server, commands OdinMS-based
Copyleft (L) 2016 - 2018 RonanLana
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation 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; without 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 client.command.commands.gm2;
import client.MapleClient;
import client.command.Command;
/**
*
* @author Ronan
*/
public class GachaListCommand extends Command {
{
setDescription("");
}
@Override
public void execute(MapleClient c, String[] params) {
c.getAbstractPlayerInteraction().openNpc(10000, "gachaponInfo");
}
}

View File

@@ -47,11 +47,11 @@ public class IgnoreCommand extends Command {
player.message("Player '" + params[0] + "' could not be found on this world.");
return;
}
boolean monitored_ = MapleLogger.ignored.contains(victim.getName());
boolean monitored_ = MapleLogger.ignored.contains(victim.getId());
if (monitored_) {
MapleLogger.ignored.remove(victim.getName());
MapleLogger.ignored.remove(victim.getId());
} else {
MapleLogger.ignored.add(victim.getName());
MapleLogger.ignored.add(victim.getId());
}
player.yellowMessage(victim.getName() + " is " + (!monitored_ ? "now being ignored." : "no longer being ignored."));
String message_ = player.getName() + (!monitored_ ? " has started ignoring " : " has stopped ignoring ") + victim.getName() + ".";

View File

@@ -36,8 +36,8 @@ public class IgnoredCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
for (String ign : MapleLogger.ignored) {
player.yellowMessage(ign + " is being ignored.");
for (Integer cid : MapleLogger.ignored) {
player.yellowMessage(MapleCharacter.getNameById(cid) + " is being ignored.");
}
}
}

View File

@@ -47,14 +47,14 @@ public class MonitorCommand extends Command {
player.message("Player '" + params[0] + "' could not be found on this world.");
return;
}
boolean monitored = MapleLogger.monitored.contains(victim.getName());
boolean monitored = MapleLogger.monitored.contains(victim.getId());
if (monitored) {
MapleLogger.monitored.remove(victim.getName());
MapleLogger.monitored.remove(victim.getId());
} else {
MapleLogger.monitored.add(victim.getName());
MapleLogger.monitored.add(victim.getId());
}
player.yellowMessage(victim.getName() + " is " + (!monitored ? "now being monitored." : "no longer being monitored."));
String message = player.getName() + (!monitored ? " has started monitoring " : " has stopped monitoring ") + victim.getName() + ".";
player.yellowMessage(victim.getId() + " is " + (!monitored ? "now being monitored." : "no longer being monitored."));
String message = player.getName() + (!monitored ? " has started monitoring " : " has stopped monitoring ") + victim.getId() + ".";
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.serverNotice(5, message));
}

View File

@@ -36,8 +36,8 @@ public class MonitorsCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
for (String ign : MapleLogger.monitored) {
player.yellowMessage(ign + " is being monitored.");
for (Integer cid : MapleLogger.monitored) {
player.yellowMessage(MapleCharacter.getNameById(cid) + " is being monitored.");
}
}
}