I would like to put an option to put bestiary 3x
Lua:
void IOBestiary::addBestiaryKill(Player* player, MonsterType* mtype, uint32_t amount /*= 1*/)
{
uint16_t raceid = mtype->info.raceid;
if (raceid == 0 || !player || !mtype) {
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) {
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);
}
}
}