public virtual void RawEncode(COutPacket p, bool bFromCS = false) { p.Encode4(nItemID); var bCashItem = liCashItemSN != 0; p.Encode1(bCashItem); // ring equips have to have their unique ID sent instead of the cash ID // but not during the locker -> storage transaction in the cash shop // not pretty but it works ok if (!bFromCS && (ItemConstants.is_friendship_equip_item(nItemID) || ItemConstants.is_couple_equip_item(nItemID) || ItemConstants.is_wedding_ring_item(nItemID))) { p.Encode8(liSN); } else { if (bCashItem) { p.Encode8(liCashItemSN); } } p.EncodeDateTime(tDateExpire); }
public void EncodeEquippedRings(COutPacket p) { #region COUPLE_RING p.Encode1(0); // TODO #endregion #region FRIENDSHIP_RING GW_FriendRecord pFriendshipRing = null; var nFriendshipRingID = 0; long nFriendShipSN = 0; for (var bp = BodyPart.BP_RING1; bp < BodyPart.BP_RING4; bp++) { var item = InventoryManipulator.GetItem(Parent, bp, true); if (item is null) { continue; } if (ItemConstants.is_friendship_equip_item(item.nItemID)) { pFriendshipRing = lFriendRecord.FirstOrDefault(ring => ring.liSN == item.liSN); break; } } p.Encode1(pFriendshipRing != null); if (pFriendshipRing != null) { p.Encode8(pFriendshipRing.liSN); p.Encode8(pFriendshipRing.liPairSN); p.Encode4(pFriendshipRing.dwFriendItemID); } #endregion #region MARRIAGE_RING p.Encode1(0); // TODO #endregion }