Missing Pirate questlines + Find & MoveLife update + Party-Map patch

Implemented missing scripts for Aerial Strike, Hypnotize and Time Leap skill questlines.
Fixed an deadlock issue within player's inventory and status.
Fixed skill spam detection disconnecting players when legitimatelly spamming Flash Jump or Heal.
Fixed party members map location not being properly updated after changing maps.
Rehauled MoveLife handler. Improved packet read of attack and skill elements, properly reflecting incoming actions to other player on the map.
Reviewed an issue with equipments MaxHP/MaxMP getting unsynced with player's MaxHP/MaxMP, resulting in differences within server-client view of a player's pool.
Fixed mobs not being spawned by dojo bosses after enough spawn actions were instanced.
Implemented proper Mob.wz linked mob data support.
Fixed /find not identifying a player's channel properly.
Fixed Echo of Hero not affecting other player in the map.
Fixed commands warp and goto not taking player off events/expeditions properly.
Fixed storage expansion not being registered on DB when buying the cash item.
Fixed party leadership being reassigned after changing channels.
Implemented suggested level range limit between party members on the EXP share system. Players whose level range from the attacker exceeds the estipulated threshold will not receive any EXP from the action.

Happy Thanksgiving Day everyone!!!
This commit is contained in:
ronancpl
2018-11-22 16:16:21 -02:00
parent 5ee0cd1c98
commit 0910dc2428
163 changed files with 4618 additions and 3186 deletions

View File

@@ -192,7 +192,6 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
private int mesosTraded = 0;
private int possibleReports = 10;
private int dojoPoints, vanquisherStage, dojoStage, dojoEnergy, vanquisherKills;
private int warpToId;
private int expRate = 1, mesoRate = 1, dropRate = 1, expCoupon = 1, mesoCoupon = 1, dropCoupon = 1;
private int omokwins, omokties, omoklosses, matchcardwins, matchcardties, matchcardlosses;
private int owlSearch;
@@ -277,6 +276,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
private Lock evtLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_EVT, true);
private Lock petLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_PET, true); // for meso & quest tasks as well
private Lock prtLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_PRT);
private Lock cpnLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_CPN);
private Map<Integer, Set<Integer>> excluded = new LinkedHashMap<>();
private Set<Integer> excludedItems = new LinkedHashSet<>();
private static String[] ariantroomleader = new String[3];
@@ -1593,7 +1593,6 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
map.addPlayer(this);
visitMap(map);
silentPartyUpdateInternal(getParty()); // EIM script calls inside
prtLock.lock();
try {
if (party != null) {
@@ -1604,6 +1603,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
} finally {
prtLock.unlock();
}
silentPartyUpdateInternal(getParty()); // EIM script calls inside
if (getMap().getHPDec() > 0) resetHpDecreaseTask();
} else {
@@ -3029,10 +3029,6 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
return allianceRank;
}
public int getAllowWarpToId() {
return warpToId;
}
public static String getAriantRoomLeaderName(int room) {
return ariantroomleader[room];
}
@@ -6064,8 +6060,23 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
}
public void updateCouponRates() {
revertCouponRates();
setCouponRates();
if (cpnLock.tryLock()) {
MapleInventory cashInv = this.getInventory(MapleInventoryType.CASH);
effLock.lock();
chrLock.lock();
cashInv.lockInventory();
try {
revertCouponRates();
setCouponRates();
} finally {
cpnLock.unlock();
cashInv.unlockInventory();
chrLock.unlock();
effLock.unlock();
}
}
}
public void resetPlayerRates() {
@@ -8011,10 +8022,6 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
}
}
public void setAllowWarpToId(int id) {
this.warpToId = id;
}
public static void setAriantRoomLeader(int room, String charname) {
ariantroomleader[room] = charname;
}

View File

