Beo
Three Magic
- Joined
- Aug 25, 2009
- Messages
- 9,075
- Solutions
- 1
- Reaction score
- 857
This script will allow you to dig grass, like you was digging sand.
Eg, sand gives you chances to either dig Scarab Coin or dig Scarab, this will enable you to dig grass and gives you chances to dig Crystal Coin or Rubbish.
Insert it into your shovel.lua file
UNTESTED.
This is my second script, so I'm not 100% it will work ^_^
Unknown666's full version;
Eg, sand gives you chances to either dig Scarab Coin or dig Scarab, this will enable you to dig grass and gives you chances to dig Crystal Coin or Rubbish.
LUA:
elseif itemEx.itemid == 4526 then
local rand = math.random (1, 200)
if rand == 1 then
doCreateItem(2160, 1, toPosition)
elseif rand > 55 then
doCreateItem(2242, 1, toPosition)
end
doSendMagicEffect (toPosition, CONST_ME_POFF)
Insert it into your shovel.lua file
UNTESTED.
This is my second script, so I'm not 100% it will work ^_^
Unknown666's full version;
Updated script, for both grass & sand.
LUA:local c,cc = 2.5,2.6 -- chance % for scarab coin[1] and crystal coin[2], so 2.5% chance now to get scarab coin, else summon scarab. You have 2.6% for a crystal coin at grass. local m,s,t = 'Scarab',2821,30*1000 -- monster name, storage, exhaustion time (30*1000), not sure if exhaustion.set uses mseconds. local sand,grass = {4760;4783},{4526;4553} -- fromid;toid, not sure wether ; = toid. function onUse(cid,item,topos,itemEx,frompos) local r = math.random(1,100) if exhaustion.get(cid,s) then doPlayerSendCancel(cid,'Cooldown, try again in '..exhaustion.check(cid,s)..' seconds.') else if isInArray(sand,itemEx.itemid) then if r <= c then exhaustion.set(cid,s,t) doCreateItem(2159,1,topos) doSendMagicEffect(topos,CONST_ME_MAGIC_GREEN) doPlayerSendTextMessage(cid,MESSAGE_FIRST,'You found a scarab coin!') else exhaustion.set(cid,s,t) doCreateMonster(m:lower(),topos) doSendMagicEffect(topos,CONST_ME_POFF) doPlayerSendTextMessage(cid,MESSAGE_FIRST,'You failed digging for scarab coin, you made a '..m..' angry!') end elseif isInArray(grass,itemEx.itemid) then if r <= cc then exhaustion.set(cid,s,t) doCreateItem(2160,1,topos) doSendMagicEffect(topos,CONST_ME_MAGIC_GREEN) doPlayerSendTextMessage(cid,MESSAGE_FIRST,'You found a crystal coin!') else exhaustion.set(cid,s,t) doCreateItem(math.random(2223,2224),1,topos) doSendMagicEffect(topos,CONST_ME_POFF) doPlayerSendTextMessage(cid,MESSAGE_FIRST,'You failed digging for a crystal coin, however, you got some rubbish though.') end else doPlayerSendCancel(cid,'Invalid tile.') end end return true end
Last edited: