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

Die for monsters

labbadia

New Member
Joined
Aug 29, 2010
Messages
51
Reaction score
1
Hello guys!
How i put when die for a monster dont lost any item / backpack / aol?
Thank you!

Edit: Another question...when i create one quest with this script...
function onUse(cid, item, frompos, item2, topos)


if item.uid == 8006 then
if getPlayerStorageValue(cid,8006) == -1 then
doPlayerSendTextMessage(cid,25,"Voce achou 20 crystal coins!")
doPlayerAddItem(cid,2160,20)
setPlayerStorageValue(cid,8006,1)
else
doPlayerSendTextMessage(cid,25,"Esta vazio!")
end

end
return TRUE
end

Have i to put storage id in quests.xml in xml folder?
 
Hello guys!
How i put when die for a monster dont lost any item / backpack / aol?
Thank you!
i guess this does it

LUA:
function onPrepareDeath(cid, deathList)
    if isPlayer(cid) and isMonster(deathList[0]) or isMonster(deathList[1]) then
        doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
        doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS, 0)
    end
    return true
end

function onLogin(cid)
    registerCreatureEvent(cid, "monsterlost")
    local loss = getConfigValue('deathLostPercent')
    if(loss ~= nil) then
        doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, loss * 10)
        doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS, loss * 10)
    end
    return true
end
XML:
<event type="preparedeath" name="monsterlost" event="script" name="monsterlose.lua"/>
<event type="login" name="monsterlose" event="script" name="monsterlose.lua"/>
 
Back
Top