Brad
Mapper
I'm wondering if its possible to make a Spell, Rune, Or Pot that heals a % of your Max hp Or mana. Ive used search and looked around but cant seem to find one.
Thanks~
Thanks~
function healPercent(cid, percent)
return doCreatureAddHealth(cid, (getCreatureMaxHealth(cid) * percent / 100))
end
Is that for a rune? or a spell? or a pot?
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_DISPEL, CONDITION_PARALYZE)
function healPercent(cid, percent)
return doCreatureAddHealth(cid, (getCreatureMaxHealth(cid) * percent / 100))
end
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
function onCastSpell(cid, var)
healPercent(cid, hereputnumber)
return doCombat(cid, combat, var)
end
<instant name="test" words="test" lvl="35" mana="10" prem="1" selftarget="1" aggressive="0" exhaustion="1000" needlearn="0" event="script" value="healing/test.lua">
<vocation id="3"/>
<vocation id="7"/>
</instant>
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
function onCastSpell(cid, var)
healPercent(cid, 25)
return doCombat(cid, combat, var)
end
local percent = 25
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_DISPEL, CONDITION_PARALYZE)
function onGetFormulaValues(cid, level, maglevel)
local v = getCreatureMaxHealth(cid) * percent / 100
return v, v
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end