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

Doesn't recognize mana type or stack tfs 1.2

Jpstafe

Well-Known Member
Joined
Aug 8, 2011
Messages
507
Reaction score
68
Hello I want to make the manas or life fluid stacks and it doesn't recognize them as such, and they are not stacked either, the runes are all stacked
final.png
xodet:
Lua:
 local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid)             end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid)         end
function onCreatureSay(cid, type, msg)         npcHandler:onCreatureSay(cid, type, msg)     end
function onThink()                             npcHandler:onThink()                         end
function onPlayerEndTrade(cid)                npcHandler:onPlayerEndTrade(cid)            end
function onPlayerCloseChannel(cid)            npcHandler:onPlayerCloseChannel(cid)        end

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

keywordHandler:addKeyword({'runes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell: animate dead, blank rune, desintegrate, energy bomb, fireball, magic wall, paralyze, poison bomb, soulfire, stone shower, wild growth, antidote, chamaleon, convince creature, destroy field, energy field, energy wall, explosion, fire bomb, fire field, greate fireball, light magic missile, heavy magic missile, intense healing, poison field, poison wall, stalagmite, ultimate healing and sudden death.'})
keywordHandler:addKeyword({'potions'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell: mana fluid and life fluid.'})
keywordHandler:addKeyword({'wands'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell: wand of vortex, wand of dragonbreath, wand of plague, wand of cosmic energy and wand of inferno..'})
keywordHandler:addKeyword({'rods'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell: snakebite rod, moonlight rod, volcanic rod, quagmire rod and tempest rod'})


shopModule:addBuyableItem({'spellbook'}, 2175, 150, 'spellbook')
shopModule:addBuyableItem({'magic lightwand'}, 2163, 400, 'magic lightwand')

shopModule:addBuyableItem({'mana fluid', 'manafluid'}, 2006, 50, 7, 'mana fluid')
shopModule:addBuyableItem({'life fluid', 'lifefluid'}, 2006, 50, 2, 'life fluid')

shopModule:addBuyableItemContainer({'bp mf'}, 2001, 2006, 1000, 7, 'backpack of mana fluids')
shopModule:addBuyableItemContainer({'bp lf'}, 2000, 2006, 1000, 2, 'backpack of life fluids')

shopModule:addBuyableItem({'animate dead'}, 2316, 375, 1, 'animate dead rune')
shopModule:addBuyableItem({'blank rune'}, 2260, 10, 1, 'blank rune')
shopModule:addBuyableItem({'desintegrate'}, 2310, 26, 1, 'desintegrate rune')
shopModule:addBuyableItem({'energy bomb'}, 2262, 203, 1, 'energy bomb rune')
shopModule:addBuyableItem({'great fireball rune'}, 2304, 180, 1, 'great fireball rune')
shopModule:addBuyableItem({'fireball rune'}, 2302, 95, 1, 'fireball rune')
shopModule:addBuyableItem({'magic wall'}, 2293, 116, 1, 'magic wall rune')
shopModule:addBuyableItem({'paralyze'}, 2278, 700, 1, 'paralyze rune')
shopModule:addBuyableItem({'poison bomb'}, 2286, 85, 1, 'poison bomb rune')
shopModule:addBuyableItem({'soulfire'}, 2308, 46, 1, 'soulfire rune')
shopModule:addBuyableItem({'wild growth'}, 2269, 160, 1, 'wild growth rune')

shopModule:addSellableItem({'vial', 'flask'}, 7490, 5, 'empty vial', 0)

shopModule:addBuyableItem({'antidote'}, 2266, 65, 1, 'antidote rune')
shopModule:addBuyableItem({'chameleon'}, 2291, 210, 1, 'chameleon rune')
shopModule:addBuyableItem({'convince creature'}, 2290, 80, 1, 'convince creature rune')
shopModule:addBuyableItem({'destroy field'}, 2261, 45, 1, 'destroy field rune')
shopModule:addBuyableItem({'energy field'}, 2277, 115, 1, 'energy field rune')
shopModule:addBuyableItem({'energy wall'}, 2279, 340, 4, 'energy wall rune')
shopModule:addBuyableItem({'explosion'}, 2313, 250, 1, 'explosion rune')
shopModule:addBuyableItem({'fire bomb'}, 2305, 235, 1, 'fire bomb rune')
shopModule:addBuyableItem({'fire field'}, 2301, 85, 1, 'fire field rune')
shopModule:addBuyableItem({'fire wall'}, 2303, 245, 1, 'fire wall rune')
shopModule:addBuyableItem({'heavy magic missile'}, 2311, 125, 1, 'heavy magic missile rune')
shopModule:addBuyableItem({'intense healing'}, 2265, 95, 1, 'intense healing rune')
shopModule:addBuyableItem({'light magic missile'}, 2287, 40, 1, 'light magic missile rune')
shopModule:addBuyableItem({'poison field'}, 2285, 65, 1, 'poison field rune')
shopModule:addBuyableItem({'poison wall'}, 2289, 210, 1, 'poison wall rune')
shopModule:addBuyableItem({'stalagmite'}, 2292, 125, 1, 'stalagmite rune')
shopModule:addBuyableItem({'sudden death'}, 2268, 325, 1, 'sudden death rune')
shopModule:addBuyableItemContainer({'bp sd'}, 2003, 2268, 6500, 1, 'backpack of sudden death rune')
shopModule:addBuyableItem({'ultimate healing'}, 2273, 175, 1, 'ultimate healing rune')
shopModule:addBuyableItemContainer({'bp uh'}, 2002, 2273, 3500, 1, 'backpack of healing rune')
shopModule:addBuyableItemContainer({'bp gfb'}, 2000, 2304, 3600, 1, 'backpack of great fireball rune')

shopModule:addBuyableItem({'wand of vortex', 'vortex'}, 2190, 500, 'wand of vortex')
shopModule:addBuyableItem({'wand of dragonbreath', 'dragonbreath'}, 2191, 1000, 'wand of dragonbreath')
shopModule:addBuyableItem({'wand of plague', 'plague'}, 2188, 5000, 'wand of plague')
shopModule:addBuyableItem({'wand of cosmic energy', 'cosmic energy'}, 2189, 10000, 'wand of cosmic energy')
shopModule:addBuyableItem({'wand of inferno', 'inferno'}, 2187, 15000, 'wand of inferno')

shopModule:addBuyableItem({'snakebite rod', 'snakebite'}, 2182, 500, 'snakebite rod')
shopModule:addBuyableItem({'moonlight rod', 'moonlight'}, 2186, 1000, 'moonlight rod')
shopModule:addBuyableItem({'volcanic rod', 'volcanic'}, 2185, 1000, 'volcanic rod')
shopModule:addBuyableItem({'quagmire rod', 'quagmire'}, 2181, 2000, 'quagmire rod')
shopModule:addBuyableItem({'tempest rod', 'tempest'}, 2183, 3000, 'tempest rod')


shopModule:addSellableItem({'wand of vortex', 'vortex'}, 2190, 100, 'wand of vortex')
shopModule:addSellableItem({'wand of dragonbreath', 'dragonbreath'}, 2191, 200, 'wand of dragonbreath')
shopModule:addSellableItem({'wand of plague', 'plague'}, 2188, 1000, 'wand of plague')
shopModule:addSellableItem({'wand of cosmic energy', 'cosmic energy'}, 2189, 2000, 'wand of cosmic energy')
shopModule:addSellableItem({'wand of inferno', 'inferno'}, 2187, 3000, 'wand of inferno')

shopModule:addSellableItem({'snakebite rod', 'snakebite'}, 2182, 100, 'snakebite rod')
shopModule:addSellableItem({'moonlight rod', 'moonlight'}, 2186, 200, 'moonlight rod')
shopModule:addSellableItem({'volcanic rod', 'volcanic'}, 2185, 1000, 'volcanic rod')
shopModule:addSellableItem({'quagmire rod', 'quagmire'}, 2181, 2000, 'quagmire rod')
shopModule:addSellableItem({'tempest rod', 'tempest'}, 2183, 3000, 'tempest rod')

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
OBJECT BUILD.png
ITEMEDITOR.png
It doesn't recognize the mana fluid, I went from 0 to 8 which are the fluids and in none of the numbers does it grab it
 

Attachments

Solution
There I followed what mano368 told me, look what he does now hahahaha amazing bug! In the server console I don't get any errors. The positive thing that is stacked now the manas xD
View attachment 80006
actions.xml:
XML:
<action itemid="7530" script="Other/fluids/potions.lua" />
potions.lua:
Lua:
local antidote = Combat()
antidote:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
antidote:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
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...
create new mana potion image, example ID: 8131

use this action, besides the mana potion you can use it for SMP, GMP....

In actions.xml
<action itemid="8131" script="potions.lua" />
Script
local antidote = Combat()
antidote:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
antidote:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
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) - 1000))
local t = {
-- Great health potion
[0] = {empty = 0, vocArray = {4, 8}, level = 80, str = "knights", func = function(p) return doTargetCombatHealth(0, p, COMBAT_HEALING, 750, 1100, 30) end},
-- Great spirit potion
[0] = {empty = 0, vocArray = {3, 7}, level = 10, str = "paladins", func = function(p) return doTargetCombatHealth(0, p, COMBAT_HEALING, 150, 320, 29), doTargetCombatMana(0, p, 100, 180, 30) end},
-- Strong health potion
[0] = {empty = 0, vocArray = {3, 4, 7, 8}, level = 80, str = "paladins and knights", func = function(p) return doTargetCombatHealth(0, p, COMBAT_HEALING, 150, 200, 30) end},
-- Ultimate mana potion
[0] = {empty = 0, vocArray = {1, 2, 5, 6}, level = 130, str = "sorcerers and druids", func = function(p) return doTargetCombatMana(0, p, 200, 300, 31) end},
-- Great mana potion
[0] = {empty = 0, vocArray = {1, 2, 5, 6}, level = 80, str = "sorcerers and druids", func = function(p) return doTargetCombatMana(0, p, 125, 220, 31) end},
-- Strong mana potion
[0] = {empty = 0, vocArray = {1, 2, 5, 6}, level = 50, str = "sorcerers and druids", func = function(p) return doTargetCombatMana(0, p, 150, 300, 31) end},
-- Mana potion
[8131] = {empty = 0, func = function(p) return doTargetCombatMana(0, p, 75, 145, 31) end},
-- Health potion
[0] = {empty = 0, func = function(p) return doTargetCombatHealth(0, p, COMBAT_HEALING, 125, 175, 30) end},
-- Small health potion
[0] = {empty = 0, func = function(p) return doTargetCombatHealth(0, p, COMBAT_HEALING, 60, 90, 30) end},
-- Antidote potion
[0] = {empty = 0, func = function(p) return antidote:execute(p, numberToVariant(p:getId())) end}
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if not target:getPlayer() then
return true
end
if player:getCondition(CONDITION_EXHAUST_HEAL) then
player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUAREEXHAUSTED))
return true
end

local tmp = t[item.itemid]
if tmp then
local level = tmp.level or 0
if tmp.vocArray and (not isInArray(tmp.vocArray, target:getVocation():getId()) or target:getLevel() < level) and not getPlayerFlagValue(player, PlayerFlag_IgnoreSpellCheck) then
player:say(string.format("This potion can only be consumed by %s of level %d or higher.", tmp.str, level), TALKTYPE_MONSTER_SAY)
return true
end
if not tmp.func(target) then
return false
end
player:addCondition(exhaust)
target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
item:remove(1)
player:addItem(tmp.empty, 1)
end
return true
end
 
I have created a new mana fluids, the scripts that you gave me are manas of 8.6, the ot that I am making is 8.0, I just want it to be mana fluid alone..
In fluids.lua do we have to add the new fluid mana?
I would like the vial not to be created when used, only the mana to disappear...
fluids.lua:
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 = {
    [2] = 'Aaaah...',
    [3] = 'Aah...',
    [4] = 'Urgh!',
    [5] = 'Mmmh.',
    [7] = 'Aaaah...',
    [10] = 'Glup.',
    [11] = 'Urgh!',
    [13] = 'Urgh!',
    [15] = 'Aah...',
    [19] = 'Urgh!',
    [43] = 'Aaaah...'
}



function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local targetType = ItemType(target.itemid)   
    
    if item.actionid == 2023 then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, '2')
        destination = Position(32791, 32332, 10)
        player:teleportTo(destination)
        player:say('Muahahahaha..', TALKTYPE_MONSTER_SAY, false, player)
        fromPosition:sendMagicEffect(CONST_ME_DRAWBLOOD)
        destination:sendMagicEffect(CONST_ME_MORTAREA)           
    end
    
    if targetType:isFluidContainer() then
        if target.type == 0 and item.type ~= 0 then
            target:transform(target.itemid, item.type)
            item:transform(item.itemid, 0)
            return true
        elseif target.type ~= 0 and item.type == 0 then
            target:transform(target.itemid, 0)
            item:transform(item.itemid, target.type)
            return true
        end
    end

    if target.itemid == 1 then
        if item.type == 0 then
            player:sendTextMessage(MESSAGE_STATUS_SMALL, 'It is empty.')

        elseif target.uid == player.uid then
            if isInArray({3, 15, 43}, item.type) then
                player:addCondition(drunk)

            elseif item.type == 4 then
                player:addCondition(poison)
                doSendMagicEffect(toPosition, CONST_ME_GREEN_RINGS)

            elseif item.type == 7 then
                player:addMana(math.random(50, 150))
                doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)

            elseif item.type == 2 then
                player:addHealth(60)
                doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
            end

            player:say(fluidMessage[item.type] or 'Gulp.', TALKTYPE_MONSTER_SAY)
            item:transform(7490, 0)
        else
            local pool = Game.createItem(2016, item.type, toPosition)
            if pool then
                pool:decay()
                if item.type == 1 then
                    checkWallArito(pool, toPosition)
                end
            end
            item:transform(item.itemid, 0)
        end

    else

        local fluidSource = targetType:getFluidSource()
        if fluidSource ~= 0 then
            item:transform(item.itemid, fluidSource)
        elseif item.type == 0 then
            player:sendTextMessage(MESSAGE_STATUS_SMALL, 'It is empty.')
        else
            if target.actionid == 2023 then
            destination = Position(32791, 32332, 10)
            player:teleportTo(destination)
            player:say('Muahahahaha..', TALKTYPE_MONSTER_SAY, false, player)
            fromPosition:sendMagicEffect(CONST_ME_DRAWBLOOD)
            destination:sendMagicEffect(CONST_ME_MORTAREA)
            else
                if toPosition.x == CONTAINER_POSITION then
                    toPosition = player:getPosition()
                end

                local pool = Game.createItem(2016, item.type, toPosition)
                if pool then
                    pool:decay()
                    if item.type == 1 then
                        checkWallArito(pool, toPosition)
                    end
                end
            end
            item:transform(item.itemid, 0)
        end
    end

    
    
    
    return true
