Version: 8.5
System: TFS 0.3.5pl1.r83
Problem: I'm trying to make the player gets 1 Magic Level when he perform an action X, I've tried with two different functions. One function is the TFS function and the other was made by my friend Socket.
TFS FUNCTION
What happens: The function adds the first level of magic level and then doesn't adds more.
SOCKET FUNCTION
What happens: The function works perfectly on 8.54 servers, but don't work on 8.5 servers ... It doesn't add magic level and gives no error in the console.
Could someone help me make this new function in lua OR c++?
System: TFS 0.3.5pl1.r83
Problem: I'm trying to make the player gets 1 Magic Level when he perform an action X, I've tried with two different functions. One function is the TFS function and the other was made by my friend Socket.
TFS FUNCTION
What happens: The function adds the first level of magic level and then doesn't adds more.
Code:
function doPlayerAddMagLevel(cid, amount)
for i = 1, amount do
doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid, getPlayerMagLevel(cid, true) + 1) - getPlayerSpentMana(cid)) / getConfigInfo('rateMagic'))
end
return true
end
SOCKET FUNCTION
What happens: The function works perfectly on 8.54 servers, but don't work on 8.5 servers ... It doesn't add magic level and gives no error in the console.
Code:
function doPlayerAddMagicLevel(cid, magicLevel)
local level = getPlayerMagLevel(cid)
local mana = getPlayerRequiredMana(cid, level + magicLevel)
doPlayerAddSpentMana(cid, mana)
return true
end
Could someone help me make this new function in lua OR c++?