Aeronx
Intermediate OT User
- Joined
- Dec 17, 2015
- Messages
- 736
- Solutions
- 9
- Reaction score
- 121
Hello all! I have this spell, that hits twice. But i cant make it to hit more than twice! I've tried, adding more events, but it doesnt work. I know it might be super easy, but can't get it solved! Anyone that could lend me a hand please? Thanks for you time!
Code:
local combat = Combat()
local time_between_hits = 0.1 --seconds
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_THROWINGSTAR)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, 1)
function onGetFormulaValues(player, attack, factor)
local skillTotal = 2 * player:getEffectiveSkillLevel(SKILL_SWORD)
local levelTotal = player:getLevel() / 5
return -(((skillTotal + attack / 3500) * 0.35) + (levelTotal) + 0), -(((skillTotal + attack / 3125) * 0.5) + (levelTotal) + 5)
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)
return true
end