Lada Calena
New Member
- Joined
- Oct 30, 2017
- Messages
- 4
- Reaction score
- 0
When player use arrows of the elements end throws a spell, then instead hit only physical damage, player hits physical damage and elements damage. Where is the problem?
Lua:
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_ETHEREALSPEAR)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
function onGetFormulaValues(player, skill, attack, factor)
local lvl = player:getLevel()
local dyst = player:getSkillLevel(SKILL_DISTANCE)
local min = (lvl / 2.4) + dyst + 5
local max = (lvl / 2.2) + dyst + 8
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(creature, variant)
return combat:execute(creature, variant)
end