• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

No more vials when buying potions.

Updated the thread:



For thoose of you who use Nharuto's potion system: [8.2, 8.21, 8.22]

Remove
Code:
            doTransformItem(item.uid, HealthP.trans)
Code:
            doTransformItem(item.uid, ManaP.trans)
Code:
            doTransformItem(item.uid, BothP.trans)

And replace those lines with:
Code:
		doRemoveItem(item.uid,1)

For lazy ass dudes who use Nharuto's potion script, or any other similar script, here is the finishing result:

Just copy and paste to your script:
PHP:
local HealthPotions = {
    [8377] = {min=800,max=1000,trans=7635,lvl=130,voc={4,8}},
    [7591] = {min=500,max=700,trans=7635,lvl=80,voc={4,8}},
    [7588] = {min=200,max=400,trans=7634,lvl=50,voc={3,4,7,8}},
    [7618] = {min=100,max=200,trans=7636,lvl=8,voc={1,2,3,4,5,6,7,8}}
}
local ManaPotions = {
    [7590] = {min=200,max=300,trans=7635,lvl=80,voc={1,2,5,6}},
    [7589] = {min=110,max=190,trans=7634,lvl=50,voc={1,2,3,5,6,7}},
    [7620] = {min=70,max=130,trans=7636,lvl=8,voc={1,2,3,4,5,6,7,8}}
}
local BothPotions = {
    [8472] = {hmin=200,hmax=400,mmin=110,mmax=190,trans=7635,lvl=80,voc={3,7}}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if itemEx.uid ~= cid or itemEx.itemid ~= 1 then
        return TRUE
    end
    local HealthP = HealthPotions[item.itemid]
    local ManaP = ManaPotions[item.itemid]
    local BothP = BothPotions[item.itemid]
    if HealthP then
        if isInArray(HealthP.voc, getPlayerVocation(cid)) == TRUE and getPlayerLevel(cid) >= HealthP.lvl or getPlayerGroupId(cid) >= 2 then
            if(doTargetCombatHealth(0, cid, COMBAT_HEALING, HealthP.min, HealthP.max, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
                return FALSE
            end
            doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid,1)
        else
            doCreatureSay(cid, "This potion can only be consumed by " .. getVocationsName(HealthP.voc) .. " of level " .. HealthP.lvl .. " or higher.", TALKTYPE_ORANGE_1)
        end
    elseif ManaP then
  if isInArray(ManaP.voc, getPlayerVocation(cid)) == TRUE and getPlayerLevel(cid) >= ManaP.lvl or getPlayerGroupId(cid) >= 2 then
            if(doTargetCombatMana(0, cid, ManaP.min, ManaP.max, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
                return FALSE
            end
            doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid,1)
        else
            doCreatureSay(cid, "This potion can only be consumed by " .. getVocationsName(ManaP.voc) .. " of level " .. ManaP.lvl .. " or higher.", TALKTYPE_ORANGE_1)
        end
    elseif BothP then
        if isInArray(BothP.voc, getPlayerVocation(cid)) == TRUE and getPlayerLevel(cid) >= BothP.lvl or getPlayerGroupId(cid) >= 2 then
            if(doTargetCombatHealth(0, cid, COMBAT_HEALING, BothP.hmin, BothP.hmax, CONST_ME_MAGIC_BLUE) == LUA_ERROR or doTargetCombatMana(0, cid, BothP.mmin, BothP.max, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
                return FALSE
            end
            doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid,1)
        else
            doCreatureSay(cid, "This potion can only be consumed by " .. getVocationsName(BothP.voc) .. " of level " .. BothP.lvl .. " or higher.", TALKTYPE_ORANGE_1)
        end
    end
return TRUE
end
 

Similar threads

Back
Top