Craftingv3
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user