diff --git a/Arrowgene.Ddon.GameServer/Handler/InstanceEnemyKillHandler.cs b/Arrowgene.Ddon.GameServer/Handler/InstanceEnemyKillHandler.cs index 16d747d73..95e283009 100644 --- a/Arrowgene.Ddon.GameServer/Handler/InstanceEnemyKillHandler.cs +++ b/Arrowgene.Ddon.GameServer/Handler/InstanceEnemyKillHandler.cs @@ -135,7 +135,7 @@ public override S2CInstanceEnemyKillRes Handle(GameClient client, C2SInstanceEne if (packet.IsNoBattleReward) { - return; + queuedPackets.Send(); } var dropItemNtc = new S2CInstancePopDropItemNtc() diff --git a/Arrowgene.Ddon.GameServer/Handler/QuestSetPriorityQuestHandler.cs b/Arrowgene.Ddon.GameServer/Handler/QuestSetPriorityQuestHandler.cs index a3813426c..2251c2a85 100644 --- a/Arrowgene.Ddon.GameServer/Handler/QuestSetPriorityQuestHandler.cs +++ b/Arrowgene.Ddon.GameServer/Handler/QuestSetPriorityQuestHandler.cs @@ -26,16 +26,16 @@ public override S2CQuestSetPriorityQuestRes Handle(GameClient client, C2SQuestSe var priorityQuests = Server.Database.GetPriorityQuestScheduleIds(client.Character.CommonId); foreach (var questScheduleId in priorityQuests) { - var quest = QuestManager.GetQuestByScheduleId(questScheduleId); - var questStateManager = QuestManager.GetQuestStateManager(client, quest); - var questState = questStateManager.GetQuestState(questScheduleId); - if (!QuestManager.IsQuestEnabled(questScheduleId) || questState is null) + if (!QuestManager.IsQuestEnabled(questScheduleId)) { Logger.Error(client, $"Priority quest for quest state which doesn't exist or is not enabled, schedule {questScheduleId}"); Server.Database.DeletePriorityQuest(client.Character.CommonId, questScheduleId); continue; } + var quest = QuestManager.GetQuestByScheduleId(questScheduleId); + var questStateManager = QuestManager.GetQuestStateManager(client, quest); + var questState = questStateManager.GetQuestState(questScheduleId); ntc.PriorityQuestList.Add(quest.ToCDataPriorityQuest(questState.Step)); } diff --git a/Arrowgene.Ddon.Shared/AssetReader/AssetCommonDeserializer.cs b/Arrowgene.Ddon.Shared/AssetReader/AssetCommonDeserializer.cs index c942a9d2d..2c6862176 100644 --- a/Arrowgene.Ddon.Shared/AssetReader/AssetCommonDeserializer.cs +++ b/Arrowgene.Ddon.Shared/AssetReader/AssetCommonDeserializer.cs @@ -1,3 +1,4 @@ +using Arrowgene.Ddon.Shared.Asset; using Arrowgene.Ddon.Shared.Model; using Arrowgene.Ddon.Shared.Model.Quest; using Arrowgene.Logging; @@ -18,7 +19,7 @@ public AssetCommonDeserializer(Dictionary namedParams) NamedParams = namedParams; } - public bool ParseEnemyGroups(Dictionary EnemyGroups, JsonElement jElement) + public bool ParseEnemyGroups(QuestDropItemAsset questDrops, Dictionary EnemyGroups, JsonElement jElement) { if (!jElement.TryGetProperty("enemy_groups", out JsonElement jGroups)) { @@ -146,6 +147,10 @@ public bool ParseEnemyGroups(Dictionary EnemyGroups, Json { questEnemy.DropsTable = customTable; } + else + { + questEnemy.DropsTable = questDrops.GetDropTable(questEnemy.EnemyId, questEnemy.Lv); + } enemyGroup.Enemies.Add(questEnemy); } diff --git a/Arrowgene.Ddon.Shared/AssetReader/EpitaphTrialAssetDeserializer.cs b/Arrowgene.Ddon.Shared/AssetReader/EpitaphTrialAssetDeserializer.cs index 13fc91e07..97410e173 100644 --- a/Arrowgene.Ddon.Shared/AssetReader/EpitaphTrialAssetDeserializer.cs +++ b/Arrowgene.Ddon.Shared/AssetReader/EpitaphTrialAssetDeserializer.cs @@ -15,10 +15,12 @@ public class EpitaphTrialAssetDeserializer private static readonly ILogger Logger = LogProvider.Logger(typeof(EpitaphTrialAssetDeserializer)); private AssetCommonDeserializer _CommonEnemyDeserializer; + private QuestDropItemAsset _QuestDrops; - public EpitaphTrialAssetDeserializer(AssetCommonDeserializer commonEnemyDeserializer) + public EpitaphTrialAssetDeserializer(AssetCommonDeserializer commonEnemyDeserializer, QuestDropItemAsset questDrops) { _CommonEnemyDeserializer = commonEnemyDeserializer; + _QuestDrops = questDrops; } public bool LoadTrialsFromDirectory(string path, EpitaphTrialAsset trialAssets) @@ -118,7 +120,7 @@ public bool ParseTrial(EpitaphTrial assetData, JsonElement jTrial) trialOption.EntryCost.Add(item); } - if (!_CommonEnemyDeserializer.ParseEnemyGroups(trialOption.EnemyGroups, jOption)) + if (!_CommonEnemyDeserializer.ParseEnemyGroups(_QuestDrops, trialOption.EnemyGroups, jOption)) { Logger.Error($"Unable to parse enemies for epitah trial {trialOption.TrialName}:{trialOption.EpitaphId}. Skipping."); return false; diff --git a/Arrowgene.Ddon.Shared/AssetReader/QuestAssetDeserializer.cs b/Arrowgene.Ddon.Shared/AssetReader/QuestAssetDeserializer.cs index 6be3bf4ad..15f117906 100644 --- a/Arrowgene.Ddon.Shared/AssetReader/QuestAssetDeserializer.cs +++ b/Arrowgene.Ddon.Shared/AssetReader/QuestAssetDeserializer.cs @@ -198,7 +198,7 @@ private bool ParseQuest(QuestAssetData assetData, JsonElement jQuest) return false; } - if (!_CommonEnemyDeserializer.ParseEnemyGroups(assetData.EnemyGroups, jQuest)) + if (!_CommonEnemyDeserializer.ParseEnemyGroups(_QuestDrops, assetData.EnemyGroups, jQuest)) { Logger.Error($"Unable to create the quest '{assetData.QuestId}'. Skipping."); return false; @@ -1103,11 +1103,6 @@ private bool ParseRawBlock(JsonElement jBlock, QuestBlock questBlock) return true; } - private bool ParseAltConditions(JsonElement jAltConditions, QuestBlock questBlock) - { - return true; - } - private void ParseCommandParams(JsonElement jCommand, CDataQuestCommand command) { List commandParams = new List() { "Param1", "Param2", "Param3", "Param4" }; diff --git a/Arrowgene.Ddon.Shared/AssetRepository.cs b/Arrowgene.Ddon.Shared/AssetRepository.cs index 11d18767f..2444d1a03 100644 --- a/Arrowgene.Ddon.Shared/AssetRepository.cs +++ b/Arrowgene.Ddon.Shared/AssetRepository.cs @@ -180,7 +180,7 @@ public void Initialize() var questAssetDeserializer = new QuestAssetDeserializer(commonEnemyDeserializer, QuestDropItemAsset); questAssetDeserializer.LoadQuestsFromDirectory(Path.Combine(_directory.FullName, QuestAssestKey), QuestAssets); - var epitaphTrialDeserializer = new EpitaphTrialAssetDeserializer(commonEnemyDeserializer); + var epitaphTrialDeserializer = new EpitaphTrialAssetDeserializer(commonEnemyDeserializer, QuestDropItemAsset); epitaphTrialDeserializer.LoadTrialsFromDirectory(Path.Combine(_directory.FullName, EpitaphAssestKey), EpitaphTrialAssets); } diff --git a/Arrowgene.Ddon.Shared/Files/Assets/epitaph/rathnite_foothills_section1_1_space_trial1.json b/Arrowgene.Ddon.Shared/Files/Assets/epitaph/rathnite_foothills_section1_1_space_trial1.json index a66095360..30b6997a9 100644 --- a/Arrowgene.Ddon.Shared/Files/Assets/epitaph/rathnite_foothills_section1_1_space_trial1.json +++ b/Arrowgene.Ddon.Shared/Files/Assets/epitaph/rathnite_foothills_section1_1_space_trial1.json @@ -11,7 +11,7 @@ { "trial_name": "Trial of the Heroes", "constraints": [ - {"type": "DefeatEnemyCount", "priority": "Primary", "Param1": 20}, + {"type": "EliminateTheEnemy", "priority": "Primary"}, {"type": "CannotBeAffectedByAbnormalStatus", "priority": "Secondary", "Param1": 3}, {"type": "CompleteConditionsWithinTimeLimit", "priority": "Secondary", "Param1": 60} ], @@ -40,36 +40,28 @@ "enemy_id": "0x010512", "level": 83, "exp": 8400, - "named_enemy_params_id": 2286, - "repop_count": 50, - "repop_wait_second": 60 + "named_enemy_params_id": 2286 }, { "comment" : "Frost Corp Tortuerer", "enemy_id": "0x010512", "level": 83, "exp": 8400, - "named_enemy_params_id": 2286, - "repop_count": 50, - "repop_wait_second": 60 + "named_enemy_params_id": 2286 }, { "comment" : "Frost Skeleton", "enemy_id": "0x010315", "level": 83, "exp": 8400, - "named_enemy_params_id": 2286, - "repop_count": 50, - "repop_wait_second": 60 + "named_enemy_params_id": 2286 }, { "comment" : "Frost Skeleton", "enemy_id": "0x010315", "level": 83, "exp": 8400, - "named_enemy_params_id": 2286, - "repop_count": 50, - "repop_wait_second": 60 + "named_enemy_params_id": 2286 } ] } @@ -78,7 +70,7 @@ { "trial_name": "Trial of the Souls", "constraints": [ - {"type": "DefeatEnemyCount", "priority": "Primary", "Param1": 20}, + {"type": "EliminateTheEnemy", "priority": "Primary"}, {"type": "CannotDieMoreThanOnce", "priority": "Secondary"}, {"type": "CompleteConditionsWithinTimeLimit", "priority": "Secondary", "Param1": 180} ], @@ -115,36 +107,28 @@ "enemy_id": "0x010511", "level": 83, "exp": 8400, - "named_enemy_params_id": 2286, - "repop_count": 50, - "repop_wait_second": 60 + "named_enemy_params_id": 2286 }, { "comment" : "Frost Corp Punisher", "enemy_id": "0x010511", "level": 83, "exp": 8400, - "named_enemy_params_id": 2286, - "repop_count": 50, - "repop_wait_second": 60 + "named_enemy_params_id": 2286 }, { "comment" : "Frost Skeleton Brute", "enemy_id": "0x010321", "level": 83, "exp": 8400, - "named_enemy_params_id": 2286, - "repop_count": 50, - "repop_wait_second": 60 + "named_enemy_params_id": 2286 }, { "comment" : "Frost Skeleton Brute", "enemy_id": "0x010321", "level": 83, "exp": 8400, - "named_enemy_params_id": 2286, - "repop_count": 50, - "repop_wait_second": 60 + "named_enemy_params_id": 2286 } ] } diff --git a/Arrowgene.Ddon.Shared/Files/Assets/epitaph/rathnite_foothills_section2_1_space_trial1.json b/Arrowgene.Ddon.Shared/Files/Assets/epitaph/rathnite_foothills_section2_1_space_trial1.json index eb5b0b3c7..8a63a98c2 100644 --- a/Arrowgene.Ddon.Shared/Files/Assets/epitaph/rathnite_foothills_section2_1_space_trial1.json +++ b/Arrowgene.Ddon.Shared/Files/Assets/epitaph/rathnite_foothills_section2_1_space_trial1.json @@ -13,7 +13,7 @@ "constraints": [ {"type": "DefeatEnemyCount", "priority": "Primary", "Param1": 20}, {"type": "CannotDieMoreThanOnce", "priority": "Secondary"}, - {"type": "DefeatEnemyWithAbnormalStatusCount", "priority": "Secondary", "Param1": 3} + {"type": "DefeatEnemyWithAbnormalStatusCount", "priority": "Secondary", "Param1": 5} ], "cost": [], "item_rewards": [ @@ -37,8 +37,7 @@ "named_enemy_params_id": 2287, "is_boss": true, "repop_count": 50, - "repop_wait_second": 0, - "is_required": false + "repop_wait_second": 0 }, { "comment" : "Grim Goblin Fighter", @@ -48,8 +47,7 @@ "index": 0, "named_enemy_params_id": 2286, "repop_count": 50, - "repop_wait_second": 0, - "is_required": false + "repop_wait_second": 0 }, { "comment" : "Grim Goblin Fighter", @@ -59,8 +57,7 @@ "index": 1, "named_enemy_params_id": 2286, "repop_count": 50, - "repop_wait_second": 0, - "is_required": false + "repop_wait_second": 0 }, { "comment" : "Grim Goblin Fighter", @@ -70,8 +67,7 @@ "index": 2, "named_enemy_params_id": 2286, "repop_count": 50, - "repop_wait_second": 0, - "is_required": false + "repop_wait_second": 0 }, { "comment" : "Grim Goblin Fighter", @@ -81,8 +77,7 @@ "index": 3, "named_enemy_params_id": 2286, "repop_count": 50, - "repop_wait_second": 0, - "is_required": false + "repop_wait_second": 0 }, { "comment" : "Grim Goblin Fighter", @@ -92,8 +87,7 @@ "index": 4, "named_enemy_params_id": 2286, "repop_count": 50, - "repop_wait_second": 0, - "is_required": false + "repop_wait_second": 0 }, { "comment" : "Grim Goblin Fighter", @@ -103,8 +97,7 @@ "index": 5, "named_enemy_params_id": 2286, "repop_count": 50, - "repop_wait_second": 0, - "is_required": false + "repop_wait_second": 0 } ] } @@ -115,7 +108,7 @@ "constraints": [ {"type": "DefeatEnemyCount", "priority": "Primary", "Param1": 20}, {"type": "CannotDieMoreThanOnce", "priority": "Secondary"}, - {"type": "DefeatEnemyWithAbnormalStatusCount", "priority": "Secondary", "Param1": 3} + {"type": "DefeatEnemyWithAbnormalStatusCount", "priority": "Secondary", "Param1": 5} ], "cost": [ {"item_id": 18656, "amount": 20} @@ -142,8 +135,7 @@ "named_enemy_params_id": 2287, "is_boss": true, "repop_count": 50, - "repop_wait_second": 0, - "is_required": false + "repop_wait_second": 0 }, { "comment" : "Goblin Shaman", @@ -153,8 +145,7 @@ "index": 1, "named_enemy_params_id": 2286, "repop_count": 50, - "repop_wait_second": 0, - "is_required": false + "repop_wait_second": 0 }, { "comment" : "Goblin Shaman", @@ -164,8 +155,7 @@ "index": 4, "named_enemy_params_id": 2286, "repop_count": 50, - "repop_wait_second": 0, - "is_required": false + "repop_wait_second": 0 }, { "comment" : "Goblin Shaman", @@ -175,8 +165,7 @@ "index": 0, "named_enemy_params_id": 2286, "repop_count": 50, - "repop_wait_second": 0, - "is_required": false + "repop_wait_second": 0 }, { "comment" : "Goblin Aid Shaman", @@ -186,8 +175,7 @@ "index": 3, "named_enemy_params_id": 2286, "repop_count": 50, - "repop_wait_second": 0, - "is_required": false + "repop_wait_second": 0 }, { "comment" : "Goblin Aid Shaman", @@ -197,8 +185,7 @@ "index": 5, "named_enemy_params_id": 2286, "repop_count": 50, - "repop_wait_second": 0, - "is_required": false + "repop_wait_second": 0 }, { "comment" : "Goblin Aid Shaman", @@ -208,8 +195,7 @@ "index": 0, "named_enemy_params_id": 2286, "repop_count": 50, - "repop_wait_second": 0, - "is_required": false + "repop_wait_second": 0 } ] }