• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Need help to fix some issues on death.

Daemonium

Programmer
Joined
Oct 18, 2015
Messages
57
Solutions
1
Reaction score
10
Location
Canada
Hello,
I got 2 problems on death. I used "doCreatureSetDropLoot(cid, false)" since I want my players to never drop items in any situation.

1rst problem: Dead body don't show who's dead and who killed them.

2nd problem: The gameplay image come back to temple before I click OK on the death message box.

LUA:
local corpse_ids = {
    [0] = 3065, -- female
    [1] = 3058 -- male
}
function onPrepareDeath(cid, deathList)

        doCreatureSetDropLoot(cid, false)
        doSendMagicEffect(getThingPos(cid), CONST_ME_HOLYAREA)
        local corpse, killers = doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), ""   
    for i = 1, math.min(getConfigInfo('deathAssistCount') + 1, #deathList) do
    killers = killers .. (i == 1 and "" or ", ") .. (isMonster(deathList[i]) and "a " or "") .. getCreatureName(deathList[i])
doItemSetAttribute(corpse, "specialdescription", "You recognize " .. getCreatureName(cid) .. ". " .. (getPlayerSex(cid) == 0 and "She" or "He") .. " was killed by " .. killers .. ".")
end
return true
end

Thanks for your help!
 
Solution
I just tryed it and it's the same... It looks like it's "doCreatureSetDropLoot" that cause the problem.
And you did test to remove the return true inside the onPrepareDeath script aswell?

Edit:
An other workaround would be to add all blessings to the players
when they login, im think that was implemented whit 0.3.6

add this inside login.lua
not sure if twist of fate is blessing #6
if so then change the 5 to a 6
LUA:
for i = 1, 5 do
   if (not getPlayerBlessing(cid, i)) then
       doPlayerAddBlessing(cid, i)
   end
end
Hello,
I got 2 problems on death. I used "doCreatureSetDropLoot(cid, false)" since I want my players to never drop items in any situation.

1rst problem: Dead body don't show who's dead and who killed them.

2nd problem: The gameplay image come back to temple before I click OK on the death message box.

LUA:
local corpse_ids = {
    [0] = 3065, -- female
    [1] = 3058 -- male
}
function onPrepareDeath(cid, deathList)

        doCreatureSetDropLoot(cid, false)
        doSendMagicEffect(getThingPos(cid), CONST_ME_HOLYAREA)
        local corpse, killers = doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), ""  
    for i = 1, math.min(getConfigInfo('deathAssistCount') + 1, #deathList) do
    killers = killers .. (i == 1 and "" or ", ") .. (isMonster(deathList[i]) and "a " or "") .. getCreatureName(deathList[i])
doItemSetAttribute(corpse, "specialdescription", "You recognize " .. getCreatureName(cid) .. ". " .. (getPlayerSex(cid) == 0 and "She" or "He") .. " was killed by " .. killers .. ".")
end
return true
end

Thanks for your help!

What if you use doCreatureSetDropLoot(cid, false) inside login.lua?
then you dont need onPrepareDeath script
 
I got the same problem, gameplay screen teleport to temple position when I die before I click on the OK bouton! :p
View attachment 29529
Do you have any other onPrepareDeath script that might be the reason of teleporting you?

Edit:
btw, did the doCreatureSetDropLoot(cid, false) inside login.lua fix the drop issue?
i mean does it make a corpse whit player name and what/who killed the player
 
Last edited:
Do you have any other onPrepareDeath script that might be the reason of teleporting you?

Edit:
btw, did the doCreatureSetDropLoot(cid, false) inside login.lua fix the drop issue?
i mean does it make a corpes whit player name and what/who killed the player

I'm making a war ot and nobody can drop loot so I decided to just remove the dead body.

I don't have any other onPrepareDeath, but mine is now :

LUA:
function onPrepareDeath(cid, deathList)

        doCreatureSetDropLoot(cid, false)
        doSendMagicEffect(getThingPos(cid), CONST_ME_HOLYAREA)   
return true
end
 
I'm making a war ot and nobody can drop loot so I decided to just remove the dead body.

I don't have any other onPrepareDeath, but mine is now :

LUA:
function onPrepareDeath(cid, deathList)

        doCreatureSetDropLoot(cid, false)
        doSendMagicEffect(getThingPos(cid), CONST_ME_HOLYAREA) 
return true
end
ok, remove that script and test what i said.

because if you add doCreatureSetDropLoot(cid, false) inside login.lua, everyplayer that login will be set to not drop loot.
It might be the onPrepareDeath function that cause the bug

edit:
or simply try to remove return true
 
ok, remove that script and test what i said.

because if you add doCreatureSetDropLoot(cid, false) inside login.lua, everyplayer that login will be set to not drop loot.
It might be the onPrepareDeath function that cause the bug

edit:
or simply try to remove return true

I just tryed it and it's the same... It looks like it's "doCreatureSetDropLoot" that cause the problem.
 
I just tryed it and it's the same... It looks like it's "doCreatureSetDropLoot" that cause the problem.
And you did test to remove the return true inside the onPrepareDeath script aswell?

Edit:
An other workaround would be to add all blessings to the players
when they login, im think that was implemented whit 0.3.6

add this inside login.lua
not sure if twist of fate is blessing #6
if so then change the 5 to a 6
LUA:
for i = 1, 5 do
   if (not getPlayerBlessing(cid, i)) then
       doPlayerAddBlessing(cid, i)
   end
end
 
Last edited:
Solution
And you did test to remove the return true inside the onPrepareDeath script aswell?

Edit:
An other workaround would be to add all blessings to the players
when they login, im think that was implemented whit 0.3.6

add this inside login.lua
not sure if twist of fate is blessing #6
if so then change the 5 to a 6
LUA:
for i = 1, 5 do
   if (not getPlayerBlessing(cid, i)) then
       doPlayerAddBlessing(cid, i)
   end
end

Solved thanks to you Mummrik!
 
Back
Top