Level/exp on all equips + Player stats overhaul + Chair handler patch

Implemented a massive overhaul on Character.wz, adding in equipment level-related nodes in order to make equipments level/EXP info available for anyone to check.
Implemented a major overhaul on the player stat management throughout the source, properly encapsulating and concurrency protecting it's mechanics.
Reviewed several MoveLifeHandler aspects, some of them trying to prevent mobs from falling from footholds in certain circumstances.
Fixed MP Recovery instant killing players when they run out of HP to use.
Fixed some chairs arbitrarily disconnecting players upon HP/MP recovery.
Fixed Puppets sticking to maps in certain scenarios.
Cached data and added concurrency protection for EXP gain on equipments.
Reworked Chair Mastery skill, now with recovering amounts based on a player's base HP/MP pool.
Fixed several deadlock issues revolving rate coupons and character inventory.
Improved overall autopot handler performance.
Reworked door bosses (such as Crocell), now spawning each 3 hours instead of upon player's demand.
Fixed alliances not saving rank names on DB at creation time.
Fixed alliances retaining disbanded guild info on DB.
Added Mystic Door support for the Mushroom Castle area.
This commit is contained in:
ronancpl
2018-09-23 22:37:00 -03:00
parent c3e3c6dfbb
commit 5480035005
255 changed files with 9576 additions and 7850 deletions

View File

@@ -0,0 +1,42 @@
/*
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/>.
*/
/*
@Author: Arthur L - Refactored command content into modules
*/
package client.command.commands.gm6;
import client.command.Command;
import client.MapleClient;
import client.MapleCharacter;
import server.quest.MapleQuest;
public class ClearQuestCacheCommand extends Command {
{
setDescription("");
}
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
MapleQuest.clearCache();
player.dropMessage(5, "Quest Cache Cleared.");
}
}

View File

@@ -0,0 +1,47 @@
/*
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/>.
*/
/*
@Author: Arthur L - Refactored command content into modules
*/
package client.command.commands.gm6;
import client.command.Command;
import client.MapleClient;
import client.MapleCharacter;
import server.quest.MapleQuest;
public class ClearQuestCommand extends Command {
{
setDescription("");
}
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
if (params.length < 1) {
player.dropMessage(5, "Please include a quest ID.");
return;
}
MapleQuest.clearCache(Integer.parseInt(params[0]));
player.dropMessage(5, "Quest Cache for quest " + params[0] + " cleared.");
}
}

View File

@@ -0,0 +1,49 @@
/*
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/>.
*/
/*
@Author: Arthur L - Refactored command content into modules
*/
package client.command.commands.gm6;
import client.command.Command;
import client.MapleClient;
import client.MapleCharacter;
import net.server.Server;
import net.server.world.World;
public class DCAllCommand extends Command {
{
setDescription("");
}
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
for (World world : Server.getInstance().getWorlds()) {
for (MapleCharacter chr : world.getPlayerStorage().getAllCharacters()) {
if (!chr.isGM()) {
chr.getClient().disconnect(false, false);
}
}
}
player.message("All players successfully disconnected.");
}
}

View File

@@ -0,0 +1,41 @@
/*
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/>.
*/
/*
@Author: Arthur L - Refactored command content into modules
*/
package client.command.commands.gm6;
import client.command.Command;
import client.MapleClient;
import client.MapleCharacter;
import server.life.MaplePlayerNPC;
public class EraseAllPNpcsCommand extends Command {
{
setDescription("");
}
@Override
public void execute(MapleClient c, String[] params) {
//MapleCharacter player = c.getPlayer();
MaplePlayerNPC.removeAllPlayerNPC();
}
}

View File

@@ -0,0 +1,41 @@
/*
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/>.
*/
/*
@Author: Arthur L - Refactored command content into modules
*/
package client.command.commands.gm6;
import client.command.Command;
import client.MapleClient;
import client.MapleCharacter;
import tools.MaplePacketCreator;
public class FredCommand extends Command {
{
setDescription("");
}
@Override
public void execute(MapleClient c, String[] params) {
c.announce(MaplePacketCreator.fredrickMessage(Byte.valueOf(params[0])));
}
}

