Full Distribution

This commit is contained in:
rasanpedromujica
2019-01-16 17:16:38 -05:00
commit 009a571331
1258 changed files with 185603 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
local humanBodies = {
4240, 4241, 4247, 4248
}
function onCastSpell(creature, variant)
local position = Variant.getPosition(variant)
local tile = Tile(position)
if tile then
local corpse = tile:getTopDownItem()
if corpse then
local itemType = corpse:getType()
if not table.contains(humanBodies, itemType:getId()) then
if itemType:isCorpse() and itemType:isMovable() then
local monster = Game.createMonster("Skeleton", position)
if monster then
corpse:remove()
monster:setMaster(creature)
position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
return true
end
end
end
end
end
creature:getPosition():sendMagicEffect(CONST_ME_POFF)
creature:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
return false
end