lukatxd
Active Member
- Joined
- Dec 9, 2010
- Messages
- 85
- Solutions
- 1
- Reaction score
- 39
TFS 1.3 downgraded by Nekiro (8.6)
I've downloaded a script to make users pay for items using another item as currency. However they can only buy those items when they also have actual money on them.
The actual trade works fine, it does remove my custom sword and adds a boots of haste to my backpack.
I've added this to npc.lua
So where do I need to change to consider the token currency in the window? I've already found uses of player:getTotalMoney() but it is used when confirming the buy action, not when loading the trade window.
EDIT:
Apparently there's this in the sources (didnt find by myself, found in another forum)
It is not considering the player balance, so it is consistent with what I'm seeing. Even though inside the buy script it checks for player balance.
I've downloaded a script to make users pay for items using another item as currency. However they can only buy those items when they also have actual money on them.
The actual trade works fine, it does remove my custom sword and adds a boots of haste to my backpack.
I've added this to npc.lua
Lua:
function Player.getTokenCurrency(self)
return self:getItemCount(12662)
end
So where do I need to change to consider the token currency in the window? I've already found uses of player:getTotalMoney() but it is used when confirming the buy action, not when loading the trade window.
EDIT:
Apparently there's this in the sources (didnt find by myself, found in another forum)
It is not considering the player balance, so it is consistent with what I'm seeing. Even though inside the buy script it checks for player balance.
C++:
void ProtocolGame::sendSaleItemList(const std::list<ShopInfo>& shop)
{
NetworkMessage msg;
msg.addByte(0x7B);
msg.add<uint32_t>(player->getMoney());
std::map<uint16_t, uint32_t> saleMap;
Last edited: