Item Raise + Gachapon Rework + Minigames & M. Magnet & M. Door patch
Fixed a glitch in inventory that would happen when trying to put items into storage. Added "Item Raise" functionality. Adjusted Party Search. Token sessions no longer expires due to no players found, rather are sent into a brief "inactivity" period. Fixed Fredrick stored items not being properly erased after a character deletion. Fixed skillbooks in stacked quantities not being useable. New tool: MapleGachaponItemidRetriever. This tool parses the gachapon descriptor file (holding several item names, for several gachapons) and generates files for each defined gachapon with itemids of the loots. Revised Mushroom Empire transition portals that interacts with scripted items (items now are useable through inventory, no longer being automatically removed from inventory upon crossing portals). Fixed script "secretroom" always requiring a new key (quest reward) to access the inner rooms, which would make the room unreachable. Reworked gachapons loots throughout the game. New loots are supposed to represent an old-school MapleSEA-like escalation of gachapon loots. Fixed issues that would show up in the case null PIN/PIC gets checked. Reworked skill Monster Magnet, no longer using "catch success rate" as a skill progression element. This fixes the skill disconnecting caster upon failure. Revised Mystic Doors, no longer crashing players after the caster decides to cancel the buff moments after casting (during portal deploying effect in course). Fixed portal access to Prime Minister crashing when trying to access on a party. Refactored the several "startQuest/completeQuest" methods widely used in the many scripting managers. Methods that does essentially the same thing now are accessed from the superclass. Fixed "rechargeable items" not being properly accounted for slots availability in inventory slot checking. Fixed several issues of late within minigames. Fixed minigames regarding double results when handling some rare scenarios. Implemented "call for leave after finishing game" functionality of minigames.
This commit is contained in:
@@ -206,7 +206,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
private transient int localstr, localdex, localluk, localint_, localmagic, localwatk;
|
||||
private transient int equipmaxhp, equipmaxmp, equipstr, equipdex, equipluk, equipint_, equipmagic, equipwatk, localchairhp, localchairmp;
|
||||
private int localchairrate;
|
||||
private boolean hidden, equipchanged = true, canDoor = true, berserk, hasMerchant, hasSandboxItem = false, whiteChat = false, canRecvPartySearchInvite = true;
|
||||
private boolean hidden, equipchanged = true, berserk, hasMerchant, hasSandboxItem = false, whiteChat = false, canRecvPartySearchInvite = true;
|
||||
private boolean equippedMesoMagnet = false, equippedItemPouch = false, equippedPetItemIgnore = false;
|
||||
private int linkedLevel = 0;
|
||||
private String linkedName = null;
|
||||
@@ -961,7 +961,8 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
public boolean canDoor() {
|
||||
return canDoor;
|
||||
MapleDoor door = getPlayerDoor();
|
||||
return door == null || (door.isActive() && door.getElapsedDeployTime() > 5000);
|
||||
}
|
||||
|
||||
public void setHasSandboxItem() {
|
||||
@@ -2297,6 +2298,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
deleteQuestProgressWhereCharacterId(con, cid);
|
||||
FredrickProcessor.removeFredrickLog(cid); // thanks maple006 for pointing out the player's Fredrick items are not being deleted at character deletion
|
||||
|
||||
try (PreparedStatement ps = con.prepareStatement("SELECT id FROM mts_cart WHERE cid = ?")) {
|
||||
ps.setInt(1, cid);
|
||||
@@ -2521,19 +2523,6 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}, healInterval, healInterval);
|
||||
}
|
||||
|
||||
public void disableDoorSpawn() {
|
||||
canDoor = false;
|
||||
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
canDoor = true;
|
||||
}
|
||||
};
|
||||
|
||||
client.getChannelServer().registerOverallAction(mapid, r, 5000);
|
||||
}
|
||||
|
||||
public void disbandGuild() {
|
||||
if (guildid < 1 || guildRank != 1) {
|
||||
return;
|
||||
@@ -3783,29 +3772,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
if (effect.isMagicDoor()) {
|
||||
MapleDoor destroyDoor = removePartyDoor(false);
|
||||
|
||||
if (destroyDoor != null) {
|
||||
destroyDoor.getTarget().removeMapObject(destroyDoor.getAreaDoor());
|
||||
destroyDoor.getTown().removeMapObject(destroyDoor.getTownDoor());
|
||||
|
||||
for (MapleCharacter chr : destroyDoor.getTarget().getCharacters()) {
|
||||
destroyDoor.getAreaDoor().sendDestroyData(chr.getClient());
|
||||
}
|
||||
|
||||
Collection<MapleCharacter> townChars = destroyDoor.getTown().getCharacters();
|
||||
for (MapleCharacter chr : townChars) {
|
||||
destroyDoor.getTownDoor().sendDestroyData(chr.getClient());
|
||||
}
|
||||
if (destroyDoor.getTownPortal().getId() == 0x80) {
|
||||
for (MapleCharacter chr : townChars) {
|
||||
MapleDoor door = chr.getMainTownDoor();
|
||||
if (door != null) {
|
||||
destroyDoor.getTownDoor().sendSpawnData(chr.getClient());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
MapleDoor.attemptRemoveDoor(this);
|
||||
} else if (effect.isMapChair()) {
|
||||
stopChairTask();
|
||||
}
|
||||
@@ -4559,7 +4526,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
silentPartyUpdateInternal(chrParty);
|
||||
}
|
||||
|
||||
private MapleDoor removePartyDoor(boolean partyUpdate) {
|
||||
public MapleDoor removePartyDoor(boolean partyUpdate) {
|
||||
MapleDoor ret = null;
|
||||
MapleParty chrParty;
|
||||
|
||||
@@ -5356,7 +5323,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
closeNpcShop();
|
||||
closeTrade();
|
||||
closePlayerShop();
|
||||
closeMiniGame();
|
||||
closeMiniGame(true);
|
||||
closeHiredMerchant(false);
|
||||
closePlayerMessenger();
|
||||
|
||||
@@ -5398,18 +5365,16 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
this.setPlayerShop(null);
|
||||
}
|
||||
|
||||
public void closeMiniGame() {
|
||||
public void closeMiniGame(boolean forceClose) {
|
||||
MapleMiniGame game = this.getMiniGame();
|
||||
if (game == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setMiniGame(null);
|
||||
if (game.isOwner(this)) {
|
||||
this.getMap().broadcastMessage(MaplePacketCreator.removeMinigameBox(this));
|
||||
game.broadcastToVisitor(MaplePacketCreator.getMiniGameClose(3));
|
||||
game.closeRoom(forceClose);
|
||||
} else {
|
||||
game.removeVisitor(this);
|
||||
game.removeVisitor(forceClose, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -109,11 +109,11 @@ public class MapleClient {
|
||||
private Map<String, ScriptEngine> engines = new HashMap<>();
|
||||
private byte characterSlots = 3;
|
||||
private byte loginattempt = 0;
|
||||
private String pin = null;
|
||||
private String pin = "";
|
||||
private int pinattempt = 0;
|
||||
private String pic = null;
|
||||
private String hwid = null;
|
||||
private String pic = "";
|
||||
private int picattempt = 0;
|
||||
private String hwid = null;
|
||||
private byte csattempt = 0;
|
||||
private byte gender = -1;
|
||||
private boolean disconnecting = false;
|
||||
@@ -480,6 +480,10 @@ public class MapleClient {
|
||||
}
|
||||
|
||||
public boolean checkPin(String other) {
|
||||
if (!(ServerConstants.ENABLE_PIN && !canBypassPin())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
pinattempt++;
|
||||
if (pinattempt > 5) {
|
||||
MapleSessionCoordinator.getInstance().closeSession(session, false);
|
||||
@@ -521,7 +525,7 @@ public class MapleClient {
|
||||
if (picattempt > 5) {
|
||||
MapleSessionCoordinator.getInstance().closeSession(session, false);
|
||||
}
|
||||
if (pic.equals(other)) {
|
||||
if (pic.equals(other)) { // thanks ryantpayton (HeavenClient) for noticing null pics being checked here
|
||||
picattempt = 0;
|
||||
MapleLoginBypassCoordinator.getInstance().registerLoginBypassEntry(getNibbleHWID(), accId, true);
|
||||
return true;
|
||||
@@ -1485,6 +1489,8 @@ public class MapleClient {
|
||||
player.getMap().removePlayer(player);
|
||||
player.clearBanishPlayerData();
|
||||
player.getClient().getChannelServer().removePlayer(player);
|
||||
|
||||
player.saveCharToDB();
|
||||
|
||||
player.getClient().updateLoginState(MapleClient.LOGIN_SERVER_TRANSITION);
|
||||
player.setSessionTransitionState();
|
||||
|
||||
@@ -85,7 +85,7 @@ public enum AutobanFactory {
|
||||
|
||||
public void alert(MapleCharacter chr, String reason) {
|
||||
if(ServerConstants.USE_AUTOBAN == true) {
|
||||
if (chr != null && MapleLogger.ignored.contains(chr.getName())){
|
||||
if (chr != null && MapleLogger.ignored.contains(chr.getId())){
|
||||
return;
|
||||
}
|
||||
Server.getInstance().broadcastGMMessage((chr != null ? chr.getWorld() : 0), MaplePacketCreator.sendYellowTip((chr != null ? MapleCharacter.makeMapleReadable(chr.getName()) : "") + " caused " + this.name() + " " + reason));
|
||||
|
||||
@@ -119,9 +119,9 @@ public class AutobanManager {
|
||||
|
||||
FilePrinter.print(FilePrinter.EXPLOITS, "Player " + chr + " was caught spamming TYPE " + type + " and has been disconnected.");
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
this.timestamp[type] = time;
|
||||
this.timestampcounter[type] = 0;
|
||||
}
|
||||
this.timestamp[type] = time;
|
||||
this.timestampcounter[type] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,6 +259,7 @@ public class CommandsExecutor {
|
||||
addCommand("job", 2, JobCommand.class);
|
||||
addCommand("unbug", 2, UnBugCommand.class);
|
||||
addCommand("id", 2, IdCommand.class);
|
||||
addCommand("gachalist", GachaListCommand.class);
|
||||
|
||||
commandsNameDesc.add(levelCommandsCursor);
|
||||
}
|
||||
|
||||
38
src/client/command/commands/gm2/GachaListCommand.java
Normal file
38
src/client/command/commands/gm2/GachaListCommand.java
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
This file is part of the HeavenMS MapleStory Server, commands OdinMS-based
|
||||
Copyleft (L) 2016 - 2018 RonanLana
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation version 3 as published by
|
||||
the Free Software Foundation. You may not use, modify or distribute
|
||||
this program under any other version of the GNU Affero General Public
|
||||
License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package client.command.commands.gm2;
|
||||
|
||||
import client.MapleClient;
|
||||
import client.command.Command;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Ronan
|
||||
*/
|
||||
public class GachaListCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
c.getAbstractPlayerInteraction().openNpc(10000, "gachaponInfo");
|
||||
}
|
||||
}
|
||||
@@ -47,11 +47,11 @@ public class IgnoreCommand extends Command {
|
||||
player.message("Player '" + params[0] + "' could not be found on this world.");
|
||||
return;
|
||||
}
|
||||
boolean monitored_ = MapleLogger.ignored.contains(victim.getName());
|
||||
boolean monitored_ = MapleLogger.ignored.contains(victim.getId());
|
||||
if (monitored_) {
|
||||
MapleLogger.ignored.remove(victim.getName());
|
||||
MapleLogger.ignored.remove(victim.getId());
|
||||
} else {
|
||||
MapleLogger.ignored.add(victim.getName());
|
||||
MapleLogger.ignored.add(victim.getId());
|
||||
}
|
||||
player.yellowMessage(victim.getName() + " is " + (!monitored_ ? "now being ignored." : "no longer being ignored."));
|
||||
String message_ = player.getName() + (!monitored_ ? " has started ignoring " : " has stopped ignoring ") + victim.getName() + ".";
|
||||
|
||||
@@ -36,8 +36,8 @@ public class IgnoredCommand extends Command {
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
for (String ign : MapleLogger.ignored) {
|
||||
player.yellowMessage(ign + " is being ignored.");
|
||||
for (Integer cid : MapleLogger.ignored) {
|
||||
player.yellowMessage(MapleCharacter.getNameById(cid) + " is being ignored.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,14 +47,14 @@ public class MonitorCommand extends Command {
|
||||
player.message("Player '" + params[0] + "' could not be found on this world.");
|
||||
return;
|
||||
}
|
||||
boolean monitored = MapleLogger.monitored.contains(victim.getName());
|
||||
boolean monitored = MapleLogger.monitored.contains(victim.getId());
|
||||
if (monitored) {
|
||||
MapleLogger.monitored.remove(victim.getName());
|
||||
MapleLogger.monitored.remove(victim.getId());
|
||||
} else {
|
||||
MapleLogger.monitored.add(victim.getName());
|
||||
MapleLogger.monitored.add(victim.getId());
|
||||
}
|
||||
player.yellowMessage(victim.getName() + " is " + (!monitored ? "now being monitored." : "no longer being monitored."));
|
||||
String message = player.getName() + (!monitored ? " has started monitoring " : " has stopped monitoring ") + victim.getName() + ".";
|
||||
player.yellowMessage(victim.getId() + " is " + (!monitored ? "now being monitored." : "no longer being monitored."));
|
||||
String message = player.getName() + (!monitored ? " has started monitoring " : " has stopped monitoring ") + victim.getId() + ".";
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.serverNotice(5, message));
|
||||
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ public class MonitorsCommand extends Command {
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
for (String ign : MapleLogger.monitored) {
|
||||
player.yellowMessage(ign + " is being monitored.");
|
||||
for (Integer cid : MapleLogger.monitored) {
|
||||
player.yellowMessage(MapleCharacter.getNameById(cid) + " is being monitored.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -463,31 +463,41 @@ public class MapleInventory implements Iterable<Item> {
|
||||
public static boolean checkSpots(MapleCharacter chr, List<Pair<Item, MapleInventoryType>> items, List<Integer> typesSlotsUsed, boolean useProofInv) {
|
||||
// assumption: no "UNDEFINED" or "EQUIPPED" items shall be tested here, all counts are >= 0.
|
||||
|
||||
Map<Integer, Short> rcvItems = new LinkedHashMap<>();
|
||||
Map<Integer, List<Integer>> rcvItems = new LinkedHashMap<>();
|
||||
Map<Integer, Byte> rcvTypes = new LinkedHashMap<>();
|
||||
|
||||
for (Pair<Item, MapleInventoryType> item : items) {
|
||||
Integer itemId = item.left.getItemId();
|
||||
Short qty = rcvItems.get(itemId);
|
||||
List<Integer> qty = rcvItems.get(itemId);
|
||||
|
||||
if(qty == null) {
|
||||
rcvItems.put(itemId, item.left.getQuantity());
|
||||
List<Integer> itemQtyList = new LinkedList<>();
|
||||
itemQtyList.add((int) item.left.getQuantity());
|
||||
|
||||
rcvItems.put(itemId, itemQtyList);
|
||||
rcvTypes.put(itemId, item.right.getType());
|
||||
} else {
|
||||
rcvItems.put(itemId, (short)(qty + item.left.getQuantity()));
|
||||
if (!ItemConstants.isRechargeable(itemId)) {
|
||||
qty.set(0, qty.get(0) + item.left.getQuantity());
|
||||
} else {
|
||||
qty.add((int) item.left.getQuantity());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MapleClient c = chr.getClient();
|
||||
for(Entry<Integer, Short> it: rcvItems.entrySet()) {
|
||||
for(Entry<Integer, List<Integer>> it: rcvItems.entrySet()) {
|
||||
int itemType = rcvTypes.get(it.getKey()) - 1;
|
||||
int usedSlots = typesSlotsUsed.get(itemType);
|
||||
|
||||
int result = MapleInventoryManipulator.checkSpaceProgressively(c, it.getKey(), it.getValue(), "", usedSlots, useProofInv);
|
||||
boolean hasSpace = ((result % 2) != 0);
|
||||
|
||||
if(!hasSpace) return false;
|
||||
typesSlotsUsed.set(itemType, (result >> 1));
|
||||
for (Integer itValue : it.getValue()) {
|
||||
int usedSlots = typesSlotsUsed.get(itemType);
|
||||
|
||||
int result = MapleInventoryManipulator.checkSpaceProgressively(c, it.getKey(), itValue, "", usedSlots, useProofInv);
|
||||
boolean hasSpace = ((result % 2) != 0);
|
||||
|
||||
if(!hasSpace) return false;
|
||||
typesSlotsUsed.set(itemType, (result >> 1));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -525,38 +535,48 @@ public class MapleInventory implements Iterable<Item> {
|
||||
public static boolean checkSpotsAndOwnership(MapleCharacter chr, List<Pair<Item, MapleInventoryType>> items, List<Integer> typesSlotsUsed, boolean useProofInv) {
|
||||
//assumption: no "UNDEFINED" or "EQUIPPED" items shall be tested here, all counts are >= 0 and item list to be checked is a legal one.
|
||||
|
||||
Map<Long, Short> rcvItems = new LinkedHashMap<>();
|
||||
Map<Long, List<Integer>> rcvItems = new LinkedHashMap<>();
|
||||
Map<Long, Byte> rcvTypes = new LinkedHashMap<>();
|
||||
Map<Long, String> rcvOwners = new LinkedHashMap<>();
|
||||
|
||||
for (Pair<Item, MapleInventoryType> item : items) {
|
||||
Long itemHash = hashKey(item.left.getItemId(), item.left.getOwner());
|
||||
Short qty = rcvItems.get(itemHash);
|
||||
List<Integer> qty = rcvItems.get(itemHash);
|
||||
|
||||
if(qty == null) {
|
||||
rcvItems.put(itemHash, item.left.getQuantity());
|
||||
List<Integer> itemQtyList = new LinkedList<>();
|
||||
itemQtyList.add((int) item.left.getQuantity());
|
||||
|
||||
rcvItems.put(itemHash, itemQtyList);
|
||||
rcvTypes.put(itemHash, item.right.getType());
|
||||
rcvOwners.put(itemHash, item.left.getOwner());
|
||||
} else {
|
||||
rcvItems.put(itemHash, (short)(qty + item.left.getQuantity()));
|
||||
// thanks BHB88 for pointing out an issue with rechargeable items being stacked on inventory check
|
||||
if (!ItemConstants.isRechargeable(item.left.getItemId())) {
|
||||
qty.set(0, qty.get(0) + item.left.getQuantity());
|
||||
} else {
|
||||
qty.add((int) item.left.getQuantity());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MapleClient c = chr.getClient();
|
||||
for(Entry<Long, Short> it: rcvItems.entrySet()) {
|
||||
for(Entry<Long, List<Integer>> it: rcvItems.entrySet()) {
|
||||
int itemType = rcvTypes.get(it.getKey()) - 1;
|
||||
int usedSlots = typesSlotsUsed.get(itemType);
|
||||
int itemId = (int) (it.getKey() >> 32L);
|
||||
|
||||
Long itemId = it.getKey() >> 32L;
|
||||
|
||||
//System.out.print("inserting " + itemId.intValue() + " with type " + itemType + " qty " + it.getValue() + " owner '" + rcvOwners.get(it.getKey()) + "' current usedSlots:");
|
||||
//for(Integer i : typesSlotsUsed) System.out.print(" " + i);
|
||||
int result = MapleInventoryManipulator.checkSpaceProgressively(c, itemId.intValue(), it.getValue(), rcvOwners.get(it.getKey()), usedSlots, useProofInv);
|
||||
boolean hasSpace = ((result % 2) != 0);
|
||||
//System.out.print(" -> hasSpace: " + hasSpace + " RESULT : " + result + "\n");
|
||||
|
||||
if(!hasSpace) return false;
|
||||
typesSlotsUsed.set(itemType, (result >> 1));
|
||||
for (Integer itValue : it.getValue()) {
|
||||
int usedSlots = typesSlotsUsed.get(itemType);
|
||||
|
||||
//System.out.print("inserting " + itemId.intValue() + " with type " + itemType + " qty " + it.getValue() + " owner '" + rcvOwners.get(it.getKey()) + "' current usedSlots:");
|
||||
//for(Integer i : typesSlotsUsed) System.out.print(" " + i);
|
||||
int result = MapleInventoryManipulator.checkSpaceProgressively(c, itemId, itValue, rcvOwners.get(it.getKey()), usedSlots, useProofInv);
|
||||
boolean hasSpace = ((result % 2) != 0);
|
||||
//System.out.print(" -> hasSpace: " + hasSpace + " RESULT : " + result + "\n");
|
||||
|
||||
if(!hasSpace) return false;
|
||||
typesSlotsUsed.set(itemType, (result >> 1));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -316,7 +316,11 @@ public class MapleInventoryManipulator {
|
||||
if (!type.equals(MapleInventoryType.EQUIP)) {
|
||||
short slotMax = ii.getSlotMax(c, itemid);
|
||||
List<Item> existing = inv.listById(itemid);
|
||||
if (!ItemConstants.isRechargeable(itemid)) {
|
||||
|
||||
final int numSlotsNeeded;
|
||||
if (ItemConstants.isRechargeable(itemid)) {
|
||||
numSlotsNeeded = 1;
|
||||
} else {
|
||||
if (existing.size() > 0) // first update all existing slots to slotMax
|
||||
{
|
||||
for (Item eItem : existing) {
|
||||
@@ -330,15 +334,14 @@ public class MapleInventoryManipulator {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (slotMax > 0) {
|
||||
numSlotsNeeded = (int) (Math.ceil(((double) quantity) / slotMax));
|
||||
} else {
|
||||
numSlotsNeeded = 1;
|
||||
}
|
||||
}
|
||||
final int numSlotsNeeded;
|
||||
if (slotMax > 0) {
|
||||
numSlotsNeeded = (int) (Math.ceil(((double) quantity) / slotMax));
|
||||
} else if (ItemConstants.isRechargeable(itemid)) {
|
||||
numSlotsNeeded = 1;
|
||||
} else {
|
||||
numSlotsNeeded = 1;
|
||||
}
|
||||
|
||||
return !inv.isFull(numSlotsNeeded - 1);
|
||||
} else {
|
||||
return !inv.isFull();
|
||||
@@ -367,7 +370,11 @@ public class MapleInventoryManipulator {
|
||||
|
||||
if (!type.equals(MapleInventoryType.EQUIP)) {
|
||||
short slotMax = ii.getSlotMax(c, itemid);
|
||||
if (!ItemConstants.isRechargeable(itemid)) {
|
||||
final int numSlotsNeeded;
|
||||
|
||||
if (ItemConstants.isRechargeable(itemid)) {
|
||||
numSlotsNeeded = 1;
|
||||
} else {
|
||||
List<Item> existing = inv.listById(itemid);
|
||||
|
||||
if (existing.size() > 0) // first update all existing slots to slotMax
|
||||
@@ -383,14 +390,12 @@ public class MapleInventoryManipulator {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
final int numSlotsNeeded;
|
||||
if (slotMax > 0) {
|
||||
numSlotsNeeded = (int) (Math.ceil(((double) quantity) / slotMax));
|
||||
} else if (ItemConstants.isRechargeable(itemid)) {
|
||||
numSlotsNeeded = 1;
|
||||
} else {
|
||||
numSlotsNeeded = 1;
|
||||
|
||||
if (slotMax > 0) {
|
||||
numSlotsNeeded = (int) (Math.ceil(((double) quantity) / slotMax));
|
||||
} else {
|
||||
numSlotsNeeded = 1;
|
||||
}
|
||||
}
|
||||
|
||||
returnValue = ((numSlotsNeeded + usedSlots) << 1);
|
||||
|
||||
@@ -100,7 +100,7 @@ public class FredrickProcessor {
|
||||
return msg;
|
||||
}
|
||||
|
||||
private static void removeFredrickLog(int cid) {
|
||||
public static void removeFredrickLog(int cid) {
|
||||
try {
|
||||
Connection con = DatabaseConnection.getConnection();
|
||||
removeFredrickLog(con, cid);
|
||||
|
||||
@@ -147,6 +147,7 @@ public class StorageProcessor {
|
||||
|
||||
chr.gainMeso(-storeFee, false, true, false);
|
||||
|
||||
item = item.copy(); // thanks Robin Schulz for pointing out an issue with stored items
|
||||
MapleKarmaManipulator.toggleKarmaFlagToUntradeable(item);
|
||||
item.setQuantity(quantity);
|
||||
storage.store(item);
|
||||
|
||||
Reference in New Issue
Block a user