Mesela Char_Item.cpp'de bool CHARACTER::SellItem(TItemPos Cell) bu fonksiyonun içinde
DWORD dwPrice;
dword türünde dwPrice adında bir tanımlama yapılmış. Ardından
dwPrice = item->GetShopBuyPrice();
Bundan sonra dwPrice eşittir yani demektir item->GetShopBuyPrice()
Alttada
ITEM_MANAGER::instance().RemoveItem(item);
PointChange(POINT_GOLD, dwPrice, false);
İtemi Sildiriyorum ve PointChange ile sana proto tablosundaki GetShopBuyPrice yani
return GetProto()->dwShopBuyPrice;
Tablodaki nesnenin satış fiyatı kadar sana yani envanterine yang (POINT_GOLD) ödensin diyor.
Bende ki o kod satırı şu şekilde
bool CHARACTER::SellItem(TItemPos Cell)
{
LPITEM item = NULL;
if (IsDead())
return false;
if (!IsValidItemPosition(Cell) || !(item = GetItem(Cell)))
return false;
if (item->IsExchanging())
return false;
if (true == item->isLocked())
return false;
if (quest::CQuestManager::instance().GetPCForce(GetPlayerID())->IsRunning() == true)
return false;
if (item->GetCount() <= 0)
return false;
DWORD dwPrice = item->GetGold();
dwPrice *= item->GetCount();
DBManager::instance().SendMoneyLog(MONEY_LOG_SHOP, item->GetVnum(), dwPrice);
item->SetCount(item->GetCount() - item->GetCount());
PointChange(POINT_GOLD, dwPrice, false);
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s has succesfully sell"), item->GetName());
return true;
}
Anladığım kadarıyla yere satarken proto tablosunda ShopBuyPrice yerine Gold'dan işlem yapıyor doğru mu ?