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

Math.random spell

Onizuka

Member
Joined
Jul 5, 2008
Messages
2,291
Reaction score
14
Lua:
function onGetFormulaValues(cid, level, maglevel)
	local min = (level * 1 + maglevel * 2) * 2.2
	local max = (level * 1 + maglevel * 2) * 2.2
	return -math.max(250, min), -max

How can i edit this so it still hits by lvl/mlvl but it also makes random damage and not always 405,405,405,405,405 and so on...

:)

Thanks.
 
Where are you calling this formula from?
I don't know if its possible to return more than 2 values, but the logic for what you say is the following:


Code:
function onGetFormulaValues(cid, level, maglevel)
	local min = (level * 1 + maglevel * 2) * 2.2
	local max = (level * 1 + maglevel * 2) * 2.2
              returnValue = math.random(min,max)
	return returnValue 

end
 
Lua:
function onGetFormulaValues(cid, level, maglevel)
	local min = (level * 1 + maglevel * 2) * 2.2
	local max = (level * 1 + maglevel * 2) * 2.2
	return -math.max(250, min), -max

How can i edit this so it still hits by lvl/mlvl but it also makes random damage and not always 405,405,405,405,405 and so on...

:)

Thanks.

change the 2nd formula (max)? =/
 
Back
Top