Mob aggro overhaul + STR-DEX autoassign patch + Guild & Pl. Store fix

Reviewed Monster Magnet skill effect on mobs, now properly showing up to other players.
Reworked concurrency protection on login handler, now properly synchronizing requests for the same accountId.
Reviewed an expedition issue with attempting to send packets on loggedoff players. Expeditions no longer holds a character object list of its own, rather finding players through their id on the world storage.
Added stat requirement definition as first message on 1st job NPCs.
Fixed an issue with area triggered NPC conversations not getting properly disposed.
Reviewed "launch.bat", internally referencing Java7 engine. Assuming it has been installed in the default directory on the system, it's no longer necessary to set precedence on PATH for it.
Fixed need for "reapproval from the 3rd job instructors" to attempt Zakum once more.
Reviewed goto command. Non-GM's no longer has access to area maps, only towns.
Implemented a new server flag for enforcing base rates (server rate: 1x) on players level 10 or lower.
Fixed player guild tooltips not being properly marshalled to others on the map, at the event of several guild actions.
Reviewed event system allowing creation of same-name events, potentially leading to null EIM problems.
Refactored some locks on MapleCharacter, potentially solving a deadlock case within expiring/forfeiting quest methods.
Implemented a major overhaul on mob aggro system, now updating player aggro in real-time based on their latest DPS. Properly refactored and encapsulated aggro mechanics.
Fixed NPE on disposing events with alive mobs.
Added server-side birthday check handling when opening player shops or merchants having cash items in store.
Fixed player shop tooltip not finishing properly when shop owner closes store with visitors still in there.
Fixed forceChangeMap method not warping players to the designated event map (rather sending them to the starting event map).
Reviewed "summon" command, now using forceChangeMap, also changing channels if needed.
Reworked HeavenMS autoassigner: STR-based classes now ups a bit more DEX than before, since its a vital attribute for accuracy on their actions.
Added meso ceil check on player transactions. Trades now gets suspended if the max amount is reached.
Implemented server-side item limit check on player shops and merchants.
Fixed an exploit with merchants, on where players would be able to save the selling item on DB before taking from inventory.
This commit is contained in:
ronancpl
2019-01-31 00:49:15 -02:00
parent 98be29b088
commit efc8884e19
101 changed files with 17235 additions and 16461 deletions

View File

