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

Lua Mana rune

arturk4

New Member
Joined
Mar 2, 2011
Messages
61
Reaction score
2
How can i make a mana rune? do anyone have a simple step by step tutorial?
 
Using as a spell rune

in manarune.lua

PHP:
function onGetFormulaValues(cid, level, maglevel)
	min = (level * 1 + maglevel * 4) * 2.08
	max = (level * 1 + maglevel * 4) * 2.7
	return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)
	ret

in spells.xml

PHP:
	<rune name="Mana Rune" id="2273" allowfaruse="1" lvl="100" maglv="100" exhaustion="1000" aggressive="0" needtarget="1" blocktype="solid" script="manarune.lua">

	<vocation name="none"/>
</rune>


changing the values to your needs..


As an Action

in manarune.lua
PHP:
local ultimateMana = RUNE ID

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local var = numberToVariant(cid)
	local level = getPlayerLevel(cid)
	local mag = getPlayerMagLevel(cid)

	local manamin = (level/2.5)+(mag*2)
	local manamax = (level/2)+(mag*2)

	if itemEx.uid ~= cid or itemEx.itemid ~= 1 then
		return TRUE
	end

	if(item.itemid == ultimateMana) then
		if (getPlayerLevel(cid) < 150) or (getPlayerVocation(cid) ~= VOCATION_ID) then
			doCreatureSay(cid, "This potion can only be consumed by players of level 150 or higher.", TALKTYPE_ORANGE_1)
			return TRUE
		end
		if(doTargetCombatMana(0, cid, manamin, manamax, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
			return FALSE
		end
		--doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doTransformItem(item.uid, ultimateMana)
	end
	return TRUE
end


/\ will work probably,

actually not made by me;
check this thread http://otland.net/f16/mana-rune-20989/index2.html
 
Back
Top