diff --git a/Game/Dungeon/MobAI.cs b/Game/Dungeon/MobAI.cs index 0bd3d93..7b216fa 100644 --- a/Game/Dungeon/MobAI.cs +++ b/Game/Dungeon/MobAI.cs @@ -8,6 +8,8 @@ namespace Server.Game.Dungeon; /// public static class MobAI { + private static readonly Random _rng = new(); + /// /// Main AI update - called each tick for each mob /// @@ -36,6 +38,7 @@ public static class MobAI ExecuteAbility(mob, mob.CastingAbility, sim); mob.CastingAbility = null; mob.State = MobState.Idle; + mob.StateTime = 0; } return; } @@ -55,14 +58,25 @@ public static class MobAI case MobBehavior.Skirmisher: UpdateSkirmisher(mob, sim, deltaTime); break; - case MobBehavior.Summoner: case MobBehavior.Tank: + UpdateTank(mob, sim, deltaTime); + break; case MobBehavior.Assassin: + UpdateAssassin(mob, sim, deltaTime); + break; case MobBehavior.Healer: + UpdateHealer(mob, sim, deltaTime); + break; case MobBehavior.Patrol: + UpdatePatrol(mob, sim, deltaTime); + break; case MobBehavior.Pack: - // For now, fall back to aggressive behavior - // TODO: Implement specialized behaviors + UpdatePack(mob, sim, deltaTime); + break; + case MobBehavior.Summoner: + UpdateSummoner(mob, sim, deltaTime); + break; + default: UpdateAggressive(mob, sim, deltaTime); break; } @@ -70,185 +84,631 @@ public static class MobAI #region Core Behaviors + /// + /// Aggressive: Charges player on sight, melee attacks. Wanders when idle. + /// private static void UpdateAggressive(MobInstance mob, DungeonSimulation sim, float deltaTime) { var target = FindNearestPlayer(mob, sim); if (target == null) { - ReturnToSpawn(mob, sim, deltaTime); + // No target - wander or return to spawn area + UpdateIdleWander(mob, sim, deltaTime); return; } float distance = GetDistance(mob.X, mob.Y, target.X, target.Y); + float distFromSpawn = GetDistance(mob.X, mob.Y, mob.SpawnX, mob.SpawnY); + + // Check leash range + if (distFromSpawn > mob.Stats.LeashRange) + { + ReturnToSpawn(mob, sim, deltaTime); + return; + } + mob.TargetId = target.CharacterId; mob.UpdateFacingDirection(target.X, target.Y); mob.CombatTime += deltaTime; - // Try to use abilities - var ability = SelectAbility(mob, distance); - if (ability != null && TryUseAbility(mob, ability, target, sim)) - { - return; - } - - // Chase and melee + // In attack range? if (distance <= mob.Stats.AttackRange) { mob.State = MobState.Attacking; mob.CurrentAnimation = mob.GetDirectionalAnimation("attack"); } - else if (distance <= mob.Stats.LeashRange) - { - mob.State = MobState.Chasing; - mob.CurrentAnimation = mob.GetDirectionalAnimation("walk"); - MoveToward(mob, target.X, target.Y, mob.Stats.MoveSpeed * mob.GetSpeedModifier() * deltaTime); - } else { - ReturnToSpawn(mob, sim, deltaTime); + // Chase + mob.State = MobState.Chasing; + mob.CurrentAnimation = mob.GetDirectionalAnimation("walk"); + MoveToward(mob, target.X, target.Y, mob.Stats.MoveSpeed * deltaTime, sim); } } + /// + /// Defensive: Only attacks if player comes close to spawn. Wanders near spawn. + /// private static void UpdateDefensive(MobInstance mob, DungeonSimulation sim, float deltaTime) { - float distFromSpawn = GetDistance(mob.X, mob.Y, mob.SpawnX, mob.SpawnY); var target = FindNearestPlayer(mob, sim); + float distFromSpawn = GetDistance(mob.X, mob.Y, mob.SpawnX, mob.SpawnY); if (target != null) { float targetDistFromSpawn = GetDistance(target.X, target.Y, mob.SpawnX, mob.SpawnY); float distance = GetDistance(mob.X, mob.Y, target.X, target.Y); - if (targetDistFromSpawn <= mob.Stats.AggroRange) + // Only fight if target is close to our spawn area + if (targetDistFromSpawn <= mob.Stats.AggroRange * 0.75f) { - mob.TargetId = target.CharacterId; - mob.UpdateFacingDirection(target.X, target.Y); - + // Don't stray too far from spawn if (distFromSpawn > mob.Stats.LeashRange * 0.5f) { ReturnToSpawn(mob, sim, deltaTime); return; } - var ability = SelectAbility(mob, distance); - if (ability != null && TryUseAbility(mob, ability, target, sim)) - { - return; - } + mob.TargetId = target.CharacterId; + mob.UpdateFacingDirection(target.X, target.Y); if (distance <= mob.Stats.AttackRange) { mob.State = MobState.Attacking; + mob.CurrentAnimation = mob.GetDirectionalAnimation("attack"); } else { mob.State = MobState.Chasing; - MoveToward(mob, target.X, target.Y, mob.Stats.MoveSpeed * 0.7f * deltaTime); + MoveToward(mob, target.X, target.Y, mob.Stats.MoveSpeed * 0.7f * deltaTime, sim); } - } - else - { - mob.TargetId = null; - ReturnToSpawn(mob, sim, deltaTime); + return; } } - else - { - ReturnToSpawn(mob, sim, deltaTime); - } + + // No threat - wander near spawn + mob.TargetId = null; + UpdateIdleWander(mob, sim, deltaTime, wanderRadius: 80f); } + /// + /// Ranged: Keeps distance, fires projectiles + /// private static void UpdateRanged(MobInstance mob, DungeonSimulation sim, float deltaTime) { var target = FindNearestPlayer(mob, sim); if (target == null) { - ReturnToSpawn(mob, sim, deltaTime); + UpdateIdleWander(mob, sim, deltaTime); return; } float distance = GetDistance(mob.X, mob.Y, target.X, target.Y); + float distFromSpawn = GetDistance(mob.X, mob.Y, mob.SpawnX, mob.SpawnY); + + if (distFromSpawn > mob.Stats.LeashRange) + { + ReturnToSpawn(mob, sim, deltaTime); + return; + } + mob.TargetId = target.CharacterId; mob.UpdateFacingDirection(target.X, target.Y); mob.CombatTime += deltaTime; - var ability = SelectAbility(mob, distance, preferRanged: true); - if (ability != null && TryUseAbility(mob, ability, target, sim)) - { - return; - } - // Maintain preferred range - if (distance < mob.PreferredRange * 0.6f) + float preferredRange = mob.PreferredRange > 0 ? mob.PreferredRange : 120f; + + if (distance < preferredRange * 0.5f) { + // Too close, back up mob.State = MobState.Kiting; - MoveAwayFrom(mob, target.X, target.Y, mob.Stats.MoveSpeed * deltaTime); + mob.CurrentAnimation = mob.GetDirectionalAnimation("walk"); + MoveAwayFrom(mob, target.X, target.Y, mob.Stats.MoveSpeed * deltaTime, sim); } - else if (distance > mob.PreferredRange * 1.2f && distance <= mob.Stats.LeashRange) + else if (distance > preferredRange * 1.3f && distance <= mob.Stats.LeashRange) { + // Too far, move closer mob.State = MobState.Chasing; - MoveToward(mob, target.X, target.Y, mob.Stats.MoveSpeed * deltaTime); - } - else if (distance > mob.Stats.LeashRange) - { - ReturnToSpawn(mob, sim, deltaTime); + mob.CurrentAnimation = mob.GetDirectionalAnimation("walk"); + MoveToward(mob, target.X, target.Y, mob.Stats.MoveSpeed * deltaTime, sim); } else { + // Good range, attack mob.State = MobState.Attacking; + mob.CurrentAnimation = mob.GetDirectionalAnimation("attack"); } } + /// + /// Skirmisher: Hit-and-run tactics + /// private static void UpdateSkirmisher(MobInstance mob, DungeonSimulation sim, float deltaTime) { var target = FindNearestPlayer(mob, sim); if (target == null) { - ReturnToSpawn(mob, sim, deltaTime); + UpdateIdleWander(mob, sim, deltaTime); return; } float distance = GetDistance(mob.X, mob.Y, target.X, target.Y); - mob.TargetId = target.CharacterId; - mob.UpdateFacingDirection(target.X, target.Y); + float distFromSpawn = GetDistance(mob.X, mob.Y, mob.SpawnX, mob.SpawnY); - if (mob.HpPercent <= mob.FleeThreshold && mob.FleeThreshold > 0) + // Check flee threshold + if (mob.FleeThreshold > 0 && mob.HpPercent <= mob.FleeThreshold) { mob.State = MobState.Fleeing; - MoveAwayFrom(mob, target.X, target.Y, mob.Stats.MoveSpeed * 1.2f * deltaTime); + mob.CurrentAnimation = mob.GetDirectionalAnimation("walk"); + MoveAwayFrom(mob, target.X, target.Y, mob.Stats.MoveSpeed * 1.3f * deltaTime, sim); return; } - // Attack then retreat pattern - if (mob.State == MobState.Attacking && mob.StateTime < 2.0f) + if (distFromSpawn > mob.Stats.LeashRange) { - var ability = SelectAbility(mob, distance); - if (ability != null && TryUseAbility(mob, ability, target, sim)) - { - return; - } - + ReturnToSpawn(mob, sim, deltaTime); + return; + } + + mob.TargetId = target.CharacterId; + mob.UpdateFacingDirection(target.X, target.Y); + + // Cycle between attack (2s) and retreat (2s) + float cycleTime = mob.StateTime % 4f; + + if (cycleTime < 2f) + { + // Attack phase if (distance <= mob.Stats.AttackRange) { + mob.State = MobState.Attacking; mob.CurrentAnimation = mob.GetDirectionalAnimation("attack"); } else { - MoveToward(mob, target.X, target.Y, mob.Stats.MoveSpeed * deltaTime); + mob.State = MobState.Chasing; + MoveToward(mob, target.X, target.Y, mob.Stats.MoveSpeed * 1.2f * deltaTime, sim); } } - else if (mob.StateTime < 4.0f) - { - mob.State = MobState.Kiting; - MoveAwayFrom(mob, target.X, target.Y, mob.Stats.MoveSpeed * deltaTime); - } else { - mob.StateTime = 0; + // Retreat phase + mob.State = MobState.Kiting; + mob.CurrentAnimation = mob.GetDirectionalAnimation("walk"); + MoveAwayFrom(mob, target.X, target.Y, mob.Stats.MoveSpeed * deltaTime, sim); + } + } + + /// + /// Tank: Slow but tough, always moves toward target + /// + private static void UpdateTank(MobInstance mob, DungeonSimulation sim, float deltaTime) + { + var target = FindNearestPlayer(mob, sim); + + if (target == null) + { + UpdateIdleWander(mob, sim, deltaTime, wanderRadius: 50f); + return; + } + + float distance = GetDistance(mob.X, mob.Y, target.X, target.Y); + float distFromSpawn = GetDistance(mob.X, mob.Y, mob.SpawnX, mob.SpawnY); + + if (distFromSpawn > mob.Stats.LeashRange) + { + ReturnToSpawn(mob, sim, deltaTime); + return; + } + + mob.TargetId = target.CharacterId; + mob.UpdateFacingDirection(target.X, target.Y); + + if (distance <= mob.Stats.AttackRange) + { mob.State = MobState.Attacking; + mob.CurrentAnimation = mob.GetDirectionalAnimation("attack"); + } + else + { + mob.State = MobState.Chasing; + mob.CurrentAnimation = mob.GetDirectionalAnimation("walk"); + // Tanks move at 60% speed + MoveToward(mob, target.X, target.Y, mob.Stats.MoveSpeed * 0.6f * deltaTime, sim); + } + } + + /// + /// Assassin: Targets lowest HP player, moves fast + /// + private static void UpdateAssassin(MobInstance mob, DungeonSimulation sim, float deltaTime) + { + // Target lowest HP player + var target = sim.Players.Values + .Where(p => p.IsAlive) + .Where(p => GetDistance(mob.X, mob.Y, p.X, p.Y) <= mob.Stats.AggroRange) + .OrderBy(p => p.Health / p.MaxHealth) + .FirstOrDefault(); + + if (target == null) + { + UpdateIdleWander(mob, sim, deltaTime); + return; + } + + float distance = GetDistance(mob.X, mob.Y, target.X, target.Y); + float distFromSpawn = GetDistance(mob.X, mob.Y, mob.SpawnX, mob.SpawnY); + + if (distFromSpawn > mob.Stats.LeashRange) + { + ReturnToSpawn(mob, sim, deltaTime); + return; + } + + mob.TargetId = target.CharacterId; + mob.UpdateFacingDirection(target.X, target.Y); + + if (distance <= mob.Stats.AttackRange) + { + mob.State = MobState.Attacking; + mob.CurrentAnimation = mob.GetDirectionalAnimation("attack"); + } + else + { + mob.State = MobState.Chasing; + mob.CurrentAnimation = mob.GetDirectionalAnimation("walk"); + // Assassins move at 130% speed + MoveToward(mob, target.X, target.Y, mob.Stats.MoveSpeed * 1.3f * deltaTime, sim); + } + } + + /// + /// Healer: Heals nearby mobs, stays back from combat + /// + private static void UpdateHealer(MobInstance mob, DungeonSimulation sim, float deltaTime) + { + // Check for injured allies first + var injuredAlly = sim.Mobs.Values + .Where(m => m.IsAlive && m.Id != mob.Id) + .Where(m => GetDistance(mob.X, mob.Y, m.X, m.Y) <= 150f) + .Where(m => m.HpPercent < 0.7f) + .OrderBy(m => m.HpPercent) + .FirstOrDefault(); + + if (injuredAlly != null) + { + // Try to heal + var healAbility = mob.Abilities + .Where(a => a.Definition.AbilityType == MobAbilityType.HealAlly || + a.Definition.AbilityType == MobAbilityType.HealAoe) + .Where(a => a.IsAvailable(mob.HpPercent)) + .FirstOrDefault(); + + if (healAbility != null) + { + mob.State = MobState.Healing; + mob.UpdateFacingDirection(injuredAlly.X, injuredAlly.Y); + mob.CurrentAnimation = mob.GetDirectionalAnimation("cast"); + return; + } + } + + // Otherwise, stay back from combat + var target = FindNearestPlayer(mob, sim); + if (target != null) + { + float distance = GetDistance(mob.X, mob.Y, target.X, target.Y); + float preferredRange = mob.PreferredRange > 0 ? mob.PreferredRange : 150f; + + if (distance < preferredRange) + { + mob.State = MobState.Kiting; + MoveAwayFrom(mob, target.X, target.Y, mob.Stats.MoveSpeed * deltaTime, sim); + } + else if (distance <= mob.Stats.AttackRange) + { + mob.State = MobState.Attacking; + } + } + else + { + UpdateIdleWander(mob, sim, deltaTime); + } + } + + /// + /// Patrol: Walks a path, alerts others when seeing players + /// + private static void UpdatePatrol(MobInstance mob, DungeonSimulation sim, float deltaTime) + { + var target = FindNearestPlayer(mob, sim); + + if (target != null) + { + // Alert nearby mobs + if (!mob.HasCalledForHelp) + { + CallForHelp(mob, sim); + } + + // Then fight like aggressive + UpdateAggressive(mob, sim, deltaTime); + } + else + { + mob.HasCalledForHelp = false; + + // Patrol - wander in a larger area + UpdateIdleWander(mob, sim, deltaTime, wanderRadius: 150f); + } + } + + /// + /// Pack: Calls nearby mobs when engaged + /// + private static void UpdatePack(MobInstance mob, DungeonSimulation sim, float deltaTime) + { + var target = FindNearestPlayer(mob, sim); + + if (target != null) + { + if (!mob.HasCalledForHelp) + { + CallForHelp(mob, sim); + } + UpdateAggressive(mob, sim, deltaTime); + } + else + { + mob.HasCalledForHelp = false; + UpdateIdleWander(mob, sim, deltaTime); + } + } + + /// + /// Summoner: Stays back and summons minions + /// + private static void UpdateSummoner(MobInstance mob, DungeonSimulation sim, float deltaTime) + { + var target = FindNearestPlayer(mob, sim); + + if (target == null) + { + UpdateIdleWander(mob, sim, deltaTime); + return; + } + + float distance = GetDistance(mob.X, mob.Y, target.X, target.Y); + float preferredRange = mob.PreferredRange > 0 ? mob.PreferredRange : 200f; + + mob.TargetId = target.CharacterId; + mob.UpdateFacingDirection(target.X, target.Y); + + // Stay back + if (distance < preferredRange * 0.5f) + { + mob.State = MobState.Kiting; + MoveAwayFrom(mob, target.X, target.Y, mob.Stats.MoveSpeed * deltaTime, sim); + } + else + { + mob.State = MobState.Summoning; + mob.CurrentAnimation = mob.GetDirectionalAnimation("cast"); + } + } + + #endregion + + #region Idle & Wander + + /// + /// Wander around spawn area when no targets + /// + private static void UpdateIdleWander(MobInstance mob, DungeonSimulation sim, float deltaTime, float wanderRadius = 100f) + { + float distFromSpawn = GetDistance(mob.X, mob.Y, mob.SpawnX, mob.SpawnY); + + // Too far from spawn? Return first + if (distFromSpawn > wanderRadius) + { + ReturnToSpawn(mob, sim, deltaTime); + return; + } + + // Heal when idle + if (mob.Health < mob.MaxHealth) + { + mob.Health = Math.Min(mob.MaxHealth, mob.Health + (int)(mob.MaxHealth * 0.02f * deltaTime)); + } + + // Check if we need a new wander target + if (mob.State != MobState.Idle || mob.StateTime > 3f || + (mob.WanderTargetX == 0 && mob.WanderTargetY == 0)) + { + // Pick a new random wander point near spawn + float angle = (float)(_rng.NextDouble() * Math.PI * 2); + float dist = (float)(_rng.NextDouble() * wanderRadius * 0.7f); + + mob.WanderTargetX = mob.SpawnX + MathF.Cos(angle) * dist; + mob.WanderTargetY = mob.SpawnY + MathF.Sin(angle) * dist; + mob.StateTime = 0; + + // Sometimes just idle for a bit + if (_rng.NextDouble() < 0.3f) + { + mob.State = MobState.Idle; + mob.CurrentAnimation = mob.GetDirectionalAnimation("idle"); + return; + } + } + + // Move toward wander target + float distToTarget = GetDistance(mob.X, mob.Y, mob.WanderTargetX, mob.WanderTargetY); + + if (distToTarget < 10f) + { + // Reached target, idle for a bit + mob.State = MobState.Idle; + mob.CurrentAnimation = mob.GetDirectionalAnimation("idle"); + mob.StateTime = 0; + } + else + { + mob.State = MobState.Idle; // Still "idle" but moving + mob.UpdateFacingDirection(mob.WanderTargetX, mob.WanderTargetY); + mob.CurrentAnimation = mob.GetDirectionalAnimation("walk"); + // Wander slowly + MoveToward(mob, mob.WanderTargetX, mob.WanderTargetY, mob.Stats.MoveSpeed * 0.3f * deltaTime, sim); + } + } + + private static void ReturnToSpawn(MobInstance mob, DungeonSimulation sim, float deltaTime) + { + float dist = GetDistance(mob.X, mob.Y, mob.SpawnX, mob.SpawnY); + + if (dist < 20f) + { + mob.State = MobState.Idle; + mob.TargetId = null; + mob.CombatTime = 0; + mob.StateTime = 0; + mob.CurrentAnimation = mob.GetDirectionalAnimation("idle"); + } + else + { + mob.State = MobState.Returning; + mob.TargetId = null; + mob.UpdateFacingDirection(mob.SpawnX, mob.SpawnY); + mob.CurrentAnimation = mob.GetDirectionalAnimation("walk"); + MoveToward(mob, mob.SpawnX, mob.SpawnY, mob.Stats.MoveSpeed * deltaTime, sim); + + // Heal while returning + if (mob.Health < mob.MaxHealth) + { + mob.Health = Math.Min(mob.MaxHealth, mob.Health + (int)(mob.MaxHealth * 0.05f * deltaTime)); + } + } + } + + private static void CallForHelp(MobInstance mob, DungeonSimulation sim) + { + mob.HasCalledForHelp = true; + float helpRadius = mob.Stats.AggroRange * 1.5f; + + foreach (var ally in sim.Mobs.Values.Where(m => m.IsAlive && m.Id != mob.Id)) + { + if (GetDistance(mob.X, mob.Y, ally.X, ally.Y) <= helpRadius) + { + // Alert ally to our target + if (mob.TargetId.HasValue && ally.TargetId == null) + { + ally.TargetId = mob.TargetId; + ally.State = MobState.Chasing; + } + } + } + } + + #endregion + + #region Movement with Collision + + private static void MoveToward(MobInstance mob, float targetX, float targetY, float speed, DungeonSimulation sim) + { + if (mob.IsRooted) return; + + float dx = targetX - mob.X; + float dy = targetY - mob.Y; + float dist = MathF.Sqrt(dx * dx + dy * dy); + + if (dist < 1f) return; + + float moveX = (dx / dist) * speed; + float moveY = (dy / dist) * speed; + + float newX = mob.X + moveX; + float newY = mob.Y + moveY; + + // Check collision for each axis separately + if (sim.CanMoveTo(newX, mob.Y)) + { + mob.X = newX; + } + else + { + // Try sliding along wall + mob.StuckTime += 0.05f; + } + + if (sim.CanMoveTo(mob.X, newY)) + { + mob.Y = newY; + } + else + { + mob.StuckTime += 0.05f; + } + + // If stuck for too long, try to unstick + if (mob.StuckTime > 1f) + { + TryUnstick(mob, sim); + mob.StuckTime = 0; + } + } + + private static void MoveAwayFrom(MobInstance mob, float targetX, float targetY, float speed, DungeonSimulation sim) + { + if (mob.IsRooted) return; + + float dx = mob.X - targetX; + float dy = mob.Y - targetY; + float dist = MathF.Sqrt(dx * dx + dy * dy); + + if (dist < 1f) return; + + float moveX = (dx / dist) * speed; + float moveY = (dy / dist) * speed; + + float newX = mob.X + moveX; + float newY = mob.Y + moveY; + + if (sim.CanMoveTo(newX, mob.Y)) + { + mob.X = newX; + } + + if (sim.CanMoveTo(mob.X, newY)) + { + mob.Y = newY; + } + } + + private static void TryUnstick(MobInstance mob, DungeonSimulation sim) + { + // Try moving in cardinal directions to get unstuck + float[] offsets = { 16, -16 }; + + foreach (float ox in offsets) + { + if (sim.CanMoveTo(mob.X + ox, mob.Y)) + { + mob.X += ox * 0.5f; + return; + } + } + + foreach (float oy in offsets) + { + if (sim.CanMoveTo(mob.X, mob.Y + oy)) + { + mob.Y += oy * 0.5f; + return; + } } } @@ -256,71 +716,11 @@ public static class MobAI #region Ability System - private static MobAbilityState? SelectAbility(MobInstance mob, float distance, bool preferRanged = false) - { - var available = mob.Abilities - .Where(a => a.IsAvailable(mob.HpPercent)) - .Where(a => a.Phase == 0 || a.Phase == mob.CurrentPhase) - .Where(a => a.Definition.Range >= distance || a.Definition.Range == 0) - .ToList(); - - if (preferRanged) - { - available = available - .Where(a => a.Definition.AbilityType == MobAbilityType.ProjectileSingle || - a.Definition.AbilityType == MobAbilityType.ProjectileAoe) - .ToList(); - } - - if (available.Count == 0) return null; - - // Weight by priority - var weighted = available.OrderByDescending(a => a.Priority).ToList(); - - // Add some randomness - if (weighted.Count > 1 && Random.Shared.NextDouble() < 0.3) - { - return weighted[Random.Shared.Next(weighted.Count)]; - } - - return weighted.FirstOrDefault(); - } - - private static bool TryUseAbility(MobInstance mob, MobAbilityState ability, PlayerInstance target, DungeonSimulation sim) - { - if (!ability.IsAvailable(mob.HpPercent)) return false; - if (mob.IsSilenced && ability.Definition.CastTime > 0) return false; - - float distance = GetDistance(mob.X, mob.Y, target.X, target.Y); - if (ability.Definition.Range > 0 && distance > ability.Definition.Range) return false; - - // Check mana cost - if (ability.Definition.ManaCost > mob.Mana) return false; - - // Start casting - if (ability.Definition.CastTime > 0) - { - mob.CastingAbility = ability; - mob.CastTimeRemaining = ability.Definition.CastTime; - mob.State = MobState.Casting; - mob.CurrentAnimation = mob.GetDirectionalAnimation(ability.Definition.AnimationKey); - return true; - } - - // Instant ability - ExecuteAbility(mob, ability, sim); - return true; - } - private static void ExecuteAbility(MobInstance mob, MobAbilityState ability, DungeonSimulation sim) { ability.CooldownRemaining = ability.Definition.Cooldown; mob.Mana -= ability.Definition.ManaCost; mob.CurrentAnimation = mob.GetDirectionalAnimation(ability.Definition.AnimationKey); - - // TODO: Queue the ability effect for the simulation to process - // For now, abilities are tracked but effects need to be wired up in DungeonSimulation - // The simulation will need to check mob.CastingAbility and process effects there } #endregion @@ -344,7 +744,6 @@ public static class MobAI { effect.Duration -= deltaTime; - // Handle DOT if (effect.DamagePerTick > 0) { effect.NextTickIn -= deltaTime; @@ -396,61 +795,6 @@ public static class MobAI .FirstOrDefault(); } - private static void ReturnToSpawn(MobInstance mob, DungeonSimulation sim, float deltaTime) - { - float dist = GetDistance(mob.X, mob.Y, mob.SpawnX, mob.SpawnY); - if (dist < 10f) - { - mob.State = MobState.Idle; - mob.TargetId = null; - mob.CombatTime = 0; - mob.CurrentAnimation = mob.GetDirectionalAnimation("idle"); - - // Heal when returning - if (mob.Health < mob.MaxHealth) - { - mob.Health = Math.Min(mob.MaxHealth, mob.Health + (int)(mob.MaxHealth * 0.1f * deltaTime)); - } - } - else - { - mob.State = MobState.Returning; - mob.UpdateFacingDirection(mob.SpawnX, mob.SpawnY); - mob.CurrentAnimation = mob.GetDirectionalAnimation("walk"); - MoveToward(mob, mob.SpawnX, mob.SpawnY, mob.Stats.MoveSpeed * deltaTime); - } - } - - private static void MoveToward(MobInstance mob, float targetX, float targetY, float speed) - { - if (mob.IsRooted) return; - - float dx = targetX - mob.X; - float dy = targetY - mob.Y; - float dist = MathF.Sqrt(dx * dx + dy * dy); - - if (dist > 0) - { - mob.X += (dx / dist) * speed; - mob.Y += (dy / dist) * speed; - } - } - - private static void MoveAwayFrom(MobInstance mob, float targetX, float targetY, float speed) - { - if (mob.IsRooted) return; - - float dx = mob.X - targetX; - float dy = mob.Y - targetY; - float dist = MathF.Sqrt(dx * dx + dy * dy); - - if (dist > 0) - { - mob.X += (dx / dist) * speed; - mob.Y += (dy / dist) * speed; - } - } - private static float GetDistance(float x1, float y1, float x2, float y2) { float dx = x2 - x1; diff --git a/Game/Dungeon/MobInstance.cs b/Game/Dungeon/MobInstance.cs index 4b4dab8..341f0a3 100644 --- a/Game/Dungeon/MobInstance.cs +++ b/Game/Dungeon/MobInstance.cs @@ -131,6 +131,12 @@ public class MobInstance /// Has already called for help this combat public bool HasCalledForHelp { get; set; } + /// Wander target X when idle + public float WanderTargetX { get; set; } + + /// Wander target Y when idle + public float WanderTargetY { get; set; } + /// Patrol waypoints (for Patrol behavior) public List<(float X, float Y)>? PatrolPath { get; set; } diff --git a/Migrations/20251227165535_MobAiv2P3.Designer.cs b/Migrations/20251227165535_MobAiv2P3.Designer.cs new file mode 100644 index 0000000..1d00155 --- /dev/null +++ b/Migrations/20251227165535_MobAiv2P3.Designer.cs @@ -0,0 +1,1941 @@ +// +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("20251227165535_MobAiv2P3")] + partial class MobAiv2P3 + { + /// + 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("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("Behavior") + .HasColumnType("int"); + + b.Property("CallForHelpRadius") + .HasColumnType("float"); + + 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("FleeThreshold") + .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("PhasesJson") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("PreferredRange") + .HasColumnType("float"); + + b.Property("ResistancesJson") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("Scale") + .HasColumnType("float"); + + b.Property("SpriteConfigJson") + .HasMaxLength(8192) + .HasColumnType("varchar(8192)"); + + 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.Entities.MobAbilityAssignment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AbilityDefinitionId") + .HasColumnType("int"); + + b.Property("CooldownOverride") + .HasColumnType("float"); + + b.Property("DamageOverride") + .HasColumnType("int"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("MaxHpPercent") + .HasColumnType("float"); + + b.Property("MinHpPercent") + .HasColumnType("float"); + + b.Property("MobDefinitionId") + .HasColumnType("int"); + + b.Property("Phase") + .HasColumnType("int"); + + b.Property("PriorityOverride") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AbilityDefinitionId"); + + b.HasIndex("MobDefinitionId"); + + b.ToTable("dungeon_mob_ability_assignments"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.MobAbilityDefinition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AbilityType") + .HasColumnType("int"); + + b.Property("AffectedStat") + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("AnimationDuration") + .HasColumnType("float"); + + b.Property("AnimationKey") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("AoeRadius") + .HasColumnType("float"); + + b.Property("BaseDamage") + .HasColumnType("int"); + + b.Property("CastTime") + .HasColumnType("float"); + + b.Property("ConeAngle") + .HasColumnType("float"); + + b.Property("Cooldown") + .HasColumnType("float"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + 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("DisplacementDistance") + .HasColumnType("float"); + + b.Property("DotDamagePerTick") + .HasColumnType("int"); + + b.Property("DotTickInterval") + .HasColumnType("float"); + + b.Property("EffectDuration") + .HasColumnType("float"); + + b.Property("HpThresholdAbove") + .HasColumnType("float"); + + b.Property("HpThresholdBelow") + .HasColumnType("float"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ManaCost") + .HasColumnType("int"); + + b.Property("MinTargetsInRange") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("ProjectileSpeed") + .HasColumnType("float"); + + b.Property("ProjectileSprite") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Range") + .HasColumnType("float"); + + b.Property("SoundEffectKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("SpeedModifier") + .HasColumnType("float"); + + b.Property("StatModifier") + .HasColumnType("float"); + + b.Property("SummonCount") + .HasColumnType("int"); + + b.Property("SummonMobId") + .HasColumnType("int"); + + b.Property("Targeting") + .HasColumnType("int"); + + b.Property("UpdatedAt") + .HasColumnType("datetime(6)"); + + b.Property("VisualEffectKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.ToTable("dungeon_mob_abilities"); + }); + + 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.Entities.MobAbilityAssignment", b => + { + b.HasOne("DataServer.Data.Entities.MobAbilityDefinition", "AbilityDefinition") + .WithMany() + .HasForeignKey("AbilityDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DataServer.Data.Entities.DungeonMobDefinition", "MobDefinition") + .WithMany("AbilityAssignments") + .HasForeignKey("MobDefinitionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AbilityDefinition"); + + b.Navigation("MobDefinition"); + }); + + 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"); + }); + + modelBuilder.Entity("DataServer.Data.Entities.DungeonMobDefinition", b => + { + b.Navigation("AbilityAssignments"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Migrations/20251227165535_MobAiv2P3.cs b/Migrations/20251227165535_MobAiv2P3.cs new file mode 100644 index 0000000..6526cd8 --- /dev/null +++ b/Migrations/20251227165535_MobAiv2P3.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace SystemRevivalServer.Migrations +{ + /// + public partial class MobAiv2P3 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/Services/Admin/Pages/Abilities/Edit.cshtml b/Services/Admin/Pages/Abilities/Edit.cshtml new file mode 100644 index 0000000..4bb50a0 --- /dev/null +++ b/Services/Admin/Pages/Abilities/Edit.cshtml @@ -0,0 +1,285 @@ +@page "/admin/abilities/edit" +@model Abilities.EditModel +@using DataServer.Data.Enums +@{ + ViewData["Title"] = Model.Ability.Id > 0 ? $"Edit: {Model.Ability.Name}" : "New Ability"; +} + +
+
+
+ ← Back to Abilities +

