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

spells reset

Mateus Robeerto

Excellent OT User
Joined
Jun 5, 2016
Messages
1,337
Solutions
71
Reaction score
697
Location
ლ(ಠ益ಠლ)
Does anyone know how I convert to 1.2 8.0
[C]: in function '__index'
data/lib/compat/compat.lua:141: in function 'doCombat'
data/spells/scripts/Exevo Gran Mas Flam.lua:209: in function <data/spells/scripts/Exevo Gran Mas Flam.lua:207>
Lua:
function onCastSpell(cid, var)
if getPlayerStorageValue(cid, 378378) >=1 then
doCombat(cid, combat, var) ---- where was error here <<
return true
else
doPlayerSendCancel(cid, "You need to have at least 1 resets to cast this spell.")
return false
end
end
if i remove this part.. the spell is normally working, i just wanted this spell just reset... someone help me pls
 
Does anyone know how I convert to 1.2 8.0

Lua:
function onCastSpell(cid, var)
if getPlayerStorageValue(cid, 378378) >=1 then
doCombat(cid, combat, var) ---- where was error here <<
return true
else
doPlayerSendCancel(cid, "You need to have at least 1 resets to cast this spell.")
return false
end
end
if i remove this part.. the spell is normally working, i just wanted this spell just reset... someone help me pls

Lua:
function onCastSpell(player, variant)
    if player:getStorageValue(378378) < 1 then -- means if your storage is under 1 you cant cast it
        player:sendChannelMessage('You cant use sry')
        return false
    end
    -- Do stuff like combat:execute(player, variant)
    return true
end
 
data/lib/compat/compat.lua
looked in data/lib/compat/compat.lua
function doCombat(cid, combat, var) return combat:execute(cid, var) end is that it? I didn't understand very well.. I'm not a very good scripter ;/, can you explain to me how it works?
Post automatically merged:

Lua:
function onCastSpell(player, variant)
    if player:getStorageValue(378378) < 1 then -- means if your storage is under 1 you cant cast it
        player:sendChannelMessage('You cant use sry')
        return false
    end
    -- Do stuff like combat:execute(player, variant)
    return true
end
I copied and put my magic.. I put 5 reset to be able to release the magic... with my doll there is 1 reset and still releasing magic ;/, it doesn't work



see the spell script, this spell is custom from my OT xD
Lua:
local combat1 = Combat()
combat1:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat1:setParameter(COMBAT_PARAM_EFFECT, 107)
combat1:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.8, -30, -2.3, 0)

local condition = Condition(CONDITION_PARALYZE)
condition:setParameter(CONDITION_PARAM_TICKS, 6000)
condition:setFormula(-0.7, -0, -0.7, -0)
setCombatCondition(combat1, condition)

local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, 107)
combat2:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.8, -30, -2.3, 0)

local condition = Condition(CONDITION_PARALYZE)
condition:setParameter(CONDITION_PARAM_TICKS, 6000)
condition:setFormula(-0.7, -0, -0.7, -0)
setCombatCondition(combat2, condition)

local combat3 = Combat()
combat3:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat3:setParameter(COMBAT_PARAM_EFFECT, 107)
combat3:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.8, -30, -2.3, 0)

local condition = Condition(CONDITION_PARALYZE)
condition:setParameter(CONDITION_PARAM_TICKS, 6000)
condition:setFormula(-0.7, -0, -0.7, -0)
setCombatCondition(combat3, condition)


local combat4 = Combat()
combat4:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat4:setParameter(COMBAT_PARAM_EFFECT, 107)
combat4:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.8, -30, -2.3, 0)

local condition = Condition(CONDITION_PARALYZE)
condition:setParameter(CONDITION_PARAM_TICKS, 6000)
condition:setFormula(-0.7, -0, -0.7, -0)
setCombatCondition(combat4, condition)


local combat5 = Combat()
combat5:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat5:setParameter(COMBAT_PARAM_EFFECT, 107)
combat5:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.8, -30, -2.3, 0)

local condition = Condition(CONDITION_PARALYZE)
condition:setParameter(CONDITION_PARAM_TICKS, 6000)
condition:setFormula(-0.7, -0, -0.7, -0)
setCombatCondition(combat5, condition)

local combat6 = Combat()
combat6:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat6:setParameter(COMBAT_PARAM_EFFECT, 107)
combat6:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.8, -30, -2.3, 0)

