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

mana potion depending on the player level

dualshock3

New Member
Joined
May 14, 2010
Messages
89
Reaction score
3
please help with this.
this is what i need:- i need that the strong mana potion heals depending on the level of the player, also this with the great mana potion, please help !
also i need a ring that increase the attack of melee,death........ all damage types.
help please
 
Last edited:
Hope this helps you. Works on TFS 0.3.2



data/actions/actions.xml
PHP:
	<action itemid="7589" event="script" value="liquids/strong_mana.lua" allowfaruse="1"/>
	<action itemid="7590" event="script" value="liquids/great_mana.lua" allowfaruse="1"/>

data/actions/scripts/liquids/strong_mana.lua
Lua:
local MIN = 1.2
local MAX = 2
local EMPTY_POTION = 7634

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(itemEx.uid) == FALSE then
		return FALSE
	end

	if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
		return TRUE
	end

	if doPlayerAddMana(itemEx.uid, math.random((getPlayerLevel(cid) * MIN), (getPlayerLevel(cid) * MAX))) == LUA_ERROR then
		return FALSE
	end

	doAddCondition(cid, exhaust)
	doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
	doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
	doTransformItem(item.uid, EMPTY_POTION)
	return TRUE
end

data/actions/scripts/liquids/great_mana.lua
Lua:
local MIN = 1.5
local MAX = 2.5
local EMPTY_POTION = 7635

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(itemEx.uid) == FALSE then
		return FALSE
	end

	if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
		return TRUE
	end

	if doPlayerAddMana(itemEx.uid, math.random((getPlayerLevel(cid) * MIN), (getPlayerLevel(cid) * MAX))) == LUA_ERROR then
		return FALSE
	end

	doAddCondition(cid, exhaust)
	doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
	doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
	doTransformItem(item.uid, EMPTY_POTION)
	return TRUE
end
 
Last edited:
thanks they work perfectly. but i want them to be infinite, ty but can you help me me making them infinite?---------------------------------solved solved
 
Sure.
The same script.
but changed one thing.
Credit: who made the script ;P

Strong Mana~~
Code:
~local MIN = 1.2
local MAX = 2
local EMPTY_POTION = 7589

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
        if isPlayer(itemEx.uid) == FALSE then
                return FALSE
        end

        if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
                doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
                return TRUE
        end

        if doPlayerAddMana(itemEx.uid, math.random((getPlayerLevel(cid) * MIN), (getPlayerLevel(cid) * MAX))) == LUA_ERROR then
                return FALSE
        end

        doAddCondition(cid, exhaust)
        doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
        doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
        doTransformItem(item.uid, EMPTY_POTION)
        return TRUE


Great Mana~~~~
Code:
  local MIN =  1.5
local MAX = 2.5
local EMPTY_POTION = 7590

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
        if isPlayer(itemEx.uid) == FALSE then
                return FALSE
        end

        if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
                doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
                return TRUE
        end

        if doPlayerAddMana(itemEx.uid, math.random((getPlayerLevel(cid) * MIN), (getPlayerLevel(cid) * MAX))) == LUA_ERROR then
                return FALSE
        end

        doAddCondition(cid, exhaust)
        doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
        doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
        doTransformItem(item.uid, EMPTY_POTION)
        return TRUE
end

Hope it works :D
~~~~
Inferno-OT Owner.
 
Back
Top