• 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!

AOL Doesn't work -

Zer0xe

Freedom, Health & Courage
Joined
Aug 3, 2007
Messages
643
Reaction score
2
Location
Sweden
Hello, OTlanders

This is the case, the AOL doesn't work.
If you wear it, and you die - You still have your AOL - but you lose your backpack.

Items.xml
Code:
	<item id="2173" article="an" name="amulet of loss">
		<attribute key="weight" value="420"/>
		<attribute key="slotType" value="necklace"/>
		<attribute key="charges" value="1"/>
		<attribute key="preventDrop" value="1"/>
	</item>

Playerdeath.lua
Lua:
function onDeath(cid, corpse, deathList)

local strings = {""}
local t, position = 1, 1

local deathType = "killed"
local toSlain, toCrushed, toEliminated = 3, 9, 15

        if #deathList >= toSlain and #deathList < toCrushed then
                deathType = "slain"
        elseif #deathList >= toCrushed and #deathList < toEliminated then
                deathType = "crushed"
        elseif #deathList >= toEliminated then
                deathType = "eliminated"
        end

        for _, pid in ipairs(deathList) do
                if isCreature(pid) == true then
                        strings[position] = t == 1 and "" or strings[position] .. ", "
                        strings[position] = strings[position] .. getCreatureName(pid) .. ""
                        t = t + 1
                else
                        strings[position] = t == 1 and "" or strings[position] .. ", "
                        strings[position] = strings[position] .."a field item"
                        t = t + 1
                end
        end

        for i, str in ipairs(strings) do
                if(str:sub(str:len()) ~= ",") then
                        str = str .. "."
                end

                msg = getCreatureName(cid) .. " was " .. deathType .. " at level " .. getPlayerLevel(cid) .. " by " .. str
        end

        for _, oid in ipairs(getPlayersOnline()) do
                doPlayerSendChannelMessage(oid, "Death channel", msg, TALKTYPE_CHANNEL_O, CHANNEL_DEATH)
        end

        return true
end

Movements.xml
Code:
	<movevent type="Equip" itemid="2173" slot="necklace" event="function" value="onEquipItem"/>
	<movevent type="DeEquip" itemid="2173" slot="necklace" event="function" value="onDeEquipItem"/>


All help will be appreciated and repped.

Thanks.
 
Back
Top