Anonymous

Module:Constants: Difference between revisions

From Melvor Idle
Update for v1.1
(Correct RegenerationInterval attributes)
(Update for v1.1)
Line 1: Line 1:
local p = {}
local p = {}
local ConstantData = mw.loadData('Module:Constants/data')
local ItemData = mw.loadData('Module:Items/data')


local Shared = require('Module:Shared')
local Shared = require('Module:Shared')
local GameData = require('Module:GameData')


--Just hardcoding these because I guess that's where we're at
--Just hardcoding these because I guess that's where we're at
Line 319: Line 317:
["MeleeCritMult"] = { text = "{V}% Melee critical hit multiplier", skills = {'Combat'} },
["MeleeCritMult"] = { text = "{V}% Melee critical hit multiplier", skills = {'Combat'} },
["RangedCritMult"] = { text = "{V}% Ranged critical hit multiplier", skills = {'Ranged'} },
["RangedCritMult"] = { text = "{V}% Ranged critical hit multiplier", skills = {'Ranged'} },
-- New 1.1 modifiers, TODO add actual descriptions and the sort
["15SlowStunChance2Turns"] = { text = "TODO 15SlowStunChance2Turns", isIncreaseNegative = false, inverseSign = false, skills = {} },
["30Slow5TurnsChance"] = { text = "TODO 30Slow5TurnsChance", isIncreaseNegative = false, inverseSign = false, skills = {} },
["5DROnBeingHit"] = { text = "TODO 5DROnBeingHit", isIncreaseNegative = false, inverseSign = false, skills = {} },
["AbsorbingSkin"] = { text = "TODO AbsorbingSkin", isIncreaseNegative = false, inverseSign = false, skills = {} },
["AdditionalAshInFiremaking"] = { text = "TODO AdditionalAshInFiremaking", isIncreaseNegative = false, inverseSign = false, skills = {} },
["AgilityPillarCost"] = { text = "TODO AgilityPillarCost", isIncreaseNegative = false, inverseSign = false, skills = {} },
["allowNonMagicCurses"] = { text = "TODO allowNonMagicCurses", isIncreaseNegative = false, inverseSign = false, skills = {} },
["applyDespairCurseOnSpawn"] = { text = "TODO applyDespairCurseOnSpawn", isIncreaseNegative = false, inverseSign = false, skills = {} },
["applyMadnessCurseOnSpawn"] = { text = "TODO applyMadnessCurseOnSpawn", isIncreaseNegative = false, inverseSign = false, skills = {} },
["applyRandomCurseOnSpawn"] = { text = "TODO applyRandomCurseOnSpawn", isIncreaseNegative = false, inverseSign = false, skills = {} },
["applyTormentCurseOnSpawn"] = { text = "TODO applyTormentCurseOnSpawn", isIncreaseNegative = false, inverseSign = false, skills = {} },
["Assassin"] = { text = "TODO Assassin", isIncreaseNegative = false, inverseSign = false, skills = {} },
["bigRon"] = { text = "TODO bigRon", isIncreaseNegative = false, inverseSign = false, skills = {} },
["BleedDOTDamage"] = { text = "TODO BleedDOTDamage", isIncreaseNegative = false, inverseSign = false, skills = {} },
["BoltProduction"] = { text = "TODO BoltProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["BonusFishingSpecialChance"] = { text = "TODO BonusFishingSpecialChance", isIncreaseNegative = false, inverseSign = false, skills = {} },
["BurnDOTDamage"] = { text = "TODO BurnDOTDamage", isIncreaseNegative = false, inverseSign = false, skills = {} },
["bypassAllSlayerItems"] = { text = "TODO bypassAllSlayerItems", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceAdditionalBarSmithing"] = { text = "TODO ChanceAdditionalBarSmithing", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceAdditionalPerfectItem"] = { text = "TODO ChanceAdditionalPerfectItem", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceDarkBlade"] = { text = "TODO ChanceDarkBlade", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceDoubleSlayerTaskKill"] = { text = "TODO ChanceDoubleSlayerTaskKill", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceExtraArrows"] = { text = "TODO ChanceExtraArrows", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceExtraCrossbows"] = { text = "TODO ChanceExtraCrossbows", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceExtraJavelins"] = { text = "TODO ChanceExtraJavelins", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceExtraMeteoriteOre"] = { text = "TODO ChanceExtraMeteoriteOre", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceExtraUnstrungBows"] = { text = "TODO ChanceExtraUnstrungBows", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceForArrowShaftsWoodcutting"] = { text = "TODO ChanceForArrowShaftsWoodcutting", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceForAshInFiremaking"] = { text = "TODO ChanceForAshInFiremaking", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceForAshInWoodcutting"] = { text = "TODO ChanceForAshInWoodcutting", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceForCharcoalInFiremaking"] = { text = "TODO ChanceForCharcoalInFiremaking", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceForOneExtraFish"] = { text = "TODO ChanceForOneExtraFish", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceForOneExtraOre"] = { text = "TODO ChanceForOneExtraOre", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceForQualitySuperiorGem"] = { text = "TODO ChanceForQualitySuperiorGem", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceForStardustInFiremaking"] = { text = "TODO ChanceForStardustInFiremaking", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceGoldenStardust"] = { text = "TODO ChanceGoldenStardust", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceItemToGoldFletching"] = { text = "TODO ChanceItemToGoldFletching", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceStardust"] = { text = "TODO ChanceStardust", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceStardustCuttingMagicLogs"] = { text = "TODO ChanceStardustCuttingMagicLogs", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceToApplyBurnWithRanged"] = { text = "TODO ChanceToApplyBurnWithRanged", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceToApplyDeadlyPoison"] = { text = "TODO ChanceToApplyDeadlyPoison", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceToApplyDeadlyPoisonWhenPoisoned"] = { text = "TODO ChanceToApplyDeadlyPoisonWhenPoisoned", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceToApplyDecayCurse"] = { text = "TODO ChanceToApplyDecayCurse", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceToApplyShock"] = { text = "TODO ChanceToApplyShock", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceToApplySleepToTargetWhenHit"] = { text = "TODO ChanceToApplySleepToTargetWhenHit", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceToAvoidCurses"] = { text = "TODO ChanceToAvoidCurses", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceToAvoidSleep"] = { text = "TODO ChanceToAvoidSleep", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceToAvoidStun"] = { text = "TODO ChanceToAvoidStun", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceToAvoidThievingStuns"] = { text = "TODO ChanceToAvoidThievingStuns", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceToDoubleLeatherDragonhideCrafting"] = { text = "TODO ChanceToDoubleLeatherDragonhideCrafting", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceToFindLostChest"] = { text = "TODO ChanceToFindLostChest", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceToFindMeteorite"] = { text = "TODO ChanceToFindMeteorite", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceToFindMushroomWoodcutting"] = { text = "TODO ChanceToFindMushroomWoodcutting", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceToIncreaseSleepDuration"] = { text = "TODO ChanceToIncreaseSleepDuration", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ChanceToPreserveConsumable"] = { text = "TODO ChanceToPreserveConsumable", isIncreaseNegative = false, inverseSign = false, skills = {} },
["coalGainedOnCookingFailure"] = { text = "TODO coalGainedOnCookingFailure", isIncreaseNegative = false, inverseSign = false, skills = {} },
["CookingSuccessCap"] = { text = "TODO CookingSuccessCap", isIncreaseNegative = false, inverseSign = false, skills = {} },
["CraftingJewelryPreservation"] = { text = "TODO CraftingJewelryPreservation", isIncreaseNegative = false, inverseSign = false, skills = {} },
["CraftingJewelryRandomGemChance"] = { text = "TODO CraftingJewelryRandomGemChance", isIncreaseNegative = false, inverseSign = false, skills = {} },
["CraftingPotionCharges"] = { text = "TODO CraftingPotionCharges", isIncreaseNegative = false, inverseSign = false, skills = {} },
["CurseLifesteal"] = { text = "TODO CurseLifesteal", isIncreaseNegative = false, inverseSign = false, skills = {} },
["CyclopsCreationCharges"] = { text = "TODO CyclopsCreationCharges", isIncreaseNegative = false, inverseSign = false, skills = {} },
["DamageDealtIfPoisoned"] = { text = "TODO DamageDealtIfPoisoned", isIncreaseNegative = false, inverseSign = false, skills = {} },
["DamageReductionAgainstBosses"] = { text = "TODO DamageReductionAgainstBosses", isIncreaseNegative = false, inverseSign = false, skills = {} },
["DamageReductionAgainstMagic"] = { text = "TODO DamageReductionAgainstMagic", isIncreaseNegative = false, inverseSign = false, skills = {} },
["DamageReductionAgainstMelee"] = { text = "TODO DamageReductionAgainstMelee", isIncreaseNegative = false, inverseSign = false, skills = {} },
["DamageReductionAgainstRanged"] = { text = "TODO DamageReductionAgainstRanged", isIncreaseNegative = false, inverseSign = false, skills = {} },
["DamageReductionAgainstSlayerTasks"] = { text = "TODO DamageReductionAgainstSlayerTasks", isIncreaseNegative = false, inverseSign = false, skills = {} },
["DamageReductionWithMagic2HWeapon"] = { text = "TODO DamageReductionWithMagic2HWeapon", isIncreaseNegative = false, inverseSign = false, skills = {} },
["DamageTakenAddedAsPrayerPoints"] = { text = "TODO DamageTakenAddedAsPrayerPoints", isIncreaseNegative = false, inverseSign = false, skills = {} },
["DamageTakenPerAttack"] = { text = "TODO DamageTakenPerAttack", isIncreaseNegative = false, inverseSign = false, skills = {} },
["DamageTakenWhenAsleep"] = { text = "TODO DamageTakenWhenAsleep", isIncreaseNegative = false, inverseSign = false, skills = {} },
["DamageTakenWhenStunned"] = { text = "TODO DamageTakenWhenStunned", isIncreaseNegative = false, inverseSign = false, skills = {} },
["DeadlyPoisonDOTDamage"] = { text = "TODO DeadlyPoisonDOTDamage", isIncreaseNegative = false, inverseSign = false, skills = {} },
["DeadlyToxinsFromHerblore"] = { text = "TODO DeadlyToxinsFromHerblore", isIncreaseNegative = false, inverseSign = false, skills = {} },
["decreaseEnemyEvasionOnSleep"] = { text = "TODO decreaseEnemyEvasionOnSleep", isIncreaseNegative = false, inverseSign = false, skills = {} },
["decreaseEnemyEvasionOnStun"] = { text = "TODO decreaseEnemyEvasionOnStun", isIncreaseNegative = false, inverseSign = false, skills = {} },
["disableGoldenStardustDrops"] = { text = "TODO disableGoldenStardustDrops", isIncreaseNegative = false, inverseSign = false, skills = {} },
["disableHPRegeneration"] = { text = "TODO disableHPRegeneration", isIncreaseNegative = false, inverseSign = false, skills = {} },
["disableLifesteal"] = { text = "TODO disableLifesteal", isIncreaseNegative = false, inverseSign = false, skills = {} },
["disableSalamanderItemReduction"] = { text = "TODO disableSalamanderItemReduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["doubleBoneDrops"] = { text = "TODO doubleBoneDrops", isIncreaseNegative = false, inverseSign = false, skills = {} },
["doubleLifesteal"] = { text = "TODO doubleLifesteal", isIncreaseNegative = false, inverseSign = false, skills = {} },
["doubleLogProduction"] = { text = "TODO doubleLogProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["doubleRuneEssenceMining"] = { text = "TODO doubleRuneEssenceMining", isIncreaseNegative = false, inverseSign = false, skills = {} },
["doubleSilverGoldMining"] = { text = "TODO doubleSilverGoldMining", isIncreaseNegative = false, inverseSign = false, skills = {} },
["doubleSilverGoldSmithingWithSeeingGold"] = { text = "TODO doubleSilverGoldSmithingWithSeeingGold", isIncreaseNegative = false, inverseSign = false, skills = {} },
["Duality"] = { text = "TODO Duality", isIncreaseNegative = false, inverseSign = false, skills = {} },
["EndOfTurnEvasion2"] = { text = "TODO EndOfTurnEvasion2", isIncreaseNegative = false, inverseSign = false, skills = {} },
["EndOfTurnMaxHealing2"] = { text = "TODO EndOfTurnMaxHealing2", isIncreaseNegative = false, inverseSign = false, skills = {} },
["EnemyDamageReduction"] = { text = "TODO EnemyDamageReduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["EvasionAgainstMagic"] = { text = "TODO EvasionAgainstMagic", isIncreaseNegative = false, inverseSign = false, skills = {} },
["EvasionAgainstMelee"] = { text = "TODO EvasionAgainstMelee", isIncreaseNegative = false, inverseSign = false, skills = {} },
["EvasionAgainstRanged"] = { text = "TODO EvasionAgainstRanged", isIncreaseNegative = false, inverseSign = false, skills = {} },
["EvasionBasedOnDR"] = { text = "TODO EvasionBasedOnDR", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FiremakingLogGP"] = { text = "TODO FiremakingLogGP", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FireRunesWhenMakingElementalRunes"] = { text = "TODO FireRunesWhenMakingElementalRunes", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FishermansPotionCharges"] = { text = "TODO FishermansPotionCharges", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FishingCookedChance"] = { text = "TODO FishingCookedChance", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatBlockAttackBonus"] = { text = "TODO FlatBlockAttackBonus", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatCraftingDragonhideCost"] = { text = "TODO FlatCraftingDragonhideCost", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatFarmingYield"] = { text = "TODO FlatFarmingYield", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatHPRegenBasedOnMagicMaxHit"] = { text = "TODO FlatHPRegenBasedOnMagicMaxHit", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatHPRegenBasedOnMeleeMaxHit"] = { text = "TODO FlatHPRegenBasedOnMeleeMaxHit", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatHPRegenBasedOnRangedMaxHit"] = { text = "TODO FlatHPRegenBasedOnRangedMaxHit", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatMagicAccuracyBonusPerAttackInterval"] = { text = "TODO FlatMagicAccuracyBonusPerAttackInterval", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatMagicAttackBonus"] = { text = "TODO FlatMagicAttackBonus", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatMagicDefenceBonus"] = { text = "TODO FlatMagicDefenceBonus", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatMeleeAccuracyBonusPerAttackInterval"] = { text = "TODO FlatMeleeAccuracyBonusPerAttackInterval", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatMeleeDefenceBonus"] = { text = "TODO FlatMeleeDefenceBonus", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatMeleeStrengthBonus"] = { text = "TODO FlatMeleeStrengthBonus", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatMeleeStrengthBonusPerAttackInterval"] = { text = "TODO FlatMeleeStrengthBonusPerAttackInterval", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatRangedAccuracyBonusPerAttackInterval"] = { text = "TODO FlatRangedAccuracyBonusPerAttackInterval", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatRangedAttackBonus"] = { text = "TODO FlatRangedAttackBonus", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatRangedDefenceBonus"] = { text = "TODO FlatRangedDefenceBonus", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatRangedStrengthBonus"] = { text = "TODO FlatRangedStrengthBonus", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatRangedStrengthBonusPerAttackInterval"] = { text = "TODO FlatRangedStrengthBonusPerAttackInterval", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatSlashAttackBonus"] = { text = "TODO FlatSlashAttackBonus", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatSmithingCoalCost"] = { text = "TODO FlatSmithingCoalCost", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FlatStabAttackBonus"] = { text = "TODO FlatStabAttackBonus", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FletchingBoltQuantity"] = { text = "TODO FletchingBoltQuantity", isIncreaseNegative = false, inverseSign = false, skills = {} },
["FletchingIntervalWithArrows"] = { text = "TODO FletchingIntervalWithArrows", isIncreaseNegative = false, inverseSign = false, skills = {} },
["freezeImmunity"] = { text = "TODO freezeImmunity", isIncreaseNegative = false, inverseSign = false, skills = {} },
["gainSlayerCoinsBasedOnEnemyCombatLevelMagic"] = { text = "TODO gainSlayerCoinsBasedOnEnemyCombatLevelMagic", isIncreaseNegative = false, inverseSign = false, skills = {} },
["gainSlayerCoinsBasedOnEnemyCombatLevelMelee"] = { text = "TODO gainSlayerCoinsBasedOnEnemyCombatLevelMelee", isIncreaseNegative = false, inverseSign = false, skills = {} },
["gainSlayerCoinsBasedOnEnemyCombatLevelRanged"] = { text = "TODO gainSlayerCoinsBasedOnEnemyCombatLevelRanged", isIncreaseNegative = false, inverseSign = false, skills = {} },
["GemVeinChance"] = { text = "TODO GemVeinChance", isIncreaseNegative = false, inverseSign = false, skills = {} },
["GenerousCookPotionCharges"] = { text = "TODO GenerousCookPotionCharges", isIncreaseNegative = false, inverseSign = false, skills = {} },
["giveRandomComboRunesRunecrafting"] = { text = "TODO giveRandomComboRunesRunecrafting", isIncreaseNegative = false, inverseSign = false, skills = {} },
["globalAccuracyHPScaling"] = { text = "TODO globalAccuracyHPScaling", isIncreaseNegative = false, inverseSign = false, skills = {} },
["GlobalSkillIntervalPercent"] = { text = "TODO GlobalSkillIntervalPercent", isIncreaseNegative = false, inverseSign = false, skills = {} },
["GlobalSleepChance"] = { text = "TODO GlobalSleepChance", isIncreaseNegative = false, inverseSign = false, skills = {} },
["GlobalStunChance"] = { text = "TODO GlobalStunChance", isIncreaseNegative = false, inverseSign = false, skills = {} },
["GPBasedOnEnemyCombatLevel"] = { text = "TODO GPBasedOnEnemyCombatLevel", isIncreaseNegative = false, inverseSign = false, skills = {} },
["GPBasedOnSummonDamage"] = { text = "TODO GPBasedOnSummonDamage", isIncreaseNegative = false, inverseSign = false, skills = {} },
["GPFromAgilityPerActiveObstacle"] = { text = "TODO GPFromAgilityPerActiveObstacle", isIncreaseNegative = false, inverseSign = false, skills = {} },
["GPFromBurningMonsters"] = { text = "TODO GPFromBurningMonsters", isIncreaseNegative = false, inverseSign = false, skills = {} },
["GPFromItemAlchemy"] = { text = "TODO GPFromItemAlchemy", isIncreaseNegative = false, inverseSign = false, skills = {} },
["GPFromMonstersFlatBasedOnEvasion"] = { text = "TODO GPFromMonstersFlatBasedOnEvasion", isIncreaseNegative = false, inverseSign = false, skills = {} },
["GPFromNegativeObstacles"] = { text = "TODO GPFromNegativeObstacles", isIncreaseNegative = false, inverseSign = false, skills = {} },
["GPFromSlayerTaskMonsters"] = { text = "TODO GPFromSlayerTaskMonsters", isIncreaseNegative = false, inverseSign = false, skills = {} },
["GPOnRegenBasedOnHPGain"] = { text = "TODO GPOnRegenBasedOnHPGain", isIncreaseNegative = false, inverseSign = false, skills = {} },
["GPPerDamage"] = { text = "TODO GPPerDamage", isIncreaseNegative = false, inverseSign = false, skills = {} },
["GPPerMagicDamage"] = { text = "TODO GPPerMagicDamage", isIncreaseNegative = false, inverseSign = false, skills = {} },
["GPPerMeleeDamage"] = { text = "TODO GPPerMeleeDamage", isIncreaseNegative = false, inverseSign = false, skills = {} },
["GPPerRangedDamage"] = { text = "TODO GPPerRangedDamage", isIncreaseNegative = false, inverseSign = false, skills = {} },
["GPWhenHitBasedOnDR"] = { text = "TODO GPWhenHitBasedOnDR", isIncreaseNegative = false, inverseSign = false, skills = {} },
["growingMadnessPassive"] = { text = "TODO growingMadnessPassive", isIncreaseNegative = false, inverseSign = false, skills = {} },
["halveDamageReduction"] = { text = "TODO halveDamageReduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["halvedWoodcuttingDoubleChance"] = { text = "TODO halvedWoodcuttingDoubleChance", isIncreaseNegative = false, inverseSign = false, skills = {} },
["HealingOnAttackBasedOnDR"] = { text = "TODO HealingOnAttackBasedOnDR", isIncreaseNegative = false, inverseSign = false, skills = {} },
["healOnHitBasedOnTargetDR"] = { text = "TODO healOnHitBasedOnTargetDR", isIncreaseNegative = false, inverseSign = false, skills = {} },
["HealWhenSleep"] = { text = "TODO HealWhenSleep", isIncreaseNegative = false, inverseSign = false, skills = {} },
["HealWhenStunned"] = { text = "TODO HealWhenStunned", isIncreaseNegative = false, inverseSign = false, skills = {} },
["HerbSackChanceThievingFarmer"] = { text = "TODO HerbSackChanceThievingFarmer", isIncreaseNegative = false, inverseSign = false, skills = {} },
["HitpointRegenerationAgainstSlayerTasks"] = { text = "TODO HitpointRegenerationAgainstSlayerTasks", isIncreaseNegative = false, inverseSign = false, skills = {} },
["HPRegenWhenEnemyHasMoreEvasion"] = { text = "TODO HPRegenWhenEnemyHasMoreEvasion", isIncreaseNegative = false, inverseSign = false, skills = {} },
["InfernalSpellAccuracy"] = { text = "TODO InfernalSpellAccuracy", isIncreaseNegative = false, inverseSign = false, skills = {} },
["JavelinProduction"] = { text = "TODO JavelinProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["JavelinResourceCost"] = { text = "TODO JavelinResourceCost", isIncreaseNegative = false, inverseSign = false, skills = {} },
["LeprechaunCreationCharges"] = { text = "TODO LeprechaunCreationCharges", isIncreaseNegative = false, inverseSign = false, skills = {} },
["Leviathan"] = { text = "TODO Leviathan", isIncreaseNegative = false, inverseSign = false, skills = {} },
["LifestealBasedOnHPRegenEffectiveness"] = { text = "TODO LifestealBasedOnHPRegenEffectiveness", isIncreaseNegative = false, inverseSign = false, skills = {} },
["LightningSpellAccuracy"] = { text = "TODO LightningSpellAccuracy", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MagicMaxHitBonusAgainstMelee"] = { text = "TODO MagicMaxHitBonusAgainstMelee", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MagicMaxHitFlat"] = { text = "TODO MagicMaxHitFlat", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MagicMinHitBasedOnMaxHitSlayerTask"] = { text = "TODO MagicMinHitBasedOnMaxHitSlayerTask", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MasteryPoolCap"] = { text = "TODO MasteryPoolCap", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MasteryXPFromNegativeObstacles"] = { text = "TODO MasteryXPFromNegativeObstacles", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MaxHitPercentBasedOnDamageReduction"] = { text = "TODO MaxHitPercentBasedOnDamageReduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MaxHitPercentBasedOnEnemyDamageReduction"] = { text = "TODO MaxHitPercentBasedOnEnemyDamageReduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MaxHPBurnDamage"] = { text = "TODO MaxHPBurnDamage", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MeleeMaxHitBasedOnMaxHitSlayerTask"] = { text = "TODO MeleeMaxHitBasedOnMaxHitSlayerTask", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MeleeMaxHitBonusAgainstRanged"] = { text = "TODO MeleeMaxHitBonusAgainstRanged", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MeleeMaxHitFlat"] = { text = "TODO MeleeMaxHitFlat", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MeleeRangedDefenceBonusBasedOnDR"] = { text = "TODO MeleeRangedDefenceBonusBasedOnDR", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MeteoriteOre"] = { text = "TODO MeteoriteOre", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MinBirdNestQuantity"] = { text = "TODO MinBirdNestQuantity", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MinimumBirdNestsWhenPotionActive"] = { text = "TODO MinimumBirdNestsWhenPotionActive", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MinInfernalArchaicDmg"] = { text = "TODO MinInfernalArchaicDmg", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MiningBarChance"] = { text = "TODO MiningBarChance", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MiningNodeHPWithPerfectSwing"] = { text = "TODO MiningNodeHPWithPerfectSwing", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MinLightningArchaicDmg"] = { text = "TODO MinLightningArchaicDmg", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MinMeteorShowerSpellDamage"] = { text = "TODO MinMeteorShowerSpellDamage", isIncreaseNegative = false, inverseSign = false, skills = {} },
["MinPoisonArchaicDmg"] = { text = "TODO MinPoisonArchaicDmg", isIncreaseNegative = false, inverseSign = false, skills = {} },
["momentInTimePassive"] = { text = "TODO momentInTimePassive", isIncreaseNegative = false, inverseSign = false, skills = {} },
["NonCombatSkillXP"] = { text = "TODO NonCombatSkillXP", isIncreaseNegative = false, inverseSign = false, skills = {} },
["NonShardCostForEquippedTablets"] = { text = "TODO NonShardCostForEquippedTablets", isIncreaseNegative = false, inverseSign = false, skills = {} },
["PassiveCookInterval"] = { text = "TODO PassiveCookInterval", isIncreaseNegative = false, inverseSign = false, skills = {} },
["PlayerDamageReduction"] = { text = "TODO PlayerDamageReduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["PlayerRage"] = { text = "TODO PlayerRage", isIncreaseNegative = false, inverseSign = false, skills = {} },
["PoisonDOTDamage"] = { text = "TODO PoisonDOTDamage", isIncreaseNegative = false, inverseSign = false, skills = {} },
["PoisonSpellAccuracy"] = { text = "TODO PoisonSpellAccuracy", isIncreaseNegative = false, inverseSign = false, skills = {} },
["PrayerPointsWhenHit"] = { text = "TODO PrayerPointsWhenHit", isIncreaseNegative = false, inverseSign = false, skills = {} },
["Rage"] = { text = "TODO Rage", isIncreaseNegative = false, inverseSign = false, skills = {} },
["RandomBarChanceThievingMiner"] = { text = "TODO RandomBarChanceThievingMiner", isIncreaseNegative = false, inverseSign = false, skills = {} },
["RangedMaxHitBasedOnMaxHitSlayerTask"] = { text = "TODO RangedMaxHitBasedOnMaxHitSlayerTask", isIncreaseNegative = false, inverseSign = false, skills = {} },
["RangedMaxHitBonusAgainstMagic"] = { text = "TODO RangedMaxHitBonusAgainstMagic", isIncreaseNegative = false, inverseSign = false, skills = {} },
["RangedMaxHitFlat"] = { text = "TODO RangedMaxHitFlat", isIncreaseNegative = false, inverseSign = false, skills = {} },
["reducedTargetDamageRedcutionIfBleeding"] = { text = "TODO reducedTargetDamageRedcutionIfBleeding", isIncreaseNegative = false, inverseSign = false, skills = {} },
["reignOverTimePassive"] = { text = "TODO reignOverTimePassive", isIncreaseNegative = false, inverseSign = false, skills = {} },
["RunecraftingStavePreservation"] = { text = "TODO RunecraftingStavePreservation", isIncreaseNegative = false, inverseSign = false, skills = {} },
["RunecraftingWaterComboRunes"] = { text = "TODO RunecraftingWaterComboRunes", isIncreaseNegative = false, inverseSign = false, skills = {} },
["RuneEssenceThievingMiner"] = { text = "TODO RuneEssenceThievingMiner", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SalamanderCreationCharges"] = { text = "TODO SalamanderCreationCharges", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SCfromLifesteal"] = { text = "TODO SCfromLifesteal", isIncreaseNegative = false, inverseSign = false, skills = {} },
["shadowCloak"] = { text = "TODO shadowCloak", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SkillMasteryXPPerAmeria"] = { text = "TODO SkillMasteryXPPerAmeria", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SkillMasteryXPPerArachi"] = { text = "TODO SkillMasteryXPPerArachi", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SkillMasteryXPPerDeedree"] = { text = "TODO SkillMasteryXPPerDeedree", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SkillMasteryXPPerHyden"] = { text = "TODO SkillMasteryXPPerHyden", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SkillMasteryXPPerIridan"] = { text = "TODO SkillMasteryXPPerIridan", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SkillMasteryXPPerKo"] = { text = "TODO SkillMasteryXPPerKo", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SkillMasteryXPPerQimican"] = { text = "TODO SkillMasteryXPPerQimican", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SkillMasteryXPPerSyllia"] = { text = "TODO SkillMasteryXPPerSyllia", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SkillMasteryXPPerVale"] = { text = "TODO SkillMasteryXPPerVale", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SkillPreservationCap"] = { text = "TODO SkillPreservationCap", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SlayerCoinsBasedOnTargetDR"] = { text = "TODO SlayerCoinsBasedOnTargetDR", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SlayerCoinsPerDamage"] = { text = "TODO SlayerCoinsPerDamage", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SlayerCoinsPerMagicDamageSlayerTask"] = { text = "TODO SlayerCoinsPerMagicDamageSlayerTask", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SlayerCoinsPerPoisonDamage"] = { text = "TODO SlayerCoinsPerPoisonDamage", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SlayerTaskMonsterAccuracy"] = { text = "TODO SlayerTaskMonsterAccuracy", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SmithingDragonGearPreservation"] = { text = "TODO SmithingDragonGearPreservation", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SummoningAttackLifesteal"] = { text = "TODO SummoningAttackLifesteal", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SummoningCreationChargesForEquippedTablets"] = { text = "TODO SummoningCreationChargesForEquippedTablets", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SummoningIntervalForOctopus"] = { text = "TODO SummoningIntervalForOctopus", isIncreaseNegative = false, inverseSign = false, skills = {} },
["SummoningIntervalPercentForEquippedTablets"] = { text = "TODO SummoningIntervalPercentForEquippedTablets", isIncreaseNegative = false, inverseSign = false, skills = {} },
["summoningSynergy_Bear_Devil"] = { text = "TODO summoningSynergy_Bear_Devil", isIncreaseNegative = false, inverseSign = false, skills = {} },
["summoningSynergy_Devil_Eagle"] = { text = "TODO summoningSynergy_Devil_Eagle", isIncreaseNegative = false, inverseSign = false, skills = {} },
["summoningSynergy_Ent_Leprechaun"] = { text = "TODO summoningSynergy_Ent_Leprechaun", isIncreaseNegative = false, inverseSign = false, skills = {} },
["summoningSynergy_Leprechaun_Devil"] = { text = "TODO summoningSynergy_Leprechaun_Devil", isIncreaseNegative = false, inverseSign = false, skills = {} },
["summoningSynergy_Mole_Leprechaun"] = { text = "TODO summoningSynergy_Mole_Leprechaun", isIncreaseNegative = false, inverseSign = false, skills = {} },
["summoningSynergy_Octopus_Leprechaun"] = { text = "TODO summoningSynergy_Octopus_Leprechaun", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ThievingAreaUniqueChance"] = { text = "TODO ThievingAreaUniqueChance", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ThievingAutoSellPrice"] = { text = "TODO ThievingAutoSellPrice", isIncreaseNegative = false, inverseSign = false, skills = {} },
["thievingChefNoDamage"] = { text = "TODO thievingChefNoDamage", isIncreaseNegative = false, inverseSign = false, skills = {} },
["ThievingStunIntervalPercent"] = { text = "TODO ThievingStunIntervalPercent", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipAridPlainsProduction"] = { text = "TODO TownshipAridPlainsProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipBarProduction"] = { text = "TODO TownshipBarProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipBlacksmithProduction"] = { text = "TODO TownshipBlacksmithProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipBuildingCost"] = { text = "TODO TownshipBuildingCost", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipBuildingHappinessPenalties"] = { text = "TODO TownshipBuildingHappinessPenalties", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipClothingProduction"] = { text = "TODO TownshipClothingProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipCoalProduction"] = { text = "TODO TownshipCoalProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipCoalUsage"] = { text = "TODO TownshipCoalUsage", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipDeadStorage"] = { text = "TODO TownshipDeadStorage", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipDesertProduction"] = { text = "TODO TownshipDesertProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["townshipDisableHunting"] = { text = "TODO townshipDisableHunting", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipEducation"] = { text = "TODO TownshipEducation", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipFarmProduction"] = { text = "TODO TownshipFarmProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipFishingDockProduction"] = { text = "TODO TownshipFishingDockProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipFoodProduction"] = { text = "TODO TownshipFoodProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipFoodUsage"] = { text = "TODO TownshipFoodUsage", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipForestProduction"] = { text = "TODO TownshipForestProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipGPProduction"] = { text = "TODO TownshipGPProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipGrasslandsProduction"] = { text = "TODO TownshipGrasslandsProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipHappiness"] = { text = "TODO TownshipHappiness", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipHealth"] = { text = "TODO TownshipHealth", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipHerbProduction"] = { text = "TODO TownshipHerbProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipJungleProduction"] = { text = "TODO TownshipJungleProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipLeatherProduction"] = { text = "TODO TownshipLeatherProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipMagicEmporiumProduction"] = { text = "TODO TownshipMagicEmporiumProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipMaxStorage"] = { text = "TODO TownshipMaxStorage", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipMountainsProduction"] = { text = "TODO TownshipMountainsProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipOrchardProduction"] = { text = "TODO TownshipOrchardProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipOreProduction"] = { text = "TODO TownshipOreProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipPlankProduction"] = { text = "TODO TownshipPlankProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipPopulationCap"] = { text = "TODO TownshipPopulationCap", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipPotionProduction"] = { text = "TODO TownshipPotionProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipResourceProduction"] = { text = "TODO TownshipResourceProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipRuneEssenceProduction"] = { text = "TODO TownshipRuneEssenceProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipSnowlandsProduction"] = { text = "TODO TownshipSnowlandsProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipStoneProduction"] = { text = "TODO TownshipStoneProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipSwampProduction"] = { text = "TODO TownshipSwampProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipTaxPerCitizen"] = { text = "TODO TownshipTaxPerCitizen", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipValleyProduction"] = { text = "TODO TownshipValleyProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipWaterProduction"] = { text = "TODO TownshipWaterProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipWoodcuttingProduction"] = { text = "TODO TownshipWoodcuttingProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["TownshipWoodProduction"] = { text = "TODO TownshipWoodProduction", isIncreaseNegative = false, inverseSign = false, skills = {} },
["WoodcuttingGemChance"] = { text = "TODO WoodcuttingGemChance", isIncreaseNegative = false, inverseSign = false, skills = {} },
["WoodcuttingJewelryChance"] = { text = "TODO WoodcuttingJewelryChance", isIncreaseNegative = false, inverseSign = false, skills = {} },
["WoodcuttingXPAddedAsFiremakingXP"] = { text = "TODO WoodcuttingXPAddedAsFiremakingXP", isIncreaseNegative = false, inverseSign = false, skills = {} },
["XPFromNegativeObstacles"] = { text = "TODO XPFromNegativeObstacles", isIncreaseNegative = false, inverseSign = false, skills = {} },
}
}


--Difficulties are hard coded which is dumb but means hardcoding them here too
local Difficulties = {
[0] = 'Very Easy',
[1] = 'Easy',
[2] = 'Medium',
[3] = 'Hard',
[4] = 'Very Hard',
[5] = 'Elite',
[6] = 'Insane'
}


function p.getTriangleAttribute(attribute, attackerStyle, targetStyle, mode)
function p.getTriangleAttribute(attribute, attackerStyle, targetStyle, modeName)
if type(attribute) ~= 'string' then
if type(attribute) ~= 'string' then
error("Parameter 'attribute' must be a string", 2)
error("Parameter 'attribute' must be a string", 2)
Line 339: Line 611:
elseif type(targetStyle) ~= 'string' then
elseif type(targetStyle) ~= 'string' then
error("Parameter 'targetStyle' must be a string", 2)
error("Parameter 'targetStyle' must be a string", 2)
elseif type(mode) ~= 'string' then
elseif type(modeName) ~= 'string' then
error("Parameter 'mode' must be a string", 2)
error("Parameter 'modeName' must be a string", 2)
end
end
local modeID = p.getGamemodeID(mode)
local mode = GameData.getEntityByName('gamemodes', modeName)
if modeID == nil then
if mode == nil then
error("Invalid gamemode '" .. mode .. "'", 2)
error("Invalid gamemode '" .. mode .. "'", 2)
end
end
Line 356: Line 628:
end
end
local triangleID = ConstantData.Gamemode.Data[modeID + 1].combatTriangle
local combatTriangle = GameData.getEntityByID('combatTriangles', mode.combatTriangle)
local attrData = ConstantData.CombatTriangle[triangleID + 1][attribute]
if combatTriangle == nil then
error("No such combat triangle: " .. mode.combatTriangle)
end
local attrData = combatTriangle[attribute]
if attrData == nil then
if attrData == nil then
error("No such attribute: " .. attribute)
error("No such attribute: " .. attribute)
Line 376: Line 651:


function p.getDifficultyString(difficulty)
function p.getDifficultyString(difficulty)
return Difficulties[difficulty]
return GameData.rawData.combatAreaDifficulties[difficulty + 1]
end
end


function p.getSkillName(skillID)
function p.getSkillName(skillID)
return ConstantData.skill[skillID]
local skill = GameData.getEntityByID('skillData', skillID)
if skill ~= nil then
return skill.data.name
end
end
end


function p.getSkillID(skillName)
function p.getSkillID(skillName)
return ConstantData.skill[skillName]
local skill = GameData.getEntityByName('skillData', skillName)
if skill ~= nil then
return skill.data.id
end
end
end


function p.getEquipmentSlotName(id)
function p.getEquipmentSlotName(id)
return type(id) == 'number' and ConstantData.equipmentSlot[id] or 'Invalid'
return type(id) == 'number' and GameData.rawData.equipmentSlots[id] or 'Invalid'
end
end


function p.getEquipmentSlotID(name)
function p.getEquipmentSlotID(name)
return ConstantData.equipmentSlot[name]
return GameData.rawData.equipmentSlots[name]
end
 
function p.getGamemodeName(id)
return ConstantData.Gamemode.Enum[id]
end
 
function p.getGamemodeID(name)
return ConstantData.Gamemode.Enum[name]
end
end


function p.getCombatStyleName(styleNum)
function p.getCombatStyleName(styleNum)
if type(styleNum) == 'number' then
if type(styleNum) == 'number' then
local styleName = ConstantData.attackType[styleNum]
local styleName = GameData.rawData.attackTypes[styleNum]
if styleName ~= nil then
if styleName ~= nil then
return Shared.titleCase(styleName)
return Shared.titleCase(styleName)
end
end
elseif type(styleNum) == 'string' and type(ConstantData.attackType[string.lower(styleNum)]) == 'number' then
elseif type(styleNum) == 'string' and type(GameData.rawData.attackTypes[string.lower(styleNum)]) == 'number' then
return Shared.titleCase(styleNum)
return Shared.titleCase(styleNum)
end
end
Line 418: Line 691:
--- Slayer functions
--- Slayer functions
--
--
function p.getSlayerTierByID(tierID, slayerLevel) -- returns a full table
function p.getSlayerTierByID(tierID)
if slayerLevel == nil then
slayerLevel = 99 -- this might upgrade to 120 in some update
end
if type(tierID) ~= 'number' then
if type(tierID) ~= 'number' then
return nil
elseif ConstantData.Slayer.Tiers[tierID + 1] == nil then
return nil
return nil
else
else
local result = Shared.clone(ConstantData.Slayer.Tiers[tierID + 1])
return GameData.rawData.slayerTiers[tierID + 1]
result.id = tierID
result.minQuantity = 10*(tierID+1) + 4
result.maxQuantity = 10*(tierID+1) + 4*slayerLevel
return result
end
end
end
end


function p.getSlayerTier(name)
function p.getSlayerTier(name)
local tierID = ConstantData.slayerTier[name]
return GameData.getEntityByProperty('slayerTiers', 'display', name)
if tierID == nil then
return nil
else
return p.getSlayerTierByID(tierID)
end
end
end


function p.getSlayerTierByLevel(level) -- returns a full table
function p.getSlayerTierByLevel(level)
if type(level) ~= 'number' or level < 1 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(GameData.rawData.slayerTiers) 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 tier
end
end
end
end
Line 460: Line 719:
--
--


function p.getSlayerTierName(tierID, fallback)
function p.getSlayerTierName(tierID)
return type(tierID) == 'number' and ConstantData.slayerTier[tierID] or "ERROR: Invalid Slayer tier[[Category:Pages with script errors]]"
if type(tierID) == 'number' then
local tier = p.getSlayerTierByID(tierID)
if tier ~= nil then
return tier.display
end
end
return "ERROR: Invalid Slayer tier[[Category:Pages with script errors]]"
end
end


function p.getSlayerTierNameByLevel(lvl, fallback)
function p.getSlayerTierNameByLevel(lvl)
local tier = p.getSlayerTierByLevel(lvl)
local tier = p.getSlayerTierByLevel(lvl)
if type(tier) == 'table' then
if type(tier) == 'table' then
return tier.display
return tier.display
else
else
return fallback or "ERROR: Invalid Slayer tier[[Category:Pages with script errors]]"
return "ERROR: Invalid Slayer tier[[Category:Pages with script errors]]"
end
end
end
end
Line 528: Line 793:
['VMUL'] = function(val) return 2^val end,
['VMUL'] = function(val) return 2^val end,
['VITEM'] = function(val)
['VITEM'] = function(val)
local item = ItemData.Items[tonumber(val) + 1]
local item = GameData.getEntityByID('items', val)
if item ~= nil then
if item ~= nil then
return item.name
return item.name