• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Action TFS 1.3 Small Dodge System ~ Revscript ~ EventCallback

Sarah Wesker

ƐƖєgαηт Sуηтαx ❤
Staff member
TFS Developer
Support Team
Joined
Mar 16, 2017
Messages
1,416
Solutions
155
Reaction score
1,971
Location
London
GitHub
MillhioreBT
Twitch
millhiorebt
I have created a small dodge system for you
Only work with oficial TFS 1.3

data/scripts/dodgesystem.lua

Lua:
-- Dodge System
local config = {
    -- Dodge Stone Setting
    maxDodgeChance = 5,
    maxDodgeAmount = 8,
    maxLevel = 10,

    -- Buy Dodge Stone Settings
    dodgeItemId = 11106,
    dodgeItemCount = 1,
    price = 100 * 10000, -- 100 Crystal Coins
    leverActionId = 9999
}

local function getPlayerDodge(player)
    local chance, amount = 0, 0
    for i = 0, 10 do
        local item = player:getSlotItem(i)
        if item then
            chance = chance + (item:getCustomAttribute("dodgeChance") or 0)
            amount = amount + (item:getCustomAttribute("dodgeAmount") or 0)
        end
    end
    return math.min(chance, 100), math.min(amount / 100, 1)
end

local function getItemLevel(item)
    local chance = (item:getCustomAttribute("dodgeChance") or 0)
    local amount = (item:getCustomAttribute("dodgeAmount") or 0)
    return math.ceil(math.min((chance / config.maxDodgeChance) * config.maxLevel, (amount / config.maxDodgeAmount)  * config.maxLevel))
end

local dodgeHealth = CreatureEvent("DodgeHealthEvent")
local dodgeSayDelay = 0

