Map buff protection & Expirable quest patch + Storage notice

Fixed items such as Red Bean Porridge and Air Bubble from acting outside of their scopes (now Air Bubble acts only under water, for instance).
Fixed an exploit with expirable quests when accessing the cash shop, that would make them "unexpirable".
Tweaked storages, now showing up popup warnings to players under level 15 instead of using the chat text area.
Removed "One-of-a-kind" tag from Lilin's Ring (caused conflicts with the Agent E custom script).
Added a few more scrolls to Spindle's shop.
Implemented several minor drop data adjustments.
This commit is contained in:
ronancpl
2018-02-09 23:25:21 -02:00
parent 3f8904ef44
commit 2d49c322e1
29 changed files with 338 additions and 138 deletions

View File

@@ -1246,16 +1246,22 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
private boolean buffMapProtection() {
effLock.lock();
chrLock.lock();
int thisMapid = mapid;
int returnMapid = client.getChannelServer().getMapFactory().getMap(thisMapid).getReturnMapId();
try {
MapleMap thisMap = client.getChannelServer().getMapFactory().getMap(mapid);
for(Entry<MapleBuffStat, MapleBuffStatValueHolder> mbs : effects.entrySet()) {
if(mbs.getKey() == MapleBuffStat.MAP_PROTECTION) {
byte value = (byte)mbs.getValue().value;
if(value == 1 && (thisMap.getReturnMapId() == 211000000 || thisMap.getReturnMapId() == 193000000)) return true; //protection from cold
else if(value == 2 && (thisMap.getReturnMapId() == 211000000 || thisMap.getReturnMapId() == 230000000)) return true; //breathing underwater
else return false;
if(value == 1 && ((returnMapid == 211000000 && thisMapid != 200082300) || returnMapid == 193000000)) {
return true; //protection from cold
} else if(value == 2 && (returnMapid == 230000000 || thisMapid == 200082300)) {
return true; //breathing underwater
} else {
return false;
}
}
}
} finally {
@@ -1264,7 +1270,9 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
for(Item it: this.getInventory(MapleInventoryType.EQUIPPED).list()) {
if((it.getFlag() & ItemConstants.COLD) == ItemConstants.COLD && map.getReturnMapId() == 211000000) return true; //protection from cold
if((it.getFlag() & ItemConstants.COLD) == ItemConstants.COLD && ((returnMapid == 211000000 && thisMapid != 200082300) || returnMapid == 193000000)) {
return true; //protection from cold
}
}
return false;
@@ -6285,6 +6293,8 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
public synchronized void saveToDB(boolean notAutosave) {
if(!loggedIn) return;
Calendar c = Calendar.getInstance();
if(notAutosave) FilePrinter.print(FilePrinter.SAVING_CHARACTER, "Attempting to save " + name + " at " + c.getTime().toString());
@@ -7474,6 +7484,19 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
}
public void forfeitExpirableQuests() {
petLock.lock();
try {
for(MapleQuest quest : questExpirations.keySet()) {
quest.forfeit(this);
}
questExpirations.clear();
} finally {
petLock.unlock();
}
}
public void questExpirationTask() {
petLock.lock();
try {

View File

@@ -65,8 +65,10 @@ public class EnterCashShopHandler extends AbstractMaplePacketHandler {
mc.cancelDiseaseExpireTask();
mc.cancelSkillCooldownTask();
mc.cancelExpirationTask();
mc.forfeitExpirableQuests();
mc.cancelQuestExpirationTask();
c.announce(MaplePacketCreator.openCashShop(c, false));
c.announce(MaplePacketCreator.showCashInventory(c));
c.announce(MaplePacketCreator.showGifts(mc.getCashShop().loadGifts()));

View File

@@ -74,6 +74,8 @@ public final class EnterMTSHandler extends AbstractMaplePacketHandler {
chr.cancelDiseaseExpireTask();
chr.cancelSkillCooldownTask();
chr.cancelExpirationTask();
chr.forfeitExpirableQuests();
chr.cancelQuestExpirationTask();
chr.saveToDB();

View File

@@ -49,7 +49,7 @@ public final class StorageHandler extends AbstractMaplePacketHandler {
final MapleStorage storage = chr.getStorage();
if (chr.getLevel() < 15){
chr.message("You may only use the storage once you have reached level 15.");
chr.dropMessage(1, "You may only use the storage once you have reached level 15.");
c.announce(MaplePacketCreator.enableActions());
return;
}

View File

@@ -1227,7 +1227,7 @@ public class MapleItemInformationProvider {
return isQuestItemCache.get(itemId);
}
MapleData data = getItemData(itemId);
boolean questItem = MapleDataTool.getIntConvert("info/quest", data, 0) == 1;
boolean questItem = (data != null && MapleDataTool.getIntConvert("info/quest", data, 0) == 1);
isQuestItemCache.put(itemId, questItem);
return questItem;
}

View File

@@ -223,13 +223,11 @@ public class MapleStorage {
}
public void sendStorage(MapleClient c, int npcId) {
/*
if (c.getPlayer().getLevel() < 15){
c.getPlayer().message("You may only use the storage once you have reached level 15.");
c.getPlayer().dropMessage(1, "You may only use the storage once you have reached level 15.");
c.announce(MaplePacketCreator.enableActions());
return;
}
*/
lock.lock();
try {

View File

@@ -2610,7 +2610,7 @@ public class MapleMap {
}
public void setMapPointBoundings(int px, int py, int h, int w) {
mapArea.setBounds(px + 60, py, w - 120, h);
mapArea.setBounds(px + 80, py, w - 160, h);
}
public void setMapLineBoundings(int vrTop, int vrBottom, int vrLeft, int vrRight) {