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

Downgrade magic level?

Michael Orsino

Premium User
Staff member
Premium User
Support Team
Joined
Nov 15, 2007
Messages
864
Solutions
10
Reaction score
452
Location
Western Australia
Is there a function to downgrade magic level?

doPlayerAddExp(cid, -100)

something along the lines of

DoPlayerAddMlvl(cid, -5)

or perhaps a way to do it?
getPlayerSpentMana(cid)
doPlayerAddSpentMana(cid, amount)
getPlayerRequiredMana(cid, magicLevel)

-----

Failing that, I would have the script kick the player and then execute some sql to change the magic level, however I have a feeling that this would screw up because as soon as the player is kicked the script wont be able to get the player name, right? Or will the script retain the player name?

Worded badly, apologies.
Thanks for any insight!
 
Released by Tufte
Code:
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

Somehow I doubt this will work for negatives. Unsure.
Anyone know?
 
Back
Top