<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetSalvagingDifficulty</id>
	<title>API:GetSalvagingDifficulty - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetSalvagingDifficulty"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetSalvagingDifficulty&amp;action=history"/>
	<updated>2026-10-18T10:53:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:GetSalvagingDifficulty&amp;diff=30458&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetSalvagingDifficulty&amp;diff=30458&amp;oldid=prev"/>
		<updated>2026-10-16T19:44:53Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Crafting}}&lt;br /&gt;
Returns how hard it is for the player to salvage an item of a given item level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
difficultyClass, chance = GetSalvagingDifficulty(itemLevel)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;itemLevel : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Item level (the &amp;lt;code&amp;gt;iLevel&amp;lt;/code&amp;gt; field of an item data table).&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;difficultyClass : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – 0 to 4. 0 is the easiest, 4 means the item cannot be salvaged. The stock UI looks it up in &amp;lt;code&amp;gt;CraftingUtils.SalvagingDifficulty&amp;lt;/code&amp;gt; and compares it with &amp;lt;code&amp;gt;GameData.Salvaging.IMPOSSIBLE&amp;lt;/code&amp;gt;.&lt;br /&gt;
;chance : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – A percentage, 0 to 100. The stock UI shows it next to the difficulty text.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The result is calculated from &amp;lt;code&amp;gt;itemLevel&amp;lt;/code&amp;gt; and the player&amp;#039;s base salvaging level (trade skill 6). Bonuses are not included.&lt;br /&gt;
* The item level is capped at 45. With &amp;lt;code&amp;gt;skill&amp;lt;/code&amp;gt; as the salvaging level:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Condition !! difficultyClass !! chance&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;skill&amp;lt;/code&amp;gt; ≥ 200 || 0 || 100&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;itemLevel × 5&amp;lt;/code&amp;gt; ≥ &amp;lt;code&amp;gt;skill + 50&amp;lt;/code&amp;gt; || 4 || 0&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;skill&amp;lt;/code&amp;gt; ≥ &amp;lt;code&amp;gt;(itemLevel + 3) × 5&amp;lt;/code&amp;gt; || 0 || 100&lt;br /&gt;
|-&lt;br /&gt;
| otherwise, with &amp;lt;code&amp;gt;chance = skill + (17 − itemLevel) × 5&amp;lt;/code&amp;gt; || 3 if &amp;lt;code&amp;gt;chance&amp;lt;/code&amp;gt; &amp;lt; 60, 2 if 60–79, 1 if 80 or more || &amp;lt;code&amp;gt;chance&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
: The rows are checked from top to bottom.&lt;br /&gt;
* If there is no player object or the Lua state is not available, nothing is returned.&lt;br /&gt;
* The function needs at least one argument and only reads the last one.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
None besides the generic &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; message when the argument is missing or not a number.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;default/ea_craftingwindow/source/salvagingwindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function SalvagingWindow.PlayerHasSufficientSkillToSalvageItem( itemData )&lt;br /&gt;
    local difficultyClass = GetSalvagingDifficulty( itemData.iLevel )&lt;br /&gt;
    return( difficultyClass ~= GameData.Salvaging.IMPOSSIBLE )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local difficultyClass, difficultyPercent = GetSalvagingDifficulty( itemData.iLevel )&lt;br /&gt;
local difficultyString = CraftingUtils.SalvagingDifficulty[difficultyClass].string&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:RequestSalvageItem|RequestSalvageItem]]&lt;br /&gt;
* [[API:GetBonusIsSalvagable|GetBonusIsSalvagable]]&lt;br /&gt;
* [[API:GetTradeSkillLevel|GetTradeSkillLevel]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>