landsandboat/scripts/items/holy_bolt.lua

25 lines
754 B
Lua

-----------------------------------
-- ID: 18153
-- Item: Holy Bolt
-- Additional effect: Light damage
-----------------------------------
---@type TItem
local itemObject = {}
itemObject.onItemAdditionalEffect = function(actor, target, baseAttackDamage, item)
local dStat = actor:getStat(xi.mod.MND) - target:getStat(xi.mod.MND)
-- Unconfirmed power.
local pTable =
{
ignoreEnSpell = true,
basePower = 40 + utils.clamp(dStat, -3, 8) + utils.clamp(math.floor((dStat - 8) / 2), 0, 8),
attackType = xi.attackType.MAGICAL,
magicalElement = xi.element.LIGHT,
canResist = true,
}
return xi.combat.action.executeAddEffectDamage(actor, target, pTable)
end
return itemObject