• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Spell for paladin using distance skill + attack

Edroniasty

New Member
Joined
Oct 2, 2015
Messages
84
Reaction score
1
Hello! I don't know how to make this works

Code:
function onGetFormulaValues(player, skill, attack, factor)
    local skill = player:getEffectiveSkillLevel(SKILL_DISTANCE)
    local min = (player:getLevel() * 0) + (skill * attack * 1) + 0
    local max = (player:getLevel() * 0) + (skill * attack * 1) + 0
    return -min, -max
end

I have problem with dmg, script don't do that dmg what I wanted, probarly don't use distance skill I don't know what's wrong

I tried many combinations of formula values, dmg should be with skill 100 and distance weapon attack 100 * 1 =820.000 but my dmg is 738 why?

full spell
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FLASHARROW)
function onGetFormulaValues(player, skill, attack, factor)
    local skill = player:getEffectiveSkillLevel(SKILL_DISTANCE)
    local min = (player:getLevel() * 0) + (skill * attack * 1) + 0
    local max = (player:getLevel() * 0) + (skill * attack * 1) + 0
    return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
local function executeAttack(cid, variant, i, j)
    local player = Player(cid)
    if not player then
        return
    end
    if i >= j then
        return
    end
    addEvent(executeAttack, 200, cid, variant, i + 1, j)
    return combat:execute(player, variant)
end
function onCastSpell(creature, variant, isHotkey)
    return executeAttack(creature:getId(), variant, 0, 5)
end
 
This formula doesn't seem to be of use
C++:
local min = (player:getLevel() * 0) + (skill * attack * 1) + 0
    local max = (player:getLevel() * 0) + (skill * attack * 1) + 0
Hypothetical level (1 x 0) + (100 x 100 x 1) + 0 for both min and max, if level is not a factor then you should just omit it entirely because anything times 0 is always 0.

Maybe the script is confused by your intentions you have skill as an argument and then you have a local skill, the two skill variables aren't the same.
LUA:
function onGetFormulaValues(player, skill, attack, factor)
    local skill = player:getEffectiveSkillLevel(SKILL_DISTANCE)
    local min = (player:getLevel() * 0) + (skill * attack * 1) + 0
    local max = (player:getLevel() * 0) + (skill * attack * 1) + 0
    return -min, -max
end
I would do something like this.
LUA:
function onGetFormulaValues(player, skill, attack, factor)
    local distance = player:getEffectiveSkillLevel(SKILL_DISTANCE)
    local value = distance * attack
    return -(math.floor(value / 2)), -value
end
 
Back
Top