Welcome! Today I'll show you a script that works as follows:
Infinity mana potion:
Does not end, it works depending on the level and profession.
Infinity health potion:
Same as above.
First step.
Open your data/actions/actions.xml and write this code:
Second step.
Create file (in directory data/talkactions/scripts/liquids)
infinityhealthpotion.lua and write this code:
Third step:
Create file (in directory data/talkactions/scripts/liquids)
infinitymanapotion.lua and write this code:
It remains only to change your file name items.xml fire bug and magic vial
Congratulations! You did it! Don't forget to rep++ me
Tested on TFS 0.3.5
Infinity mana potion:
Does not end, it works depending on the level and profession.
Infinity health potion:
Same as above.
First step.
Open your data/actions/actions.xml and write this code:
Code:
<action itemid="7488" event="script" value="liquids/infinitymanapotion.lua" allowfaruse="1"/>
<action itemid="5468" event="script" value="liquids/infinityhealthpotion.lua" allowfaruse="1"/>
Create file (in directory data/talkactions/scripts/liquids)
infinityhealthpotion.lua and write this code:
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000)
function onUse(cid, item, fromPosition, itemEx, toPosition)
local healthAdd = {
["Sorcerer"]={math.random(75, 125), math.random(75, 125), math.random(75, 125)}, ["Druid"]={math.random(75, 125), math.random(75, 125), math.random(75, 125)}, ["Paladin"]={math.random(75, 125), math.random(320, 390), math.random(450, 620)}, ["Knight"]={math.random(75, 125), math.random(320, 390), math.random(500, 800)},
["Master Sorcerer"]={math.random(75, 125), math.random(75, 125), math.random(75, 125)}, ["Elder Druid"]={math.random(75, 125), math.random(75, 125), math.random(75, 125)}, ["Royal Paladin"]={math.random(75, 125), math.random(320, 390), math.random(450, 620)}, ["Elite Knight"]={math.random(75, 125), math.random(320, 600), math.random(500, 800)}
}
if(isPlayer(itemEx.uid) == TRUE) then
if(hasCondition(itemEx.uid, CONDITION_EXHAUST) == FALSE) then
if(getPlayerLevel(itemEx.uid) < 50) then
doCreatureAddHealth(itemEx.uid, healthAdd[getPlayerVocationName(itemEx.uid)][1])
elseif(getPlayerLevel(itemEx.uid) >= 50) and (getPlayerLevel(itemEx.uid) < 80) then
doCreatureAddHealth(itemEx.uid, healthAdd[getPlayerVocationName(itemEx.uid)][2])
else
doCreatureAddHealth(itemEx.uid, healthAdd[getPlayerVocationName(itemEx.uid)][3])
end
doAddCondition(itemEx.uid, exhaust)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doSendAnimatedText(getCreaturePosition(itemEx.uid), "Aaaahhh...", TEXTCOLOR_DARKYELLOW)
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end
else
return FALSE
end
end
Create file (in directory data/talkactions/scripts/liquids)
infinitymanapotion.lua and write this code:
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000)
function onUse(cid, item, fromPosition, itemEx, toPosition)
local manaAdd = {
["Sorcerer"]={math.random(75, 125), math.random(180, 220), math.random(280, 320)}, ["Druid"]={math.random(75, 125), math.random(180, 220), math.random(280, 320)}, ["Paladin"]={math.random(75, 125), math.random(180, 220), math.random(180, 220)}, ["Knight"]={math.random(75, 125), math.random(75, 125), math.random(75, 125)},
["Master Sorcerer"]={math.random(75, 125), math.random(180, 220), math.random(280, 320)}, ["Elder Druid"]={math.random(75, 125), math.random(180, 220), math.random(280, 320)}, ["Royal Paladin"]={math.random(75, 125), math.random(180, 220), math.random(180, 220)}, ["Elite Knight"]={math.random(75, 125), math.random(75, 125), math.random(75, 125)}
}
if(isPlayer(itemEx.uid) == TRUE) then
if(hasCondition(itemEx.uid, CONDITION_EXHAUST) == FALSE) then
if(getPlayerLevel(itemEx.uid) < 50) then
doCreatureAddMana(itemEx.uid, manaAdd[getPlayerVocationName(itemEx.uid)][1])
elseif(getPlayerLevel(itemEx.uid) >= 50) and (getPlayerLevel(itemEx.uid) < 80) then
doCreatureAddMana(itemEx.uid, manaAdd[getPlayerVocationName(itemEx.uid)][2])
else
doCreatureAddMana(itemEx.uid, manaAdd[getPlayerVocationName(itemEx.uid)][3])
end
doAddCondition(itemEx.uid, exhaust)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doSendAnimatedText(getCreaturePosition(itemEx.uid), "Aaaah...", TEXTCOLOR_DARKYELLOW)
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end
else
return FALSE
end
end
Congratulations! You did it! Don't forget to rep++ me

Tested on TFS 0.3.5
Last edited: