• 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!

TFS 1.X+ Show mana heal

Hello Could anyone help me with a code for TFS 1.2 8.6 server?
How to show mana healing numbers ?
In potions script after using mana potions paste this >
Ofc "PotionValue" change for you local define of it
Code:
  target:sendTextMessage(MESSAGE_HEALED, "You have recovered ".. PotionValue .. " mana points.", player:getPosition(), PotionValue, 29)
 
In potions script after using mana potions paste this >
Ofc "PotionValue" change for you local define of it
Code:
  target:sendTextMessage(MESSAGE_HEALED, "You have recovered ".. PotionValue .. " mana points.", player:getPosition(), PotionValue, 29)
Debug client after login
 
Debug client after login
You change it?

Example->
Change this:

Code:
    elseif itemId == manaPot then
        if not doTargetCombatMana(0, target, 75, 125, CONST_ME_MAGIC_BLUE) then
            return false
        end
 
        player:addCondition(exhaust)
        target:say("Aaaah...", TALKTYPE_MONSTER_SAY)

To this:
Code:
    elseif itemId == manaPot then
    local manaPotValue = math.random(75,125)
        if not doTargetCombatMana(0, target, manaPotValue, CONST_ME_MAGIC_BLUE)
        target:sendTextMessage(MESSAGE_HEALED, "You have recovered ".. manaPotValue .. " mana points.", player:getPosition(), manaPotValue, 29) then
            return false
        end
 
        player:addCondition(exhaust)
        target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
 
You change it?

Example->
Change this:

Code:
    elseif itemId == manaPot then
        if not doTargetCombatMana(0, target, 75, 125, CONST_ME_MAGIC_BLUE) then
            return false
        end

        player:addCondition(exhaust)
        target:say("Aaaah...", TALKTYPE_MONSTER_SAY)

To this:
Code:
    elseif itemId == manaPot then
    local manaPotValue = math.random(75,125)
        if not doTargetCombatMana(0, target, manaPotValue, CONST_ME_MAGIC_BLUE)
        target:sendTextMessage(MESSAGE_HEALED, "You have recovered ".. manaPotValue .. " mana points.", player:getPosition(), manaPotValue, 29) then
            return false
        end

        player:addCondition(exhaust)
        target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
dada.png
 
Code:
    elseif itemId == manaPot then
    local manaPotValue = math.random(75,125)
        if not doTargetCombatMana(0, target, manaPotValue, CONST_ME_MAGIC_BLUE) and
        target:sendTextMessage(MESSAGE_HEALED, "You have recovered ".. manaPotValue .. " mana points.", player:getPosition(), manaPotValue, 29) then
            return false
        end
 
        player:addCondition(exhaust)
        target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
 
Code:
    elseif itemId == manaPot then
    local manaPotValue = math.random(75,125)
        if not doTargetCombatMana(0, target, manaPotValue, CONST_ME_MAGIC_BLUE) and
        target:sendTextMessage(MESSAGE_HEALED, "You have recovered ".. manaPotValue .. " mana points.", player:getPosition(), manaPotValue, 29) then
            return false
        end

        player:addCondition(exhaust)
        target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
There is no error but still does not display numbers(mana heal) and only the inscription with no effect appears (Sorry i use google translate)
 

Make new item, thats will be a test mana potion.


Then make
testmanapot.lua

and paste inside this code:
Code:
local exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, (configManager.getNumber(configKeys.EX_ACTIONS_DELAY_INTERVAL) - 100))
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getCondition(CONDITION_EXHAUST_HEAL) then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUAREEXHAUSTED))
        return true
    end
player:addCondition(exhaust)
local PotionValue = math.random(75,125)
    if target:isPlayer() then
        item:remove(1)
target:addMana(PotionValue)
  target:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
  target:sendTextMessage(MESSAGE_HEALED, "You have recovered ".. PotionValue .. " mana points.", player:getPosition(), PotionValue, 29)
            return false
        end
end

Then tell if numbers show :)
 
Back
Top