Hi guys, i'm editing my server to put online, but i want it perfect!
So i was playing a server that the npc don't 'buy' your equipped item, just that on the backpack
I really want this, someone can help me please?
Thanks adv.
EDIT: I found this on sources:
I think instead "g_game.removeItemOfType(player, iit.id, npcState->amount, subType)" i can put a function that remove only backpack's item!
So i was playing a server that the npc don't 'buy' your equipped item, just that on the backpack
I really want this, someone can help me please?
Thanks adv.
EDIT: I found this on sources:
Code:
case ACTION_SELLITEM:
{
const ItemType& iit = Item::items[npcState->itemId];
if(iit.id != 0)
{
uint32_t moneyCount = it->intValue;
if(it->strValue == "|PRICE|")
moneyCount = npcState->price * npcState->amount;
int32_t subType = -1;
if(iit.hasSubType())
subType = npcState->subType;
int32_t itemCount = player->__getItemTypeCount(iit.id, subType);
if(itemCount >= npcState->amount)
{
g_game.removeItemOfType(player, iit.id, npcState->amount, subType);
g_game.addMoney(player, moneyCount, FLAG_NOLIMIT);
}
}
break;
}
I think instead "g_game.removeItemOfType(player, iit.id, npcState->amount, subType)" i can put a function that remove only backpack's item!
Last edited: