data/ibs/000-constant.lua add the following line:
data/XML/channels.xml
data/creaturescripts/
You can use something like this on Login.lua to open it automatically.
Lua:
CHANNEL_DEATH = 10
Lua:
<channel id="10" name="Deaths" logged="yes" active="0"/>
data/creaturescripts/
Lua:
--[[Script by Musztang]]
function isSummon(cid)
return getCreatureMaster(cid) ~= nil and true or false
end
function onDeath(cid, corpse, deathList)
i = 0
str = getCreatureName(cid).." ["..getPlayerLevel(cid).."]"
for _, pid in ipairs(deathList) do
i = i + 1
if (i == 1) then
if(#deathList <= 1) then
str = str.." was killed by "
elseif(#deathList > 1 and #deathList <= 4) then
str = str.." was slain by "
elseif(#deathList > 4 and #deathList <= 7) then
str = str.." was crushed by "
elseif(#deathList > 7 and #deathList <= 10) then
str = str.." was eliminated by "
elseif(#deathList > 10) then
str = str.." was annihilated by "
end
elseif (i == #deathList) then
str = str.." and "
else
str = str..", "
end
if not(isPlayer(pid) or isMonster(pid)) then
str = str.."a field item"
elseif isSummon(pid) then
str = str.."a "..getCreatureName(pid):lower().." summoned by "..(isPlayer(getCreatureMaster(pid)) and "" or "a ")..""..getCreatureName(getCreatureMaster(pid))
elseif isPlayer(pid) then
str = str..""..getCreatureName(pid)
elseif isMonster(pid) then
str = str.."a "..getCreatureName(pid):lower()
end
end
str = str.."."
for _, creature in ipairs(getChannelUsers(CHANNEL_DEATH)) do
doPlayerSendChannelMessage(creature, '', str, TALKTYPE_CHANNEL_O, CHANNEL_DEATH)
end
return true
end
You can use something like this on Login.lua to open it automatically.
Lua:
doPlayerOpenChannel(cid, 10)
Last edited: