• 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+ creating manafluid for level 200+ tfs 1,5

bpm91

Intermediate OT User
Joined
May 23, 2019
Messages
882
Solutions
7
Reaction score
123
Location
Brazil
YouTube
caruniawikibr
would anyone know how to get a new manafluid, only usable for level 200+
and which varies between 150-190

Lua:
local drunk = Condition(CONDITION_DRUNK)
drunk:setParameter(CONDITION_PARAM_TICKS, 60000)

local poison = Condition(CONDITION_POISON)
poison:setParameter(CONDITION_PARAM_DELAYED, true)
poison:setParameter(CONDITION_PARAM_MINVALUE, -50)
poison:setParameter(CONDITION_PARAM_MAXVALUE, -120)
poison:setParameter(CONDITION_PARAM_STARTVALUE, -5)
poison:setParameter(CONDITION_PARAM_TICKINTERVAL, 4000)
poison:setParameter(CONDITION_PARAM_FORCEUPDATE, true)

local fluidMessage = {
    [FLUID_BEER] = "Aah...",
    [FLUID_SLIME] = "Urgh!",
    [FLUID_LEMONADE] = "Mmmh.",
    [FLUID_MANA] = "Aaaah...",
    [FLUID_LIFE] = "Aaaah...",
    [FLUID_OIL] = "Urgh!",
    [FLUID_URINE] = "Urgh!",
    [FLUID_WINE] = "Aah...",
    [FLUID_MUD] = "Urgh!",
    [FLUID_RUM] = "Aah...",
    [FLUID_MEAD] = "Aaaah..."
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local targetItemType = ItemType(target.itemid)
    if targetItemType and targetItemType:isFluidContainer() then
        if target.type == FLUID_NONE and item.type ~= FLUID_NONE then
            target:transform(target:getId(), item.type)
            item:transform(item:getId(), FLUID_NONE)
            return true
        elseif target.type ~= FLUID_NONE and item.type == FLUID_NONE then
            item:transform(item:getId(), target.type)
            target:transform(target:getId(), FLUID_NONE)
            return true
        end
    end

    if target:isCreature() and target == player then
        if item.type == FLUID_NONE then
            player:sendTextMessage(MESSAGE_STATUS_SMALL, "It is empty.")
        elseif target.uid == player.uid then
            if table.contains({FLUID_BEER, FLUID_WINE, FLUID_MEAD}, item.type) then
                player:addCondition(drunk)
            elseif item.type == FLUID_SLIME then
                player:addCondition(poison)
            elseif item.type == FLUID_MANA then
                player:addMana(math.random(50, 150))
                player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
            elseif item.type == FLUID_LIFE then
                player:addHealth(60)
                player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
            end
            player:say(fluidMessage[item.type] or "Gulp.", TALKTYPE_SAY)
           item:remove(1)
        else
            Game.createItem(2016, item.type, toPosition):decay()
            item:transform(item:getId(), FLUID_NONE)
        end
    else
        local fluidSource = targetItemType and targetItemType:getFluidSource() or FLUID_NONE
        if fluidSource ~= FLUID_NONE then
            item:transform(item:getId(), fluidSource)
        elseif item.type == FLUID_NONE then
            player:sendTextMessage(MESSAGE_STATUS_SMALL, "It is empty.")
        else
            if toPosition.x == CONTAINER_POSITION then
                toPosition = player:getPosition()
            end
            Game.createItem(2016, item.type, toPosition):decay()
            item:transform(item:getId(), FLUID_NONE)
        end
    end
    return true
end
 
would anyone know how to get a new manafluid, only usable for level 200+
and which varies between 150-190

Lua:
local drunk = Condition(CONDITION_DRUNK)
drunk:setParameter(CONDITION_PARAM_TICKS, 60000)

local poison = Condition(CONDITION_POISON)
poison:setParameter(CONDITION_PARAM_DELAYED, true)
poison:setParameter(CONDITION_PARAM_MINVALUE, -50)
poison:setParameter(CONDITION_PARAM_MAXVALUE, -120)
poison:setParameter(CONDITION_PARAM_STARTVALUE, -5)
poison:setParameter(CONDITION_PARAM_TICKINTERVAL, 4000)
poison:setParameter(CONDITION_PARAM_FORCEUPDATE, true)

local fluidMessage = {
    [FLUID_BEER] = "Aah...",
    [FLUID_SLIME] = "Urgh!",
    [FLUID_LEMONADE] = "Mmmh.",
    [FLUID_MANA] = "Aaaah...",
    [FLUID_LIFE] = "Aaaah...",
    [FLUID_OIL] = "Urgh!",
    [FLUID_URINE] = "Urgh!",
    [FLUID_WINE] = "Aah...",
    [FLUID_MUD] = "Urgh!",
    [FLUID_RUM] = "Aah...",
    [FLUID_MEAD] = "Aaaah..."
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local targetItemType = ItemType(target.itemid)
    if targetItemType and targetItemType:isFluidContainer() then
        if target.type == FLUID_NONE and item.type ~= FLUID_NONE then
            target:transform(target:getId(), item.type)
            item:transform(item:getId(), FLUID_NONE)
            return true
        elseif target.type ~= FLUID_NONE and item.type == FLUID_NONE then
            item:transform(item:getId(), target.type)
            target:transform(target:getId(), FLUID_NONE)
            return true
        end
    end

    if target:isCreature() and target == player then
        if item.type == FLUID_NONE then
            player:sendTextMessage(MESSAGE_STATUS_SMALL, "It is empty.")
        elseif target.uid == player.uid then
            if table.contains({FLUID_BEER, FLUID_WINE, FLUID_MEAD}, item.type) then
                player:addCondition(drunk)
            elseif item.type == FLUID_SLIME then
                player:addCondition(poison)
            elseif item.type == FLUID_MANA then
                player:addMana(math.random(50, 150))
                player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
            elseif item.type == FLUID_LIFE then
                player:addHealth(60)
                player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
            end
            player:say(fluidMessage[item.type] or "Gulp.", TALKTYPE_SAY)
           item:remove(1)
        else
            Game.createItem(2016, item.type, toPosition):decay()
            item:transform(item:getId(), FLUID_NONE)
        end
    else
        local fluidSource = targetItemType and targetItemType:getFluidSource() or FLUID_NONE
        if fluidSource ~= FLUID_NONE then
            item:transform(item:getId(), fluidSource)
        elseif item.type == FLUID_NONE then
            player:sendTextMessage(MESSAGE_STATUS_SMALL, "It is empty.")
        else
            if toPosition.x == CONTAINER_POSITION then
                toPosition = player:getPosition()
            end
            Game.createItem(2016, item.type, toPosition):decay()
            item:transform(item:getId(), FLUID_NONE)
        end
    end
    return true
end
You can do copying the item and making a new item or you can add a code that add X mana to level below 200 and X mana to high

Lua:
            elseif item.type == FLUID_MANA then
               if player:getLevel() < 200 then
                    player:addMana(math.random(50, 150)) -- before 200
               else
                    player:addMana(math.random(150, 190)) -- from lvl 200
               end
 
ok i got it, i just repeated the script. and the sprites, I changed them to fluids3, and I changed the level as I did above
 
Last edited:
Back
Top