@@ -39,7 +39,7 @@ public class RatesCommand extends Command {
// travel rates not applicable since it's intrinsically a server/environment rate rather than a character rate
String showMsg_ = "#eCHARACTER RATES#n" + "\r\n\r\n";
showMsg_ += "EXP Rate: #e#b" + player.getExpRate() + "x#k#n" + "\r\n";
showMsg_ += "EXP Rate: #e#b" + player.getExpRate() + "x#k#n" + (player.hasNoviceExpRate() ? " - novice rate" : "") + "\r\n";
showMsg_ += "MESO Rate: #e#b" + player.getMesoRate() + "x#k#n" + "\r\n";
showMsg_ += "DROP Rate: #e#b" + player.getDropRate() + "x#k#n" + "\r\n";
showMsg_ += "BOSS DROP Rate: #e#b" + player.getBossDropRate() + "x#k#n" + "\r\n";

View File

@@ -40,7 +40,7 @@ public class ShowRatesCommand extends Command {
showMsg += "World EXP Rate: #k" + c.getWorldServer().getExpRate() + "x#k" + "\r\n";
showMsg += "Player EXP Rate: #k" + player.getRawExpRate() + "x#k" + "\r\n";
if(player.getCouponExpRate() != 1) showMsg += "Coupon EXP Rate: #k" + player.getCouponExpRate() + "x#k" + "\r\n";
showMsg += "EXP Rate: #e#b" + player.getExpRate() + "x#k#n" + "\r\n";
showMsg += "EXP Rate: #e#b" + player.getExpRate() + "x#k#n" + (player.hasNoviceExpRate() ? " - novice rate" : "") + "\r\n";
showMsg += "\r\n" + "#eMESO RATE#n" + "\r\n";
showMsg += "World MESO Rate: #k" + c.getWorldServer().getMesoRate() + "x#k" + "\r\n";
@@ -66,7 +66,7 @@ public class ShowRatesCommand extends Command {
}
showMsg += "\r\n";
showMsg += "World TRAVEL Rate: #e#b" + c.getWorldServer().getTravelRate() + "x#k#n" + "\r\nServer\r\nPlayer";
showMsg += "World TRAVEL Rate: #e#b" + c.getWorldServer().getTravelRate() + "x#k#n" + "\r\n";
player.showHint(showMsg, 300);
}

View File

@@ -41,8 +41,6 @@ public class GotoCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
final HashMap<String, Integer> gotomaps = GameConstants.GOTO_MAPS;
MapleCharacter player = c.getPlayer();
if (params.length < 1){
player.yellowMessage("Syntax: @goto <map name>");
@@ -54,6 +52,13 @@ public class GotoCommand extends Command {
return;
}
HashMap<String, Integer> gotomaps;
if (player.isGM()) {
gotomaps = new HashMap<>(GameConstants.GOTO_AREAS); // distinct map registry for GM/users suggested thanks to Vcoc
} else {
gotomaps = new HashMap<>(GameConstants.GOTO_TOWNS);
}
if (gotomaps.containsKey(params[0])) {
MapleMap target = c.getChannelServer().getMapFactory().getMap(gotomaps.get(params[0]));

View File

@@ -26,6 +26,7 @@ package client.command.commands.gm2;
import client.command.Command;
import client.MapleClient;
import client.MapleCharacter;
import server.maps.MapleMap;
import net.server.Server;
import net.server.channel.Channel;
@@ -54,33 +55,26 @@ public class SummonCommand extends Command {
}
}
if (victim != null) {
boolean changingEvent = true;
if (victim.getEventInstance() != null) {
if (player.getEventInstance() != null && victim.getEventInstance().getLeaderId() == player.getEventInstance().getLeaderId()) {
changingEvent = false;
} else {
victim.getEventInstance().unregisterPlayer(victim);
}
if (!victim.isLoggedinWorld()) {
player.dropMessage(6, "Player currently not logged in or unreachable.");
return;
}
//Attempt to join the warpers instance.
if (player.getEventInstance() != null && changingEvent) {
if (player.getClient().getChannel() == victim.getClient().getChannel()) {
player.getEventInstance().registerPlayer(victim);
victim.saveLocationOnWarp();
victim.changeMap(player.getEventInstance().getMapInstance(player.getMapId()), player.getMap().findClosestPortal(player.getPosition()));
} else {
player.dropMessage("Target isn't on your channel, not able to warp into event instance.");
}
} else {//If victim isn't in an event instance or is in the same event instance as the one the caller is, just warp them.
victim.saveLocationOnWarp();
victim.changeMap(player.getMapId(), player.getMap().findClosestPortal(player.getPosition()));
}
if (player.getClient().getChannel() != victim.getClient().getChannel()) {//And then change channel if needed.
victim.dropMessage("Changing channel, please wait a moment.");
victim.getClient().changeChannel(player.getClient().getChannel());
}
try {
for (int i = 0; i < 7; i++) { // poll for a while until the player reconnects
if (victim.isLoggedinWorld()) break;
Thread.sleep(1777);
}
} catch (InterruptedException e) {}
MapleMap map = player.getMap();
victim.saveLocationOnWarp();
victim.forceChangeMap(map, map.findClosestPortal(player.getPosition()));
} else {
player.dropMessage(6, "Unknown player.");
}

View File

@@ -29,7 +29,6 @@ import client.command.Command;
import server.maps.MapleMap;
import java.awt.*;
import java.util.ArrayList;
import java.util.Collection;
public class WarpAreaCommand extends Command {
@@ -54,7 +53,7 @@ public class WarpAreaCommand extends Command {
Point pos = player.getPosition();
Collection<MapleCharacter> characters = new ArrayList<>(player.getMap().getCharacters());
Collection<MapleCharacter> characters = player.getMap().getAllPlayers();
for (MapleCharacter victim : characters) {
if (victim.getPosition().distanceSq(pos) <= 50000) {

View File

@@ -28,7 +28,6 @@ import client.MapleClient;
import client.command.Command;
import server.maps.MapleMap;
import java.util.ArrayList;
import java.util.Collection;
public class WarpMapCommand extends Command {
@@ -51,7 +50,7 @@ public class WarpMapCommand extends Command {
return;
}
Collection<MapleCharacter> characters = new ArrayList<>(player.getMap().getCharacters());
Collection<MapleCharacter> characters = player.getMap().getAllPlayers();
for (MapleCharacter victim : characters) {
victim.saveLocationOnWarp();

View File

@@ -30,6 +30,8 @@ import net.server.Server;
import net.server.channel.Channel;
import server.expeditions.MapleExpedition;
import java.util.Map.Entry;
public class ExpedsCommand extends Command {
{
setDescription("");
@@ -53,11 +55,11 @@ public class ExpedsCommand extends Command {
player.yellowMessage(">> Size: " + exped.getMembers().size());
player.yellowMessage(">> Leader: " + exped.getLeader().getName());
int memId = 2;
for (MapleCharacter member : exped.getMembers()) {
if (exped.isLeader(member)) {
for (Entry<Integer, String> e : exped.getMembers().entrySet()) {
if (exped.isLeader(e.getKey())) {
continue;
}
player.yellowMessage(">>> Member " + memId + ": " + member.getName());
player.yellowMessage(">>> Member " + memId + ": " + e.getValue());
memId++;
}
}

View File

@@ -28,7 +28,6 @@ import client.MapleClient;
import client.MapleCharacter;
import server.maps.MapleMap;
import java.util.ArrayList;
import java.util.Collection;
public class ReloadMapCommand extends Command {
@@ -42,7 +41,7 @@ public class ReloadMapCommand extends Command {
MapleMap newMap = c.getChannelServer().getMapFactory().resetMap(player.getMapId());
int callerid = c.getPlayer().getId();
Collection<MapleCharacter> characters = new ArrayList<>(player.getMap().getCharacters());
Collection<MapleCharacter> characters = player.getMap().getAllPlayers();
for (MapleCharacter chr : characters) {
chr.saveLocationOnWarp();

View File

@@ -23,12 +23,11 @@
*/
package client.command.commands.gm3;
import client.command.Command;
import client.MapleClient;
import client.MapleCharacter;
import client.command.Command;
import client.MapleClient;
import client.MapleCharacter;
import java.util.ArrayList;
import java.util.List;
import java.util.List;
public class WarpSnowBallCommand extends Command {
{
@@ -38,7 +37,7 @@ public class WarpSnowBallCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
List<MapleCharacter> chars = new ArrayList<>(player.getMap().getCharacters());
List<MapleCharacter> chars = player.getMap().getAllPlayers();
for (MapleCharacter chr : chars) {
chr.saveLocationOnWarp();
chr.changeMap(109060000, chr.getTeam());

View File

@@ -72,7 +72,7 @@ public class DebugCommand extends Command {
for (MapleMapObject monstermo : monsters) {
MapleMonster monster = (MapleMonster) monstermo;
MapleCharacter controller = monster.getController();
player.message("Monster ID: " + monster.getId() + " Aggro target: " + ((controller != null) ? controller.getName() : "<none>"));
player.message("Monster ID: " + monster.getId() + " Aggro target: " + ((controller != null) ? controller.getName() + " Has aggro: " + monster.isControllerHasAggro() + " Knowns aggro: " + monster.isControllerKnowsAboutAggro() : "<none>"));
}
break;