Trade results + Map-Ownership & Fishing + P. EXP distribution rework
Fixed an issue where players could lose priority over recently dropped items after switching maps. Adjusted EXP bonus buffs to also cover party bonus gains. Fixed items taken back from merchants not properly checking for stacking opportunities in player inventory. Fixed some merchant references in visitors' player object not being properly cleared when owner closes shop. Adjusted merchants to automatically close as soon as the merchant owner finishes maintenance process with it having no items in store. Added trade result opcodes. Trade results now should work almost as intended originally. Implemented server-side check for portal distance when deploying player shops and merchants. Implemented server-side check for whether local or remote IP is being used when logging in a local/remote server (this should mitigate a few of the issues people may find when trying to log in game world). Implemented commands designed for management of opened IO sessions. Fixed chalkboard not showing up for owner player when changing maps. Added "time left" functionality for merchant owners managing the opened store. Fixed skillbooks not showing properly for other players in the map. Fixed commands using lowercased-version of content inputted by player. Implemented the Fredrick expected fee on using the Store Bank service. Implemented "exclusive invitation management" in the system. Inviters are notified the invited players are already managing an invite, should it be visually "in-progress" for that one. Implemented "map ownership". Non-map owners are unable to farm in an area if they are not party members with the owner or until the ownership rescinds. Adjusted inventory sort feature, now sorting projectile items in such a fashion that commonly stronger versions comes before the basic ones. Added a visual effect that shows up when obtaining Aran skills. Revised party EXP gain system. Party bonuses now accounts a fraction of the accumulated EXP gained by members when defeating a mob, and raw EXP gained by a player is kept the same regardless of him/her being in a party or not (thus a bonus being REALLY a bonus). Implemented a custom fishing system in the source, on which during "seasonal" times (that gets arbitrarily defined by both day-of-year and time-of-day) fishes are more likely to be hooked. Such likelihood also improved depending on the amount of mesos spent as lure.
This commit is contained in:
@@ -93,8 +93,16 @@ public class CommandsExecutor {
|
||||
}
|
||||
|
||||
private void handleInternal(MapleClient client, String message){
|
||||
final String[] spitedMessage = message.toLowerCase().substring(1).split("[ ]");
|
||||
final String commandName = spitedMessage[0];
|
||||
final String splitRegex = "[ ]";
|
||||
String[] splitedMessage = message.substring(1).split(splitRegex, 2);
|
||||
if (splitedMessage.length < 2) {
|
||||
splitedMessage = new String[]{splitedMessage[0], ""};
|
||||
}
|
||||
|
||||
client.getPlayer().setLastCommandMessage(splitedMessage[1]); // thanks Tochi & Nulliphite for noticing string messages being marshalled lowercase
|
||||
final String commandName = splitedMessage[0].toLowerCase();
|
||||
final String[] lowercaseParams = splitedMessage[1].toLowerCase().split(splitRegex);
|
||||
|
||||
final RegisteredCommand command = registeredCommands.get(commandName);
|
||||
if (command == null){
|
||||
client.getPlayer().yellowMessage("Command '" + commandName + "' is not available. See @commands for a list of available commands.");
|
||||
@@ -105,8 +113,8 @@ public class CommandsExecutor {
|
||||
return;
|
||||
}
|
||||
String[] params;
|
||||
if (spitedMessage.length > 1) {
|
||||
params = Arrays.copyOfRange(spitedMessage, 1, spitedMessage.length);
|
||||
if (lowercaseParams.length > 0) {
|
||||
params = Arrays.copyOfRange(lowercaseParams, 0, lowercaseParams.length);
|
||||
} else {
|
||||
params = new String[]{};
|
||||
}
|
||||
@@ -194,6 +202,7 @@ public class CommandsExecutor {
|
||||
addCommand("luk", StatLukCommand.class);
|
||||
addCommand("enableauth", EnableAuthCommand.class);
|
||||
addCommand("toggleexp", ToggleExpCommand.class);
|
||||
addCommand("mylawn", MapOwnerClaimCommand.class);
|
||||
|
||||
commandsNameDesc.add(levelCommandsCursor);
|
||||
}
|
||||
@@ -331,6 +340,7 @@ public class CommandsExecutor {
|
||||
addCommand("droprate", 4, DropRateCommand.class);
|
||||
addCommand("questrate", 4, QuestRateCommand.class);
|
||||
addCommand("travelrate", 4, TravelRateCommand.class);
|
||||
addCommand("fishrate", 4, FishingRateCommand.class);
|
||||
addCommand("itemvac", 4, ItemVacCommand.class);
|
||||
addCommand("forcevac", 4, ForceVacCommand.class);
|
||||
addCommand("zakum", 4, ZakumCommand.class);
|
||||
@@ -356,6 +366,8 @@ public class CommandsExecutor {
|
||||
addCommand("set", 5, SetCommand.class);
|
||||
addCommand("showpackets", 5, ShowPacketsCommand.class);
|
||||
addCommand("showmovelife", 5, ShowMoveLifeCommand.class);
|
||||
addCommand("showsessions", 5, ShowSessionsCommand.class);
|
||||
addCommand("iplist", 5, IpListCommand.class);
|
||||
|
||||
commandsNameDesc.add(levelCommandsCursor);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.gachapon.MapleGachapon;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
public class GachaCommand extends Command {
|
||||
{
|
||||
@@ -37,7 +36,7 @@ public class GachaCommand extends Command {
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleGachapon.Gachapon gacha = null;
|
||||
String search = joinStringFrom(params,0);
|
||||
String search = c.getPlayer().getLastCommandMessage();
|
||||
String gachaName = "";
|
||||
String [] names = {"Henesys", "Ellinia", "Perion", "Kerning City", "Sleepywood", "Mushroom Shrine", "Showa Spa Male", "Showa Spa Female", "New Leaf City", "Nautilus Harbor"};
|
||||
int [] ids = {9100100, 9100101, 9100102, 9100103, 9100104, 9100105, 9100106, 9100107, 9100109, 9100117};
|
||||
|
||||
@@ -50,7 +50,7 @@ public class GmCommand extends Command {
|
||||
player.dropMessage(5, "Your message was too short. Please provide as much detail as possible.");
|
||||
return;
|
||||
}
|
||||
String message = joinStringFrom(params, 0);
|
||||
String message = player.getLastCommandMessage();
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.sendYellowTip("[GM MESSAGE]:" + MapleCharacter.makeMapleReadable(player.getName()) + ": " + message));
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.serverNotice(1, message));
|
||||
FilePrinter.printError(FilePrinter.COMMAND_GM, MapleCharacter.makeMapleReadable(player.getName()) + ": " + message);
|
||||
|
||||
62
src/client/command/commands/gm0/MapOwnerClaimCommand.java
Normal file
62
src/client/command/commands/gm0/MapOwnerClaimCommand.java
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
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: Ronan
|
||||
*/
|
||||
package client.command.commands.gm0;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class MapOwnerClaimCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
if (c.tryacquireClient()) {
|
||||
try {
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
|
||||
if (ServerConstants.USE_MAP_OWNERSHIP_SYSTEM) {
|
||||
if (chr.getEventInstance() == null) {
|
||||
if (chr.getMap().unclaimOwnership(chr)) {
|
||||
chr.dropMessage(5, "This lawn is now free real estate.");
|
||||
} else if (chr.getMap().claimOwnership(chr)) {
|
||||
chr.dropMessage(5, "You have leased this lawn for a while, until you leave here or after 1 minute of inactivity.");
|
||||
} else {
|
||||
chr.dropMessage(5, "This lawn has already been leased by another player.");
|
||||
}
|
||||
} else {
|
||||
chr.dropMessage(5, "This lawn cannot be leased.");
|
||||
}
|
||||
} else {
|
||||
chr.dropMessage(5, "Feature unavailable.");
|
||||
}
|
||||
} finally {
|
||||
c.releaseClient();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class ReportBugCommand extends Command {
|
||||
player.dropMessage(5, "Message too short and not sent. Please do @bug <bug>");
|
||||
return;
|
||||
}
|
||||
String message = joinStringFrom(params, 0);
|
||||
String message = player.getLastCommandMessage();
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.sendYellowTip("[BUG]:" + MapleCharacter.makeMapleReadable(player.getName()) + ": " + message));
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.serverNotice(1, message));
|
||||
FilePrinter.printError(FilePrinter.COMMAND_BUG, MapleCharacter.makeMapleReadable(player.getName()) + ": " + message);
|
||||
|
||||
@@ -46,7 +46,7 @@ public class WhatDropsFromCommand extends Command {
|
||||
player.dropMessage(5, "Please do @whatdropsfrom <monster name>");
|
||||
return;
|
||||
}
|
||||
String monsterName = joinStringFrom(params, 0);
|
||||
String monsterName = player.getLastCommandMessage();
|
||||
String output = "";
|
||||
int limit = 3;
|
||||
Iterator<Pair<Integer, String>> listIterator = MapleMonsterInformationProvider.getMobsIDsFromName(monsterName).iterator();
|
||||
|
||||
@@ -51,7 +51,7 @@ public class WhoDropsCommand extends Command {
|
||||
|
||||
if (c.tryacquireClient()) {
|
||||
try {
|
||||
String searchString = joinStringFrom(params, 0);
|
||||
String searchString = player.getLastCommandMessage();
|
||||
String output = "";
|
||||
Iterator<Pair<Integer, String>> listIterator = MapleItemInformationProvider.getInstance().getItemDataByName(searchString).iterator();
|
||||
if(listIterator.hasNext()) {
|
||||
|
||||
@@ -36,15 +36,37 @@ public class GiveNxCommand extends Command {
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !givenx [<playername>] <gainnx>");
|
||||
player.yellowMessage("Syntax: !givenx [nx, mp, np] [<playername>] <gainnx>");
|
||||
return;
|
||||
}
|
||||
|
||||
String recv;
|
||||
int value;
|
||||
String recv, typeStr = "nx";
|
||||
int value, type = 1;
|
||||
if (params.length > 1) {
|
||||
recv = params[0];
|
||||
value = Integer.parseInt(params[1]);
|
||||
if (params[0].length() == 2) {
|
||||
switch (params[0]) {
|
||||
case "mp": // maplePoint
|
||||
type = 2;
|
||||
break;
|
||||
case "np": // nxPrepaid
|
||||
type = 4;
|
||||
break;
|
||||
default:
|
||||
type = 1;
|
||||
}
|
||||
typeStr = params[0];
|
||||
|
||||
if (params.length > 2) {
|
||||
recv = params[1];
|
||||
value = Integer.parseInt(params[2]);
|
||||
} else {
|
||||
recv = c.getPlayer().getName();
|
||||
value = Integer.parseInt(params[1]);
|
||||
}
|
||||
} else {
|
||||
recv = params[0];
|
||||
value = Integer.parseInt(params[1]);
|
||||
}
|
||||
} else {
|
||||
recv = c.getPlayer().getName();
|
||||
value = Integer.parseInt(params[0]);
|
||||
@@ -52,8 +74,8 @@ public class GiveNxCommand extends Command {
|
||||
|
||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(recv);
|
||||
if (victim != null) {
|
||||
victim.getCashShop().gainCash(1, value);
|
||||
player.message("NX given.");
|
||||
victim.getCashShop().gainCash(type, value);
|
||||
player.message(typeStr.toUpperCase() + " given.");
|
||||
} else {
|
||||
player.message("Player '" + recv + "' could not be found.");
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class MusicCommand extends Command {
|
||||
return;
|
||||
}
|
||||
|
||||
String song = joinStringFrom(params, 0);
|
||||
String song = player.getLastCommandMessage();
|
||||
for (String s : GameConstants.GAME_SONGS) {
|
||||
if (s.equalsIgnoreCase(song)) { // thanks Masterrulax for finding an issue here
|
||||
player.getMap().broadcastMessage(MaplePacketCreator.musicChange(s));
|
||||
|
||||
@@ -37,6 +37,6 @@ public class NoticeCommand extends Command {
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
Server.getInstance().broadcastMessage(c.getWorld(), MaplePacketCreator.serverNotice(6, "[Notice] " + joinStringFrom(params, 0)));
|
||||
Server.getInstance().broadcastMessage(c.getWorld(), MaplePacketCreator.serverNotice(6, "[Notice] " + player.getLastCommandMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
48
src/client/command/commands/gm4/FishingRateCommand.java
Normal file
48
src/client/command/commands/gm4/FishingRateCommand.java
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
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: Ronan
|
||||
*/
|
||||
package client.command.commands.gm4;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
public class FishingRateCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !fishrate <newrate>");
|
||||
return;
|
||||
}
|
||||
|
||||
int fishrate = Math.max(Integer.parseInt(params[0]), 1);
|
||||
c.getWorldServer().setFishingRate(fishrate);
|
||||
c.getWorldServer().broadcastPacket(MaplePacketCreator.serverNotice(6, "[Rate] Fishing Rate has been changed to " + fishrate + "x."));
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ public class ServerMessageCommand extends Command {
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
//MapleCharacter player = c.getPlayer();
|
||||
c.getWorldServer().setServerMessage(joinStringFrom(params, 0));
|
||||
MapleCharacter player = c.getPlayer();
|
||||
c.getWorldServer().setServerMessage(player.getLastCommandMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public class DebugCommand extends Command {
|
||||
break;
|
||||
|
||||
case "packet":
|
||||
player.getMap().broadcastMessage(MaplePacketCreator.customPacket(joinStringFrom(params, 1)));
|
||||
//player.getMap().broadcastMessage(MaplePacketCreator.customPacket(joinStringFrom(params, 1)));
|
||||
break;
|
||||
|
||||
case "portal":
|
||||
|
||||
60
src/client/command/commands/gm5/IpListCommand.java
Normal file
60
src/client/command/commands/gm5/IpListCommand.java
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
This file is part of the HeavenMS MapleStory Server
|
||||
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.gm5;
|
||||
|
||||
import java.util.Collection;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import client.command.Command;
|
||||
import constants.GameConstants;
|
||||
import net.server.Server;
|
||||
import net.server.world.World;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Mist
|
||||
* @author Blood (Tochi)
|
||||
* @author Ronan
|
||||
*/
|
||||
public class IpListCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
String str = "Player-IP relation:";
|
||||
|
||||
for (World w : Server.getInstance().getWorlds()) {
|
||||
Collection<MapleCharacter> chars = w.getPlayerStorage().getAllCharacters();
|
||||
|
||||
if (!chars.isEmpty()) {
|
||||
str += "\r\n" + GameConstants.WORLD_NAMES[w.getId()] + "\r\n";
|
||||
|
||||
for (MapleCharacter chr : chars) {
|
||||
str += " " + chr.getName() + " - " + chr.getClient().getSession().getRemoteAddress() + "\r\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
c.getAbstractPlayerInteraction().npcTalk(22000, str);
|
||||
}
|
||||
|
||||
}
|
||||
39
src/client/command/commands/gm5/ShowSessionsCommand.java
Normal file
39
src/client/command/commands/gm5/ShowSessionsCommand.java
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
This file is part of the HeavenMS MapleStory Server
|
||||
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.gm5;
|
||||
|
||||
import client.MapleClient;
|
||||
import client.command.Command;
|
||||
import net.server.coordinator.MapleSessionCoordinator;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Ronan
|
||||
*/
|
||||
public class ShowSessionsCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleSessionCoordinator.getInstance().printSessionTrace(c);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user