to your bank balancewhere does the money go?
There is an NPC bank, Does your server not have an NPC bank?where should I get the banking system? Use tfs 1.5 nekiro 8.6
If it's your TFS 1.5 Nekiro, then the default NPC bank already exists. Take a look here.My friend, to be honest, I don't know anything, I've never used it and I don't even know where to look. Could you guide me or refer me to a website with an explanation?
I prefer talkactions, but I don't know why only the !balance command works and !withdraw all doesn't throw any errors, but it doesn't pay out money except for the !balance command, nothing happens, it's a pity I have to figure it out because the conversation with the NPC is too longIf it's your TFS 1.5 Nekiro, then the default NPC bank already exists. Take a look here.
orTFS-1.5-Downgrades/data/npc/scripts/bank.lua at 8.60 · nekiro/TFS-1.5-Downgrades
Alternative forgottenserver versions for older protocols support - nekiro/TFS-1.5-Downgradesgithub.com
There is also a command available to check your bank balance.
TFS 1.X+ - TFS 1.3 onSay param broken...
So I am making a banking code and I can't seem to use param at all... function onSay(player, words, param) if words == "!balance" then player:popupFYI("[Balance]: "..player:getBankBalance()) return false elseif words == "!deposit" then if not param then...otland.net
See which one you prefer more: NPC bank or talkaction bank.
Hi,I really like how simple and effective it is! How easy is it possible to change the looting to when the body is opened instead of when it's killed?
Don't want to make things to easy.
function ec.onDropLoot(monster, corpse)
function ec.onDropLoot(monster, corpse)
if not corpse:getType():isContainer() then
return
end
local corpseOwner = Player(corpse:getCorpseOwner())
local items = corpse:getItems()
local warningCapacity = false
for _, item in pairs(items) do
if item then
local itemId = item:getId()
if hasPlayerAutolootItem(corpseOwner, itemId) then
if currencyItems[itemId] then
local worth = item:getCount()
local playerBankBalance = corpseOwner:getBankBalance()
corpseOwner:setBankBalance(playerBankBalance + worth)
corpseOwner:sendTextMessage(MESSAGE_STATUS_SMALL, string.format("Your balance increases by %d gold coins.", worth))
item:remove()
elseif not item:moveTo(corpseOwner, 0) then
warningCapacity = true
end
end
end
end
if warningCapacity then
corpseOwner:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have no capacity.")
end
end
Perfect working! Good job.For those who want to use Sarah's system? I was added and tested it, and noticed that there were errors, so I had to make changes to the source. After that, I corrected the script, which is very simple. I tested it on TFS 1.4.2 1098 and it worked perfectly, 100% Ok.
Here are the commits that need necessary alterations.
Possibility of defining currencies by MillhioreBT · Pull Request #3699 · otland/forgottenserver
I have followed [proper The Forgotten Server code styling][code]. I have read and understood the [contribution guidelines][cont] before making this PR. I am aware that this PR may be closed if th...github.comA new way to manage player storages by MillhioreBT · Pull Request #3956 · otland/forgottenserver
Pull Request Prelude I have followed [proper The Forgotten Server code styling][code]. I have read and understood the [contribution guidelines][cont] before making this PR. I am aware that this...github.com
look for this line:
change to:Lua:function ec.onDropLoot(monster, corpse)
Lua:function ec.onDropLoot(monster, corpse) if not corpse:getType():isContainer() then return end local corpseOwner = Player(corpse:getCorpseOwner()) local items = corpse:getItems() local warningCapacity = false for _, item in pairs(items) do if item then local itemId = item:getId() if hasPlayerAutolootItem(corpseOwner, itemId) then if currencyItems[itemId] then local worth = item:getCount() local playerBankBalance = corpseOwner:getBankBalance() corpseOwner:setBankBalance(playerBankBalance + worth) corpseOwner:sendTextMessage(MESSAGE_STATUS_SMALL, string.format("Your balance increases by %d gold coins.", worth)) item:remove() elseif not item:moveTo(corpseOwner, 0) then warningCapacity = true end end end end if warningCapacity then corpseOwner:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have no capacity.") end end
For those who want to use Sarah's system? I was added and tested it, and noticed that there were errors, so I had to make changes to the source. After that, I corrected the script, which is very simple. I tested it on TFS 1.4.2 1098 and it worked perfectly, 100% Ok.
Here are the commits that need necessary alterations.
Possibility of defining currencies by MillhioreBT · Pull Request #3699 · otland/forgottenserver
I have followed [proper The Forgotten Server code styling][code]. I have read and understood the [contribution guidelines][cont] before making this PR. I am aware that this PR may be closed if th...github.comA new way to manage player storages by MillhioreBT · Pull Request #3956 · otland/forgottenserver
Pull Request Prelude I have followed [proper The Forgotten Server code styling][code]. I have read and understood the [contribution guidelines][cont] before making this PR. I am aware that this...github.com
look for this line:
change to:Lua:function ec.onDropLoot(monster, corpse)
Lua:function ec.onDropLoot(monster, corpse) if not corpse:getType():isContainer() then return end local corpseOwner = Player(corpse:getCorpseOwner()) local items = corpse:getItems() local warningCapacity = false for _, item in pairs(items) do if item then local itemId = item:getId() if hasPlayerAutolootItem(corpseOwner, itemId) then if currencyItems[itemId] then local worth = item:getCount() local playerBankBalance = corpseOwner:getBankBalance() corpseOwner:setBankBalance(playerBankBalance + worth) corpseOwner:sendTextMessage(MESSAGE_STATUS_SMALL, string.format("Your balance increases by %d gold coins.", worth)) item:remove() elseif not item:moveTo(corpseOwner, 0) then warningCapacity = true end end end end if warningCapacity then corpseOwner:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have no capacity.") end end
if action == "add" then
local itemType = ItemType(split[2])
if not itemType or itemType:getId() == 0 then
itemType = ItemType(math.max(tonumber(split[2]) or 0), 0)
if not itemType or itemType:getId() == 0 then
player:sendCancelMessage(string.format("The item %s does not exist!", split[2]))
return false
end
end
local itemName = itemType:getName()
local itemID = itemType:getId()
if addPlayerAutolootItem(player, itemID) then
local message = string.format("Added %s to autoloot list.", itemName)
player:sendCancelMessage(message)
local monster = Monster(player:getPosition())
if monster then
monster:say(message, TALKTYPE_MONSTER_SAY)
end
else
player:sendCancelMessage(string.format("The item %s is already in the autoloot list.", itemName))
end
return false
end
For those who want to use Sarah's system? I was added and tested it, and noticed that there were errors, so I had to make changes to the source. After that, I corrected the script, which is very simple. I tested it on TFS 1.4.2 1098 and it worked perfectly, 100% Ok.
Here are the commits that need necessary alterations.
Possibility of defining currencies by MillhioreBT · Pull Request #3699 · otland/forgottenserver
I have followed [proper The Forgotten Server code styling][code]. I have read and understood the [contribution guidelines][cont] before making this PR. I am aware that this PR may be closed if th...github.comA new way to manage player storages by MillhioreBT · Pull Request #3956 · otland/forgottenserver
Pull Request Prelude I have followed [proper The Forgotten Server code styling][code]. I have read and understood the [contribution guidelines][cont] before making this PR. I am aware that this...github.com
look for this line:
change to:Lua:function ec.onDropLoot(monster, corpse)
Lua:function ec.onDropLoot(monster, corpse) if not corpse:getType():isContainer() then return end local corpseOwner = Player(corpse:getCorpseOwner()) local items = corpse:getItems() local warningCapacity = false for _, item in pairs(items) do if item then local itemId = item:getId() if hasPlayerAutolootItem(corpseOwner, itemId) then if currencyItems[itemId] then local worth = item:getCount() local playerBankBalance = corpseOwner:getBankBalance() corpseOwner:setBankBalance(playerBankBalance + worth) corpseOwner:sendTextMessage(MESSAGE_STATUS_SMALL, string.format("Your balance increases by %d gold coins.", worth)) item:remove() elseif not item:moveTo(corpseOwner, 0) then warningCapacity = true end end end end if warningCapacity then corpseOwner:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have no capacity.") end end
I tested with some normal items, however, this ID 'crown legs' doesn't work at all. I found it strange. Later, I'll study the case. I don't know the reason why this 'crown legs' ID doesn't work while other normal ones do.2488
They work, but add it like this.I tested with some normal items, however, this ID 'crown legs' doesn't work at all. I found it strange. Later, I'll study the case. I don't know the reason why this 'crown legs' ID doesn't work while other normal ones do.
2024-03-07_01-00-28.255530 Lua Script Error: [Event Interface]
2024-03-07_01-00-28.255595 data/events/scripts/monster.lua:Monster@onDropLoot
2024-03-07_01-00-28.255632 /var/www/tfs_old/data/scripts/auto_loot/auto_loot.lua:21: attempt to index local 'player' (a nil value)
2024-03-07_01-00-28.255667 stack traceback:
2024-03-07_01-00-28.255701 [C]: in function '__index'
2024-03-07_01-00-28.255736 /var/www/tfs_old/data/scripts/auto_loot/auto_loot.lua:21: in function 'getPlayerLimit'
2024-03-07_01-00-28.256337 /var/www/tfs_old/data/scripts/auto_loot/auto_loot.lua:25: in function 'getPlayerAutolootItems'
2024-03-07_01-00-28.256385 /var/www/tfs_old/data/scripts/auto_loot/auto_loot.lua:87: in function 'hasPlayerAutolootItem'
2024-03-07_01-00-28.256459 /var/www/tfs_old/data/scripts/auto_loot/auto_loot.lua:107: in function </var/www/tfs_old/data/scripts/auto_loot/auto_loot.lua:97>
2024-03-07_01-00-28.256633 /var/www/tfs_old/data/scripts/lib/event_callbacks.lua:127: in function 'EventCallback'
2024-03-07_01-00-28.256774 data/events/scripts/monster.lua:3: in function <data/events/scripts/monster.lua:1>