From 0828923c2d914196f90f8d0cbbca26b3281dde9e Mon Sep 17 00:00:00 2001 From: HuLiNap Date: Fri, 2 May 2025 15:31:07 +0700 Subject: [PATCH] fix some issues with lineup --- config.json | 378 ++++++++++++++--------- gameserver/src/commands/sync.zig | 6 + gameserver/src/manager/battle_mgr.zig | 44 +-- gameserver/src/manager/lineup_mgr.zig | 6 +- gameserver/src/manager/multipath_mgr.zig | 8 +- gameserver/src/manager/scene_mgr.zig | 2 +- gameserver/src/services/avatar.zig | 7 + 7 files changed, 285 insertions(+), 166 deletions(-) diff --git a/config.json b/config.json index fba2ccc..621d4f2 100644 --- a/config.json +++ b/config.json @@ -1,53 +1,5 @@ { "avatar_config": [ - { - "name": "Acheron", - "id": 1304, - "hp": 100, - "sp": 0, - "level": 80, - "promotion": 6, - "rank": 6, - "lightcone": { - "id": 23000, - "rank": 2, - "level": 80, - "promotion": 6 - }, - "relics": [ - "61171,15,1,4,3:2:2,4:1:2,8:2:3,9:3:1", - "61172,15,1,4,1:2:4,5:2:4,8:2:2,9:3:1", - "61173,15,5,4,4:2:0,5:3:2,8:3:5,10:1:1", - "61174,15,2,4,2:2:2,8:3:5,9:2:2,10:1:1", - "63145,15,7,4,3:3:5,4:1:2,5:1:1,8:3:4", - "63146,15,4,4,3:2:1,9:4:4,10:1:1,11:1:1" - ], - "use_technique": true - }, - { - "name": "Hyacine", - "id": 1313, - "hp": 100, - "sp": 50, - "level": 80, - "promotion": 6, - "rank": 6, - "lightcone": { - "id": 23001, - "rank": 2, - "level": 80, - "promotion": 6 - }, - "relics": [ - "61251,15,1,4,5:1:1,6:3:3,7:3:3,12:1:1", - "61252,15,1,4,7:3:3,10:3:3,11:2:2,12:1:1", - "61253,15,6,4,5:1:1,6:3:5,7:2:4,12:3:4", - "61254,15,4,4,4:2:0,9:2:2,11:2:4,10:3:0", - "63205,15,8,4,2:2:3,7:3:1,8:2:1,10:2:4", - "63206,15,3,4,3:3:2,7:2:1,9:3:4,11:1:1" - ], - "use_technique": true - }, { "name": "Cipher", "id": 1406, @@ -57,44 +9,68 @@ "promotion": 6, "rank": 6, "lightcone": { - "id": 23004, - "rank": 2, + "id": 23043, + "rank": 5, "level": 80, "promotion": 6 }, "relics": [ - "61171,15,1,4,7:2:2,5:2:3,8:1:2,9:3:2", - "61172,15,1,4,5:2:3,8:2:2,9:2:2,12:2:1", - "61173,15,5,4,8:3:3,7:2:2,5:3:0,2:1:1", - "61174,15,4,4,3:2:3,8:2:3,9:2:2,10:2:1", - "63145,15,9,4,3:2:2,5:2:2,8:2:3,9:2:3", - "63146,15,4,4,1:2:3,6:1:2,8:1:0,9:4:2" + "61261,15,1,4,9:5:5,10:2:2,6:1:1,5:1:1", + "61262,15,1,4,12:1:1,6:3:3,4:2:2,11:3:3", + "61263,15,5,4,7:3:3,6:1:1,2:2:2,4:3:3", + "61264,15,4,4,11:1:1,12:1:1,9:5:5,6:2:2", + "63145,15,7,4,3:3:3,2:2:2,4:3:3,8:1:1", + "63146,15,4,4,9:3:3,2:2:2,3:1:1,6:3:3" ], "use_technique": false }, { - "name": "Tribbie", - "id": 1403, + "name": "Hyacine", + "id": 1409, "hp": 100, - "sp": 0, + "sp": 50, "level": 80, "promotion": 6, "rank": 6, "lightcone": { - "id": 23006, - "rank": 2, + "id": 23042, + "rank": 5, "level": 80, "promotion": 6 }, "relics": [ - "61241,15,1,4,8:2:1,9:2:4,11:2:2,12:2:2", - "61242,15,1,4,3:1:0,8:3:3,9:2:1,12:2:3", - "61243,15,5,4,3:2:4,8:3:2,10:1:0,11:2:3", - "61244,15,1,4,5:2:2,8:2:3,9:2:1,12:2:4", - "63195,15,1,4,1:2:4,5:1:1,8:4:4,9:1:1", - "63196,15,3,4,7:2:1,8:4:7,9:2:1,10:1:1" + "61251,15,1,4,7:3:3,2:2:2,12:3:3,9:1:1", + "61252,15,1,4,7:1:1,12:5:5,10:2:2,3:1:1", + "61253,15,6,4,5:3:3,8:1:1,7:3:3,10:2:2", + "61254,15,4,4,9:1:1,8:4:4,11:2:2,5:2:2", + "63205,15,1,4,7:3:3,8:2:2,10:1:1,2:3:3", + "63206,15,3,4,5:3:3,8:2:2,11:3:3,6:1:1" ], - "use_technique": true + "use_technique": false + }, + { + "name": "Anaxa", + "id": 1405, + "hp": 100, + "sp": 50, + "level": 80, + "promotion": 6, + "rank": 6, + "lightcone": { + "id": 23041, + "rank": 5, + "level": 80, + "promotion": 6 + }, + "relics": [ + "61081,15,1,4,12:2:2,6:2:2,2:3:3,10:2:2", + "61082,15,1,4,5:2:2,6:4:4,11:1:1,8:2:2", + "61083,15,5,4,7:3:3,3:1:1,6:3:3,5:2:2", + "61084,15,4,4,12:1:1,8:1:1,9:2:2,4:5:5", + "63175,15,8,4,7:4:4,9:2:2,3:2:2,11:1:1", + "63176,15,2,4,5:4:4,10:2:2,7:2:2,11:1:1" + ], + "use_technique": false }, { "name": "Castorice", @@ -105,23 +81,71 @@ "promotion": 6, "rank": 6, "lightcone": { - "id": 23015, - "rank": 2, + "id": 23040, + "rank": 5, "level": 80, "promotion": 6 }, "relics": [ - "61241,15,1,4,8:2:2,6:2:2,4:2:2,2:3:3", - "61242,15,1,4,3:3:3,9:2:2,7:2:2,8:2:2", - "61243,15,5,4,6:2:2,4:2:2,12:1:1,2:4:4", - "61244,15,1,4,5:4:4,8:2:2,1:2:2,6:1:1", - "63195,15,1,4,9:2:2,2:1:1,8:1:1,11:5:5", - "63196,15,3,4,7:1:1,1:3:3,11:4:4,2:1:1" + "61241,15,1,4,6:3:3,9:4:4,4:1:1,10:1:1", + "61242,15,1,4,9:2:2,3:1:1,7:4:4,5:2:2", + "61243,15,5,4,7:1:1,3:2:2,10:3:3,6:3:3", + "61244,15,1,4,1:2:2,5:2:2,12:2:2,8:3:3", + "63195,15,1,4,2:3:3,12:1:1,8:2:2,5:3:3", + "63196,15,3,4,9:3:3,6:2:2,8:3:3,3:1:1" ], - "use_technique": true + "use_technique": false }, { - "name": "Castorice", + "name": "Mydei", + "id": 1404, + "hp": 100, + "sp": 50, + "level": 80, + "promotion": 6, + "rank": 6, + "lightcone": { + "id": 23039, + "rank": 5, + "level": 80, + "promotion": 6 + }, + "relics": [ + "61241,15,1,4,3:2:2,12:2:2,6:2:2,2:3:3", + "61242,15,1,4,5:1:1,6:3:3,10:3:3,9:2:2", + "61243,15,5,4,10:3:3,12:1:1,8:2:2,3:3:3", + "61244,15,1,4,8:2:2,11:2:2,10:2:2,2:3:3", + "63195,15,1,4,12:2:2,7:4:4,3:1:1,8:2:2", + "63196,15,3,4,7:3:3,10:1:1,6:3:3,3:2:2" + ], + "use_technique": false + }, + { + "name": "Tribbie", + "id": 1403, + "hp": 100, + "sp": 50, + "level": 80, + "promotion": 6, + "rank": 6, + "lightcone": { + "id": 23038, + "rank": 5, + "level": 80, + "promotion": 6 + }, + "relics": [ + "61241,15,1,4,9:3:3,11:2:2,12:2:2,2:2:2", + "61242,15,1,4,1:1:1,12:2:2,6:4:4,9:2:2", + "61243,15,5,4,6:3:3,1:2:2,7:3:3,11:1:1", + "61244,15,1,4,1:2:2,2:2:2,3:1:1,8:4:4", + "63195,15,1,4,8:3:3,3:2:2,2:2:2,11:2:2", + "63196,15,2,4,9:3:3,11:3:3,7:2:2,6:1:1" + ], + "use_technique": false + }, + { + "name": "Trailblazer", "id": 8008, "hp": 100, "sp": 50, @@ -129,23 +153,23 @@ "promotion": 6, "rank": 6, "lightcone": { - "id": 23009, - "rank": 2, + "id": 24005, + "rank": 5, "level": 80, "promotion": 6 }, "relics": [ - "61241,15,1,4,8:2:2,6:2:2,4:2:2,2:3:3", - "61242,15,1,4,3:3:3,9:2:2,7:2:2,8:2:2", - "61243,15,5,4,6:2:2,4:2:2,12:1:1,2:4:4", - "61244,15,1,4,5:4:4,8:2:2,1:2:2,6:1:1", - "63195,15,1,4,9:2:2,2:1:1,8:1:1,11:5:5", - "63196,15,3,4,7:1:1,1:3:3,11:4:4,2:1:1" + "61231,15,1,4,6:2:2,3:1:1,7:3:3,11:3:3", + "61232,15,1,4,9:2:2,8:3:3,7:2:2,3:2:2", + "61233,15,5,4,5:2:2,7:3:3,4:3:3,8:1:1", + "61234,15,4,4,4:3:3,11:2:2,5:3:3,12:1:1", + "63185,15,6,4,7:2:2,11:3:3,6:3:3,2:1:1", + "63186,15,2,4,8:2:2,1:3:3,5:2:2,6:2:2" ], - "use_technique": true + "use_technique": false }, { - "name": "Castorice", + "name": "March 7th", "id": 1001, "hp": 100, "sp": 50, @@ -153,44 +177,20 @@ "promotion": 6, "rank": 6, "lightcone": { - "id": 23012, - "rank": 2, + "id": 23023, + "rank": 5, "level": 80, "promotion": 6 }, "relics": [ - "61241,15,1,4,8:2:2,6:2:2,4:2:2,2:3:3", - "61242,15,1,4,3:3:3,9:2:2,7:2:2,8:2:2", - "61243,15,5,4,6:2:2,4:2:2,12:1:1,2:4:4", - "61244,15,1,4,5:4:4,8:2:2,1:2:2,6:1:1", - "63195,15,1,4,9:2:2,2:1:1,8:1:1,11:5:5", - "63196,15,3,4,7:1:1,1:3:3,11:4:4,2:1:1" + "61031,15,1,4,8:2:2,2:2:2,5:2:2,7:3:3", + "61032,15,1,4,10:3:3,7:1:1,3:2:2,5:3:3", + "61033,15,5,4,6:3:3,8:3:3,11:1:1,4:2:2", + "61034,15,4,4,6:2:2,9:2:2,3:2:2,10:3:3", + "63085,15,6,4,5:1:1,4:3:3,7:4:4,6:1:1", + "63186,15,2,4,10:3:3,1:1:1,9:3:3,11:2:2" ], - "use_technique": true - }, - { - "name": "The Herta", - "id": 1401, - "hp": 100, - "sp": 50, - "level": 80, - "promotion": 6, - "rank": 6, - "lightcone": { - "id": 23013, - "rank": 2, - "level": 80, - "promotion": 6 - }, - "relics": [ - "61221,15,1,4,12:2:2,3:1:1,10:4:4,5:2:2", - "61222,15,1,4,3:4:4,4:1:1,10:3:3,8:1:1", - "61223,15,5,4,3:3:3,2:3:3,12:1:1,8:2:2", - "61224,15,4,4,6:3:3,2:1:1,12:3:3,8:2:2", - "63145,15,6,4,11:2:2,5:1:1,9:2:2,8:4:4", - "63146,15,4,4,6:3:3,10:1:1,12:4:4,11:1:1" - ], - "use_technique": true + "use_technique": false }, { "name": "Aglaea", @@ -201,44 +201,140 @@ "promotion": 6, "rank": 6, "lightcone": { - "id": 23033, - "rank": 2, + "id": 23036, + "rank": 5, "level": 80, "promotion": 6 }, "relics": [ - "61221,15,1,4,12:2:2,3:1:1,10:4:4,5:2:2", - "61222,15,1,4,3:4:4,4:1:1,10:3:3,8:1:1", - "61223,15,5,4,3:3:3,2:3:3,12:1:1,8:2:2", - "61224,15,4,4,6:3:3,2:1:1,12:3:3,8:2:2", - "63145,15,6,4,11:2:2,5:1:1,9:2:2,8:4:4", - "63146,15,4,4,6:3:3,10:1:1,12:4:4,11:1:1" + "61231,15,1,4,3:1:1,9:2:2,12:3:3,8:3:3", + "61232,15,1,4,12:3:3,4:2:2,3:2:2,11:2:2", + "61233,15,5,4,2:3:3,3:2:2,6:2:2,5:2:2", + "61234,15,4,4,6:1:1,2:2:2,4:3:3,3:3:3", + "63185,15,7,4,7:4:4,10:2:2,11:1:1,5:2:2", + "63186,15,4,4,8:4:4,3:1:1,1:2:2,9:2:2" ], - "use_technique": true + "use_technique": false }, { - "name": "Yunli", - "id": 1221, + "name": "The Herta", + "id": 1401, "hp": 100, "sp": 50, "level": 80, "promotion": 6, "rank": 6, "lightcone": { - "id": 23018, - "rank": 2, + "id": 23037, + "rank": 5, "level": 80, "promotion": 6 }, "relics": [ - "61221,15,1,4,12:2:2,3:1:1,10:4:4,5:2:2", - "61222,15,1,4,3:4:4,4:1:1,10:3:3,8:1:1", - "61223,15,5,4,3:3:3,2:3:3,12:1:1,8:2:2", - "61224,15,4,4,6:3:3,2:1:1,12:3:3,8:2:2", - "63145,15,6,4,11:2:2,5:1:1,9:2:2,8:4:4", - "63146,15,4,4,6:3:3,10:1:1,12:4:4,11:1:1" + "61221,15,1,4,7:2:2,2:3:3,9:1:1,12:3:3", + "61222,15,1,4,11:2:2,5:2:2,1:2:2,10:3:3", + "61223,15,5,4,10:3:3,12:2:2,5:3:3,4:1:1", + "61224,15,4,4,5:2:2,2:1:1,6:3:3,3:3:3", + "63145,15,6,4,8:2:2,1:1:1,5:3:3,12:3:3", + "63146,15,4,4,11:2:2,8:2:2,1:3:3,9:2:2" ], - "use_technique": true + "use_technique": false + }, + { + "name": "Fugue", + "id": 1225, + "hp": 100, + "sp": 50, + "level": 80, + "promotion": 6, + "rank": 6, + "lightcone": { + "id": 23035, + "rank": 5, + "level": 80, + "promotion": 6 + }, + "relics": [ + "61191,15,1,4,11:3:3,12:1:1,4:3:3,7:2:2", + "61192,15,1,4,9:3:3,12:1:1,1:2:2,7:3:3", + "61193,15,7,4,5:2:2,1:3:3,9:2:2,7:2:2", + "61194,15,4,4,8:1:1,12:1:1,2:4:4,4:3:3", + "63165,15,2,4,12:2:2,6:2:2,2:1:1,7:4:4", + "63166,15,1,4,10:1:1,4:4:4,3:2:2,7:2:2" + ], + "use_technique": false + }, + { + "name": "Sunday", + "id": 1313, + "hp": 100, + "sp": 50, + "level": 80, + "promotion": 6, + "rank": 6, + "lightcone": { + "id": 23034, + "rank": 5, + "level": 80, + "promotion": 6 + }, + "relics": [ + "61211,15,1,4,8:2:2,9:3:3,4:3:3,2:1:1", + "61212,15,1,4,9:3:3,4:3:3,7:2:2,8:1:1", + "61213,15,5,4,4:1:1,11:3:3,8:3:3,10:2:2", + "61214,15,4,4,12:3:3,10:3:3,1:2:2,8:1:1", + "63085,15,2,4,7:3:3,3:1:1,9:2:2,11:3:3", + "63086,15,2,4,9:1:1,12:3:3,4:2:2,8:3:3" + ], + "use_technique": false + }, + { + "name": "Rappa", + "id": 1317, + "hp": 100, + "sp": 50, + "level": 80, + "promotion": 6, + "rank": 6, + "lightcone": { + "id": 23033, + "rank": 5, + "level": 80, + "promotion": 6 + }, + "relics": [ + "61191,15,1,4,12:1:1,3:3:3,6:4:4,7:1:1", + "61192,15,1,4,1:2:2,12:2:2,5:1:1,9:4:4", + "61193,15,2,4,7:2:2,2:3:3,6:2:2,1:2:2", + "61194,15,4,4,1:2:2,2:3:3,10:2:2,11:2:2", + "63165,15,2,4,1:2:2,2:1:1,12:4:4,4:2:2", + "63166,15,2,4,5:3:3,6:2:2,10:2:2,9:2:2" + ], + "use_technique": false + }, + { + "name": "Lingsha", + "id": 1222, + "hp": 100, + "sp": 50, + "level": 80, + "promotion": 6, + "rank": 6, + "lightcone": { + "id": 23032, + "rank": 5, + "level": 80, + "promotion": 6 + }, + "relics": [ + "61191,15,1,4,11:2:2,9:4:4,5:2:2,2:1:1", + "61192,15,1,4,7:1:1,1:4:4,6:3:3,3:1:1", + "61193,15,6,4,11:2:2,8:2:2,7:2:2,9:3:3", + "61194,15,4,4,6:1:1,1:3:3,8:2:2,12:3:3", + "63165,15,2,4,1:4:4,8:1:1,4:2:2,2:2:2", + "63166,15,2,4,12:3:3,10:3:3,9:2:2,8:1:1" + ], + "use_technique": false } ], "battle_config": { diff --git a/gameserver/src/commands/sync.zig b/gameserver/src/commands/sync.zig index fb564fe..ec0cef6 100644 --- a/gameserver/src/commands/sync.zig +++ b/gameserver/src/commands/sync.zig @@ -5,6 +5,7 @@ const protocol = @import("protocol"); const Packet = @import("../Packet.zig"); const Config = @import("../services/config.zig"); const Data = @import("../data.zig"); +const LineupManager = @import("../manager/lineup_mgr.zig"); const ArrayList = std.ArrayList; const Allocator = std.mem.Allocator; @@ -176,6 +177,11 @@ pub fn onSyncMultiPath(session: *Session, _: []const u8, allocator: Allocator) E counts[i] += 1; for (avatar_ids[i]) |id| { if (avatar.id == id) { + if (avatar.id >= 8001 and avatar.id <= 8008) { + LineupManager.mc_id = avatar.id; + } else { + LineupManager.m7_id = avatar.id; + } multis[i].rank = avatar.rank; indexes[i] = max_avatar_list + 1 - counts[i]; } diff --git a/gameserver/src/manager/battle_mgr.zig b/gameserver/src/manager/battle_mgr.zig index 208e6df..ce5cfb2 100644 --- a/gameserver/src/manager/battle_mgr.zig +++ b/gameserver/src/manager/battle_mgr.zig @@ -259,18 +259,18 @@ pub const BattleManager = struct { var avatarIndex: u32 = 0; var initial_mode = false; while (true) { - for (config.avatar_config.items) |avatarConf| { - if (!initial_mode) { - if (!isInList(avatarConf.id, &selectedAvatarID)) { - continue; + if (!initial_mode) { + for (selectedAvatarID) |selected_id| { + for (config.avatar_config.items) |avatarConf| { + if (avatarConf.id == selected_id) { + const avatar = try createBattleAvatar(self.allocator, avatarConf); + try addTechniqueBuffs(self.allocator, &battle, avatar, avatarConf, avatarIndex); + try battle.pve_avatar_list.append(avatar); + avatarIndex += 1; + break; + } } - } - const avatar = try createBattleAvatar(self.allocator, avatarConf); - try addTechniqueBuffs(self.allocator, &battle, avatar, avatarConf, avatarIndex); - try battle.pve_avatar_list.append(avatar); - avatarIndex += 1; - if (avatarIndex >= 4) { - break; + if (avatarIndex >= 4) break; } } if (avatarIndex == 0 and !initial_mode) { @@ -304,18 +304,18 @@ pub const ChallegeStageManager = struct { var avatarIndex: u32 = 0; var initial_mode = false; while (true) { - for (config.avatar_config.items) |avatarConf| { - if (!initial_mode) { - if (!isInList(avatarConf.id, &selectedAvatarID)) { - continue; + if (!initial_mode) { + for (selectedAvatarID) |selected_id| { + for (config.avatar_config.items) |avatarConf| { + if (avatarConf.id == selected_id) { + const avatar = try createBattleAvatar(self.allocator, avatarConf); + try addTechniqueBuffs(self.allocator, &battle, avatar, avatarConf, avatarIndex); + try battle.pve_avatar_list.append(avatar); + avatarIndex += 1; + break; + } } - } - const avatar = try createBattleAvatar(self.allocator, avatarConf); - try addTechniqueBuffs(self.allocator, &battle, avatar, avatarConf, avatarIndex); - try battle.pve_avatar_list.append(avatar); - avatarIndex += 1; - if (avatarIndex >= 4) { - break; + if (avatarIndex >= 4) break; } } if (avatarIndex == 0 and !initial_mode) { diff --git a/gameserver/src/manager/lineup_mgr.zig b/gameserver/src/manager/lineup_mgr.zig index b7dc9f7..cb0b3bc 100644 --- a/gameserver/src/manager/lineup_mgr.zig +++ b/gameserver/src/manager/lineup_mgr.zig @@ -13,6 +13,9 @@ const ArrayList = std.ArrayList; const Allocator = std.mem.Allocator; const CmdID = protocol.CmdID; +pub var mc_id: u32 = 8008; +pub var m7_id: u32 = 1001; + pub const LineupManager = struct { allocator: std.mem.Allocator, pub fn init(allocator: std.mem.Allocator) LineupManager { @@ -97,7 +100,8 @@ pub fn getSelectedAvatarID(allocator: std.mem.Allocator, input: []const u32) !vo var i: usize = 0; while (i < BattleManager.selectedAvatarID.len and i < tempList.items.len) : (i += 1) { - BattleManager.selectedAvatarID[i] = tempList.items[i]; + const id = if (tempList.items[i] == 8001) mc_id else if (tempList.items[i] == 1001) m7_id else tempList.items[i]; + BattleManager.selectedAvatarID[i] = id; } while (i < BattleManager.selectedAvatarID.len) : (i += 1) { BattleManager.selectedAvatarID[i] = 0; diff --git a/gameserver/src/manager/multipath_mgr.zig b/gameserver/src/manager/multipath_mgr.zig index 00b231d..2fa684b 100644 --- a/gameserver/src/manager/multipath_mgr.zig +++ b/gameserver/src/manager/multipath_mgr.zig @@ -4,6 +4,7 @@ const Session = @import("../Session.zig"); const Packet = @import("../Packet.zig"); const Config = @import("../services/config.zig"); const Data = @import("../data.zig"); +const LineupManager = @import("../manager/lineup_mgr.zig"); const ArrayList = std.ArrayList; const Allocator = std.mem.Allocator; @@ -46,6 +47,11 @@ pub const MultiPathManager = struct { counts[i] += 1; for (avatar_ids[i]) |id| { if (avatar.id == id) { + if (avatar.id >= 8001 and avatar.id <= 8008) { + LineupManager.mc_id = avatar.id; + } else { + LineupManager.m7_id = avatar.id; + } multis[i].rank = avatar.rank; indexes[i] = counts[i] - 1; } @@ -88,7 +94,7 @@ pub const MultiPathManager = struct { try rsp.multi_path_avatar_info_list.appendSlice(&multis); try rsp.basic_type_id_list.appendSlice(&Data.MultiAvatar); try rsp.cur_multi_path_avatar_type_map.append(.{ .key = 1001, .value = .Mar_7thKnightType }); - try rsp.cur_multi_path_avatar_type_map.append(.{ .key = 8001, .value = .GirlMemoryType }); + try rsp.cur_multi_path_avatar_type_map.append(.{ .key = 8001, .value = .GirlWarriorType }); rsp.retcode = 0; return rsp; diff --git a/gameserver/src/manager/scene_mgr.zig b/gameserver/src/manager/scene_mgr.zig index af4c737..2db4f43 100644 --- a/gameserver/src/manager/scene_mgr.zig +++ b/gameserver/src/manager/scene_mgr.zig @@ -73,7 +73,7 @@ pub const SceneManager = struct { .entityCase_ = .{ .Prop = prop_info }, .GroupId = scene_group.group_id, .InstId = propConf.instId, - .EntityId = 0, + .EntityId = generator.nextId(), .Motion = .{ .pos = .{ .x = propConf.pos.x, .y = propConf.pos.y, .z = propConf.pos.z }, .rot = .{ .x = propConf.rot.x, .y = propConf.rot.y, .z = propConf.rot.z }, diff --git a/gameserver/src/services/avatar.zig b/gameserver/src/services/avatar.zig index f16eb7f..ee47bf0 100644 --- a/gameserver/src/services/avatar.zig +++ b/gameserver/src/services/avatar.zig @@ -4,6 +4,7 @@ const Session = @import("../Session.zig"); const Packet = @import("../Packet.zig"); const Config = @import("config.zig"); const Data = @import("../data.zig"); +const LineupManager = @import("../manager/lineup_mgr.zig"); const UidGenerator = @import("item.zig").UidGenerator; const ArrayList = std.ArrayList; @@ -113,8 +114,10 @@ pub fn onSetAvatarPath(session: *Session, packet: *const Packet, allocator: Allo rsp.avatar_id = req.avatar_id; if (rsp.avatar_id == protocol.MultiPathAvatarType.Mar_7thKnightType) { m7th = false; + LineupManager.m7_id = 1001; } else if (rsp.avatar_id == protocol.MultiPathAvatarType.Mar_7thRogueType) { m7th = true; + LineupManager.m7_id = 1224; } else if (rsp.avatar_id == protocol.MultiPathAvatarType.BoyWarriorType) { mac = 1; mg = false; @@ -130,15 +133,19 @@ pub fn onSetAvatarPath(session: *Session, packet: *const Packet, allocator: Allo } else if (rsp.avatar_id == protocol.MultiPathAvatarType.GirlWarriorType) { mac = 1; mg = true; + LineupManager.mc_id = 8002; } else if (rsp.avatar_id == protocol.MultiPathAvatarType.GirlKnightType) { mac = 2; mg = true; + LineupManager.mc_id = 8004; } else if (rsp.avatar_id == protocol.MultiPathAvatarType.GirlShamanType) { mac = 3; mg = true; + LineupManager.mc_id = 8006; } else if (rsp.avatar_id == protocol.MultiPathAvatarType.GirlMemoryType) { mac = 4; mg = true; + LineupManager.mc_id = 8008; } var sync = protocol.AvatarPathChangedNotify.init(allocator);