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

REQUEST: Potions that heal as your level goes up.

Entranced

I'm not Jesus
Joined
Feb 5, 2009
Messages
8
Reaction score
0
Location
Maine, USA
I've tried many different combinations of using the exura script inside the great mana potion action script, and it wont work.

I'm trying to create potions that "heal" higher as your level gets higher, like a healing spell works. The higher you level, the more it fills.

I've searched many different places, and have yet to find a formula/script.

Here was my script for strong mana potion, it didn't show any errors when I ran the server, but when I logged on, I wasn't able to use potions.
The server I'm running is the newest TFS crying dampson
Code:
function onGetFormulaValues(cid, level, maglevel)
	local MIN = (level * 1 + maglevel * 4) * .4
	local MAX = (level * 1 + maglevel * 4) * .6
	local EMPTY_POTION = 7634
		if min < 20 then
		min = 20
	end
	return min, max
end

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(MIN, 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)
	return TRUE
end
 
Last edited:
Add these 2 lines to the script
PHP:
local level = getPlayerLevel(cid)
local maglevel = getPlayerMagLevel(cid)

Don't forget to gimme rep++ if I helped you. :thumbup:
 
Code:
[13/05/2009 10:14:40] [Warning - Event::loadScript] Can not load script (data/actions/scripts/liquids/ultimate_health.lua)
[13/05/2009 10:14:40] data/actions/scripts/liquids/ultimate_health.lua:10: ')' expected near '('

What does
Code:
')' expected near '('
in line 10 mean?

PHP:
local EMPTY_POTION = 7635
local CHARGES = 3
local EXHAUST_TIME = 1 -- Exhaust time in seconds.
local STORE_VALUE = 3068 -- Value where exhaust is saved.

function onUse(cid, item, fromPosition, itemEx, toPosition)
	
	local level = getPlayerLevel(itemEx.uid)
	local MIN = ((15((level)-8)+185)*(.60))
	local MAX = ((15((level)-8)+185)*(.75)) 
	
	
	if isPlayer(itemEx.uid) == FALSE then
		return FALSE
	end
	
	if exhaust(cid, STORE_VALUE, EXHAUST_TIME) > 0 then
	
	
		if((not(isKnight(itemEx.uid)) or getPlayerLevel(itemEx.uid) < 130) and getPlayerCustomFlagValue(itemEx.uid, PlayerCustomFlag_GamemasterPrivileges) == FALSE) then
		doCreatureSay(itemEx.uid, "Only knights of level 130 or above may drink this fluid.", TALKTYPE_ORANGE_1)
		return TRUE
		
		else 
			if doCreatureAddHealth(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then
					return FALSE
			end
			
			
			doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
			doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
	
			if(item.actionid == 0) then
				doSetItemActionId(item.uid, 99 + CHARGES)
				return TRUE
			end

			local _charges = item.actionid - 100
			if(_charges > 1) then
				doSetItemActionId(item.uid, item.actionid - 1)
			else
				doRemoveItem(item.uid)
			end
		end
			
	else
		doPlayerSendCancel(cid, "You are exhausted.")
	end
	return 1
end
 
Back
Top