Storybook announce + AOE Mobskills & Autopot & Inventory check Patch
Implemented storybook detection for the skillbook announcer. Fixed an issue with AOE mob skills not locating players properly in certain situations. Reviewed interaction of players within same remote network on multiclient system. Patched messages when leaving the expedition area showing up for leaving players. Patched some skill questline item chances unexpectedly too low. Reviewed Rush questline-exclusive area not allowing multiple players in the room. Fixed meso capacity check on shop owner happening after item transaction. Patched server-side autopot settings, now using threshold cooling method to determine a player's updated settings. Reviewed locking flow regarding world/channel deployment on main class. Fixed a scenario where items collectable by party members would not show up in case those were the only items to be dropped and none needed by the last-hitter. Patched an issue in the inventory space checking algorithm that would allow a transaction for multiple of the same equipments. Refactored Dojo entry/exit modules. Patched a check on Maker skill. Fixed Cygnus FA buff getting reapplied each time the skill procs.
This commit is contained in:
@@ -61,6 +61,7 @@ public class ItemAction extends MapleQuestAction {
|
||||
for (MapleData iEntry : data.getChildren()) {
|
||||
int id = MapleDataTool.getInt(iEntry.getChildByPath("id"));
|
||||
int count = MapleDataTool.getInt(iEntry.getChildByPath("count"), 1);
|
||||
int period = MapleDataTool.getInt(iEntry.getChildByPath("period"), 0);
|
||||
|
||||
Integer prop = null;
|
||||
MapleData propData = iEntry.getChildByPath("prop");
|
||||
@@ -75,7 +76,7 @@ public class ItemAction extends MapleQuestAction {
|
||||
if (iEntry.getChildByPath("job") != null)
|
||||
job = MapleDataTool.getInt(iEntry.getChildByPath("job"));
|
||||
|
||||
items.add(new ItemData(Integer.parseInt(iEntry.getName()), id, count, prop, job, gender));
|
||||
items.add(new ItemData(Integer.parseInt(iEntry.getName()), id, count, prop, job, gender, period));
|
||||
}
|
||||
|
||||
Collections.sort(items, new Comparator<ItemData>()
|
||||
@@ -90,8 +91,8 @@ public class ItemAction extends MapleQuestAction {
|
||||
|
||||
@Override
|
||||
public void run(MapleCharacter chr, Integer extSelection) {
|
||||
List<Pair<Integer, Integer>> takeItem = new LinkedList<>();
|
||||
List<Pair<Integer, Integer>> giveItem = new LinkedList<>();
|
||||
List<ItemData> takeItem = new LinkedList<>();
|
||||
List<ItemData> giveItem = new LinkedList<>();
|
||||
|
||||
int props = 0, rndProps = 0, accProps = 0;
|
||||
for(ItemData item : items) {
|
||||
@@ -125,34 +126,38 @@ public class ItemAction extends MapleQuestAction {
|
||||
}
|
||||
|
||||
if(iEntry.getCount() < 0) { // Remove Item
|
||||
takeItem.add(new Pair<>(iEntry.getId(), iEntry.getCount()));
|
||||
takeItem.add(iEntry);
|
||||
} else { // Give Item
|
||||
giveItem.add(new Pair<>(iEntry.getId(), iEntry.getCount()));
|
||||
giveItem.add(iEntry);
|
||||
}
|
||||
}
|
||||
|
||||
// must take all needed items before giving others
|
||||
|
||||
for(Pair<Integer, Integer> iPair: takeItem) {
|
||||
MapleInventoryType type = ItemConstants.getInventoryType(iPair.getLeft());
|
||||
int quantity = iPair.getRight() * -1; // Invert
|
||||
for(ItemData iEntry: takeItem) {
|
||||
int itemid = iEntry.getId(), count = iEntry.getCount();
|
||||
|
||||
MapleInventoryType type = ItemConstants.getInventoryType(itemid);
|
||||
int quantity = count * -1; // Invert
|
||||
if(type.equals(MapleInventoryType.EQUIP)) {
|
||||
if(chr.getInventory(type).countById(iPair.getLeft()) < quantity) {
|
||||
if(chr.getInventory(type).countById(itemid) < quantity) {
|
||||
// Not enough in the equip inventoty, so check Equipped...
|
||||
if(chr.getInventory(MapleInventoryType.EQUIPPED).countById(iPair.getLeft()) > quantity) {
|
||||
if(chr.getInventory(MapleInventoryType.EQUIPPED).countById(itemid) > quantity) {
|
||||
// Found it equipped, so change the type to equipped.
|
||||
type = MapleInventoryType.EQUIPPED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MapleInventoryManipulator.removeById(chr.getClient(), type, iPair.getLeft(), quantity, true, false);
|
||||
chr.announce(MaplePacketCreator.getShowItemGain(iPair.getLeft(), (short) iPair.getRight().shortValue(), true));
|
||||
MapleInventoryManipulator.removeById(chr.getClient(), type, itemid, quantity, true, false);
|
||||
chr.announce(MaplePacketCreator.getShowItemGain(itemid, (short) count, true));
|
||||
}
|
||||
|
||||
for(Pair<Integer, Integer> iPair: giveItem) {
|
||||
MapleInventoryManipulator.addById(chr.getClient(), iPair.getLeft(), (short) iPair.getRight().shortValue(), "", -1);
|
||||
chr.announce(MaplePacketCreator.getShowItemGain(iPair.getLeft(), (short) iPair.getRight().shortValue(), true));
|
||||
for(ItemData iEntry: giveItem) {
|
||||
int itemid = iEntry.getId(), count = iEntry.getCount(), period = iEntry.getPeriod(); // thanks Vcoc for noticing quest milestone item not getting removed from inventory after a while
|
||||
|
||||
MapleInventoryManipulator.addById(chr.getClient(), itemid, (short) count, "", -1, period > 0 ? (System.currentTimeMillis() + period * 60 * 1000) : -1);
|
||||
chr.announce(MaplePacketCreator.getShowItemGain(itemid, (short) count, true));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,16 +325,17 @@ public class ItemAction extends MapleQuestAction {
|
||||
}
|
||||
|
||||
private class ItemData {
|
||||
private final int map, id, count, job, gender;
|
||||
private final int map, id, count, job, gender, period;
|
||||
private final Integer prop;
|
||||
|
||||
public ItemData(int map, int id, int count, Integer prop, int job, int gender) {
|
||||
public ItemData(int map, int id, int count, Integer prop, int job, int gender, int period) {
|
||||
this.map = map;
|
||||
this.id = id;
|
||||
this.count = count;
|
||||
this.prop = prop;
|
||||
this.job = job;
|
||||
this.gender = gender;
|
||||
this.period = period;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
@@ -351,5 +357,9 @@ public class ItemAction extends MapleQuestAction {
|
||||
public int getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public int getPeriod() {
|
||||
return period;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user