end
 
Friend, to make it stackable, you need to create a new item and use this script I gave you... it makes your life a lot easier if you want to create other pots... all in one script. It works on 8.0 tfs 1.2.

Using the one you have, I don't know how to help... because the empty vial is 2006 and the full ones are 2006.1 2006.2 etc...
 
Friend, to make it stackable, you need to create a new item and use this script I gave you... it makes your life a lot easier if you want to create other pots... all in one script. It works on 8.0 tfs 1.2.

Using the one you have, I don't know how to help... because the empty vial is 2006 and the full ones are 2006.1 2006.2 etc...
in potions.lua I have this:
Lua:
local berserk = Condition(CONDITION_ATTRIBUTES)
berserk:setParameter(CONDITION_PARAM_TICKS, 10 * 60 * 1000)
berserk:setParameter(CONDITION_PARAM_SKILL_MELEE, 5)
berserk:setParameter(CONDITION_PARAM_SKILL_SHIELD, -10)
berserk:setParameter(CONDITION_PARAM_BUFF_SPELL, true)

local mastermind = Condition(CONDITION_ATTRIBUTES)
mastermind:setParameter(CONDITION_PARAM_TICKS, 10 * 60 * 1000)
mastermind:setParameter(CONDITION_PARAM_STAT_MAGICPOINTS, 3)
mastermind:setParameter(CONDITION_PARAM_BUFF_SPELL, true)

