71 lines
2.0 KiB
C#
71 lines
2.0 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using Server.Data.Entities;
|
|
|
|
namespace Server.Data.Entities
|
|
{
|
|
/// <summary>
|
|
/// A single entry in a loot table - one possible drop
|
|
/// </summary>
|
|
[Table("dungeon_loot_table_entries")]
|
|
public class DungeonLootTableEntry
|
|
{
|
|
[Key]
|
|
public int Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// The loot table this entry belongs to
|
|
/// </summary>
|
|
public int LootTableId { get; set; }
|
|
|
|
[ForeignKey(nameof(LootTableId))]
|
|
public DungeonLootTable? LootTable { get; set; }
|
|
|
|
/// <summary>
|
|
/// The item that can drop
|
|
/// </summary>
|
|
public int ItemDefinitionId { get; set; }
|
|
|
|
[ForeignKey(nameof(ItemDefinitionId))]
|
|
public DungeonItemDefinition? ItemDefinition { get; set; }
|
|
|
|
/// <summary>
|
|
/// Base drop chance (0.0 - 1.0)
|
|
/// 1.0 = 100%, 0.1 = 10%, 0.01 = 1%
|
|
/// </summary>
|
|
public float DropChance { get; set; } = 0.1f;
|
|
|
|
/// <summary>
|
|
/// Minimum quantity to drop
|
|
/// </summary>
|
|
public int MinQuantity { get; set; } = 1;
|
|
|
|
/// <summary>
|
|
/// Maximum quantity to drop
|
|
/// </summary>
|
|
public int MaxQuantity { get; set; } = 1;
|
|
|
|
/// <summary>
|
|
/// Weight for weighted random selection (higher = more likely)
|
|
/// Used when selecting which items drop
|
|
/// </summary>
|
|
public int Weight { get; set; } = 100;
|
|
|
|
/// <summary>
|
|
/// If true, this is a guaranteed drop (ignores DropChance)
|
|
/// </summary>
|
|
public bool Guaranteed { get; set; } = false;
|
|
|
|
/// <summary>
|
|
/// Additional drop chance per dungeon tier
|
|
/// Example: 0.02 means +2% chance per tier
|
|
/// </summary>
|
|
public float DropChancePerTier { get; set; } = 0.0f;
|
|
|
|
/// <summary>
|
|
/// Maximum drop chance after tier scaling
|
|
/// </summary>
|
|
public float MaxDropChance { get; set; } = 1.0f;
|
|
}
|
|
}
|