Craftingv3

This commit is contained in:
dingo
2025-12-23 15:08:44 -05:00
parent f04ed1acf6
commit 856350057c
2 changed files with 74 additions and 1 deletions
+17 -1
View File
@@ -2972,9 +2972,25 @@ public sealed class DungeonHandler : IClientMessageHandler
if (recipe == null)
{
// Failed discovery - 65% chance to lose materials
var (materialsLost, lostItems) = await _craftingHandler.TryConsumeMaterialsOnFailedDiscoveryAsync(
db, session.CharacterId, ingredients);
var errorMsg = error ?? "No recipe found for these ingredients";
if (materialsLost)
{
errorMsg += $"\nMaterials lost: {string.Join(", ", lostItems)}";
}
else
{
errorMsg += "\nMaterials saved!";
}
await SendAsync(connection, DungeonOpCodes.CRAFTING_RESULT, new {
success = false,
error = error ?? "No recipe found for these ingredients"
error = errorMsg,
materialsLost = materialsLost,
lostItems = lostItems
}, ct);
}
else if (alreadyKnown)