darkmu
Well-Known Member
Can someone help me make some adjustments to this script?
It is currently being flagged this way on my channel:
I would like you not to repeat the same monsters so much and leave only 1 time for each different monster and I would also like to know why he gets [0] in the beginning?
TFS 1.X+ - Deathlist damage map (https://otland.net/threads/deathlist-damage-map.266695/) @Evil Puncker
It is currently being flagged this way on my channel:
LUA:
22:53 [0]: Soraka [409] was killed by a true dawnfire asura, , , , a true midnight asura, a true dawnfire asura, , , a true midnight asura, a true midnight asura, a true dawnfire asura, , a true dawnfire asura, a hellhound, a true dawnfire asura, a true dawnfire asura, , a true midnight asura, a true midnight asura, , a true midnight asura, a true dawnfire asura, a hellspawn, , a true dawnfire asura, , a true midnight asura, , a hellspawn, , , , , a true dawnfire asura, a true midnight asura, , a true dawnfire asura, a hellhound, a true frost flower asura, a true dawnfire asura, , a true midnight asura, a true frost flower asura, , , a true dawnfire asura, a hellspawn, , , a true frost flower asura, ,
22:44 [0]: Fofoqueira [106] was killed by , , , , a wyrm, , , , , , , , , , , , , , , , , , , a wyrm, , , , , a dragon, , , , ..
I would like you not to repeat the same monsters so much and leave only 1 time for each different monster and I would also like to know why he gets [0] in the beginning?
LUA:
function table.size(t)
local size = 0
for k, v in pairs(t) do
size = size + 1
end
return size
end
function onDeath(creature, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified)
local damageMap = creature:getDamageMap()
local str = creature:getName().." ["..creature:getLevel().."]"
if(#damageMap <= 1) then
str = str.." was killed by "
elseif(#damageMap > 1 and #damageMap <= 4) then
str = str.." was slain by "
elseif(#damageMap > 4 and #damageMap <= 7) then
str = str.." was crushed by "
elseif(#damageMap > 7 and #damageMap <= 10) then
str = str.." was eliminated by "
elseif(#damageMap > 10) then
str = str.." was annihilated by "
end
local i = 0
for pid, _ in pairs(damageMap) do
i = i + 1
if (i == #damageMap) then
str = str.." and "
elseif (i ~= 1) then
str = str..", "
end
if isPlayer(pid) then
str = str..""..getCreatureName(pid)
elseif isMonster(pid) then
str = str.."a "..getCreatureName(pid):lower()
end
end
str = str.."."
--Game.broadcastMessage(str, MESSAGE_STATUS_WARNING)
sendChannelMessage(4, TALKTYPE_CHANNEL_R1, str)
return true
end
TFS 1.X+ - Deathlist damage map (https://otland.net/threads/deathlist-damage-map.266695/) @Evil Puncker