project-meteor-server/data/scripts/effects/decoy2.lua
yogurt c442dc9ecd Script fixes and new effects.
Cleaned up unneeded requires in some scripts
Fixed Second Wind
Added new effect scripts
Added bard song scripts that mostly work
2018-06-25 23:36:18 -05:00

15 lines
659 B
Lua

require("modifiers")
require("battleutils")
--This is the traited version of Decoy. It can also evade physical attacks.
function onPreAction(effect, caster, target, skill, action, actionContainer)
--Evade single ranged or magic attack
--Traited allows for physical attacks
if target.allegiance != caster.allegiance and (skill.isRanged or action.actionType == ActionType.Magic or action.actionType == ActionType.Physical) then
--Set action's hit rate to 0
action.hirRate = 0.0;
--Remove status and add message
actionContainer.AddAction(target.statusEffects.RemoveStatusEffectForBattleAction(effect));
end
end;