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

Action Infinity Potions 0.3.5

natix4

mc
Joined
Nov 8, 2009
Messages
154
Reaction score
1
Location
Poland
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:
Code:
	<action itemid="7488" event="script" value="liquids/infinitymanapotion.lua" allowfaruse="1"/>
	<action itemid="5468" event="script" value="liquids/infinityhealthpotion.lua" allowfaruse="1"/>
Second step.
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
Third step:
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
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 :D
Tested on TFS 0.3.5
 
Last edited:
When i check something like 'show healing damage.. blabla' its doesnt showing when im using this potions.

Can any1 help me?

Rep+ for help!
 
Back
Top