Mateus Robeerto
Excellent OT User
I'll explain step by step how to add an animated effect to display the number of healing and mana.
Here is an example of the original UH (ultimate_healing) spell. TFS 1.5 8.0 Nekiro.
Let's work on how to correctly replace the proper place.
for this
Look how the end result is here.
In green color it is 12, if you want to change it, just modify that line.
See the GIF to check the result
Please, after making the changes or modifications, let us know here so we know if it worked or not.
Note: For those of you who don't have text animation in your source, you need to add it to the source for the animated text display to work correctly.
Hope you enjoyed this script.
Here is an example of the original UH (ultimate_healing) spell. TFS 1.5 8.0 Nekiro.
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
function onGetFormulaValues(player, level, magicLevel)
local min = (level / 5) + (magicLevel * 6.8) + 42
local max = (level / 5) + (magicLevel * 12.9) + 90
return min, max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(creature, variant)
return combat:execute(creature, variant)
end
Let's work on how to correctly replace the proper place.
Lua:
return min, max
for this
Lua:
local totalIncrease = math.random(min, max)
local formattedText = string.format("+%d", totalIncrease)
doSendAnimatedText(formattedText, getPlayerPosition(cid), 12)
return totalIncrease, totalIncrease
Look how the end result is here.
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
function onGetFormulaValues(player, level, magicLevel)
local min = (level / 5) + (magicLevel * 6.8) + 42
local max = (level / 5) + (magicLevel * 12.9) + 90
local totalIncrease = math.random(min, max)
local formattedText = string.format("+%d", totalIncrease)
Game.sendAnimatedText(formattedText, player:getPosition(), 12)
return totalIncrease, totalIncrease
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(creature, variant)
return combat:execute(creature, variant)
end
In green color it is 12, if you want to change it, just modify that line.
Lua:
doSendAnimatedText(formattedText, getPlayerPosition(cid), 12)
See the GIF to check the result
Please, after making the changes or modifications, let us know here so we know if it worked or not.
Note: For those of you who don't have text animation in your source, you need to add it to the source for the animated text display to work correctly.
Animated Text Support for OT Client 10.98/99 - TFS 1.3
I discovered that OT Client can support animated text in higher client versions of tibia. To do this its very simple. Open up compat.lua and find function doSendAnimatedText() debugPrint("Deprecated function.") return true end and replace it with this function doSendAnimatedText(message...
otland.net
Hope you enjoyed this script.
Last edited: