diff --git a/Arrowgene.Ddon.GameServer/Enemies/InstanceEnemyManager.cs b/Arrowgene.Ddon.GameServer/Enemies/InstanceEnemyManager.cs index 062e57914..35b02ef59 100644 --- a/Arrowgene.Ddon.GameServer/Enemies/InstanceEnemyManager.cs +++ b/Arrowgene.Ddon.GameServer/Enemies/InstanceEnemyManager.cs @@ -1,21 +1,24 @@ using Arrowgene.Ddon.GameServer; using Arrowgene.Ddon.GameServer.GatheringItems; +using Arrowgene.Ddon.GameServer.Quests; using Arrowgene.Ddon.Shared.Model; using System; using System.Collections.Generic; public class InstanceEnemyManager : InstanceAssetManager { - private readonly DdonGameServer _server; + private readonly DdonGameServer _Server; + private Dictionary _CurrentSubgroup { get; set; } public InstanceEnemyManager(DdonGameServer server) : base() { - _server = server; + _Server = server; + _CurrentSubgroup = new Dictionary(); } protected override List FetchAssetsFromRepository(StageId stage, byte subGroupId) { - return _server.AssetRepository.EnemySpawnAsset.Enemies.GetValueOrDefault((stage, subGroupId)) ?? new List(); + return _Server.AssetRepository.EnemySpawnAsset.Enemies.GetValueOrDefault((stage, subGroupId)) ?? new List(); } protected override List InstanceAssets(List originals) @@ -23,7 +26,7 @@ protected override List InstanceAssets(List originals) List filteredEnemyList = new List(); // Calculate current game time - long gameTimeMSec = _server.WeatherManager.RealTimeToGameTimeMS(DateTimeOffset.UtcNow); + long gameTimeMSec = _Server.WeatherManager.RealTimeToGameTimeMS(DateTimeOffset.UtcNow); foreach (Enemy original in originals) { @@ -43,4 +46,33 @@ protected override List InstanceAssets(List originals) } return filteredEnemyList; } + + public ushort GetInstanceSubgroupId(StageId stageId) + { + lock (_CurrentSubgroup) + { + if (!_CurrentSubgroup.ContainsKey(stageId)) + { + return 0; + } + return _CurrentSubgroup[stageId]; + } + } + + public void SetInstanceSubgroupId(StageId stageId, ushort subgroupId) + { + lock (_CurrentSubgroup) + { + _CurrentSubgroup[stageId] = subgroupId; + } + } + + public override void Clear() + { + base.Clear(); + lock (_CurrentSubgroup) + { + _CurrentSubgroup.Clear(); + } + } } diff --git a/Arrowgene.Ddon.GameServer/GatheringItems/InstanceDropItemManager.cs b/Arrowgene.Ddon.GameServer/GatheringItems/InstanceDropItemManager.cs index cbad75107..2d7c97dc7 100644 --- a/Arrowgene.Ddon.GameServer/GatheringItems/InstanceDropItemManager.cs +++ b/Arrowgene.Ddon.GameServer/GatheringItems/InstanceDropItemManager.cs @@ -14,7 +14,7 @@ public InstanceDropItemManager(GameClient client) protected override List FetchAssetsFromRepository(StageId stage, uint setId) { - List enemiesInSet = _client.Party.InstanceEnemyManager.GetAssets(stage, 0); + List enemiesInSet = _client.Party.InstanceEnemyManager.GetAssets(stage, (byte) setId); if(enemiesInSet != null && setId < enemiesInSet.Count) { Enemy enemy = enemiesInSet[(int) setId]; diff --git a/Arrowgene.Ddon.GameServer/Handler/InstanceEnemyKillHandler.cs b/Arrowgene.Ddon.GameServer/Handler/InstanceEnemyKillHandler.cs index b3913f3d8..75ae55846 100644 --- a/Arrowgene.Ddon.GameServer/Handler/InstanceEnemyKillHandler.cs +++ b/Arrowgene.Ddon.GameServer/Handler/InstanceEnemyKillHandler.cs @@ -30,17 +30,15 @@ public override void Handle(GameClient client, StructurePacket GetAssets(StageId stageId, T1 subGroupId) return _instancedAssetsDictionary[(stageId, subGroupId)]; } - public void Clear() + public virtual void Clear() { _instancedAssetsDictionary.Clear(); } @@ -50,4 +50,4 @@ public void Clear() protected abstract List InstanceAssets(List originals); } -} \ No newline at end of file +} diff --git a/Arrowgene.Ddon.GameServer/Party/PartyQuestState.cs b/Arrowgene.Ddon.GameServer/Party/PartyQuestState.cs index 799ba5f9e..8886dcd14 100644 --- a/Arrowgene.Ddon.GameServer/Party/PartyQuestState.cs +++ b/Arrowgene.Ddon.GameServer/Party/PartyQuestState.cs @@ -34,8 +34,6 @@ public class QuestState public Dictionary ProcessState { get; set; } public Dictionary>> QuestEnemies { get; set; } - public Dictionary CurrentSubgroup { get; set; } - public Dictionary DeliveryRecords { get; set; } public QuestState() @@ -43,7 +41,6 @@ public QuestState() ProcessState = new Dictionary(); QuestEnemies = new Dictionary>>(); DeliveryRecords = new Dictionary(); - CurrentSubgroup = new Dictionary(); } public uint UpdateDeliveryRequest(uint itemId, uint amount) @@ -214,28 +211,6 @@ public InstancedEnemy GetInstancedEnemy(QuestId questId, StageId stageId, ushort return GetInstancedEnemy(quest, stageId, subGroupId, index); } - public void SetInstanceSubgroupId(Quest quest, StageId stageId, ushort subgroupId) - { - lock (ActiveQuests) - { - var questState = ActiveQuests[quest.QuestId]; - questState.CurrentSubgroup[stageId] = subgroupId; - } - } - - public ushort GetInstanceSubgroupId(Quest quest, StageId stageId) - { - lock (ActiveQuests) - { - var questState = ActiveQuests[quest.QuestId]; - if (!questState.CurrentSubgroup.ContainsKey(stageId)) - { - return 0; - } - return questState.CurrentSubgroup[stageId]; - } - } - public void AddNewQuest(QuestId questId, uint step) { var quest = QuestManager.GetQuest(questId); diff --git a/Arrowgene.Ddon.Shared/Files/Assets/EnemySpawn.json b/Arrowgene.Ddon.Shared/Files/Assets/EnemySpawn.json index 3833eed91..60038c974 100644 --- a/Arrowgene.Ddon.Shared/Files/Assets/EnemySpawn.json +++ b/Arrowgene.Ddon.Shared/Files/Assets/EnemySpawn.json @@ -216618,118 +216618,6 @@ 180, "00:00,23:59" ], - [ - 146, - 0, - 6, - 0, - "0x010207", - 2298, - 0, - 100, - 16, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - false, - false, - false, - false, - 0, - 0, - 310, - 180, - "00:00,23:59" - ], - [ - 146, - 0, - 6, - 0, - "0x010207", - 2298, - 0, - 100, - 16, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - false, - false, - false, - false, - 0, - 0, - 310, - 180, - "00:00,23:59" - ], - [ - 146, - 0, - 6, - 0, - "0x010606", - 2298, - 0, - 100, - 16, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - false, - false, - false, - false, - 0, - 0, - 310, - 386, - "00:00,23:59" - ], - [ - 146, - 0, - 6, - 0, - "0x010606", - 2298, - 0, - 100, - 16, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - false, - false, - false, - false, - 0, - 0, - 310, - 386, - "00:00,23:59" - ], [ 146, 0, @@ -249909,6 +249797,118 @@ 80000, 341, "00:00,23:59" + ], + [ + 146, + 0, + 6, + 2, + "0x010207", + 2298, + 0, + 100, + 16, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + false, + false, + false, + false, + 0, + 0, + 310, + -1, + "00:00,23:59" + ], + [ + 146, + 0, + 6, + 2, + "0x010207", + 2298, + 0, + 100, + 16, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + false, + false, + false, + false, + 0, + 0, + 310, + -1, + "00:00,23:59" + ], + [ + 146, + 0, + 6, + 2, + "0x010606", + 2298, + 0, + 100, + 16, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + false, + false, + false, + false, + 0, + 0, + 310, + -1, + "00:00,23:59" + ], + [ + 146, + 0, + 6, + 2, + "0x010606", + 2298, + 0, + 100, + 16, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + false, + false, + false, + false, + 0, + 0, + 310, + -1, + "00:00,23:59" ] ] } \ No newline at end of file diff --git a/Arrowgene.Ddon.Shared/Model/CharacterCommon.cs b/Arrowgene.Ddon.Shared/Model/CharacterCommon.cs index 49932052f..8d803eafa 100644 --- a/Arrowgene.Ddon.Shared/Model/CharacterCommon.cs +++ b/Arrowgene.Ddon.Shared/Model/CharacterCommon.cs @@ -55,6 +55,7 @@ public CDataCharacterJobData? ActiveCharacterJobData /// TODO combine into a location class ? public StageId Stage { get; set; } + public uint StageNo { get; set; } public double X { get; set; } public float Y { get; set; }