local bullseye = Condition(CONDITION_ATTRIBUTES)
bullseye:setParameter(CONDITION_PARAM_TICKS, 10 * 60 * 1000)
bullseye:setParameter(CONDITION_PARAM_SKILL_DISTANCE, 5)
bullseye:setParameter(CONDITION_PARAM_SKILL_SHIELD, -10)
bullseye:setParameter(CONDITION_PARAM_BUFF_SPELL, true)

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

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

local potions = {
    [6558] = {transform = {id = {7588, 7589}}, effect = CONST_ME_DRAWBLOOD},
    [7439] = {condition = berserk, vocations = {4, 8}, effect = CONST_ME_MAGIC_RED,
            description = "Only knights may drink this potion.", text = "You feel stronger."},

    [7440] = {condition = mastermind, vocations = {1, 2, 5, 6}, effect = CONST_ME_MAGIC_BLUE,
            description = "Only sorcerers and druids may drink this potion.", text = "You feel smarter."},

    [7443] = {condition = bullseye, vocations = {3, 7}, effect = CONST_ME_MAGIC_GREEN,
            description = "Only paladins may drink this potion.", text = "You feel more accurate."},

    [7588] = {health = {250, 350}, vocations = {3, 4, 7, 8}, level = 50, flask = 7634,
            description = "Only knights and paladins of level 50 or above may drink this fluid."},

    [7589] = {mana = {115, 185}, vocations = {1, 2, 3, 5, 6, 7}, level = 50, flask = 7634,
            description = "Only sorcerers, druids and paladins of level 50 or above may drink this fluid."},

    [7590] = {mana = {150, 250}, vocations = {1, 2, 5, 6}, level = 80, flask = 7635,
            description = "Only druids and sorcerers of level 80 or above may drink this fluid."},

    [7591] = {health = {425, 575}, vocations = {4, 8}, level = 80, flask = 7635,
            description = "Only knights of level 80 or above may drink this fluid."},

    [7618] = {health = {125, 175}, flask = 7636},
    [7620] = {mana = {75, 125}, flask = 7636},
    [8472] = {health = {250, 350}, mana = {100, 200}, vocations = {3, 7}, level = 80, flask = 7635,
            description = "Only paladins of level 80 or above may drink this fluid."},

    [8473] = {health = {650, 850}, vocations = {4, 8}, level = 130, flask = 7635,
            description = "Only knights of level 130 or above may drink this fluid."},

    [8474] = {combat = antidote, flask = 7636},
    [8704] = {health = {60, 90}, flask = 7636},
    [26029] = {mana = {425, 575}, vocations = {1, 2, 5, 6}, level = 130, flask = 7635,
            description = "Only druids and sorcerers of level 130 or above may drink this fluid."},

    [26030] = {health = {420, 580}, mana = {250, 350}, vocations = {3, 7}, level = 130, flask = 7635,
            description = "Only paladins of level 130 or above may drink this fluid."},

    [26031] = {health = {875, 1125}, vocations = {4, 8}, level = 200, flask = 7635,
            description = "Only knights of level 200 or above may drink this fluid."}
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if type(target) == "userdata" and not target:isPlayer() then
        return false
    end

    local potion = potions[item:getId()]
    if potion.level and player:getLevel() < potion.level or potion.vocations and not table.contains(potion.vocations, player:getVocation():getBase():getId()) and not (player:getGroup():getId() >= 2) then
        player:say(potion.description, TALKTYPE_MONSTER_SAY)
        return true
    end

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

    if potion.health or potion.mana or potion.combat then
        if potion.health then
            doTargetCombatHealth(0, target, COMBAT_HEALING, potion.health[1], potion.health[2], CONST_ME_MAGIC_BLUE)
        end

        if potion.mana then
            doTargetCombatMana(0, target, potion.mana[1], potion.mana[2], CONST_ME_MAGIC_BLUE)
        end

        if potion.combat then
            potion.combat:execute(target, Variant(target:getId()))
        end

        player:addAchievementProgress('Potion Addict', 100000)
        target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
        player:addItem(potion.flask, 1)
        player:addCondition(exhaust)
        player:setStorageValue(38412, player:getStorageValue(38412)+1)
    end

    if potion.condition then
        player:addCondition(potion.condition)
        player:say(potion.text, TALKTYPE_MONSTER_SAY)
        player:getPosition():sendMagicEffect(potion.effect)
    end

    if potion.transform then
        item:transform(potion.transform.id[math.random(#potion.transform.id)])
        item:getPosition():sendMagicEffect(potion.effect)
        return true
    end

    if not configManager.getBoolean(configKeys.REMOVE_POTION_CHARGES) then
        return true
    end

    local client = player:getClient()
    if client.version > 1140 then
        player:updateSupplyTracker(item)
    end

    item:remove(1)
    return true
end
I'm going to replace it with the lua that you put... in exlame ID, there goes the id of the new mana fluid that I created, right?
 
create new mana potion image, example ID: 8131

use this action, besides the mana potion you can use it for SMP, GMP....

In actions.xml

Script
I used the script it worked perfectly, but the manas fluids are not stackable... in the object builder and item editor I made it stackable
gordando.png
Untitled ‑ Made with FlexClip (1).gif
 
I used the script it worked perfectly, but the manas fluids are not stackable... in the object builder and item editor I made it stackable
View attachment 79995
View attachment 79996
I don't know nothing about that, but, As you can see, you've created a completely new vial with the Mana Fluid design inside, correct? Have you tried unchecking the fluid content option? making an item as if it were a regular item, but without this option of it being a fluid content and seeing if it starts to stack
 
I don't know nothing about that, but, As you can see, you've created a completely new vial with the Mana Fluid design inside, correct? Have you tried unchecking the fluid content option? making an item as if it were a regular item, but without this option of it being a fluid content and seeing if it starts to stack

This is the correct solution, need remove the option on fluid content from the item.
 
This is the correct solution, need remove the option on fluid content from the item.
There I followed what mano368 told me, look what he does now hahahaha amazing bug! In the server console I don't get any errors. The positive thing that is stacked now the manas xD
Untitled ‑ Made with FlexClip (2).gif
actions.xml:
XML:
<action itemid="7530" script="Other/fluids/potions.lua" />
potions.lua:
Lua:
local antidote = Combat()
antidote:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
antidote:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
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) - 1000))
local t = {
-- Great health potion
--[0] = {empty = 0, vocArray = {4, 8}, level = 80, str = "knights", func = function(p) return doTargetCombatHealth(0, p, COMBAT_HEALING, 750, 1100, 30) end},
-- Great spirit potion
--[0] = {empty = 0, vocArray = {3, 7}, level = 10, str = "paladins", func = function(p) return doTargetCombatHealth(0, p, COMBAT_HEALING, 150, 320, 29), doTargetCombatMana(0, p, 100, 180, 30) end},
-- Strong health potion
--[0] = {empty = 0, vocArray = {3, 4, 7, 8}, level = 80, str = "paladins and knights", func = function(p) return doTargetCombatHealth(0, p, COMBAT_HEALING, 150, 200, 30) end},
-- Ultimate mana potion
--[0] = {empty = 0, vocArray = {1, 2, 5, 6}, level = 130, str = "sorcerers and druids", func = function(p) return doTargetCombatMana(0, p, 200, 300, 31) end},
-- Great mana potion
--[0] = {empty = 0, vocArray = {1, 2, 5, 6}, level = 80, str = "sorcerers and druids", func = function(p) return doTargetCombatMana(0, p, 125, 220, 31) end},
-- Strong mana potion
--[0] = {empty = 0, vocArray = {1, 2, 5, 6}, level = 50, str = "sorcerers and druids", func = function(p) return doTargetCombatMana(0, p, 150, 300, 31) end},
-- Mana potion
[7530] = {empty = 0, func = function(p) return doTargetCombatMana(0, p, 75, 145, 31) end},
-- Health potion
[0] = {empty = 0, func = function(p) return doTargetCombatHealth(0, p, COMBAT_HEALING, 125, 175, 30) end},
-- Small health potion
--[0] = {empty = 0, func = function(p) return doTargetCombatHealth(0, p, COMBAT_HEALING, 60, 90, 30) end},
-- Antidote potion
[0] = {empty = 0, func = function(p) return antidote:execute(p, numberToVariant(p:getId())) end}
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if not target:getPlayer() then
return true
end
if player:getCondition(CONDITION_EXHAUST_HEAL) then
player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUAREEXHAUSTED))
return true
end

