diff --git a/Common/Data/Config/Task/TaskConfigInfo.cs b/Common/Data/Config/Task/TaskConfigInfo.cs index 41f8f6af..3c383f9e 100644 --- a/Common/Data/Config/Task/TaskConfigInfo.cs +++ b/Common/Data/Config/Task/TaskConfigInfo.cs @@ -65,6 +65,13 @@ public class TaskConfigInfo return res; } + if (typeStr == "NewAdventureFireProjectile") + { + var res = AdventureFireProjectile.LoadFromJsonObject(json); + res.Type = type; + return res; + } + if (typeStr == "AdventureTriggerAttack") { var res = AdventureTriggerAttack.LoadFromJsonObject(json); diff --git a/GameServer/Game/Task/AvatarTask/AbilityLevelTask.cs b/GameServer/Game/Task/AvatarTask/AbilityLevelTask.cs index 2ccaddb3..425f8349 100644 --- a/GameServer/Game/Task/AvatarTask/AbilityLevelTask.cs +++ b/GameServer/Game/Task/AvatarTask/AbilityLevelTask.cs @@ -234,6 +234,35 @@ public class AbilityLevelTask(PlayerInstance player) return new AbilityLevelResult(instance, battleInfos); } + public async ValueTask NewAdventureFireProjectile(AbilityLevelParam param) + { + BattleInstance? instance = null; + List battleInfos = []; + + if (param.Act is AdventureFireProjectile adventureFireProjectile) + { + foreach (var task in adventureFireProjectile.OnProjectileHit) + { + var result = await TriggerTask(param with { Act = task }); + if (result.BattleInfos != null) battleInfos.AddRange(result.BattleInfos); + + if (result.Instance != null) + instance = result.Instance; + } + + foreach (var task in adventureFireProjectile.OnProjectileLifetimeFinish) + { + var result = await TriggerTask(param with { Act = task }); + if (result.BattleInfos != null) battleInfos.AddRange(result.BattleInfos); + + if (result.Instance != null) + instance = result.Instance; + } + } + + return new AbilityLevelResult(instance, battleInfos); + } + public async ValueTask CreateSummonUnit(AbilityLevelParam param) { if (param.Act is CreateSummonUnit createSummonUnit)