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

Trade items with id higher than 20000

Draraki

New Member
Joined
Mar 3, 2012
Messages
4
Reaction score
0
Hello.
I'm trying to add item with id higher than 20000 to npc, but it's not working. XML is correct. I can see item in trade window, but i can't look on it (see description) and can't sell/buy it. onSell/onBuy function is not called and i don't have any error. Also /i command not works for this items, when i type (for example /i nameOfItemHigherThan20000), but when i put id instead of name it works correctly and i can see description. I think there is a limit somewhere in c++, but don't have idea where.
I'm using tfs 0.4.
 
same problem
Fixed edithing items.cpp on sources:

C++:
    /*
    if(id > 20000 && id < 20100)
    {
        id -= 20000;
        ItemType* iType = new ItemType();

        iType->id = id;
        items.addElement(iType, iType->id);
    } */

/*if(serverId > 20000 && serverId < 20100)
    serverId = serverId - 20000;*/
Find and comment these codes. Works fine i guess.
 
Last edited:
I just wanna add this in case people are having this problem still:

If you are using Fir3element's TFS 0.4 3777 and you have more than 20,000 items in your items.xml, you will have a hard time using the function getItemIdByName

Nubaza's message is actually a fix for that problem. Just comment that section and you should be good.
Also remember to change the "else if" for a simple "if" like this:

Around line 270 in items.cpp
C++:
// if(serverId > 20000 && serverId < 20100){
//     serverId = serverId - 20000;
// }
// else if(lastId > 99 && lastId != serverId - 1)
if(lastId > 99 && lastId != serverId - 1)

Thank you Nubaza!
 
Back
Top