4,687
edits
(Fixed some edge case modifiers) |
(Updated Arch Tool Level display, Fixed error on nil modifiers in getModifiersDifference) |
||
Line 393: | Line 393: | ||
["DamageTakenWhenStunned"] = { text = "{V}% damage taken when stunned", isIncreaseNegative = true, skills = {'Combat'} }, | ["DamageTakenWhenStunned"] = { text = "{V}% damage taken when stunned", isIncreaseNegative = true, skills = {'Combat'} }, | ||
["DeadlyPoisonDOTDamage"] = { text = "{V}% Damage taken from Deadly Poison", skills = {'Combat'} }, | ["DeadlyPoisonDOTDamage"] = { text = "{V}% Damage taken from Deadly Poison", skills = {'Combat'} }, | ||
["DeadlyToxinsFromHerblore"] = { text = "When creating Lethal Toxins Potions in Herblore, gain + | ["DeadlyToxinsFromHerblore"] = { text = "When creating Lethal Toxins Potions in Herblore, gain +${value} Deadly Toxins Potion(s) as an additional Potion (Cannot be doubled)", skills = {'Herblore'} }, | ||
["decreaseEnemyEvasionOnSleep"] = { text = "When a Sleep is applied to the Target, -10% Global Evasion Rating for the remainder of the fight (Stacks up to 3 times)", skills = {'Combat'} }, | ["decreaseEnemyEvasionOnSleep"] = { text = "When a Sleep is applied to the Target, -10% Global Evasion Rating for the remainder of the fight (Stacks up to 3 times)", skills = {'Combat'} }, | ||
["decreaseEnemyEvasionOnStun"] = { text = "When a Stun is applied to the Target, -10% Global Evasion Rating for the remainder of the fight (Stacks up to 3 times)", skills = {'Combat'} }, | ["decreaseEnemyEvasionOnStun"] = { text = "When a Stun is applied to the Target, -10% Global Evasion Rating for the remainder of the fight (Stacks up to 3 times)", skills = {'Combat'} }, | ||
Line 914: | Line 914: | ||
local baseName = modifierName | local baseName = modifierName | ||
local modifier = GameData.rawData.modifierData[modifierName] | local modifier = GameData.rawData.modifierData[modifierName] | ||
if modifier == nil then | |||
return nil | |||
end | |||
if Shared.startsWith(modifierName, "increased") or Shared.startsWith(modifierName, "decreased") then | if Shared.startsWith(modifierName, "increased") or Shared.startsWith(modifierName, "decreased") then | ||
baseName = string.sub(modifierName, 10) | baseName = string.sub(modifierName, 10) | ||
end | end | ||
Line 932: | Line 932: | ||
if modName == nil then | if modName == nil then | ||
return Shared.printError('Invalid modifier type for "' .. modifier .. '"') | return Shared.printError('Invalid modifier type for "' .. modifier .. '"') | ||
end | |||
if modifyValue ~= nil and string.match(modifyValue, 'ToolLevels') then | |||
modifyValue = 'ArchaeologyToolLevels' | |||
end | end | ||
Line 945: | Line 949: | ||
['(value)=>Math.pow(2,value)'] = function(val) return 2^val end, | ['(value)=>Math.pow(2,value)'] = function(val) return 2^val end, | ||
["(value)=>{if(value>=2){return getLangString('ALLOW_UNHOLY_PRAYERS');}\nelse if(value>=1){return getLangString('ALLOW_UNHOLY_PRAYERS_WITH_EQUIPMENT');}\nelse{return 'Invalid modifier value.';}}"] = function(val) return 'Allows for Unholy Prayers to be used' end, | ["(value)=>{if(value>=2){return getLangString('ALLOW_UNHOLY_PRAYERS');}\nelse if(value>=1){return getLangString('ALLOW_UNHOLY_PRAYERS_WITH_EQUIPMENT');}\nelse{return 'Invalid modifier value.';}}"] = function(val) return 'Allows for Unholy Prayers to be used' end, | ||
[ | ['ArchaeologyToolLevels'] = function(val) | ||
local toolLevel = '+' .. val | |||
if string.match(modName, 'Sieve') then | |||
toolLevel = toolLevel .. ' level of the Sieve Tool in Archaeology' | |||
elseif string.match(modName, 'Trowel') then | |||
toolLevel = toolLevel .. ' level of the Trowel Tool in Archaeology' | |||
elseif string.match(modName, 'Brush') then | |||
toolLevel = toolLevel .. ' level of the Brush Tool in Archaeology' | |||
elseif string.match(modName, 'Shovel') then | |||
toolLevel = toolLevel .. ' level of the Shovel Tool in Archaeology' | |||
end | |||
if val > 1 then | |||
return string.gsub(toolLevel, 'level', 'levels') | |||
else | |||
return toolLevel | |||
end | |||
end, | |||
['(value)=>game.golbinRaid.startingWeapons[value].name'] = function(val) | ['(value)=>game.golbinRaid.startingWeapons[value].name'] = function(val) | ||
-- For golbin raid starting weapons | -- For golbin raid starting weapons | ||
Line 980: | Line 997: | ||
for i, subVal in ipairs(valueArray) do | for i, subVal in ipairs(valueArray) do | ||
local resultText = modText | local resultText = modText | ||
-- A few modifiers don't have official descriptions; Fallback to manual ones instead | |||
if string.match(resultText, 'UNDEFINED TRANSLATION') then | |||
resultText = modifierTypes[modName].text | |||
end | |||
local modMagnitude = nil | local modMagnitude = nil | ||
if type(subVal) == 'table' and subVal.skillID ~= nil then | if type(subVal) == 'table' and subVal.skillID ~= nil then | ||
Line 994: | Line 1,015: | ||
resultText = string.gsub(resultText, '${value}', function(rule) return (formatModValue(modMagnitude, rule) or '') end) | resultText = string.gsub(resultText, '${value}', function(rule) return (formatModValue(modMagnitude, rule) or '') end) | ||
if doColor then | if doColor then | ||
local colorCode = (isNegative ~= nil and isNegative and 'color:red' or 'color:green') | local colorCode = (isNegative ~= nil and isNegative and 'color:red' or 'color:green') | ||
Line 1,175: | Line 1,192: | ||
end | end | ||
modDiff[modName] = (modDiff[modName] or 0) + math.abs(value) | modDiff[modName] = (modDiff[modName] or 0) + math.abs(value) | ||
if GameData.rawData.modifierData[modName] == nil then | |||
modDiff[modName] = nil | |||
end | |||
end | end | ||
end | end |