Michcol94
Member
- Joined
- Sep 2, 2021
- Messages
- 105
- Reaction score
- 19
Lua:
<instant group="attack" name="Regeneration" words="regeneration" level="2" mana="50" manapercent="0" soul="0" premium="0" needtarget="0" casterTargetOrDirection="0" blockwalls="0" cooldown="2000" groupcooldown="2000" needlearn="0" script="attack/regeneration.lua">
<vocations>
<vocation name="Goku"/>
<vocation name="Goku 2"/>
<vocation name="Goku 3" />
<vocation name="Goku 4" />
<vocation name="Goku 5" />
<vocation name="Goku 6" />
</vocations>
</instant>
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
combat:setParameter(COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
function onGetFormulaValues(player, level, maglevel)
local heal = player:getMaxHealth() * 0.2 -- 20% of max HP
return heal, heal
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(creature, variant)
return combat:execute(creature, variant)
end