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

Scripter Custom runes for Tfs 1.1 Paid

kozmo

Member
Joined
Jan 30, 2009
Messages
433
Solutions
2
Reaction score
22
I am needing someone to make me 3 custom runes for my server,
paladins spirit rune (heals health and mana)
knights health rune
mages manarune

I am paying 10 to 20$ for this depends how it turns out.
Thanks kozmo.
 
Just check how your potions are made and make it work with runes
 
Thanks.. Almost was gonna pay but the potion tip worked and I got it working , only thing that would be nice is to have it show how much mana it is healing in purple or something. :p
 
Last edited:
Thanks.. Almost was gonna pay but the potion tip worked and I got it working , only thing that would be nice is to have it show how much mana it is healing in purple or something. :p

I guess you can enable that in your config.lua not sure for 1.1 tho

Something with showtext on healing.
 
Okay I can try it thanks.
Code:
local config = {
    -- first paladins spiritrune
    [2299] = {health = {2000, 2500}, mana = {200, 400}, vocations = {3}, text = 'paladins', level = 250, emptyId = 2299},
    -- first knights healthrune
    [2307] = {health = {2250, 2850}, vocations = {4}, text = 'knights', level = 250, emptyId = 2307},
    -- first mages manarune
    [2283] = {mana = {2000, 2800}, vocations = {1, 2}, text = 'sorcerers and druids', level = 250, emptyId = 2283},
}

local antidote = Combat()
antidote:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
antidote:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
antidote:setParameter(COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
antidote:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
antidote:setParameter(COMBAT_PARAM_DISPEL, CONDITION_POISON)

local exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, (configManager.getNumber(configKeys.EX_ACTIONS_DELAY_INTERVAL) - 100))
-- 1000 - 100 due to exact condition timing. -100 doesn't hurt us, and players don't have reminding ~50ms exhaustion.

function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)
    local potion = config[item.itemid]
    if not potion then
        return true
    end

    if itemEx.itemid ~= 1 or itemEx.type ~= THING_TYPE_PLAYER then
        return true
    end

    if player:getCondition(CONDITION_EXHAUST_HEAL) then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUAREEXHAUSTED))
        return true
    end

    local target = Player(itemEx.uid)
    if potion.antidote and not antidote:execute(target, Variant(itemEx.uid)) then
        return false
    end

    if (potion.level and player:getLevel() < potion.level)
            or (type(potion.vocations) == 'table' and not isInArray(potion.vocations, player:getVocation():getBase():getId()))
            and not (player:getGroup():getId() >= 2) then
        player:say(string.format('This custom rune can only be used by %s of level %d or higher.', potion.text, potion.level), TALKTYPE_MONSTER_SAY)
        return true
    end

    if type(potion.health) == 'table' and not doTargetCombatHealth(0, target, COMBAT_HEALING, potion.health[1], potion.health[2], CONST_ME_MAGIC_RED) then
        return false
    end

    if type(potion.mana) == 'table' and not doTargetCombatMana(0, target, potion.mana[1], potion.mana[2], CONST_ME_MAGIC_RED) then
        return false
    end

    local cStorage = player:getStorageValue(Storage.Achievements.PotionAddict)
    if cStorage < 100000 then
        player:setStorageValue(Storage.Achievements.PotionAddict, math.max(1, cStorage) + 1)
    elseif cStorage == 100000 then
        player:addAchievement('Potion Addict')
        player:setStorageValue(Storage.Achievements.PotionAddict, 100001)
    end

    player:addCondition(exhaust)
    doCreatureSayWithRadius(target, 'Yeaah...', TALKTYPE_MONSTER_SAY, 2, 2, toPosition)
    Item(item.uid):remove(1)
    if fromPosition.x == CONTAINER_POSITION then
        player:addItem(potion.emptyId, 1)
    else
        Game.createItem(potion.emptyId, 1, fromPosition)
    end
    return true
end
 
Alright! :)
This should work
Code:
local config = {
    -- first paladins spiritrune
    [2299] = {health = {2000, 2500}, mana = {200, 400}, vocations = {3}, text = 'paladins', level = 250, emptyId = 2299},
    -- first knights healthrune
    [2307] = {health = {2250, 2850}, vocations = {4}, text = 'knights', level = 250, emptyId = 2307},
    -- first mages manarune
    [2283] = {mana = {2000, 2800}, vocations = {1, 2}, text = 'sorcerers and druids', level = 250, emptyId = 2283},
}

local antidote = Combat()
antidote:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
antidote:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
antidote:setParameter(COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
antidote:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
antidote:setParameter(COMBAT_PARAM_DISPEL, CONDITION_POISON)

local exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, (configManager.getNumber(configKeys.EX_ACTIONS_DELAY_INTERVAL) - 100))
-- 1000 - 100 due to exact condition timing. -100 doesn't hurt us, and players don't have reminding ~50ms exhaustion.

function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)
    local potion = config[item.itemid]
    if not potion then
        return true
    end

    if itemEx.itemid ~= 1 or itemEx.type ~= THING_TYPE_PLAYER then
        return true
    end

    if player:getCondition(CONDITION_EXHAUST_HEAL) then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUAREEXHAUSTED))
        return true
    end

    local target = Player(itemEx.uid)
    if potion.antidote and not antidote:execute(target, Variant(itemEx.uid)) then
        return false
    end

    if (potion.level and player:getLevel() < potion.level)
            or (type(potion.vocations) == 'table' and not isInArray(potion.vocations, player:getVocation():getBase():getId()))
            and not (player:getGroup():getId() >= 2) then
        player:say(string.format('This custom rune can only be used by %s of level %d or higher.', potion.text, potion.level), TALKTYPE_MONSTER_SAY)
        return true
    end

    if type(potion.health) == 'table' and not doTargetCombatHealth(0, target, COMBAT_HEALING, potion.health[1], potion.health[2], CONST_ME_MAGIC_RED) then
        return false
    end

  
    if type(potion.mana) == 'table' then
