This function is very handy for custom quests! Now you can add magic levels specified in 1 function!
Usage:
This will add 5 magic-levels upon the players current magic level! If he had mlvl 55, he will now have 60.
Put this in your data/lib/functions.lua
Tested on 0,3,4PL2
Would'nt mind a rep point from you
Usage:
PHP:
doPlayerAddMagLevel(cid, 5)
Put this in your data/lib/functions.lua
PHP:
function doPlayerAddMagLevel(cid, add)
local current = getPlayerRequiredMana(cid, getPlayerMagLevel(cid))
local manaspend = ((getPlayerRequiredMana(cid, getPlayerMagLevel(cid)+add)) / getConfigInfo("rateMagic"))
if isPlayer(cid) == TRUE then
doPlayerAddSpentMana(cid, (current + manaspend))
else
error("Player not found in function doPlayerAddMagLevel")
end
end
Tested on 0,3,4PL2
Would'nt mind a rep point from you