Lootv2
This commit is contained in:
+55
-37
@@ -95,9 +95,13 @@ public class LootService
|
|||||||
|
|
||||||
if (!_mobLootTableMappings.TryGetValue(mobDefinitionId, out var mappings))
|
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
|
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)
|
foreach (var mapping in mappings)
|
||||||
{
|
{
|
||||||
// Check if this table rolls
|
// Check if this table rolls
|
||||||
@@ -116,6 +120,8 @@ public class LootService
|
|||||||
loot.AddRange(drops);
|
loot.AddRange(drops);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_log.LogDebug("Generated {Count} loot drops for mob {MobId}", loot.Count, mobDefinitionId);
|
||||||
|
|
||||||
return loot;
|
return loot;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -329,55 +335,67 @@ public class LootService
|
|||||||
|
|
||||||
private List<DungeonMobLootTable> GetDefaultMobLootTableMappings(List<DungeonLootTable> tables)
|
private List<DungeonMobLootTable> GetDefaultMobLootTableMappings(List<DungeonLootTable> tables)
|
||||||
{
|
{
|
||||||
// Mob IDs from DefaultDungeonMobs:
|
// ACTUAL Mob IDs from DefaultDungeonMobs:
|
||||||
// 1: Skeleton, 2: Zombie, 3: Ghost (Undead)
|
// 1: Skeleton (Undead)
|
||||||
// 4: Giant Spider, 5: Cave Wolf (Beast)
|
// 2: Zombie (Undead)
|
||||||
// 6: Lesser Demon, 7: Imp (Demon)
|
// 3: Giant Rat (Beast)
|
||||||
// 8: Fire Elemental, 9: Ice Elemental (Elemental)
|
// 4: Giant Spider (Beast)
|
||||||
// 10: Skeleton Lord (Boss)
|
// 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<DungeonMobLootTable>
|
return new List<DungeonMobLootTable>
|
||||||
{
|
{
|
||||||
// Undead mobs
|
// Skeleton (Undead) - ID 1
|
||||||
new() { MobDefinitionId = 1, LootTableId = 1, Priority = 0 }, // Skeleton - Common
|
new() { MobDefinitionId = 1, LootTableId = 1, Priority = 0 }, // Common
|
||||||
new() { MobDefinitionId = 1, LootTableId = 2, Priority = 1 }, // Skeleton - Undead
|
new() { MobDefinitionId = 1, LootTableId = 2, Priority = 1 }, // Undead
|
||||||
new() { MobDefinitionId = 1, LootTableId = 20, Priority = 2, RollChance = 0.3f }, // Skeleton - Weapon chance
|
new() { MobDefinitionId = 1, LootTableId = 20, Priority = 2, RollChance = 0.3f }, // Weapon chance
|
||||||
|
|
||||||
new() { MobDefinitionId = 2, LootTableId = 1, Priority = 0 }, // Zombie - Common
|
// Zombie (Undead) - ID 2
|
||||||
new() { MobDefinitionId = 2, LootTableId = 2, Priority = 1 }, // Zombie - Undead
|
new() { MobDefinitionId = 2, LootTableId = 1, Priority = 0 }, // Common
|
||||||
new() { MobDefinitionId = 2, LootTableId = 21, Priority = 2, RollChance = 0.3f }, // Zombie - Armor chance
|
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
|
// Giant Rat (Beast) - ID 3
|
||||||
new() { MobDefinitionId = 3, LootTableId = 2, Priority = 1 }, // Ghost - Undead
|
new() { MobDefinitionId = 3, LootTableId = 1, Priority = 0 }, // Common
|
||||||
|
new() { MobDefinitionId = 3, LootTableId = 3, Priority = 1 }, // Beast
|
||||||
|
|
||||||
// Beast mobs
|
// Giant Spider (Beast) - ID 4
|
||||||
new() { MobDefinitionId = 4, LootTableId = 1, Priority = 0 }, // Giant Spider - Common
|
new() { MobDefinitionId = 4, LootTableId = 1, Priority = 0 }, // Common
|
||||||
new() { MobDefinitionId = 4, LootTableId = 3, Priority = 1 }, // Giant Spider - Beast
|
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
|
// Skeleton Knight (Elite, Undead) - ID 10
|
||||||
new() { MobDefinitionId = 5, LootTableId = 3, Priority = 1 }, // Cave Wolf - Beast
|
new() { MobDefinitionId = 10, LootTableId = 1, Priority = 0 }, // Common
|
||||||
new() { MobDefinitionId = 5, LootTableId = 20, Priority = 2, RollChance = 0.2f }, // Cave Wolf - Weapon
|
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
|
// Imp (Demon) - ID 20
|
||||||
new() { MobDefinitionId = 6, LootTableId = 1, Priority = 0 }, // Lesser Demon - Common
|
new() { MobDefinitionId = 20, LootTableId = 1, Priority = 0 }, // Common
|
||||||
new() { MobDefinitionId = 6, LootTableId = 4, Priority = 1 }, // Lesser Demon - Demon
|
new() { MobDefinitionId = 20, LootTableId = 4, Priority = 1 }, // 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
|
|
||||||
|
|
||||||
new() { MobDefinitionId = 7, LootTableId = 1, Priority = 0 }, // Imp - Common
|
// Cultist (Humanoid) - ID 21
|
||||||
new() { MobDefinitionId = 7, LootTableId = 4, Priority = 1 }, // Imp - Demon
|
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
|
// Stone Golem (Elite) - ID 30
|
||||||
new() { MobDefinitionId = 8, LootTableId = 1, Priority = 0 }, // Fire Elemental - Common
|
new() { MobDefinitionId = 30, LootTableId = 1, Priority = 0 }, // Common
|
||||||
new() { MobDefinitionId = 8, LootTableId = 5, Priority = 1 }, // Fire Elemental - Elemental
|
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
|
// Fire Elemental - ID 31
|
||||||
new() { MobDefinitionId = 9, LootTableId = 5, Priority = 1 }, // Ice Elemental - Elemental
|
new() { MobDefinitionId = 31, LootTableId = 1, Priority = 0 }, // Common
|
||||||
|
new() { MobDefinitionId = 31, LootTableId = 5, Priority = 1 }, // Elemental
|
||||||
|
|
||||||
// Boss
|
// The Bone Lord (Boss) - ID 100
|
||||||
new() { MobDefinitionId = 10, LootTableId = 10, Priority = 0 }, // Skeleton Lord - Boss Common
|
new() { MobDefinitionId = 100, LootTableId = 10, Priority = 0 }, // Boss Common
|
||||||
new() { MobDefinitionId = 10, LootTableId = 11, Priority = 1 }, // Skeleton Lord - Boss Rare
|
new() { MobDefinitionId = 100, LootTableId = 11, Priority = 1 }, // Boss Rare
|
||||||
new() { MobDefinitionId = 10, LootTableId = 2, Priority = 2 }, // Skeleton Lord - Undead
|
new() { MobDefinitionId = 100, LootTableId = 2, Priority = 2 }, // Undead
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user