implement 6xD2 command

This commit is contained in:
Martin Michelsen
2023-10-19 15:44:31 -07:00
parent 5a30272869
commit a211bd07ac
4 changed files with 12 additions and 7 deletions
+4 -4
View File
@@ -3089,7 +3089,7 @@ struct SC_SyncCharacterSaveFile_BB_00E7 {
/* 2CB8 */ PlayerRecordsBB_Challenge challenge_records;
/* 2DF8 */ parray<uint8_t, 0x0028> tech_menu_config; // player
/* 2E20 */ parray<uint8_t, 0x002C> unknown_a6;
/* 2E4C */ parray<uint8_t, 0x0058> quest_data2; // player
/* 2E4C */ parray<le_uint32_t, 0x0016> quest_data2; // player
/* 2EA4 */ KeyAndTeamConfigBB key_config; // account
/* 3994 */
} __attribute__((packed));
@@ -5646,11 +5646,11 @@ struct G_BlackPaperDealPhotonCrystalExchange_BB_6xDF {
struct G_BlackPaperDealRewards_BB_6xE0 {
G_ClientIDHeader header;
uint8_t unknown_a1;
uint8_t unknown_a2;
uint8_t unknown_a2; // argsA[0]
uint8_t unknown_a3;
uint8_t unknown_a4;
le_uint32_t unknown_a5;
le_uint32_t unknown_a6;
le_float unknown_a5; // argsA[1]
le_float unknown_a6; // argsA[2]
} __packed__;
// 6xE1: Gallon's Plan quest (BB; handled by server)
+1 -1
View File
@@ -44,7 +44,7 @@ struct SavedPlayerDataBB { // .nsc file format
/* 185C */ ptext<char16_t, 0x00AC> info_board;
/* 19B4 */ PlayerInventory inventory;
/* 1D00 */ parray<uint8_t, 0x0208> quest_data1;
/* 1F08 */ parray<uint8_t, 0x0058> quest_data2;
/* 1F08 */ parray<le_uint32_t, 0x0016> quest_data2;
/* 1F60 */ parray<uint8_t, 0x0028> tech_menu_config;
/* 1F88 */
+1 -1
View File
@@ -838,7 +838,7 @@ static const QuestScriptOpcodeDefinition opcode_defs[] = {
{0xF95B, "bb_send_6xD9", {INT32, INT32, INT32, INT32, LABEL16, LABEL16}, F_V4 | F_ARGS}, // Sends 6xD9
{0xF95C, "bb_exchange_slt", {INT32, INT32, INT32, INT32}, F_V4 | F_ARGS}, // Sends 6xDE
{0xF95D, "bb_exchange_pc", {}, F_V4}, // Sends 6xDF
{0xF95E, "bb_box_create_bp", {INT32, INT32, INT32}, F_V4 | F_ARGS}, // Sends 6xE0
{0xF95E, "bb_box_create_bp", {INT32, FLOAT32, FLOAT32}, F_V4 | F_ARGS}, // Sends 6xE0
{0xF95F, "bb_exchange_pt", {INT32, INT32, INT32, INT32, INT32}, F_V4 | F_ARGS}, // Sends 6xE1
{0xF960, "bb_send_6xE2", {INT32}, F_V4 | F_ARGS}, // Sends 6xE2
{0xF961, "bb_get_6xE3_status", {REG}, F_V4}, // Returns 0 if 6xE3 hasn't been received, 1 if the received item is valid, 2 if the received item is invalid
+6 -1
View File
@@ -1950,6 +1950,11 @@ static void on_upgrade_weapon_attribute_bb(shared_ptr<Client> c, uint8_t, uint8_
}
}
static void on_write_quest_data2_bb(shared_ptr<Client> c, uint8_t, uint8_t, const void* data, size_t size) {
const auto& cmd = check_size_t<G_SetQuestData2_BB_6xD2>(data, size);
c->game_data.player()->quest_data2[cmd.index] = cmd.value;
}
////////////////////////////////////////////////////////////////////////////////
typedef void (*subcommand_handler_t)(shared_ptr<Client> c, uint8_t command, uint8_t flag, const void* data, size_t size);
@@ -2165,7 +2170,7 @@ subcommand_handler_t subcommand_handlers[0x100] = {
/* 6xCF */ on_battle_restart_bb,
/* 6xD0 */ on_battle_level_up_bb,
/* 6xD1 */ nullptr,
/* 6xD2 */ nullptr,
/* 6xD2 */ on_write_quest_data2_bb,
/* 6xD3 */ nullptr,
/* 6xD4 */ nullptr,
/* 6xD5 */ on_quest_exchange_item_bb,