I've made script for paralyze rune but i have one problem.
This script requires target to calculate how much speed it has to decrease.
Problem is that you can't throw rune without targeting someone. Example: you won't be able to use rune through battle list.
Does anyone know better way to find rune target that is not targeted?
I was considering doing it through events like
This script requires target to calculate how much speed it has to decrease.
Problem is that you can't throw rune without targeting someone. Example: you won't be able to use rune through battle list.
Does anyone know better way to find rune target that is not targeted?
I was considering doing it through events like
Lua:
Creature:onTargetCombat(target)
Lua:
function onCastSpell(creature, var)
local target = creature:getTarget()
if not target then
creature:sendCancelMessage("You need to target creature first.")
creature:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
local condition = Condition(CONDITION_PARALYZE)
condition:setParameter(CONDITION_PARAM_TICKS, 20000)
condition:setFormula(0, -(target:getSpeed()) + 80, 0, -(target:getSpeed()) + 80)
combat:addCondition(condition)
if not combat:execute(creature, var) then
return false
end
creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
return true
end