diff --git a/Game/Dungeon/CombatCalculator.cs b/Game/Dungeon/CombatCalculator.cs index c9c9c6e..ddeea67 100644 --- a/Game/Dungeon/CombatCalculator.cs +++ b/Game/Dungeon/CombatCalculator.cs @@ -1,5 +1,4 @@ using DataServer.Data.Entities; -using DataServer.Data.Enums; namespace Server.Game.Dungeon; @@ -14,54 +13,41 @@ public static class CombatCalculator public static DamageResult CalculatePlayerToMobDamage( PlayerInstance player, MobInstance mob, - DamageType damageType, - int baseDamage, - Dictionary? playerGearResistances = null) + string damageTypeKey, + int baseDamage) { // 1. Base damage modified by player stats float damage = baseDamage; - // Physical damage scales with STR - if (damageType == DamageType.Physical) + // Physical damage scales with STR, all other types scale with INT + if (damageTypeKey == "physical") { damage *= 1 + (player.Strength * 0.05f); // 5% per STR } - // Magical damage scales with INT else { damage *= 1 + (player.Intelligence * 0.05f); // 5% per INT } - // 2. Apply mob's armor/magic resist reduction - float mitigation = 0f; - if (damageType == DamageType.Physical) - { - // Armor formula: damage reduction = armor / (armor + 100) - mitigation = mob.Stats.Armor / (float)(mob.Stats.Armor + 100); - } - else - { - // Magic resist formula - mitigation = mob.Stats.MagicResist / (float)(mob.Stats.MagicResist + 100); - } - - damage *= (1 - mitigation); + // 2. Apply mob's armor reduction (flat mitigation for all damage types) + float armorMitigation = mob.Stats.Armor / (float)(mob.Stats.Armor + 100); + damage *= (1 - armorMitigation); // 3. Apply mob's elemental resistances - string resistKey = damageType.ToString().ToLower(); - if (mob.Stats.Resistances.TryGetValue(resistKey, out float mobResist)) + float mobResist = 0f; + if (mob.Stats.Resistances.TryGetValue(damageTypeKey, out float resist)) { + mobResist = resist; // Positive = resistance (reduces damage), Negative = weakness (increases damage) // 0.5 = 50% resistance, -0.25 = 25% weakness, 1.0 = immune if (mobResist >= 1.0f) { - // Immune return new DamageResult { FinalDamage = 0, WasResisted = true, WasImmune = true, - DamageType = damageType + DamageTypeKey = damageTypeKey }; } damage *= (1 - mobResist); @@ -75,7 +61,7 @@ public static class CombatCalculator FinalDamage = finalDamage, WasResisted = mobResist > 0, WasWeakness = mobResist < 0, - DamageType = damageType + DamageTypeKey = damageTypeKey }; } @@ -85,32 +71,19 @@ public static class CombatCalculator public static DamageResult CalculateMobToPlayerDamage( MobInstance mob, PlayerInstance player, - DamageType damageType, + string damageTypeKey, int baseDamage, Dictionary playerTotalResistances) { float damage = baseDamage; - // 1. Apply player's armor/magic resist reduction - float mitigation = 0f; - if (damageType == DamageType.Physical) - { - // Player armor from gear + endurance bonus - int playerArmor = player.Armor; - mitigation = playerArmor / (float)(playerArmor + 100); - } - else - { - int playerMagicResist = player.MagicResist; - mitigation = playerMagicResist / (float)(playerMagicResist + 100); - } - - damage *= (1 - mitigation); + // 1. Apply player's armor reduction (flat mitigation for all damage types) + float armorMitigation = player.Armor / (float)(player.Armor + 100); + damage *= (1 - armorMitigation); // 2. Apply player's elemental resistances (from gear + innate) - string resistKey = damageType.ToString().ToLower(); float playerResist = 0f; - if (playerTotalResistances.TryGetValue(resistKey, out float resist)) + if (playerTotalResistances.TryGetValue(damageTypeKey, out float resist)) { playerResist = resist; } @@ -134,7 +107,7 @@ public static class CombatCalculator FinalDamage = finalDamage, WasResisted = playerResist > 0, WasWeakness = playerResist < 0, - DamageType = damageType + DamageTypeKey = damageTypeKey }; } @@ -161,10 +134,18 @@ public static class CombatCalculator return total; } + /// + /// Calculate total armor for a player from gear + /// + public static int CalculatePlayerTotalArmor(List equippedItems) + { + return equippedItems.Sum(item => item.Armor); + } + /// /// Calculate player weapon damage range /// - public static (int min, int max, DamageType type) GetPlayerWeaponDamage( + public static (int min, int max, string damageTypeKey) GetPlayerWeaponDamage( PlayerInstance player, DungeonItemDefinition? weapon) { @@ -173,10 +154,31 @@ public static class CombatCalculator // Unarmed: base damage + STR int unarmedMin = 1 + (int)(player.Strength * 0.5f); int unarmedMax = 3 + (int)(player.Strength * 0.5f); - return (unarmedMin, unarmedMax, DamageType.Physical); + return (unarmedMin, unarmedMax, "physical"); } - return (weapon.MinDamage, weapon.MaxDamage, weapon.DamageType); + return (weapon.MinDamage, weapon.MaxDamage, weapon.DamageTypeKey); + } + + /// + /// Check if player meets equipment requirements + /// + public static (bool canEquip, string? reason) CanEquipItem( + DungeonCharacter character, + DungeonItemDefinition item) + { + if (character.Level < item.RequiredLevel) + return (false, $"Requires level {item.RequiredLevel}"); + if (character.Strength < item.RequiredStrength) + return (false, $"Requires {item.RequiredStrength} STR"); + if (character.Intelligence < item.RequiredIntelligence) + return (false, $"Requires {item.RequiredIntelligence} INT"); + if (character.Wisdom < item.RequiredWisdom) + return (false, $"Requires {item.RequiredWisdom} WIS"); + if (character.Dexterity < item.RequiredDexterity) + return (false, $"Requires {item.RequiredDexterity} DEX"); + + return (true, null); } } @@ -187,5 +189,5 @@ public class DamageResult public bool WasWeakness { get; set; } public bool WasImmune { get; set; } public bool WasCritical { get; set; } - public DamageType DamageType { get; set; } + public string DamageTypeKey { get; set; } = "physical"; } diff --git a/Game/Dungeon/DungeonSimulation.cs b/Game/Dungeon/DungeonSimulation.cs index c6f5f54..74df126 100644 --- a/Game/Dungeon/DungeonSimulation.cs +++ b/Game/Dungeon/DungeonSimulation.cs @@ -273,16 +273,13 @@ public class DungeonSimulation private void MobAttackPlayer(MobInstance mob, PlayerInstance player) { - // Determine damage type (physical if mob has no magic damage) - var damageType = mob.Stats.MagicDamage > mob.Stats.PhysicalDamage - ? DataServer.Data.Enums.DamageType.Fire // Use fire for magic mobs (could be configured per mob) - : DataServer.Data.Enums.DamageType.Physical; - + // Use mob's configured damage type key + string damageTypeKey = mob.Stats.DamageTypeKey ?? "physical"; int baseDamage = mob.Stats.PhysicalDamage + mob.Stats.MagicDamage; // Calculate damage with resistances var result = CombatCalculator.CalculateMobToPlayerDamage( - mob, player, damageType, baseDamage, player.Resistances); + mob, player, damageTypeKey, baseDamage, player.Resistances); player.Health -= result.FinalDamage; player.IsInCombat = true; @@ -295,6 +292,7 @@ public class DungeonSimulation TargetType = EntityType.Player, TargetId = (int)player.CharacterId, Damage = result.FinalDamage, + DamageTypeKey = damageTypeKey, WasResisted = result.WasResisted, WasWeakness = result.WasWeakness }); @@ -359,13 +357,13 @@ public class DungeonSimulation float dist = Distance(player.X, player.Y, mob.X, mob.Y); if (dist > 60) return; // Out of range - // Base damage from stats (would be enhanced by equipped weapon in full implementation) + // Use player's weapon damage type (set when loading equipped weapon) + string damageTypeKey = player.WeaponDamageTypeKey ?? "physical"; int baseDamage = 10 + (int)(player.Strength * 0.5f); - var damageType = DataServer.Data.Enums.DamageType.Physical; // Calculate damage with mob resistances var result = CombatCalculator.CalculatePlayerToMobDamage( - player, mob, damageType, baseDamage); + player, mob, damageTypeKey, baseDamage); if (result.WasImmune) { @@ -377,6 +375,7 @@ public class DungeonSimulation TargetType = EntityType.Mob, TargetId = mob.Id, Damage = 0, + DamageTypeKey = damageTypeKey, WasImmune = true }); return; @@ -393,6 +392,7 @@ public class DungeonSimulation TargetType = EntityType.Mob, TargetId = mob.Id, Damage = result.FinalDamage, + DamageTypeKey = damageTypeKey, WasResisted = result.WasResisted, WasWeakness = result.WasWeakness }); diff --git a/Game/Dungeon/PlayerInstance.cs b/Game/Dungeon/PlayerInstance.cs index f43738e..7357537 100644 --- a/Game/Dungeon/PlayerInstance.cs +++ b/Game/Dungeon/PlayerInstance.cs @@ -28,7 +28,11 @@ public class PlayerInstance // Defensive stats (from gear) public int Armor { get; set; } - public int MagicResist { get; set; } + + /// + /// Weapon damage type key (from equipped weapon, defaults to physical for unarmed) + /// + public string WeaponDamageTypeKey { get; set; } = "physical"; /// /// Combined resistances from innate + gear diff --git a/Game/Dungeon/TickResult.cs b/Game/Dungeon/TickResult.cs index 6ebd946..2d563e5 100644 --- a/Game/Dungeon/TickResult.cs +++ b/Game/Dungeon/TickResult.cs @@ -1,5 +1,3 @@ -using DataServer.Data.Enums; - namespace Server.Game.Dungeon; public class TickResult @@ -16,7 +14,11 @@ public class DamageEvent public EntityType TargetType { get; set; } public int TargetId { get; set; } public int Damage { get; set; } - public DamageType DamageType { get; set; } + + /// + /// Damage type key (e.g., "physical", "fire", "poison") + /// + public string DamageTypeKey { get; set; } = "physical"; /// /// True if damage was reduced by resistance diff --git a/Migrations/20251226172112_Cleanup unused code.Designer.cs b/Migrations/20251226172112_Cleanup unused code.Designer.cs new file mode 100644 index 0000000..c79ade8 --- /dev/null +++ b/Migrations/20251226172112_Cleanup unused code.Designer.cs @@ -0,0 +1,1728 @@ +// +using System; +using DataServer.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace SystemRevivalServer.Migrations +{ + [DbContext(typeof(GameDbContext))] + [Migration("20251226172112_Cleanup unused code")] + partial class Cleanupunusedcode + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("DataServer.Data.Account", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BannedUntil") + .HasColumnType("datetime(6)"); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); + + b.Property("Email") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("IsBanned") + .HasColumnType("tinyint(1)"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("varbinary(64)"); + + b.Property("PasswordSalt") + .IsRequired() + .HasColumnType("varbinary(32)"); + + b.Property("Role") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("UpdatedAt") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)") + .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); + + b.Property("Username") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.HasKey("Id"); + + b.HasIndex("Email") + .IsUnique(); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("accounts", (string)null); + }); + + modelBuilder.Entity("DataServer.Data.Entities.ClientAsset", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AssetType") + .HasColumnType("int"); + + b.Property("CdnPath") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("FileHash") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("FilePath") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("FileSize") + .HasColumnType("bigint"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("IsRequired") + .HasColumnType("tinyint(1)"); + + b.Property("MinClientVersion") + .HasMaxLength(16) + .HasColumnType("varchar(16)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime(6)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("client_assets"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DamageResistanceType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Color") + .IsRequired() + .HasMaxLength(16) + .HasColumnType("varchar(16)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("IconPath") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("SortOrder") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("damage_resistance_types"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DeathChest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("DungeonInstanceId") + .HasColumnType("char(36)"); + + b.Property("EmptiedAt") + .HasColumnType("datetime(6)"); + + b.Property("GoldAmount") + .HasColumnType("bigint"); + + b.Property("IsEmpty") + .HasColumnType("tinyint(1)"); + + b.Property("OwnerCharacterId") + .HasColumnType("bigint unsigned"); + + b.Property("VictimCharacterId") + .HasColumnType("bigint unsigned"); + + b.Property("VictimMobDefinitionId") + .HasColumnType("int"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("OwnerCharacterId"); + + b.HasIndex("VictimCharacterId"); + + b.ToTable("dungeon_death_chests"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DeathChestItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("DeathChestId") + .HasColumnType("bigint unsigned"); + + b.Property("IsTaken") + .HasColumnType("tinyint(1)"); + + b.Property("ItemDefinitionId") + .HasColumnType("int"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TakenAt") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("DeathChestId"); + + b.HasIndex("ItemDefinitionId"); + + b.ToTable("dungeon_death_chest_items"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonBeltItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CharacterId") + .HasColumnType("bigint unsigned"); + + b.Property("InventorySlotIndex") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId"); + + b.ToTable("dungeon_belt_items"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacter", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AccountId") + .HasColumnType("bigint unsigned"); + + b.Property("BossesKilled") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("CurrentHealth") + .HasColumnType("int"); + + b.Property("CurrentMana") + .HasColumnType("int"); + + b.Property("Dexterity") + .HasColumnType("int"); + + b.Property("DungeonsCompleted") + .HasColumnType("int"); + + b.Property("Endurance") + .HasColumnType("int"); + + b.Property("EquippedAccessory") + .HasColumnType("bigint unsigned"); + + b.Property("EquippedBoots") + .HasColumnType("bigint unsigned"); + + b.Property("EquippedChest") + .HasColumnType("bigint unsigned"); + + b.Property("EquippedGloves") + .HasColumnType("bigint unsigned"); + + b.Property("EquippedHead") + .HasColumnType("bigint unsigned"); + + b.Property("EquippedLegs") + .HasColumnType("bigint unsigned"); + + b.Property("EquippedOffhand") + .HasColumnType("bigint unsigned"); + + b.Property("EquippedWeapon") + .HasColumnType("bigint unsigned"); + + b.Property("Experience") + .HasColumnType("bigint"); + + b.Property("Gold") + .HasColumnType("bigint"); + + b.Property("Intelligence") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastPlayedAt") + .HasColumnType("datetime(6)"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("PlayersKilled") + .HasColumnType("int"); + + b.Property("ResistancesJson") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("Strength") + .HasColumnType("int"); + + b.Property("TotalDeaths") + .HasColumnType("int"); + + b.Property("TotalKills") + .HasColumnType("int"); + + b.Property("UnspentStatPoints") + .HasColumnType("int"); + + b.Property("Wisdom") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AccountId"); + + b.ToTable("dungeon_characters"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacterCraftingSkill", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CharacterId") + .HasColumnType("bigint unsigned"); + + b.Property("Experience") + .HasColumnType("bigint"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("SkillType") + .HasColumnType("int"); + + b.Property("TotalItemsCrafted") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId"); + + b.ToTable("dungeon_character_crafting_skills"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacterItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AcquiredAt") + .HasColumnType("datetime(6)"); + + b.Property("CharacterId") + .HasColumnType("bigint unsigned"); + + b.Property("EquipSlot") + .HasColumnType("int"); + + b.Property("IsEquipped") + .HasColumnType("tinyint(1)"); + + b.Property("ItemDefinitionId") + .HasColumnType("int"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId"); + + b.HasIndex("ItemDefinitionId"); + + b.ToTable("dungeon_character_items"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacterItemCraftedLink", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CharacterItemId") + .HasColumnType("bigint unsigned"); + + b.Property("CraftedItemId") + .HasColumnType("bigint unsigned"); + + b.HasKey("Id"); + + b.HasIndex("CharacterItemId"); + + b.HasIndex("CraftedItemId"); + + b.ToTable("dungeon_character_item_crafted_link"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacterKnownRecipe", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CharacterId") + .HasColumnType("bigint unsigned"); + + b.Property("DiscoveredAt") + .HasColumnType("datetime(6)"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("TimesCrafted") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId"); + + b.HasIndex("RecipeId"); + + b.ToTable("dungeon_character_known_recipes"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCraftedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BaseItemDefinitionId") + .HasColumnType("int"); + + b.Property("CraftedAt") + .HasColumnType("datetime(6)"); + + b.Property("CrafterId") + .HasColumnType("bigint unsigned"); + + b.Property("CrafterName") + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("CraftingLevelAtCreation") + .HasColumnType("int"); + + b.Property("CustomName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("QualityRating") + .HasColumnType("int"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("RollHistoryJson") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RolledBonusArmor") + .HasColumnType("int"); + + b.Property("RolledBonusDexterity") + .HasColumnType("int"); + + b.Property("RolledBonusEndurance") + .HasColumnType("int"); + + b.Property("RolledBonusHealAmount") + .HasColumnType("int"); + + b.Property("RolledBonusHealth") + .HasColumnType("int"); + + b.Property("RolledBonusIntelligence") + .HasColumnType("int"); + + b.Property("RolledBonusMagicResist") + .HasColumnType("int"); + + b.Property("RolledBonusMana") + .HasColumnType("int"); + + b.Property("RolledBonusManaRestore") + .HasColumnType("int"); + + b.Property("RolledBonusMaxDamage") + .HasColumnType("int"); + + b.Property("RolledBonusMinDamage") + .HasColumnType("int"); + + b.Property("RolledBonusStrength") + .HasColumnType("int"); + + b.Property("RolledBonusWisdom") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("BaseItemDefinitionId"); + + b.HasIndex("CrafterId"); + + b.HasIndex("RecipeId"); + + b.ToTable("dungeon_crafted_items"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCraftingRecipe", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BaseXp") + .HasColumnType("int"); + + b.Property("BonusOutputChanceAtMinLevel") + .HasColumnType("float"); + + b.Property("BonusOutputItemDefinitionId") + .HasColumnType("int"); + + b.Property("BonusOutputMaxLevel") + .HasColumnType("int"); + + b.Property("BonusOutputMinLevel") + .HasColumnType("int"); + + b.Property("BonusOutputQuantity") + .HasColumnType("int"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("HasStatRolls") + .HasColumnType("tinyint(1)"); + + b.Property("IsBaseRecipe") + .HasColumnType("tinyint(1)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("OutputItemDefinitionId") + .HasColumnType("int"); + + b.Property("OutputQuantity") + .HasColumnType("int"); + + b.Property("PossibleStatsJson") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RequiredLevel") + .HasColumnType("int"); + + b.Property("SkillType") + .HasColumnType("int"); + + b.Property("Tier") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("OutputItemDefinitionId"); + + b.ToTable("dungeon_crafting_recipes"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCraftingRecipeIngredient", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ItemDefinitionId") + .HasColumnType("int"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("SlotOrder") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ItemDefinitionId"); + + b.HasIndex("RecipeId"); + + b.ToTable("dungeon_crafting_recipe_ingredients"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonItemDefinition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Armor") + .HasColumnType("int"); + + b.Property("AttackRange") + .HasColumnType("float"); + + b.Property("BonusDexterity") + .HasColumnType("int"); + + b.Property("BonusEndurance") + .HasColumnType("int"); + + b.Property("BonusHealth") + .HasColumnType("int"); + + b.Property("BonusIntelligence") + .HasColumnType("int"); + + b.Property("BonusMana") + .HasColumnType("int"); + + b.Property("BonusStrength") + .HasColumnType("int"); + + b.Property("BonusWisdom") + .HasColumnType("int"); + + b.Property("BuffDuration") + .HasColumnType("int"); + + b.Property("BuffResistancesJson") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("DamageType") + .HasColumnType("int"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("EquipSlot") + .HasColumnType("int"); + + b.Property("HealAmount") + .HasColumnType("int"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("IsTeleportScroll") + .HasColumnType("tinyint(1)"); + + b.Property("MagicResist") + .HasColumnType("int"); + + b.Property("ManaRestore") + .HasColumnType("int"); + + b.Property("MaxDamage") + .HasColumnType("int"); + + b.Property("MaxStack") + .HasColumnType("int"); + + b.Property("MinDamage") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Rarity") + .HasColumnType("int"); + + b.Property("RequiredDexterity") + .HasColumnType("int"); + + b.Property("RequiredIntelligence") + .HasColumnType("int"); + + b.Property("RequiredLevel") + .HasColumnType("int"); + + b.Property("RequiredStrength") + .HasColumnType("int"); + + b.Property("RequiredWisdom") + .HasColumnType("int"); + + b.Property("ResistancesJson") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("SpriteId") + .HasColumnType("int"); + + b.Property("SpritePath") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Stackable") + .HasColumnType("tinyint(1)"); + + b.Property("StaminaRestore") + .HasColumnType("int"); + + b.Property("TeachesSpellId") + .HasColumnType("int"); + + b.Property("TintColor") + .HasMaxLength(16) + .HasColumnType("varchar(16)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("dungeon_item_definitions"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonLearnedSpell", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CharacterId") + .HasColumnType("bigint unsigned"); + + b.Property("DefinitionId") + .HasColumnType("int"); + + b.Property("LearnedAt") + .HasColumnType("datetime(6)"); + + b.Property("SpellDefinitionId") + .HasColumnType("int"); + + b.Property("SpellLevel") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId"); + + b.HasIndex("DefinitionId"); + + b.ToTable("dungeon_learned_spells"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonLootTable", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DropChanceMultiplier") + .HasColumnType("float"); + + b.Property("GuaranteedDrop") + .HasColumnType("tinyint(1)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("MaxDrops") + .HasColumnType("int"); + + b.Property("MaxTier") + .HasColumnType("int"); + + b.Property("MinDrops") + .HasColumnType("int"); + + b.Property("MinTier") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.ToTable("dungeon_loot_tables"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonLootTableEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("DropChance") + .HasColumnType("float"); + + b.Property("DropChancePerTier") + .HasColumnType("float"); + + b.Property("Guaranteed") + .HasColumnType("tinyint(1)"); + + b.Property("ItemDefinitionId") + .HasColumnType("int"); + + b.Property("LootTableId") + .HasColumnType("int"); + + b.Property("MaxDropChance") + .HasColumnType("float"); + + b.Property("MaxQuantity") + .HasColumnType("int"); + + b.Property("MinQuantity") + .HasColumnType("int"); + + b.Property("Weight") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ItemDefinitionId"); + + b.HasIndex("LootTableId"); + + b.ToTable("dungeon_loot_table_entries"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonMobDefinition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AbilitiesJson") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("AggroRange") + .HasColumnType("float"); + + b.Property("AnimationSpeed") + .HasColumnType("float"); + + b.Property("ArmorPerTier") + .HasColumnType("float"); + + b.Property("AttackRange") + .HasColumnType("float"); + + b.Property("AttackSpeed") + .HasColumnType("float"); + + b.Property("BaseArmor") + .HasColumnType("int"); + + b.Property("BaseHealth") + .HasColumnType("int"); + + b.Property("BaseMagicDamage") + .HasColumnType("int"); + + b.Property("BaseMagicResist") + .HasColumnType("int"); + + b.Property("BaseMana") + .HasColumnType("int"); + + b.Property("BasePhysicalDamage") + .HasColumnType("int"); + + b.Property("BaseXp") + .HasColumnType("int"); + + b.Property("Category") + .HasColumnType("int"); + + b.Property("DamagePerTier") + .HasColumnType("float"); + + b.Property("DamageTypeKey") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DropChanceMultiplier") + .HasColumnType("float"); + + b.Property("HealthPerTier") + .HasColumnType("float"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("LeashRange") + .HasColumnType("float"); + + b.Property("LootTableId") + .HasColumnType("int"); + + b.Property("MaxTier") + .HasColumnType("int"); + + b.Property("MinTier") + .HasColumnType("int"); + + b.Property("MoveSpeed") + .HasColumnType("float"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ResistancesJson") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("Scale") + .HasColumnType("float"); + + b.Property("SpriteConfigJson") + .HasMaxLength(4096) + .HasColumnType("varchar(4096)"); + + b.Property("TintColor") + .IsRequired() + .HasMaxLength(16) + .HasColumnType("varchar(16)"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("XpPerTier") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.ToTable("dungeon_mob_definitions"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonMobLootTable", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("LootTableId") + .HasColumnType("int"); + + b.Property("MobDefinitionId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("RollChance") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("LootTableId"); + + b.HasIndex("MobDefinitionId"); + + b.ToTable("dungeon_mob_loot_tables"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonPersistence", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("BossKilled") + .HasColumnType("tinyint(1)"); + + b.Property("ChestStateJson") + .HasColumnType("json"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("CreatorCharacterId") + .HasColumnType("bigint unsigned"); + + b.Property("CreatorId") + .HasColumnType("bigint unsigned"); + + b.Property("CreatorLevel") + .HasColumnType("int"); + + b.Property("CreatorName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsCleared") + .HasColumnType("tinyint(1)"); + + b.Property("LastActivity") + .HasColumnType("datetime(6)"); + + b.Property("LevelBracketMax") + .HasColumnType("int"); + + b.Property("LevelBracketMin") + .HasColumnType("int"); + + b.Property("LootChestStateJson") + .HasColumnType("json"); + + b.Property("MobStateJson") + .HasColumnType("json"); + + b.Property("PersistedAt") + .HasColumnType("datetime(6)"); + + b.Property("Seed") + .HasColumnType("int"); + + b.Property("Tier") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CreatorId"); + + b.ToTable("dungeon_instances"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonRecipeScroll", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ItemDefinitionId") + .HasColumnType("int"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ItemDefinitionId"); + + b.HasIndex("RecipeId"); + + b.ToTable("dungeon_recipe_scrolls"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonSpellDefinition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AreaOfEffect") + .HasColumnType("float"); + + b.Property("BaseDamage") + .HasColumnType("int"); + + b.Property("BaseHealing") + .HasColumnType("int"); + + b.Property("Cooldown") + .HasColumnType("float"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("EffectColor") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("IsShield") + .HasColumnType("tinyint(1)"); + + b.Property("IsTeleport") + .HasColumnType("tinyint(1)"); + + b.Property("ManaCost") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Range") + .HasColumnType("float"); + + b.Property("RequiredIntelligence") + .HasColumnType("int"); + + b.Property("RequiredLevel") + .HasColumnType("int"); + + b.Property("RequiredWisdom") + .HasColumnType("int"); + + b.Property("ShieldAmount") + .HasColumnType("int"); + + b.Property("SpriteId") + .HasColumnType("int"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("dungeon_spell_definitions"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonStashItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CharacterId") + .HasColumnType("bigint unsigned"); + + b.Property("DefinitionId") + .HasColumnType("int"); + + b.Property("ItemDefinitionId") + .HasColumnType("int"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("StoredAt") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId"); + + b.HasIndex("DefinitionId"); + + b.ToTable("dungeon_stash_items"); + }); + + modelBuilder.Entity("DataServer.Data.Session", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AccountId") + .HasColumnType("bigint unsigned"); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); + + b.Property("CreatedIp") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ExpiresAt") + .HasColumnType("datetime(6)"); + + b.Property("RevokedAt") + .HasColumnType("datetime(6)"); + + b.Property("TokenHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("UserAgent") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("AccountId"); + + b.HasIndex("TokenHash") + .IsUnique(); + + b.ToTable("sessions", (string)null); + }); + + modelBuilder.Entity("DataServer.Data.Zone", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); + + b.Property("MaxX") + .HasColumnType("double"); + + b.Property("MaxY") + .HasColumnType("double"); + + b.Property("MaxZ") + .HasColumnType("double"); + + b.Property("MinX") + .HasColumnType("double"); + + b.Property("MinY") + .HasColumnType("double"); + + b.Property("MinZ") + .HasColumnType("double"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UpdatedAt") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)") + .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("zones", (string)null); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DeathChest", b => + { + b.HasOne("DataServer.Data.Entities.DungeonCharacter", "OwnerCharacter") + .WithMany() + .HasForeignKey("OwnerCharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonCharacter", "VictimCharacter") + .WithMany() + .HasForeignKey("VictimCharacterId"); + + b.Navigation("OwnerCharacter"); + + b.Navigation("VictimCharacter"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DeathChestItem", b => + { + b.HasOne("DataServer.Data.Entities.DeathChest", "DeathChest") + .WithMany("Items") + .HasForeignKey("DeathChestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonItemDefinition", "ItemDefinition") + .WithMany() + .HasForeignKey("ItemDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DeathChest"); + + b.Navigation("ItemDefinition"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonBeltItem", b => + { + b.HasOne("DataServer.Data.Entities.DungeonCharacter", "Character") + .WithMany() + .HasForeignKey("CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacter", b => + { + b.HasOne("DataServer.Data.Account", "Account") + .WithMany("Characters") + .HasForeignKey("AccountId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacterCraftingSkill", b => + { + b.HasOne("DataServer.Data.Entities.DungeonCharacter", "Character") + .WithMany("CraftingSkills") + .HasForeignKey("CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacterItem", b => + { + b.HasOne("DataServer.Data.Entities.DungeonCharacter", "Character") + .WithMany("Inventory") + .HasForeignKey("CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonItemDefinition", "ItemDefinition") + .WithMany() + .HasForeignKey("ItemDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + + b.Navigation("ItemDefinition"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacterItemCraftedLink", b => + { + b.HasOne("DataServer.Data.Entities.DungeonCharacterItem", "CharacterItem") + .WithMany() + .HasForeignKey("CharacterItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonCraftedItem", "CraftedItem") + .WithMany() + .HasForeignKey("CraftedItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CharacterItem"); + + b.Navigation("CraftedItem"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacterKnownRecipe", b => + { + b.HasOne("DataServer.Data.Entities.DungeonCharacter", "Character") + .WithMany("KnownRecipes") + .HasForeignKey("CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonCraftingRecipe", "Recipe") + .WithMany() + .HasForeignKey("RecipeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + + b.Navigation("Recipe"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCraftedItem", b => + { + b.HasOne("DataServer.Data.Entities.DungeonItemDefinition", "BaseItemDefinition") + .WithMany() + .HasForeignKey("BaseItemDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonCharacter", "Crafter") + .WithMany() + .HasForeignKey("CrafterId"); + + b.HasOne("DataServer.Data.Entities.DungeonCraftingRecipe", "Recipe") + .WithMany() + .HasForeignKey("RecipeId"); + + b.Navigation("BaseItemDefinition"); + + b.Navigation("Crafter"); + + b.Navigation("Recipe"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCraftingRecipe", b => + { + b.HasOne("DataServer.Data.Entities.DungeonItemDefinition", "OutputItem") + .WithMany() + .HasForeignKey("OutputItemDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OutputItem"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCraftingRecipeIngredient", b => + { + b.HasOne("DataServer.Data.Entities.DungeonItemDefinition", "ItemDefinition") + .WithMany() + .HasForeignKey("ItemDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonCraftingRecipe", "Recipe") + .WithMany("Ingredients") + .HasForeignKey("RecipeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ItemDefinition"); + + b.Navigation("Recipe"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonLearnedSpell", b => + { + b.HasOne("DataServer.Data.Entities.DungeonCharacter", "Character") + .WithMany("LearnedSpells") + .HasForeignKey("CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonSpellDefinition", "Definition") + .WithMany() + .HasForeignKey("DefinitionId"); + + b.Navigation("Character"); + + b.Navigation("Definition"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonLootTableEntry", b => + { + b.HasOne("DataServer.Data.Entities.DungeonItemDefinition", "ItemDefinition") + .WithMany() + .HasForeignKey("ItemDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonLootTable", "LootTable") + .WithMany("Entries") + .HasForeignKey("LootTableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ItemDefinition"); + + b.Navigation("LootTable"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonMobLootTable", b => + { + b.HasOne("DataServer.Data.Entities.DungeonLootTable", "LootTable") + .WithMany() + .HasForeignKey("LootTableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonMobDefinition", "MobDefinition") + .WithMany() + .HasForeignKey("MobDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LootTable"); + + b.Navigation("MobDefinition"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonPersistence", b => + { + b.HasOne("DataServer.Data.Entities.DungeonCharacter", "Creator") + .WithMany() + .HasForeignKey("CreatorId"); + + b.Navigation("Creator"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonRecipeScroll", b => + { + b.HasOne("DataServer.Data.Entities.DungeonItemDefinition", "ItemDefinition") + .WithMany() + .HasForeignKey("ItemDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonCraftingRecipe", "Recipe") + .WithMany() + .HasForeignKey("RecipeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ItemDefinition"); + + b.Navigation("Recipe"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonStashItem", b => + { + b.HasOne("DataServer.Data.Entities.DungeonCharacter", "Character") + .WithMany("Stash") + .HasForeignKey("CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonItemDefinition", "Definition") + .WithMany() + .HasForeignKey("DefinitionId"); + + b.Navigation("Character"); + + b.Navigation("Definition"); + }); + + modelBuilder.Entity("DataServer.Data.Session", b => + { + b.HasOne("DataServer.Data.Account", "Account") + .WithMany("Sessions") + .HasForeignKey("AccountId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("DataServer.Data.Account", b => + { + b.Navigation("Characters"); + + b.Navigation("Sessions"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DeathChest", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacter", b => + { + b.Navigation("CraftingSkills"); + + b.Navigation("Inventory"); + + b.Navigation("KnownRecipes"); + + b.Navigation("LearnedSpells"); + + b.Navigation("Stash"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCraftingRecipe", b => + { + b.Navigation("Ingredients"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonLootTable", b => + { + b.Navigation("Entries"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Migrations/20251226172112_Cleanup unused code.cs b/Migrations/20251226172112_Cleanup unused code.cs new file mode 100644 index 0000000..dbcf178 --- /dev/null +++ b/Migrations/20251226172112_Cleanup unused code.cs @@ -0,0 +1,214 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace SystemRevivalServer.Migrations +{ + /// + public partial class Cleanupunusedcode : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "equipment"); + + migrationBuilder.DropTable( + name: "inventories"); + + migrationBuilder.DropTable( + name: "characters"); + + migrationBuilder.DropTable( + name: "item_templates"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "characters", + columns: table => new + { + Id = table.Column(type: "bigint unsigned", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + AccountId = table.Column(type: "bigint unsigned", nullable: false), + ZoneId = table.Column(type: "bigint unsigned", nullable: false), + AppearanceJson = table.Column(type: "json", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), + FacingDeg = table.Column(type: "float", nullable: false), + HpCurrent = table.Column(type: "int unsigned", nullable: false), + HpMax = table.Column(type: "int unsigned", nullable: false), + Level = table.Column(type: "int unsigned", nullable: false), + MpCurrent = table.Column(type: "int unsigned", nullable: false), + MpMax = table.Column(type: "int unsigned", nullable: false), + Name = table.Column(type: "varchar(32)", maxLength: 32, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + PosX = table.Column(type: "double", nullable: false), + PosY = table.Column(type: "double", nullable: false), + PosZ = table.Column(type: "double", nullable: false), + StaminaCurrent = table.Column(type: "int unsigned", nullable: false), + StaminaMax = table.Column(type: "int unsigned", nullable: false), + StatDexterity = table.Column(type: "int unsigned", nullable: false), + StatEndurance = table.Column(type: "int unsigned", nullable: false), + StatIntelligence = table.Column(type: "int unsigned", nullable: false), + StatStrength = table.Column(type: "int unsigned", nullable: false), + StatWisdom = table.Column(type: "int unsigned", nullable: false), + UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn), + Xp = table.Column(type: "bigint unsigned", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_characters", x => x.Id); + table.ForeignKey( + name: "FK_characters_accounts_AccountId", + column: x => x.AccountId, + principalTable: "accounts", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_characters_zones_ZoneId", + column: x => x.ZoneId, + principalTable: "zones", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "item_templates", + columns: table => new + { + Id = table.Column(type: "bigint unsigned", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), + ItemType = table.Column(type: "tinyint unsigned", nullable: false), + MaxStack = table.Column(type: "int unsigned", nullable: false), + Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Rarity = table.Column(type: "tinyint unsigned", nullable: false), + StatsJson = table.Column(type: "json", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn), + Weight = table.Column(type: "int unsigned", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_item_templates", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "equipment", + columns: table => new + { + Id = table.Column(type: "bigint unsigned", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CharacterId = table.Column(type: "bigint unsigned", nullable: false), + ItemTemplateId = table.Column(type: "bigint unsigned", nullable: false), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), + SlotCode = table.Column(type: "tinyint unsigned", nullable: false), + UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) + }, + constraints: table => + { + table.PrimaryKey("PK_equipment", x => x.Id); + table.ForeignKey( + name: "FK_equipment_characters_CharacterId", + column: x => x.CharacterId, + principalTable: "characters", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_equipment_item_templates_ItemTemplateId", + column: x => x.ItemTemplateId, + principalTable: "item_templates", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "inventories", + columns: table => new + { + Id = table.Column(type: "bigint unsigned", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CharacterId = table.Column(type: "bigint unsigned", nullable: false), + ItemTemplateId = table.Column(type: "bigint unsigned", nullable: false), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), + Quantity = table.Column(type: "int unsigned", nullable: false), + SlotIndex = table.Column(type: "int unsigned", nullable: false), + UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) + }, + constraints: table => + { + table.PrimaryKey("PK_inventories", x => x.Id); + table.ForeignKey( + name: "FK_inventories_characters_CharacterId", + column: x => x.CharacterId, + principalTable: "characters", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_inventories_item_templates_ItemTemplateId", + column: x => x.ItemTemplateId, + principalTable: "item_templates", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_characters_AccountId", + table: "characters", + column: "AccountId", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_characters_ZoneId", + table: "characters", + column: "ZoneId"); + + migrationBuilder.CreateIndex( + name: "IX_equipment_CharacterId_SlotCode", + table: "equipment", + columns: new[] { "CharacterId", "SlotCode" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_equipment_ItemTemplateId", + table: "equipment", + column: "ItemTemplateId"); + + migrationBuilder.CreateIndex( + name: "IX_inventories_CharacterId", + table: "inventories", + column: "CharacterId"); + + migrationBuilder.CreateIndex( + name: "IX_inventories_CharacterId_SlotIndex", + table: "inventories", + columns: new[] { "CharacterId", "SlotIndex" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_inventories_ItemTemplateId", + table: "inventories", + column: "ItemTemplateId"); + + migrationBuilder.CreateIndex( + name: "IX_item_templates_Name", + table: "item_templates", + column: "Name", + unique: true); + } + } +} diff --git a/Migrations/20251226212352_DamageTypeChanges.Designer.cs b/Migrations/20251226212352_DamageTypeChanges.Designer.cs new file mode 100644 index 0000000..f133c83 --- /dev/null +++ b/Migrations/20251226212352_DamageTypeChanges.Designer.cs @@ -0,0 +1,1727 @@ +// +using System; +using DataServer.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace SystemRevivalServer.Migrations +{ + [DbContext(typeof(GameDbContext))] + [Migration("20251226212352_DamageTypeChanges")] + partial class DamageTypeChanges + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("DataServer.Data.Account", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BannedUntil") + .HasColumnType("datetime(6)"); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); + + b.Property("Email") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("IsBanned") + .HasColumnType("tinyint(1)"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("varbinary(64)"); + + b.Property("PasswordSalt") + .IsRequired() + .HasColumnType("varbinary(32)"); + + b.Property("Role") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("UpdatedAt") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)") + .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); + + b.Property("Username") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.HasKey("Id"); + + b.HasIndex("Email") + .IsUnique(); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("accounts", (string)null); + }); + + modelBuilder.Entity("DataServer.Data.Entities.ClientAsset", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AssetType") + .HasColumnType("int"); + + b.Property("CdnPath") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("FileHash") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("FilePath") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("FileSize") + .HasColumnType("bigint"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("IsRequired") + .HasColumnType("tinyint(1)"); + + b.Property("MinClientVersion") + .HasMaxLength(16) + .HasColumnType("varchar(16)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime(6)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("client_assets"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DamageResistanceType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Color") + .IsRequired() + .HasMaxLength(16) + .HasColumnType("varchar(16)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("IconPath") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("SortOrder") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("damage_resistance_types"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DeathChest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("DungeonInstanceId") + .HasColumnType("char(36)"); + + b.Property("EmptiedAt") + .HasColumnType("datetime(6)"); + + b.Property("GoldAmount") + .HasColumnType("bigint"); + + b.Property("IsEmpty") + .HasColumnType("tinyint(1)"); + + b.Property("OwnerCharacterId") + .HasColumnType("bigint unsigned"); + + b.Property("VictimCharacterId") + .HasColumnType("bigint unsigned"); + + b.Property("VictimMobDefinitionId") + .HasColumnType("int"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("OwnerCharacterId"); + + b.HasIndex("VictimCharacterId"); + + b.ToTable("dungeon_death_chests"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DeathChestItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("DeathChestId") + .HasColumnType("bigint unsigned"); + + b.Property("IsTaken") + .HasColumnType("tinyint(1)"); + + b.Property("ItemDefinitionId") + .HasColumnType("int"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("TakenAt") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("DeathChestId"); + + b.HasIndex("ItemDefinitionId"); + + b.ToTable("dungeon_death_chest_items"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonBeltItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CharacterId") + .HasColumnType("bigint unsigned"); + + b.Property("InventorySlotIndex") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId"); + + b.ToTable("dungeon_belt_items"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacter", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AccountId") + .HasColumnType("bigint unsigned"); + + b.Property("BossesKilled") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("CurrentHealth") + .HasColumnType("int"); + + b.Property("CurrentMana") + .HasColumnType("int"); + + b.Property("Dexterity") + .HasColumnType("int"); + + b.Property("DungeonsCompleted") + .HasColumnType("int"); + + b.Property("Endurance") + .HasColumnType("int"); + + b.Property("EquippedAccessory") + .HasColumnType("bigint unsigned"); + + b.Property("EquippedBoots") + .HasColumnType("bigint unsigned"); + + b.Property("EquippedChest") + .HasColumnType("bigint unsigned"); + + b.Property("EquippedGloves") + .HasColumnType("bigint unsigned"); + + b.Property("EquippedHead") + .HasColumnType("bigint unsigned"); + + b.Property("EquippedLegs") + .HasColumnType("bigint unsigned"); + + b.Property("EquippedOffhand") + .HasColumnType("bigint unsigned"); + + b.Property("EquippedWeapon") + .HasColumnType("bigint unsigned"); + + b.Property("Experience") + .HasColumnType("bigint"); + + b.Property("Gold") + .HasColumnType("bigint"); + + b.Property("Intelligence") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastPlayedAt") + .HasColumnType("datetime(6)"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("PlayersKilled") + .HasColumnType("int"); + + b.Property("ResistancesJson") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("Strength") + .HasColumnType("int"); + + b.Property("TotalDeaths") + .HasColumnType("int"); + + b.Property("TotalKills") + .HasColumnType("int"); + + b.Property("UnspentStatPoints") + .HasColumnType("int"); + + b.Property("Wisdom") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AccountId"); + + b.ToTable("dungeon_characters"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacterCraftingSkill", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CharacterId") + .HasColumnType("bigint unsigned"); + + b.Property("Experience") + .HasColumnType("bigint"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("SkillType") + .HasColumnType("int"); + + b.Property("TotalItemsCrafted") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId"); + + b.ToTable("dungeon_character_crafting_skills"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacterItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AcquiredAt") + .HasColumnType("datetime(6)"); + + b.Property("CharacterId") + .HasColumnType("bigint unsigned"); + + b.Property("EquipSlot") + .HasColumnType("int"); + + b.Property("IsEquipped") + .HasColumnType("tinyint(1)"); + + b.Property("ItemDefinitionId") + .HasColumnType("int"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId"); + + b.HasIndex("ItemDefinitionId"); + + b.ToTable("dungeon_character_items"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacterItemCraftedLink", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CharacterItemId") + .HasColumnType("bigint unsigned"); + + b.Property("CraftedItemId") + .HasColumnType("bigint unsigned"); + + b.HasKey("Id"); + + b.HasIndex("CharacterItemId"); + + b.HasIndex("CraftedItemId"); + + b.ToTable("dungeon_character_item_crafted_link"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacterKnownRecipe", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CharacterId") + .HasColumnType("bigint unsigned"); + + b.Property("DiscoveredAt") + .HasColumnType("datetime(6)"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("TimesCrafted") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId"); + + b.HasIndex("RecipeId"); + + b.ToTable("dungeon_character_known_recipes"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCraftedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BaseItemDefinitionId") + .HasColumnType("int"); + + b.Property("CraftedAt") + .HasColumnType("datetime(6)"); + + b.Property("CrafterId") + .HasColumnType("bigint unsigned"); + + b.Property("CrafterName") + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("CraftingLevelAtCreation") + .HasColumnType("int"); + + b.Property("CustomName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("QualityRating") + .HasColumnType("int"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("RollHistoryJson") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RolledBonusArmor") + .HasColumnType("int"); + + b.Property("RolledBonusDexterity") + .HasColumnType("int"); + + b.Property("RolledBonusEndurance") + .HasColumnType("int"); + + b.Property("RolledBonusHealAmount") + .HasColumnType("int"); + + b.Property("RolledBonusHealth") + .HasColumnType("int"); + + b.Property("RolledBonusIntelligence") + .HasColumnType("int"); + + b.Property("RolledBonusMagicResist") + .HasColumnType("int"); + + b.Property("RolledBonusMana") + .HasColumnType("int"); + + b.Property("RolledBonusManaRestore") + .HasColumnType("int"); + + b.Property("RolledBonusMaxDamage") + .HasColumnType("int"); + + b.Property("RolledBonusMinDamage") + .HasColumnType("int"); + + b.Property("RolledBonusStrength") + .HasColumnType("int"); + + b.Property("RolledBonusWisdom") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("BaseItemDefinitionId"); + + b.HasIndex("CrafterId"); + + b.HasIndex("RecipeId"); + + b.ToTable("dungeon_crafted_items"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCraftingRecipe", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BaseXp") + .HasColumnType("int"); + + b.Property("BonusOutputChanceAtMinLevel") + .HasColumnType("float"); + + b.Property("BonusOutputItemDefinitionId") + .HasColumnType("int"); + + b.Property("BonusOutputMaxLevel") + .HasColumnType("int"); + + b.Property("BonusOutputMinLevel") + .HasColumnType("int"); + + b.Property("BonusOutputQuantity") + .HasColumnType("int"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("HasStatRolls") + .HasColumnType("tinyint(1)"); + + b.Property("IsBaseRecipe") + .HasColumnType("tinyint(1)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("OutputItemDefinitionId") + .HasColumnType("int"); + + b.Property("OutputQuantity") + .HasColumnType("int"); + + b.Property("PossibleStatsJson") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RequiredLevel") + .HasColumnType("int"); + + b.Property("SkillType") + .HasColumnType("int"); + + b.Property("Tier") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("OutputItemDefinitionId"); + + b.ToTable("dungeon_crafting_recipes"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCraftingRecipeIngredient", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ItemDefinitionId") + .HasColumnType("int"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.Property("SlotOrder") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ItemDefinitionId"); + + b.HasIndex("RecipeId"); + + b.ToTable("dungeon_crafting_recipe_ingredients"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonItemDefinition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Armor") + .HasColumnType("int"); + + b.Property("AttackRange") + .HasColumnType("float"); + + b.Property("BonusDexterity") + .HasColumnType("int"); + + b.Property("BonusEndurance") + .HasColumnType("int"); + + b.Property("BonusHealth") + .HasColumnType("int"); + + b.Property("BonusIntelligence") + .HasColumnType("int"); + + b.Property("BonusMana") + .HasColumnType("int"); + + b.Property("BonusStrength") + .HasColumnType("int"); + + b.Property("BonusWisdom") + .HasColumnType("int"); + + b.Property("BuffDuration") + .HasColumnType("int"); + + b.Property("BuffResistancesJson") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("DamageTypeKey") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("EquipSlot") + .HasColumnType("int"); + + b.Property("HealAmount") + .HasColumnType("int"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("IsTeleportScroll") + .HasColumnType("tinyint(1)"); + + b.Property("ManaRestore") + .HasColumnType("int"); + + b.Property("MaxDamage") + .HasColumnType("int"); + + b.Property("MaxStack") + .HasColumnType("int"); + + b.Property("MinDamage") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Rarity") + .HasColumnType("int"); + + b.Property("RequiredDexterity") + .HasColumnType("int"); + + b.Property("RequiredIntelligence") + .HasColumnType("int"); + + b.Property("RequiredLevel") + .HasColumnType("int"); + + b.Property("RequiredStrength") + .HasColumnType("int"); + + b.Property("RequiredWisdom") + .HasColumnType("int"); + + b.Property("ResistancesJson") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("SpriteId") + .HasColumnType("int"); + + b.Property("SpritePath") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Stackable") + .HasColumnType("tinyint(1)"); + + b.Property("StaminaRestore") + .HasColumnType("int"); + + b.Property("TeachesSpellId") + .HasColumnType("int"); + + b.Property("TintColor") + .HasMaxLength(16) + .HasColumnType("varchar(16)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("dungeon_item_definitions"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonLearnedSpell", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CharacterId") + .HasColumnType("bigint unsigned"); + + b.Property("DefinitionId") + .HasColumnType("int"); + + b.Property("LearnedAt") + .HasColumnType("datetime(6)"); + + b.Property("SpellDefinitionId") + .HasColumnType("int"); + + b.Property("SpellLevel") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId"); + + b.HasIndex("DefinitionId"); + + b.ToTable("dungeon_learned_spells"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonLootTable", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DropChanceMultiplier") + .HasColumnType("float"); + + b.Property("GuaranteedDrop") + .HasColumnType("tinyint(1)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("MaxDrops") + .HasColumnType("int"); + + b.Property("MaxTier") + .HasColumnType("int"); + + b.Property("MinDrops") + .HasColumnType("int"); + + b.Property("MinTier") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.ToTable("dungeon_loot_tables"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonLootTableEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("DropChance") + .HasColumnType("float"); + + b.Property("DropChancePerTier") + .HasColumnType("float"); + + b.Property("Guaranteed") + .HasColumnType("tinyint(1)"); + + b.Property("ItemDefinitionId") + .HasColumnType("int"); + + b.Property("LootTableId") + .HasColumnType("int"); + + b.Property("MaxDropChance") + .HasColumnType("float"); + + b.Property("MaxQuantity") + .HasColumnType("int"); + + b.Property("MinQuantity") + .HasColumnType("int"); + + b.Property("Weight") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ItemDefinitionId"); + + b.HasIndex("LootTableId"); + + b.ToTable("dungeon_loot_table_entries"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonMobDefinition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AbilitiesJson") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("AggroRange") + .HasColumnType("float"); + + b.Property("AnimationSpeed") + .HasColumnType("float"); + + b.Property("ArmorPerTier") + .HasColumnType("float"); + + b.Property("AttackRange") + .HasColumnType("float"); + + b.Property("AttackSpeed") + .HasColumnType("float"); + + b.Property("BaseArmor") + .HasColumnType("int"); + + b.Property("BaseHealth") + .HasColumnType("int"); + + b.Property("BaseMagicDamage") + .HasColumnType("int"); + + b.Property("BaseMagicResist") + .HasColumnType("int"); + + b.Property("BaseMana") + .HasColumnType("int"); + + b.Property("BasePhysicalDamage") + .HasColumnType("int"); + + b.Property("BaseXp") + .HasColumnType("int"); + + b.Property("Category") + .HasColumnType("int"); + + b.Property("DamagePerTier") + .HasColumnType("float"); + + b.Property("DamageTypeKey") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DropChanceMultiplier") + .HasColumnType("float"); + + b.Property("HealthPerTier") + .HasColumnType("float"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("LeashRange") + .HasColumnType("float"); + + b.Property("LootTableId") + .HasColumnType("int"); + + b.Property("MaxTier") + .HasColumnType("int"); + + b.Property("MinTier") + .HasColumnType("int"); + + b.Property("MoveSpeed") + .HasColumnType("float"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ResistancesJson") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("Scale") + .HasColumnType("float"); + + b.Property("SpriteConfigJson") + .HasMaxLength(4096) + .HasColumnType("varchar(4096)"); + + b.Property("TintColor") + .IsRequired() + .HasMaxLength(16) + .HasColumnType("varchar(16)"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("XpPerTier") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.ToTable("dungeon_mob_definitions"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonMobLootTable", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("LootTableId") + .HasColumnType("int"); + + b.Property("MobDefinitionId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("RollChance") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("LootTableId"); + + b.HasIndex("MobDefinitionId"); + + b.ToTable("dungeon_mob_loot_tables"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonPersistence", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("BossKilled") + .HasColumnType("tinyint(1)"); + + b.Property("ChestStateJson") + .HasColumnType("json"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("CreatorCharacterId") + .HasColumnType("bigint unsigned"); + + b.Property("CreatorId") + .HasColumnType("bigint unsigned"); + + b.Property("CreatorLevel") + .HasColumnType("int"); + + b.Property("CreatorName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsCleared") + .HasColumnType("tinyint(1)"); + + b.Property("LastActivity") + .HasColumnType("datetime(6)"); + + b.Property("LevelBracketMax") + .HasColumnType("int"); + + b.Property("LevelBracketMin") + .HasColumnType("int"); + + b.Property("LootChestStateJson") + .HasColumnType("json"); + + b.Property("MobStateJson") + .HasColumnType("json"); + + b.Property("PersistedAt") + .HasColumnType("datetime(6)"); + + b.Property("Seed") + .HasColumnType("int"); + + b.Property("Tier") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CreatorId"); + + b.ToTable("dungeon_instances"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonRecipeScroll", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ItemDefinitionId") + .HasColumnType("int"); + + b.Property("RecipeId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ItemDefinitionId"); + + b.HasIndex("RecipeId"); + + b.ToTable("dungeon_recipe_scrolls"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonSpellDefinition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AreaOfEffect") + .HasColumnType("float"); + + b.Property("BaseDamage") + .HasColumnType("int"); + + b.Property("BaseHealing") + .HasColumnType("int"); + + b.Property("Cooldown") + .HasColumnType("float"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("EffectColor") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("IsShield") + .HasColumnType("tinyint(1)"); + + b.Property("IsTeleport") + .HasColumnType("tinyint(1)"); + + b.Property("ManaCost") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Range") + .HasColumnType("float"); + + b.Property("RequiredIntelligence") + .HasColumnType("int"); + + b.Property("RequiredLevel") + .HasColumnType("int"); + + b.Property("RequiredWisdom") + .HasColumnType("int"); + + b.Property("ShieldAmount") + .HasColumnType("int"); + + b.Property("SpriteId") + .HasColumnType("int"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("dungeon_spell_definitions"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonStashItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CharacterId") + .HasColumnType("bigint unsigned"); + + b.Property("DefinitionId") + .HasColumnType("int"); + + b.Property("ItemDefinitionId") + .HasColumnType("int"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("SlotIndex") + .HasColumnType("int"); + + b.Property("StoredAt") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId"); + + b.HasIndex("DefinitionId"); + + b.ToTable("dungeon_stash_items"); + }); + + modelBuilder.Entity("DataServer.Data.Session", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AccountId") + .HasColumnType("bigint unsigned"); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); + + b.Property("CreatedIp") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ExpiresAt") + .HasColumnType("datetime(6)"); + + b.Property("RevokedAt") + .HasColumnType("datetime(6)"); + + b.Property("TokenHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("UserAgent") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("AccountId"); + + b.HasIndex("TokenHash") + .IsUnique(); + + b.ToTable("sessions", (string)null); + }); + + modelBuilder.Entity("DataServer.Data.Zone", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); + + b.Property("MaxX") + .HasColumnType("double"); + + b.Property("MaxY") + .HasColumnType("double"); + + b.Property("MaxZ") + .HasColumnType("double"); + + b.Property("MinX") + .HasColumnType("double"); + + b.Property("MinY") + .HasColumnType("double"); + + b.Property("MinZ") + .HasColumnType("double"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UpdatedAt") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("datetime(6)") + .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); + + MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("zones", (string)null); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DeathChest", b => + { + b.HasOne("DataServer.Data.Entities.DungeonCharacter", "OwnerCharacter") + .WithMany() + .HasForeignKey("OwnerCharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonCharacter", "VictimCharacter") + .WithMany() + .HasForeignKey("VictimCharacterId"); + + b.Navigation("OwnerCharacter"); + + b.Navigation("VictimCharacter"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DeathChestItem", b => + { + b.HasOne("DataServer.Data.Entities.DeathChest", "DeathChest") + .WithMany("Items") + .HasForeignKey("DeathChestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonItemDefinition", "ItemDefinition") + .WithMany() + .HasForeignKey("ItemDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DeathChest"); + + b.Navigation("ItemDefinition"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonBeltItem", b => + { + b.HasOne("DataServer.Data.Entities.DungeonCharacter", "Character") + .WithMany() + .HasForeignKey("CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacter", b => + { + b.HasOne("DataServer.Data.Account", "Account") + .WithMany("Characters") + .HasForeignKey("AccountId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacterCraftingSkill", b => + { + b.HasOne("DataServer.Data.Entities.DungeonCharacter", "Character") + .WithMany("CraftingSkills") + .HasForeignKey("CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacterItem", b => + { + b.HasOne("DataServer.Data.Entities.DungeonCharacter", "Character") + .WithMany("Inventory") + .HasForeignKey("CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonItemDefinition", "ItemDefinition") + .WithMany() + .HasForeignKey("ItemDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + + b.Navigation("ItemDefinition"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacterItemCraftedLink", b => + { + b.HasOne("DataServer.Data.Entities.DungeonCharacterItem", "CharacterItem") + .WithMany() + .HasForeignKey("CharacterItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonCraftedItem", "CraftedItem") + .WithMany() + .HasForeignKey("CraftedItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CharacterItem"); + + b.Navigation("CraftedItem"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacterKnownRecipe", b => + { + b.HasOne("DataServer.Data.Entities.DungeonCharacter", "Character") + .WithMany("KnownRecipes") + .HasForeignKey("CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonCraftingRecipe", "Recipe") + .WithMany() + .HasForeignKey("RecipeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + + b.Navigation("Recipe"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCraftedItem", b => + { + b.HasOne("DataServer.Data.Entities.DungeonItemDefinition", "BaseItemDefinition") + .WithMany() + .HasForeignKey("BaseItemDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonCharacter", "Crafter") + .WithMany() + .HasForeignKey("CrafterId"); + + b.HasOne("DataServer.Data.Entities.DungeonCraftingRecipe", "Recipe") + .WithMany() + .HasForeignKey("RecipeId"); + + b.Navigation("BaseItemDefinition"); + + b.Navigation("Crafter"); + + b.Navigation("Recipe"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCraftingRecipe", b => + { + b.HasOne("DataServer.Data.Entities.DungeonItemDefinition", "OutputItem") + .WithMany() + .HasForeignKey("OutputItemDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OutputItem"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCraftingRecipeIngredient", b => + { + b.HasOne("DataServer.Data.Entities.DungeonItemDefinition", "ItemDefinition") + .WithMany() + .HasForeignKey("ItemDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonCraftingRecipe", "Recipe") + .WithMany("Ingredients") + .HasForeignKey("RecipeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ItemDefinition"); + + b.Navigation("Recipe"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonLearnedSpell", b => + { + b.HasOne("DataServer.Data.Entities.DungeonCharacter", "Character") + .WithMany("LearnedSpells") + .HasForeignKey("CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonSpellDefinition", "Definition") + .WithMany() + .HasForeignKey("DefinitionId"); + + b.Navigation("Character"); + + b.Navigation("Definition"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonLootTableEntry", b => + { + b.HasOne("DataServer.Data.Entities.DungeonItemDefinition", "ItemDefinition") + .WithMany() + .HasForeignKey("ItemDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonLootTable", "LootTable") + .WithMany("Entries") + .HasForeignKey("LootTableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ItemDefinition"); + + b.Navigation("LootTable"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonMobLootTable", b => + { + b.HasOne("DataServer.Data.Entities.DungeonLootTable", "LootTable") + .WithMany() + .HasForeignKey("LootTableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonMobDefinition", "MobDefinition") + .WithMany() + .HasForeignKey("MobDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LootTable"); + + b.Navigation("MobDefinition"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonPersistence", b => + { + b.HasOne("DataServer.Data.Entities.DungeonCharacter", "Creator") + .WithMany() + .HasForeignKey("CreatorId"); + + b.Navigation("Creator"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonRecipeScroll", b => + { + b.HasOne("DataServer.Data.Entities.DungeonItemDefinition", "ItemDefinition") + .WithMany() + .HasForeignKey("ItemDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonCraftingRecipe", "Recipe") + .WithMany() + .HasForeignKey("RecipeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ItemDefinition"); + + b.Navigation("Recipe"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonStashItem", b => + { + b.HasOne("DataServer.Data.Entities.DungeonCharacter", "Character") + .WithMany("Stash") + .HasForeignKey("CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonItemDefinition", "Definition") + .WithMany() + .HasForeignKey("DefinitionId"); + + b.Navigation("Character"); + + b.Navigation("Definition"); + }); + + modelBuilder.Entity("DataServer.Data.Session", b => + { + b.HasOne("DataServer.Data.Account", "Account") + .WithMany("Sessions") + .HasForeignKey("AccountId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("DataServer.Data.Account", b => + { + b.Navigation("Characters"); + + b.Navigation("Sessions"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DeathChest", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacter", b => + { + b.Navigation("CraftingSkills"); + + b.Navigation("Inventory"); + + b.Navigation("KnownRecipes"); + + b.Navigation("LearnedSpells"); + + b.Navigation("Stash"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonCraftingRecipe", b => + { + b.Navigation("Ingredients"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonLootTable", b => + { + b.Navigation("Entries"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Migrations/20251226212352_DamageTypeChanges.cs b/Migrations/20251226212352_DamageTypeChanges.cs new file mode 100644 index 0000000..899563a --- /dev/null +++ b/Migrations/20251226212352_DamageTypeChanges.cs @@ -0,0 +1,53 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace SystemRevivalServer.Migrations +{ + /// + public partial class DamageTypeChanges : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "DamageType", + table: "dungeon_item_definitions"); + + migrationBuilder.DropColumn( + name: "MagicResist", + table: "dungeon_item_definitions"); + + migrationBuilder.AddColumn( + name: "DamageTypeKey", + table: "dungeon_item_definitions", + type: "varchar(32)", + maxLength: 32, + nullable: false, + defaultValue: "") + .Annotation("MySql:CharSet", "utf8mb4"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "DamageTypeKey", + table: "dungeon_item_definitions"); + + migrationBuilder.AddColumn( + name: "DamageType", + table: "dungeon_item_definitions", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "MagicResist", + table: "dungeon_item_definitions", + type: "int", + nullable: false, + defaultValue: 0); + } + } +} diff --git a/Migrations/GameDbContextModelSnapshot.cs b/Migrations/GameDbContextModelSnapshot.cs index 019413d..c8fa246 100644 --- a/Migrations/GameDbContextModelSnapshot.cs +++ b/Migrations/GameDbContextModelSnapshot.cs @@ -745,8 +745,10 @@ namespace SystemRevivalServer.Migrations .HasMaxLength(1024) .HasColumnType("varchar(1024)"); - b.Property("DamageType") - .HasColumnType("int"); + b.Property("DamageTypeKey") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); b.Property("Description") .IsRequired() @@ -765,9 +767,6 @@ namespace SystemRevivalServer.Migrations b.Property("IsTeleportScroll") .HasColumnType("tinyint(1)"); - b.Property("MagicResist") - .HasColumnType("int"); - b.Property("ManaRestore") .HasColumnType("int"); @@ -1299,232 +1298,6 @@ namespace SystemRevivalServer.Migrations b.ToTable("dungeon_stash_items"); }); - modelBuilder.Entity("DataServer.Data.EquipmentSlot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("SlotCode") - .HasColumnType("tinyint unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotCode") - .IsUnique(); - - b.ToTable("equipment", (string)null); - }); - - modelBuilder.Entity("DataServer.Data.InventoryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("Quantity") - .HasColumnType("int unsigned"); - - b.Property("SlotIndex") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("CharacterId"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotIndex") - .IsUnique(); - - b.ToTable("inventories", (string)null); - }); - - modelBuilder.Entity("DataServer.Data.ItemTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemType") - .HasColumnType("tinyint unsigned"); - - b.Property("MaxStack") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("Rarity") - .HasColumnType("tinyint unsigned"); - - b.Property("StatsJson") - .HasColumnType("json"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Weight") - .HasColumnType("int unsigned"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("item_templates", (string)null); - }); - - modelBuilder.Entity("DataServer.Data.Old_Character", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("AppearanceJson") - .HasColumnType("json"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("FacingDeg") - .HasColumnType("float"); - - b.Property("HpCurrent") - .HasColumnType("int unsigned"); - - b.Property("HpMax") - .HasColumnType("int unsigned"); - - b.Property("Level") - .HasColumnType("int unsigned"); - - b.Property("MpCurrent") - .HasColumnType("int unsigned"); - - b.Property("MpMax") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.Property("PosX") - .HasColumnType("double"); - - b.Property("PosY") - .HasColumnType("double"); - - b.Property("PosZ") - .HasColumnType("double"); - - b.Property("StaminaCurrent") - .HasColumnType("int unsigned"); - - b.Property("StaminaMax") - .HasColumnType("int unsigned"); - - b.Property("StatDexterity") - .HasColumnType("int unsigned"); - - b.Property("StatEndurance") - .HasColumnType("int unsigned"); - - b.Property("StatIntelligence") - .HasColumnType("int unsigned"); - - b.Property("StatStrength") - .HasColumnType("int unsigned"); - - b.Property("StatWisdom") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Xp") - .HasColumnType("bigint unsigned"); - - b.Property("ZoneId") - .HasColumnType("bigint unsigned"); - - b.HasKey("Id"); - - b.HasIndex("AccountId") - .IsUnique(); - - b.HasIndex("ZoneId"); - - b.ToTable("characters", (string)null); - }); - modelBuilder.Entity("DataServer.Data.Session", b => { b.Property("Id") @@ -1671,7 +1444,7 @@ namespace SystemRevivalServer.Migrations modelBuilder.Entity("DataServer.Data.Entities.DungeonCharacter", b => { b.HasOne("DataServer.Data.Account", "Account") - .WithMany() + .WithMany("Characters") .HasForeignKey("AccountId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); @@ -1900,63 +1673,6 @@ namespace SystemRevivalServer.Migrations b.Navigation("Definition"); }); - modelBuilder.Entity("DataServer.Data.EquipmentSlot", b => - { - b.HasOne("DataServer.Data.Old_Character", "Old_Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("DataServer.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ItemTemplate"); - - b.Navigation("Old_Character"); - }); - - modelBuilder.Entity("DataServer.Data.InventoryItem", b => - { - b.HasOne("DataServer.Data.Old_Character", "Old_Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("DataServer.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ItemTemplate"); - - b.Navigation("Old_Character"); - }); - - modelBuilder.Entity("DataServer.Data.Old_Character", b => - { - b.HasOne("DataServer.Data.Account", "Account") - .WithMany("Characters") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("DataServer.Data.Zone", "Zone") - .WithMany() - .HasForeignKey("ZoneId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Account"); - - b.Navigation("Zone"); - }); - modelBuilder.Entity("DataServer.Data.Session", b => { b.HasOne("DataServer.Data.Account", "Account") diff --git a/Services/Admin/Pages/Items/Edit.cshtml b/Services/Admin/Pages/Items/Edit.cshtml index 93626cc..8f6ca7c 100644 --- a/Services/Admin/Pages/Items/Edit.cshtml +++ b/Services/Admin/Pages/Items/Edit.cshtml @@ -3,10 +3,12 @@ @using DataServer.Data.Enums @{ ViewData["Title"] = Model.IsNew ? "Create Item" : $"Edit: {Model.Item.Name}"; + var isEquipment = Model.Item.Type == ItemType.Weapon || Model.Item.Type == ItemType.Armor || Model.Item.Type == ItemType.Accessory; + var isWeapon = Model.Item.Type == ItemType.Weapon; + var isConsumable = Model.Item.Type == ItemType.Consumable; }
-
@@ -21,226 +23,94 @@ @if (!string.IsNullOrEmpty(Model.Message)) { -
- @Model.Message -
+
@Model.Message
} -
+ @Html.AntiForgeryToken()
-
-

Basic Information

-
+

Basic Information

-
- - -
- +
- + @foreach (var t in Enum.GetValues()) { }
- -
- - -
- -
- - -
- -
+
+
+
- -
- - -
+
+
- -
-
-
-

Stacking

-
-
-
- - -
-
-
- -
-
-

Visual

-
-
-
- - -
-
-
- -
- - - - -
-
-
- -
- - -
-
-
-
-
-
- - +
-
-

Requirements

-
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
+

Visual & Stacking

+
+
+
+
No image
+
+
- -
-
-

Stat Bonuses (When Equipped)

-
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
- - -
-
-

Combat Stats

-
+ +
+

Stat Requirements

-
- - -
-
- - -
-
- - -
-
+
+
+
+
+
+
+ + +
+

Stat Bonuses (When Equipped)

+
+
+
+
+
+
+
+
+
+
+ + +
+

Combat Stats

+
+
+
+
+
- + @foreach (var rt in Model.ResistanceTypes) { }
-
- - -
-
- - -
+
-
+
-
-
-

Consumable Effects

-
+
+

Consumable Effects

@@ -395,104 +188,47 @@ @section Scripts { } diff --git a/Services/Admin/Pages/Items/Edit.cshtml.cs b/Services/Admin/Pages/Items/Edit.cshtml.cs index c7bfdea..a725b37 100644 --- a/Services/Admin/Pages/Items/Edit.cshtml.cs +++ b/Services/Admin/Pages/Items/Edit.cshtml.cs @@ -133,9 +133,8 @@ public class EditModel : AdminPageModel MinDamage = Item.MinDamage, MaxDamage = Item.MaxDamage, AttackRange = Item.AttackRange, - DamageType = Item.DamageType, + DamageTypeKey = Item.DamageTypeKey, Armor = Item.Armor, - MagicResist = Item.MagicResist, HealAmount = Item.HealAmount, ManaRestore = Item.ManaRestore, StaminaRestore = Item.StaminaRestore, @@ -193,9 +192,8 @@ public class EditModel : AdminPageModel existing.MinDamage = Item.MinDamage; existing.MaxDamage = Item.MaxDamage; existing.AttackRange = Item.AttackRange; - existing.DamageType = Item.DamageType; + existing.DamageTypeKey = Item.DamageTypeKey; existing.Armor = Item.Armor; - existing.MagicResist = Item.MagicResist; existing.HealAmount = Item.HealAmount; existing.ManaRestore = Item.ManaRestore; existing.StaminaRestore = Item.StaminaRestore; diff --git a/Services/Admin/Pages/Players/_ItemTooltip.cshtml b/Services/Admin/Pages/Players/_ItemTooltip.cshtml index 284dccc..e14014d 100644 --- a/Services/Admin/Pages/Players/_ItemTooltip.cshtml +++ b/Services/Admin/Pages/Players/_ItemTooltip.cshtml @@ -38,7 +38,7 @@ {
@Model.MinDamage - @Model.MaxDamage - @Model.DamageType Damage + @Model.DamageTypeKey Damage @if (Model.AttackRange > 0) { Range: @Model.AttackRange @@ -47,17 +47,10 @@ } - @if (Model.Armor > 0 || Model.MagicResist > 0) + @if (Model.Armor > 0) {
- @if (Model.Armor > 0) - { -

Armor: @Model.Armor

- } - @if (Model.MagicResist > 0) - { -

Magic Resist: @Model.MagicResist

- } +

Armor: @Model.Armor

} diff --git a/data/entities/DungeonCharacterCombatStats.cs b/data/entities/DungeonCharacterCombatStats.cs index 1c72c5d..5f87570 100644 --- a/data/entities/DungeonCharacterCombatStats.cs +++ b/data/entities/DungeonCharacterCombatStats.cs @@ -13,7 +13,6 @@ public class DungeonCharacterCombatStats public int BonusHealth { get; set; } public int BonusMana { get; set; } public int Armor { get; set; } - public int MagicResist { get; set; } public float MoveSpeed { get; set; } public float AttackSpeed { get; set; } public float RegenRate { get; set; } diff --git a/data/entities/DungeonCharacterStats.cs b/data/entities/DungeonCharacterStats.cs index 8c101bd..f6a75f3 100644 --- a/data/entities/DungeonCharacterStats.cs +++ b/data/entities/DungeonCharacterStats.cs @@ -39,7 +39,6 @@ public static class DungeonCharacterStats stats.BonusHealth += item.BonusHealth; stats.BonusMana += item.BonusMana; stats.Armor += item.Armor; - stats.MagicResist += item.MagicResist; } } diff --git a/data/entities/DungeonItemDefinition.cs b/data/entities/DungeonItemDefinition.cs index e395761..58c9ef5 100644 --- a/data/entities/DungeonItemDefinition.cs +++ b/data/entities/DungeonItemDefinition.cs @@ -45,11 +45,16 @@ public class DungeonItemDefinition 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 + /// + /// Damage type key (references DamageResistanceType.Key) + /// e.g., "physical", "fire", "poison" + /// + [MaxLength(32)] + public string DamageTypeKey { get; set; } = "physical"; + + // Armor stats (flat damage reduction for all damage types) public int Armor { get; set; } = 0; - public int MagicResist { get; set; } = 0; // Consumable effects public int HealAmount { get; set; } = 0; diff --git a/data/entities/DungeonMobCombatStats.cs b/data/entities/DungeonMobCombatStats.cs index 887cd71..8f51d16 100644 --- a/data/entities/DungeonMobCombatStats.cs +++ b/data/entities/DungeonMobCombatStats.cs @@ -1,5 +1,3 @@ -using DataServer.Data.Enums; - namespace DataServer.Data.Entities; /// @@ -11,7 +9,6 @@ public class DungeonMobCombatStats public int PhysicalDamage { get; set; } public int MagicDamage { get; set; } public int Armor { get; set; } - public int MagicResist { get; set; } public float MoveSpeed { get; set; } public float AttackRange { get; set; } public float AttackSpeed { get; set; } @@ -21,33 +18,31 @@ public class DungeonMobCombatStats public Dictionary Resistances { get; set; } = new(); /// - /// Calculate damage after resistances + /// Primary damage type key (e.g., "physical", "fire", "poison") /// - public int CalculateDamage(int rawDamage, DamageType damageType) + public string DamageTypeKey { get; set; } = "physical"; + + /// + /// Calculate damage after armor and resistances + /// + public int CalculateDamage(int rawDamage, string damageTypeKey) { - string typeKey = damageType.ToString().ToLower(); + float damage = rawDamage; + + // Apply armor reduction (flat mitigation for all damage types) + if (Armor > 0) + { + float armorReduction = Armor / (float)(Armor + 100); + damage *= (1.0f - armorReduction); + } // Check for resistance/weakness - if (Resistances.TryGetValue(typeKey, out float resistance)) + if (Resistances.TryGetValue(damageTypeKey, out float resistance)) { if (resistance >= 1.0f) return 0; // Immune - return (int)(rawDamage * (1.0f - resistance)); + damage *= (1.0f - resistance); } - // Physical/Magic armor reduction - if (damageType == DamageType.Physical && Armor > 0) - { - // Armor formula: damage reduction = armor / (armor + 100) - float reduction = Armor / (float)(Armor + 100); - return (int)(rawDamage * (1.0f - reduction)); - } - - if (damageType != DamageType.Physical && MagicResist > 0) - { - float reduction = MagicResist / (float)(MagicResist + 100); - return (int)(rawDamage * (1.0f - reduction)); - } - - return rawDamage; + return Math.Max(1, (int)damage); } } diff --git a/data/entities/DungeonMobDefinition.cs b/data/entities/DungeonMobDefinition.cs index bc758eb..73e54a2 100644 --- a/data/entities/DungeonMobDefinition.cs +++ b/data/entities/DungeonMobDefinition.cs @@ -167,14 +167,14 @@ public class DungeonMobDefinition PhysicalDamage = (int)(BasePhysicalDamage * DamagePerTier * bracketMultiplier), MagicDamage = (int)(BaseMagicDamage * DamagePerTier * bracketMultiplier), Armor = (int)(BaseArmor * ArmorPerTier * bracketMultiplier), - MagicResist = (int)(BaseMagicResist * ArmorPerTier * bracketMultiplier), MoveSpeed = MoveSpeed, AttackRange = AttackRange, AttackSpeed = AttackSpeed, AggroRange = AggroRange, LeashRange = LeashRange, XpReward = (int)(BaseXp * XpPerTier * bracketMultiplier), - Resistances = Resistances + Resistances = Resistances, + DamageTypeKey = DamageTypeKey }; } }