Heal GMS + Improved chnl workers & Pshop tooltip + Equips on party HP
Slightly improved channel and disease announce workers performance. Completion of repeatable quests no longer generates fame to players. Equipment drop rates of Leprechaun were slightly decreased. Fixed Pet Item Ignore not checking certain exploit cases correctly. Optimized Pet Item Ignore server handler performance. Fixed some exploits and improved performance on PetLootHandler. Improved concurrency protection on MapleInventoryManipulator. Heal skill effect on players now works GMS-intended, as description says. Also removed the delayed Heal cast effect to others. Fixed party player HPBar not accounting the player's HP stat gained on equips towards the effective MaxHP. The duration of mists generated by mobs has been rescaled to 10x longer than what has been displayed until now (wz duration property is supposed to actually be in 100ms). Optimized timer management for mob skill cooldown and elemental effectiveness. Implemented an additional inventory check system, to be used in cases where it's expected to remove a set group for items (with quantity) to then add a new group of items. Fixed Player Shop/Hired Merchant "vacancy" tooltip, now properly showing whether the store has a visitor room or is already full at that time. Fixed Player Shops only using the standard stand type. Fixed cash pet food ignoring certain pet itemids when reading data from WZ.
This commit is contained in:
@@ -23,6 +23,7 @@ package scripting;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.util.Arrays;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
@@ -36,7 +37,6 @@ import net.server.world.MaplePartyCharacter;
|
||||
import scripting.event.EventInstanceManager;
|
||||
import scripting.event.EventManager;
|
||||
import scripting.npc.NPCScriptManager;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.expeditions.MapleExpedition;
|
||||
import server.expeditions.MapleExpeditionType;
|
||||
@@ -58,9 +58,11 @@ import client.SkillFactory;
|
||||
import client.inventory.Equip;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.MapleInventory;
|
||||
import client.inventory.MapleInventoryProof;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import client.inventory.MaplePet;
|
||||
import client.inventory.ModifyInventory;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import constants.GameConstants;
|
||||
import constants.ItemConstants;
|
||||
import constants.ServerConstants;
|
||||
@@ -247,7 +249,73 @@ public class AbstractPlayerInteraction {
|
||||
addedItems.add(new Pair<>(it, ItemConstants.getInventoryType(itemids.get(i))));
|
||||
}
|
||||
|
||||
return MapleInventory.checkSpots(c.getPlayer(), addedItems);
|
||||
return MapleInventory.checkSpots(c.getPlayer(), addedItems, false);
|
||||
}
|
||||
|
||||
public boolean canHold(int itemid, int quantity, int removeItemid, int removeQuantity) {
|
||||
return canHoldAllAfterRemoving(Collections.singletonList(itemid), Collections.singletonList(quantity), Collections.singletonList(removeItemid), Collections.singletonList(removeQuantity));
|
||||
}
|
||||
|
||||
private static List<Pair<Item, MapleInventoryType>> prepareProofInventoryItems(List<Pair<Integer, Integer>> items) {
|
||||
List<Pair<Item, MapleInventoryType>> addedItems = new LinkedList<>();
|
||||
for(Pair<Integer, Integer> p : items) {
|
||||
Item it = new Item(p.getLeft(), (short) 0, p.getRight().shortValue());
|
||||
addedItems.add(new Pair<>(it, MapleInventoryType.CANHOLD));
|
||||
}
|
||||
|
||||
return addedItems;
|
||||
}
|
||||
|
||||
private static List<List<Pair<Integer, Integer>>> prepareInventoryItemList(List<Integer> itemids, List<Integer> quantity) {
|
||||
int size = Math.min(itemids.size(), quantity.size());
|
||||
|
||||
List<List<Pair<Integer, Integer>>> invList = new ArrayList<>(6);
|
||||
for(int i = MapleInventoryType.UNDEFINED.getType(); i < MapleInventoryType.CASH.getType(); i++) {
|
||||
invList.add(new LinkedList<Pair<Integer, Integer>>());
|
||||
}
|
||||
|
||||
for(int i = 0; i < size; i++) {
|
||||
int itemid = itemids.get(i);
|
||||
invList.get(ItemConstants.getInventoryType(itemid).getType()).add(new Pair<>(itemid, quantity.get(i)));
|
||||
}
|
||||
|
||||
return invList;
|
||||
}
|
||||
|
||||
public boolean canHoldAllAfterRemoving(List<Integer> toAddItemids, List<Integer> toAddQuantity, List<Integer> toRemoveItemids, List<Integer> toRemoveQuantity) {
|
||||
List<List<Pair<Integer, Integer>>> toAddItemList = prepareInventoryItemList(toAddItemids, toAddQuantity);
|
||||
List<List<Pair<Integer, Integer>>> toRemoveItemList = prepareInventoryItemList(toRemoveItemids, toRemoveQuantity);
|
||||
|
||||
MapleInventoryProof prfInv = (MapleInventoryProof) this.getInventory(MapleInventoryType.CANHOLD);
|
||||
prfInv.lockInventory();
|
||||
try {
|
||||
for(int i = MapleInventoryType.EQUIP.getType(); i < MapleInventoryType.CASH.getType(); i++) {
|
||||
List<Pair<Integer, Integer>> toAdd = toAddItemList.get(i);
|
||||
|
||||
if(!toAdd.isEmpty()) {
|
||||
List<Pair<Integer, Integer>> toRemove = toRemoveItemList.get(i);
|
||||
|
||||
MapleInventory inv = this.getInventory(i);
|
||||
prfInv.cloneContents(inv);
|
||||
|
||||
for(Pair<Integer, Integer> p : toRemove) {
|
||||
MapleInventoryManipulator.removeById(c, MapleInventoryType.CANHOLD, p.getLeft(), p.getRight(), false, false);
|
||||
}
|
||||
|
||||
List<Pair<Item, MapleInventoryType>> addItems = prepareProofInventoryItems(toAdd);
|
||||
|
||||
boolean canHold = MapleInventory.checkSpots(c.getPlayer(), addItems, true);
|
||||
if(!canHold) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
prfInv.flushContents();
|
||||
prfInv.unlockInventory();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//---- \/ \/ \/ \/ \/ \/ \/ NOT TESTED \/ \/ \/ \/ \/ \/ \/ \/ \/ ----
|
||||
|
||||
@@ -35,14 +35,13 @@ import java.util.Set;
|
||||
import java.util.Iterator;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import tools.locks.MonitoredReentrantLock;
|
||||
import tools.locks.MonitoredReentrantReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
|
||||
|
||||
import javax.script.ScriptException;
|
||||
|
||||
import net.server.audit.locks.MonitoredLockType;
|
||||
import net.server.audit.locks.MonitoredReentrantLock;
|
||||
import net.server.audit.locks.MonitoredReentrantReadWriteLock;
|
||||
import net.server.world.MapleParty;
|
||||
import net.server.world.MaplePartyCharacter;
|
||||
import provider.MapleDataProviderFactory;
|
||||
@@ -70,7 +69,6 @@ import server.MapleItemInformationProvider;
|
||||
import server.life.MapleLifeFactory;
|
||||
import server.life.MapleNPC;
|
||||
import tools.MaplePacketCreator;
|
||||
import tools.locks.MonitoredLockType;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -54,8 +54,8 @@ import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import tools.locks.MonitoredLockType;
|
||||
import tools.locks.MonitoredReentrantLock;
|
||||
import net.server.audit.locks.MonitoredLockType;
|
||||
import net.server.audit.locks.MonitoredReentrantLock;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user