diff --git a/GameServer/Game/Battle/BattleInstance.cs b/GameServer/Game/Battle/BattleInstance.cs index 85217483..510b1cb1 100644 --- a/GameServer/Game/Battle/BattleInstance.cs +++ b/GameServer/Game/Battle/BattleInstance.cs @@ -87,48 +87,47 @@ namespace EggLink.DanhengServer.Game.Battle public Dictionary GetBattleAvatars() { var excel = GameData.StageConfigData[StageId]; - if (excel.TrialAvatarList.Count > 0) - { - var list = new List(); - list.AddRange(excel.TrialAvatarList); + List list = new List(); + foreach (var avatar in excel.TrialAvatarList) + { + if (GameData.SpecialAvatarData.ContainsKey(avatar)) + { + list.Add(avatar); + } + } + + if (list.Count == 0) + { if (Player.Data.CurrentGender == Gender.Man) { foreach (var avatar in excel.TrialAvatarList) { - if (avatar.ToString().EndsWith("8002")) - { - list.Remove(avatar); - } - if (avatar.ToString().EndsWith("8004")) - { - list.Remove(avatar); - } - if (avatar.ToString().EndsWith("8006")) - { - list.Remove(avatar); - } - } - } else - { - foreach (var avatar in excel.TrialAvatarList) - { - if (avatar.ToString().EndsWith("8001")) - { - list.Remove(avatar); - } - if (avatar.ToString().EndsWith("8003")) - { - list.Remove(avatar); - } - if (avatar.ToString().EndsWith("8005")) + if (avatar.ToString().EndsWith("8002") || + avatar.ToString().EndsWith("8004") || + avatar.ToString().EndsWith("8006")) { list.Remove(avatar); } } } + else + { + foreach (var avatar in excel.TrialAvatarList) + { + if (avatar.ToString().EndsWith("8001") || + avatar.ToString().EndsWith("8003") || + avatar.ToString().EndsWith("8005")) + { + list.Remove(avatar); + } + } + } + } - Dictionary dict = []; + if (list.Count > 0) + { + Dictionary dict = new Dictionary(); foreach (var avatar in list) { GameData.SpecialAvatarData.TryGetValue(avatar * 10 + Player.Data.WorldLevel, out var specialAvatar); @@ -139,10 +138,10 @@ namespace EggLink.DanhengServer.Game.Battle } return dict; - } + } else { - Dictionary dict = []; + Dictionary dict = new Dictionary(); foreach (var avatar in Lineup.BaseAvatars!) { AvatarInfo? avatarInstance = null; diff --git a/GameServer/Game/Player/PlayerInstance.cs b/GameServer/Game/Player/PlayerInstance.cs index c116c8f8..0762cb61 100644 --- a/GameServer/Game/Player/PlayerInstance.cs +++ b/GameServer/Game/Player/PlayerInstance.cs @@ -230,6 +230,7 @@ namespace EggLink.DanhengServer.Game.Player Data.CurBasicType = id; AvatarManager!.GetHero()!.HeroId = id; AvatarManager!.GetHero()!.ValidateHero(); + AvatarManager!.GetHero()!.SetCurSp(0, LineupManager!.GetCurLineup()!.IsExtraLineup()); SendPacket(new PacketHeroBasicTypeChangedNotify(id)); SendPacket(new PacketPlayerSyncScNotify(AvatarManager!.GetHero()!)); }