Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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!
Hello,Maybe someone will be able to help me with this. After death, the character "stands" instead of only seeing the dead body. If someone is standing next to you, they see everything normally. Only the owner sees as on the screen. Does anyone know how to solve this problem?
Hello,Maybe someone will be able to help me with this. After death, the character "stands" instead of only seeing the dead body. If someone is standing next to you, they see everything normally. Only the owner sees as on the screen. Does anyone know how to solve this problem?
After death, only the corpse should be visible, not the figure standing on the corpse. I thought every Tibia player knew what the screen looks like after death
local deathListEnabled = true
local maxDeathRecords = 5
function onDeath(player, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
local playerId = player:getId()
if nextUseStaminaTime[playerId] then
nextUseStaminaTime[playerId] = nil
end
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are dead.")
if not deathListEnabled then
return
end
local byPlayer = 0
local killerName
if killer then
if killer:isPlayer() then
byPlayer = 1
else
local master = killer:getMaster()
if master and master ~= killer and master:isPlayer() then
killer = master
byPlayer = 1
end
end
killerName = killer:getName()
else
killerName = "field item"
end
local byPlayerMostDamage = 0
local mostDamageKillerName
if mostDamageKiller then
if mostDamageKiller:isPlayer() then
byPlayerMostDamage = 1
else
local master = mostDamageKiller:getMaster()
if master and master ~= mostDamageKiller and master:isPlayer() then
mostDamageKiller = master
byPlayerMostDamage = 1
end
end
mostDamageName = mostDamageKiller:getName()
else
mostDamageName = "field item"
end
local playerGuid = player:getGuid()
db.query("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`, `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`) VALUES (" .. playerGuid .. ", " .. os.time() .. ", " .. player:getLevel() .. ", " .. db.escapeString(killerName) .. ", " .. byPlayer .. ", " .. db.escapeString(mostDamageName) .. ", " .. byPlayerMostDamage .. ", " .. (lastHitUnjustified and 1 or 0) .. ", " .. (mostDamageUnjustified and 1 or 0) .. ")")
local resultId = db.storeQuery("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. playerGuid)
local deathRecords = 0
local tmpResultId = resultId
while tmpResultId ~= false do
tmpResultId = result.next(resultId)
deathRecords = deathRecords + 1
end
if resultId ~= false then
result.free(resultId)
end
local limit = deathRecords - maxDeathRecords
if limit > 0 then
db.asyncQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. playerGuid .. " ORDER BY `time` LIMIT " .. limit)
end
if byPlayer == 1 then
local targetGuild = player:getGuild()
targetGuild = targetGuild and targetGuild:getId() or 0
if targetGuild ~= 0 then
local killerGuild = killer:getGuild()
killerGuild = killerGuild and killerGuild:getId() or 0
if killerGuild ~= 0 and targetGuild ~= killerGuild and isInWar(playerId, killer:getId()) then
local warId = false
resultId = db.storeQuery("SELECT `id` FROM `guild_wars` WHERE `status` = 1 AND ((`guild1` = " .. killerGuild .. " AND `guild2` = " .. targetGuild .. ") OR (`guild1` = " .. targetGuild .. " AND `guild2` = " .. killerGuild .. "))")
if resultId ~= false then
warId = result.getNumber(resultId, "id")
result.free(resultId)
end
if warId ~= false then
db.asyncQuery("INSERT INTO `guildwar_kills` (`killer`, `target`, `killerguild`, `targetguild`, `time`, `warid`) VALUES (" .. db.escapeString(killerName) .. ", " .. db.escapeString(player:getName()) .. ", " .. killerGuild .. ", " .. targetGuild .. ", " .. os.time() .. ", " .. warId .. ")")
end
end
end
end
end
Post automatically merged:
cmd:
LUA:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/playerdeath.lua:onDeath
data/creaturescripts/scripts/playerdeath.lua:6: attempt to index global 'nextUseStaminaTime' (a nil value)
stack traceback:
[C]: in function '__index'
data/creaturescripts/scripts/playerdeath.lua:6: in function <data/creaturescripts/scripts/playerdeath.lua:4>
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/droploot.lua:onDeath
data/creaturescripts/scripts/droploot.lua:7: attempt to call field 'contains' (a nil value)
stack traceback:
[C]: in function 'contains'
data/creaturescripts/scripts/droploot.lua:7: in function <data/creaturescripts/scripts/droploot.lua:1>
Pololo has logged out.
LUA:
function onDeath(player, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
if player:hasFlag(PlayerFlag_NotGenerateLoot) or player:getVocation():getId() == VOCATION_NONE then
return true
end
local amulet = player:getSlotItem(CONST_SLOT_NECKLACE)
local isRedOrBlack = table.contains({SKULL_RED, SKULL_BLACK}, player:getSkull())
if amulet and amulet.itemid == ITEM_AMULETOFLOSS and not isRedOrBlack then
local isPlayer = false
if killer then
if killer:isPlayer() then
isPlayer = true
else
local master = killer:getMaster()
if master and master:isPlayer() then
isPlayer = true
end
end
end
if not isPlayer or not player:hasBlessing(6) then
player:removeItem(ITEM_AMULETOFLOSS, 1, -1, false)
end
else
for i = CONST_SLOT_HEAD, CONST_SLOT_AMMO do
local item = player:getSlotItem(i)
local lossPercent = player:getLossPercent()
if item then
if isRedOrBlack or math.random(item:isContainer() and 100 or 1000) <= lossPercent then
if (isRedOrBlack or lossPercent ~= 0) and not item:moveTo(corpse) then
item:remove()
end
end
end
end
end
if not player:getSlotItem(CONST_SLOT_BACKPACK) then
player:addItem(ITEM_BAG, 1, false, CONST_SLOT_BACKPACK)
end
return true
end
As Dakos said, disable all creaturescripts and check, if it fixes anything.
It's also possible that TFS 1.4 does not send packet to 'remove creature' from logged-in player screen, as he probably should get kicked (go to list of characters) on 10.98?
A few things have been corrected and there are no more errors in the console, and the character still "stands" after death
"
Wadwad has logged in.
Wadwad has logged out.
Wadwad has logged in.
Wadwad has logged out.
Pololo has logged in.
Pololo has logged out.
Pololo has logged in.
Pololo has logged out.
Pololo has logged in.
"
I don't quite know how to turn off the "onDeath" function
For example, at "droplot.lua" where it appears
Code:
function onDeath(player, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
if player:hasFlag(PlayerFlag_NotGenerateLoot) or player:getVocation():getId() == VOCATION_NONE then
return true
end
local amulet = player:getSlotItem(CONST_SLOT_NECKLACE)
local isRedOrBlack = table.contains({SKULL_RED, SKULL_BLACK}, player:getSkull())
if amulet and amulet.itemid == ITEM_AMULETOFLOSS and not isRedOrBlack then
local isPlayer = false
if killer then
if killer:isPlayer() then
isPlayer = true
else
local master = killer:getMaster()
if master and master:isPlayer() then
isPlayer = true
end
end
end
if not isPlayer or not player:hasBlessing(6) then
player:removeItem(ITEM_AMULETOFLOSS, 1, -1, false)
end
else
for i = CONST_SLOT_HEAD, CONST_SLOT_AMMO do
local item = player:getSlotItem(i)
local lossPercent = player:getLossPercent()
if item then
if isRedOrBlack or math.random(item:isContainer() and 100 or 1000) <= lossPercent then
if (isRedOrBlack or lossPercent ~= 0) and not item:moveTo(corpse) then
item:remove()
end
end
end
end
end
if not player:getSlotItem(CONST_SLOT_BACKPACK) then
player:addItem(ITEM_BAG, 1, false, CONST_SLOT_BACKPACK)
end
return true
end
I couldn't add a text document as an attachment here
And this:
ERROR: ProtocolGame parse message exception (11019 bytes, 5600 unread, last opcode is 0x00 (0), prev opcode is 0x00 (0)): InputMessage eof reached
Packet has been saved to packet.log, you can use it to find what was wrong. (Protocol: 1098)
I noticed that in general I have 3 other protocol errors, but from the start of the server to the death of the player only this error appeared, so those should not be related to this one.
I will not post it in this topic, because if someone encounters this problem, maybe it will be possible to solve it thanks to this topic.
How to solve this, I will create a new topic with protocol errors
I noticed that in general I have 3 other protocol errors, but from the start of the server to the death of the player only this error appeared, so those should not be related to this one.
I will not post it in this topic, because if someone encounters this problem, maybe it will be possible to solve it thanks to this topic.
How to solve this, I will create a new topic with protocol errors
server.log:
Connecting to: 127.0.0.1:7171
WARNING: HTTP error for http://************/api/status.php: Invalid http status code (410)
Login to 127.0.0.1:7172
ERROR: ProtocolGame parse message exception (13679 bytes, 5688 unread, last opcode is 0x00 (0), prev opcode is 0x00 (0)): InputMessage eof reached
Packet has been saved to packet.log, you can use it to find what was wrong. (Protocol: 1098)
packet.log:
ProtocolGame parse message exception (11072 bytes, 5653 unread, last opcode is 0x00 (0), prev opcode is 0x00 (0), proto: 1098): InputMessage eof reached
ProtocolGame parse message exception (13679 bytes, 5688 unread, last opcode is 0x00 (0), prev opcode is 0x00 (0), proto: 1098): InputMessage eof reached
in both cases a long string of different numbers/letters
ERROR: ProtocolGame parse message exception (298 bytes, 18 unread, last opcode is 0x00 (0), prev opcode is 0x00 (0)): InputMessage eof reached
Packet has been saved to packet.log, you can use it to find what was wrong. (Protocol: 1098)
After the player dies (the person who died sees that his character is standing on the screen but is dead) - from the perspective of the player next to him, only the body is visible. (first screen)
After a while, it logs the player out of the death screen and appears in the temple:
Server.log:
ERROR: ProtocolGame parse message exception (298 bytes, 18 unread, last opcode is 0x00 (0), prev opcode is 0x00 (0)): InputMessage eof reached
Packet has been saved to packet.log, you can use it to find what was wrong. (Protocol: 1098)
Server.log:
WARNING: HTTP error for http://************/api/status.php: Invalid http status code (410)
Login to 127.0.0.1:7172
ERROR: ProtocolGame parse message exception (11019 bytes, 5600 unread, last opcode is 0x00 (0), prev opcode is 0x00 (0)): InputMessage eof reached
Packet has been saved to packet.log, you can use it to find what was wrong. (Protocol: 1098)
packet.log:
ProtocolGame parse message exception (11019 bytes, 5600 unread, last opcode is 0x00 (0), prev opcode is 0x00 (0), proto: 1098): InputMessage eof reached
(......)
If it helps, I can share the server protocol files.
ERROR: ProtocolGame parse message exception (532 bytes, 30 unread, last opcode is 0x00 (0), prev opcode is 0x00 (0)): InputMessage eof reached
Packet has been saved to packet.log, you can use it to find what was wrong. (Protocol: 1098)
ERROR: ProtocolGame parse message exception (532 bytes, 30 unread, last opcode is 0x00 (0), prev opcode is 0x00 (0)): InputMessage eof reached
Packet has been saved to packet.log, you can use it to find what was wrong. (Protocol: 1098)
local deathListEnabled = true
local maxDeathRecords = 5
function onDeath(player, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
local playerId = player:getId()
if nextUseStaminaTime[playerId] then
nextUseStaminaTime[playerId] = nil
end
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are dead.")
if not deathListEnabled then
return
end
local byPlayer = 0
local killerName
if killer then
if killer:isPlayer() then
byPlayer = 1
else
local master = killer:getMaster()
if master and master ~= killer and master:isPlayer() then
killer = master
byPlayer = 1
end
end
killerName = killer:getName()
else
killerName = "field item"
end
local byPlayerMostDamage = 0
local mostDamageKillerName
if mostDamageKiller then
if mostDamageKiller:isPlayer() then
byPlayerMostDamage = 1
else
local master = mostDamageKiller:getMaster()
if master and master ~= mostDamageKiller and master:isPlayer() then
mostDamageKiller = master
byPlayerMostDamage = 1
end
end
mostDamageName = mostDamageKiller:getName()
else
mostDamageName = "field item"
end
local playerGuid = player:getGuid()
db.query("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`, `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`) VALUES (" .. playerGuid .. ", " .. os.time() .. ", " .. player:getLevel() .. ", " .. db.escapeString(killerName) .. ", " .. byPlayer .. ", " .. db.escapeString(mostDamageName) .. ", " .. byPlayerMostDamage .. ", " .. (lastHitUnjustified and 1 or 0) .. ", " .. (mostDamageUnjustified and 1 or 0) .. ")")
local resultId = db.storeQuery("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. playerGuid)
local deathRecords = 0
local tmpResultId = resultId
while tmpResultId ~= false do
tmpResultId = result.next(resultId)
deathRecords = deathRecords + 1
end
if resultId ~= false then
result.free(resultId)
end
local limit = deathRecords - maxDeathRecords
if limit > 0 then
db.asyncQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. playerGuid .. " ORDER BY `time` LIMIT " .. limit)
end
if byPlayer == 1 then
local targetGuild = player:getGuild()
targetGuild = targetGuild and targetGuild:getId() or 0
if targetGuild ~= 0 then
local killerGuild = killer:getGuild()
killerGuild = killerGuild and killerGuild:getId() or 0
if killerGuild ~= 0 and targetGuild ~= killerGuild and isInWar(playerId, killer:getId()) then
local warId = false
resultId = db.storeQuery("SELECT `id` FROM `guild_wars` WHERE `status` = 1 AND ((`guild1` = " .. killerGuild .. " AND `guild2` = " .. targetGuild .. ") OR (`guild1` = " .. targetGuild .. " AND `guild2` = " .. killerGuild .. "))")
if resultId ~= false then
warId = result.getNumber(resultId, "id")
result.free(resultId)
end
if warId ~= false then
db.asyncQuery("INSERT INTO `guildwar_kills` (`killer`, `target`, `killerguild`, `targetguild`, `time`, `warid`) VALUES (" .. db.escapeString(killerName) .. ", " .. db.escapeString(player:getName()) .. ", " .. killerGuild .. ", " .. targetGuild .. ", " .. os.time() .. ", " .. warId .. ")")
end
end
end
end
end
I disabled several onDeath but it didn't help me find a solution
Most likely has nothing to do with death, just track back your latest changes that involve protocols
The server is sending extra packets that the client was not planned to read (which can cause random seemingly unrelated bugs, like creatures standing on death)
Most likely has nothing to do with death, just track back your latest changes that involve protocols
The server is sending extra packets that the client was not planned to read (which can cause random seemingly unrelated bugs, like creatures standing on death)
If I have protocol errors (I sent the entire list in the post above in Tuesday), how can I solve the problems? Apart from the protocol number, there are a lot of numbers and letters that don't mean much to me :/