Index: java/org/l2jmobius/gameserver/network/serverpackets/crossevent/ExCrossEventInfo.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- java/org/l2jmobius/gameserver/network/serverpackets/crossevent/ExCrossEventInfo.java (date 1724226356486)
+++ java/org/l2jmobius/gameserver/network/serverpackets/crossevent/ExCrossEventInfo.java (date 1724226356486)
@@ -21,9 +21,11 @@
import org.l2jmobius.commons.network.WritableBuffer;
import org.l2jmobius.gameserver.data.xml.CrossEventData;
import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.holders.CrossEventHolder;
import org.l2jmobius.gameserver.model.holders.CrossEventNormalRewardHolder;
+import org.l2jmobius.gameserver.model.itemcontainer.ItemContainer;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.ServerPackets;
import org.l2jmobius.gameserver.network.serverpackets.ServerPacket;
@@ -34,11 +36,18 @@
int ITEM_TO_PLAY_ID = Inventory.EINHASAD_COIN_ID;
private final Player _player;
final List<CrossEventNormalRewardHolder> cellRewards;
-
+
+ int _einhasadCoinCount = 0;
+
public ExCrossEventInfo(Player player)
{
_player = player;
cellRewards = CrossEventData.getInstance().getCellRewards();
+
+ Item einhasadCoin = _player.getInventory().getItemByItemId(ITEM_TO_PLAY_ID);
+ if (einhasadCoin != null) {
+ _einhasadCoinCount = (int) einhasadCoin.getCount();
+ }
}
@Override
@@ -48,8 +57,8 @@
buffer.writeByte(1); // bOnEvent
buffer.writeInt(0); // <_CrossBlock> blocks
-
- buffer.writeInt((int) _player.getInventory().getItemByItemId(ITEM_TO_PLAY_ID).getCount()); // nCoupon
+
+ buffer.writeInt(_einhasadCoinCount); // nCoupon
buffer.writeInt(_player.getCrossRewards()); // nRareRewardCnt