refine 24 and 25 command structs
This commit is contained in:
+10
-5
@@ -888,24 +888,29 @@ struct SC_GameGuardCheck_BB_0022 {
|
||||
|
||||
// 24 (S->C): Secret Lottery Ticket exchange result (BB)
|
||||
// Sent in response to a 6xDE command from the client.
|
||||
// The client sets 8 sequential quest registers, starting with start_reg_num,
|
||||
// to the values specified in reg_values. Then it starts a new quest thread
|
||||
// at the specified label.
|
||||
// header.flag indicates whether the client had any Secret Lottery Tickets in
|
||||
// their inventory (and hence could participate): 0 means success, 1 means
|
||||
// failure.
|
||||
// failure. However, this value is unused by the client.
|
||||
|
||||
struct S_ExchangeSecretLotteryTicketResult_BB_24 {
|
||||
le_uint16_t label = 0;
|
||||
uint8_t start_index = 0;
|
||||
uint8_t start_reg_num = 0;
|
||||
uint8_t unused = 0;
|
||||
parray<le_uint32_t, 8> unknown_a3;
|
||||
parray<le_uint32_t, 8> reg_values;
|
||||
} __packed_ws__(S_ExchangeSecretLotteryTicketResult_BB_24, 0x24);
|
||||
|
||||
// 25 (S->C): Gallon's Plan result (BB)
|
||||
// Sent in response to a 6xE1 command from the client.
|
||||
// The client sets the quest registers reg_num1 to reg_value1 and reg_num2 to
|
||||
// reg_value2, then starts a new quest thread at the specified label.
|
||||
|
||||
struct S_GallonPlanResult_BB_25 {
|
||||
le_uint16_t label = 0;
|
||||
uint8_t offset1 = 0;
|
||||
uint8_t offset2 = 0;
|
||||
uint8_t reg_num1 = 0;
|
||||
uint8_t reg_num2 = 0;
|
||||
uint8_t value1 = 0;
|
||||
uint8_t value2 = 0;
|
||||
le_uint16_t unused = 0;
|
||||
|
||||
@@ -4765,15 +4765,15 @@ static void on_secret_lottery_ticket_exchange_bb(shared_ptr<Client> c, uint8_t,
|
||||
}
|
||||
|
||||
S_ExchangeSecretLotteryTicketResult_BB_24 out_cmd;
|
||||
out_cmd.start_index = cmd.index;
|
||||
out_cmd.start_reg_num = cmd.index;
|
||||
out_cmd.label = cmd.success_label;
|
||||
if (s->secret_lottery_results.empty()) {
|
||||
out_cmd.unknown_a3.clear(0);
|
||||
out_cmd.reg_values.clear(0);
|
||||
} else if (s->secret_lottery_results.size() == 1) {
|
||||
out_cmd.unknown_a3.clear(1);
|
||||
out_cmd.reg_values.clear(1);
|
||||
} else {
|
||||
for (size_t z = 0; z < out_cmd.unknown_a3.size(); z++) {
|
||||
out_cmd.unknown_a3[z] = random_from_optional_crypt(l->opt_rand_crypt) % s->secret_lottery_results.size();
|
||||
for (size_t z = 0; z < out_cmd.reg_values.size(); z++) {
|
||||
out_cmd.reg_values[z] = random_from_optional_crypt(l->opt_rand_crypt) % s->secret_lottery_results.size();
|
||||
}
|
||||
}
|
||||
send_command_t(c, 0x24, (slt_index >= 0) ? 0 : 1, out_cmd);
|
||||
@@ -4883,8 +4883,8 @@ static void on_quest_F95F_result_bb(shared_ptr<Client> c, uint8_t, uint8_t, void
|
||||
|
||||
S_GallonPlanResult_BB_25 out_cmd;
|
||||
out_cmd.label = cmd.success_label;
|
||||
out_cmd.offset1 = 0x3C;
|
||||
out_cmd.offset2 = 0x08;
|
||||
out_cmd.reg_num1 = 0x3C;
|
||||
out_cmd.reg_num2 = 0x08;
|
||||
out_cmd.value1 = 0x00;
|
||||
out_cmd.value2 = cmd.result_index;
|
||||
send_command_t(c, 0x25, 0x00, out_cmd);
|
||||
|
||||
Reference in New Issue
Block a user