View File

@@ -0,0 +1,49 @@
/*
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/>.
*/
/*
@Author: Arthur L - Refactored command content into modules
*/
package client.command.commands.gm6;
import client.command.Command;
import client.MapleClient;
import client.MapleCharacter;
public class GetAccCommand extends Command {
{
setDescription("");
}
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !getacc <playername>");
return;
}
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
if (victim != null) {
player.message(victim.getName() + "'s account name is " + victim.getClient().getAccountName() + ".");
} else {
player.message("Player '" + params[0] + "' could not be found on this world.");
}
}
}

View File

@@ -0,0 +1,55 @@
/*
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/>.
*/
/*
@Author: Arthur L - Refactored command content into modules
*/
package client.command.commands.gm6;
import client.command.Command;
import client.MapleClient;
import client.MapleCharacter;
import net.server.Server;
import net.server.world.World;
public class MapPlayersCommand extends Command {
{
setDescription("");
}
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
String names = "";
int map = player.getMapId();
for (World world : Server.getInstance().getWorlds()) {
for (MapleCharacter chr : world.getPlayerStorage().getAllCharacters()) {
int curMap = chr.getMapId();
String hp = Integer.toString(chr.getHp());
String maxhp = Integer.toString(chr.getCurrentMaxHp());
String name = chr.getName() + ": " + hp + "/" + maxhp;
if (map == curMap) {
names = names.equals("") ? name : (names + ", " + name);
}
}
}
player.message("Players on mapid " + map + ": " + names);
}
}

View File

@@ -0,0 +1,50 @@
/*
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/>.
*/
/*
@Author: Arthur L - Refactored command content into modules
*/
package client.command.commands.gm6;
import client.command.Command;
import client.MapleClient;
import client.MapleCharacter;
import net.server.Server;
import net.server.world.World;
import tools.MaplePacketCreator;
public class SaveAllCommand extends Command {
{
setDescription("");
}
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
for (World world : Server.getInstance().getWorlds()) {
for (MapleCharacter chr : world.getPlayerStorage().getAllCharacters()) {
chr.saveCharToDB();
}
}
String message = player.getName() + " used !saveall.";
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.serverNotice(5, message));
player.message("All players saved successfully.");
}
}

View File

@@ -0,0 +1,69 @@
/*
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/>.
*/
/*
@Author: Arthur L - Refactored command content into modules
*/
package client.command.commands.gm6;
import client.MapleCharacter;
import client.command.Command;
import client.MapleClient;
import net.server.Server;
public class ServerAddChannelCommand extends Command {
{
setDescription("");
}
@Override
public void execute(MapleClient c, String[] params) {
final MapleCharacter player = c.getPlayer();
if (params.length < 1) {
player.dropMessage(5, "Syntax: @addchannel <worldid>");
return;
}
final int worldid = Integer.parseInt(params[0]);
new Thread(new Runnable() {
@Override
public void run() {
int chid = Server.getInstance().addChannel(worldid);
if(player.isLoggedinWorld()) {
if(chid >= 0) {
player.dropMessage(5, "NEW Channel " + chid + " successfully deployed on world " + worldid + ".");
} else {
if(chid == -3) {
player.dropMessage(5, "Invalid worldid detected. Channel creation aborted.");
} else if(chid == -2) {
player.dropMessage(5, "Reached channel limit on worldid " + worldid + ". Channel creation aborted.");
} else if(chid == -1) {
player.dropMessage(5, "Error detected when loading the 'world.ini' file. Channel creation aborted.");
} else {
player.dropMessage(5, "NEW Channel failed to be deployed. Check if the needed port is already in use or other limitations are taking place.");
}
}
}
}
}).start();
}
}