@@ -850,7 +850,7 @@ public class MapleClient {
}
}
private void removePlayer(World wserv) {
private void removePlayer(World wserv, boolean serverTransition) {
try {
player.setDisconnectedFromChannelWorld();
player.notifyMapTransferToPartner(-1);
@@ -859,12 +859,14 @@ public class MapleClient {
player.closePlayerInteractions();
QuestScriptManager.getInstance().dispose(this);
removePartyPlayer(wserv);
EventInstanceManager eim = player.getEventInstance();
if (eim != null) {
eim.playerDisconnected(player);
}
if (!serverTransition) { // thanks MedicOP for detecting an issue with party leader change on changing channels
removePartyPlayer(wserv);
EventInstanceManager eim = player.getEventInstance();
if (eim != null) {
eim.playerDisconnected(player);
}
}
if (player.getMap() != null) {
int mapId = player.getMapId();
@@ -918,7 +920,7 @@ public class MapleClient {
final World wserv = getWorldServer(); // obviously wserv is NOT null if this player was online on it
try {
removePlayer(wserv);
removePlayer(wserv, this.serverTransition);
if (!(channel == -1 || shutdown)) {
if (!cashshop) {

View File

@@ -31,7 +31,7 @@ import tools.DatabaseConnection;
/**
*
* @author Jay Estrella :3 (Mr.Trash)
* @author Jay Estrella - Mr.Trash :3
*/
public class MapleFamily {
private static int id;

View File

@@ -331,6 +331,7 @@ public class CommandsExecutor {
addCommand("debug", 5, DebugCommand.class);
addCommand("set", 5, SetCommand.class);
addCommand("showpackets", 5, ShowPacketsCommand.class);
addCommand("showmovelife", 5, ShowMoveLifeCommand.class);
commandsNameDesc.add(levelCommandsCursor);
}

View File

@@ -48,13 +48,12 @@ public class GotoCommand extends Command {
}
if (gotomaps.containsKey(params[0])) {
MapleMap target = c.getChannelServer().getMapFactory().getMap(gotomaps.get(params[0]));
MaplePortal targetPortal = target.getPortal(0);
if (player.getEventInstance() != null) {
player.getEventInstance().removePlayer(player);
}
// expedition issue with this command detected thanks to Masterrulax
MaplePortal targetPortal = target.getRandomPlayerSpawnpoint();
player.changeMap(target, targetPortal);
} else {
player.dropMessage(5, "That map does not exist.");
player.dropMessage(5, "Area '" + params[0] + "' is not registered.");
}
}
}

View File

@@ -47,9 +47,8 @@ public class WarpCommand extends Command {
player.yellowMessage("Map ID " + params[0] + " is invalid.");
return;
}
if (player.getEventInstance() != null) {
player.getEventInstance().leftParty(player);
}
// expedition issue with this command detected thanks to Masterrulax
player.changeMap(target, target.getRandomPlayerSpawnpoint());
} catch (Exception ex) {
player.yellowMessage("Map ID " + params[0] + " is invalid.");

View File

@@ -0,0 +1,39 @@
/*
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.gm5;
import client.command.Command;
import client.MapleClient;
import constants.ServerConstants;
public class ShowMoveLifeCommand extends Command {
{
setDescription("");
}
@Override
public void execute(MapleClient c, String[] params) {
ServerConstants.USE_DEBUG_SHOW_RCVD_MVLIFE = !ServerConstants.USE_DEBUG_SHOW_RCVD_MVLIFE;
}
}

View File

@@ -487,20 +487,22 @@ public class Equip extends Item {
String lvupStr = "'" + MapleItemInformationProvider.getInstance().getName(this.getItemId()) + "' is now level " + itemLevel + "! ";
String showStr = "#e'" + MapleItemInformationProvider.getInstance().getName(this.getItemId()) + "'#b is now #elevel #r" + itemLevel + "#k#b!";
Pair<String, Pair<Boolean, Boolean>> res = gainStats(stats);
Pair<String, Pair<Boolean, Boolean>> res = this.gainStats(stats);
lvupStr += res.getLeft();
boolean gotSlot = res.getRight().getLeft();
boolean gotVicious = res.getRight().getRight();
if(gotVicious) {
if (gotVicious) {
//c.getPlayer().dropMessage(6, "A new Vicious Hammer opportunity has been found on the '" + MapleItemInformationProvider.getInstance().getName(getItemId()) + "'!");
lvupStr += "+VICIOUS ";
}
if(gotSlot) {
if (gotSlot) {
//c.getPlayer().dropMessage(6, "A new upgrade slot has been found on the '" + MapleItemInformationProvider.getInstance().getName(getItemId()) + "'!");
lvupStr += "+UPGSLOT ";
}
c.getPlayer().equipChanged();
showLevelupMessage(showStr, c); // thanks to Polaris dev team !
c.getPlayer().dropMessage(6, lvupStr);

View File

@@ -42,6 +42,7 @@ import server.MapleItemInformationProvider;
import client.inventory.manipulator.MapleInventoryManipulator;
import tools.FilePrinter;
import net.server.audit.locks.MonitoredLockType;
import server.ThreadManager;
/**
*
@@ -320,7 +321,12 @@ public class MapleInventory implements Iterable<Item> {
}
if (ItemConstants.isRateCoupon(item.getItemId())) {
owner.updateCouponRates();
ThreadManager.getInstance().newTask(new Runnable() { // deadlocks with coupons rates found thanks to GabrielSin & Masterrulax
@Override
public void run() {
owner.updateCouponRates();
}
});
}
return slotId;
@@ -335,7 +341,12 @@ public class MapleInventory implements Iterable<Item> {
}
if (ItemConstants.isRateCoupon(item.getItemId())) {
owner.updateCouponRates();
ThreadManager.getInstance().newTask(new Runnable() {
@Override
public void run() {
owner.updateCouponRates();
}
});
}
}
@@ -349,7 +360,12 @@ public class MapleInventory implements Iterable<Item> {
}
if (item != null && ItemConstants.isRateCoupon(item.getItemId())) {
owner.updateCouponRates();
ThreadManager.getInstance().newTask(new Runnable() {
@Override
public void run() {
owner.updateCouponRates();
}
});
}
}

View File

@@ -47,7 +47,7 @@ import tools.MaplePacketCreator;
/**
*
* @author Matze
* @author Ronan (improved check space feature & removed redundant object calls)
* @author Ronan - improved check space feature & removed redundant object calls
*/
public class MapleInventoryManipulator {

View File

@@ -35,7 +35,7 @@ import tools.MaplePacketCreator;
/**
*
* @author Ronan (credits to Eric for showing the New Year opcodes and handler layout)
* @author Ronan - credits to Eric for showing the New Year opcodes and handler layout
*/
public class NewYearCardRecord {
private int id;

View File

@@ -50,7 +50,7 @@ import tools.data.input.SeekableLittleEndianAccessor;
/**
*
* @author RonanLana (synchronization of AP transaction modules)
* @author RonanLana - synchronization of AP transaction modules
*/
public class AssignAPProcessor {

View File

@@ -36,7 +36,7 @@ import tools.MaplePacketCreator;
/**
*
* @author RonanLana (synchronization of SP transaction modules)
* @author RonanLana - synchronization of SP transaction modules
*/
public class AssignSPProcessor {

View File

@@ -48,7 +48,7 @@ import tools.MaplePacketCreator;
/**
*
* @author RonanLana (synchronization of Duey modules)
* @author RonanLana - synchronization of Duey modules
*/
public class DueyProcessor {

View File

@@ -43,7 +43,7 @@ import tools.Pair;
/**
*
* @author RonanLana (synchronization of Fredrick modules)
* @author RonanLana - synchronization of Fredrick modules
*/
public class FredrickProcessor {
private static boolean canRetrieveFromFredrick(MapleCharacter chr, List<Pair<Item, MapleInventoryType>> items) {

View File

@@ -34,7 +34,7 @@ import tools.MaplePacketCreator;
/**
*
* @author RonanLana (just added locking on OdinMS' SpawnPetHandler method body)
* @author RonanLana - just added locking on OdinMS' SpawnPetHandler method body
*/
public class SpawnPetProcessor {
private static MapleDataProvider dataRoot = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/Item.wz"));