Thorn
Spriting since 2013
Hello guys, i have the latest tfs, and drowning condition doesn't dissapear after players get out of water, check this is what i have:
oh and btw i have check other thread with the same problem but none of them helped me
xml:
does anyone know why this happens?
oh and btw i have check other thread with the same problem but none of them helped me
xml:
Code:
<!-- Swimming -->
<movevent event="StepIn" fromid="4620" toid="4625" script="swimming.lua" />
<movevent event="StepOut" fromid="4620" toid="4625" script="swimming.lua" />
<movevent event="StepIn" fromid="4820" toid="4825" script="swimming.lua" />
<movevent event="StepOut" fromid="4820" toid="4825" script="swimming.lua" />
<movevent event="StepIn" itemid="5405" script="drowning.lua" />
<movevent event="StepOut" itemid="5405" script="drowning.lua" />
Code:
local condition = Condition(CONDITION_DROWN)
condition:setParameter(CONDITION_PARAM_PERIODICDAMAGE, -20)
condition:setParameter(CONDITION_PARAM_TICKS, -1)
condition:setParameter(CONDITION_PARAM_TICKINTERVAL, 2000)
function onStepIn(creature, item, position, fromPosition)
if creature:isPlayer() then
if math.random(1, 10) == 1 then
position:sendMagicEffect(CONST_ME_BUBBLES)
end
creature:addCondition(condition)
end
return true
end
function onStepOut(creature, item, position, fromPosition)
if not creature:isPlayer() then
creature:removeCondition(CONDITION_DROWN)
end
return true
end
does anyone know why this happens?