local tmp = t[item.itemid]
if tmp then
local level = tmp.level or 0
if tmp.vocArray and (not isInArray(tmp.vocArray, target:getVocation():getId()) or target:getLevel() < level) and not getPlayerFlagValue(player, PlayerFlag_IgnoreSpellCheck) then
player:say(string.format("This potion can only be consumed by %s of level %d or higher.", tmp.str, level), TALKTYPE_MONSTER_SAY)
return true
end
if not tmp.func(target) then
return false
end
player:addCondition(exhaust)
target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
item:remove(1)
player:remove(1)
end
return true
end
items.xml:
XML:
<item id="7530" article="a" name="mana fluid">
        <attribute key="weight" value="180" />
        <attribute key="pickupable" value="1" />
    </item>
Object Builder:
libertad 1.png
Item Editor:
libertad 2.png
 
There I followed what mano368 told me, look what he does now hahahaha amazing bug! In the server console I don't get any errors. The positive thing that is stacked now the manas xD
View attachment 80006
actions.xml:
XML:
<action itemid="7530" script="Other/fluids/potions.lua" />
potions.lua:
Lua:
local antidote = Combat()
antidote:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
antidote:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
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) - 1000))
local t = {
-- Great health potion
--[0] = {empty = 0, vocArray = {4, 8}, level = 80, str = "knights", func = function(p) return doTargetCombatHealth(0, p, COMBAT_HEALING, 750, 1100, 30) end},
-- Great spirit potion
--[0] = {empty = 0, vocArray = {3, 7}, level = 10, str = "paladins", func = function(p) return doTargetCombatHealth(0, p, COMBAT_HEALING, 150, 320, 29), doTargetCombatMana(0, p, 100, 180, 30) end},
-- Strong health potion
--[0] = {empty = 0, vocArray = {3, 4, 7, 8}, level = 80, str = "paladins and knights", func = function(p) return doTargetCombatHealth(0, p, COMBAT_HEALING, 150, 200, 30) end},
-- Ultimate mana potion
--[0] = {empty = 0, vocArray = {1, 2, 5, 6}, level = 130, str = "sorcerers and druids", func = function(p) return doTargetCombatMana(0, p, 200, 300, 31) end},
-- Great mana potion
--[0] = {empty = 0, vocArray = {1, 2, 5, 6}, level = 80, str = "sorcerers and druids", func = function(p) return doTargetCombatMana(0, p, 125, 220, 31) end},
-- Strong mana potion
--[0] = {empty = 0, vocArray = {1, 2, 5, 6}, level = 50, str = "sorcerers and druids", func = function(p) return doTargetCombatMana(0, p, 150, 300, 31) end},
-- Mana potion
[7530] = {empty = 0, func = function(p) return doTargetCombatMana(0, p, 75, 145, 31) end},
-- Health potion
[0] = {empty = 0, func = function(p) return doTargetCombatHealth(0, p, COMBAT_HEALING, 125, 175, 30) end},
-- Small health potion
--[0] = {empty = 0, func = function(p) return doTargetCombatHealth(0, p, COMBAT_HEALING, 60, 90, 30) end},
-- Antidote potion
[0] = {empty = 0, func = function(p) return antidote:execute(p, numberToVariant(p:getId())) end}
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if not target:getPlayer() then
return true
end
if player:getCondition(CONDITION_EXHAUST_HEAL) then
player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUAREEXHAUSTED))
return true
end

local tmp = t[item.itemid]
if tmp then
local level = tmp.level or 0
if tmp.vocArray and (not isInArray(tmp.vocArray, target:getVocation():getId()) or target:getLevel() < level) and not getPlayerFlagValue(player, PlayerFlag_IgnoreSpellCheck) then
player:say(string.format("This potion can only be consumed by %s of level %d or higher.", tmp.str, level), TALKTYPE_MONSTER_SAY)
return true
end
if not tmp.func(target) then
return false
end
player:addCondition(exhaust)
target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
item:remove(1)
player:remove(1)
end
return true
end
items.xml:
XML:
<item id="7530" article="a" name="mana fluid">
        <attribute key="weight" value="180" />
        <attribute key="pickupable" value="1" />
    </item>
Object Builder:
View attachment 80007
Item Editor:
View attachment 80008
Here is your problem:

Lua:
player:remove(1)

this forces the player to log out, just remove this line
 
Solution
Back
Top