mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-14 06:34:55 +02:00
Full Distribution
This commit is contained in:
20
data/actions/lib/actions.lua
Normal file
20
data/actions/lib/actions.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
function doDestroyItem(target)
|
||||
if not target:isItem() then
|
||||
return false
|
||||
end
|
||||
|
||||
local itemType = ItemType(target:getId())
|
||||
if not itemType:isDestroyable() then
|
||||
return false
|
||||
end
|
||||
|
||||
if math.random(1,10) <= 3 then
|
||||
target:transform(itemType:getDestroyTarget())
|
||||
target:decay()
|
||||
target:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT)
|
||||
else
|
||||
target:getPosition():sendMagicEffect(CONST_ME_POFF)
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
Reference in New Issue
Block a user