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

Lua spell with always hit same

darknelson

Member
Joined
Jun 19, 2011
Messages
190
Solutions
1
Reaction score
15
hey brothers please, help me with this

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_BLOCKSHIELD, true)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGYARROW)


function onGetFormulaValues(player, skill, attack, fightMode)
    local base = 80
    local variation = 20
    local formula = 3 * player:getMagicLevel() + (2 * player:getLevel())
    local damage = formula * base / 100
    damage = damage * attack / 25
    return (250)*-1,(350)*-1
end


combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")


function onCastSpell(creature, variant)
    return combat:execute(creature, variant)
end

im trying my spell hit always the same, but not work when i hit, its spoff and fails and then sometimes return attack good
 
What you mean with the same? You mean like always deal same number? (1k) for example? Try this and tell me if this is what you meant
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_BLOCKSHIELD, true)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGYARROW)

function onGetFormulaValues(player, skill, attack, fightMode)
    return -1000,-1000
end


combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")


function onCastSpell(creature, variant)
    return combat:execute(creature, variant)
end
 
im trying my spell hit always the same, but not work when i hit, its spoff and fails and then sometimes return attack good
It may 'poof' or 'fail' because you have these:
Code:
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_BLOCKSHIELD, true)
which means defense and armor can block that damage.
Set them to false if you don't want the damage to be blocked.
 
Back
Top