local corpse_ids = {
[0] = 3065, -- female
[1] = 3058 -- male
}
function onPrepareDeath(cid, deathList)
if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196 then
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])
end
doItemSetAttribute(corpse, "specialdescription", "You recognize " .. getCreatureName(cid) .. ". " .. (getPlayerSex(cid) == 0 and "She" or "He") .. " was killed by " .. killers .. ".")
end
return true
end
<event type="preparedeath" name="onPrepareDeath" event="script" value="rs.lua"/>
registerCreatureEvent(cid, "onPrepareDeath")
doRemoveItem(item.uid, 1)
<attribute key="charges" value="1"/>
<item id="2196" article="a" name="red skull amulet">
<attribute key="weight" value="420"/>
[COLOR="Red"]<attribute key="charges" value="1"/>[/COLOR]
<attribute key="slotType" value="necklace"/>
</item>
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if isPlayer(cid) == true then
if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196) then
doSetCreatureDropLoot(cid, false)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
if getPlayerSlotItem(cid, 2).itemid == 2196 then
doPlayerRemoveItem(cid, 2196, 1)
end
return true
end
<event type="preparedeath" name="onPrepareDeath" event="script" value="RsAmulet.lua"/>
registerCreatureEvent(cid, "onPrepareDeath")
return true
end
<item id="2196" article="a" name="red skull amulet">
<attribute key="description" value="This amulet will stop you from dropping equipment while having a red skull."/>
<attribute key="weight" value="420"/>
<attribute key="slotType" value="necklace"/>
<attribute key="charges" value="1"/>
<attribute key="preventDrop" value="1"/>
</item>
Code:function onPrepareDeath(cid, deathList) if getCreatureSkullType(cid) < 5 and doPlayerRemoveItem(cid, 2196, 1) then doSetCreatureDropLoot(cid, false) doSendAnimatedText(getThingPos(cid), 'AOL Ownz', getCreatureSkullType(cid) == 4 and 180 or 215) end return true end
doSetCreatureDropLoot(cid, false)
doCreatureSetDropLoot(cid, false)