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

(SOLVED) RevScript Spells problem

Mr Noxi

Noxus Otserver
Joined
May 13, 2010
Messages
272
Solutions
3
Reaction score
94
Location
Sweden
Hey!

So i have these 2 revScript spells but they are sharing cooldown with eachother and idk why. I dont want itttt

Here is the spell, the other spells has excat same function but with "spell2" insted of spell1".

What have i missed, is there any easy fix or?

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
combat:setArea(createCombatArea(AREA_CIRCLE3X3))
local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
combat2:setArea(createCombatArea(AREA_CIRCLE3X3))

function onGetFormulaValues(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 9.0) + 700
    local max = (level / 5) + (magicLevel * 13.0) + 700
    return -min, -max
end

function onGetFormulaValues2(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 9.0) + 750
    local max = (level / 5) + (magicLevel * 15.0) + 710
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
combat2:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues2")

local function secondSpell(cid, variant)
    local creature = Creature(cid)
    if not creature then return end
    return combat2:execute(creature, variant)
end

local spell1 = Spell(SPELL_INSTANT)

function spell1.onCastSpell(creature, variant, isHotkey)
    combat:execute(creature, variant)
    addEvent(secondSpell, 500, creature:getId(), variant)
    return true
end

spell1:name("Test1")
spell1:words("test1")
spell1:group("attack")
spell1:vocation("Paladin", "Royal paladin")
spell1:cooldown(2500)
spell1:level(600)
spell1:mana(400)
spell1:blockWalls(true)
spell1:register()


Thankksss
 
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
combat:setArea(createCombatArea(AREA_CIRCLE3X3))

local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
combat2:setArea(createCombatArea(AREA_CIRCLE3X3))

function onGetFormulaValues(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 9.0) + 700
    local max = (level / 5) + (magicLevel * 13.0) + 700
    return -min, -max
end

function onGetFormulaValues2(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 9.0) + 750
    local max = (level / 5) + (magicLevel * 15.0) + 710
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
combat2:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues2")

local spell1 = Spell(SPELL_INSTANT)
function spell1.onCastSpell(creature, variant, isHotkey)
    return combat:execute(creature, variant)
end

spell1:name("Test1")
spell1:words("test1")
spell1:group("attack")
spell1:vocation("Paladin", "Royal paladin")
spell1:cooldown(2500)
spell1:level(600)
spell1:mana(400)
spell1:blockWalls(true)
spell1:register()

local spell2 = Spell(SPELL_INSTANT)
function spell2.onCastSpell(creature, variant, isHotkey)
    return combat2:execute(creature, variant)
end

spell2:name("Test2")
spell2:words("test2")
spell2:group("attack")
spell2:vocation("Paladin", "Royal paladin")
spell2:cooldown(2500)
spell2:level(600)
spell2:mana(400)
spell2:blockWalls(true)
spell2:register()
 
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
combat:setArea(createCombatArea(AREA_CIRCLE3X3))

local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
combat2:setArea(createCombatArea(AREA_CIRCLE3X3))

function onGetFormulaValues(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 9.0) + 700
    local max = (level / 5) + (magicLevel * 13.0) + 700
    return -min, -max
end

function onGetFormulaValues2(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 9.0) + 750
    local max = (level / 5) + (magicLevel * 15.0) + 710
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
combat2:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues2")

local spell1 = Spell(SPELL_INSTANT)
function spell1.onCastSpell(creature, variant, isHotkey)
    return combat:execute(creature, variant)
end

spell1:name("Test1")
spell1:words("test1")
spell1:group("attack")
spell1:vocation("Paladin", "Royal paladin")
spell1:cooldown(2500)
spell1:level(600)
spell1:mana(400)
spell1:blockWalls(true)
spell1:register()

local spell2 = Spell(SPELL_INSTANT)
function spell2.onCastSpell(creature, variant, isHotkey)
    return combat2:execute(creature, variant)
end

spell2:name("Test2")
spell2:words("test2")
spell2:group("attack")
spell2:vocation("Paladin", "Royal paladin")
spell2:cooldown(2500)
spell2:level(600)
spell2:mana(400)
spell2:blockWalls(true)
spell2:register()
I dont think u understood my question correctly dear, i know how to make them 2 separate spells, i just dont want them to share cooldown.

Exampel
Player uses test1 spell with 2,5 s cooldown
Player can use test2 spell with 5s cooldown after 2,5 sec.

Player uses test2 spell with 5s cooldown.
Player cannot use test1 spell with 2,5 s cooldown untill cooldown on 5 sec from test2 spell.
 
Set a low group cooldown.

This sample: 4 seconds spell cooldown, but only 1 second group cooldown.
Lua:
spell:cooldown(4 * 1000)
spell:groupCooldown(1 * 1000)

So you cannot spam the same spell, but you can quickly cast another spell in the same spell group.
 
Back
Top