implement BB rare monster determination

This commit is contained in:
Martin Michelsen
2023-06-19 18:33:05 -07:00
parent 26dc50930b
commit 8db058871f
5 changed files with 206 additions and 129 deletions
+12 -1
View File
@@ -2066,7 +2066,6 @@ void send_level_up(shared_ptr<Lobby> l, shared_ptr<Client> c) {
send_command_t(l, 0x60, 0x00, cmd);
}
// gives a player EXP
void send_give_experience(shared_ptr<Lobby> l, shared_ptr<Client> c,
uint32_t amount) {
if (c->version() != GameVersion::BB) {
@@ -2079,6 +2078,18 @@ void send_give_experience(shared_ptr<Lobby> l, shared_ptr<Client> c,
send_command_t(l, 0x60, 0x00, cmd);
}
void send_rare_enemy_index_list(shared_ptr<Client> c, const vector<size_t>& indexes) {
S_RareMonsterList_BB_DE cmd;
if (indexes.size() > cmd.enemy_ids.size()) {
throw runtime_error("too many rare enemies");
}
for (size_t z = 0; z < indexes.size(); z++) {
cmd.enemy_ids[z] = indexes[z];
}
cmd.enemy_ids.clear_after(indexes.size(), 0xFFFF);
send_command_t(c, 0xDE, 0x00, cmd);
}
////////////////////////////////////////////////////////////////////////////////
// ep3 only commands