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

Solved Super UH and mana rune

Thorn

Spriting since 2013
Joined
Sep 24, 2012
Messages
2,203
Solutions
1
Reaction score
923
Location
Chile
Plz i need a super uh and mana rune, but i need them to heal you a % of the total mana (manarune) and a % of total hp (super uh) plzzz
 
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
function onGetFormulaValues(cid, level, maglevel)
	local min = (getCreatureMaxHealth(cid) / 100) * 20
	local max = (getCreatureMaxHealth(cid) / 100) * 30
	return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
 
 
function onCastSpell(cid, var)	
	return doCombat(cid, combat, var)
end

20 is the min percent, and 30 is the max percent, use the same script for the manarune, but only edit values to heal mana instead of health.

Code:
getCreatureMaxMana
 
i don't undertand im kinda newbie with this >.<

- - - Updated - - -

where should i paste it, and idk how to make a "copy" to super uh :/! plz man help >.<
 
Is the super uh, look at this:

Code:
local min = (getCreatureMaxHealth(cid) / 100) * 20
	local max = (getCreatureMaxHealth(cid) / 100) * 30

The 20 is the min percent to heal, and the 30 is the max percent to heal.
 
Ok, and can i edit those number? to make it min 10 and max 15?

- - - Updated - - -

and how do i change it to make it manarune? :D

- - - Updated - - -

it says you cannot use this object >.< (manarune) i changed what u wrote to this
local min = (getCreatureMaxMana(cid) / 100) * 20
local max = (getCreatureMaxMana(cid) / 100) * 30

- - - Updated - - -

[Warning - Event::loadScript] Event onUse not found (data/actions/scripts/mr.lua)
error in console >.<
 
damn xD

- - - Updated - - -

plz could you give me the xml file to mr? i have the action xml :S!!
<action itemid="2294" event="script" value="mr.lua"/>

- - - Updated - - -

oh man now both works, but the mr is healing hp too :S
 
You need to configure it to heal mana too. Like this:

LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_MANADRAIN)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
function onGetFormulaValues(cid, level, maglevel)
	local min = (getCreatureMaxMana(cid) / 100) * 20
	local max = (getCreatureMaxMana(cid) / 100) * 30
	return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
 
 
function onCastSpell(cid, var)	
	return doCombat(cid, combat, var)
end
 
Back
Top