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

RevScripts convert this double shoot arrow spell to lua revscript for canary

ForgottenNot

Member
Joined
Feb 10, 2023
Messages
289
Reaction score
24
HI
as title says, please and thank yoiu
LUA:
local combat = Combat()
local time_between_hits = 0.3 --seconds

combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
--combat:setParameter(COMBAT_PARAM_EFFECT, 66)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ARROW)
combat:setArea(createCombatArea(AREA_SQUARE1X1))

function onGetFormulaValues(player, level, maglevel)
    local min = (level / 5) + (maglevel * 2.5) + 30
    local max = (level / 5) + (maglevel * 2.5) + 30
    return -min, -max
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(creature, var)
   combat:execute(creature, var)
  addEvent(function()  combat:execute(creature, var) end, time_between_hits * 1000)
  addEvent(function()  combat:execute(creature, var) end, time_between_hits * 1000)
  return true
end
 
solved i think
LUA:
local combat = Combat()
local time_between_hits = 0.3 --seconds

combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
--combat:setParameter(COMBAT_PARAM_EFFECT, 66)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ARROW)
combat:setArea(createCombatArea(AREA_SQUARE1X1))

local spell = Spell("instant")

function onGetFormulaValues(player, level, maglevel)
    local min = (level / 5) + (maglevel * 2.5) + 30
    local max = (level / 5) + (maglevel * 2.5) + 30
    return -min, -max
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(creature, var)
   combat:execute(creature, var)
  addEvent(function()  combat:execute(creature, var) end, time_between_hits * 1000)
  addEvent(function()  combat:execute(creature, var) end, time_between_hits * 1000)
  return true
end

spell:name("hunter2")
spell:words("###92")
spell:isAggressive(true)
spell:blockWalls(false)
spell:needTarget(true)
spell:needLearn(false)
spell:register()
 
solved i think
LUA:
local combat = Combat()
local time_between_hits = 0.3 --seconds

combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
--combat:setParameter(COMBAT_PARAM_EFFECT, 66)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ARROW)
combat:setArea(createCombatArea(AREA_SQUARE1X1))

local spell = Spell("instant")

function onGetFormulaValues(player, level, maglevel)
    local min = (level / 5) + (maglevel * 2.5) + 30
    local max = (level / 5) + (maglevel * 2.5) + 30
    return -min, -max
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(creature, var)
   combat:execute(creature, var)
  addEvent(function()  combat:execute(creature, var) end, time_between_hits * 1000)
  addEvent(function()  combat:execute(creature, var) end, time_between_hits * 1000)
  return true
end

spell:name("hunter2")
spell:words("###92")
spell:isAggressive(true)
spell:blockWalls(false)
spell:needTarget(true)
spell:needLearn(false)
spell:register()

Safer way, so you don't crash.
LUA:
local hitAmount = 3
local time_between_hits = 300 -- milliseconds

local combat = Combat()

combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
--combat:setParameter(COMBAT_PARAM_EFFECT, 66)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ARROW)
combat:setArea(createCombatArea(AREA_SQUARE1X1))

local spell = Spell("instant")

function onGetFormulaValues(player, level, maglevel)
    local min = (level / 5) + (maglevel * 2.5) + 30
    local max = (level / 5) + (maglevel * 2.5) + 30
    return -min, -max
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

local function castSpell(creatureId, var)
    local creature = Creature(creatureId)
    if not creature then
        return
    end
    combat:execute(creature, var)
end

function onCastSpell(creature, var)
    local creatureId = creature:getId()
    for i = 1, hitAmount do
        addEvent(castSpell, time_between_hits * (i - 1), creatureId, var)
    end
    return true
end

spell:name("hunter2")
spell:words("###92")
spell:isAggressive(true)
spell:blockWalls(false)
spell:needTarget(true)
spell:needLearn(false)
spell:register()
 
LUA:
local combat = Combat()
local timeBetweenHits = 0.3 -- seconds

combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ARROW)
combat:setArea(createCombatArea(AREA_SQUARE1X1))

local spell = Spell("instant")

function onGetFormulaValues(player, level, maglevel)
    local min = (level / 5) + (maglevel * 2.5) + 30
    local max = (level / 5) + (maglevel * 2.5) + 30
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant)
    local function executeCombat()
        combat:execute(creature, variant)
    end
    
    executeCombat() -- First hit
    addEvent(executeCombat, timeBetweenHits * 1000) -- Second hit after 0.3 seconds
    addEvent(executeCombat, timeBetweenHits * 2000) -- Third hit after 0.6 seconds
    return true
end

spell:name("hunter2")
spell:words("###92") -- Replace with actual magic words
spell:isAggressive(true)
spell:blockWalls(false)
spell:needTarget(true)
spell:needLearn(false)
spell:register()
 
Safer way, so you don't crash.
LUA:
local hitAmount = 3
local time_between_hits = 300 -- milliseconds

local combat = Combat()

combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
--combat:setParameter(COMBAT_PARAM_EFFECT, 66)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ARROW)
combat:setArea(createCombatArea(AREA_SQUARE1X1))

local spell = Spell("instant")

function onGetFormulaValues(player, level, maglevel)
    local min = (level / 5) + (maglevel * 2.5) + 30
    local max = (level / 5) + (maglevel * 2.5) + 30
    return -min, -max
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

local function castSpell(creatureId, var)
    local creature = Creature(creatureId)
    if not creature then
        return
    end
    combat:execute(creature, var)
end

function onCastSpell(creature, var)
    local creatureId = creature:getId()
    for i = 1, hitAmount do
        addEvent(castSpell, time_between_hits * (i - 1), creatureId, var)
    end
    return true
end

spell:name("hunter2")
spell:words("###92")
spell:isAggressive(true)
spell:blockWalls(false)
spell:needTarget(true)
spell:needLearn(false)
spell:register()
thank you al always it solved few uses that i was facing.appreciate your work/help very much
edit: this pops up in console i think its my fault can you help me?

[2024-07-08 09:45:47.909] [error] [Monsters::deserializeSpell] - Hunter unknown or missing parameter on spell with name: hunter2
[2024-07-08 09:45:47.909] [warning] [readSpell] - Monster Hunter: Loading spell hunter2. Parameter type applies only for condition and combat.
[2024-07-08 09:45:47.910] [error] [Monsters::deserializeSpell] - Hunter unknown or missing parameter on spell with name: hunter2
 
thank you al always it solved few uses that i was facing.appreciate your work/help very much
edit: this pops up in console i think its my fault can you help me?

[2024-07-08 09:45:47.909] [error] [Monsters::deserializeSpell] - Hunter unknown or missing parameter on spell with name: hunter2
[2024-07-08 09:45:47.909] [warning] [readSpell] - Monster Hunter: Loading spell hunter2. Parameter type applies only for condition and combat.
[2024-07-08 09:45:47.910] [error] [Monsters::deserializeSpell] - Hunter unknown or missing parameter on spell with name: hunter2
Spells is my weakest area.. but try this, make sure to update id

LUA:
local hitAmount = 3
local time_between_hits = 300 -- milliseconds

local combat = Combat()

combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
--combat:setParameter(COMBAT_PARAM_EFFECT, 66)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ARROW)
combat:setArea(createCombatArea(AREA_SQUARE1X1))

function onGetFormulaValues(player, level, maglevel)
    local min = (level / 5) + (maglevel * 2.5) + 30
    local max = (level / 5) + (maglevel * 2.5) + 30
    return -min, -max
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

local function castSpell(creatureId, var)
    local creature = Creature(creatureId)
    if not creature then
        return
    end
    combat:execute(creature, var)
end

local spell = Spell(SPELL_INSTANT)

function spell.onCastSpell(creature, var)
    local creatureId = creature:getId()
    for i = 1, hitAmount do
        addEvent(castSpell, time_between_hits * (i - 1), creatureId, var)
    end
    return true
end

spell:name("hunter2")
spell:id(11111) -- check spells.xml for the next free id
spell:words("###92")
spell:isAggressive(true)
spell:blockWalls(false)
spell:needTarget(true)
spell:needLearn(false)
spell:register()
 
Spells is my weakest area.. but try this, make sure to update id

LUA:
local hitAmount = 3
local time_between_hits = 300 -- milliseconds

local combat = Combat()

combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
--combat:setParameter(COMBAT_PARAM_EFFECT, 66)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ARROW)
combat:setArea(createCombatArea(AREA_SQUARE1X1))

function onGetFormulaValues(player, level, maglevel)
    local min = (level / 5) + (maglevel * 2.5) + 30
    local max = (level / 5) + (maglevel * 2.5) + 30
    return -min, -max
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

local function castSpell(creatureId, var)
    local creature = Creature(creatureId)
    if not creature then
        return
    end
    combat:execute(creature, var)
end

local spell = Spell(SPELL_INSTANT)

function spell.onCastSpell(creature, var)
    local creatureId = creature:getId()
    for i = 1, hitAmount do
        addEvent(castSpell, time_between_hits * (i - 1), creatureId, var)
    end
    return true
end

spell:name("hunter2")
spell:id(11111) -- check spells.xml for the next free id
spell:words("###92")
spell:isAggressive(true)
spell:blockWalls(false)
spell:needTarget(true)
spell:needLearn(false)
spell:register()
same problem in console man :c
LUA:
ions/47.lua: No such file or directory
[2024-07-08 23:23:29.980] [warning] [Spells::registerInstantLuaEvent] - Duplicate registered instant spell with words: ###182, on spell with name: lord of the elements paralyze
[2024-07-08 23:23:30.677] [warning] [readSpell] - Monster Hunter: Loading spell hunter2. Parameter type applies only for condition and combat.
[2024-07-08 23:23:30.677] [warning] [readSpell] - Monster Hunter: Loading spell hunter2. Parameter type applies only for condition and combat.
 

Similar threads

Back
Top