View File

@@ -0,0 +1,59 @@
/*
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/>.
*/
/*
@Author: Arthur L - Refactored command content into modules
*/
package client.command.commands.gm6;
import client.MapleCharacter;
import client.command.Command;
import client.MapleClient;
import net.server.Server;
public class ServerAddWorldCommand extends Command {
{
setDescription("");
}
@Override
public void execute(MapleClient c, String[] params) {
final MapleCharacter player = c.getPlayer();
new Thread(new Runnable() {
@Override
public void run() {
int wid = Server.getInstance().addWorld();
if(player.isLoggedinWorld()) {
if(wid >= 0) {
player.dropMessage(5, "NEW World " + wid + " successfully deployed.");
} else {
if(wid == -2) {
player.dropMessage(5, "Error detected when loading the 'world.ini' file. World creation aborted.");
} else {
player.dropMessage(5, "NEW World failed to be deployed. Check if needed ports are already in use or maximum world count has been reached.");
}
}
}
}
}).start();
}
}

View File

@@ -0,0 +1,61 @@
/*
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/>.
*/
/*
@Author: Arthur L - Refactored command content into modules
*/
package client.command.commands.gm6;
import client.MapleCharacter;
import client.command.Command;
import client.MapleClient;
import net.server.Server;
public class ServerRemoveChannelCommand extends Command {
{
setDescription("");
}
@Override
public void execute(MapleClient c, String[] params) {
final MapleCharacter player = c.getPlayer();
if (params.length < 1) {
player.dropMessage(5, "Syntax: @removechannel <worldid>");
return;
}
final int worldId = Integer.parseInt(params[0]);
new Thread(new Runnable() {
@Override
public void run() {
if(Server.getInstance().removeChannel(worldId)) {
if(player.isLoggedinWorld()) {
player.dropMessage(5, "Successfully removed a channel on World " + worldId + ". Current channel count: " + Server.getInstance().getWorld(worldId).getChannelsSize() + ".");
}
} else {
if(player.isLoggedinWorld()) {
player.dropMessage(5, "Failed to remove last Channel on world " + worldId + ". Check if either that world exists or there are people currently playing there.");
}
}
}
}).start();
}
}

View File

@@ -0,0 +1,65 @@
/*
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/>.
*/
/*
@Author: Arthur L - Refactored command content into modules
*/
package client.command.commands.gm6;
import client.MapleCharacter;
import client.command.Command;
import client.MapleClient;
import net.server.Server;
public class ServerRemoveWorldCommand extends Command {
{
setDescription("");
}
@Override
public void execute(MapleClient c, String[] params) {
final MapleCharacter player = c.getPlayer();
final int rwid = Server.getInstance().getWorldsSize() - 1;
if(rwid <= 0) {
player.dropMessage(5, "Unable to remove world 0.");
return;
}
new Thread(new Runnable() {
@Override
public void run() {
if(Server.getInstance().removeWorld()) {
if(player.isLoggedinWorld()) {
player.dropMessage(5, "Successfully removed a world. Current world count: " + Server.getInstance().getWorldsSize() + ".");
}
} else {
if(player.isLoggedinWorld()) {
if(rwid < 0) {
player.dropMessage(5, "No registered worlds to remove.");
} else {
player.dropMessage(5, "Failed to remove world " + rwid + ". Check if there are people currently playing there.");
}
}
}
}
}).start();
}
}

View File

@@ -0,0 +1,55 @@
/*
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/>.
*/
/*
@Author: Arthur L - Refactored command content into modules
*/
package client.command.commands.gm6;
import client.command.Command;
import client.MapleClient;
import client.MapleCharacter;
public class SetGmLevelCommand extends Command {
{
setDescription("");
}
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
if (params.length < 2) {
player.yellowMessage("Syntax: !setgmlevel <playername> <newlevel>");
return;
}
int newLevel = Integer.parseInt(params[1]);
MapleCharacter target = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
if (target != null) {
target.setGMLevel(newLevel);
target.getClient().setGMLevel(newLevel);
target.dropMessage("You are now a level " + newLevel + " GM. See @commands for a list of available commands.");
player.dropMessage(target + " is now a level " + newLevel + " GM.");
} else {
player.dropMessage("Player '" + params[0] + "' was not found on this channel.");
}
}
}

