• 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!

Animate dead rune

zcorpy

New Member
Joined
Sep 12, 2017
Messages
85
Reaction score
4
Hey mens I need your help to see if the rune animate dead rune that is the one that returns from a body to a skeleton
What I need is to know if you can set a limit to revive only 2 maximum
Thankful to the kind person who helps me
this is my .lua

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
 
Last edited by a moderator:
Solution
change
Lua:
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
for
Lua:
function onCastSpell(cid, var)
    local summons = getCreatureSummons(cid)
    if #summons < 2 then
        local position = variantToPosition(var)
        if(position.x ~= 0 and position.y ~= 0) then
            return doTargetCorpse(cid, position)
        end
    end
    
    doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
    doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
    return...
change
Lua:
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
for
Lua:
function onCastSpell(cid, var)
    local summons = getCreatureSummons(cid)
    if #summons < 2 then
        local position = variantToPosition(var)
        if(position.x ~= 0 and position.y ~= 0) then
            return doTargetCorpse(cid, position)
        end
    end
    
    doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
    doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
    return false
end
 
Solution
change
Lua:
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
for
Lua:
function onCastSpell(cid, var)
    local summons = getCreatureSummons(cid)
    if #summons < 2 then
        local position = variantToPosition(var)
        if(position.x ~= 0 and position.y ~= 0) then
            return doTargetCorpse(cid, position)
        end
    end
   
    doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
    doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
    return false
end

It worked perfectly, thank you very much (y)
 
Back
Top