function dodgeHealth.onHealthChange(player, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    if not attacker or not attacker:isPlayer() then
        return primaryDamage, primaryType, secondaryDamage, secondaryType
    end

    if attacker ~= player then
        local chance, amount = getPlayerDodge(player)
        if chance > 0 and amount > 0 then
            if chance >= math.random(100) then
                if dodgeSayDelay <= os.mtime() then
                    player:say("Dodge!")
                    dodgeSayDelay = os.mtime() + 3000
                end
                if amount >= 1 then
                    player:getPosition():sendMagicEffect(CONST_ME_POFF)
                end
                return primaryDamage - (amount * primaryDamage), primaryType, secondaryDamage - (amount * secondaryDamage), secondaryType
            end
        end
    end
    return primaryDamage, primaryType, secondaryDamage, secondaryType
end

dodgeHealth:register()

local dodgeMana = CreatureEvent("DodgeManaEvent")

function dodgeMana.onManaChange(player, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    if not attacker or not attacker:isPlayer() then
        return primaryDamage, primaryType, secondaryDamage, secondaryType
    end
    
    if attacker ~= player then
        local chance, amount = getPlayerDodge(player)
        if chance > 0 and amount > 0 then
            if chance >= math.random(100) then
                if dodgeSayDelay <= os.mtime() then
                    player:say("Dodge!")
                    dodgeSayDelay = os.mtime() + 3000
                end
                if amount >= 1 then
                    player:getPosition():sendMagicEffect(CONST_ME_POFF)
                end
                return primaryDamage - (amount * primaryDamage), primaryType, secondaryDamage - (amount * secondaryDamage), secondaryType
            end
        end
    end
    return primaryDamage, primaryType, secondaryDamage, secondaryType
end

dodgeMana:register()

local function isDodgeItem(iType)
    local weaponType = iType:getWeaponType()
    return weaponType ~= WEAPON_NONE or iType:getAttack() ~= 0 or iType:getDefense() ~= 0 or iType:getExtraDefense() ~= 0 or iType:getHitChance() ~= 0
end

local dodgeStone = Action()

function dodgeStone.onUse(player, item, fromPos, target, toPos, isHotkey)
    if not target or target.uid == 0 or target:isCreature() then
        player:sendCancelMessage("This item only works on items.")
        return true
    end

    if not isDodgeItem(target:getType()) then
        player:sendCancelMessage("Only items with base attributes can be upgraded.")
        return true
    end

    if getItemLevel(target) >= config.maxLevel then
        player:sendCancelMessage("This item is already fully upgraded.")
        return true
    end

    target:setCustomAttribute("dodgeChance", (target:getCustomAttribute("dodgeChance") or 0) + (config.maxDodgeChance / config.maxLevel))
    target:setCustomAttribute("dodgeAmount", (target:getCustomAttribute("dodgeAmount") or 0) + (config.maxDodgeAmount / config.maxLevel))
    target:getPosition():sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
    local itemLevel = getItemLevel(target)
    player:say(string.format("DodgeSuccess +%d!", itemLevel))
    player:sendCancelMessage(string.format("The %s o has been upgraded to level %d!", target:getName(), itemLevel))
    return true
end

dodgeStone:id(config.dodgeItemId)
dodgeStone:register()

local dodgeBuy = Action()

function dodgeBuy.onUse(player, item, fromPos, target, toPos, isHotkey)
    if not player:removeMoney(config.price) then
        player:sendCancelMessage(string.format("You don't have enough money, you need %s crystal coins.", config.price / 10000))
        return true
    end

    local dodgeItem = player:addItem(config.dodgeItemId, config.dodgeItemCount)
    if not dodgeItem then
        player:sendCancelMessage("You have no space, free up your inventory.")
        return true
    end

    local position = player:getPosition()
    fromPos:sendDistanceEffect(position, CONST_ANI_SMALLSTONE)
    player:say("DodgeBuySuccess!")
    position:sendMagicEffect(CONST_ME_STUN)

    local itemId = item:getId()
    if itemId == 1945 or itemId == 1946 then
        item:transform(itemId == 1945 and 1946 or 1945)
    end
    return true
end

dodgeBuy:aid(config.leverActionId)
dodgeBuy:register()

local dodgeLook = EventCallback

function dodgeLook.onLook(player, thing, position, distance, description)
    if thing:isItem() then
        local chance = (thing:getCustomAttribute("dodgeChance") or 0)
        local amount = (thing:getCustomAttribute("dodgeAmount") or 0)
        if chance ~= 0 and amount ~= 0 then
            description = string.format("%s\n[ Dodge Chance: %s%%, Amount: %s%% ]", description, chance, amount)
        end
    elseif thing:isPlayer() then
        local chance, amount = getPlayerDodge(player)
        if chance ~= 0 and amount ~= 0 then
            description = string.format("%s\n[ Dodge Chance: %s%%, Amount: %s%% ]", description, chance, amount * 100)
        end
    end
    return description
end

dodgeLook:register(2)

local dodgeLogin = CreatureEvent("DodgeLogin")

function dodgeLogin.onLogin(player)
    player:registerEvent("DodgeHealthEvent")
    player:registerEvent("DodgeManaEvent")
    return true
end

dodgeLogin:register()

You only have to configure the itemId of the dodge stone and the actionId for the lever with which the dodge stone is purchased

System caracteristics:
* Added to the end of the description of the items information about dodge chance and amount if you has them
1620585634539.png

* Added to the end of the description of the players information about dodge chance and amount exactly the total of your all items equiped if you has them

1620585664032.png
* Lever for buy dodge stones with actionId leverActionId = 9999
GIF 09-05-2021 02-55-24 p. m..gif1620587402229.png

* Just dodge players damages only
 
Last edited:
how to use in tfs 1.3 without eventcallback??
I tried here but I have this error, any solution?
[2021-14-07 21:47:01.561] [error] Lua script error: data/events/scripts/player.lua:player@onLook
[2021-14-07 21:47:01.561] [error] data/events/scripts/player.lua:102: attempt to call method 'isItem' (a nil value)
stack traceback:
[C]: in function 'isItem'
data/events/scripts/player.lua:102: in function <data/events/scripts/player.lua:100>
I tried to use it like this in the onlook function
if thing:isItem() then
local chance = (thing:getCustomAttribute("dodgeChance") or 0)
local amount = (thing:getCustomAttribute("dodgeAmount") or 0)
if chance ~= 0 and amount ~= 0 then
description = string.format("%s\n[ Dodge Chance: %s%%, Amount: %s%% ]", description, chance, amount)
end
elseif thing:isPlayer() then
local chance, amount = getPlayerDodge(player)
if chance ~= 0 and amount ~= 0 then
description = string.format("%s\n[ Dodge Chance: %s%%, Amount: %s%% ]", description, chance, amount * 100)
end
end
 
how to use in tfs 1.3 without eventcallback??
I tried here but I have this error, any solution?

I tried to use it like this in the onlook function
In your case you should try adding this piece of code to the onLook event in events/scripts/player.lua
Lua:
if thing:isItem() then
    local chance = (thing:getCustomAttribute("dodgeChance") or 0)
    local amount = (thing:getCustomAttribute("dodgeAmount") or 0)
    if chance ~= 0 and amount ~= 0 then
        description = string.format("%s\n[ Dodge Chance: %s%%, Amount: %s%% ]", description, chance, amount)
    end
elseif thing:isPlayer() then
    local chance, amount = getPlayerDodge(player)
    if chance ~= 0 and amount ~= 0 then
        description = string.format("%s\n[ Dodge Chance: %s%%, Amount: %s%% ]", description, chance, amount * 100)
    end
end
 
Hey, can you add target onLook? Cuz now if im looking on other player i see my dodge stats :/

I tried but everytime i got error attempt to call method 'getSlotItem' (a nil value)
 
Hey, can you add target onLook? Cuz now if im looking on other player i see my dodge stats :/

I tried but everytime i got error attempt to call method 'getSlotItem' (a nil value)

change getPlayerDodge(player) to getPlayerDodge(thing)

should work
 
Remove or not attacker:isPlayer() from onHealthChange and onManaChange
 
These status can only be applied on Weapons and Shields. Theres a way to add it just in Armor Items?
 
Sarah is possible you made a dodge system like this but apply in tfs 1.3.

I a using this abilites but doesn't have dodge.

Maybe you can help me pretty girl?
 
item should dissapear so ppl can use more money, is it possible to make remove item: true/false?
 
He creado un pequeño sistema de esquiva para ti.
Solo funciona con TFS 1.3 oficial

datos/scripts/dodgesystem.lua

[CÓDIGO="lua"]
-- Sistema de esquivar
configuración local = {
- Esquivar ajuste de piedra
maxDodgeChance = 5,
cantidad máxima de Dodge = 8,
nivel máximo = 10,

-- Comprar ajustes de Dodge Stone
esquivarItemId = 11106,
esquivarItemCount = 1,
precio = 100 * 10000, -- 100 monedas de cristal
palancaActionId = 9999
}

función local getPlayerDodge(jugador)
probabilidad local, cantidad = 0, 0
para i = 0, 10 hacer
elemento local = jugador:getSlotItem(i)
si el artículo entonces
oportunidad = oportunidad + (elemento:getCustomAttribute("dodgeChance") o 0)
cantidad = cantidad + (elemento:getCustomAttribute("dodgeAmount") o 0)
fin
fin
devuelve math.min(oportunidad, 100), math.min(cantidad / 100, 1)
fin

función local getItemLevel(elemento)
oportunidad local = (elemento:getCustomAttribute("dodgeChance") o 0)
monto local = (elemento:getCustomAttribute("dodgeAmount") o 0)
return math.ceil(math.min((chance / config.maxDodgeChance) * config.maxLevel, (cantidad / config.maxDodgeAmount) * config.maxLevel))
fin

local dodgeHealth = CreatureEvent("DodgeHealthEvent")
esquivar localSayDelay = 0

función dodgeHealth.onHealthChange(jugador, atacante, daño primario, tipo primario, daño secundario, tipo secundario, origen)
si no es atacante o no es atacante:isPlayer() entonces
devolver daño primario, tipo primario, daño secundario, tipo secundario
fin

si el atacante ~= jugador entonces
probabilidad local, cantidad = getPlayerDodge(jugador)
si probabilidad > 0 y cantidad > 0 entonces
si probabilidad >= math.random(100) entonces
si dodgeSayDelay <= os.mtime() entonces
jugador: decir ("¡Esquiva!")
esquivarSayDelay = os.mtime() + 3000
fin
si cantidad >= 1 entonces
jugador:getPosition():sendMagicEffect(CONST_ME_POFF)
fin
devolver daño primario - (cantidad * daño primario), tipo primario, daño secundario - (cantidad * daño secundario), tipo secundario
fin
fin
fin
devolver daño primario, tipo primario, daño secundario, tipo secundario
fin

esquivarSalud:registrarse()

local esquivarMana = CreatureEvent("DodgeManaEvent")

función dodgeMana.onManaChange(jugador, atacante, daño primario, tipo primario, daño secundario, tipo secundario, origen)
si no es atacante o no es atacante:isPlayer() entonces
devolver daño primario, tipo primario, daño secundario, tipo secundario
fin

si el atacante ~= jugador entonces
probabilidad local, cantidad = getPlayerDodge(jugador)
si probabilidad > 0 y cantidad > 0 entonces
si probabilidad >= math.random(100) entonces
si dodgeSayDelay <= os.mtime() entonces
jugador: decir ("¡Esquiva!")
esquivarSayDelay = os.mtime() + 3000
fin
si cantidad >= 1 entonces
jugador:getPosition():sendMagicEffect(CONST_ME_POFF)
fin
devolver daño primario - (cantidad * daño primario), tipo primario, daño secundario - (cantidad * daño secundario), tipo secundario
fin
fin
fin
devolver daño primario, tipo primario, daño secundario, tipo secundario
fin

esquivarMana:registrarse()

la función local esDodgeItem(iType)
tipo de arma local = iType:getWeaponType()
devolver tipo de arma ~= WEAPON_NONE o iType:getAttack() ~= 0 o iType:getDefense() ~= 0 o iType:getExtraDefense() ~= 0 o iType:getHitChance() ~= 0
fin

DodgeStone local = Acción()

función dodgeStone.onUse(jugador, elemento, fromPos, target, toPos, isHotkey)
si no es target o target.uid == 0 o target:isCreature() entonces
player:sendCancelMessage("Este elemento solo funciona en elementos.")
devolver verdadero
fin

si no esDodgeItem(objetivo:getType()) entonces
player:sendCancelMessage("Solo se pueden actualizar elementos con atributos básicos.")
devolver verdadero
fin

si getItemLevel(destino) >= config.maxLevel entonces
player:sendCancelMessage("Este elemento ya está completamente actualizado.")
devolver verdadero
fin

objetivo:setCustomAttribute("dodgeChance", (objetivo:getCustomAttribute("dodgeChance") o 0) + (config.maxDodgeChance / config.maxLevel))
objetivo:setCustomAttribute("dodgeAmount", (objetivo:getCustomAttribute("dodgeAmount") o 0) + (config.maxDodgeAmount / config.maxLevel))
objetivo:getPosition():sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
nivel de artículo local = getItemLevel (objetivo)
jugador:say(string.format("DodgeSuccess +%d!", itemLevel))
player:sendCancelMessage(string.format("¡%so se ha actualizado al nivel %d!", target:getName(), itemLevel))
devolver verdadero
fin

DodgePiedra:id(config.dodgeItemId)
esquivarPiedra:registrarse()

esquivar localComprar = Acción()

función dodgeBuy.onUse(jugador, artículo, fromPos, target, toPos, isHotkey)
si no es jugador: removeMoney(config.price) entonces
jugador:sendCancelMessage(string.format("No tienes suficiente dinero, necesitas %s monedas de cristal.", config.price / 10000))
devolver verdadero
fin

dodgeItem local = jugador:addItem(config.dodgeItemId, config.dodgeItemCount)
si no esquivar artículo entonces
player:sendCancelMessage("No tienes espacio, libera tu inventario.")
devolver verdadero
fin

posición local = jugador:getPosition()
fromPos:sendDistanceEffect(posición, CONST_ANI_SMALLSTONE)
jugador: decir ("¡DodgeCompra Éxito!")
posición: enviarMagicEffect (CONST_ME_STUN)

ID de artículo local = artículo:getId()
si itemId == 1945 o itemId == 1946 entonces
artículo: transformar (itemId == 1945 y 1946 o 1945)
fin
devolver verdadero
fin

esquivarComprar:aid(config.leverActionId)
esquivarComprar:registrarse()

DodgeLook local = EventCallback

función dodgeLook.onLook(jugador, cosa, posición, distancia, descripción)
si cosa: isItem() entonces
oportunidad local = (cosa:getCustomAttribute("dodgeChance") o 0)
monto local = (cosa:getCustomAttribute("dodgeAmount") o 0)
si probabilidad ~= 0 y cantidad ~= 0 entonces
descripción = string.format("%s\n[ Probabilidad de esquivar: %s%%, Cantidad: %s%% ]", descripción, probabilidad, cantidad)
fin
elseif cosa:isPlayer() entonces
probabilidad local, cantidad = getPlayerDodge(jugador)
si probabilidad ~= 0 y cantidad ~= 0 entonces
descripción = string.format("%s\n[ Probabilidad de esquivar: %s%%, Cantidad: %s%% ]", descripción, probabilidad, cantidad * 100)
fin
fin
descripción de la devolución
fin

esquivarMira:registrarse(2)

esquivarLogin local = CreatureEvent("DodgeLogin")

función esquivarLogin.onLogin(jugador)
jugador:registerEvent("DodgeHealthEvent")
jugador:registerEvent("DodgeManaEvent")
devolver verdadero
fin

esquivarIniciar sesión:registrarse()
[/CÓDIGO]

Solo debes configurar el itemId de la esquivar piedra y el actionId de la palanca con la que se compra la esquivar piedra.

Características del sistema:
*Añadido al final de la descripción de los items información sobre esquivar chancey amountsi los tienes
[ADJUNTAR=completo]58499[/ADJUNTAR]

* Se agregó al final de la descripción de los jugadores información sobre cómo esquivar chance and amountexactamente el total de todos los elementos equipados si los tienes.

[ADJUNTAR=completo]58500[/ADJUNTAR]
* Palanca para comprar esquivar piedras con actionIdleverActionId = 9999
View attachment 58501View attachment 58506

* Solo esquiva los daños de los jugadores solamente.

no estaba eliminando el item al usarlo si alguien quiere que el item se elimine cuando se use la piedra

aquí la secuencia de comandos



Lua:
-- Dodge System
local config = {
    -- Dodge Stone Setting
    maxDodgeChance = 5,
    maxDodgeAmount = 8,
    maxLevel = 10,

    -- Buy Dodge Stone Settings
    dodgeItemId = 11106,
    dodgeItemCount = 1,
    price = 10 * 1000, -- 10 Crystal Coins
    leverActionId = 9999
}

local function getPlayerDodge(player)
    local chance, amount = 0, 0
    for i = 0, 10 do
        local item = player:getSlotItem(i)
        if item then
            chance = chance + (item:getCustomAttribute("dodgeChance") or 0)
            amount = amount + (item:getCustomAttribute("dodgeAmount") or 0)
        end
    end
    return math.min(chance, 100), math.min(amount / 100, 1)
end

local function getItemLevel(item)
    local chance = (item:getCustomAttribute("dodgeChance") or 0)
    local amount = (item:getCustomAttribute("dodgeAmount") or 0)
    return math.ceil(math.min((chance / config.maxDodgeChance) * config.maxLevel, (amount / config.maxDodgeAmount)  * config.maxLevel))
end

local dodgeHealth = CreatureEvent("DodgeHealthEvent")
local dodgeSayDelay = 0

function dodgeHealth.onHealthChange(player, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    if not attacker or not attacker:isPlayer() then
        return primaryDamage, primaryType, secondaryDamage, secondaryType
    end

    if attacker ~= player then
        local chance, amount = getPlayerDodge(player)
        if chance > 0 and amount > 0 then
            if chance >= math.random(100) then
                if dodgeSayDelay <= os.mtime() then
                    player:say("Dodge!")
                    dodgeSayDelay = os.mtime() + 3000
                end
                if amount >= 1 then
                    player:getPosition():sendMagicEffect(CONST_ME_POFF)
                end
                return primaryDamage - (amount * primaryDamage), primaryType, secondaryDamage - (amount * secondaryDamage), secondaryType
            end
        end
    end
    return primaryDamage, primaryType, secondaryDamage, secondaryType
end

dodgeHealth:register()

local dodgeMana = CreatureEvent("DodgeManaEvent")

function dodgeMana.onManaChange(player, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    if not attacker or not attacker:isPlayer() then
        return primaryDamage, primaryType, secondaryDamage, secondaryType
    end
    
    if attacker ~= player then
        local chance, amount = getPlayerDodge(player)
        if chance > 0 and amount > 0 then
            if chance >= math.random(100) then
                if dodgeSayDelay <= os.mtime() then
                    player:say("Dodge!")
                    dodgeSayDelay = os.mtime() + 3000
                end
                if amount >= 1 then
                    player:getPosition():sendMagicEffect(CONST_ME_POFF)
                end
                return primaryDamage - (amount * primaryDamage), primaryType, secondaryDamage - (amount * secondaryDamage), secondaryType
            end
        end
    end
    return primaryDamage, primaryType, secondaryDamage, secondaryType
end

dodgeMana:register()

local function isDodgeItem(iType)
    local weaponType = iType:getWeaponType()
    return weaponType ~= WEAPON_NONE or iType:getAttack() ~= 0 or iType:getDefense() ~= 0 or iType:getExtraDefense() ~= 0 or iType:getHitChance() ~= 0
end

local dodgeStone = Action()

function dodgeStone.onUse(player, item, fromPos, target, toPos, isHotkey)
    if not target or target.uid == 0 or target:isCreature() then
        player:sendCancelMessage("This item only works on items.")
        return true
    end

    if not isDodgeItem(target:getType()) then
        player:sendCancelMessage("Only items with base attributes can be upgraded.")
        return true
    end

    if getItemLevel(target) >= config.maxLevel then
        player:sendCancelMessage("This item is already fully upgraded.")
        return true
    end

    target:setCustomAttribute("dodgeChance", (target:getCustomAttribute("dodgeChance") or 0) + (config.maxDodgeChance / config.maxLevel))
    target:setCustomAttribute("dodgeAmount", (target:getCustomAttribute("dodgeAmount") or 0) + (config.maxDodgeAmount / config.maxLevel))
    target:getPosition():sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
    local itemLevel = getItemLevel(target)
    player:say(string.format("DodgeSuccess +%d!", itemLevel))
    player:sendCancelMessage(string.format("The %s has been upgraded to level %d!", target:getName(), itemLevel))
    
    -- Eliminar el artículo usado del inventario del jugador
    elemento: eliminar (1)

    devolver verdadero
fin

DodgePiedra:id(config.dodgeItemId)
esquivarPiedra:registrarse()

esquivar localComprar = Acción()

función dodgeBuy.onUse(jugador, artículo, fromPos, target, toPos, isHotkey)
    si no es jugador: removeMoney(config.price) entonces
        jugador:sendCancelMessage(string.format("No tienes suficiente dinero, necesitas %s monedas de cristal.", config.price / 10000))
        devolver verdadero
    fin

    dodgeItem local = jugador:addItem(config.dodgeItemId, config.dodgeItemCount)
    si no esquivar artículo entonces
        player:sendCancelMessage("No tienes espacio, libera tu inventario.")
        devolver verdadero
    fin

    posición local = jugador:getPosition()
    fromPos:sendDistanceEffect(posición, CONST_ANI_SMALLSTONE)
    jugador: decir ("¡DodgeCompra Éxito!")
    posición: enviarMagicEffect (CONST_ME_STUN)

    ID de artículo local = artículo:getId()
    si itemId == 1945 o itemId == 1946 entonces
        artículo: transformar (itemId == 1945 y 1946 o 1945)
    fin
    devolver verdadero
fin

esquivarComprar:aid(config.leverActionId)
esquivarComprar:registrarse()

DodgeLook local = EventCallback

función dodgeLook.onLook(jugador, cosa, posición, distancia, descripción)
    si cosa: isItem() entonces
        oportunidad local = (cosa:getCustomAttribute("dodgeChance") o 0)
        monto local = (cosa:getCustomAttribute("dodgeAmount") o 0)
        si probabilidad ~= 0 y cantidad ~= 0 entonces
            descripción = string.format("%s\n[ Probabilidad de esquivar: %s%%, Cantidad: %s%% ]", descripción, probabilidad, cantidad)
        fin
    elseif cosa:isPlayer() entonces
        probabilidad local, cantidad = getPlayerDodge(jugador)
        si probabilidad ~= 0 y cantidad ~= 0 entonces
            descripción = string.format("%s\n[ Probabilidad de esquivar: %s%%, Cantidad: %s%% ]", descripción, probabilidad, cantidad * 100)
        fin
    fin
    descripción de la devolución
fin

esquivarMira:registrarse(2)

esquivarLogin local = CreatureEvent("DodgeLogin")

función esquivarLogin.onLogin(jugador)
    jugador:registerEvent("DodgeHealthEvent")
    jugador:registerEvent("DodgeManaEvent")
    devolver verdadero
fin

esquivarIniciar sesión:registrarse()[/CÓDIGO]
 
Back
Top