View File

@@ -0,0 +1,74 @@
/*
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/>.
*/
/*
@Author: Arthur L - Refactored command content into modules
*/
package client.command.commands.gm6;
import client.command.Command;
import client.MapleClient;
import client.MapleCharacter;
import net.server.Server;
import net.server.world.World;
import server.TimerManager;
public class ShutdownCommand extends Command {
{
setDescription("");
}
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
if (params.length < 1){
player.yellowMessage("Syntax: !shutdown [<time>|NOW]");
return;
}
int time = 60000;
if (params[0].equalsIgnoreCase("now")){
time = 1;
} else {
time *= Integer.parseInt(params[0]);
}
if (time > 1) {
int seconds = (int) (time / 1000) % 60;
int minutes = (int) ((time / (1000 * 60)) % 60);
int hours = (int) ((time / (1000 * 60 * 60)) % 24);
int days = (int) ((time / (1000 * 60 * 60 * 24)));
String strTime = "";
if (days > 0) strTime += days + " days, ";
if (hours > 0) strTime += hours + " hours, ";
strTime += minutes + " minutes, ";
strTime += seconds + " seconds";
for (World w : Server.getInstance().getWorlds()) {
for (MapleCharacter chr : w.getPlayerStorage().getAllCharacters()) {
chr.dropMessage("Server is undergoing maintenance process, and will be shutdown in " + strTime + ". Prepare yourself to quit safely in the mean time.");
}
}
}
TimerManager.getInstance().schedule(Server.getInstance().shutdown(false), time);
}
}

View File

@@ -0,0 +1,41 @@
/*
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/>.
*/
/*
@Author: Arthur L - Refactored command content into modules
*/
package client.command.commands.gm6;
import client.command.Command;
import client.MapleClient;
import client.MapleCharacter;
import server.life.MaplePlayerNPC;
public class SpawnAllPNpcsCommand extends Command {
{
setDescription("");
}
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
MaplePlayerNPC.multicastSpawnPlayerNPC(player.getMapId(), player.getWorld());
}
}

View File

@@ -0,0 +1,68 @@
/*
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/>.
*/
/*
@Author: Arthur L - Refactored command content into modules
*/
package client.command.commands.gm6;
import client.command.Command;
import client.MapleClient;
import client.MapleCharacter;
import net.server.Server;
import tools.MaplePacketCreator;
import java.net.InetAddress;
import java.net.UnknownHostException;
public class WarpWorldCommand extends Command {
{
setDescription("");
}
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !warpworld <worldid>");
return;
}
Server server = Server.getInstance();
byte worldb = Byte.parseByte(params[0]);
if (worldb <= (server.getWorldsSize() - 1)) {
try {
String[] socket = server.getInetSocket(worldb, c.getChannel());
c.getWorldServer().removePlayer(player);
player.getMap().removePlayer(player);//LOL FORGOT THIS ><
c.updateLoginState(MapleClient.LOGIN_SERVER_TRANSITION);
player.setWorld(worldb);
player.saveCharToDB();//To set the new world :O (true because else 2 player instances are created, one in both worlds)
c.announce(MaplePacketCreator.getChannelChange(InetAddress.getByName(socket[0]), Integer.parseInt(socket[1])));
} catch (UnknownHostException | NumberFormatException ex) {
ex.printStackTrace();
player.message("Unexpected error when changing worlds, are you sure the world you are trying to warp to has the same amount of channels?");
}
} else {
player.message("Invalid world; highest number available: " + (server.getWorldsSize() - 1));
}
}
}