Hi all,
I have a problem with my Special Iventory. I'm NOT able to sell any items from it to NPCs.
Everything else works fine, i can create shops/offlineshop from special storage , i can move items, i can drop and trade
But when i try to sell an item it doesnt work. No syserr or syslog to point where the issue is.
I attached my input_maion.cpp, shop.cpp, shop_manager.cpp and uiShop.py if anyone could help me fix this.
Beiträge von Cristian Sevastian
-
-
So i've changed the sell to WORD but it still doesnt work for me, im still unable to sell from special storage.
This is my CShopManager::SellCode- void CShopManager::Sell(LPCHARACTER ch, WORD bCell, WORD bCount)
- {
- #ifdef ENABLE_NEWSTUFF
- if (g_BuySellTimeLimitValue && !PulseManager::Instance().IncreaseClock(ch->GetPlayerID(), ePulse::BoxOpening, std::chrono::milliseconds(g_BuySellTimeLimitValue)))
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("아직 골드를 버릴 수 없습니다."));
- return;
- }
- #endif
- #ifdef REMOVE_SHOP_CHECK
- if (ch->GetShop())
- {
- if (ch->GetShop()->IsPCShop())
- return;
- }
- #else
- if (!ch->GetShopOwner())
- return;
- if (!ch->CanHandleItem())
- return;
- if (ch->GetShop()->IsPCShop())
- return;
- if (DISTANCE_APPROX(ch->GetX()-ch->GetShopOwner()->GetX(), ch->GetY()-ch->GetShopOwner()->GetY())>2000)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("상점과의 거리가 너무 멀어 물건을 팔 수 없습니다."));
- return;
- }
- #endif
- LPITEM item = ch->GetInventoryItem(bCell);
- if (!item)
- return;
- if (item->IsEquipped() == true)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("착용 중인 아이템은 판매할 수 없습니다."));
- return;
- }
- if (true == item->isLocked())
- {
- return;
- }
- if (IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_SELL))
- return;
- DWORD dwPrice;
- if (bCount == 0 || bCount > item->GetCount())
- bCount = item->GetCount();
- dwPrice = item->GetShopBuyPrice();
- if (IS_SET(item->GetFlag(), ITEM_FLAG_COUNT_PER_1GOLD))
- {
- if (dwPrice == 0)
- dwPrice = bCount;
- else
- dwPrice = bCount / dwPrice;
- }
- else
- dwPrice *= bCount;
- #ifndef ENABLE_NO_SELL_PRICE_DIVIDED_BY_5
- dwPrice /= 5;
- #endif
- DWORD dwTax = 0;
- int iVal = 3;
- {
- dwTax = dwPrice * iVal/100;
- dwPrice -= dwTax;
- }
- if (test_server)
- sys_log(0, "Sell Item price id %d %s itemid %d", ch->GetPlayerID(), ch->GetName(), item->GetID());
- const int64_t nTotalMoney = static_cast<int64_t>(ch->GetGold()) + static_cast<int64_t>(dwPrice);
- if (GOLD_MAX <= nTotalMoney)
- {
- sys_err("[OVERFLOW_GOLD] id %u name %s gold %u", ch->GetPlayerID(), ch->GetName(), ch->GetGold());
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("20억냥이 초과하여 물품을 팔수 없습니다."));
- return;
- }
- sys_log(0, "SHOP: SELL: %s item name: %s(x%d):%u price: %u", ch->GetName(), item->GetName(), bCount, item->GetID(), dwPrice);
- if (iVal > 0)
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("판매금액의 %d %% 가 세금으로 나가게됩니다"), iVal);
- DBManager::instance().SendMoneyLog(MONEY_LOG_SHOP, item->GetVnum(), dwPrice);
- if (bCount == item->GetCount())
- ITEM_MANAGER::instance().RemoveItem(item, "SELL");
- else
- item->SetCount(item->GetCount() - bCount);
- CMonarch::instance().SendtoDBAddMoney(dwTax, ch->GetEmpire(), ch);
- ch->PointChange(POINT_GOLD, dwPrice, false);
- if (test_server)
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Item sold for %d yang"), dwPrice);
- }
This is my CInputMain::ShopCode- int CInputMain::Shop(LPCHARACTER ch, const char * data, size_t uiBytes)
- {
- TPacketCGShop * p = (TPacketCGShop *) data;
- if (uiBytes < sizeof(TPacketCGShop))
- return -1;
- if (test_server)
- sys_log(0, "CInputMain::Shop() ==> SubHeader %d", p->subheader);
- const char * c_pData = data + sizeof(TPacketCGShop);
- uiBytes -= sizeof(TPacketCGShop);
- switch (p->subheader)
- {
- case SHOP_SUBHEADER_CG_END:
- sys_log(1, "INPUT: %s SHOP: END", ch->GetName());
- CShopManager::instance().StopShopping(ch);
- return 0;
- case SHOP_SUBHEADER_CG_BUY:
- {
- if (uiBytes < sizeof(BYTE) + sizeof(BYTE))
- return -1;
- BYTE bPos = *(c_pData + 1);
- sys_log(1, "INPUT: %s SHOP: BUY %d", ch->GetName(), bPos);
- CShopManager::instance().Buy(ch, bPos);
- return (sizeof(BYTE) + sizeof(BYTE));
- }
- case SHOP_SUBHEADER_CG_SELL:
- {
- if (uiBytes < sizeof(BYTE))
- return -1;
- BYTE pos = *c_pData;
- sys_log(0, "INPUT: %s SHOP: SELL", ch->GetName());
- CShopManager::instance().Sell(ch, pos);
- return sizeof(BYTE);
- }
- case SHOP_SUBHEADER_CG_SELL2:
- {
- if (uiBytes < sizeof(BYTE) + sizeof(BYTE))
- return -1;
- BYTE pos = *(c_pData++);
- BYTE count = *(c_pData);
- sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName());
- CShopManager::instance().Sell(ch, pos, count);
- return sizeof(BYTE) + sizeof(BYTE);
- }
- default:
- sys_err("CInputMain::Shop : Unknown subheader %d : %s", p->subheader, ch->GetName());
- break;
- }
- return 0;
- }
-
Hi,
I have an issue with the game client crashing when i summon a Horse and i get nothing in my Syserr (server or client)
The issue only happens when the horse npc is summoned.
If i use "/ride_horse" and get mounted on the horse straight away Client doesn't crash but it does crash when i Dismount.
Game also crashes when i try to spawn the horse npc by using /mob command.
Nothing in syserr but in ch syslog i get this:
Code- Nov 6 18:55:10 :: COMMAND: ShadowsPR0: mob
- Nov 6 18:55:10 :: RegisterRaceNumMap Brown Horse 20102
- Nov 6 18:55:10 :: FlushPendingDestroy size 1
- Nov 6 18:55:11 :: DISCONNECT: ShadowsPR0 (DESC::~DESC)
- Nov 6 18:55:11 :: SAVE: ShadowsPR0 963018x276796
- Nov 6 18:55:11 :: QUEST clear timer 0
- Nov 6 18:55:11 :: SYSTEM: closing socket. DESC #22
EDIT: I managed to get an error by running the game in debug mode:
Bitte melden Sie sich an, um diesen Link zu sehen.
Any help/pointers would be very appreciated !