• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Animate dead in area

goesraphael

Member
Joined
Apr 4, 2017
Messages
59
Solutions
1
Reaction score
9
Hello, when I use the rune Animate Dead in a minotaur corpse for example, it only make 1 skeleton even if have more than 1 dead minotaur around, but the rune should work in area to summon more than 1 skeleton if there are more than 1 minotaur corpse, anyone can help me change this script to be in area and summon more than 1 skell at time?

Lua:
local function doTargetCorpse(cid, position)
    position.stackpos = 255
    local corpse = getThingFromPos(position)
    if(corpse.uid > 0 and isCorpse(corpse.uid) and isMoveable(corpse.uid) and getCreatureSkullType(cid) ~= SKULL_BLACK) then
        doRemoveItem(corpse.uid)
        doConvinceCreature(cid, doCreateMonster("Skeleton", position))

        doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
        return true
    end

    doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
    doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
    return false
end

function onCastSpell(cid, var)
    local position = variantToPosition(var)
    if(position.x ~= 0 and position.y ~= 0) then
        return doTargetCorpse(cid, position)
    end

    doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
    doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
    return false
end
 
Back
Top