local manas = math.floor(math.random((potion.mana[1]),(potion.mana[2])))
        player:sendTextMessage(MESSAGE_EXPERIENCE, "You've gained "..manas.." mana.", player:getPosition(), "" .. manas .. "", TEXTCOLOR_PURPLE)
        doSendMagicEffect(getPlayerPosition(player), CONST_ME_MAGIC_RED)
        doPlayerAddMana(player, manas)
    end

    local cStorage = player:getStorageValue(Storage.Achievements.PotionAddict)
    if cStorage < 100000 then
        player:setStorageValue(Storage.Achievements.PotionAddict, math.max(1, cStorage) + 1)
    elseif cStorage == 100000 then
        player:addAchievement('Potion Addict')
        player:setStorageValue(Storage.Achievements.PotionAddict, 100001)
    end

    player:addCondition(exhaust)
    doCreatureSayWithRadius(target, 'Yeaah...', TALKTYPE_MONSTER_SAY, 2, 2, toPosition)
    Item(item.uid):remove(1)
    if fromPosition.x == CONTAINER_POSITION then
        player:addItem(potion.emptyId, 1)
    else
        Game.createItem(potion.emptyId, 1, fromPosition)
    end
    return true
end

There's actually no good potion script out there for 1.x, there's TFS default one (but I found it hard to adjust coz i'm newb) and there's codeinablacks potion script but it lacks support for flat values etc so it can be hard for new people to adjust. So I can kind of understand why OP could pay for one even if it's simple.
 
Last edited:
Does not work I tried no error just not working.
Thanks for trying though. :P
 
It works for me however I removed the storagevalue shit since it's not needed.
lLw0Q7mUG.png

Code:
local config = {
    -- first paladins spiritrune
    [2299] = {health = {2000, 2500}, mana = {200, 400}, vocations = {3}, text = 'paladins', level = 250, emptyId = 2299},
    -- first knights healthrune
    [2307] = {health = {2250, 2850}, vocations = {4}, text = 'knights', level = 250, emptyId = 2307},
    -- first mages manarune
    [2283] = {mana = {2000, 2800}, vocations = {1, 2}, text = 'sorcerers and druids', level = 250, emptyId = 2283},
}

local antidote = Combat()
antidote:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
antidote:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
antidote:setParameter(COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
antidote:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
antidote:setParameter(COMBAT_PARAM_DISPEL, CONDITION_POISON)

local exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, (configManager.getNumber(configKeys.EX_ACTIONS_DELAY_INTERVAL) - 100))
-- 1000 - 100 due to exact condition timing. -100 doesn't hurt us, and players don't have reminding ~50ms exhaustion.

function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)
    local potion = config[item.itemid]
    if not potion then
        return true
    end

    if itemEx.itemid ~= 1 or itemEx.type ~= THING_TYPE_PLAYER then
        return true
    end

    if player:getCondition(CONDITION_EXHAUST_HEAL) then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUAREEXHAUSTED))
        return true
    end

    local target = Player(itemEx.uid)
    if potion.antidote and not antidote:execute(target, Variant(itemEx.uid)) then
        return false
    end

    if (potion.level and player:getLevel() < potion.level)
            or (type(potion.vocations) == 'table' and not isInArray(potion.vocations, player:getVocation():getId()))
            and not (player:getGroup():getId() >= 2) then
        player:say(string.format('This custom rune can only be used by %s of level %d or higher.', potion.text, potion.level), TALKTYPE_MONSTER_SAY)
        return true
    end

    if type(potion.health) == 'table' and not doTargetCombatHealth(0, target, COMBAT_HEALING, potion.health[1], potion.health[2], CONST_ME_MAGIC_RED) then
        return false
    end

    
    if type(potion.mana) == 'table' then
  local manas = math.floor(math.random((potion.mana[1]),(potion.mana[2])))
        player:sendTextMessage(MESSAGE_EXPERIENCE, "You've gained "..manas.." mana.", player:getPosition(), "" .. manas .. "", TEXTCOLOR_PURPLE)
        doSendMagicEffect(getPlayerPosition(player), CONST_ME_MAGIC_RED)
        doPlayerAddMana(player, manas)
    end


    player:addCondition(exhaust)
    doCreatureSayWithRadius(target, 'Yeaah...', TALKTYPE_MONSTER_SAY, 2, 2, toPosition)
    Item(item.uid):remove(1)
    if fromPosition.x == CONTAINER_POSITION then
        player:addItem(potion.emptyId, 1)
    else
        Game.createItem(potion.emptyId, 1, fromPosition)
    end
    return true
end
That's the script I used

and obviously you need this too

Code:
        <action itemid="2299" script="potion.lua"/>
        <action itemid="2307" script="potion.lua"/>
        <action itemid="2283" script="potion.lua"/>
 
Thanks I really appreciate you trying to help using that script the Rune now wont even work,
I don't know what's going on just wont work.
 
Back
Top