Hi guys,
A while ago, @amatria create the script bellow for me, that when the player has mana shield a effect keep on loop. It works just as I needed, but now I want to put a loop on another condition, "condition:setParameter(CONDITION_PARAM_SKILL_SWORDPERCENT, 150)". I'm not sure how to do it, because mana shield and sword percent are very different types of conditions, I will be glad if someone can help.
link for the original mana shield loop:
A while ago, @amatria create the script bellow for me, that when the player has mana shield a effect keep on loop. It works just as I needed, but now I want to put a loop on another condition, "condition:setParameter(CONDITION_PARAM_SKILL_SWORDPERCENT, 150)". I'm not sure how to do it, because mana shield and sword percent are very different types of conditions, I will be glad if someone can help.
Lua:
-- time in seconds
local effectInterval = 2
local intervalStorage = 9999
local manaShieldEffect = CreatureEvent("ManaShieldEffect")
manaShieldEffect:type("think")
function manaShieldEffect.onThink(creature, interval)
local player = Player(creature)
if not player:hasCondition(CONDITION_MANASHIELD) then -- thats the part I'm having trouble with. Swordpercent is a conditon attribute
return false
end
if os.time() - player:getStorageValue(intervalStorage) < effectInterval then
return false
end
local position = player:getPosition()
local effectPosition = Position({x = position.x+1, y = position.y+1, z = position.z})
effectPosition:sendMagicEffect(2)
player:setStorageValue(intervalStorage, os.time())
return true
end
manaShieldEffect:register()
local registerEvent = CreatureEvent("RegisterManaShieldEffect")
registerEvent:type("login")
function registerEvent.onLogin(player)
player:registerEvent("ManaShieldEffect")
return true
end
registerEvent:register()
link for the original mana shield loop:
Lua - TFS 1.3 how to make a effect loop for the duration of a spell?
Hello guys, I would like for a effect to keep on loop for the whole duration of utamo vita. Let's say for example that I would like the blue spark effect to keep on loop for the entire time player has utamo vita, how would I put this? I've tried to look at utana vid for example, but I believe...
otland.net