Module:Constants: Difference between revisions

Updated Arch Tool Level display, Fixed error on nil modifiers in getModifiersDifference
(Preparation for 1.2/AoD)
(Updated Arch Tool Level display, Fixed error on nil modifiers in getModifiersDifference)
 
(14 intermediate revisions by 3 users not shown)
Line 5: Line 5:


--Just hardcoding these because I guess that's where we're at
--Just hardcoding these because I guess that's where we're at
--getModifierSkills still needs skills, otherwise this can be removed
local modifierTypes = {
local modifierTypes = {
["MeleeStrengthBonus"] = { text = "{V}% Melee Strength Bonus from Equipment", 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', 'Archaeology'} },
["ChanceRandomPotionHerblore"] = { text = "{V}% chance to gain a second potion of a random tier", skills = {'Herblore'} },
["ChanceRandomPotionHerblore"] = { text = "{V}% chance to gain a second potion of a random tier", skills = {'Herblore'} },
["FlatPrayerCostReduction"] = { text = "{V} Prayer Point Cost for Prayers", inverseSign = true, skills = {'Prayer'} },
["FlatPrayerCostReduction"] = { text = "{V} Prayer Point Cost for Prayers (Prayer Point cost cannot go below 1)", inverseSign = true, skills = {'Prayer'} },
["MinEarthSpellDmg"] = { text = "{VX} Min Earth Spell Dmg", skills = {'Magic'} },
["MinEarthSpellDmg"] = { text = "{VX} Min Earth Spell Dmg", skills = {'Magic'} },
["SlayerTaskLength"] = { text = "{V}% Slayer Task Length/Qty", skills = {'Slayer'} },
["SlayerTaskLength"] = { text = "{V}% Slayer Task Length/Qty", skills = {'Slayer'} },
Line 206: Line 207:
["Decay"] = { text = "{V}% of Maximum Hitpoints taken as damage on a successful attack (once per turn)", isIncreaseNegative = true, skills = {'Combat'} },
["Decay"] = { text = "{V}% of Maximum Hitpoints taken as damage on a successful attack (once per turn)", isIncreaseNegative = true, skills = {'Combat'} },
["doubleItemsSkill"] = { text = "x{VMUL} Items received from {SV0}", unsigned = true },
["doubleItemsSkill"] = { text = "x{VMUL} Items received from {SV0}", unsigned = true },
["doubleOresMining"] = { text = "x{VMUL} Ores received from Mining", unsigned = true, skills = {'Mining'} },
["doubleOresMining"] = { text = "x2 Ores received from Mining", unsigned = true, skills = {'Mining'} },
["DragonBreathDamage"] = { text = "{V}% damage taken from dragonbreath", isIncreaseNegative = true, skills = {'Combat'} },
["DragonBreathDamage"] = { text = "{V}% damage taken from dragonbreath", isIncreaseNegative = true, skills = {'Combat'} },
["FiremakingCoalChance"] = { text = "{V}% chance to receive coal when burning logs in Firemaking", skills = {'Firemaking'} },
["FiremakingCoalChance"] = { text = "{V}% chance to receive coal when burning logs in Firemaking", skills = {'Firemaking'} },
Line 245: Line 246:
["poisonImmunity"] = { text = "{V}% chance to ignore poison", skills = {'Combat'} },
["poisonImmunity"] = { text = "{V}% chance to ignore poison", skills = {'Combat'} },
["PoisonLifesteal"] = { text = "{V}% Poison lifesteal", skills = {'Combat'} },
["PoisonLifesteal"] = { text = "{V}% Poison lifesteal", skills = {'Combat'} },
["PrayerCost"] = { text = "{V}% Prayer Point Cost for Prayers", isIncreaseNegative = true, skills = {'Prayer'} },
["PrayerCost"] = { text = "{V}% Prayer Point Cost for Prayers (Prayer Point cost cannot go below 1)", isIncreaseNegative = true, skills = {'Prayer'} },
["RangedCritChance"] = { text = "{V}% Ranged critical hit chance", skills = {'Ranged'} },
["RangedCritChance"] = { text = "{V}% Ranged critical hit chance", skills = {'Ranged'} },
["RangedLifesteal"] = { text = "{V}% Ranged Lifesteal", skills = {'Ranged'} },
["RangedLifesteal"] = { text = "{V}% Ranged Lifesteal", skills = {'Ranged'} },
Line 392: 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 {V} Deadly Toxins Potion(s) as an additional Potion (Cannot be doubled)", skills = {'Herblore'} },
["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 608: Line 609:
["MasteryTokens"] = { text = "{V} Mastery Tokens received", skills = {'Woodcutting', 'Fishing', 'Firemaking', 'Cooking', 'Mining', 'Smithing', 'Thieving', 'Farming', 'Fletching', 'Crafting', 'Runecrafting', 'Herblore', 'Agility', 'Summoning', 'Astrology'} },
["MasteryTokens"] = { text = "{V} Mastery Tokens received", skills = {'Woodcutting', 'Fishing', 'Firemaking', 'Cooking', 'Mining', 'Smithing', 'Thieving', 'Farming', 'Fletching', 'Crafting', 'Runecrafting', 'Herblore', 'Agility', 'Summoning', 'Astrology'} },
["TownshipRepairCost"] = { text = "{V}% Township repair costs", isIncreaseNegative = true, skills = {'Township'} },
["TownshipRepairCost"] = { text = "{V}% Township repair costs", isIncreaseNegative = true, skills = {'Township'} },
["TownshipTraderCost"] = { text = "{V}% Township Trader costs", isIncreaseNegative = true, skills = {'Township'} }
["TownshipTraderCost"] = { text = "{V}% Township Trader costs", isIncreaseNegative = true, skills = {'Township'} },
-- New 1.2 modifiers
["AccuracyIfCursed"] = { text = "{V}% Global Accuracy when Cursed", isIncreaseNegative = true, skills = {'Combat'} },
["agilityItemCostReductionCanReach100"] = { text = "Item cost reduction in Agility can now reach 100%", skills = {'Agility'} },
["AgilityObstacleItemCost"] = { text = "{V}% Agility Obstacle Item Costs", skills = {'Agility'}, isIncreaseNegative = true },
["allowUnholyPrayerUse"] = { text = "Allow Unholy Prayer Use", unsigned = true, skills = {'Combat', 'Prayer'} },
["AmmoPreservationBypass"] = { text = "{V}% Ammo Preservation (Bypass Gamemode Limitation)", skills = {'Combat', 'Ranged'} },
["applyAttackMasterRelicEffect"] = { text = "Apply -1% Melee Evasion to the Target per hit, stacking up to 30 times and lasts until the end of the fight", skills = {'Combat'} },
["applyMagicMasterRelicEffect"] = { text = "Start the fight with 100% Magic Critical Hit chance, which decreases by 20% per Attack Turn", skills = {'Combat'} },
["applyStrengthMasterRelicEffect"] = { text = "Apply 1 stack of Rage to self per Attack Turn, stacking up to 10 times and resetting at max stacks", skills = {'Combat'} },
["ArchaeologyCommonItemSkillXP"] = { text = "{V}% Archaeology Skill XP when locating a Common Artefact", skills = {'Archaeology'} },
["archaeologyVeryRareMapPreservation"] = { text = "Finding a Very Rare or Super Rare item in Archaeology will use no Dig Site Map excavation charges", skills = {'Archaeology'} },
["ArrowProduction"] = { text = "{V} Arrows produced per action in Fletching" },
["BarrierSummonDamage"] = { text = "{V}% Summoning Familiar damage added as extra damage to Barrier", skills = {'Combat'} },
["BarrierSummonDamageIfSlayerTask"] = { text = "{V}% Barrier damage added to Summon Familiar if target is current Slayer Task", skills = {'Combat'} },
["BaseCraftingConsumableProduction"] = { text = "{V} base quantity of Consumables produced per action in Crafting" },
["BoltSpellMaxHitFlat"] = { text = "{VX} Max Hit when using Bolt spells", skills = {'Combat'} },
["BrushToolLevel"] = { text = "{V} Brush tool level", skills = {'Archaeology'} },
["BurnReflectChance"] = { text = "{V}% chance to inflict a Burn to the Attacker when hit", skills = {'Combat'} },
["ChanceAdditionalSoup"] = { text = "{V} chance to receive an additional Soup from Cooking (Cannot be doubled)", skills = {'Cooking'} },
["ChanceBarrierBleed"] = { text = "{V}% chance for Summon to apply a Barrier Bleed to the enemy that deals damage equal to 200% Summon Max Hit over 10s", skills = {'Combat'} },
["ChanceBarrierBurn"] = { text = "{V}% chance for Summon to apply a Barrier Burn to the enemy", skills = {'Combat'} },
["ChanceCrystallization"] = { text = "{V}% chance to apply Crystallization (Target is stunned and takes +50% Damage during effect)", skills = {'Combat'} },
["ChanceCrystalSanction"] = { text = "{V}% chance to apply Crystal Sanction to the Target (Next Attack Turn from Target deals no Damage)", skills = {'Combat'} },
["ChanceForChestOfGemsInWoodcutting"] = { text = "{V}% chance to obtain a Chest of Gems per Woodcutting action", skills = {'Woodcutting'} },
["ChanceForEnchantedUrnInCrafting"] = { text = "{V}% chance for Urns produced in Crafting to be Enchanted", skills = {'Crafting'} },
["ChanceForGoldFromCrafting30"] = { text = "{V}% chance to to gain GP equal to 30% of the base sale price of the Item crafted in Crafting", skills = {'Skilling', 'Fishing'} },
["ChanceForGPFromFishing"] = { text = "{V}% chance to gain GP equal to base fish sale price while Fishing", skills = {'Fishing'} },
["ChanceToApply5Slow"] = { text = "{V}% chance to apply a Slow to the Target that increases its Attack Interval by +5% for 3 Turns.", skills = {'Combat'} },
["ChanceToApplyBlind"] = { text = "{V}% chance to apply -20% Global Accuracy to the Target when hit", skills = {'Combat'} },
["ChanceToApplyConfusionCurse"] = { text = "{V}% chance to apply Confusion Curse to the Target per hit", skills = {'Combat'} },
["ChanceToCatchExtraSameAreaFish"] = { text = "{V}% chance to catch +1 random Fish from the same Fishing Area (Cannot be doubled)", skills = {'Skilling', 'Fishing'} },
["ChanceToCleanse"] = { text = "{V}% to apply Cleanse to self for 2 turns (Immune to all debuffs and damage over time effects)", skills = {'Combat'} },
["ChanceToDodge"] = { text = "{V}% chance to convert a successful hit from the Target into a miss", skills = {'Combat'} },
["ChanceToDodgeCrystallization"] = { text = "{V}% chance to dodge Crystallization from being applied", skills = {'Combat'} },
["ChanceToDodgeCrystalSanction"] = { text = "{V}% chance to dodge Crystal Sanction from being applied", skills = {'Combat'} },
["ChanceToLocateAncientRelic"] = { text = "{V}% increased chance to locate Ancient Relics" },
["ChanceToLocateSkillPet"] = { text = "{V}% increased chance to locate a Skill Pet" },
["ChanceToNull"] = { text = "{V}% chance to apply Null to the Target for 2 Turns (Prevents the Target from applying buffs or modifier effects to themself).", skills = {'Combat'} },
["ChanceToPreserveMapCharges"] = { text = "{V}% chance to preserve dig site map excavation actions", skills = {'Cartography'} },
["ChanceToPreservePrayerPointsPerPoint"] = { text = "{V}% chance to preserve Prayer Points per Prayer Point cost of active Prayers", skills = {'Combat'} },
["ChanceToPreserveUnholyPrayerPoints"] = { text = "{V}% chance to preserve Prayer Points for Unholy Prayers", skills = {'Combat', 'Prayer'} },
["ChanceToReceiveNoCombatDrops"] = { text = "{V}% chance to receive no Combat drops from Monsters or Dungeons", isIncreaseNegative = true, skills = {'Combat'} },
["ChanceWeakeningTouch"] = { text = "{V}% chance to apply Weakening Touch to the Target", skills = {'Combat'} },
["cleansed"] = { text = "Immune to all debuffs and damage over time effects", skills = {'Combat'} },
["CombinationRuneProduction"] = { text = "{V} Combination Runes produced per action in Runecrafting", skills = {'Runecrafting'} },
["convertBoneDropsIntoCake"] = { text = "Converts all Bone drops from Combat into Birthday Cake Slice drops", skills = {'Comabt'} },
["CookingIntervalForBasicSoup"] = { text = "{V}% Cooking Interval when making Basic Soup", isIncreaseNegative = true, skills = {'Cooking'} },
["crystallized"] = { text = "Modifier to determined status of crystallized effect", skills = {'Combat'} },
["CurseOnHitWithUnholyMark"] = { text = "{V}% chance to apply a random Curse when hitting with an attack if the target has Unholy Mark", skills = {'Combat'} },
["DamageBasedOnCurrentHitpoints"] = { text = "{V}% of target's current hitpoints dealt as damage when hitting with an attack", skills = {'Combat'} },
["DamageBasedOnMaxHitpoints"] = { text = "{V}% of target's max hitpoints dealt as damage when hitting with an attack", skills = {'Combat'} },
["DamageDealtPerEffect"] = { text = "{V}% damage dealt per effect affected by", skills = {'Combat'} },
["DamageDealtWith2Effects"] = { text = "{V}% damage dealt if affected by 2 or more effects", skills = {'Combat'} },
["DamageReductionIfCursed"] = { text = "{V}% Damage Reduction when Cursed", isIncreaseNegative = true, skills = {'Combat'} },
["DamageReductionPer30Defence"] = { text = "{V}% Damage Reduction per 30 Defence Skill Levels", skills = {'Combat'} },
["DamageReductionWithActivePrayer"] = { text = "{V}% Damage Reduction when at least one Prayer is active", skills = {'Combat'} },
["DamageTakenBasedOnHP"] = { text = "{V}% damage taken per percent of hitpoints missing", isIncreaseNegative = true, skills = {'Combat'} },
["DamageTakenIfCursed"] = { text = "{V}% damage taken when Cursed", isIncreaseNegative = true, skills = {'Combat'} },
["DamageTakenWhenSlowed"] = { text = "{V}% damage taken when Slowed", isIncreaseNegative = true, skills = {'Combat'} },
["DigSiteMapCharges"] = { text = "{V} Dig Site Map excavation actions", skills = {'Cartography'} },
["DigSiteMapSlots"] = { text = "{V} Dig Site Map slots", skills = {'Cartography'} },
["disableAttackDamage"] = { text = "Disables all damage from Attacks", skills = {'Combat'} },
["disabledSpecialAttacks"] = { text = "All player special attacks are disabled", isIncreaseNegative = true, skills = {'Combat'} },
["disableTownshipHealthDegradation"] = { text = "Township Health no longer degrades", skills = {'Township'} },
["doubleActiveModifiersCartography"] = { text = "Doubles the effects of all positive Active Modifiers from Point of Interests in Cartography", skills = {'Archaeology'} },
["doubleConsumablesArchaeology"] = { text = "x{VMUL} Consumable Items received from Archaeology", unsigned = true, skills = {'Archaeology'} },
["doubleModifiersInAstrologyForMaxedConstellations"] = { text = "All modifiers in a completed Astrology Constellation are doubled", skills = {'Astrology'} },
["Elusive"] = { text = "When Target is hit, +3% Global Evasion Rating and -1% Attack Interval (Stacks 10 times)", skills = {'Combat'} },
["enableBarrierBurn"] = { text = "Burns can now damage Barrier", skills = {'Combat'} },
["enableLemonSeason"] = { text = "There is a 20% chance of a Lemon Season occurring in Township", skills = {'Township'} },
["EnemyMaximumHitpoints"] = { text = "{V}% Maximum Hitpoints for the Target", skills = {'Combat'}, isIncreaseNegative = true },
["EvasionIfCursed"] = { text = "{V}% Global Evasion when Cursed", isIncreaseNegative = true, skills = {'Combat'} },
["FlatBarrierDamage"] = { text = "{VX} Flat Barrier damage dealt by Attacker per Attack Turn", skills = {'Combat'} },
["FlatBarrierSummonDamage"] = { text = "{VX} Flat Barrier damage added to Summon Familiar", skills = {'Combat'} },
["FlatBarrierSummonDamageMagic"] = { text = "{VX} Flat Barrier damage added to Summon Familiar if using Magic", skills = {'Combat'} },
["FlatBarrierSummonDamageMelee"] = { text = "{VX} Flat Barrier damage added to Summon Familiar if using Melee", skills = {'Combat'} },
["FlatBarrierSummonDamageRanged"] = { text = "{VX} Flat Barrier damage added to Summon Familiar if using Ranged", skills = {'Combat'} },
["FrostburnReflectChance"] = { text = "{V}% chance to inflict Frostburn to the Attacker when hit", skills = {'Combat'} },
["gain2MaxHitpointsPerTurn"] = { text = "+2% maximum Hitpoints per Turn (Maximum 10 stacks)", skills = {'Combat'} },
["GlobalFreezeChance"] = { text = "{V}% chance to apply Freeze for 1 Attack Turn when hitting with any attack (once per turn)", skills = {'Combat'} },
["GlobalPreservationChanceBypass"] = { text = "{V}% Chance to Preserve Resources in Skills (Bypass Gamemode Limitation)" },
["GPFlat"] = { text = "{V} GP gained when earning GP, except Alt. Magic and Item Sales" },
["GPFromBarrierDamage"] = { text = "Grants GP equal to {VD}% damage dealt to Barrier", skills = {'Combat'} },
["GPFromLogSales"] = { text = "{V}% GP From Log Sales", skills = {'Woodcutting'} },
["GPFromRawFishSales"] = { text = "{V}% GP From Raw Fish Sales", skills = {'Fishing'} },
["GPPerArchaeologyLevelNoArtefact"] = { text = "Gain GP equal to {V} per Archaeology Skill Level per excavation action that locates no Artefacts", skills = {'Archaeology'} },
["halfAttackInterval"] = { text = "UNDEFINED TRANSLATION: :MODIFIER_DATA_halfAttackInterval", skills = {'Combat'} },
["halfMasteryXP"] = { text = "UNDEFINED TRANSLATION: :MODIFIER_DATA_halfMasteryXP" },
["halfSkillInterval"] = { text = "UNDEFINED TRANSLATION: :MODIFIER_DATA_halfSkillInterval" },
["halfSkillXP"] = { text = "UNDEFINED TRANSLATION: :MODIFIER_DATA_halfSkillXP" },
["HealEvery200Int"] = { text = "Heal for {V}% current Hitpoints every 0.2s", skills = {'Combat'} },
["HealingWhenHit"] = { text = "{V}% of max hitpoints healed when hit by an attack", skills = {'Combat'} },
["HexTravelCost"] = { text = "{V}% Cartography travel costs", isIncreaseNegative = true, skills = {'Cartography'} },
["HiddenSkillLevelBasedOnLevels"] = { text = "{V}% of your {SV0} Level added as Hidden {SV0} Levels", isSkill = true, skills = {'Combat'} },
["HiddenSkillLevelPer2Levels"] = { text = "{V} Hidden {SV0} Level for every 2 levels of {SV0}", isSkill = true, skills = {'Combat'} },
["HolyDustFromBlessedOffering"] = { text = "{V} Holy Dust obtained from Blessed Offering Alt. Magic Spell (cannot be doubled)", skills = {'Combat'} },
["InitialMapArtefactValues"] = { text = "{V}% initial artefact values when creating maps in Cartography", skills = {'Cartography'} },
["LargeArtefactChance"] = { text = "{V}% chance to find Large Artefacts in Archaeology", skills = {'Archaeology'} },
["LargeArtefactValue"] = { text = "{V} Large Artefact value", skills = {'Archaeology'} },
["LemonsPerAction"] = { text = "{V} Lemons granted per non-Combat action", skills = {'Township'} },
["LifestealDamageBasedOnCurrentHitpoints"] = { text = "{V}% of target's current hitpoints dealt as damage and healed when hitting with an attack", skills = {'Combat'} },
["MagicMaxHitWithActivePrayer"] = { text = "{V}% Magic Max Hit when at least one Prayer is active", skills = {'Combat'} },
["MapRefinementCost"] = { text = "{V}% dig site map refinement cost", isIncreaseNegative = true, skills = {'Cartography'} },
["MapUpgradeActions"] = { text = "{V}% Dig Site Map excavation actions when upgrading in Cartography", skills = {'Cartography'} },
["MapUpgradeInterval"] = { text = "{V}% Cartography Dig Site Map upgrade interval", isIncreaseNegative = true, skills = {'Cartography'} },
["MaxHitBasedOnPrayerCost"] = { text = "{V}% Maximum Hit per Prayer Point cost of active Prayers", skills = {'Combat'} },
["MaxHitIfCursed"] = { text = "{V}% Maximum Hit when Cursed", isIncreaseNegative = true, skills = {'Combat'} },
["MaxHitPercentBasedOnTargetCurrentHitpoints"] = { text = "{V}% Maximum Hit for each 1% of Target current Hitpoints remaining", skills = {'Combat'} },
["MediumArtefactChance"] = { text = "{V}% chance to find Medium Artefacts in Archaeology", skills = {'Archaeology'} },
["MediumArtefactValue"] = { text = "{V} Medium Artefact value", skills = {'Archaeology'} },
["MeleeAccuracyMaxHitPer8Strength"] = { text = "{V}% Melee Accuracy and Melee Max Hit per 8 Strength Skill Levels (Floored)", skills = {'Combat'} },
["MeleeAttackIntervalPercent"] = { text = "{V}% Melee Attack Interval", skills = {'Combat', 'Attack'}, isIncreaseNegative = true },
["MeleeStrengthBonusBasedOnSkillLevel"] = { text = "{V} Melee Strength Bonus based on your current {SV0} Level", isSkill = true, skills = {'Combat'} },
["MeleeStrengthBonusPer10EnemyDR"] = { text = "{V}% Melee Strength Bonus from equipment per 10% base enemy damage reduction", skills = {'Combat'} },
["MinimumItemsFoundInArchaeology"] = { text = "{V} minimum Items found in Archaeology", skills = {'Archaeology'} },
["MinimumTownshipBuildingEfficiency"] = { text = "{V}% minimum Township building efficiency", skills = {'Township'} },
["MinSpellDmg"] = { text = "{VX} Minimum Spell Damage", skills = {'Combat', 'Magic'} },
["noDamageFromThievingNPCs"] = { text = "NPCs in Thieving deal no damage", skills = {'Thieving'} },
["nulled"] = { text = "Unable to apply buffs or modifier effects to self", isIncreaseNegative = true, skills = {'Combat'} },
["PaperMakingInterval"] = { text = "{V}% Cartography paper making interval", isIncreaseNegative = true, skills = {'Cartography'} },
["PotionsHerblore"] = { text = "{V} Potions created in Herblore (Cannot be doubled)", skills = {'Herblore'} },
["PrayerPointsFromBurying"] = { text = "{V} Prayer Points from Burying", skills = {'Combat', 'Prayer'} },
["PrayerPointsFromBuryingPercent"] = { text = "{V}% Prayer Points gained from burying Bones", skills = {'Combat', 'Prayer'} },
["PrayerPointsPerMonsterKill"] = { text = "{V} Prayer Points gained per Monster kill", skills = {'Combat'} },
["RangedStrengthBonusPer8Ranged"] = { text = "{V}% Ranged Strength Bonus per 8 Ranged Skill Levels (Floored)", skills = {'Combat'} },
["RegenPerDamageTaken"] = { text = "{V}% of damage taken from attacks healed on next hitpoint regeneration", skills = {'Combat'} },
["removeDebuffsFromAgility"] = { text = "Remove all debuffs from Agility Obstacles", skills = {'Agility'} },
["RunePreservationBypass"] = { text = "{V}% Rune Preservation (Bypass Gamemode Limitation)", skills = {'Combat', 'Magic'} },
["SelfDamageBasedOnCurrentHitpoints"] = { text = "Deal damage to self equal to {V}% of your current Hitpoints per hit", isIncreaseNegative = true, skills = {'Combat'} },
["ShovelToolLevel"] = { text = "{V} Shovel tool level", skills = {'Archaeology'} },
["SieveToolLevel"] = { text = "{V} Sieve tool level", skills = {'Archaeology'} },
["SightRange"] = { text = "{V} Cartography sight range", skills = {'Cartography'} },
["SmallArtefactChance"] = { text = "{V}% chance to find Small Artefacts in Archaeology", skills = {'Archaeology'} },
["SmallArtefactValue"] = { text = "{V} Small Artefact value", skills = {'Archaeology'} },
["StandardRuneProduction"] = { text = "{V} Standard Runes produced per action in Runecrafting", skills = {'Runecrafting'} },
["SurveyInterval"] = { text = "{V}% Cartography survey interval", isIncreaseNegative = true, skills = {'Cartography'} },
["SurveyRange"] = { text = "{V} Cartography survey range", skills = {'Cartography'} },
["SurveyXP"] = { text = "{V}% Cartography survey XP", skills = {'Cartography'} },
["TinyArtefactChance"] = { text = "{V}% chance to find Tiny Artefacts in Archaeology", skills = {'Archaeology'} },
["TinyArtefactValue"] = { text = "{V} Tiny Artefact value", skills = {'Archaeology'} },
["TravelEventChance"] = { text = "{V}% increased travel event chance in Cartography", skills = {'Cartography'} },
["TrowelToolLevel"] = { text = "{V} Trowel tool level", skills = {'Archaeology'} },
["underwaterEffect"] = { text = "Each Attack Turn, Attacker's Attack interval is decreased by -1% and the Target is slow by +1%. Stacks 20 times.", skills = {'Combat'} },
["UnholyMarkOnHit"] = { text = "{V} Unholy Mark stacks applied when hitting with an attack", skills = {'Combat'} },
["unlockAllSummoningSynergies"] = { text = "All Summoning Synergies are unlocked", skills = {'Summoning'} },
["XPFromMasteryTokens"] = { text = "All Mastery Tokens grant {V}% of the maximum Mastery Pool XP for the respective Skill" },
["HiddenSkillLevelPer3Levels"] = { text = "{V} Hidden {SV0} Level for every 3 levels of {SV0}" },
-- New 1.2.2 modifiers
["MinElementalSpellDmg"] = { text = "{VX} minimum Elemental Spell Damage", skills = {'Combat'} },
["SummoningAttackIntervalPercent"] = { text = "{V}% Summoning Familiar Attack Interval", isIncreaseNegative = true, skills = {'Combat'} },
["barrierRegenTurns"] = { text = "Regenerates 25% Barrier every {V} Attack Turns", skills = {'Combat'} }
}
}


Line 756: Line 908:
--- End of slayer functions
--- End of slayer functions


--Turns a modifier name like 'increasedMeleeAccuracyBonus' into several pieces of data:
--Turns a modifier name like 'increasedHPRegenFlat' into several pieces of data:
--Base Name, Text, Sign, and IsNegative
--Base Name, Description, IsNegative, and modifyValue
--ex. "MeleeAccuracyBonus", "+{V}% Melee Accuracy", "+", false
--ex. "HPRegenFlat", "+${value} Flat Hitpoints Regeneration", false, "multiplyByNumberMultiplier"
function p.getModifierDetails(modifierName)
function p.getModifierDetails(modifierName)
local baseName = modifierName
local baseName = modifierName
local isIncrease = true
local modifier = GameData.rawData.modifierData[modifierName]
local isNegative = false
local valueUnsigned = false


if Shared.startsWith(modifierName, "increased") or Shared.startsWith(modifierName, "decreased") then
baseName = string.sub(modifierName, 10)
isIncrease = Shared.startsWith(modifierName, "increased")
end
local modifier = modifierTypes[baseName]
if modifier == nil then
if modifier == nil then
return nil
return nil
end
end


local isPositive = isIncrease
if Shared.startsWith(modifierName, "increased") or Shared.startsWith(modifierName, "decreased") then
if modifier.isIncreaseNegative then
baseName = string.sub(modifierName, 10)
isPositive = not isPositive
end
end


local sign = "+"
return baseName, modifier.description, modifier.isNegative, modifier.modifyValue
if (not isIncrease and not modifier.inverseSign) or (isIncrease and modifier.inverseSign) then
sign = "-"
end
 
if type(modifier.unsigned) == 'boolean' then valueUnsigned = modifier.unsigned end
 
return baseName, modifier.text, sign, not isPositive, valueUnsigned, modifier
end
end


function p._getModifierText(modifier, value, doColor)
function p._getModifierText(modifier, value, doColor)
if doColor == nil then doColor = true end
if doColor == nil then doColor = true end
local modName, modText, sign, isNegative, valueUnsigned = p.getModifierDetails(modifier)
local modName, modText, isNegative, modifyValue = p.getModifierDetails(modifier)


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
end
 
if modifyValue ~= nil and string.match(modifyValue, 'ToolLevels') then
modifyValue = 'ArchaeologyToolLevels'
end
 
local formatModValue = function(value, rule)
local formatModValue = function(value, rule)
local ruleFunctions = {
local ruleFunctions = {
['V'] = function(val) return val end,
['value'] = function(val) return val end,
['VD'] = function(val) return val / 10 end,
['multiplyByNumberMultiplier'] = function(val) return val * 10 end,
['VMS'] = function(val) return val / 1000 end,
['divideByNumberMultiplier'] = function(val) return val / 10 end,
['VX'] = function(val) return val * 10 end,
['milliToSeconds'] = function(val) return val / 1000 end,
['VX100'] = function(val) return val * 100 end,
['(value)=>value*100'] = function(val) return val * 100 end,
['V+100'] = function(val) return val + 100 end,
['(value)=>100+value'] = function(val) return val + 100 end,
['V+1'] = function(val) return val + 1 end,
['(value)=>value+1'] = function(val) return val + 1 end,
['VMUL'] = function(val) return 2^val end,
['(value)=>Math.pow(2,value)'] = function(val) return 2^val end,
['VITEM'] = function(val)
["(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,
-- For golbin raid starting weapons
['ArchaeologyToolLevels'] = function(val)
local startingWeapons = { 'melvorD:Bronze_Scimitar', 'melvorD:Adamant_Scimitar' }
local toolLevel = '+' .. val
local itemID = startingWeapons[val + 1]
if string.match(modName, 'Sieve') then
local item = GameData.getEntityByID('items', itemID)
toolLevel = toolLevel ..  ' level of the Sieve Tool in Archaeology'
if item ~= nil then
elseif string.match(modName, 'Trowel') then
return item.name
toolLevel = toolLevel ..  ' level of the Trowel Tool in Archaeology'
else
elseif string.match(modName, 'Brush') then
return 'Unknown'
toolLevel = toolLevel ..  ' level of the Brush Tool in Archaeology'
end
elseif string.match(modName, 'Shovel') then
end
toolLevel = toolLevel ..  ' level of the Shovel Tool in Archaeology'
}
end
local ruleFunc = ruleFunctions[rule] or ruleFunctions['V']
if val > 1 then
return string.gsub(toolLevel, 'level', 'levels')
if type(value) == 'table' then
else
-- If table is a pair of values then format both & add a separator
return toolLevel
return ruleFunc(value[1]) .. '-' .. ruleFunc(value[2])
end
else
end,
return ruleFunc(value)
['(value)=>game.golbinRaid.startingWeapons[value].name'] = function(val)
-- For golbin raid starting weapons
local startingWeapons = { 'melvorD:Bronze_Scimitar', 'melvorD:Adamant_Scimitar' }
local itemID = startingWeapons[val + 1]
local item = GameData.getEntityByID('items', itemID)
if item ~= nil then
return item.name
else
return 'Unknown'
end
end
end
}
local ruleFunc = ruleFunctions[modifyValue] or ruleFunctions['value']
if type(value) == 'table' then
-- If table is a pair of values then format both & add a separator
return ruleFunc(value[1]) .. '-' .. ruleFunc(value[2])
else
return ruleFunc(value)
end
end
end


local valueArray, resultArray = nil, {}
local valueArray, resultArray = nil, {}
Line 839: 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 845: Line 1,007:
local skillName = p.getSkillName(subVal.skillID)
local skillName = p.getSkillName(subVal.skillID)
if skillName ~= nil then
if skillName ~= nil then
resultText = string.gsub(resultText, '{SV0}', skillName)
resultText = string.gsub(resultText, '${skillName}', skillName)
end
end
else
else
Line 852: Line 1,014:
end
end


local valSign = (valueUnsigned and '' or sign or '')
resultText = string.gsub(resultText, '${value}', function(rule) return (formatModValue(modMagnitude, rule) or '') end)
resultText = string.gsub(resultText, '{(V[^}]*)}', function(rule) return valSign .. (formatModValue(modMagnitude, rule) or '') end)
resultText = string.gsub(resultText, '{S}', sign)


if doColor then
if doColor then
Line 1,032: 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
463

edits