Extra MP gain & Expired pet patch
Fixed "extra MaxMP gain with INT accounting" being given to a leveled up character even when the flag USE_RANDOMIZE_HPMP_GAIN is set to false. Solved an issue with pets upon expiration, that would render the pet no longer being able to be unequipped until WoL applied.
This commit is contained in:
11
README.md
11
README.md
@@ -25,9 +25,18 @@ Recommended localhost: https://hostr.co/r5QDmhlxpp8M
|
|||||||
* MapleSilver's starting on window-mode, with some string fixes. This is a variation of Fraysa's https://hostr.co/gJbLZITRVHmv
|
* MapleSilver's starting on window-mode, with some string fixes. This is a variation of Fraysa's https://hostr.co/gJbLZITRVHmv
|
||||||
|
|
||||||
---
|
---
|
||||||
|
### Support us
|
||||||
|
|
||||||
|
Feel free to __root for us__ on our endeavour at our Discord channel, or even actively **help us improve** the server by issuing pull requests with informative details about what's changing.
|
||||||
|
|
||||||
|
Also, if you liked this project, please don't forget to __star__ the repo ;) .
|
||||||
|
|
||||||
|
Discord: https://discord.gg/Q7wKxHX
|
||||||
|
|
||||||
### Donation
|
### Donation
|
||||||
|
|
||||||
If you liked what you have seen on the project, donate a little something as a helping hand for my contributions towards Maple development.
|
If you REALLY liked what you have seen on the project, please feel free to donate a little something as a helping hand for my contributions towards Maple development. Also remember to **support Nexon**!
|
||||||
|
|
||||||
Paypal: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3K8KVTWRLFBQ4
|
Paypal: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3K8KVTWRLFBQ4
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -822,3 +822,7 @@ Resolvido caso de deadlock no MapleMap (uso de broadcastMessage, que usa chrLock
|
|||||||
Refatorado dano/cura em mobs, agora encapsulando atomicamente as mudanças de HP. Resolvido também problemas de acesso concorrente quanto a isso.
|
Refatorado dano/cura em mobs, agora encapsulando atomicamente as mudanças de HP. Resolvido também problemas de acesso concorrente quanto a isso.
|
||||||
Resolvido problemas com HT e danos de status poison, bagunçando as contabilizações de HP de vez em quando.
|
Resolvido problemas com HT e danos de status poison, bagunçando as contabilizações de HP de vez em quando.
|
||||||
Nova PQ: TreasurePQ, level 140+, acessível via portal em NLC.
|
Nova PQ: TreasurePQ, level 140+, acessível via portal em NLC.
|
||||||
|
|
||||||
|
08 Março 2018,
|
||||||
|
Corrigido levelup contabilizando o stat INT nos ganhos de MP mesmo quando a flag USE_RANDOMIZE_HPMP_GAIN está desativada.
|
||||||
|
Aprimorado comando de item/drop agora permitindo gerar pets.
|
||||||
@@ -60,7 +60,6 @@ function action(mode, type, selection) {
|
|||||||
|
|
||||||
switch(cm.getPlayer().getMapId()) {
|
switch(cm.getPlayer().getMapId()) {
|
||||||
case 920010000:
|
case 920010000:
|
||||||
print(eim.getIntProperty("statusStg0"));
|
|
||||||
if(eim.getIntProperty("statusStg0") != 1) {
|
if(eim.getIntProperty("statusStg0") != 1) {
|
||||||
eim.warpEventTeamToMapSpawnPoint(920010000, 2);
|
eim.warpEventTeamToMapSpawnPoint(920010000, 2);
|
||||||
eim.giveEventPlayersExp(3500);
|
eim.giveEventPlayersExp(3500);
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ function end(mode, type, selection) {
|
|||||||
qm.evolvePet(i, after);
|
qm.evolvePet(i, after);
|
||||||
// var petId = MaplePet.createPet(rand + 5000049, level, closeness, fullness);
|
// var petId = MaplePet.createPet(rand + 5000049, level, closeness, fullness);
|
||||||
// if (petId == -1) return;
|
// if (petId == -1) return;
|
||||||
// MapleInventoryManipulator.addById(qm.getClient(), rand+5000049, 1, null, petId);
|
// MapleInventoryManipulator.addById(qm.getClient(), rand+5000049, 1, "", petId);
|
||||||
} else
|
} else
|
||||||
qm.dropMessage(1,"Your inventory is full");
|
qm.dropMessage(1,"Your inventory is full");
|
||||||
qm.dispose();
|
qm.dispose();
|
||||||
|
|||||||
@@ -2308,23 +2308,29 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
|||||||
item.setExpiration(-1);
|
item.setExpiration(-1);
|
||||||
forceUpdateItem(item); //TEST :3
|
forceUpdateItem(item); //TEST :3
|
||||||
} else if (expiration != -1 && expiration < currenttime) {
|
} else if (expiration != -1 && expiration < currenttime) {
|
||||||
if(!ItemConstants.isPet(item.getItemId()) || ItemConstants.isExpirablePet(item.getItemId())) {
|
if(!ItemConstants.isPet(item.getItemId())) {
|
||||||
client.announce(MaplePacketCreator.itemExpired(item.getItemId()));
|
client.announce(MaplePacketCreator.itemExpired(item.getItemId()));
|
||||||
toberemove.add(item);
|
toberemove.add(item);
|
||||||
if(ItemConstants.isRateCoupon(item.getItemId())) {
|
if(ItemConstants.isRateCoupon(item.getItemId())) {
|
||||||
deletedCoupon = true;
|
deletedCoupon = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
item.setExpiration(-1);
|
if(item.getPetId() > -1) {
|
||||||
forceUpdateItem(item);
|
int petIdx = getPetIndex(item.getPetId());
|
||||||
|
if(petIdx > -1) unequipPet(getPet(petIdx), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ItemConstants.isExpirablePet(item.getItemId())) {
|
||||||
|
client.announce(MaplePacketCreator.itemExpired(item.getItemId()));
|
||||||
|
toberemove.add(item);
|
||||||
|
} else {
|
||||||
|
item.setExpiration(-1);
|
||||||
|
forceUpdateItem(item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Item item : toberemove) {
|
for (Item item : toberemove) {
|
||||||
if(item.getPetId() > -1) {
|
|
||||||
int petIdx = getPetIndex(item.getPetId());
|
|
||||||
if(petIdx > -1) unequipPet(getPet(petIdx), true);
|
|
||||||
}
|
|
||||||
MapleInventoryManipulator.removeFromSlot(client, inv.getType(), item.getPosition(), item.getQuantity(), true);
|
MapleInventoryManipulator.removeFromSlot(client, inv.getType(), item.getPosition(), item.getQuantity(), true);
|
||||||
}
|
}
|
||||||
toberemove.clear();
|
toberemove.clear();
|
||||||
@@ -4880,7 +4886,15 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
|||||||
if (improvingMaxMPLevel > 0 && (job.isA(MapleJob.MAGICIAN) || job.isA(MapleJob.CRUSADER) || job.isA(MapleJob.BLAZEWIZARD1))) {
|
if (improvingMaxMPLevel > 0 && (job.isA(MapleJob.MAGICIAN) || job.isA(MapleJob.CRUSADER) || job.isA(MapleJob.BLAZEWIZARD1))) {
|
||||||
maxmp += improvingMaxMP.getEffect(improvingMaxMPLevel).getX();
|
maxmp += improvingMaxMP.getEffect(improvingMaxMPLevel).getX();
|
||||||
}
|
}
|
||||||
maxmp += localint_ / 10;
|
|
||||||
|
if (ServerConstants.USE_RANDOMIZE_HPMP_GAIN) {
|
||||||
|
if (job.isA(MapleJob.MAGICIAN) || job.isA(MapleJob.BLAZEWIZARD1)) {
|
||||||
|
maxmp += localint_ / 20;
|
||||||
|
} else {
|
||||||
|
maxmp += localint_ / 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (takeexp) {
|
if (takeexp) {
|
||||||
exp.addAndGet(-ExpTable.getExpNeededForLevel(level));
|
exp.addAndGet(-ExpTable.getExpNeededForLevel(level));
|
||||||
if (exp.get() < 0) {
|
if (exp.get() < 0) {
|
||||||
|
|||||||
@@ -474,7 +474,7 @@ public class Commands {
|
|||||||
ps.close();
|
ps.close();
|
||||||
con.close();
|
con.close();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
player.dropMessage("There was a problem retreiving the required data. Please try again.");
|
player.dropMessage(6, "There was a problem retrieving the required data. Please try again.");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -602,7 +602,7 @@ public class Commands {
|
|||||||
|
|
||||||
player.changeMap(event.getMapId());
|
player.changeMap(event.getMapId());
|
||||||
} else {
|
} else {
|
||||||
player.dropMessage("The limit of players for the event has already been reached.");
|
player.dropMessage(5, "The limit of players for the event has already been reached.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.dropMessage(5, "You are already in the event.");
|
player.dropMessage(5, "You are already in the event.");
|
||||||
@@ -1060,7 +1060,7 @@ public class Commands {
|
|||||||
//victim.getEventInstance().registerPlayer(player);
|
//victim.getEventInstance().registerPlayer(player);
|
||||||
player.changeMap(victim.getEventInstance().getMapInstance(victim.getMapId()), victim.getMap().findClosestPortal(victim.getPosition()));
|
player.changeMap(victim.getEventInstance().getMapInstance(victim.getMapId()), victim.getMap().findClosestPortal(victim.getPosition()));
|
||||||
} else {
|
} else {
|
||||||
player.dropMessage("Please change to channel " + victim.getClient().getChannel());
|
player.dropMessage(6, "Please change to channel " + victim.getClient().getChannel());
|
||||||
}
|
}
|
||||||
} else {//If victim isn't in an event instance, just warp them.
|
} else {//If victim isn't in an event instance, just warp them.
|
||||||
player.changeMap(victim.getMapId(), victim.getMap().findClosestPortal(victim.getPosition()));
|
player.changeMap(victim.getMapId(), victim.getMap().findClosestPortal(victim.getPosition()));
|
||||||
@@ -1070,7 +1070,7 @@ public class Commands {
|
|||||||
player.getClient().changeChannel(victim.getClient().getChannel());
|
player.getClient().changeChannel(victim.getClient().getChannel());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.dropMessage("Unknown player.");
|
player.dropMessage(6, "Unknown player.");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1117,7 +1117,7 @@ public class Commands {
|
|||||||
victim.getClient().changeChannel(player.getClient().getChannel());
|
victim.getClient().changeChannel(player.getClient().getChannel());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.dropMessage("Unknown player.");
|
player.dropMessage(6, "Unknown player.");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1130,13 +1130,13 @@ public class Commands {
|
|||||||
victim = c.getWorldServer().getPlayerStorage().getCharacterByName(sub[1]);
|
victim = c.getWorldServer().getPlayerStorage().getCharacterByName(sub[1]);
|
||||||
if(victim != null && victim.isLoggedin()) {
|
if(victim != null && victim.isLoggedin()) {
|
||||||
if (player.getClient().getChannel() != victim.getClient().getChannel()) {
|
if (player.getClient().getChannel() != victim.getClient().getChannel()) {
|
||||||
player.dropMessage("Player '" + victim.getName() + "' is at channel " + victim.getClient().getChannel() + ".");
|
player.dropMessage(5, "Player '" + victim.getName() + "' is at channel " + victim.getClient().getChannel() + ".");
|
||||||
} else {
|
} else {
|
||||||
MapleMap map = victim.getMap();
|
MapleMap map = victim.getMap();
|
||||||
player.changeMap(map, map.findClosestPortal(victim.getPosition()));
|
player.changeMap(map, map.findClosestPortal(victim.getPosition()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.dropMessage("Unknown player.");
|
player.dropMessage(6, "Unknown player.");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1156,31 +1156,65 @@ public class Commands {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int itemId = Integer.parseInt(sub[1]);
|
int itemId = Integer.parseInt(sub[1]);
|
||||||
if(MapleItemInformationProvider.getInstance().getName(itemId) == null) {
|
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||||
|
|
||||||
|
if(ii.getName(itemId) == null) {
|
||||||
player.yellowMessage("Item id '" + sub[1] + "' does not exist.");
|
player.yellowMessage("Item id '" + sub[1] + "' does not exist.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
short quantity = 1;
|
short quantity = 1;
|
||||||
if(sub.length >= 3) quantity = Short.parseShort(sub[2]);
|
if(sub.length >= 3) quantity = Short.parseShort(sub[2]);
|
||||||
|
|
||||||
if (ItemConstants.isPet(itemId)) {
|
if (ServerConstants.BLOCK_GENERATE_CASH_ITEM && ii.isCash(itemId)) {
|
||||||
player.message("You cannot create a pet with this command.");
|
player.yellowMessage("You cannot create a cash item with this command.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ItemConstants.isPet(itemId)) {
|
||||||
|
if (sub.length >= 3){ // thanks to istreety & TacoBell
|
||||||
|
quantity = 1;
|
||||||
|
long days = Math.max(1, Integer.parseInt(sub[2]));
|
||||||
|
long expiration = System.currentTimeMillis() + (days * 24 * 60 * 60 * 1000);
|
||||||
|
int petid = MaplePet.createPet(itemId);
|
||||||
|
|
||||||
|
if(sub[0].equals("item")) {
|
||||||
|
MapleInventoryManipulator.addById(c, itemId, quantity, player.getName(), petid, expiration);
|
||||||
|
} else {
|
||||||
|
Item toDrop = new Item(itemId, (short) 0, quantity, petid);
|
||||||
|
toDrop.setExpiration(expiration);
|
||||||
|
|
||||||
|
toDrop.setOwner("");
|
||||||
|
if(player.gmLevel() < 3) {
|
||||||
|
byte b = toDrop.getFlag();
|
||||||
|
b |= ItemConstants.ACCOUNT_SHARING;
|
||||||
|
b |= ItemConstants.UNTRADEABLE;
|
||||||
|
|
||||||
|
toDrop.setFlag(b);
|
||||||
|
}
|
||||||
|
|
||||||
|
c.getPlayer().getMap().spawnItemDrop(c.getPlayer(), c.getPlayer(), toDrop, c.getPlayer().getPosition(), true, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
player.yellowMessage("Pet Syntax: !item <itemid> <expiration>");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (sub[0].equals("item")) {
|
if (sub[0].equals("item")) {
|
||||||
byte flag = 0;
|
byte flag = 0;
|
||||||
if(player.gmLevel() < 3) {
|
if(player.gmLevel() < 3) {
|
||||||
flag |= ItemConstants.ACCOUNT_SHARING;
|
flag |= ItemConstants.ACCOUNT_SHARING;
|
||||||
flag |= ItemConstants.UNTRADEABLE;
|
flag |= ItemConstants.UNTRADEABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
MapleInventoryManipulator.addById(c, itemId, quantity, player.getName(), -1, flag, -1);
|
MapleInventoryManipulator.addById(c, itemId, quantity, player.getName(), -1, flag, -1);
|
||||||
} else {
|
} else {
|
||||||
Item toDrop;
|
Item toDrop;
|
||||||
if (ItemConstants.getInventoryType(itemId) == MapleInventoryType.EQUIP) {
|
if (ItemConstants.getInventoryType(itemId) == MapleInventoryType.EQUIP) {
|
||||||
toDrop = MapleItemInformationProvider.getInstance().getEquipById(itemId);
|
toDrop = ii.getEquipById(itemId);
|
||||||
} else {
|
} else {
|
||||||
toDrop = new Item(itemId, (short) 0, quantity);
|
toDrop = new Item(itemId, (short) 0, quantity);
|
||||||
}
|
}
|
||||||
@@ -1659,8 +1693,8 @@ public class Commands {
|
|||||||
float xpos = player.getPosition().x;
|
float xpos = player.getPosition().x;
|
||||||
float ypos = player.getPosition().y;
|
float ypos = player.getPosition().y;
|
||||||
float fh = player.getMap().getFootholds().findBelow(player.getPosition()).getId();
|
float fh = player.getMap().getFootholds().findBelow(player.getPosition()).getId();
|
||||||
player.dropMessage("Position: (" + xpos + ", " + ypos + ")");
|
player.dropMessage(6, "Position: (" + xpos + ", " + ypos + ")");
|
||||||
player.dropMessage("Foothold ID: " + fh);
|
player.dropMessage(6, "Foothold ID: " + fh);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "togglecoupon":
|
case "togglecoupon":
|
||||||
@@ -1853,7 +1887,7 @@ public class Commands {
|
|||||||
map.damageMonster(player, monster, Integer.MAX_VALUE);
|
map.damageMonster(player, monster, Integer.MAX_VALUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.dropMessage("Killed " + monsters.size() + " monsters.");
|
player.dropMessage(5, "Killed " + monsters.size() + " monsters.");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "notice":
|
case "notice":
|
||||||
@@ -2196,7 +2230,7 @@ public class Commands {
|
|||||||
hardsetItemStats((Equip) it, multiply);
|
hardsetItemStats((Equip) it, multiply);
|
||||||
MapleInventoryManipulator.addFromDrop(c, it);
|
MapleInventoryManipulator.addFromDrop(c, it);
|
||||||
} else {
|
} else {
|
||||||
player.dropMessage("Make sure it's an equippable item.");
|
player.dropMessage(6, "Make sure it's an equippable item.");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -84,6 +84,9 @@ public class ServerConstants {
|
|||||||
|
|
||||||
public static final int PARTY_EXPERIENCE_MOD = 1; //Change for event stuff.
|
public static final int PARTY_EXPERIENCE_MOD = 1; //Change for event stuff.
|
||||||
|
|
||||||
|
//Commands Configuration
|
||||||
|
public static final boolean BLOCK_GENERATE_CASH_ITEM = false; //Prevents creation of cash items with the item/drop command.
|
||||||
|
|
||||||
//Miscellaneous Configuration
|
//Miscellaneous Configuration
|
||||||
public static final byte MIN_UNDERLEVEL_TO_EXP_GAIN = 5; //Characters are unable to get EXP from a mob if their level are under this threshold, only if "USE_ENFORCE_MOB_LEVEL_RANGE" is enabled. For bosses, this attribute is doubled.
|
public static final byte MIN_UNDERLEVEL_TO_EXP_GAIN = 5; //Characters are unable to get EXP from a mob if their level are under this threshold, only if "USE_ENFORCE_MOB_LEVEL_RANGE" is enabled. For bosses, this attribute is doubled.
|
||||||
public static final byte MAX_MONITORED_BUFFSTATS = 5; //Limits accounting for "dormant" buff effects, that should take place when stronger stat buffs expires.
|
public static final byte MAX_MONITORED_BUFFSTATS = 5; //Limits accounting for "dormant" buff effects, that should take place when stronger stat buffs expires.
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public final class DistributeAPHandler extends AbstractMaplePacketHandler {
|
|||||||
return MaxHP + calcHpChange(player, job, usedAPReset);
|
return MaxHP + calcHpChange(player, job, usedAPReset);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int calcHpChange(MapleCharacter player, MapleJob job, boolean usedAPReset) {
|
private static int calcHpChange(MapleCharacter player, MapleJob job, boolean usedAPReset) {
|
||||||
int MaxHP = 0;
|
int MaxHP = 0;
|
||||||
|
|
||||||
if (job.isA(MapleJob.WARRIOR) || job.isA(MapleJob.DAWNWARRIOR1)) {
|
if (job.isA(MapleJob.WARRIOR) || job.isA(MapleJob.DAWNWARRIOR1)) {
|
||||||
@@ -207,7 +207,7 @@ public final class DistributeAPHandler extends AbstractMaplePacketHandler {
|
|||||||
return MaxMP + calcMpChange(player, job, usedAPReset);
|
return MaxMP + calcMpChange(player, job, usedAPReset);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int calcMpChange(MapleCharacter player, MapleJob job, boolean usedAPReset) {
|
private static int calcMpChange(MapleCharacter player, MapleJob job, boolean usedAPReset) {
|
||||||
int MaxMP = 0;
|
int MaxMP = 0;
|
||||||
|
|
||||||
if (job.isA(MapleJob.WARRIOR) || job.isA(MapleJob.DAWNWARRIOR1) || job.isA(MapleJob.ARAN1)) {
|
if (job.isA(MapleJob.WARRIOR) || job.isA(MapleJob.DAWNWARRIOR1) || job.isA(MapleJob.ARAN1)) {
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class MapleInventoryManipulator {
|
|||||||
if (!type.equals(MapleInventoryType.EQUIP)) {
|
if (!type.equals(MapleInventoryType.EQUIP)) {
|
||||||
short slotMax = ii.getSlotMax(c, itemId);
|
short slotMax = ii.getSlotMax(c, itemId);
|
||||||
List<Item> existing = c.getPlayer().getInventory(type).listById(itemId);
|
List<Item> existing = c.getPlayer().getInventory(type).listById(itemId);
|
||||||
if (!ItemConstants.isRechargable(itemId)) {
|
if (!ItemConstants.isRechargable(itemId) && petid == -1) {
|
||||||
if (existing.size() > 0) { // first update all existing slots to slotMax
|
if (existing.size() > 0) { // first update all existing slots to slotMax
|
||||||
Iterator<Item> i = existing.iterator();
|
Iterator<Item> i = existing.iterator();
|
||||||
while (quantity > 0) {
|
while (quantity > 0) {
|
||||||
@@ -151,7 +151,7 @@ public class MapleInventoryManipulator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean addFromDrop(MapleClient c, Item item, boolean show) {
|
public static boolean addFromDrop(MapleClient c, Item item, boolean show) {
|
||||||
return addFromDrop(c, item, show, -1);
|
return addFromDrop(c, item, show, item.getPetId());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean addFromDrop(MapleClient c, Item item, boolean show, int petId) {
|
public static boolean addFromDrop(MapleClient c, Item item, boolean show, int petId) {
|
||||||
@@ -166,7 +166,7 @@ public class MapleInventoryManipulator {
|
|||||||
if (!type.equals(MapleInventoryType.EQUIP)) {
|
if (!type.equals(MapleInventoryType.EQUIP)) {
|
||||||
short slotMax = ii.getSlotMax(c, item.getItemId());
|
short slotMax = ii.getSlotMax(c, item.getItemId());
|
||||||
List<Item> existing = c.getPlayer().getInventory(type).listById(item.getItemId());
|
List<Item> existing = c.getPlayer().getInventory(type).listById(item.getItemId());
|
||||||
if (!ItemConstants.isRechargable(item.getItemId())) {
|
if (!ItemConstants.isRechargable(item.getItemId()) && petId == -1) {
|
||||||
if (existing.size() > 0) { // first update all existing slots to slotMax
|
if (existing.size() > 0) { // first update all existing slots to slotMax
|
||||||
Iterator<Item> i = existing.iterator();
|
Iterator<Item> i = existing.iterator();
|
||||||
while (quantity > 0) {
|
while (quantity > 0) {
|
||||||
@@ -202,6 +202,8 @@ public class MapleInventoryManipulator {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Item nItem = new Item(item.getItemId(), (short) 0, quantity, petId);
|
Item nItem = new Item(item.getItemId(), (short) 0, quantity, petId);
|
||||||
|
nItem.setExpiration(item.getExpiration());
|
||||||
|
|
||||||
short newSlot = c.getPlayer().getInventory(type).addItem(nItem);
|
short newSlot = c.getPlayer().getInventory(type).addItem(nItem);
|
||||||
if (newSlot == -1) {
|
if (newSlot == -1) {
|
||||||
c.announce(MaplePacketCreator.getInventoryFull());
|
c.announce(MaplePacketCreator.getInventoryFull());
|
||||||
|
|||||||
Reference in New Issue
Block a user