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

Solved

Status
Not open for further replies.

Exmortis

Member
Joined
Jun 27, 2008
Messages
189
Reaction score
5
This rune works great with the exception that the magiceffect "Aaah.." doesnt work.
Also I would like it to show how much mana is gained on the player that uses it.
You know what I mean?
Thanks alot for any help i'll get.
I'll rep you aswell.

Code:
local exhausted = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhausted, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local min, max
	local lvl, mag = getPlayerLevel(cid), getPlayerMagLevel(cid)
	if isSorcerer(cid) or isDruid(cid) then
		min = lvl * 1.0 + mag * 1.0
		max = lvl * 1.0 + mag * 1.0
	elseif isPaladin(cid) then
		min = lvl * 1.0 + mag * 1.0
		max = lvl * 1.0 + mag * 1.0
	elseif isKnight(cid) then
		min = lvl * 0.5 + mag * 0.5
		max = lvl * 1.0 + mag * 1.0
	end
	
	local rand = math.random(min, max)
	if rand > 400 then
		rand = 400
	end
	
	if rand < 100 then
		rand = 100
	end
	
	if hasCondition(cid, CONDITION_EXHAUST_HEAL) then
		return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
	end
	
	if not isPlayer(itemEx.uid) then
		return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
	end
	
	if(getCreatureMana(cid) >= getCreatureMaxMana(cid)) then
		return doPlayerSendCancel(cid, "Your mana is currently full.")
	end
	
	return doChangeTypeItem(item.uid, item.type - 1) and doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE) and doPlayerAddMana(itemEx.uid, rand) and doAddCondition(cid, exhausted) and doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
end
 
Last edited:
For the mana thing, (so you can see mana when you use pot or whatsoever)
In your config.lua:
Lua:
showHealingDamage = true
And thats it
 
Nah, that's for all healing types.

Code:
doSendAnimatedText(getPlayerPosition(cid), rand .. "", TEXTCOLOR_RED)
 
This is a more simple version of a manarune =/

Lua:
function onUse(cid, item, frompos, item2, topos)
mag = getPlayerMagLevel(cid)
if mag >= 3 then
doSendMagicEffect(topos,1)
doCreatureSay(cid,"Small Manarune",19) -- What You Want It To Say When You Use It.
doPlayerAddMana(cid, 500) -- Amount of Mana You Want To Add.
if item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
end
else
doSendMagicEffect(frompos,2)
doPlayerSendCancel(cid,"You don't have the required magic level to use that rune.") -- If You Don't Have Required Magic Level
end
return 1
 
Status
Not open for further replies.
Back
Top