• 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.2] Player feeded and random mana ticks

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
Hi folks!

What functions I can use to make the player always feeded and also add also heal some random mana between v.minMana and v.maxMana and with mana ticks. I did this script below but I'm not sure if I can use it:

Code:
local config = {
    [1] = {minMana = 200, maxMana = 400}, -- MS
    [2] = {minMana = 200, maxMana = 400}, -- ED
    [3] = {minMana = 120, maxMana = 200}, -- RP
    [4] = {minMana = 80, maxMana = 190} -- EK
}

function doMilenio()
    local player = creature:getPlayer()
    if not player then
        return true
    end
   
    local vocation = player:getVocation()
    local v = config[vocation:getId()]

    -- Ok? Ok.
    if not v then
        return
    end
   
    -- We are creating the condition over here
    local condition = player:getCondition(CONDITION_REGENERATION, CONDITIONID_DEFAULT)
    if condition and math.floor(condition:getTicks() / 1000 + 30 * 20) >= 1200 then
        return true
    end

    -- Feed this shit
    player:feed(30 * 20)
   
    -- Give that man some mana
    player:addMana(math.random(v.minMana, v.maxMana))
    -- print the amount of the mana that player recives.
    return true
end

Thanks.
 
Hi folks!

What functions I can use to make the player always feeded and also add also heal some random mana between v.minMana and v.maxMana and with mana ticks. I did this script below but I'm not sure if I can use it:

Code:
local config = {
    [1] = {minMana = 200, maxMana = 400}, -- MS
    [2] = {minMana = 200, maxMana = 400}, -- ED
    [3] = {minMana = 120, maxMana = 200}, -- RP
    [4] = {minMana = 80, maxMana = 190} -- EK
}

function doMilenio()
    local player = creature:getPlayer()
    if not player then
        return true
    end
  
    local vocation = player:getVocation()
    local v = config[vocation:getId()]

    -- Ok? Ok.
    if not v then
        return
    end
  
    -- We are creating the condition over here
    local condition = player:getCondition(CONDITION_REGENERATION, CONDITIONID_DEFAULT)
    if condition and math.floor(condition:getTicks() / 1000 + 30 * 20) >= 1200 then
        return true
    end

    -- Feed this shit
    player:feed(30 * 20)
  
    -- Give that man some mana
    player:addMana(math.random(v.minMana, v.maxMana))
    -- print the amount of the mana that player recives.
    return true
end

Thanks.
These functions silly :oops:
https://github.com/otland/forgottenserver/wiki/Functions
 

silly :oops:

lKqs210.png

DzoJtUD.png
 

Similar threads

Back
Top