Pet Snail expiration + Scripted portal sound effects
Fixed pet Snail not expiring properly (being removed from inventory when the time's up). Broadcasted code update for most of the missing portal sound effects for portal scripts. It is expected for all scripted portals now to play the sound effect when traversing it.
This commit is contained in:
@@ -2308,7 +2308,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
item.setExpiration(-1);
|
||||
forceUpdateItem(item); //TEST :3
|
||||
} else if (expiration != -1 && expiration < currenttime) {
|
||||
if(!ItemConstants.isPet(item.getItemId()) || ServerConstants.USE_ERASE_PET_ON_EXPIRATION) {
|
||||
if(!ItemConstants.isPet(item.getItemId()) || ItemConstants.isExpirablePet(item.getItemId())) {
|
||||
client.announce(MaplePacketCreator.itemExpired(item.getItemId()));
|
||||
toberemove.add(item);
|
||||
if(ItemConstants.isRateCoupon(item.getItemId())) {
|
||||
@@ -2321,7 +2321,10 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
}
|
||||
}
|
||||
for (Item item : toberemove) {
|
||||
if(item.getPetId() > -1) unequipPet(getPet(getPetIndex(item.getPetId())), true);
|
||||
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);
|
||||
}
|
||||
toberemove.clear();
|
||||
|
||||
@@ -93,6 +93,10 @@ public final class ItemConstants {
|
||||
return itemId / 1000 == 5000;
|
||||
}
|
||||
|
||||
public static boolean isExpirablePet(int itemId) {
|
||||
return ServerConstants.USE_ERASE_PET_ON_EXPIRATION || itemId == 5000054;
|
||||
}
|
||||
|
||||
public static boolean isNewYearCardEtc(int itemId) {
|
||||
return itemId / 10000 == 430;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user