public CShopItem(int nItemId, int nPrice, short nQuantity = 1) { Template = MasterManager.ItemTemplate(nItemId); nItemID = nItemId; nMaxPerSlot = (short)Template.SlotMax; this.nPrice = nPrice; this.nQuantity = ItemConstants.IsArrow(nItemId) || ItemConstants.IsBullet(nItemId) || ItemConstants.IsThrowingStar(nItemId) ? nMaxPerSlot : nQuantity; if (Template is ConsumeItemTemplate consumeTemplate) { dUnitPrice = consumeTemplate.UnitPrice; } }
public CShopItem(int nItemId) { Template = MasterManager.ItemTemplate(nItemId); nItemID = nItemId; nMaxPerSlot = (short)Template.SlotMax; if (ItemConstants.IsArrow(nItemId) || ItemConstants.IsBullet(nItemId) || ItemConstants.IsThrowingStar(nItemId)) { nQuantity = nMaxPerSlot; } else { nQuantity = 1; } if (Template is ConsumeItemTemplate consumeTemplate) { dUnitPrice = consumeTemplate.UnitPrice; } }