12,714
edits
m (Correct value representation for RolledReflectDamage modifier) |
m (Add missing modifier skill) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 8: | Line 8: | ||
--Just hardcoding these because I guess that's where we're at | --Just hardcoding these because I guess that's where we're at | ||
local modifierTypes = { | local modifierTypes = { | ||
["MeleeStrengthBonus"] = { text = "{V}% Melee Strength Bonus", skills = {'Combat'} }, | ["MeleeStrengthBonus"] = { text = "{V}% Melee Strength Bonus from Equipment", skills = {'Combat'} }, | ||
["DamageToDungeonMonsters"] = { text = "{V}% Damage To Dungeon Monsters", skills = {'Combat'} }, | ["DamageToDungeonMonsters"] = { text = "{V}% Damage To Dungeon Monsters", skills = {'Combat'} }, | ||
["GlobalMasteryXP"] = { text = "{V}% Global Mastery XP", skills = {'Woodcutting', 'Fishing', 'Firemaking', 'Cooking', 'Mining', 'Smithing', 'Thieving', 'Farming', 'Fletching', 'Crafting', 'Runecrafting', 'Herblore', 'Agility', 'Summoning', 'Astrology'} }, | ["GlobalMasteryXP"] = { text = "{V}% Global Mastery XP", skills = {'Woodcutting', 'Fishing', 'Firemaking', 'Cooking', 'Mining', 'Smithing', 'Thieving', 'Farming', 'Fletching', 'Crafting', 'Runecrafting', 'Herblore', 'Agility', 'Summoning', 'Astrology'} }, | ||
Line 81: | Line 81: | ||
["AttackRolls"] = { text = "+Lucky Hit Chance (Roll twice, take the better result)", skills = {'Combat'} }, | ["AttackRolls"] = { text = "+Lucky Hit Chance (Roll twice, take the better result)", skills = {'Combat'} }, | ||
["AmmoPreservation"] = { text = "{V}% Ammo Preservation", skills = {'Ranged'} }, | ["AmmoPreservation"] = { text = "{V}% Ammo Preservation", skills = {'Ranged'} }, | ||
["RangedStrengthBonus"] = { text = "{V}% Ranged Strength Bonus", skills = {'Combat'} }, | ["RangedStrengthBonus"] = { text = "{V}% Ranged Strength Bonus from Equipment", skills = {'Combat'} }, | ||
["MagicDamageBonus"] = { text = "{V}% Magic Damage Bonus", skills = {'Combat'} }, | ["MagicDamageBonus"] = { text = "{V}% Magic Damage Bonus from Equipment", skills = {'Combat'} }, | ||
["MasteryXP"] = { text = "{V}% {SV0} Mastery XP" }, | ["MasteryXP"] = { text = "{V}% {SV0} Mastery XP" }, | ||
["dungeonEquipmentSwapping"] = { text = "{V} Dungeon Equipment Swapping", skills = {'Combat'} }, | ["dungeonEquipmentSwapping"] = { text = "{V} Dungeon Equipment Swapping", skills = {'Combat'} }, | ||
Line 122: | Line 122: | ||
["summoningSynergy_3_11"] = {text = "When successfully pickpocketing the Lumberjack in Thieving, grants {V} Bird Nest instead of GP.", skills = {'Thieving'}}, | ["summoningSynergy_3_11"] = {text = "When successfully pickpocketing the Lumberjack in Thieving, grants {V} Bird Nest instead of GP.", skills = {'Thieving'}}, | ||
["summoningSynergy_3_16"] = {text = "In Woodcutting, {V}% chance for a random Silver or Gold Jewelry to drop instead of a Bird Nest.", skills = {'Woodcutting'}}, | ["summoningSynergy_3_16"] = {text = "In Woodcutting, {V}% chance for a random Silver or Gold Jewelry to drop instead of a Bird Nest.", skills = {'Woodcutting'}}, | ||
["summoningSynergy_3_17"] = {text = "{V}% chance to gain +1 Base Logs from Woodcutting, or produced Items from Smithing.", skills = {'Woodcutting'}}, | ["summoningSynergy_3_17"] = {text = "{V}% chance to gain +1 Base Logs from Woodcutting, or produced Items from Smithing.", skills = {'Woodcutting', 'Smithing'}}, | ||
["summoningSynergy_3_18"] = {text = "While the Bird Nest Potion is active in Woodcutting, grants {V} minimum Bird Nest.", skills = {'Woodcutting'}}, | ["summoningSynergy_3_18"] = {text = "While the Bird Nest Potion is active in Woodcutting, grants {V} minimum Bird Nest.", skills = {'Woodcutting'}}, | ||
["summoningSynergy_3_19"] = {text = "{V}% of Woodcutting Skill XP is earned as Firemaking Skill XP. Chance to double Logs is halved.", skills = {'Woodcutting', 'Firemaking'}}, | ["summoningSynergy_3_19"] = {text = "{V}% of Woodcutting Skill XP is earned as Firemaking Skill XP. Chance to double Logs is halved.", skills = {'Woodcutting', 'Firemaking'}}, | ||
Line 255: | Line 255: | ||
["RedemptionPercent"] = { text = "{V}% of max hitpoints healed on redemption", skills = {'Combat'} }, | ["RedemptionPercent"] = { text = "{V}% of max hitpoints healed on redemption", skills = {'Combat'} }, | ||
["RedemptionThreshold"] = { text = "{V}% redemption threshold", skills = {'Combat'} }, | ["RedemptionThreshold"] = { text = "{V}% redemption threshold", skills = {'Combat'} }, | ||
["RolledReflectDamage"] = { text = "{S}0-{VX} Reflect Damage" | ["RolledReflectDamage"] = { text = "{S}0-{VX} Reflect Damage", unsigned = true, skills = {'Combat'} }, | ||
["RuneProvision"] = { text = "Rune providing items provide {VMUL}x as many runes", skills = {'Combat'} }, | ["RuneProvision"] = { text = "Rune providing items provide {VMUL}x as many runes", skills = {'Combat'} }, | ||
["SecondaryFoodBurnChance"] = { text = "{V}% Secondary Chance to burn food when Cooking", isIncreaseNegative = true, skills = {'Cooking'} }, | ["SecondaryFoodBurnChance"] = { text = "{V}% Secondary Chance to burn food when Cooking", isIncreaseNegative = true, skills = {'Cooking'} }, | ||
Line 298: | Line 298: | ||
["frostBurnImmunity"] = { text = "{V}% chance to ignore Frostburn", skills = {'Combat'} }, | ["frostBurnImmunity"] = { text = "{V}% chance to ignore Frostburn", skills = {'Combat'} }, | ||
["globalEvasionHPScaling"] = { text = "Evasion Ratings are multiplied by {V} times current Hitpoints percent", skills = {'Combat'} }, | ["globalEvasionHPScaling"] = { text = "Evasion Ratings are multiplied by {V} times current Hitpoints percent", skills = {'Combat'} }, | ||
["GPFromFiremaking"] = { text = "{V}% GP from Firemaking.", skills = {'Firemaking'} }, | |||
["infiniteLootContainer"] = { text = "The loot container has an infinite amount of slots", skills = {'Combat'} }, | ["infiniteLootContainer"] = { text = "The loot container has an infinite amount of slots", skills = {'Combat'} }, | ||
["magicImmunity"] = { text = "Immune to Magic attacks", skills = {'Combat'} }, | ["magicImmunity"] = { text = "Immune to Magic attacks", skills = {'Combat'} }, | ||
Line 330: | Line 331: | ||
[6] = 'Insane'} | [6] = 'Insane'} | ||
function p.getTriangleAttribute(attribute, attackerStyle, targetStyle, mode) | |||
if type(attribute) ~= 'string' then | |||
error("Parameter 'attribute' must be a string", 2) | |||
elseif type(attackerStyle) ~= 'string' then | |||
error("Parameter 'attackerStyle' must be a string", 2) | |||
elseif type(targetStyle) ~= 'string' then | |||
error("Parameter 'targetStyle' must be a string", 2) | |||
elseif type(mode) ~= 'string' then | |||
error("Parameter 'mode' must be a string", 2) | |||
end | |||
local modeID = p.getGamemodeID(mode) | |||
if modeID == nil then | |||
error("Invalid gamemode '" .. mode .. "'", 2) | |||
end | |||
} | |||
local attStyle, targStyle = string.lower(attackerStyle), string.lower(targetStyle) | |||
local validStyles = { 'magic', 'melee', 'ranged' } | |||
if not Shared.contains(validStyles, string.lower(attStyle)) then | |||
error("Invalid value for parameter 'attackerStyle'", 2) | |||
elseif not Shared.contains(validStyles, string.lower(targStyle)) then | |||
error("Invalid value for parameter 'targetStyle'", 2) | |||
end | |||
local triangleID = ConstantData.Gamemode.Data[modeID + 1].combatTriangle | |||
local attrData = ConstantData.CombatTriangle[triangleID + 1][attribute] | |||
if attrData == nil then | |||
error("No such attribute: " .. attribute) | |||
else | else | ||
return | return attrData[attStyle][targStyle] | ||
end | end | ||
end | |||
function p.getTriangleDamageModifier(attackerStyle, targetStyle, mode) | |||
return p.getTriangleAttribute('damageModifier', attackerStyle, targetStyle, mode) | |||
end | end | ||
--Syntax is like p.getTriangleDRModifier('Melee', 'Ranged', 'Normal') | --Syntax is like p.getTriangleDRModifier('Melee', 'Ranged', 'Normal') | ||
--Returns a multiplier that can be multiplied with base DR to get the post-Triangle result | --Returns a multiplier that can be multiplied with base DR to get the post-Triangle result | ||
function p.getTriangleDRModifier( | function p.getTriangleDRModifier(attackerStyle, targetStyle, mode) | ||
return p.getTriangleAttribute('reductionModifier', attackerStyle, targetStyle, mode) | |||
end | end | ||
Line 395: | Line 392: | ||
function p.getEquipmentSlotID(name) | function p.getEquipmentSlotID(name) | ||
return ConstantData.equipmentSlot[name] | return ConstantData.equipmentSlot[name] | ||
end | |||
function p.getGamemodeName(id) | |||
return ConstantData.Gamemode.Enum[id] | |||
end | |||
function p.getGamemodeID(name) | |||
return ConstantData.Gamemode.Enum[name] | |||
end | end | ||