This work for at least evolution.xml [0.7.8], and all TFS SQL servers from the 0.2 series. [At least from 0.2.4]
Enter data\actions\scripts\other and open potions.lua
Remove
same goes to:
and:
And replace those lines with:
Then when you click on the potion, you will drink the potion, and the vial will be removed automatic.
No more vials.
With this, you don't need any npc that buys vials at all, since there won't exist any vials.
[only the old vials you got when you where drinking the potions before you added this script.]
I'm just here to help you guys who think vials are annoying worthless items.
Any questions just ask.
For thoose of you who use Nharuto's potion system: [8.2, 8.21, 8.22]
Remove
And replace those lines with:
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:
Enter data\actions\scripts\other and open potions.lua
Remove
Code:
doTransformItem(item.uid, emptyPot)
Code:
doTransformItem(item.uid, strongEmptyPot)
Code:
doTransformItem(item.uid, greatEmptyPot)
Code:
doRemoveItem(item.uid,1)
Then when you click on the potion, you will drink the potion, and the vial will be removed automatic.
No more vials.
With this, you don't need any npc that buys vials at all, since there won't exist any vials.
[only the old vials you got when you where drinking the potions before you added this script.]
I'm just here to help you guys who think vials are annoying worthless items.
Any questions just ask.
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
Last edited: