• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

NPC sell the equipped item

chiitus

Member
Joined
Jun 1, 2009
Messages
206
Reaction score
12
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 :D
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:
Back
Top