Tutorial [Otservbr] Cambiar la cantidad de puntos de Bestiario

Alex

Miembro del equipo
Webdesigner
LV
58
 
Awards
38
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.
 
Arriba