85 lines
2.7 KiB
C#
85 lines
2.7 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using Server.Data.Enums;
|
|
|
|
namespace Server.Data.Entities;
|
|
|
|
/// <summary>
|
|
/// Item template/definition - what an item IS
|
|
/// </summary>
|
|
[Table("dungeon_item_definitions")]
|
|
public class DungeonItemDefinition
|
|
{
|
|
[Key]
|
|
public int Id { get; set; }
|
|
|
|
[Required]
|
|
[MaxLength(64)]
|
|
public string Name { get; set; } = "";
|
|
|
|
[MaxLength(256)]
|
|
public string Description { get; set; } = "";
|
|
|
|
public ItemType Type { get; set; }
|
|
public ItemRarity Rarity { get; set; } = ItemRarity.Common;
|
|
public DungeonEquipmentSlot? EquipSlot { get; set; } // Null if not equippable
|
|
|
|
// Stat requirements to equip/use
|
|
public int RequiredStrength { get; set; } = 0;
|
|
public int RequiredIntelligence { get; set; } = 0;
|
|
public int RequiredWisdom { get; set; } = 0;
|
|
public int RequiredDexterity { get; set; } = 0;
|
|
public int RequiredLevel { get; set; } = 1;
|
|
|
|
// Stat bonuses when equipped
|
|
public int BonusStrength { get; set; } = 0;
|
|
public int BonusIntelligence { get; set; } = 0;
|
|
public int BonusWisdom { get; set; } = 0;
|
|
public int BonusEndurance { get; set; } = 0;
|
|
public int BonusDexterity { get; set; } = 0;
|
|
public int BonusHealth { get; set; } = 0;
|
|
public int BonusMana { get; set; } = 0;
|
|
|
|
// Weapon stats
|
|
public int MinDamage { get; set; } = 0;
|
|
public int MaxDamage { get; set; } = 0;
|
|
public float AttackRange { get; set; } = 0; // 0 = melee
|
|
public DamageType DamageType { get; set; } = DamageType.Physical;
|
|
|
|
// Armor stats
|
|
public int Armor { get; set; } = 0;
|
|
public int MagicResist { get; set; } = 0;
|
|
|
|
// Consumable effects
|
|
public int HealAmount { get; set; } = 0;
|
|
public int ManaRestore { get; set; } = 0;
|
|
public int StaminaRestore { get; set; } = 0;
|
|
|
|
// Special
|
|
public bool IsTeleportScroll { get; set; } = false;
|
|
public int? TeachesSpellId { get; set; } // For spell tomes
|
|
|
|
// Stacking
|
|
public bool Stackable { get; set; } = false;
|
|
public int MaxStack { get; set; } = 1;
|
|
|
|
// Visuals
|
|
/// <summary>
|
|
/// Path to the item's sprite image on CDN (e.g., "textures/items/sword_iron.png")
|
|
/// If null/empty, client uses fallback placeholder based on item type
|
|
/// </summary>
|
|
[MaxLength(256)]
|
|
public string? SpritePath { get; set; }
|
|
|
|
/// <summary>
|
|
/// Optional color tint as hex (e.g., "#ff0000" for red tint)
|
|
/// </summary>
|
|
[MaxLength(16)]
|
|
public string? TintColor { get; set; }
|
|
|
|
// Legacy field - kept for backwards compatibility
|
|
public int SpriteId { get; set; } = 0;
|
|
|
|
public bool IsEnabled { get; set; } = true;
|
|
}
|