ok, i found the problem, but i'm not going to fix it because i don't know the formula for actually calulating the price(it's more than just grabbing it from the database).
in worldpackets.cpp, function pakNPCbuy:
- case 7:
- case 11:
- case 13:
- {
- float price = 0;
- UINT bprice = 0;
- UINT pricerate = 0;
- switch(thisitem.itemtype)
- {
- case 7:
- pricerate = EquipList[thisitem.itemtype].Index[thisitem.itemnum]->pricerate;
- bprice *= EquipList[thisitem.itemtype].Index[thisitem.itemnum]->price;
- break;
- case 11:
- pricerate = JemList.Index[thisitem.itemnum]->pricerate;
- bprice *= JemList.Index[thisitem.itemnum]->price;
- break;
- case 13:continue;//can we sell quest items? :S
-
- }
- price = pricerate;
- price *= 0x61 - 0x32; // misc rate -0x32
- price += 1000;
- price *= bprice;
- price *= (200 - 0x62); //town rate ( 100)
- price *= 5.555555555555556E-06;
- price = (float)floor(price);
- Log( MSG_WARNING, "Item Sold: itemnum %i, itemtype %i, itemcount %i, price %0.0f", thisitem.itemnum, thisitem.itemtype, thisitem.count, price);
- thisclient->CharInfo->Zulies += (long int)price*count;
-
this is the part that gets the sell prices for gems and accessories.
near the top, it initializes 'bprice' as zero. after that it multiplies 'bprice' by the price in the CSV, but it's still zero, since it started at zero, and multiplication does that.
then when 'price' gets multiplied by 'bprice' further down, it zeros it too, and screws up the whole thing, making the end price zero for every gem and accessory.
i'm assuming you could just change these lines:
- bprice *= EquipList[thisitem.itemtype].Index[thisitem.itemnum]->price;
- bprice *= JemList.Index[thisitem.itemnum]->price;
to:
- bprice = EquipList[thisitem.itemtype].Index[thisitem.itemnum]->price;
- bprice = JemList.Index[thisitem.itemnum]->price;
to assign them instead of multiplying them, but it's hard for me to test since i don't run rev 80. and besides, assumption is evil, and should be tested. but that's what i figure the problem is, just makes sense.