• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

TFS 1.2 Manarune Heal with Color

Marko999x

ArchezOt soon
Premium User
Joined
Dec 14, 2017
Messages
3,973
Solutions
103
Reaction score
3,106
Location
Germany
Heyo Otland!
I would like to request a manarune which heals in Yellow ( Animated Text )
I heard it should work still with Numbers..
Manarune should heal always 500

TFS 1.2 thanks
 
Solution
actions will work the same for this, but if you insist on using spells:
LUA:
local mana = 500
local color = TEXTCOLOR_YELLOW

function onCastSpell(creature, variant)
    local player = Player(creature)
    if not player then
        return false
    end
    player:addMana(mana)
    player:sendTextMessage(MESSAGE_HEALED, "You have healed ".. mana .. " mana.", player:getPosition(), mana, color)
    return true
end
LUA:
local mana = 500
local color = TEXTCOLOR_YELLOW

function onUse(player, item, fromPosition, target, toPosition)
    player:addMana(mana)
    player:sendTextMessage(MESSAGE_HEALED, "You have healed ".. mana .. " mana.", player:getPosition(), mana, color)
    return true
end
 
LUA:
local mana = 500
local color = TEXTCOLOR_YELLOW

function onUse(player, item, fromPosition, target, toPosition)
    player:addMana(mana)
    player:sendTextMessage(MESSAGE_HEALED, "You have healed ".. mana .. " mana.", player:getPosition(), mana, color)
    return true
end

Its nice but the bad thing is its for action :/ Isnt it possible to do it for spells?
 
actions will work the same for this, but if you insist on using spells:
LUA:
local mana = 500
local color = TEXTCOLOR_YELLOW

function onCastSpell(creature, variant)
    local player = Player(creature)
    if not player then
        return false
    end
    player:addMana(mana)
    player:sendTextMessage(MESSAGE_HEALED, "You have healed ".. mana .. " mana.", player:getPosition(), mana, color)
    return true
end
 
Solution
Back
Top