Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d22d9b603b | ||
|
|
16b0a36c86 | ||
|
|
db82cbcfae | ||
|
|
0d684c1400 |
@@ -41,6 +41,7 @@ public class CashShopSurpriseHandler extends AbstractPacketHandler {
|
||||
if (cssResult != null) {
|
||||
Item cssItem = cssResult.getLeft(), cssBox = cssResult.getRight();
|
||||
c.sendPacket(PacketCreator.onCashGachaponOpenSuccess(c.getAccID(), cssBox.getSN(), cssBox.getQuantity(), cssItem, cssItem.getItemId(), cssItem.getQuantity(), true));
|
||||
c.sendPacket(PacketCreator.showCashInventory(c));
|
||||
} else {
|
||||
c.sendPacket(PacketCreator.onCashItemGachaponOpenFailed());
|
||||
}
|
||||
|
||||
@@ -278,6 +278,10 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
||||
getPlayer().gainMeso(gain);
|
||||
}
|
||||
|
||||
public void gainMeso(Double gain) {
|
||||
getPlayer().gainMeso(gain.intValue());
|
||||
}
|
||||
|
||||
public void gainExp(int gain) {
|
||||
getPlayer().gainExp(gain, true, true);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ import provider.DataProviderFactory;
|
||||
import provider.DataTool;
|
||||
import provider.wz.WZFiles;
|
||||
import tools.DatabaseConnection;
|
||||
import tools.PacketCreator;
|
||||
import tools.Pair;
|
||||
|
||||
import java.sql.Connection;
|
||||
@@ -407,6 +408,17 @@ public class CashShop {
|
||||
}
|
||||
}
|
||||
|
||||
public int getItemsSize() {
|
||||
int size = 0;
|
||||
lock.lock();
|
||||
try {
|
||||
size = inventory.size();
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
public List<Integer> getWishList() {
|
||||
return wishList;
|
||||
}
|
||||
@@ -544,14 +556,14 @@ public class CashShop {
|
||||
Item css = getCashShopItemByItemid(ItemId.CASH_SHOP_SURPRISE);
|
||||
|
||||
if (css != null) {
|
||||
if (getItemsSize() >= 100) {
|
||||
return null;
|
||||
}
|
||||
|
||||
CashItem cItem = CashItemFactory.getRandomCashItem();
|
||||
|
||||
if (cItem != null) {
|
||||
if (css.getQuantity() > 1) {
|
||||
/* if(NOT ENOUGH SPACE) { looks like we're not dealing with cash inventory limit whatsoever, k then
|
||||
return null;
|
||||
} */
|
||||
|
||||
css.setQuantity((short) (css.getQuantity() - 1));
|
||||
} else {
|
||||
removeFromInventory(css);
|
||||
|
||||
Reference in New Issue
Block a user