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

combat conditions in actions.lua

Darkenes

New Member
Joined
Jan 5, 2014
Messages
19
Solutions
1
Reaction score
4
is there a way to

Lua:
function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end

in this?
Lua:
local holes = {468, 481, 483, 7932, 8579}
local sand = {231, 9059}

function onUse(cid, item, fromPosition, itemEx, toPosition)
local storage = 100
local time = 0 -- time in seconds

    if exhaustion.check(cid, storage) then       
        return true
    end

    if(isInArray(holes, itemEx.itemid)) then
        local newId = itemEx.itemid + 1
        if(itemEx.itemid == 8579) then
            newId = 8585
        end

        exhaustion.set(cid, storage, time)
        doTransformItem(itemEx.uid, newId)
        doDecayItem(itemEx.uid)
    elseif(isInArray(sand, itemEx.itemid)) then
        local rand = math.random(1, 100)
        if(itemEx.actionid  == 100 and rand <= 20) then
            exhaustion.set(cid, storage, time)
            doTransformItem(itemEx.uid, 489)
            doDecayItem(itemEx.uid)
        elseif(rand >= 1 and rand <= 5) then
            doCreateItem(2159, 1, toPosition)
        end

        exhaustion.set(cid, storage, time)
        doSendMagicEffect(toPosition, CONST_ME_POFF)
    end

    return true
end

as if the shovel were an exori vis the same exhausted and the same combat conditions
 
Back
Top