Slime
Active Member
- Joined
- Jan 25, 2014
- Messages
- 115
- Reaction score
- 32
I didn't really like an idea of money being a "physical" item in game. Because of the kind of server I'm developing, I decided to change 'soul' into 'gold' and make it as a main currency in game. Now I'm adjusting things to work and I've stumbled across this: at the moment I did no source edits of server or client, just changing 2 lines in npctrade.lua (module)
to
Now it allows me to buy infinite amount of items that cost 100 or less gold (or 200 gold depending on how many soul points you have). Imagine discovering this on a real server with a lot of players - it would cause a riot and lead to its death.
Code:
function onPlayerGoods(money, items)
playerMoney = money
Code:
function onPlayerGoods(money, items)
local localPlayer = g_game.getLocalPlayer()
playerMoney = localPlayer:getSoul()