Raikou
Well-Known Member
- Joined
- Jul 18, 2007
- Messages
- 145
- Solutions
- 2
- Reaction score
- 54
So i`m trying to make use of this hole, but it doesnt want to open (use shovel and transform to 7933).
These are my server settings:
Items:
Actions:
Shovel:
These are my server settings:
Items:
XML:
<item id="7932" article="a" name="large hole"/>
<item id="7933" article="a" name="large hole">
<attribute key="floorchange" value="down" />
<attribute key="decayTo" value="7932" />
<attribute key="duration" value="600" />
</item>
Actions:
XML:
<action itemid="2554" script="tools/shovel.lua" />
Shovel:
Lua:
local holes = {468, 481, 483, 7932}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local tile = Tile(toPosition)
if not tile then
return false
end
local ground = tile:getGround()
if not ground then
return false
end
local groundId = ground:getId()
if table.contains(holes, groundId) then
ground:transform(groundId + 1)
ground:decay()
toPosition.z = toPosition.z + 1
tile:relocateTo(toPosition)
elseif groundId == 231 then
local randomValue = math.random(1, 100)
if randomValue == 1 then
Game.createItem(2159, 1, toPosition)
elseif randomValue > 95 then
Game.createMonster("Scarab", toPosition)
end
toPosition:sendMagicEffect(CONST_ME_POFF)
else
return false
end
return true
end