because im new in scripting i hope you can help me i found that script for a manarune
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local level = player:getLevel()
local magLevel = player:getMagicLevel()
local min = (level * 2) + (magLevel * 1) - 50
local max = (level * 3) + (magLevel * 1)
player:addMana(math.random(min, max))
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
player:say("Uhhhh...", TALKTYPE_MONSTER_SAY)
return true
end
but i want to change that math random *3/*2
i want that the rune heal 20% of the mana and 15% health
is that possible to script that in percentage ?
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local level = player:getLevel()
local magLevel = player:getMagicLevel()
local min = (level * 2) + (magLevel * 1) - 50
local max = (level * 3) + (magLevel * 1)
player:addMana(math.random(min, max))
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
player:say("Uhhhh...", TALKTYPE_MONSTER_SAY)
return true
end
but i want to change that math random *3/*2
i want that the rune heal 20% of the mana and 15% health
is that possible to script that in percentage ?