Crafting System v2

This commit is contained in:
dingo
2025-12-23 13:41:07 -05:00
parent 4661576af5
commit f04ed1acf6
2 changed files with 97 additions and 41 deletions
+9 -3
View File
@@ -2961,15 +2961,20 @@ public sealed class DungeonHandler : IClientMessageHandler
if (request.Discover && request.Ingredients != null && request.Ingredients.Count > 0)
{
// Recipe discovery attempt
// Recipe discovery attempt with optional skill type filter
var ingredients = request.Ingredients.Select(i => (i.ItemDefinitionId, i.Quantity)).ToList();
var (recipe, alreadyKnown) = await _craftingHandler.TryDiscoverRecipeAsync(db, session.CharacterId, ingredients);
CraftingSkillType? skillFilter = request.SkillType.HasValue
? (CraftingSkillType)request.SkillType.Value
: null;
var (recipe, alreadyKnown, error) = await _craftingHandler.TryDiscoverRecipeAsync(
db, session.CharacterId, ingredients, skillFilter);
if (recipe == null)
{
await SendAsync(connection, DungeonOpCodes.CRAFTING_RESULT, new {
success = false,
error = "No recipe found for these ingredients"
error = error ?? "No recipe found for these ingredients"
}, ct);
}
else if (alreadyKnown)
@@ -3132,6 +3137,7 @@ public class CraftingAttemptRequest
public int RecipeId { get; set; }
public List<CraftingIngredientInput>? Ingredients { get; set; }
public bool Discover { get; set; }
public int? SkillType { get; set; }
}
public class CraftingIngredientInput