//
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
//
namespace MUnique.OpenMU.DataModel.Configuration;
using MUnique.OpenMU.Annotations;
using MUnique.OpenMU.AttributeSystem;
using MUnique.OpenMU.DataModel.Configuration.Quests;
using MUnique.OpenMU.DataModel.Entities;
using MUnique.OpenMU.Interfaces;
///
/// Type of the window which will be openend when talking to the npc.
/// TODO: Maybe change to a class and do it data-driven.
///
public enum NpcWindow
{
///
/// No window defined.
///
Undefined,
///
/// A merchant window.
///
Merchant,
///
/// Another merchant window.
///
Merchant1,
///
/// A storage window.
///
Storage,
///
/// A vault storage.
///
VaultStorage,
///
/// A chaos machine window.
///
ChaosMachine,
///
/// A devil square window.
///
DevilSquare,
///
/// A blood castle window.
///
BloodCastle,
///
/// The pet trainer window.
///
PetTrainer,
///
/// The lahap window.
///
Lahap,
///
/// The castle senior window.
///
CastleSeniorNPC,
///
/// The elphis refinery window.
///
ElphisRefinery,
///
/// The refine stone making window.
///
RefineStoneMaking,
///
/// The jewel of harmony option removal window.
///
RemoveJohOption,
///
/// The illusion temple window.
///
IllusionTemple,
///
/// The chaos card combination window.
///
ChaosCardCombination,
///
/// The cherry blossom branches assembly window.
///
CherryBlossomBranchesAssembly,
///
/// The seed master window.
///
SeedMaster,
///
/// The seed researcher window.
///
SeedResearcher,
///
/// The stat reinitializer window.
///
StatReInitializer,
///
/// The delgado lucky coin registration window.
///
DelgadoLuckyCoinRegistration,
///
/// The doorkeeper titus duel watch window.
///
DoorkeeperTitusDuelWatch,
///
/// The lugard doppelganger entry window.
///
LugardDoppelgangerEntry,
///
/// The jerint gaion event entry window.
///
JerintGaionEvententry,
///
/// The julia warp market server window.
///
JuliaWarpMarketServer,
///
/// The guild master window.
///
GuildMaster,
///
/// The dialog window which allows to exchange or refine Lucky Item.
/// Used by NPC "David".
///
CombineLuckyItem,
///
/// The specific npc dialog. The client knows which dialog should be shown.
///
///
/// Npc Numbers: 257, 543, 544, 566, 567, 568, 581.
/// Warning: If the game client doesn't have a dialog for this npc, it will crash.
///
NpcDialog,
///
/// The dialog for the legacy quest system.
///
LegacyQuest,
///
/// The castle siege gate NPC interaction window.
///
CastleSiegeGateNpc,
///
/// The castle siege lever NPC interaction window.
///
CastleSiegeLeverNpc,
}
///
/// Type of a non-player-character object.
///
public enum NpcObjectKind
{
///
/// The npc is a monster.
///
Monster,
///
/// The npc is passive, e.g. a merchant.
///
PassiveNpc,
///
/// The npc is a guard.
///
Guard,
///
/// The npc is a trap.
///
Trap,
///
/// The npc is a gate.
///
Gate,
///
/// The npc is a statue.
///
Statue,
///
/// The npc is a soccer ball.
///
SoccerBall,
///
/// The npc is a destructible.
///
Destructible,
}
///
/// A definition for a monster (or NPC in general).
///
[Cloneable]
public partial class MonsterDefinition
{
///
/// Gets or sets the unique number of this monster.
///
public short Number { get; set; }
///
/// Gets or sets the designation of this monster.
/// Not relevant for the server, however helpful for debugging/logging.
///
public LocalizedString Designation { get; set; }
///
/// Gets or sets the range in which a monster will move randomly?
/// It is not used yet. TODO: Find out what it's really good for. Remove, if not needed.
///
public byte MoveRange { get; set; }
///
/// Gets or sets the attack range in which the monster can attack without moving closer to the target.
///
///
/// The attack range.
///
public byte AttackRange { get; set; }
///
/// Gets or sets the view range in which the monster can recognize its targets.
///
public short ViewRange { get; set; }
///
/// Gets or sets the move delay for each step.
///
public TimeSpan MoveDelay { get; set; }
///
/// Gets or sets the attack delay, which is the time between attacks.
///
public TimeSpan AttackDelay { get; set; }
///
/// Gets or sets the delay which is waited until a died instance respawns.
///
public TimeSpan RespawnDelay { get; set; }
///
/// Gets or sets the attribute.
/// Not sure what this is.
/// Maybe the maximum numbers of concurrent additional attributes / magic effects?
/// TODO.
///
public byte Attribute { get; set; }
///
/// Gets or sets the number of maximum item drops after an instance of this monster died.
///
public int NumberOfMaximumItemDrops { get; set; }
///
/// Gets or sets the id of the npc window.
///
public NpcWindow NpcWindow { get; set; }
///
/// Gets or sets the kind of the object.
///
public NpcObjectKind ObjectKind { get; set; }
///
/// Gets or sets the name of the intelligence type, if this npc/monster uses a specific implementation of an INpcIntelligence.
///
public string? IntelligenceTypeName { get; set; }
///
/// Gets or sets the skill with which this monster is attacking. Also known as "Attack type".
///
/// The additional damage of the skill is usually NOT applied; However, magic effects are.
public virtual Skill? AttackSkill { get; set; }
///
/// Gets or sets the items of the merchant store. Is only relevant for merchant NPCs.
///
[MemberOfAggregate]
public virtual ItemStorage? MerchantStore { get; set; }
///
/// Gets or sets the item craftings. Is only relevant for crafting NPCs (chaos goblin etc.).
///
[MemberOfAggregate]
public virtual ICollection ItemCraftings { get; protected set; } = null!;
///
/// Gets or sets the drop item groups.
/// Some monsters drop special items. Examples: Kundun has the chance to drop ancient items.
///
public virtual ICollection DropItemGroups { get; protected set; } = null!;
///
/// Gets or sets the attributes of this monster.
///
[MemberOfAggregate]
public virtual ICollection Attributes { get; protected set; } = null!;
///
/// Gets or sets the quests which can be started through this npc.
///
[MemberOfAggregate]
public virtual ICollection Quests { get; protected set; } = null!;
///
/// Gets or sets the buffs which can be granted by this npc.
///
[MemberOfAggregate]
public virtual ICollection Buffs { get; protected set; } = null!;
///
/// Attribute default accessor.
///
/// The attribute.
/// The value of the attribute.
public float this[AttributeDefinition key]
{
get
{
return this.Attributes.First(a => a.AttributeDefinition == key).Value;
}
}
///
public override string ToString()
{
return $"{this.Designation} ({this.Number})";
}
}