diff --git a/fs_edit_general.lua b/fs_edit_general.lua index 295f7c5..934b5ed 100644 --- a/fs_edit_general.lua +++ b/fs_edit_general.lua @@ -2093,7 +2093,7 @@ yl_speak_up.get_fs_edit_option_action_npc_wants_or_accepts = function( amount = tostring(parts[2]) end local size_list = {"any amount", "exactly "..amount, - "less than "..amount, "more than "..amount, "other amount than "..amount} + "less than "..amount, "more than "..amount, "another amount than "..amount} local match_size = 1 for i, list_text in ipairs(size_list) do if(data.match_stack_size and data.match_stack_size == list_text:split(" ")[ 1 ]) then diff --git a/fs_edit_preconditions.lua b/fs_edit_preconditions.lua index 6b54c05..16c7dec 100644 --- a/fs_edit_preconditions.lua +++ b/fs_edit_preconditions.lua @@ -232,6 +232,32 @@ yl_speak_up.show_precondition = function(p, pname) end return who.." has an empty inventory." end + elseif(p.p_type == "player_offered_item") then + local item = tostring(p.p_value:split(" ")[1]) + local amount = tostring(p.p_value:split(" ")[2]) + local match = "any amount" + if(p.p_match_stack_size == "any") then + match = "any amount" + elseif(p.p_match_stack_size == "exactly") then + match = "exactly "..tostring(amount) + elseif(p.p_match_stack_size == "less" + or p.p_match_stack_size == "more") then + match = p.p_match_stack_size.." than "..tostring(amount) + elseif(p.p_match_stack_size == "another") then + match = "another amount than " ..tostring(amount) + end + if(p.p_item_group and p.p_item_group ~= "") then + return "The player offered "..tostring(match).." item(s) of the group \"".. + tostring(item).."\"." + elseif((p.p_item_quest_id and p.p_item_quest_id ~= "") + or (p.p_item_desc and p.p_item_desc ~= "")) then + return "The player offered "..tostring(match).." of \"".. + tostring(p.p_item_desc or "- default description -").. + "\" (\""..tostring(item or "- ? -").."\") ".. + "with ID \""..tostring(p.p_item_quest_id or "- no special ID -").."\"." + else + return "The player offered "..tostring(match).." of \""..tostring(item).."\"." + end elseif(p.p_type == "custom") then return "Call custom function with param: \""..tostring(p.p_value).."\"." elseif(p.p_type == "other") then