• 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 Rune mana/heatlh

Aklovo

Enjoy It
Joined
Dec 30, 2009
Messages
453
Reaction score
12
Location
México
Can anyone help me with a mana rune wich heals mana and health and can just be used by paladins?

Thanks :D!
 
Lua:
function onUse(cid, item, frompos, item2, topos)
mag = getPlayerMagLevel(cid)
	if isPladadin(cid) == TRUE then
	doSendMagicEffect(topos,1)
	doCreatureSay(cid,"Donated Manarune!!",19)
	doPlayerAddMana(cid, 10000)

	else
	doSendMagicEffect(frompos,2)
	doPlayerSendCancel(cid,"You don't have the required vocation to use that rune.")
	end
return TRUE
end
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(itemEx.uid) == TRUE and isPaladin(cid) == TRUE then
		doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN)
		doPlayerAddMana(itemEx.uid, 1000)
		doPlayerAddHealth(itemEx.uid, 1000)
	else
		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		doPlayerSendCancel(cid, isPlayer(itemEx.uid) == TRUE and "You don't have the required magic level to use that rune." or "You can only use this rune on players.")
	end
	return TRUE
end
 
Last edited:
Thx a lot cyko, you are great ;o, how can i learn lua code? can you tell me your secret? eh

Aa another thing, it will work with royal paly too? And i need to add in the spells.xml? or is an action? :S Thx, sorry im a nub :s
 
Why actions.xml o_O?
It's more relative to spells/runes, or am I wrong?
Aah, I see, onUse ;)
If anyone want the spells script fort manarune, I can post it here :)
Post it anyway :)

Spells.xml
Code:
<rune name="Manarune" id="2294" aggressive="0" charges="100" needtarget="1" maglv="1" exhaustion="2000" enabled="1" allowfaruse="1" script="custom/manarune.lua"></rune>

spells/scripts/custom/manarune.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)
local pos = getPlayerPosition(cid)
local mana_minimum = 500
local mana_maximum = 1000
-- Mana Formula Settings END --
local mana_add = math.random(mana_minimum, mana_maximum)
doPlayerAddMana(cid, mana_add)
return doCombat(cid, combat, var)
end

Items.xml -- find 2294
Code:
	<item id="2294" article="a" name="Manarune">
		<attribute key="weight" value="120"/>
		<attribute key="charges" value="5"/>
	</item>
 
Last edited:
action version allows you to use it in the same round as healing spell, in the spells way you get healing exhaust
but manarune with health is strong enough, so you can get healing exhaust, but should dispell paralisis

also every one forgot about the health part(he want spirit rune lets say :D)

Code:
local combat_health = createCombatObject()
setCombatParam(combat_health, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat_health, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat_health, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat_health, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat_health, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combat_health, COMBAT_FORMULA_LEVELMAGIC, 0, 500, 0, 1000)

local combat_mana = createCombatObject()
setCombatParam(combat_mana, COMBAT_PARAM_TYPE, COMBAT_MANADRAIN)
setCombatParam(combat_mana, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat_mana, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat_mana, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combat_mana, COMBAT_FORMULA_LEVELMAGIC, 0, 500, 0, 1000)

function onCastSpell(cid, var)
		doCombat(cid, combat_health, var)
	        doCombat(cid, combat_mana, var)
return TRUE
end
not tested, may not work(use spells.xml line and items.xml part from pos above)

@down: ok edited, used double prz dispell cause someties the dispel part of healing spells fails, so it will decrase fail chance I guess
 
Last edited:
Mana rune

Mana rune script
PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)
	doPlayerAddMana(cid, 500)
	return doCombat(cid, combat, var)
end

spells.xml
PHP:
	<rune name="Mana Rune" id="2300" allowfaruse="1" charges="5" lvl="8" exhaustion="899" maglv="5" aggressive="0" needtarget="1" blocktype="solid" script="manarune.lua"/>
 
Back
Top