@ViewData["Title"]

+ @if (Model.AssignmentCount > 0) + { +

Assigned to @Model.AssignmentCount mob(s)

+ } +
+ @if (Model.Ability.Id > 0) + { +
+ @Html.AntiForgeryToken() + + +
+ } +
+ + @if (!string.IsNullOrEmpty(Model.Message)) + { +
+ @Model.Message +
+ } + +
+ @Html.AntiForgeryToken() + + + + +
+

Basic Info

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

Damage / Healing

+
+
+ + +

Negative = healing

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

Range & Area

+
+
+ + +

0 = self only

+
+
+ + +

0 = single target

+
+
+ + +

Degrees, 0 = not cone

+
+
+ + +

Knockback/pull

+
+
+
+ + +
+

Timing

+
+
+ + +
+
+ + +

0 = instant

+
+
+ + +
+
+
+ + +
+

Projectile (if applicable)

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

Status Effects (DOT, CC)

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

0.5 = 50% slow

+
+
+
+ + +
+

Summoning

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

Conditions

+
+
+ + +

Only use when HP below

+
+
+ + +

Only use when HP above

+
+
+ + +
+
+
+ + +
+

Animation & Effects

+
+
+ + +

attack, cast, special, etc.

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

Buff / Debuff

+
+
+ + +

