LucasFerraz
Systems Analyst
Author: skydangerous
Script: Do not drop a specific item
Function: Do not drop a specific item
Tested: Dev 0.4, 3777 and 3884.
In creaturescript/scripts create forever.lua
Lua:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if (getPlayerSlotItem(cid,2).itemid == 2173) then
doCreatureSetDropLoot(cid, false)
end
return true
end
Register in login.lua
Lua:
registerCreatureEvent(cid, "forever")
In creaturescript.xml add
XML:
<event type="preparedeath" name="forever" event="script" value="forever.lua"/>
How to edit
You can change 2173 to id of your item.
Lua:
itemid == 2173
In 2 you can change the slot of item.
Lua:
getPlayerSlotItem(cid,2)
Slots IDs
Lua:
CONST_SLOT_HEAD = 1
CONST_SLOT_NECKLACE = 2
CONST_SLOT_BACKPACK = 3
CONST_SLOT_ARMOR = 4
CONST_SLOT_RIGHT = 5
CONST_SLOT_LEFT = 6
CONST_SLOT_LEGS = 7
CONST_SLOT_FEET = 8
CONST_SLOT_RING = 9
CONST_SLOT_AMMO = 10
Last edited: