Reactor Loot + Obstacles damage mob + Static calls from scripts
Revised starting AP, now working out with flags. To supply the 9AP shortage of 4/4/4/4, two options: one giving out 9 AP from the start, other giving 4/5 AP when changing jobs (1st, 2nd). This change would also work with the autoassign for beginners flag. Refactored several quest scripts, that would be glitching the player when doing quest start/complete and disposing under the same script status. Cleared some cases with the quest reward system where it would call out a "full inventory" even though new inventory slots could get discovered when doing the quest loot transaction. Fixed an issue with player stores being deployed overlapping in a few scenarios. Fixed reduced EXP gain from kills when triggering skill Mortal Blow. Added "open Duey" functionality when clicking "O" in the incoming package notification. Fixed packages without messages (a quirk from quick delivery) not accounting visually as a "quick" one. Fixed certain mounts (non-item skill mounts, such as Yeti or Spaceship) not showing up properly to other players when changing maps. Added handler for mob damage by environment objects (OrbisPQ jail storage area). Added a placeholder on mob's stolen items to prevent more steals to be placed as soon as the Steal mechanism is triggered. Patched boss logs not removing recent entries from the DB tables (the reset method is actually supposed to clear every entry). Revised a possible memory leak scenario happening due to an exception thrown midway monster kill method. Improved reactor drops, now placing loots visible for the acting player centered (similar as to how mob loots work). Refactored several issues in scripts, related to accessing static Java methods through an object, that would start appearing after transitioning to Java 8.
This commit is contained in:
@@ -109,6 +109,7 @@ public class ItemAction extends MapleQuestAction {
|
||||
if (!canGetItem(iEntry, chr)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if(iEntry.getProp() != null) {
|
||||
if(iEntry.getProp() == -1) {
|
||||
if(extSelection != extNum++)
|
||||
@@ -181,11 +182,11 @@ public class ItemAction extends MapleQuestAction {
|
||||
}
|
||||
|
||||
} else {
|
||||
if(item.getCount() > 0) {
|
||||
// Make sure they can hold the item.
|
||||
Item toItem = new Item(item.getId(), (short) 0, (short) item.getCount());
|
||||
gainList.add(new Pair<>(toItem, type));
|
||||
} else {
|
||||
// Make sure they can hold the item.
|
||||
Item toItem = new Item(item.getId(), (short) 0, (short) item.getCount());
|
||||
gainList.add(new Pair<>(toItem, type));
|
||||
|
||||
if(item.getCount() < 0) {
|
||||
// Make sure they actually have the item.
|
||||
int quantity = item.getCount() * -1;
|
||||
|
||||
@@ -229,12 +230,34 @@ public class ItemAction extends MapleQuestAction {
|
||||
gainList.add(selected);
|
||||
}
|
||||
|
||||
if (!MapleInventory.checkSpots(chr, gainList, allSlotUsed, false)) {
|
||||
if (!canHold(chr, gainList)) {
|
||||
chr.dropMessage(1, "Please check if you have enough space in your inventory.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean canHold(MapleCharacter chr, List<Pair<Item, MapleInventoryType>> gainList) {
|
||||
List<Integer> toAddItemids = new LinkedList<>();
|
||||
List<Integer> toAddQuantity = new LinkedList<>();
|
||||
List<Integer> toRemoveItemids = new LinkedList<>();
|
||||
List<Integer> toRemoveQuantity = new LinkedList<>();
|
||||
|
||||
for (Pair<Item, MapleInventoryType> item : gainList) {
|
||||
Item it = item.getLeft();
|
||||
|
||||
if (it.getQuantity() > 0) {
|
||||
toAddItemids.add(it.getItemId());
|
||||
toAddQuantity.add((int) it.getQuantity());
|
||||
} else {
|
||||
toRemoveItemids.add(it.getItemId());
|
||||
toRemoveQuantity.add(-1 * ((int) it.getQuantity()));
|
||||
}
|
||||
}
|
||||
|
||||
// thanks onechord for noticing quests unnecessarily giving out "full inventory" from quests that also takes items from players
|
||||
return chr.getClient().getAbstractPlayerInteraction().canHoldAllAfterRemoving(toAddItemids, toAddQuantity, toRemoveItemids, toRemoveQuantity);
|
||||
}
|
||||
|
||||
private boolean canGetItem(ItemData item, MapleCharacter chr) {
|
||||
if (item.getGender() != 2 && item.getGender() != chr.getGender()) {
|
||||
|
||||
Reference in New Issue
Block a user