Untitled

mail@pastecode.io avatar
unknown
lua
2 months ago
798 B
3
Indexable
Never
local storage = 4500
local multiplier = 1.20
 
local config = {
    [1] = 150,
    [2] = 80,
    [3] = 50
}
 
function onStatsChange(cid, attacker, type, combat, value)

    if origin == ORIGIN_CRITICAL or not isPlayer(attacker) or attacker == cid or (type ~= STATSCHANGE_HEALTHLOSS and type ~= STATSCHANGE_MANALOSS) then
        return true
    end

    local nobility = tonumber(getPlayerStorageValue(attacker, storage)) or 0
    if config[nobility] then

        if (config[nobility] * 2) >= math.random (800) then

            local damage = math.min(2000000000, math.floor(value * multiplier)) * 2
            doTargetCombatHealth(attacker, cid, combat, -value, -value, 255, true, ORIGIN_CRITICAL)
            return false

        end
    end
 
    return true
end
Leave a Comment