This commit is contained in:
dingo
2025-12-08 11:57:08 -05:00
parent 3755b13931
commit 17da6639cf
15 changed files with 3098 additions and 5 deletions
+481
View File
@@ -0,0 +1,481 @@
using Server.Data.Enums;
namespace Server.Data.Entities;
/// <summary>
/// Default item definitions - seeded on first startup
/// </summary>
public static class DefaultDungeonItems
{
public static List<DungeonItemDefinition> GetDefaultItems()
{
return new List<DungeonItemDefinition>
{
// ==================== CRAFTING MATERIALS (1-10) ====================
new()
{
Id = 1,
Name = "Bone Fragment",
Description = "A fragment of bone from the undead. Used in crafting.",
Type = ItemType.Material,
Rarity = ItemRarity.Common,
Stackable = true,
MaxStack = 99,
SpriteId = 1
},
new()
{
Id = 2,
Name = "Rotted Cloth",
Description = "Decayed fabric from the walking dead.",
Type = ItemType.Material,
Rarity = ItemRarity.Common,
Stackable = true,
MaxStack = 99,
SpriteId = 2
},
new()
{
Id = 3,
Name = "Soul Essence",
Description = "The captured essence of a departed spirit. Valuable for enchanting.",
Type = ItemType.Material,
Rarity = ItemRarity.Uncommon,
Stackable = true,
MaxStack = 50,
SpriteId = 3
},
new()
{
Id = 4,
Name = "Beast Hide",
Description = "Tough hide from a dungeon beast.",
Type = ItemType.Material,
Rarity = ItemRarity.Common,
Stackable = true,
MaxStack = 99,
SpriteId = 4
},
new()
{
Id = 5,
Name = "Beast Fang",
Description = "A sharp fang from a predatory creature.",
Type = ItemType.Material,
Rarity = ItemRarity.Common,
Stackable = true,
MaxStack = 99,
SpriteId = 5
},
new()
{
Id = 6,
Name = "Beast Heart",
Description = "The still-warm heart of a powerful beast.",
Type = ItemType.Material,
Rarity = ItemRarity.Uncommon,
Stackable = true,
MaxStack = 30,
SpriteId = 6
},
new()
{
Id = 7,
Name = "Demon Essence",
Description = "Dark energy condensed from demonic creatures.",
Type = ItemType.Material,
Rarity = ItemRarity.Uncommon,
Stackable = true,
MaxStack = 50,
SpriteId = 7
},
new()
{
Id = 8,
Name = "Infernal Shard",
Description = "A crystallized fragment of hellfire.",
Type = ItemType.Material,
Rarity = ItemRarity.Rare,
Stackable = true,
MaxStack = 30,
SpriteId = 8
},
new()
{
Id = 9,
Name = "Elemental Core",
Description = "The magical core of an elemental being.",
Type = ItemType.Material,
Rarity = ItemRarity.Uncommon,
Stackable = true,
MaxStack = 50,
SpriteId = 9
},
new()
{
Id = 10,
Name = "Arcane Dust",
Description = "Fine magical particles. Essential for enchanting.",
Type = ItemType.Material,
Rarity = ItemRarity.Rare,
Stackable = true,
MaxStack = 99,
SpriteId = 10
},
// ==================== CONSUMABLES (11-20) ====================
new()
{
Id = 11,
Name = "Minor Health Potion",
Description = "Restores a small amount of health.",
Type = ItemType.Consumable,
Rarity = ItemRarity.Common,
Stackable = true,
MaxStack = 20,
HealAmount = 30,
SpriteId = 11
},
new()
{
Id = 12,
Name = "Health Potion",
Description = "Restores a moderate amount of health.",
Type = ItemType.Consumable,
Rarity = ItemRarity.Common,
Stackable = true,
MaxStack = 20,
HealAmount = 75,
SpriteId = 12
},
new()
{
Id = 13,
Name = "Greater Health Potion",
Description = "Restores a large amount of health.",
Type = ItemType.Consumable,
Rarity = ItemRarity.Uncommon,
Stackable = true,
MaxStack = 10,
HealAmount = 150,
SpriteId = 13
},
new()
{
Id = 14,
Name = "Minor Mana Potion",
Description = "Restores a small amount of mana.",
Type = ItemType.Consumable,
Rarity = ItemRarity.Common,
Stackable = true,
MaxStack = 20,
ManaRestore = 25,
SpriteId = 14
},
new()
{
Id = 15,
Name = "Mana Potion",
Description = "Restores a moderate amount of mana.",
Type = ItemType.Consumable,
Rarity = ItemRarity.Common,
Stackable = true,
MaxStack = 20,
ManaRestore = 60,
SpriteId = 15
},
new()
{
Id = 16,
Name = "Scroll of Escape",
Description = "Teleports you safely out of the dungeon.",
Type = ItemType.Consumable,
Rarity = ItemRarity.Uncommon,
Stackable = true,
MaxStack = 5,
IsTeleportScroll = true,
SpriteId = 16
},
// ==================== WEAPONS (21-30) ====================
new()
{
Id = 21,
Name = "Iron Sword",
Description = "A sturdy iron blade.",
Type = ItemType.Weapon,
Rarity = ItemRarity.Common,
EquipSlot = DungeonEquipmentSlot.MainHand,
MinDamage = 8,
MaxDamage = 14,
AttackRange = 40,
RequiredLevel = 1,
SpriteId = 21
},
new()
{
Id = 22,
Name = "Steel Sword",
Description = "A well-forged steel blade.",
Type = ItemType.Weapon,
Rarity = ItemRarity.Uncommon,
EquipSlot = DungeonEquipmentSlot.MainHand,
MinDamage = 12,
MaxDamage = 20,
AttackRange = 40,
RequiredLevel = 3,
RequiredStrength = 5,
SpriteId = 22
},
new()
{
Id = 23,
Name = "Wooden Air Staff",
Description = "A simple staff channeling magical energy.",
Type = ItemType.Weapon,
Rarity = ItemRarity.Common,
EquipSlot = DungeonEquipmentSlot.MainHand,
MinDamage = 5,
MaxDamage = 10,
AttackRange = 100,
DamageType = DamageType.Wind,
BonusMana = 10,
RequiredLevel = 1,
SpriteId = 23
},
new()
{
Id = 24,
Name = "Enchanted Fire Staff",
Description = "A staff imbued with arcane power.",
Type = ItemType.Weapon,
Rarity = ItemRarity.Uncommon,
EquipSlot = DungeonEquipmentSlot.MainHand,
MinDamage = 10,
MaxDamage = 18,
AttackRange = 120,
DamageType = DamageType.Fire,
BonusMana = 25,
BonusIntelligence = 3,
RequiredLevel = 4,
RequiredIntelligence = 6,
SpriteId = 24
},
new()
{
Id = 25,
Name = "Hunting Bow",
Description = "A reliable ranged weapon.",
Type = ItemType.Weapon,
Rarity = ItemRarity.Common,
EquipSlot = DungeonEquipmentSlot.MainHand,
MinDamage = 6,
MaxDamage = 12,
AttackRange = 180,
DamageType = DamageType.Physical,
RequiredLevel = 1,
RequiredDexterity = 3,
SpriteId = 25
},
new()
{
Id = 26,
Name = "Shadow Dagger",
Description = "A wickedly sharp blade that strikes from the shadows.",
Type = ItemType.Weapon,
Rarity = ItemRarity.Rare,
EquipSlot = DungeonEquipmentSlot.MainHand,
MinDamage = 15,
MaxDamage = 25,
AttackRange = 35,
DamageType = DamageType.Physical,
BonusDexterity = 5,
RequiredLevel = 6,
RequiredDexterity = 10,
SpriteId = 26
},
// ==================== ARMOR - CHEST (31-35) ====================
new()
{
Id = 31,
Name = "Leather Armor",
Description = "Basic leather protection.",
Type = ItemType.Armor,
Rarity = ItemRarity.Common,
EquipSlot = DungeonEquipmentSlot.Chest,
Armor = 5,
RequiredLevel = 1,
SpriteId = 31
},
new()
{
Id = 32,
Name = "Chainmail",
Description = "Interlocking metal rings provide solid defense.",
Type = ItemType.Armor,
Rarity = ItemRarity.Uncommon,
EquipSlot = DungeonEquipmentSlot.Chest,
Armor = 12,
BonusEndurance = 2,
RequiredLevel = 4,
RequiredStrength = 5,
SpriteId = 32
},
new()
{
Id = 33,
Name = "Mage Robes",
Description = "Enchanted robes that enhance magical abilities.",
Type = ItemType.Armor,
Rarity = ItemRarity.Uncommon,
EquipSlot = DungeonEquipmentSlot.Chest,
Armor = 3,
MagicResist = 10,
BonusMana = 30,
BonusIntelligence = 3,
RequiredLevel = 3,
RequiredIntelligence = 5,
SpriteId = 33
},
// ==================== ARMOR - HEAD (36-38) ====================
new()
{
Id = 36,
Name = "Leather Cap",
Description = "A simple leather head covering.",
Type = ItemType.Armor,
Rarity = ItemRarity.Common,
EquipSlot = DungeonEquipmentSlot.Head,
Armor = 2,
RequiredLevel = 1,
SpriteId = 36
},
new()
{
Id = 37,
Name = "Iron Helm",
Description = "A sturdy metal helmet.",
Type = ItemType.Armor,
Rarity = ItemRarity.Uncommon,
EquipSlot = DungeonEquipmentSlot.Head,
Armor = 6,
BonusEndurance = 1,
RequiredLevel = 3,
RequiredStrength = 3,
SpriteId = 37
},
new()
{
Id = 38,
Name = "Wizard Hat",
Description = "A pointed hat crackling with magical energy.",
Type = ItemType.Armor,
Rarity = ItemRarity.Uncommon,
EquipSlot = DungeonEquipmentSlot.Head,
Armor = 1,
MagicResist = 5,
BonusMana = 15,
BonusWisdom = 2,
RequiredLevel = 3,
RequiredIntelligence = 3,
SpriteId = 38
},
// ==================== ARMOR - OFFHAND (41-43) ====================
new()
{
Id = 41,
Name = "Wooden Shield",
Description = "A basic wooden shield.",
Type = ItemType.Armor,
Rarity = ItemRarity.Common,
EquipSlot = DungeonEquipmentSlot.OffHand,
Armor = 4,
RequiredLevel = 1,
SpriteId = 41
},
new()
{
Id = 42,
Name = "Iron Shield",
Description = "A solid iron shield.",
Type = ItemType.Armor,
Rarity = ItemRarity.Uncommon,
EquipSlot = DungeonEquipmentSlot.OffHand,
Armor = 10,
BonusEndurance = 2,
RequiredLevel = 4,
RequiredStrength = 6,
SpriteId = 42
},
new()
{
Id = 43,
Name = "Tome of Knowledge",
Description = "An ancient tome that enhances magical power.",
Type = ItemType.Armor,
Rarity = ItemRarity.Uncommon,
EquipSlot = DungeonEquipmentSlot.OffHand,
MagicResist = 5,
BonusMana = 20,
BonusIntelligence = 2,
RequiredLevel = 3,
RequiredIntelligence = 4,
SpriteId = 43
},
// ==================== ACCESSORIES (51-55) ====================
new()
{
Id = 51,
Name = "Ring of Health",
Description = "A simple ring that bolsters vitality.",
Type = ItemType.Accessory,
Rarity = ItemRarity.Common,
EquipSlot = DungeonEquipmentSlot.Accessory1,
BonusHealth = 25,
RequiredLevel = 2,
SpriteId = 51
},
new()
{
Id = 52,
Name = "Ring of Power",
Description = "A ring pulsing with physical might.",
Type = ItemType.Accessory,
Rarity = ItemRarity.Uncommon,
EquipSlot = DungeonEquipmentSlot.Accessory1,
BonusStrength = 3,
RequiredLevel = 3,
SpriteId = 52
},
new()
{
Id = 53,
Name = "Amulet of Wisdom",
Description = "An amulet that sharpens the mind.",
Type = ItemType.Accessory,
Rarity = ItemRarity.Uncommon,
EquipSlot = DungeonEquipmentSlot.Accessory2,
BonusWisdom = 3,
BonusMana = 15,
RequiredLevel = 3,
SpriteId = 53
},
new()
{
Id = 54,
Name = "Pendant of Swiftness",
Description = "A pendant that enhances agility.",
Type = ItemType.Accessory,
Rarity = ItemRarity.Uncommon,
EquipSlot = DungeonEquipmentSlot.Accessory2,
BonusDexterity = 4,
RequiredLevel = 3,
SpriteId = 54
},
};
}
}
+70
View File
@@ -0,0 +1,70 @@
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;
}
}
+37
View File
@@ -0,0 +1,37 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Server.Data.Entities;
namespace Server.Data.Entities
{
/// <summary>
/// Maps mobs to their loot tables (many-to-many)
/// A mob can have multiple loot tables, and a loot table can be used by multiple mobs
/// </summary>
[Table("dungeon_mob_loot_tables")]
public class DungeonMobLootTable
{
[Key]
public int Id { get; set; }
public int MobDefinitionId { get; set; }
[ForeignKey(nameof(MobDefinitionId))]
public DungeonMobDefinition? MobDefinition { get; set; }
public int LootTableId { get; set; }
[ForeignKey(nameof(LootTableId))]
public DungeonLootTable? LootTable { get; set; }
/// <summary>
/// Priority/order for rolling this table (lower = first)
/// </summary>
public int Priority { get; set; } = 0;
/// <summary>
/// Chance this loot table is rolled at all (0.0 - 1.0)
/// </summary>
public float RollChance { get; set; } = 1.0f;
}
}
+61
View File
@@ -0,0 +1,61 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Server.Data.Enums;
namespace Server.Data.Entities;
/// <summary>
/// A loot table defines a collection of possible item drops
/// </summary>
[Table("dungeon_loot_tables")]
public class DungeonLootTable
{
[Key]
public int Id { get; set; }
[Required]
[MaxLength(64)]
public string Name { get; set; } = "";
[MaxLength(256)]
public string Description { get; set; } = "";
/// <summary>
/// Minimum dungeon tier for this loot table to be active
/// </summary>
public int MinTier { get; set; } = 1;
/// <summary>
/// Maximum dungeon tier (99 = no limit)
/// </summary>
public int MaxTier { get; set; } = 99;
/// <summary>
/// Global drop chance multiplier for all entries in this table
/// </summary>
public float DropChanceMultiplier { get; set; } = 1.0f;
/// <summary>
/// Minimum number of items to drop from this table
/// </summary>
public int MinDrops { get; set; } = 1;
/// <summary>
/// Maximum number of items to drop from this table
/// </summary>
public int MaxDrops { get; set; } = 3;
/// <summary>
/// If true, guaranteed to drop at least MinDrops items
/// </summary>
public bool GuaranteedDrop { get; set; } = false;
public bool IsEnabled { get; set; } = true;
// Navigation
public ICollection<DungeonLootTableEntry> Entries { get; set; } = new List<DungeonLootTableEntry>();
}