1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-23 05:07:47 +00:00
project-meteor-server/data/scripts/effects/necrogenesis.lua

12 lines
518 B
Lua
Raw Normal View History

require("modifiers")
require("battleutils")
function onHit(effect, attacker, defender, action, actionContainer)
if action.commandType == CommandType.Spell then
--Necrogenesis returns 75% of damage done rounded up(?) as MP.
local hpToReturn = math.ceil(0.75 * action.amount);
attacker.AddMp(hpToReturn);
actionContainer.AddHPAction(attacker.actorId, 33012, mpToReturn);
actionContainer.AddAction(attacker.statusEffects.RemoveStatusEffectForBattleAction(effect));
end
end