-----------------------------------
-- ID: 16791
-- Item: Death Scythe +1
-- Additional Effect: Drains HP
-----------------------------------
require("scripts/globals/status")
require("scripts/globals/magic")
require("scripts/globals/msg")
-----------------------------------
local item_object = {}

item_object.onAdditionalEffect = function(player, target, damage)
    local chance = 10

    if (math.random(0, 99) >= chance) then
        return 0, 0, 0
    else
        local power = 10
        local params = {}
        params.bonusmab = 0
        params.includemab = false
        power = addBonusesAbility(player, tpz.magic.ele.DARK, target, power, params)
        power = power * applyResistanceAddEffect(player, target, tpz.magic.ele.DARK, 0)
        power = adjustForTarget(target, power, tpz.magic.ele.DARK)
        power = finalMagicNonSpellAdjustments(player, target, tpz.magic.ele.DARK, power )

        if (power < 0) then
            power = 0
        else
            player:addHP(power)
        end

        return tpz.subEffect.HP_DRAIN, tpz.msg.basic.ADD_EFFECT_HP_DRAIN, power
    end
end

return item_object