local condition = Condition(CONDITION_PARALYZE)
condition:setParameter(CONDITION_PARAM_TICKS, 6000)
condition:setFormula(-0.7, -0, -0.7, -0)
setCombatCondition(combat6, condition)


arr1 = {
{0, 1, 1, 1, 0},
{1, 1, 1, 1, 1},
{1, 1, 2, 1, 1},
{1, 1, 1, 1, 1},
{0, 1, 1, 1, 0},
}



arr2 = {
{0, 1, 1, 1, 0},
{1, 1, 1, 1, 1},
{1, 1, 2, 1, 1},
{1, 1, 1, 1, 1},
{0, 1, 1, 1, 0},
}

arr3 = {
{0, 1, 1, 1, 0},
{1, 1, 1, 1, 1},
{1, 1, 2, 1, 1},
{1, 1, 1, 1, 1},
{0, 1, 1, 1, 0},
}

arr4 = {
{0, 1, 1, 1, 0},
{1, 1, 1, 1, 1},
{1, 1, 2, 1, 1},
{1, 1, 1, 1, 1},
{0, 1, 1, 1, 0},
}


arr5 = {
{0, 1, 1, 1, 0},
{1, 1, 1, 1, 1},
{1, 1, 2, 1, 1},
{1, 1, 1, 1, 1},
{0, 1, 1, 1, 0},
}


arr6 = {
{0, 1, 1, 1, 0},
{1, 1, 1, 1, 1},
{1, 1, 2, 1, 1},
{1, 1, 1, 1, 1},
{0, 1, 1, 1, 0},
}

local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)
local area5 = createCombatArea(arr5)
local area6 = createCombatArea(arr6)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat3, area3)
setCombatArea(combat4, area4)
setCombatArea(combat5, area5)
setCombatArea(combat6, area6)


local function onCastSpell1(parameters)
   local player= Player(parameters.cid)
   combat:execute(player, parameters.var)
end

local function onCastSpell2(parameters)
   local player= Player(parameters.cid)
   combat:execute(player, parameters.var)
end

local function onCastSpell3(parameters)
   local player= Player(parameters.cid)
   combat:execute(player, parameters.var)
end

local function onCastSpell4(parameters)
   local player= Player(parameters.cid)
   combat:execute(player, parameters.var)
end

local function onCastSpell5(parameters)
   local player= Player(parameters.cid)
   combat:execute(player, parameters.var)
end

local function onCastSpell6(parameters)
   local player= Player(parameters.cid)
   combat:execute(player, parameters.var)
end

local exhausted_seconds = 25 -- Segundos que o Player Poderá castar a spell novamente
local exhausted_storagevalue = 6345 -- Storage Value do Cool Down




local function cooldown(cid)
    local player = Player(cid)
    if player then
        player:sendTextMessage(MESSAGE_STATUS_WARNING, 'CD: Chamas da Escuridão.')
    end
end

function onCastSpell(creature, variant)
    local exhaustEnd = creature:getStorageValue(exhausted_storagevalue)
    if os.time() < exhaustEnd then
        creature:sendCancelMessage('O Cooldown não está pronto.')
        return false
    end
    
    function onCastSpell(player, variant)
    if player:getStorageValue(378378) < 5 then -- means if your storage is under 1 you cant cast it
        player:sendChannelMessage('you need to be 5 reset')
        return false
    end
    -- Do stuff like combat:execute(player, variant)
    return true
end
    

   local function spell4(cid)
        local creature = Player(cid)
        combat4:execute(creature, variant)
    end

    local function spell3(cid)
        local creature = Player(cid)
        addEvent(spell4, 750, cid)
        return combat3:execute(creature, variant)
    end

    local function spell2(cid)
        local creature = Player(cid)
        addEvent(spell3, 750, cid)
        return combat2:execute(creature, variant)
    end

    local function spell1(cid)
        local creature = Player(cid)
        addEvent(spell2, 750, cid)
        return combat1:execute(creature, variant)
    end

    local cid = creature:getId()
    addEvent(spell1, 700, cid)
    addEvent(cooldown, 30000, cid)
    creature:setStorageValue(exhausted_storagevalue, os.time() + exhausted_seconds)

    return true
end
 
Back
Top