baseline: OpenMU upstream b5a0961 (fresh source)
This commit is contained in:
107
src/DataModel/Configuration/Quests/QuestDefinition.cs
Normal file
107
src/DataModel/Configuration/Quests/QuestDefinition.cs
Normal file
@@ -0,0 +1,107 @@
|
||||
// <copyright file="QuestDefinition.cs" company="MUnique">
|
||||
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
|
||||
// </copyright>
|
||||
|
||||
namespace MUnique.OpenMU.DataModel.Configuration.Quests;
|
||||
|
||||
using MUnique.OpenMU.Annotations;
|
||||
|
||||
/// <summary>
|
||||
/// The definition of a quest.
|
||||
/// </summary>
|
||||
[Cloneable]
|
||||
public partial class QuestDefinition
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the NPC which gives the quest.
|
||||
/// </summary>
|
||||
public virtual MonsterDefinition? QuestGiver { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the quest.
|
||||
/// </summary>
|
||||
public LocalizedString Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the group identifier of the quest.
|
||||
/// </summary>
|
||||
public short Group { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of the quest which should be unique within the group.
|
||||
/// </summary>
|
||||
public short Number { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the starting number of the quest which should be unique within the group. It's used as an identifier before a quest is started.
|
||||
/// It's an identifier which is required on the client side to show the correct starting text.
|
||||
/// </summary>
|
||||
public short StartingNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the refuse number of the quest which should be unique within the group. It's used as an identifier after a quest has been refused by the player.
|
||||
/// It's an identifier which is required on the client side to show the correct follow-up text.
|
||||
/// </summary>
|
||||
public short RefuseNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this <see cref="QuestDefinition"/> is repeatable
|
||||
/// which means if the character can start this quest multiple times even after it already
|
||||
/// completed it once.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// <c>true</c> if repeatable; otherwise, <c>false</c>.
|
||||
/// </value>
|
||||
public bool Repeatable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this quest requires a client action.
|
||||
/// </summary>
|
||||
public bool RequiresClientAction { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this quest requires a certain amount of money in the characters
|
||||
/// inventory before it can be started.
|
||||
/// </summary>
|
||||
public int RequiredStartMoney { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the minimum character level.
|
||||
/// </summary>
|
||||
public int MinimumCharacterLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the maximum character level.
|
||||
/// </summary>
|
||||
public int MaximumCharacterLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the qualified character class. If <c>null</c>, it's valid for all character classes.
|
||||
/// </summary>
|
||||
public virtual CharacterClass? QualifiedCharacter { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the required monster kills to be able to complete this quest.
|
||||
/// </summary>
|
||||
[MemberOfAggregate]
|
||||
public virtual ICollection<QuestMonsterKillRequirement> RequiredMonsterKills { get; protected set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the required items which should be in the characters inventory when the
|
||||
/// player requests to complete the quest.
|
||||
/// </summary>
|
||||
[MemberOfAggregate]
|
||||
public virtual ICollection<QuestItemRequirement> RequiredItems { get; protected set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the rewards when completing the quest successfully.
|
||||
/// </summary>
|
||||
[MemberOfAggregate]
|
||||
public virtual ICollection<QuestReward> Rewards { get; protected set; } = null!;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string? ToString()
|
||||
{
|
||||
return this.Name.ToString();
|
||||
}
|
||||
}
|
||||
38
src/DataModel/Configuration/Quests/QuestItemRequirement.cs
Normal file
38
src/DataModel/Configuration/Quests/QuestItemRequirement.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
// <copyright file="QuestItemRequirement.cs" company="MUnique">
|
||||
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
|
||||
// </copyright>
|
||||
|
||||
namespace MUnique.OpenMU.DataModel.Configuration.Quests;
|
||||
|
||||
using MUnique.OpenMU.Annotations;
|
||||
using MUnique.OpenMU.DataModel.Configuration.Items;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the required item(s) which should be in the inventory of the character
|
||||
/// when the player requests to complete the quest.
|
||||
/// </summary>
|
||||
[Cloneable]
|
||||
public partial class QuestItemRequirement
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the required item.
|
||||
/// </summary>
|
||||
[Required]
|
||||
public virtual ItemDefinition? Item { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the drop item group which should be considered when this quest is active and this requirement applies.
|
||||
/// </summary>
|
||||
public virtual DropItemGroup? DropItemGroup { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the minimum number of <see cref="Item"/>s.
|
||||
/// </summary>
|
||||
public int MinimumNumber { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{this.MinimumNumber} x {this.Item?.Name}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// <copyright file="QuestMonsterKillRequirement.cs" company="MUnique">
|
||||
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
|
||||
// </copyright>
|
||||
|
||||
namespace MUnique.OpenMU.DataModel.Configuration.Quests;
|
||||
|
||||
using MUnique.OpenMU.Annotations;
|
||||
|
||||
/// <summary>
|
||||
/// The monster kill requirement of a <see cref="QuestDefinition"/>.
|
||||
/// </summary>
|
||||
[Cloneable]
|
||||
public partial class QuestMonsterKillRequirement
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the monster which must be killed.
|
||||
/// </summary>
|
||||
[Required]
|
||||
public virtual MonsterDefinition? Monster { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the minimum number of killed <see cref="Monster"/>s.
|
||||
/// </summary>
|
||||
public int MinimumNumber { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{this.MinimumNumber}x {this.Monster}";
|
||||
}
|
||||
}
|
||||
72
src/DataModel/Configuration/Quests/QuestReward.cs
Normal file
72
src/DataModel/Configuration/Quests/QuestReward.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
// <copyright file="QuestReward.cs" company="MUnique">
|
||||
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
|
||||
// </copyright>
|
||||
|
||||
namespace MUnique.OpenMU.DataModel.Configuration.Quests;
|
||||
|
||||
using MUnique.OpenMU.Annotations;
|
||||
using MUnique.OpenMU.AttributeSystem;
|
||||
using MUnique.OpenMU.DataModel.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the reward of a completed quest.
|
||||
/// </summary>
|
||||
[Cloneable]
|
||||
public partial class QuestReward
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the reward.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The type of the reward.
|
||||
/// </value>
|
||||
public QuestRewardType RewardType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the reward. It may have a different meaning, depending on the <see cref="RewardType"/>.
|
||||
/// </summary>
|
||||
public int Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the item reward.
|
||||
/// The <see cref="Value"/> contains how often the item is rewarded.
|
||||
/// </summary>
|
||||
[MemberOfAggregate]
|
||||
public virtual Item? ItemReward { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the attribute reward. It's set when <see cref="RewardType"/> is <see cref="QuestRewardType.Attribute"/>.
|
||||
/// </summary>
|
||||
public virtual AttributeDefinition? AttributeReward { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the attribute reward. It's set when <see cref="RewardType"/> is <see cref="QuestRewardType.Skill"/>.
|
||||
/// </summary>
|
||||
public virtual Skill? SkillReward { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString()
|
||||
{
|
||||
if (this.RewardType == QuestRewardType.Item)
|
||||
{
|
||||
return $"{this.Value} x {this.ItemReward}";
|
||||
}
|
||||
|
||||
if (this.RewardType == QuestRewardType.Skill)
|
||||
{
|
||||
return $"Skill: {this.SkillReward?.Name}";
|
||||
}
|
||||
|
||||
if (this.RewardType == QuestRewardType.Attribute)
|
||||
{
|
||||
return $"Attribute: {this.Value} x {this.AttributeReward}";
|
||||
}
|
||||
|
||||
if (this.RewardType is QuestRewardType.Experience or QuestRewardType.Money or QuestRewardType.LevelUpPoints or QuestRewardType.GensAttribution)
|
||||
{
|
||||
return $"{this.Value} x {this.RewardType}";
|
||||
}
|
||||
|
||||
return $"{this.RewardType}";
|
||||
}
|
||||
}
|
||||
67
src/DataModel/Configuration/Quests/QuestRewardType.cs
Normal file
67
src/DataModel/Configuration/Quests/QuestRewardType.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
// <copyright file="QuestRewardType.cs" company="MUnique">
|
||||
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
|
||||
// </copyright>
|
||||
|
||||
namespace MUnique.OpenMU.DataModel.Configuration.Quests;
|
||||
|
||||
using MUnique.OpenMU.DataModel.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the type of the reward of a quest.
|
||||
/// </summary>
|
||||
public enum QuestRewardType
|
||||
{
|
||||
/// <summary>
|
||||
/// Undefined quest reward. Rewards nothing.
|
||||
/// </summary>
|
||||
Undefined,
|
||||
|
||||
/// <summary>
|
||||
/// The completed quest rewards additional <see cref="Character.Experience"/>.
|
||||
/// </summary>
|
||||
Experience,
|
||||
|
||||
/// <summary>
|
||||
/// The completed quest rewards additional money to the characters inventory.
|
||||
/// </summary>
|
||||
Money,
|
||||
|
||||
/// <summary>
|
||||
/// The completed quest rewards an item one or more times.
|
||||
/// </summary>
|
||||
Item,
|
||||
|
||||
/// <summary>
|
||||
/// The completed quest rewards gens attribution points.
|
||||
/// </summary>
|
||||
GensAttribution,
|
||||
|
||||
/// <summary>
|
||||
/// The completed quest rewards additional <see cref="Character.LevelUpPoints"/>.
|
||||
/// </summary>
|
||||
LevelUpPoints,
|
||||
|
||||
/// <summary>
|
||||
/// When completing the quest, the <see cref="Character.CharacterClass"/> evolves from the first to the second generation.
|
||||
/// </summary>
|
||||
CharacterEvolutionFirstToSecond,
|
||||
|
||||
/// <summary>
|
||||
/// When completing the quest, the <see cref="Character.CharacterClass"/> evolves from the second to the third generation (master classes).
|
||||
/// </summary>
|
||||
CharacterEvolutionSecondToThird,
|
||||
|
||||
/// <summary>
|
||||
/// The completed quest rewards an additional attribute with the specified value.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// For example, it could mean to add an attribute "Completed Marlon Quest" or "Combo Skill Available" which could
|
||||
/// further be a requirement for skills etc. With the the definition of an attribute, we have maximum flexibility.
|
||||
/// </remarks>
|
||||
Attribute,
|
||||
|
||||
/// <summary>
|
||||
/// The completed quest rewards an additional skill, if not yet learned.
|
||||
/// </summary>
|
||||
Skill,
|
||||
}
|
||||
Reference in New Issue
Block a user