LucasFerraz
Systems Analyst
Hello guys,
How can I optimize it to the max?
How can I optimize it to the max?
Code:
function onDeath(cid, corpse, deathList)
if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196 then
if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).aid > 1000 then
doItemSetAttribute(getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).uid, "aid", 1)
elseif getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).aid >= 2 then
doPlayerRemoveItem(cid, getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid, 1)
else
doItemSetAttribute(getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).uid, "aid", getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).aid+1)
end
doCreatureSetDropLoot(cid, false)
return true
elseif getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2173 then
if getPlayerSkullType(cid) < 4 then
return doCreatureSetDropLoot(cid, false)
else
return doCreatureSetDropLoot(cid, true)
end
else
return true
end
end