• 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!

RevScripts how to increase the bestiary rate?

Hyagosrs

Member
Joined
Mar 10, 2018
Messages
94
Solutions
1
Reaction score
11
how to increase the bestiary rate? hmm.. like 3x or more ? OTBR
 
data/scripts/modules/bestiary_charms.lua
my bad, it's data/scripts/creaturescripts/others/bestiary_kill.lua
 
data/scripts/modules/bestiary_charms.lua
my bad, it's data/scripts/creaturescripts/others/bestiary_kill.lua


This is my script, but i don't think i could change for double or 3x..
Lua:
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
            participant:addBestiaryKill(creature:getName())
        end
      end

    return true
end
bestiaryOnKill:register()
 
This is my script, but i don't think i could change for double or 3x..
Lua:
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
            participant:addBestiaryKill(creature:getName())
        end
      end

    return true
end
bestiaryOnKill:register()
Lua:
participant:addBestiaryKill(creature:getName(), 3)

But u need to make some changes on the sources iobestiary.cpp:

Code:
void IOBestiary::addBestiaryKill(Player* player, MonsterType* mtype, uint32_t amount /*= 1*/)
{
    uint16_t raceid = mtype->info.raceid;
    if (raceid == 0) {
        return;
    }
    uint32_t curCount = player->getBestiaryKillCount(raceid);
    std::ostringstream ss;

    player->addBestiaryKillCount(raceid, amount);

    if (curCount == 0) {
        player->sendBestiaryEntryChanged(raceid);
        ss << "You unlocked details for the creature '" << mtype->name << "'";
        player->sendTextMessage(MESSAGE_STATUS, ss.str());
        return;
    }

    curCount += amount;

    if ((curCount == mtype->info.bestiaryFirstUnlock) || (curCount == mtype->info.bestiarySecondUnlock)) {
        ss << "You unlocked details for the creature '" << mtype->name << "'";
        player->sendTextMessage(MESSAGE_STATUS, ss.str());
        player->sendBestiaryEntryChanged(raceid);
} else if ((curCount >= mtype->info.bestiaryToUnlock) && curCount <= mtype->info.bestiaryToUnlock + 3) { 
        ss << "You unlocked details for the creature '" << mtype->name << "'";
        player->sendTextMessage(MESSAGE_STATUS, ss.str());
        addCharmPoints(player, mtype->info.bestiaryCharmsPoints);
        player->sendBestiaryEntryChanged(raceid);
    }

    std::list<MonsterType*> trackerList = player->getBestiaryTrackerList();
    for (MonsterType* mType : trackerList) {
        if (raceid == mType->info.raceid) {
            player->refreshBestiaryTracker(trackerList);
        }
    }
}
 
Back
Top