Map chair skill + Hired Merchant fix

Changed map chair bonus healing mechanic to be a player skill, instead of promptly available for all players (healing buff takes place only if the player has the skill). Hired Merchant now properly checks for a space on the inventory before permitting a player to buy an item/bundle. Minor fix with concurrency on MapleStorage.
This commit is contained in:
ronancpl
2017-10-22 01:08:40 -02:00
parent 75e11e1996
commit e993c8c7b0
63 changed files with 354 additions and 191 deletions

View File

@@ -167,7 +167,8 @@ public class MapleHiredMerchant extends AbstractMapleMapObject {
}
int price = (int)Math.min((long)pItem.getPrice() * quantity, Integer.MAX_VALUE);
if (c.getPlayer().getMeso() >= price) {
if (MapleInventoryManipulator.addFromDrop(c, newItem, false)) {
if (MapleInventoryManipulator.checkSpace(c, newItem.getItemId(), newItem.getQuantity(), newItem.getOwner())) {
MapleInventoryManipulator.addFromDrop(c, newItem, false);
c.getPlayer().gainMeso(-price, false);
synchronized (sold) {
@@ -196,7 +197,7 @@ public class MapleHiredMerchant extends AbstractMapleMapObject {
}
}
} else {
c.getPlayer().dropMessage(1, "Your inventory is full. Please clean a slot before buying this item.");
c.getPlayer().dropMessage(1, "Your inventory is full. Please clear a slot before buying this item.");
}
} else {
c.getPlayer().dropMessage(1, "You do not have enough mesos.");