1.5 = +50%, 0.5 = -50%

+
+
+ + +
+
+
+ + +
+ + Cancel +
+
+
diff --git a/Services/Admin/Pages/Abilities/Edit.cshtml.cs b/Services/Admin/Pages/Abilities/Edit.cshtml.cs new file mode 100644 index 0000000..cc870d6 --- /dev/null +++ b/Services/Admin/Pages/Abilities/Edit.cshtml.cs @@ -0,0 +1,172 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using DataServer.Data; +using DataServer.Data.Entities; +using DataServer.Data.Enums; + +namespace Server.Services.Admin.Pages.Abilities; + +public class EditModel : AdminPageModel +{ + private readonly GameDbContext _db; + + public EditModel(GameDbContext db) + { + _db = db; + } + + [BindProperty] + public MobAbilityDefinition Ability { get; set; } = new(); + + public List DamageTypes { get; set; } = new(); + public List SummonableMobs { get; set; } = new(); + public int AssignmentCount { get; set; } + + public string? Message { get; set; } + public bool IsError { get; set; } + + public async Task OnGetAsync(int? id) + { + await LoadLookups(); + + if (id.HasValue) + { + var ability = await _db.MobAbilityDefinitions.FindAsync(id.Value); + if (ability != null) + { + Ability = ability; + AssignmentCount = await _db.MobAbilityAssignments.CountAsync(a => a.AbilityDefinitionId == id.Value); + } + } + else + { + Ability = new MobAbilityDefinition + { + Key = "new_ability_" + DateTime.UtcNow.Ticks % 10000, + IsEnabled = true + }; + } + } + + public async Task OnPostAsync(string? action) + { + await LoadLookups(); + + try + { + if (action == "duplicate" && Ability.Id > 0) + { + var newAbility = new MobAbilityDefinition + { + Name = Ability.Name + " (Copy)", + Key = Ability.Key + "_copy", + Description = Ability.Description, + AbilityType = Ability.AbilityType, + Targeting = Ability.Targeting, + BaseDamage = Ability.BaseDamage, + DamagePerTier = Ability.DamagePerTier, + DamageTypeKey = Ability.DamageTypeKey, + Range = Ability.Range, + AoeRadius = Ability.AoeRadius, + ConeAngle = Ability.ConeAngle, + Cooldown = Ability.Cooldown, + CastTime = Ability.CastTime, + AnimationDuration = Ability.AnimationDuration, + ProjectileSpeed = Ability.ProjectileSpeed, + ProjectileSprite = Ability.ProjectileSprite, + EffectDuration = Ability.EffectDuration, + DotDamagePerTick = Ability.DotDamagePerTick, + DotTickInterval = Ability.DotTickInterval, + SpeedModifier = Ability.SpeedModifier, + DisplacementDistance = Ability.DisplacementDistance, + SummonMobId = Ability.SummonMobId, + SummonCount = Ability.SummonCount, + StatModifier = Ability.StatModifier, + AffectedStat = Ability.AffectedStat, + Priority = Ability.Priority, + ManaCost = Ability.ManaCost, + AnimationKey = Ability.AnimationKey, + SoundEffectKey = Ability.SoundEffectKey, + VisualEffectKey = Ability.VisualEffectKey, + IsEnabled = true + }; + _db.MobAbilityDefinitions.Add(newAbility); + await _db.SaveChangesAsync(); + return RedirectToPage(new { id = newAbility.Id }); + } + + if (Ability.Id == 0) + { + Ability.CreatedAt = DateTime.UtcNow; + Ability.UpdatedAt = DateTime.UtcNow; + _db.MobAbilityDefinitions.Add(Ability); + await _db.SaveChangesAsync(); + Message = $"Ability '{Ability.Name}' created."; + return RedirectToPage(new { id = Ability.Id }); + } + else + { + var existing = await _db.MobAbilityDefinitions.FindAsync(Ability.Id); + if (existing == null) + { + Message = "Ability not found."; + IsError = true; + return Page(); + } + + existing.Name = Ability.Name; + existing.Key = Ability.Key; + existing.Description = Ability.Description; + existing.AbilityType = Ability.AbilityType; + existing.Targeting = Ability.Targeting; + existing.BaseDamage = Ability.BaseDamage; + existing.DamagePerTier = Ability.DamagePerTier; + existing.DamageTypeKey = Ability.DamageTypeKey; + existing.Range = Ability.Range; + existing.AoeRadius = Ability.AoeRadius; + existing.ConeAngle = Ability.ConeAngle; + existing.Cooldown = Ability.Cooldown; + existing.CastTime = Ability.CastTime; + existing.AnimationDuration = Ability.AnimationDuration; + existing.ProjectileSpeed = Ability.ProjectileSpeed; + existing.ProjectileSprite = Ability.ProjectileSprite; + existing.EffectDuration = Ability.EffectDuration; + existing.DotDamagePerTick = Ability.DotDamagePerTick; + existing.DotTickInterval = Ability.DotTickInterval; + existing.SpeedModifier = Ability.SpeedModifier; + existing.DisplacementDistance = Ability.DisplacementDistance; + existing.SummonMobId = Ability.SummonMobId; + existing.SummonCount = Ability.SummonCount; + existing.StatModifier = Ability.StatModifier; + existing.AffectedStat = Ability.AffectedStat; + existing.HpThresholdBelow = Ability.HpThresholdBelow; + existing.HpThresholdAbove = Ability.HpThresholdAbove; + existing.MinTargetsInRange = Ability.MinTargetsInRange; + existing.Priority = Ability.Priority; + existing.ManaCost = Ability.ManaCost; + existing.AnimationKey = Ability.AnimationKey; + existing.SoundEffectKey = Ability.SoundEffectKey; + existing.VisualEffectKey = Ability.VisualEffectKey; + existing.IsEnabled = Ability.IsEnabled; + existing.UpdatedAt = DateTime.UtcNow; + + await _db.SaveChangesAsync(); + Message = "Ability updated."; + AssignmentCount = await _db.MobAbilityAssignments.CountAsync(a => a.AbilityDefinitionId == Ability.Id); + } + } + catch (Exception ex) + { + Message = $"Error: {ex.Message}"; + IsError = true; + } + + return Page(); + } + + private async Task LoadLookups() + { + DamageTypes = await _db.DamageResistanceTypes.OrderBy(d => d.DisplayName).ToListAsync(); + SummonableMobs = await _db.DungeonMobDefinitions.Where(m => m.IsEnabled).OrderBy(m => m.Name).ToListAsync(); + } +} diff --git a/Services/Admin/Pages/Abilities/Index.cshtml b/Services/Admin/Pages/Abilities/Index.cshtml new file mode 100644 index 0000000..f6ee0ed --- /dev/null +++ b/Services/Admin/Pages/Abilities/Index.cshtml @@ -0,0 +1,127 @@ +@page "/admin/abilities" +@model Abilities.IndexModel +@using DataServer.Data.Enums +@{ + ViewData["Title"] = "Mob Abilities"; +} + +
+
+
+

