mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-09 05:54:50 +02:00
New scripts
New scripts for commands and effects that use the new function signatures and work with the new statuseffectcontainer
This commit is contained in:
parent
4f80023156
commit
00017468cc
129 changed files with 884 additions and 396 deletions
|
@ -6,12 +6,19 @@ function onMagicCast(caster, effect, skill)
|
|||
skill.mpCost = skill.mpCost / 2;
|
||||
end;
|
||||
|
||||
function onHit(effect, attacker, defender, action, actionContainer)
|
||||
if action.commandType == CommandType.Spell then
|
||||
--Parsimony returns 35% of damage done rounded up as MP.
|
||||
local mpToReturn = math.ceil(0.35 * action.amount);
|
||||
attacker.AddMp(mpToReturn);
|
||||
actionContainer.AddMPAction(attacker.actorId, 33007, mpToReturn);
|
||||
actionContainer.AddAction(attacker.statusEffects.RemoveStatusEffectForBattleAction(effect));
|
||||
--Having two identical functions seems weird. also don't know if parsimony still activates if resisted or evaded?
|
||||
function onHit(effect, attacker, defender, skill, action, actionContainer)
|
||||
if skill.GetCommandType() == CommandType.Spell then
|
||||
local percent = 0.10;
|
||||
|
||||
if effect.GetTier() == 2 then
|
||||
percent = 0.35;
|
||||
end
|
||||
|
||||
--Parsimony returns 10% (35 traited) of damage done rounded up as MP.
|
||||
local mpToReturn = math.ceil(percent * action.amount);
|
||||
attacker.AddMP(mpToReturn);
|
||||
actionContainer.AddMPAbsorbAction(0, 33007, mpToReturn);
|
||||
defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false);
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue