From 3b04f8068f821b2f1e358bd41e4555b0b2e85293 Mon Sep 17 00:00:00 2001 From: dingo Date: Mon, 8 Dec 2025 15:52:15 -0500 Subject: [PATCH] Lootv2 --- Game/Dungeon/LootService.cs | 92 ++++++++++++++++++++++--------------- 1 file changed, 55 insertions(+), 37 deletions(-) diff --git a/Game/Dungeon/LootService.cs b/Game/Dungeon/LootService.cs index d86ecdc..4b11a56 100644 --- a/Game/Dungeon/LootService.cs +++ b/Game/Dungeon/LootService.cs @@ -95,9 +95,13 @@ public class LootService if (!_mobLootTableMappings.TryGetValue(mobDefinitionId, out var mappings)) { + _log.LogWarning("No loot tables found for mob {MobId}. Available mappings: {MobIds}", + mobDefinitionId, string.Join(", ", _mobLootTableMappings.Keys)); return loot; // No loot tables for this mob } + _log.LogDebug("Generating loot for mob {MobId}, found {Count} table mappings", mobDefinitionId, mappings.Count); + foreach (var mapping in mappings) { // Check if this table rolls @@ -116,6 +120,8 @@ public class LootService loot.AddRange(drops); } + _log.LogDebug("Generated {Count} loot drops for mob {MobId}", loot.Count, mobDefinitionId); + return loot; } @@ -329,55 +335,67 @@ public class LootService private List GetDefaultMobLootTableMappings(List tables) { - // Mob IDs from DefaultDungeonMobs: - // 1: Skeleton, 2: Zombie, 3: Ghost (Undead) - // 4: Giant Spider, 5: Cave Wolf (Beast) - // 6: Lesser Demon, 7: Imp (Demon) - // 8: Fire Elemental, 9: Ice Elemental (Elemental) - // 10: Skeleton Lord (Boss) + // ACTUAL Mob IDs from DefaultDungeonMobs: + // 1: Skeleton (Undead) + // 2: Zombie (Undead) + // 3: Giant Rat (Beast) + // 4: Giant Spider (Beast) + // 10: Skeleton Knight (Elite, Undead) + // 20: Imp (Demon) + // 21: Cultist (Humanoid) + // 30: Stone Golem (Elite, Construct) + // 31: Fire Elemental (Elemental) + // 100: The Bone Lord (Boss, Undead) return new List { - // Undead mobs - new() { MobDefinitionId = 1, LootTableId = 1, Priority = 0 }, // Skeleton - Common - new() { MobDefinitionId = 1, LootTableId = 2, Priority = 1 }, // Skeleton - Undead - new() { MobDefinitionId = 1, LootTableId = 20, Priority = 2, RollChance = 0.3f }, // Skeleton - Weapon chance + // Skeleton (Undead) - ID 1 + new() { MobDefinitionId = 1, LootTableId = 1, Priority = 0 }, // Common + new() { MobDefinitionId = 1, LootTableId = 2, Priority = 1 }, // Undead + new() { MobDefinitionId = 1, LootTableId = 20, Priority = 2, RollChance = 0.3f }, // Weapon chance - new() { MobDefinitionId = 2, LootTableId = 1, Priority = 0 }, // Zombie - Common - new() { MobDefinitionId = 2, LootTableId = 2, Priority = 1 }, // Zombie - Undead - new() { MobDefinitionId = 2, LootTableId = 21, Priority = 2, RollChance = 0.3f }, // Zombie - Armor chance + // Zombie (Undead) - ID 2 + new() { MobDefinitionId = 2, LootTableId = 1, Priority = 0 }, // Common + new() { MobDefinitionId = 2, LootTableId = 2, Priority = 1 }, // Undead + new() { MobDefinitionId = 2, LootTableId = 21, Priority = 2, RollChance = 0.3f }, // Armor chance - new() { MobDefinitionId = 3, LootTableId = 1, Priority = 0 }, // Ghost - Common - new() { MobDefinitionId = 3, LootTableId = 2, Priority = 1 }, // Ghost - Undead + // Giant Rat (Beast) - ID 3 + new() { MobDefinitionId = 3, LootTableId = 1, Priority = 0 }, // Common + new() { MobDefinitionId = 3, LootTableId = 3, Priority = 1 }, // Beast - // Beast mobs - new() { MobDefinitionId = 4, LootTableId = 1, Priority = 0 }, // Giant Spider - Common - new() { MobDefinitionId = 4, LootTableId = 3, Priority = 1 }, // Giant Spider - Beast + // Giant Spider (Beast) - ID 4 + new() { MobDefinitionId = 4, LootTableId = 1, Priority = 0 }, // Common + new() { MobDefinitionId = 4, LootTableId = 3, Priority = 1 }, // Beast + new() { MobDefinitionId = 4, LootTableId = 20, Priority = 2, RollChance = 0.2f }, // Weapon - new() { MobDefinitionId = 5, LootTableId = 1, Priority = 0 }, // Cave Wolf - Common - new() { MobDefinitionId = 5, LootTableId = 3, Priority = 1 }, // Cave Wolf - Beast - new() { MobDefinitionId = 5, LootTableId = 20, Priority = 2, RollChance = 0.2f }, // Cave Wolf - Weapon + // Skeleton Knight (Elite, Undead) - ID 10 + new() { MobDefinitionId = 10, LootTableId = 1, Priority = 0 }, // Common + new() { MobDefinitionId = 10, LootTableId = 2, Priority = 1 }, // Undead + new() { MobDefinitionId = 10, LootTableId = 20, Priority = 2, RollChance = 0.5f }, // Weapon + new() { MobDefinitionId = 10, LootTableId = 21, Priority = 3, RollChance = 0.5f }, // Armor - // Demon mobs - new() { MobDefinitionId = 6, LootTableId = 1, Priority = 0 }, // Lesser Demon - Common - new() { MobDefinitionId = 6, LootTableId = 4, Priority = 1 }, // Lesser Demon - Demon - new() { MobDefinitionId = 6, LootTableId = 20, Priority = 2, RollChance = 0.4f }, // Lesser Demon - Weapon - new() { MobDefinitionId = 6, LootTableId = 21, Priority = 3, RollChance = 0.4f }, // Lesser Demon - Armor + // Imp (Demon) - ID 20 + new() { MobDefinitionId = 20, LootTableId = 1, Priority = 0 }, // Common + new() { MobDefinitionId = 20, LootTableId = 4, Priority = 1 }, // Demon - new() { MobDefinitionId = 7, LootTableId = 1, Priority = 0 }, // Imp - Common - new() { MobDefinitionId = 7, LootTableId = 4, Priority = 1 }, // Imp - Demon + // Cultist (Humanoid) - ID 21 + new() { MobDefinitionId = 21, LootTableId = 1, Priority = 0 }, // Common + new() { MobDefinitionId = 21, LootTableId = 4, Priority = 1 }, // Demon loot + new() { MobDefinitionId = 21, LootTableId = 20, Priority = 2, RollChance = 0.3f }, // Weapon - // Elemental mobs - new() { MobDefinitionId = 8, LootTableId = 1, Priority = 0 }, // Fire Elemental - Common - new() { MobDefinitionId = 8, LootTableId = 5, Priority = 1 }, // Fire Elemental - Elemental + // Stone Golem (Elite) - ID 30 + new() { MobDefinitionId = 30, LootTableId = 1, Priority = 0 }, // Common + new() { MobDefinitionId = 30, LootTableId = 5, Priority = 1 }, // Elemental + new() { MobDefinitionId = 30, LootTableId = 21, Priority = 2, RollChance = 0.6f }, // Armor - new() { MobDefinitionId = 9, LootTableId = 1, Priority = 0 }, // Ice Elemental - Common - new() { MobDefinitionId = 9, LootTableId = 5, Priority = 1 }, // Ice Elemental - Elemental + // Fire Elemental - ID 31 + new() { MobDefinitionId = 31, LootTableId = 1, Priority = 0 }, // Common + new() { MobDefinitionId = 31, LootTableId = 5, Priority = 1 }, // Elemental - // Boss - new() { MobDefinitionId = 10, LootTableId = 10, Priority = 0 }, // Skeleton Lord - Boss Common - new() { MobDefinitionId = 10, LootTableId = 11, Priority = 1 }, // Skeleton Lord - Boss Rare - new() { MobDefinitionId = 10, LootTableId = 2, Priority = 2 }, // Skeleton Lord - Undead + // The Bone Lord (Boss) - ID 100 + new() { MobDefinitionId = 100, LootTableId = 10, Priority = 0 }, // Boss Common + new() { MobDefinitionId = 100, LootTableId = 11, Priority = 1 }, // Boss Rare + new() { MobDefinitionId = 100, LootTableId = 2, Priority = 2 }, // Undead }; }