• 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 Custom Mana Potion

SuperNino

New Member
Joined
Oct 6, 2010
Messages
26
Reaction score
1
Location
Sweden
Here you have a simple mana potion script that should work fine.
I've tried it and it works for me based on level,
was difficult to find this so thought I share with you now when I spend time to find it I might as well help those who are looking for it.


data/actions/actions.xml:
Code:
	<action itemid="7488" event="script" value="manapotion.lua"/>

data/actions/scripts/manapotion.lua:
Code:
local MIN = 1.0
local MAX = 1.5
local EMPTY_POTION = 7488
 
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, "Mana Potion!", TALKTYPE_ORANGE_1)
	doTransformItem(item.uid, EMPTY_POTION)
	return TRUE
end

Hope i did help some one aut there.
And rep me if u want to :thumbup:
 
ok. was this useless or what ?
give me a comment if it was good or bad?

something maybe ^^
 
Im sure this was needed, i don't know if i will use it tho..But i do know people will use this, they are just to lazy to comment! Good job.
 
Back
Top