Anonymous

Module:Constants: Difference between revisions

From Melvor Idle
Correct RegenerationInterval attributes
(Correct Slayer function issues)
(Correct RegenerationInterval attributes)
(4 intermediate revisions by the same user not shown)
Line 65: Line 65:
["MaxHitPercent"] = { text = "{V}% Max Hit", skills = {'Combat'} },
["MaxHitPercent"] = { text = "{V}% Max Hit", skills = {'Combat'} },
["AltMagicSkillXP"] = { text = "{V}% Alt. Magic Skill XP", skills = {'Magic'} },
["AltMagicSkillXP"] = { text = "{V}% Alt. Magic Skill XP", skills = {'Magic'} },
["MinAirSpellDmg"] = { text = "{VX} Min Air Spell Dmg", skills = {'Combat'} },
["MinAirSpellDmg"] = { text = "{VX} Min Air Spell Dmg", skills = {'Magic'} },
["AutoEatEfficiency"] = { text = "{V}% Auto Eat Efficiency", skills = {'Combat'} },
["AutoEatEfficiency"] = { text = "{V}% Auto Eat Efficiency", skills = {'Combat'} },
["GPFromThieving"] = { text = "{V}% GP From Thieving", skills = {'Thieving'} },
["GPFromThieving"] = { text = "{V}% GP From Thieving", skills = {'Thieving'} },
Line 309: Line 309:
["PoisonReflectChance"] = { text = "{V}% chance to poison attackers when hit", skills = {'Combat'} },
["PoisonReflectChance"] = { text = "{V}% chance to poison attackers when hit", skills = {'Combat'} },
["rangedImmunity"] = { text = "Immune to Ranged attacks", skills = {'Combat'} },
["rangedImmunity"] = { text = "Immune to Ranged attacks", skills = {'Combat'} },
["RegenerationInterval"] = { text = "{VMS}s Hitpoint Regeneration interval", skills = {'Combat'} },
["RegenerationInterval"] = { text = "{VMS}s Hitpoint Regeneration interval", isIncreaseNegative = true, skills = {'Combat'} },
["slowImmunity"] = { text = "{V}% chance to ignore Slow effects", skills = {'Combat'} },
["slowImmunity"] = { text = "{V}% chance to ignore Slow effects", skills = {'Combat'} },
["SurgeSpellAccuracy"] = { text = "{V}% Accuracy Rating when using Surge spells", skills = {'Combat'} },
["SurgeSpellAccuracy"] = { text = "{V}% Accuracy Rating when using Surge spells", skills = {'Combat'} },
Line 409: Line 409:
return Shared.titleCase(styleName)
return Shared.titleCase(styleName)
end
end
elseif type(styleNum) == 'string' and type(ConstantData.attackType[string.lower(styleNum)]) == 'number' then
return Shared.titleCase(styleNum)
end
end
return "ERROR: Invalid combat style[[Category:Pages with script errors]]"
return "ERROR: Invalid combat style[[Category:Pages with script errors]]"
Line 443: Line 445:


function p.getSlayerTierByLevel(level) -- returns a full table
function p.getSlayerTierByLevel(level) -- returns a full table
if type(level) ~= 'number' or level < 0 then
if type(level) ~= 'number' or level < 1 then
return "ERROR: Invalid Slayer level [[Category:Pages with script errors]]"
return "ERROR: Invalid Slayer level [[Category:Pages with script errors]]"
end
end
for i, tier in ipairs(ConstantData.Slayer.Tiers) do
for i, tier in ipairs(ConstantData.Slayer.Tiers) do
if tier.minLevel <= level and (tier.maxLevel == nil) or (tier.maxLevel >= level) then
if tier.minLevel <= level and (tier.maxLevel == nil or tier.maxLevel >= level) then
return p.getSlayerTierByID(i - 1)
return p.getSlayerTierByID(i - 1)
end
end
Line 523: Line 525:
['VX'] = function(val) return val * 10 end,
['VX'] = function(val) return val * 10 end,
['VX100'] = function(val) return val * 100 end,
['VX100'] = function(val) return val * 100 end,
['V%+100'] = function(val) return val + 100 end,
['V+100'] = function(val) return val + 100 end,
['VMUL'] = function(val) return 2^val end,
['VMUL'] = function(val) return 2^val end,
['VITEM'] = function(val)
['VITEM'] = function(val)