Multi World NPCs + patch on Player interactions

Made NPCs now work properly on multiworld system. Solved multiple issues
regarding Player Shops not giving back items properly when owner exits.
Added restriction on changing channels at FM rooms, preventing shop
owner entering Cash Shop.
This commit is contained in:
ronancpl
2017-05-28 22:11:39 -03:00
parent d0396e4c36
commit 7f178a3d80
548 changed files with 340 additions and 164 deletions

View File

@@ -472,7 +472,7 @@ public class MapleInventoryManipulator {
return;
}
int itemId = source.getItemId();
if (itemId >= 5000000 && itemId <= 5000100) {
if (itemId >= 5000000 && itemId <= 5000102) {
return;
}
if (type == MapleInventoryType.EQUIPPED && itemId == 1122017) {

View File

@@ -254,10 +254,13 @@ public class MapleTrade {
}
public static void cancelTrade(MapleCharacter c) {
c.getTrade().cancel();
if (c.getTrade().getPartner() != null) {
c.getTrade().getPartner().cancel();
c.getTrade().getPartner().getChr().setTrade(null);
MapleTrade trade = c.getTrade();
if(trade == null) return;
trade.cancel();
if (trade.getPartner() != null) {
trade.getPartner().cancel();
trade.getPartner().getChr().setTrade(null);
}
c.setTrade(null);
}

View File

@@ -29,7 +29,7 @@ public enum FieldLimit {
MOVEMENTSKILLS(0x02),
SUMMON(0x04),
DOOR(0x08),
CHANGECHANNEL(0x10),
CANNOTMIGRATE(0x10), //change channel, town portal scroll, access cash shop, etc etc
//NO_NOTES(0x20),
CANNOTVIPROCK(0x40),
CANNOTMINIGAME(0x80),

View File

@@ -57,7 +57,7 @@ public class HiredMerchant extends AbstractMapleMapObject {
private String ownerName = "";
private String description = "";
private MapleCharacter[] visitors = new MapleCharacter[3];
private List<MaplePlayerShopItem> items = new LinkedList<>();
private final List<MaplePlayerShopItem> items = new LinkedList<>();
private List<Pair<String, Byte>> messages = new LinkedList<>();
private List<SoldItem> sold = new LinkedList<>();
private boolean open;

View File

@@ -36,6 +36,7 @@ import provider.MapleDataProviderFactory;
import provider.MapleDataTool;
import server.quest.actions.*;
import server.quest.requirements.*;
import tools.FilePrinter;
import tools.MaplePacketCreator;
/**
@@ -63,21 +64,25 @@ public class MapleQuest {
private MapleQuest(int id) {
this.id = (short) id;
if(questInfo != null) {
MapleData reqData = questInfo.getChildByPath(String.valueOf(id));
timeLimit = MapleDataTool.getInt("timeLimit", reqData, 0);
timeLimit = Math.max(timeLimit, MapleDataTool.getInt("timeLimit2", reqData, 0)); // alas, nexon made we deal with 2 timeLimits
autoStart = MapleDataTool.getInt("autoStart", reqData, 0) == 1;
autoPreComplete = MapleDataTool.getInt("autoPreComplete", reqData, 0) == 1;
autoComplete = MapleDataTool.getInt("autoComplete", reqData, 0) == 1;
}
MapleData reqData = questReq.getChildByPath(String.valueOf(id));
if (reqData == null) {//most likely infoEx
return;
}
if(questInfo != null) {
MapleData reqInfo = questInfo.getChildByPath(String.valueOf(id));
if(reqInfo != null) {
timeLimit = MapleDataTool.getInt("timeLimit", reqInfo, 0);
timeLimit = Math.max(timeLimit, MapleDataTool.getInt("timeLimit2", reqInfo, 0)); // alas, nexon made we deal with 2 timeLimits
autoStart = MapleDataTool.getInt("autoStart", reqInfo, 0) == 1;
autoPreComplete = MapleDataTool.getInt("autoPreComplete", reqInfo, 0) == 1;
autoComplete = MapleDataTool.getInt("autoComplete", reqInfo, 0) == 1;
} else {
System.out.println("no data " + id);
}
}
MapleData startReqData = reqData.getChildByPath("0");
if (startReqData != null) {
for (MapleData startReq : startReqData.getChildren()) {