@Yuuroido Using Nexon's ModifiedCommodity packet (portion within OnSetCashShop) you can modify anything and everything for each Commodity in the CS that you want :). Just needs a flag and its updated value and it'll use that, it's a nice way to make certain packages go OnSale along with taking them off. Also useful if you want to mess around with the prices/count or other stuff xD
PHP Code:
public void EncodeModifiedData(OutPacket oPacket) {
oPacket.Encode4(dwModifiedFlag);
if ((dwModifiedFlag & ItemID) > 0) {
oPacket.Encode4(nItemId);
}
if ((dwModifiedFlag & Count) > 0) {
oPacket.Encode2(nCount);
}
if ((dwModifiedFlag & Price) > 0) {
oPacket.Encode4(nPrice);
}
if ((dwModifiedFlag & Bonus) > 0) {
oPacket.Encode1(bBonus);
}
if ((dwModifiedFlag & Priority) > 0) {
oPacket.Encode1(nPriority);
}
if ((dwModifiedFlag & Period) > 0) {
oPacket.Encode2(nPeriod);
}
if ((dwModifiedFlag & MaplePoint) > 0) {
oPacket.Encode4(nMaplePoint);
}
if ((dwModifiedFlag & Meso) > 0) {
oPacket.Encode4(nMeso);
}
if ((dwModifiedFlag & ForPremiumUser) > 0) {
oPacket.Encode1(bForPremiumUser);
}
if ((dwModifiedFlag & CommodityGender) > 0) {
oPacket.Encode1(nCommodityGender);
}
if ((dwModifiedFlag & OnSale) > 0) {
oPacket.Encode1(bOnSale);
}
if ((dwModifiedFlag & Class) > 0) {
oPacket.Encode1(nClass);
}
if ((dwModifiedFlag & Limit) > 0) {
oPacket.Encode1(bLimit);//nLimit post-BB
}
if ((dwModifiedFlag & PbCash) > 0) {
oPacket.Encode2(nPbCash);
}
if ((dwModifiedFlag & PbPoint) > 0) {
oPacket.Encode2(nPbPoint);
}
if ((dwModifiedFlag & PbGift) > 0) {
oPacket.Encode2(nPbGift);
}
if ((dwModifiedFlag & PackageSN) > 0) {
oPacket.Encode1(aPackageSN.size());
for (int nPackageSN : aPackageSN) {
oPacket.Encode4(nPackageSN);
}
}
if ((dwModifiedFlag & ReqPOP) > 0) {
oPacket.Encode2(nReqPOP);
}
if ((dwModifiedFlag & ReqLEV) > 0) {
oPacket.Encode2(nReqLev);
}
}
EDIT: Oh, and this is what Nexon uses later on in replace for CategoryDiscount. They just modify the flag for the commodity. This is just from my v90, but for higher versions here's all the flags:
PHP Code:
public static final int
ItemID = 0x1,
Count = 0x2,
Price = 0x4,
Bonus = 0x8,
Priority = 0x10,
Period = 0x20,
MaplePoint = 0x40,
Meso = 0x80,
ForPremiumUser = 0x100,
CommodityGender = 0x200,
OnSale = 0x400,
Class = 0x800,
Limit = 0x1000,
PbCash = 0x2000,
PbPoint = 0x4000,
PbGift = 0x8000,
PackageSN = 0x10000,
ReqPOP = 0x20000,
ReqLEV = 0x40000,
TermStart = 0x80000,
TermEnd = 0x100000,
Refundable = 0x200000,
BombSale = 0x400000,
ForcedCategory = 0x800000,
GameWorld = 0x1000000,
Token = 0x2000000,
LimitMax = 0x4000000,
LimitQuest_ID = 0x8000000,
OriginalPrice = 0x10000000,
Discount = 0x20000000,
DiscountRate = 0x40000000,
MileageRate = 0x80000000,
All = 0x7FFFF//0xFFFFFFFF
;