• 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!

Solved NPC Sell Window Bug

Crip Killa

♪Chasm Dev♪
Joined
Oct 19, 2008
Messages
515
Reaction score
44
Hell I was wondering if I can receive some help with this bug for NPC's in my server who buy items from players it happens with all npcs that buy items from players. For example if I want to sell boots of haste to an npc I go to the trade window and click sell but the npc does not recognize that I have boots of haste.But if I say sell boots of haste the npc recognizes that I have them and accepts them this is a strange bug that I can not seem to solve any help is appreciated my client is tibia 8.71 and I am using TFS 0.4 and I do not receive any errors in my console. I am also attaching some pictures to help better explain this bug.

First:
CwGuNgQ.jpg


Second:
jnFHeuz.jpg


Third:
nSkae4S.jpg


Can anyone help?
 
Last edited by a moderator:
Have you tried to replace your lib files? If you have post the script.
Yes I have tried multiple lib files of different TFS 0.4 8.71 Revs and I have just discovered the problem does not appear to be limited to just this npc some of the npc for example crash the server if they have <parameter key="shop_sellable" but if I change it to <parameter key="shop_buyable" it works and vice versa and the server does not crash.

Here is the script of the boot npc:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Viky" script="data/npc/scripts/default.lua" walkinterval="2000" floorchange="0">
    <health now="150" max="150"/>
    <look type="148" head="72" body="17" legs="15" feet="24" addons="1"/>
    <parameters>
        <parameter key="module_shop" value="1"/>
        <parameter key="shop_buyable" value="
        forest boots,13340,25000;
        leather boots,2643,10;
        crocodile boots,3982,100
        "/>
        <parameter key="shop_sellable" value="boots of haste,2195,25"/>
        <parameter key="message_greet" value="Hello |PLAYERNAME|. Please, take a look at my {offer}, you'll surely like it!"/>
        <parameter key="message_sendtrade" value="I am trading all boots. Just browse trough the list of what I can offer you, as you might find what you are searching for."/>
        <parameter key="message_oncloseshop" value="Good luck while hunting! I will wait for more boots!"/>
    </parameters>
</npc>

Do you even have room in your backpack?

Yes I have room in my bp as in the picture I posted if I say in the npc window "trade boots of haste" it works and I am able to sell them the trade window though does not recognize that I have them in my bp also I am using TFS 0.4 for tibia client 8.71 I am unsure of the specific rev.
 
Last edited:
I have come across something new. I tried the modules.lua from TFS 0.4 trunk.r4393 and this time I noticed that before the server crash the npc said "Do you like what I have to offer" but once I switched back to my module.lua when I said offer the server just crashed. So I replaced my NPC LIB with the trunk.r4393 but that still did not fix the problem as the server still crashed. Any other ideas?

Bump

Here are some new things I have come to discover with this bug I have tried this with two premade npcs from TFS 0.4 first I tried Eryn he is the runes npc he crashed my server so then I tried the furniture npc Lola the same result my server crashed both had in them shop_sellable and shop_buyable so I removed shop_sellable from Lola and the npc worked so then I tried the reverse I removed shop_buyable and and entered shop_sellable this crashed my server so I believe the problem is with the sell function of the npc.
 
Last edited by a moderator:
Ok this was a source error I solved by using a backup of the sources I had thanks to everyone who helped. The error was in game.cpp and game.h
 
Back
Top