Bienvenido a Open Games Community

Únete ahora para acceder a todas nuestras funciones. Una vez que te registres e inicies sesión, podrás crear temas, responder a hilos existentes, valorar la reputación de otros miembros y muchísimo más. Además, es rápido y totalmente gratuito; ¿a qué esperas?

Tutorial [Otservbr] Cambiar la cantidad de puntos de Bestiario

Alex

Administrador
Dev
Registrado
1 Sep 2021
Mensajes
2.376
Puntuación de reacción
28.612
Puntos
707
Hola a todos,

Este es un breve tutorial, ya sea que quieras crear un evento o simplemente aumentar el número de muertes de cada monstruo en el bestiario.

Recordando que este tutorial es para quienes usan la base OTSERVBR

Primero ve en: data/scripts/creaturescripts/others/bestiary_kill.lua

Código:
local bestiaryOnKill = CreatureEvent("BestiaryOnKill")
function bestiaryOnKill.onKill(player, creature, lastHit)
    if not player:isPlayer() or not creature:isMonster() or creature:hasBeenSummoned() or creature:isPlayer() then
        return true
    end

    for cid, damage in pairs(creature:getDamageMap()) do
        local participant = Player(cid)
        if participant and participant:isPlayer() then
            local bestAmount = 1 --(default=1) how much will increase after kill a monster in bestiary
            for i = bestAmount, 1, -1 do 
            participant:addBestiaryKill(creature:getName())
            end
        end
      end

    return true
end
bestiaryOnKill:register()

Para cambiar el valor, simplemente cambie la variable "bestAmount" a la cantidad que desee.
Esto incrementara por ejemplo, si pones 5, de 5 en el bestiary.
 
shape1
shape2
shape3
shape4
shape5
shape6
Arriba