tfs 1.3
I have 2 spells, one that applies a fire DOT and another that increases damage if Player has the DOT.
the DOT is for 5 turns, but when you use the spell more than once on the target the spell reaches more than 15/20dots depending on when I use it.
there is some usual form of 5 shifts
I want to know why this is happening.
dot
dano
I tested using this
but I don't know how to make the other script check this and remove
I have 2 spells, one that applies a fire DOT and another that increases damage if Player has the DOT.
the DOT is for 5 turns, but when you use the spell more than once on the target the spell reaches more than 15/20dots depending on when I use it.
there is some usual form of 5 shifts
I want to know why this is happening.
dot
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_FIREATTACK)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
local condition = Condition(CONDITION_FIRE)
condition:setParameter(CONDITION_PARAM_DELAYED, 1)
function onGetFormulaValues(player, level, maglevel)
local min = 50
local max = 50
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(creature, var)
condition:addDamage(5,1000, -20)
combat:addCondition(condition)
combat:execute(creature, var)
return true
end
dano
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ICEAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)
local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ICEAREA)
combat2:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)
local ticks = 3 -- Enter the amount of seconds between each damage tick
local repeats = 3 -- Enter the amount of times you want this damage to repeat
function onGetFormulaValues(player, level, maglevel)
local min = 10
local max = 10
return -min, -max
end
function onGetFormulaValuess(player, level, maglevel)
local min = 50
local max = 50
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
combat2:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValuess")
function onCastSpell(creature, var)
local target = creature:getTarget()
if target:getCondition(CONDITION_FIRE) then
combat2:setParameter(COMBAT_PARAM_DISPEL, CONDITION_FIRE)
combat2:execute(creature, var)
else
combat:execute(creature, var)
end
return true
end
Post automatically merged:
I tested using this
Lua:
condition:setParameter(CONDITION_PARAM_PERIODICDAMAGE, -20)
but I don't know how to make the other script check this and remove