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

tfs 1.5 (downgrade 7.72) by nekiro NPC Trade

kite28

Member
Joined
May 15, 2012
Messages
71
Reaction score
6
hey, I have a little problem with tfs, as the header says, it's about 1.5 downgrade 7.72 by nekiro. Does anyone have a guide or could share here on the forum how to comment/add a trade system in NPC? Thank you very much in advance for your help. I tried various methods and read various forums, but no one shared it.
 
Copy paste of 8 6 nekiro.
Npc cpp .h
protocolgame and player cpp .h : see
LUA:
: void ProtocolGame::sendShop , void ProtocolGame::sendSaleItemList
void Player:penShopWindow
- Npc (lua)dir of data


Use a function that only applies to players who have an OTC client. because old client will crash
 
Any ideas how to set up the trade window in nekiro 8.0 downgrade? I already tried copy/paste from 8.6 and nothing help tbh.
TFS 1.5 Nekiro 8.0 Downgrade. I'm using OTC. I also tried to make NPC channel works, but nothing helps too :<.
 
Last edited:
Hello im using 772 nekiro's downgrade and im trying to get the trade working, replaced npc.h and npc.cpp with nekiro's 860.
Also
LUA:
ProtocolGame::sendShop , ProtocolGame::sendSaleItemList,  Player:openShopWindow

changed
SHOPMODULE_MODE = SHOPMODULE_MODE_BOTH

added to Game::playerSay like in 860
Code:
    if (type == TALKTYPE_PRIVATE_PN) {
        playerSpeakToNpc(player, text);
        return;
    }

Replaced enum SpeakClasses from 8.60 in const.h and registered them in luascript.cpp

But its not working. When i say hi i get error message in otcv8 console.

ERROR:
ProtocolGame parse message exception (92 bytes, 21 unread, last opcode is 0x20 (32), prev opcode is 0xaa (170), proto: 772): unhandled opcode 32
60 00 58 00
aa 02 00 00 00 04 00 45 72 79 6e 05 81 00 32 00 06 45 00 48 65 6c 6c 6f 20 47 4d 20 4b 55 42 4f 2e 20 49 20 73 65 6c 6c 20 72 75 6e 65 73 2c 20 70 6f 74 69 6f 6e 73 2c 20 77 61 6e 64 73 20 61 6e 64
20 72 6f 64 73 2e 20 57 72 69 74 65 20 7b 20 6f 66 66 65 72 20 7d
 
Solved it, problem was actually in otclientv8 sources.

in ProtocolGame::sendShop
LUA:
 uint16_t itemsToSend = std::min<size_t>(itemList.size(), std::numeric_limits<uint16_t>::max());
    msg.add<uint16_t>(itemsToSend);
in client
LUA:
ProtocolGame::parseOpenNpcTrade

    if (g_game.getProtocolVersion() >= 986) // tbh not sure from what version
        listCount = msg->getU16();
    else
        listCount = msg->getU8();

So its actually sending uint16_t from server but client was using msg->getU8()
So i changed the g_game.getProtocolVersion() >= 986 to
Code:
g_game.getProtocolVersion() >= 772

And working fine.
 
Back
Top