Mob Abilities

+

Manage abilities that can be assigned to mobs

+
+ + New Ability +
+ + @if (TempData["Message"] != null) + { +
+ @TempData["Message"] +
+ } + @if (TempData["Error"] != null) + { +
+ @TempData["Error"] +
+ } + + +
+
+
+ + +
+
+ + +
+ + Clear +
+
+ + +
+ + + + + + + + + + + + + + + @foreach (var ability in Model.Abilities) + { + + + + + + + + + + + } + +
NameKeyTypeDamageRangeCooldownStatusActions
@ability.Name@ability.Key + @ability.AbilityType + @ability.BaseDamage@ability.Range@ability.Cooldown.ToString("0.#")s + @if (ability.IsEnabled) + { + Enabled + } + else + { + Disabled + } + +
+ Edit +
+ @Html.AntiForgeryToken() + + +
+
+
+ + @if (Model.Abilities.Count == 0) + { +
+ No abilities found. Create one +
+ } +
+
+ +@functions { + string GetTypeBadge(MobAbilityType type) + { + return type switch + { + MobAbilityType.MeleeAttack or MobAbilityType.Cleave => "bg-red-600", + MobAbilityType.ProjectileSingle or MobAbilityType.ProjectileAoe => "bg-orange-600", + MobAbilityType.HealSelf or MobAbilityType.HealAlly or MobAbilityType.HealAoe => "bg-green-600", + MobAbilityType.Poison or MobAbilityType.Bleed or MobAbilityType.Burn => "bg-purple-600", + MobAbilityType.Stun or MobAbilityType.Knockback or MobAbilityType.Fear or MobAbilityType.Pull => "bg-yellow-600", + MobAbilityType.SummonSingle or MobAbilityType.SummonBulk => "bg-blue-600", + _ => "bg-gray-600" + }; + } +} diff --git a/Services/Admin/Pages/Abilities/Index.cshtml.cs b/Services/Admin/Pages/Abilities/Index.cshtml.cs new file mode 100644 index 0000000..1d71cd8 --- /dev/null +++ b/Services/Admin/Pages/Abilities/Index.cshtml.cs @@ -0,0 +1,62 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using DataServer.Data; +using DataServer.Data.Entities; +using DataServer.Data.Enums; + +namespace Server.Services.Admin.Pages.Abilities; + +public class IndexModel : AdminPageModel +{ + private readonly GameDbContext _db; + + public IndexModel(GameDbContext db) + { + _db = db; + } + + public List Abilities { get; set; } = new(); + + [FromQuery] + public string? Search { get; set; } + + [FromQuery] + public MobAbilityType? TypeFilter { get; set; } + + public async Task OnGetAsync() + { + var query = _db.MobAbilityDefinitions.AsQueryable(); + + if (!string.IsNullOrWhiteSpace(Search)) + { + query = query.Where(a => a.Name.Contains(Search) || a.Key.Contains(Search)); + } + + if (TypeFilter.HasValue) + { + query = query.Where(a => a.AbilityType == TypeFilter.Value); + } + + Abilities = await query.OrderBy(a => a.Name).ToListAsync(); + } + + public async Task OnPostDeleteAsync(int id) + { + var ability = await _db.MobAbilityDefinitions.FindAsync(id); + if (ability != null) + { + // Check if ability is assigned to any mobs + var assignments = await _db.MobAbilityAssignments.Where(a => a.AbilityDefinitionId == id).CountAsync(); + if (assignments > 0) + { + TempData["Error"] = $"Cannot delete: ability is assigned to {assignments} mob(s)."; + return RedirectToPage(); + } + + _db.MobAbilityDefinitions.Remove(ability); + await _db.SaveChangesAsync(); + TempData["Message"] = $"Ability '{ability.Name}' deleted."; + } + return RedirectToPage(); + } +} diff --git a/Services/Admin/Pages/Mobs/Edit.cshtml b/Services/Admin/Pages/Mobs/Edit.cshtml index 22f86b8..4f6f547 100644 --- a/Services/Admin/Pages/Mobs/Edit.cshtml +++ b/Services/Admin/Pages/Mobs/Edit.cshtml @@ -131,6 +131,15 @@

Movement & Behavior

+
+ + +
@@ -143,6 +152,16 @@
+
+ + +

For ranged/kiting

+
+
+ + +

HP% to flee (0-1)

+
@@ -349,6 +368,128 @@
+ + @if (!Model.IsNew) + { +
+
+

Abilities (@Model.MobAbilities.Count)

+ +
+
+ @if (Model.MobAbilities.Count > 0) + { + + + + + + + + + + + + + + + @foreach (var assignment in Model.MobAbilities) + { + var ability = assignment.AbilityDefinition; + + + + + + + + + + + } + +
AbilityTypeDamageRangeCooldownPhaseStatusActions
@ability?.Name@ability?.AbilityType@ability?.BaseDamage@ability?.Range@ability?.Cooldown.ToString("0.#")s@(assignment.Phase == 0 ? "All" : $"Phase {assignment.Phase}") + @if (assignment.IsEnabled) + { + Active + } + else + { + Disabled + } + +
+
+ @Html.AntiForgeryToken() + + + +
+
+ @Html.AntiForgeryToken() + + + +
+
+
+ } + else + { +

No abilities assigned. This mob will use a basic attack.

+ } +
+
+ + + + } + @if (!Model.IsNew) { @@ -464,7 +605,20 @@ document.getElementById('addLootModal').classList.add('hidden'); document.getElementById('addLootModal').classList.remove('flex'); } - document.addEventListener('keydown', e => { if (e.key === 'Escape') closeAddLootModal(); }); + function showAddAbilityModal() { + document.getElementById('addAbilityModal').classList.remove('hidden'); + document.getElementById('addAbilityModal').classList.add('flex'); + } + function closeAddAbilityModal() { + document.getElementById('addAbilityModal').classList.add('hidden'); + document.getElementById('addAbilityModal').classList.remove('flex'); + } + document.addEventListener('keydown', e => { + if (e.key === 'Escape') { + closeAddLootModal(); + closeAddAbilityModal(); + } + }); // Resistance type options for dynamic rows const resistanceOptions = `@Html.Raw(string.Join("", Model.ResistanceTypes.Select(rt => $"")))`; diff --git a/Services/Admin/Pages/Mobs/Edit.cshtml.cs b/Services/Admin/Pages/Mobs/Edit.cshtml.cs index 52f0f0a..bfceb3b 100644 --- a/Services/Admin/Pages/Mobs/Edit.cshtml.cs +++ b/Services/Admin/Pages/Mobs/Edit.cshtml.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using DataServer.Data; using DataServer.Data.Entities; +using DataServer.Data.Enums; using System.Text.Json; namespace Server.Services.Admin.Pages.Mobs; @@ -41,6 +42,10 @@ public class EditModel : AdminPageModel public List AllLootTables { get; set; } = new(); public List ResistanceTypes { get; set; } = new(); + // Ability management + public List MobAbilities { get; set; } = new(); + public List AllAbilities { get; set; } = new(); + public bool IsNew => Mob.Id == 0; public string? Message { get; set; } public bool IsError { get; set; } @@ -92,6 +97,11 @@ public class EditModel : AdminPageModel .Where(r => r.IsEnabled) .OrderBy(r => r.SortOrder) .ToListAsync(); + + AllAbilities = await _db.MobAbilityDefinitions + .Where(a => a.IsEnabled) + .OrderBy(a => a.Name) + .ToListAsync(); if (id.HasValue) { @@ -105,6 +115,12 @@ public class EditModel : AdminPageModel .Where(m => m.MobDefinitionId == id.Value) .OrderBy(m => m.Priority) .ToListAsync(); + + MobAbilities = await _db.MobAbilityAssignments + .Include(a => a.AbilityDefinition) + .Where(a => a.MobDefinitionId == id.Value) + .OrderBy(a => a.AbilityDefinition!.Name) + .ToListAsync(); } } else @@ -336,4 +352,55 @@ public class EditModel : AdminPageModel return RedirectToPage("/Mobs/Edit", new { id = mobId }); } + + public async Task OnPostAddAbilityAsync(int mobId, int abilityId, int priority, int phase) + { + // Check if already assigned + var existing = await _db.MobAbilityAssignments + .FirstOrDefaultAsync(a => a.MobDefinitionId == mobId && a.AbilityDefinitionId == abilityId); + + if (existing != null) + { + TempData["Error"] = "This ability is already assigned to this mob."; + return RedirectToPage("/Mobs/Edit", new { id = mobId }); + } + + var assignment = new MobAbilityAssignment + { + MobDefinitionId = mobId, + AbilityDefinitionId = abilityId, + PriorityOverride = priority > 0 ? priority : null, + Phase = phase, + IsEnabled = true + }; + + _db.MobAbilityAssignments.Add(assignment); + await _db.SaveChangesAsync(); + + return RedirectToPage("/Mobs/Edit", new { id = mobId }); + } + + public async Task OnPostRemoveAbilityAsync(int assignmentId, int mobId) + { + var assignment = await _db.MobAbilityAssignments.FindAsync(assignmentId); + if (assignment != null) + { + _db.MobAbilityAssignments.Remove(assignment); + await _db.SaveChangesAsync(); + } + + return RedirectToPage("/Mobs/Edit", new { id = mobId }); + } + + public async Task OnPostToggleAbilityAsync(int assignmentId, int mobId) + { + var assignment = await _db.MobAbilityAssignments.FindAsync(assignmentId); + if (assignment != null) + { + assignment.IsEnabled = !assignment.IsEnabled; + await _db.SaveChangesAsync(); + } + + return RedirectToPage("/Mobs/Edit", new { id = mobId }); + } } diff --git a/Services/Admin/Pages/Shared/_Layout.cshtml b/Services/Admin/Pages/Shared/_Layout.cshtml index 8ff90ca..b201b04 100644 --- a/Services/Admin/Pages/Shared/_Layout.cshtml +++ b/Services/Admin/Pages/Shared/_Layout.cshtml @@ -92,7 +92,7 @@ - Void Scavengers + Dungeon Divers

Admin Panel

@@ -138,6 +138,13 @@ Mobs + + + + + Abilities + +