A really simple script, you just use closed seashells(7552) and you may get a giant shimmering pearl, you may squeeze your fingers, or you may just not get anything.
Actions.xml
seashell.lua
And finally:
items.xml
And that's it, hope you like it.
Actions.xml
Code:
<action itemid="7552-7553" event="script" value="other/seashell.lua" />
seashell.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local CHANCES = math.random(100)
if item.itemid == 7552 then
if CHANCES <= 20 then
doPlayerAddItem(cid,math.random(7632,7633),1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You found a giant shimmering pearl.")
doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
elseif CHANCES <= 60 then
doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -100, -200, CONST_ME_NONE)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You squeezed your fingers.")
doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You found nothing.")
doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
end
doTransformItem(item.uid,item.itemid+1)
doDecayItem(item.uid)
elseif item.itemid == 7553 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
end
return true
end
And finally:
items.xml
Code:
<item id="7552" article="a" name="large seashell">
<attribute key="description" value="Maybe there's something inside of it."/>
</item>
<item id="7553" article="a" name="large seashell">
<attribute key="description" value="It is empty."/>
<attribute key="decayTo" value="7552"/>
<attribute key="duration" value="86400"/>
</item>
Code:
<item id="7632" article="a" name="giant shimmering pearl" plural="giant shimmering pearls">
<attribute key="weight" value="80"/>
</item>
<item id="7633" article="a" name="giant shimmering pearl" plural="giant shimmering pearls">
<attribute key="weight" value="80"/>
</item>
And that's it, hope you like it.