Skip to content

Commit d2b1347

Browse files
authored
Merge branch 'develop' into develop
2 parents e98610d + c6ff06f commit d2b1347

18 files changed

Lines changed: 1320 additions & 33 deletions

File tree

Arrowgene.Ddon.GameServer/Handler/QuestQuestProgressHandler.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ public override PacketQueue Handle(GameClient client, C2SQuestQuestProgressReq r
114114
Logger.Info("==========================================================================================");
115115
}
116116

117+
117118
if (!quest.IsPersonal)
118119
{
119120
foreach (var memberClient in client.Party.Clients)

Arrowgene.Ddon.GameServer/Quests/Extensions/QuestBlockCheckCmdExtension.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Arrowgene.Ddon.GameServer.Characters;
2-
using Arrowgene.Ddon.GameServer.Quests.Work;
32
using Arrowgene.Ddon.Shared.Entity.Structure;
43
using Arrowgene.Ddon.Shared.Model;
54
using Arrowgene.Ddon.Shared.Model.Quest;
@@ -283,9 +282,6 @@ public static QuestBlock AddCheckCmdWorldQuestClearNum(this QuestBlock questBloc
283282
{
284283
ValidateIndexAndUpdateCommandList(questBlock.CheckCommands, commandListIndex);
285284
questBlock.CheckCommands[commandListIndex].AddCheckCmdWorldQuestClearNum(areaId, amount);
286-
287-
questBlock.QuestProgressWork.Add(new WorldQuestClearedProgressWork(questBlock.QuestScheduleId, questBlock.AsQuestProcessState(), areaId, amount));
288-
289285
return questBlock;
290286
}
291287

Arrowgene.Ddon.GameServer/Quests/GenericQuest.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Arrowgene.Ddon.GameServer.Characters;
22
using Arrowgene.Ddon.GameServer.Quests.Extensions;
3+
using Arrowgene.Ddon.GameServer.Quests.Work;
34
using Arrowgene.Ddon.GameServer.Scripting.Interfaces;
45
using Arrowgene.Ddon.Server;
56
using Arrowgene.Ddon.Server.Network;
@@ -107,6 +108,21 @@ public static GenericQuest FromAsset(DdonGameServer server, QuestAssetData quest
107108
quest.AddWorldManageUnlock(block.WorldManageUnlocks);
108109
quest.AddProgressWorkItems(block.QuestProgressWork);
109110

111+
// Scan for SetQuestClearNum check commands and synthesize matching
112+
// WorldQuestClearedProgressWork items after BlockNo is finalised.
113+
foreach (var cmdGroup in block.CheckCommands)
114+
{
115+
foreach (var cmd in cmdGroup)
116+
{
117+
if (cmd.Command == (ushort)QuestCheckCommand.SetQuestClearNum)
118+
{
119+
var areaId = (QuestAreaId)cmd.Param02;
120+
var amount = (uint)cmd.Param01;
121+
quest.AddProgressWorkItem(new WorldQuestClearedProgressWork(block, areaId, amount));
122+
}
123+
}
124+
}
125+
110126
switch (block.BlockType)
111127
{
112128
case QuestBlockType.KillGroup:

Arrowgene.Ddon.GameServer/Quests/ProgressWork/WorldQuestClearedProgressWork.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@ public class WorldQuestClearedProgressWork : QuestProgressWork
1212
public readonly QuestAreaId AreaId;
1313
public readonly uint Amount;
1414

15-
public WorldQuestClearedProgressWork(uint questScheduleId, QuestProcessState processState, QuestAreaId areaId, uint amount) : base(questScheduleId, processState, QuestProgressWorkType.WorldQuestCleared)
15+
// The block is stored by reference so that BlockNo is read at NTC-generation time,
16+
// after AddBlock() has assigned the final block number.
17+
private readonly QuestBlock _block;
18+
19+
public WorldQuestClearedProgressWork(QuestBlock block, QuestAreaId areaId, uint amount)
20+
: base(block.QuestScheduleId, QuestProgressWorkType.WorldQuestCleared)
1621
{
22+
_block = block;
1723
AreaId = areaId;
1824
Amount = amount;
1925
}
@@ -25,13 +31,12 @@ public bool QuestIsMatch(Quest quest)
2531

2632
public override S2CQuestQuestProgressWorkSaveNtc GetWork()
2733
{
28-
Console.WriteLine($"QuestScheduleId={QuestScheduleId}, ProcessWork={ProcessState}, AreaId={AreaId}");
2934
return new S2CQuestQuestProgressWorkSaveNtc()
3035
{
3136
QuestScheduleId = QuestScheduleId,
32-
ProcessNo = ProcessState.ProcessNo,
33-
SequenceNo = ProcessState.SequenceNo,
34-
BlockNo = ProcessState.BlockNo,
37+
ProcessNo = _block.ProcessNo,
38+
SequenceNo = _block.SequenceNo,
39+
BlockNo = _block.BlockNo,
3540
WorkList = new List<CDataQuestProgressWork>
3641
{
3742
QuestManager.NotifyCommand.WorldQuestClearNum(AreaId, Amount)

Arrowgene.Ddon.GameServer/Quests/Quest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ public virtual CDataSetQuestList ToCDataSetQuestList(uint step, uint clearCount)
836836
};
837837

838838
// Does this work?
839-
data.Param.DistributionStartDate = DateTimeOffset.FromUnixTimeSeconds(Server.ScheduleManager.TaskExpiry(TaskType.WorldQuestRotation));
839+
// data.Param.DistributionStartDate = DateTimeOffset.FromUnixTimeSeconds(Server.ScheduleManager.TaskExpiry(TaskType.WorldQuestRotation));
840840
data.Param.DistributionEndDate = DateTimeOffset.FromUnixTimeSeconds(Server.ScheduleManager.TaskExpiry(TaskType.WorldQuestRotation));
841841

842842
return data;

Arrowgene.Ddon.Scripts/scripts/quests/personal/q60000014.csx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,9 @@ public class ScriptedQuest : IQuest
4343
.AddResultCmdReleaseAnnounce(ContentsRelease.AreaMastersWorldQuestInfo, TutorialId.PurchasingWorldQuestInformation)
4444
.AddCheckCmdOpenAreaMaster(QuestAreaId.HidellPlains);
4545
process0.AddTalkToNpcBlock(QuestAnnounceType.CheckpointAndUpdate, Stage.BlackGrapeInn, NpcId.Alfred, 14519);
46-
// Temporary step until WorkQuestClearNum works properly always
47-
process0.AddIsStageNoBlock(QuestAnnounceType.CheckpointAndUpdate, Stage.BlackGrapeInn)
48-
.AddResultCmdTutorialDialog(TutorialId.QuestRecommendedLevel);
49-
// process0.AddRawBlock(QuestAnnounceType.CheckpointAndUpdate)
50-
// .AddResultCmdTutorialDialog(TutorialId.QuestRecommendedLevel)
51-
// .AddCheckCmdWorldQuestClearNum(QuestAreaId.HidellPlains, 1);
46+
process0.AddRawBlock(QuestAnnounceType.CheckpointAndUpdate)
47+
.AddResultCmdTutorialDialog(TutorialId.QuestRecommendedLevel)
48+
.AddCheckCmdWorldQuestClearNum(QuestAreaId.HidellPlains, 1);
5249
process0.AddTalkToNpcBlock(QuestAnnounceType.CheckpointAndUpdate, Stage.BlackGrapeInn, NpcId.Alfred, 13809);
5350
process0.AddTalkToNpcBlock(QuestAnnounceType.CheckpointAndUpdate, Stage.TheWhiteDragonTemple0, NpcId.Seneka0, 11295)
5451
.AddResultCmdTutorialDialog(TutorialId.ReapRewardsfortheWorldQuest);
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/**
2+
* @brief Adventure Spot Guide: Rathnite Foothills I
3+
*/
4+
5+
#load "libs.csx"
6+
7+
public class ScriptedQuest : IQuest
8+
{
9+
public override QuestType QuestType => QuestType.Tutorial;
10+
public override QuestId QuestId => (QuestId)60300100; // Schedule ID: 1673543680
11+
public override ushort RecommendedLevel => 78;
12+
public override byte MinimumItemRank => 0;
13+
public override bool IsDiscoverable => true;
14+
public override StageInfo StageInfo => Stage.PiremothTravelersInn;
15+
public override QuestAdventureGuideCategory? AdventureGuideCategory => QuestAdventureGuideCategory.QuestUsefulForAdventure;
16+
17+
protected override void InitializeRewards()
18+
{
19+
AddPointReward(PointType.ExperiencePoints, 36850);
20+
AddWalletReward(WalletType.Gold, 10145);
21+
AddWalletReward(WalletType.RiftPoints, 1660);
22+
AddFixedItemReward(ItemId.DelicateIntaglio, 3);
23+
}
24+
25+
private class EnemyGroupId
26+
{
27+
public const uint Encounter = 10;
28+
}
29+
30+
protected override void InitializeEnemyGroups()
31+
{
32+
AddEnemies(EnemyGroupId.Encounter, Stage.CaveofHellsDescentInnerDepths, 10, QuestEnemyPlacementType.Manual, new()
33+
{
34+
LibDdon.Enemy.Create(EnemyId.Gorechimera0, 78, 94705, 0)
35+
.SetIsAreaBoss(true)
36+
.SetIsBoss(true)
37+
.SetEnemyTargetTypesId(TargetTypesId.AreaBoss),
38+
});
39+
}
40+
41+
protected override void InitializeBlocks()
42+
{
43+
var process0 = AddNewProcess(0);
44+
process0.AddRawBlock(QuestAnnounceType.None)
45+
.AddCheckCommands([
46+
QuestManager.CheckCommand.CheckAreaRank(18, 1)
47+
]);
48+
process0.AddNpcTalkAndOrderBlock(Stage.PiremothTravelersInn, NpcId.Bruno, 25750);
49+
process0.AddSpawnGroupBlock(QuestAnnounceType.Accept, EnemyGroupId.Encounter)
50+
.AddResultCommands([
51+
QuestManager.ResultCommand.QstTalkChg(NpcId.Bruno, 25751)
52+
])
53+
.AddCheckCommands([
54+
QuestManager.CheckCommand.IsEnemyFoundForOrder(1092, 10, -1)
55+
]);
56+
process0.AddRawBlock(QuestAnnounceType.Update)
57+
.AddCheckCommands([
58+
QuestManager.CheckCommand.SceHitIn(1092, 0) // Chest room
59+
]);
60+
process0.AddRawBlock(QuestAnnounceType.CheckpointAndUpdate)
61+
.AddResultCommands([
62+
QuestManager.ResultCommand.QstTalkChg(NpcId.Bruno, 25752)
63+
])
64+
.AddCheckCommands([
65+
QuestManager.CheckCommand.TalkNpc(630, NpcId.Bruno)
66+
]);
67+
process0.AddProcessEndBlock(true);
68+
}
69+
}
70+
71+
return new ScriptedQuest();
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/**
2+
* @brief Adventure Spot Guide: Rathnite Foothills II
3+
*/
4+
5+
#load "libs.csx"
6+
7+
public class ScriptedQuest : IQuest
8+
{
9+
public override QuestType QuestType => QuestType.Tutorial;
10+
public override QuestId QuestId => (QuestId)60300101; // Schedule ID: 1673543808
11+
public override ushort RecommendedLevel => 80;
12+
public override byte MinimumItemRank => 0;
13+
public override bool IsDiscoverable => true;
14+
public override StageInfo StageInfo => Stage.PiremothTravelersInn;
15+
public override QuestAdventureGuideCategory? AdventureGuideCategory => QuestAdventureGuideCategory.QuestUsefulForAdventure;
16+
17+
protected override void InitializeState()
18+
{
19+
AddQuestOrderCondition(QuestOrderCondition.HasAreaRank(QuestAreaId.RathniteFoothills, 2));
20+
}
21+
22+
protected override void InitializeRewards()
23+
{
24+
AddPointReward(PointType.ExperiencePoints, 42000);
25+
AddWalletReward(WalletType.Gold, 11000);
26+
AddWalletReward(WalletType.RiftPoints, 1880);
27+
AddFixedItemReward(ItemId.AcreRoyalFamilyIntaglio, 1);
28+
}
29+
30+
private class EnemyGroupId
31+
{
32+
public const uint Encounter = 10;
33+
}
34+
35+
protected override void InitializeEnemyGroups()
36+
{
37+
AddEnemies(EnemyGroupId.Encounter, Stage.ReservoirUndergroundTunnel, 4, QuestEnemyPlacementType.Manual, new()
38+
{
39+
LibDdon.Enemy.Create(EnemyId.WarReadyGorecyclopsLightArmor0, 80, 207360, 0)
40+
.SetIsAreaBoss(true)
41+
.SetIsBoss(true)
42+
.SetEnemyTargetTypesId(TargetTypesId.AreaBoss),
43+
LibDdon.Enemy.Create(EnemyId.GrimGoblin, 80, 5184, 1)
44+
.SetEnemyTargetTypesId(TargetTypesId.Normal),
45+
LibDdon.Enemy.Create(EnemyId.GrimGoblin, 80, 5184, 2)
46+
.SetEnemyTargetTypesId(TargetTypesId.Normal),
47+
LibDdon.Enemy.Create(EnemyId.GrimGoblin, 80, 5184, 3)
48+
.SetEnemyTargetTypesId(TargetTypesId.Normal),
49+
LibDdon.Enemy.Create(EnemyId.GrimGoblin, 80, 5184, 4)
50+
.SetEnemyTargetTypesId(TargetTypesId.Normal),
51+
LibDdon.Enemy.Create(EnemyId.GrimGoblin, 80, 5184, 5)
52+
.SetEnemyTargetTypesId(TargetTypesId.Normal),
53+
});
54+
}
55+
56+
protected override void InitializeBlocks()
57+
{
58+
var process0 = AddNewProcess(0);
59+
process0.AddNpcTalkAndOrderBlock(Stage.PiremothTravelersInn, NpcId.Bruno, 25798);
60+
process0.AddSpawnGroupBlock(QuestAnnounceType.Accept, EnemyGroupId.Encounter)
61+
.AddResultCommands([
62+
QuestManager.ResultCommand.QstTalkChg(NpcId.Bruno, 25799)
63+
])
64+
.AddCheckCommands([
65+
QuestManager.CheckCommand.IsEnemyFoundForOrder(1080, 4, 0)
66+
]);
67+
process0.AddRawBlock(QuestAnnounceType.Update)
68+
.AddCheckCommands([
69+
QuestManager.CheckCommand.SceHitIn(1080, 0) // Chest room
70+
]);
71+
process0.AddRawBlock(QuestAnnounceType.CheckpointAndUpdate)
72+
.AddResultCommands([
73+
QuestManager.ResultCommand.QstTalkChg(NpcId.Bruno, 25800)
74+
])
75+
.AddCheckCommands([
76+
QuestManager.CheckCommand.TalkNpc(630, NpcId.Bruno)
77+
]);
78+
process0.AddProcessEndBlock(true);
79+
}
80+
}
81+
82+
return new ScriptedQuest();
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/**
2+
* @brief Adventure Spot Guide: Rathnite Foothills III
3+
*/
4+
5+
#load "libs.csx"
6+
7+
public class ScriptedQuest : IQuest
8+
{
9+
public override QuestType QuestType => QuestType.Tutorial;
10+
public override QuestId QuestId => (QuestId)60300102; // Schedule ID: 1673543936
11+
public override ushort RecommendedLevel => 83;
12+
public override byte MinimumItemRank => 0;
13+
public override bool IsDiscoverable => true;
14+
public override StageInfo StageInfo => Stage.RothgillTravelersInn;
15+
public override QuestAdventureGuideCategory? AdventureGuideCategory => QuestAdventureGuideCategory.QuestUsefulForAdventure;
16+
17+
protected override void InitializeState()
18+
{
19+
AddQuestOrderCondition(QuestOrderCondition.HasAreaRank(QuestAreaId.RathniteFoothills, 5));
20+
}
21+
22+
protected override void InitializeRewards()
23+
{
24+
AddPointReward(PointType.ExperiencePoints, 42000);
25+
AddWalletReward(WalletType.Gold, 11000);
26+
AddWalletReward(WalletType.RiftPoints, 2000);
27+
AddFixedItemReward(ItemId.MonsterTissueSample, 1);
28+
}
29+
30+
private class EnemyGroupId
31+
{
32+
public const uint Encounter = 10;
33+
}
34+
35+
protected override void InitializeEnemyGroups()
36+
{
37+
AddEnemies(EnemyGroupId.Encounter, Stage.YimidhittRuins, 16, QuestEnemyPlacementType.Manual, new()
38+
{
39+
LibDdon.Enemy.Create(EnemyId.Drake0, 83, 394800, 0)
40+
.SetIsAreaBoss(true)
41+
.SetIsBoss(true)
42+
.SetEnemyTargetTypesId(TargetTypesId.AreaBoss),
43+
});
44+
}
45+
46+
protected override void InitializeBlocks()
47+
{
48+
var process0 = AddNewProcess(0);
49+
process0.AddNpcTalkAndOrderBlock(Stage.RothgillTravelersInn, NpcId.Laura, 25801);
50+
process0.AddSpawnGroupBlock(QuestAnnounceType.Accept, EnemyGroupId.Encounter)
51+
.AddResultCommands([
52+
QuestManager.ResultCommand.QstTalkChg(NpcId.Laura, 25802)
53+
])
54+
.AddCheckCommands([
55+
QuestManager.CheckCommand.IsEnemyFoundForOrder(1060, 16, 0)
56+
]);
57+
process0.AddRawBlock(QuestAnnounceType.Update)
58+
.AddCheckCommands([
59+
QuestManager.CheckCommand.SceHitIn(1060, 0) // Chest room
60+
]);
61+
process0.AddRawBlock(QuestAnnounceType.CheckpointAndUpdate)
62+
.AddResultCommands([
63+
QuestManager.ResultCommand.QstTalkChg(NpcId.Laura, 25803)
64+
])
65+
.AddCheckCommands([
66+
QuestManager.CheckCommand.TalkNpc(631, NpcId.Laura)
67+
]);
68+
process0.AddProcessEndBlock(true);
69+
}
70+
}
71+
72+
return new ScriptedQuest();

0 commit comments

Comments
 (0)