• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Healing Rune

merfus

Member
Joined
Dec 27, 2011
Messages
214
Reaction score
5
Location
Poland
Hello i found this script:
LUA:
function onUse(cid, item, frompos, item2, topos)
	local exhausted_seconds = 2
	local exhausted_storagevalue = 74
 
                if isPlayer(cid) then
                 if(os.time() <= getPlayerStorageValue(cid, exhausted_storagevalue)) then
                 return doPlayerSendCancel(cid, "You are exhausted.")
                 end
		 if(item.type >= 1) then
doSendMagicEffect(topos,12)
	doCreatureAddMana(cid, math.floor(getCreatureMaxMana(cid)*0.20))
	doCreatureAddHealth(cid, math.floor(getCreatureMaxHealth(cid)*0.20))
					setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
					doChangeTypeItem(item.uid, item.type - 1)
			else
doSendMagicEffect(topos,12)
	doCreatureAddMana(cid, math.floor(getCreatureMaxMana(cid)*0.20))
	doCreatureAddHealth(cid, math.floor(getCreatureMaxHealth(cid)*0.20))
					setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
					doRemoveItem(item.uid, 1)
				end
		end
	return true
end



Can anyone change it for random add HP and MP. Now its add 20% always (0.20) but i want to randomize it, like from 20-30%, can anyone help me?
 
LUA:
function onUse(cid, item, frompos, item2, topos)
	local exhausted_seconds = 2
	local exhausted_storagevalue = 74
 
                if isPlayer(cid) then
                 if(os.time() <= getPlayerStorageValue(cid, exhausted_storagevalue)) then
                 return doPlayerSendCancel(cid, "You are exhausted.")
                 end
		 if(item.type >= 1) then
doSendMagicEffect(topos,12)
	doCreatureAddMana(cid, math.floor(getCreatureMaxMana(cid)*math.random(0.20,0.30)))
	doCreatureAddHealth(cid, math.floor(getCreatureMaxHealth(cid)*math.random(0.20,0.30)))
					setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
					doChangeTypeItem(item.uid, item.type - 1)
			else
doSendMagicEffect(topos,12)
	doCreatureAddMana(cid, math.floor(getCreatureMaxMana(cid)*math.random(0.20,0.30)))
	doCreatureAddHealth(cid, math.floor(getCreatureMaxHealth(cid)*math.random(0.20,0.30)))
					setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
					doRemoveItem(item.uid, 1)
				end
		end
	return true
end
There you go
 
LUA:
function onUse(cid, item, frompos, item2, topos)
	local exhausted_seconds = 2
	local exhausted_storagevalue = 74
 
                if isPlayer(cid) then
                 if(os.time() <= getPlayerStorageValue(cid, exhausted_storagevalue)) then
                 return doPlayerSendCancel(cid, "You are exhausted.")
                 end
		 if(item.type >= 1) then
doSendMagicEffect(topos,12)
	doCreatureAddMana(cid, math.floor(getCreatureMaxMana(cid)*math.random(0.20,0.30)))
	doCreatureAddHealth(cid, math.floor(getCreatureMaxHealth(cid)*math.random(0.20,0.30)))
					setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
					doChangeTypeItem(item.uid, item.type - 1)
			else
doSendMagicEffect(topos,12)
	doCreatureAddMana(cid, math.floor(getCreatureMaxMana(cid)*math.random(0.20,0.30)))
	doCreatureAddHealth(cid, math.floor(getCreatureMaxHealth(cid)*math.random(0.20,0.30)))
					setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
					doRemoveItem(item.uid, 1)
				end
		end
	return true
end
There you go

don't work ;x
No bug in console, just magic effect on item (not me) what i use and dont add hp/mp.
 
ultimate healing rune.lua
PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 29)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
--setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 1.20, -30, 1.30, 0)

function onGetFormulaValues(cid, level, maglevel)
	min = (level * 1 + maglevel * 5) * 1.1 - 20
	max = (level * 1 + maglevel * 5) * 1.20
	
	if min < 250 then
		min = 250
	end

	return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end

manarune.lua
PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)
doPlayerAddMana(cid, 10000)---- how much it heal .
doSendMagicEffect(getCreaturePosition(cid), 1)
doCreatureSay(cid, "Mana Rune", TALKTYPE_ORANGE_1)
doPlayerSendCancel(cid, text) 
end
 
ultimate healing rune.lua
PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 29)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
--setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 1.20, -30, 1.30, 0)

function onGetFormulaValues(cid, level, maglevel)
	min = (level * 1 + maglevel * 5) * 1.1 - 20
	max = (level * 1 + maglevel * 5) * 1.20
	
	if min < 250 then
		min = 250
	end

	return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end

manarune.lua
PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)
doPlayerAddMana(cid, 10000)---- how much it heal .
doSendMagicEffect(getCreaturePosition(cid), 1)
doCreatureSay(cid, "Mana Rune", TALKTYPE_ORANGE_1)
doPlayerSendCancel(cid, text) 
end

Ownage said:
Can anyone change it for random add HP and MP. Now its add 20% always (0.20) but i want to randomize it, like from 20-30%, can anyone help me?

First Read Post then Act
 
LUA:
function onUse(cid, item, frompos, item2, topos)
	local exhausted_seconds = 2
	local exhausted_storagevalue = 74
	local value = 0.01 * math.random(20, 30)
 
                if isPlayer(cid) then
                 if(os.time() <= getPlayerStorageValue(cid, exhausted_storagevalue)) then
                 return doPlayerSendCancel(cid, "You are exhausted.")
                 end
		 if(item.type >= 1) then
doSendMagicEffect(topos,12)
	doCreatureAddMana(cid, math.floor(getCreatureMaxMana(cid)* value))
	doCreatureAddHealth(cid, math.floor(getCreatureMaxHealth(cid)* value))
					setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
					doChangeTypeItem(item.uid, item.type - 1)
			else
doSendMagicEffect(topos,12)
	doCreatureAddMana(cid, math.floor(getCreatureMaxMana(cid)* value))
	doCreatureAddHealth(cid, math.floor(getCreatureMaxHealth(cid)* value))
					setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
					doRemoveItem(item.uid, 1)
				end
		end
	return true
end
try that again
 
LUA:
function onUse(cid, item, frompos, item2, topos)
	local exhausted_seconds = 2
	local exhausted_storagevalue = 74
	local value = 0.01 * math.random(20, 30)
 
                if isPlayer(cid) then
                 if(os.time() <= getPlayerStorageValue(cid, exhausted_storagevalue)) then
                 return doPlayerSendCancel(cid, "You are exhausted.")
                 end
		 if(item.type >= 1) then
doSendMagicEffect(topos,12)
	doCreatureAddMana(cid, math.floor(getCreatureMaxMana(cid)* value))
	doCreatureAddHealth(cid, math.floor(getCreatureMaxHealth(cid)* value))
					setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
					doChangeTypeItem(item.uid, item.type - 1)
			else
doSendMagicEffect(topos,12)
	doCreatureAddMana(cid, math.floor(getCreatureMaxMana(cid)* value))
	doCreatureAddHealth(cid, math.floor(getCreatureMaxHealth(cid)* value))
					setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
					doRemoveItem(item.uid, 1)
				end
		end
	return true
end
try that again

Works Perfect
Rep++ For you :)
 
Could someone make this action script to heal based on level instead of max health/mana?
Easy change but i can't find the correct term. Tried with getCreatureLevel >.<
 
Back
Top