• 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] Spells Take Mana Depending On Level.

tabz23

New Member
Joined
Sep 3, 2009
Messages
66
Reaction score
0
Hey guys is it possible to set a spell to take away mana depending on the level you are? example: somewhere in each lua script for each spell there should be something like

if level 1-10 manacost is 100
if level 11-20 mana cost is 150

and then in spells.xml you put mana to 0 because if not itll take away the mana from spells AND the mana from the script...

is this possible? i dont want to do manapercent for my spells because then exura is gona cost a level 100 like 1k mana >.>

if anyone could help i would really appreciate it!!! just an example of exura should do... so i can know where to put it in the other scripts lol

easy config please!!! thanks alot!
 
Code:
local LH_ManaCost = {
	{{1, 10}, 100},
	{{11, 20}, 150}
}

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0.15, 0, 0.43, 0)

function onCastSpell(cid, var)
	for i = 1, #LH_ManaCost do
		if lvl >= LH_ManaCost[i][1][1] and lvl <= LH_ManaCost[i][1][2] then
			local manaCost = LH_ManaCost[i][2]
			if(getPlayerMana(cid) >= manaCost) then
				doPlayerRemoveMana(cid, manaCost)
				return doCombat(cid, combat, var)
			else
				return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHMANA)
			end
		end
	end
end
 
Back
Top