diff --git a/Api/AdminController.cs b/Api/AdminController.cs
index 908d749..133a0c0 100644
--- a/Api/AdminController.cs
+++ b/Api/AdminController.cs
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using DataServer.Data;
+using DataServer.Data.Entities;
using Server.Services.Auth;
namespace Server.Api;
@@ -342,3 +343,37 @@ public class BootstrapRequest
public string Username { get; set; } = "";
public string BootstrapKey { get; set; } = "";
}
+
+///
+/// Get all resistance types for dropdowns
+///
+[ApiController]
+[Route("api/admin/resistances")]
+public class ResistanceTypesController : ControllerBase
+{
+ private readonly GameDbContext _db;
+
+ public ResistanceTypesController(GameDbContext db)
+ {
+ _db = db;
+ }
+
+ [HttpGet]
+ public async Task GetAll()
+ {
+ var types = await _db.DamageResistanceTypes
+ .Where(t => t.IsEnabled)
+ .OrderBy(t => t.SortOrder)
+ .Select(t => new { t.Key, t.DisplayName, t.Color })
+ .ToListAsync();
+ return Ok(types);
+ }
+
+ [HttpGet("check/{key}")]
+ public async Task CheckExists(string key)
+ {
+ var exists = await _db.DamageResistanceTypes
+ .AnyAsync(t => t.Key.ToLower() == key.ToLower() && t.IsEnabled);
+ return Ok(new { exists });
+ }
+}
diff --git a/Game/Dungeon/CombatCalculator.cs b/Game/Dungeon/CombatCalculator.cs
new file mode 100644
index 0000000..c9c9c6e
--- /dev/null
+++ b/Game/Dungeon/CombatCalculator.cs
@@ -0,0 +1,191 @@
+using DataServer.Data.Entities;
+using DataServer.Data.Enums;
+
+namespace Server.Game.Dungeon;
+
+///
+/// Handles damage calculations with stats, gear, and resistances
+///
+public static class CombatCalculator
+{
+ ///
+ /// Calculate damage dealt from player to mob
+ ///
+ public static DamageResult CalculatePlayerToMobDamage(
+ PlayerInstance player,
+ MobInstance mob,
+ DamageType damageType,
+ int baseDamage,
+ Dictionary? playerGearResistances = null)
+ {
+ // 1. Base damage modified by player stats
+ float damage = baseDamage;
+
+ // Physical damage scales with STR
+ if (damageType == DamageType.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);
+
+ // 3. Apply mob's elemental resistances
+ string resistKey = damageType.ToString().ToLower();
+ if (mob.Stats.Resistances.TryGetValue(resistKey, out float mobResist))
+ {
+ // 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
+ };
+ }
+ damage *= (1 - mobResist);
+ }
+
+ // 4. Ensure minimum damage of 1
+ int finalDamage = Math.Max(1, (int)damage);
+
+ return new DamageResult
+ {
+ FinalDamage = finalDamage,
+ WasResisted = mobResist > 0,
+ WasWeakness = mobResist < 0,
+ DamageType = damageType
+ };
+ }
+
+ ///
+ /// Calculate damage dealt from mob to player
+ ///
+ public static DamageResult CalculateMobToPlayerDamage(
+ MobInstance mob,
+ PlayerInstance player,
+ DamageType damageType,
+ 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);
+
+ // 2. Apply player's elemental resistances (from gear + innate)
+ string resistKey = damageType.ToString().ToLower();
+ float playerResist = 0f;
+ if (playerTotalResistances.TryGetValue(resistKey, out float resist))
+ {
+ playerResist = resist;
+ }
+
+ // Cap resistance at 75% to prevent immunity stacking
+ playerResist = Math.Min(playerResist, 0.75f);
+
+ if (playerResist != 0)
+ {
+ damage *= (1 - playerResist);
+ }
+
+ // 3. Endurance provides flat damage reduction
+ float enduranceReduction = player.Endurance * 0.5f; // 0.5 flat reduction per END
+ damage = Math.Max(1, damage - enduranceReduction);
+
+ int finalDamage = Math.Max(1, (int)damage);
+
+ return new DamageResult
+ {
+ FinalDamage = finalDamage,
+ WasResisted = playerResist > 0,
+ WasWeakness = playerResist < 0,
+ DamageType = damageType
+ };
+ }
+
+ ///
+ /// Calculate total resistances for a player from innate + gear
+ ///
+ public static Dictionary CalculatePlayerTotalResistances(
+ Dictionary innateResistances,
+ List equippedItems)
+ {
+ var total = new Dictionary(innateResistances);
+
+ foreach (var item in equippedItems)
+ {
+ foreach (var resist in item.Resistances)
+ {
+ if (total.ContainsKey(resist.Key))
+ total[resist.Key] += resist.Value;
+ else
+ total[resist.Key] = resist.Value;
+ }
+ }
+
+ return total;
+ }
+
+ ///
+ /// Calculate player weapon damage range
+ ///
+ public static (int min, int max, DamageType type) GetPlayerWeaponDamage(
+ PlayerInstance player,
+ DungeonItemDefinition? weapon)
+ {
+ if (weapon == null)
+ {
+ // 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 (weapon.MinDamage, weapon.MaxDamage, weapon.DamageType);
+ }
+}
+
+public class DamageResult
+{
+ public int FinalDamage { get; set; }
+ public bool WasResisted { get; set; }
+ public bool WasWeakness { get; set; }
+ public bool WasImmune { get; set; }
+ public bool WasCritical { get; set; }
+ public DamageType DamageType { get; set; }
+}
diff --git a/Game/Dungeon/DungeonSimulation.cs b/Game/Dungeon/DungeonSimulation.cs
index 8fb23e9..c6f5f54 100644
--- a/Game/Dungeon/DungeonSimulation.cs
+++ b/Game/Dungeon/DungeonSimulation.cs
@@ -273,8 +273,18 @@ public class DungeonSimulation
private void MobAttackPlayer(MobInstance mob, PlayerInstance player)
{
- int damage = mob.Stats.PhysicalDamage + mob.Stats.MagicDamage;
- player.Health -= damage;
+ // 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;
+
+ int baseDamage = mob.Stats.PhysicalDamage + mob.Stats.MagicDamage;
+
+ // Calculate damage with resistances
+ var result = CombatCalculator.CalculateMobToPlayerDamage(
+ mob, player, damageType, baseDamage, player.Resistances);
+
+ player.Health -= result.FinalDamage;
player.IsInCombat = true;
player.LastCombatTick = CurrentTick;
@@ -284,7 +294,9 @@ public class DungeonSimulation
SourceId = mob.Id,
TargetType = EntityType.Player,
TargetId = (int)player.CharacterId,
- Damage = damage
+ Damage = result.FinalDamage,
+ WasResisted = result.WasResisted,
+ WasWeakness = result.WasWeakness
});
if (player.Health <= 0)
@@ -347,10 +359,30 @@ public class DungeonSimulation
float dist = Distance(player.X, player.Y, mob.X, mob.Y);
if (dist > 60) return; // Out of range
- // Calculate damage
- int damage = (int)(10 * (1 + player.Strength * 0.05f));
+ // Base damage from stats (would be enhanced by equipped weapon in full implementation)
+ int baseDamage = 10 + (int)(player.Strength * 0.5f);
+ var damageType = DataServer.Data.Enums.DamageType.Physical;
- mob.Health -= damage;
+ // Calculate damage with mob resistances
+ var result = CombatCalculator.CalculatePlayerToMobDamage(
+ player, mob, damageType, baseDamage);
+
+ if (result.WasImmune)
+ {
+ // Mob is immune, still add event for client feedback
+ _pendingDamageEvents.Add(new DamageEvent
+ {
+ SourceType = EntityType.Player,
+ SourceId = (int)player.CharacterId,
+ TargetType = EntityType.Mob,
+ TargetId = mob.Id,
+ Damage = 0,
+ WasImmune = true
+ });
+ return;
+ }
+
+ mob.Health -= result.FinalDamage;
player.IsInCombat = true;
player.LastCombatTick = CurrentTick;
@@ -360,7 +392,9 @@ public class DungeonSimulation
SourceId = (int)player.CharacterId,
TargetType = EntityType.Mob,
TargetId = mob.Id,
- Damage = damage
+ Damage = result.FinalDamage,
+ WasResisted = result.WasResisted,
+ WasWeakness = result.WasWeakness
});
if (mob.Health <= 0)
diff --git a/Game/Dungeon/PlayerInstance.cs b/Game/Dungeon/PlayerInstance.cs
index e5f8b0c..f43738e 100644
--- a/Game/Dungeon/PlayerInstance.cs
+++ b/Game/Dungeon/PlayerInstance.cs
@@ -22,6 +22,18 @@ public class PlayerInstance
public float AttackSpeed { get; set; } = 1f;
public int Strength { get; set; }
public int Intelligence { get; set; }
+ public int Wisdom { get; set; }
+ public int Endurance { get; set; }
+ public int Dexterity { get; set; }
+
+ // Defensive stats (from gear)
+ public int Armor { get; set; }
+ public int MagicResist { get; set; }
+
+ ///
+ /// Combined resistances from innate + gear
+ ///
+ public Dictionary Resistances { get; set; } = new();
public bool IsAlive { get; set; } = true;
public bool IsInCombat { get; set; }
diff --git a/Game/Dungeon/TickResult.cs b/Game/Dungeon/TickResult.cs
index 5bec9e1..6ebd946 100644
--- a/Game/Dungeon/TickResult.cs
+++ b/Game/Dungeon/TickResult.cs
@@ -17,6 +17,21 @@ public class DamageEvent
public int TargetId { get; set; }
public int Damage { get; set; }
public DamageType DamageType { get; set; }
+
+ ///
+ /// True if damage was reduced by resistance
+ ///
+ public bool WasResisted { get; set; }
+
+ ///
+ /// True if damage was increased by weakness
+ ///
+ public bool WasWeakness { get; set; }
+
+ ///
+ /// True if target was immune (0 damage)
+ ///
+ public bool WasImmune { get; set; }
}
public class DeathEvent
diff --git a/Migrations/20251226153944_Resistance System + tweaks.Designer.cs b/Migrations/20251226153944_Resistance System + tweaks.Designer.cs
new file mode 100644
index 0000000..9fe178e
--- /dev/null
+++ b/Migrations/20251226153944_Resistance System + tweaks.Designer.cs
@@ -0,0 +1,1998 @@
+//
+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("20251226153944_Resistance System + tweaks")]
+ partial class ResistanceSystemtweaks
+ {
+ ///
+ 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("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