<action uniqueid="STORAGE_HERE" event="script" value="quests/yourscript.lua"/> <!-- brief description of the quest, so you can easily identify it later -->
function onUse(cid, item, frompos, item2, topos)
if item.uid == STORAGE_HERE then
if getPlayerStorageValue(cid,STORAGE_HERE) == -1 then
doPlayerSendTextMessage(cid,25,"You have found ITEM_HERE.")
doPlayerAddItem(cid,ITEM_ID_HERE,1)
setPlayerStorageValue(cid,STORAGE_HERE,1)
else
doPlayerSendTextMessage(cid,25,"This body has been looted already.")
end
end
return TRUE
end
just use quest system... set action id to 2000
Set uniqueID X to the corpse
actions.xml
LUA:<action uniqueid="STORAGE_HERE" event="script" value="quests/yourscript.lua"/> <!-- brief description of the quest, so you can easily identify it later -->
quests/yourscript.lua
LUA:function onUse(cid, item, frompos, item2, topos) if item.uid == STORAGE_HERE then if getPlayerStorageValue(cid,STORAGE_HERE) == -1 then doPlayerSendTextMessage(cid,25,"You have found ITEM_HERE.") doPlayerAddItem(cid,ITEM_ID_HERE,1) setPlayerStorageValue(cid,STORAGE_HERE,1) else doPlayerSendTextMessage(cid,25,"This body has been looted already.") end end return TRUE end
You also have to set the corpse ID in actions.xml.
with the map editoryou should put the action ID in the corpes and then edit it from the scripts.
[[COLOR="red"][B]2001[/B][/COLOR]] = [COLOR="#4169e1"][B]30015[/B][/COLOR],[COLOR="lime"] --Demon Helmet (DHQ)[/COLOR]
[[COLOR="red"][B]2002[/B][/COLOR]] = [COLOR="#4169e1"][B]30016[/B][/COLOR], [COLOR="lime"]--Demon Shield (DHQ)[/COLOR]
[[COLOR="red"][B]2003[/B][/COLOR]] = [COLOR="#4169e1"][B]30017[/B][/COLOR], [COLOR="lime"]--Steel Boots (DHQ)[/COLOR]
[[COLOR="red"][B]2004[/B][/COLOR]] = [COLOR="#4169e1"][B]30018[/B][/COLOR], [COLOR="lime"]--POI main[/COLOR]
<action actionid="2001-2004" event="script" value="quests/system.lua"/>