Anonymous

Module:Sandbox/AuronTest: Difference between revisions

From Melvor Idle
m
no edit summary
m (1.0 testing: Constants)
mNo edit summary
Line 10: Line 10:
   ["MeleeStrengthBonus"] = { text = "{V}% Melee Strength Bonus", skills = {'Combat'} },
   ["MeleeStrengthBonus"] = { text = "{V}% Melee Strength Bonus", 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'} }, -- TODO Astrology
   ["GlobalMasteryXP"] = { text = "{V}% Global Mastery XP", skills = {'Woodcutting', 'Fishing', 'Firemaking', 'Cooking', 'Mining', 'Smithing', 'Thieving', 'Farming', 'Fletching', 'Crafting', 'Runecrafting', 'Herblore', 'Agility', 'Summoning', 'Astrology'} },
   ["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", inverseSign = true, skills = {'Prayer'} },
Line 276: Line 276:
   ["masteryToken"] = { text = "Grants Mastery Pool XP equal to {V}% of the maximum Mastery Pool XP for the respective skill",
   ["masteryToken"] = { text = "Grants Mastery Pool XP equal to {V}% of the maximum Mastery Pool XP for the respective skill",
     skills = {'Woodcutting', 'Fishing', 'Firemaking', 'Cooking', 'Mining', 'Smithing', 'Thieving', 'Farming',
     skills = {'Woodcutting', 'Fishing', 'Firemaking', 'Cooking', 'Mining', 'Smithing', 'Thieving', 'Farming',
             'Fletching', 'Crafting', 'Runecrafting', 'Herblore', 'Agility', 'Summoning'} }, -- TODO Astrology
             'Fletching', 'Crafting', 'Runecrafting', 'Herblore', 'Agility', 'Summoning', 'Astrology'} },
   ["MinThievingGP"] = { text = "{V}% minimum GP from Thieving", skills = {'Thieving'} },
   ["MinThievingGP"] = { text = "{V}% minimum GP from Thieving", skills = {'Thieving'} },
   ["RunecraftingEssencePreservation"] = { text = "{V}% chance to preserve resources when Runecrafting runes", skills = {'Runecrafting'} },
   ["RunecraftingEssencePreservation"] = { text = "{V}% chance to preserve resources when Runecrafting runes", skills = {'Runecrafting'} },
Line 284: Line 284:
   ["AfflictionChance"] = { text = "{V}% chance to apply affliction when attacking", skills = {'Combat'} },
   ["AfflictionChance"] = { text = "{V}% chance to apply affliction when attacking", skills = {'Combat'} },
   ["allowLootContainerStacking"] = { text = "Items other than bones stack within the loot container", skills = {'Combat'} },
   ["allowLootContainerStacking"] = { text = "Items other than bones stack within the loot container", skills = {'Combat'} },
   ["BaseStardustDropQty"] = { text = "{V}% to base drop quantity of Stardust and Golden Stardust from Astrology", skills = {''} }, -- TODO Astrology
   ["BaseStardustDropQty"] = { text = "{V}% to base drop quantity of Stardust and Golden Stardust from Astrology", skills = {'Astrology'} },
   ["BleedReflectChance"] = { text = "{V}% chance to inflict a bleed that does 100% of the attack's damage to attackers when hit", skills = {'Combat'} },
   ["BleedReflectChance"] = { text = "{V}% chance to inflict a bleed that does 100% of the attack's damage to attackers when hit", skills = {'Combat'} },
   ["ChanceForDiamondFiremaking"] = { text = "{V}% chance to receive a Diamond per action in Firemaking (Cannot be doubled)", skills = {'Firemaking'} },
   ["ChanceForDiamondFiremaking"] = { text = "{V}% chance to receive a Diamond per action in Firemaking (Cannot be doubled)", skills = {'Firemaking'} },
Line 382: Line 382:


function p.getSkillName(skillID)
function p.getSkillName(skillID)
   for skName, ID in Shared.skpairs(ConstantData.skill) do
   return type(skillID) == 'number' and ConstantData.skill[skillID]
    if ID == skillID then
      return skName
    end
  end
  return nil
end
end


function p.getSkillID(skillName)
function p.getSkillID(skillName)
   return ConstantData.skill[skillName]
   return type(skillName) == 'string' and ConstantData.skill[skillName]
end
end


function p.getEquipmentSlotName(id)
function p.getEquipmentSlotName(id)
   for slotName, i in Shared.skpairs(ConstantData.equipmentSlot) do
   return type(id) == 'number' and ConstantData.equipmentSlot[id] or 'Invalid'
    if i == id then
      return slotName
    end
  end
  return 'Invalid'
end
end


function p.getEquipmentSlotID(name)
function p.getEquipmentSlotID(name)
   return ConstantData.equipmentSlot[name]
   return type(name) == 'string' and ConstantData.equipmentSlot[name]
end
end


-- TODO attackType no longer exists
function p.getCombatStyleName(styleNum)
function p.getCombatStyleName(styleNum)
   for name, num in Shared.skpairs(ConstantData.attackType) do
   for name, num in Shared.skpairs(ConstantData.attackType) do
Line 417: Line 408:


function p.getSlayerTierName(tier)
function p.getSlayerTierName(tier)
   for name, num in Shared.skpairs(ConstantData.slayerTier) do
   return type(tier) == 'number' and ConstantData.slayerTier[tier] or "ERROR: Invalid Slayer tier[[Category:Pages with script errors]]"
    if num == tier then
      return name
    end
  end
  return "ERROR: Invalid Slayer tier[[Category:Pages with script errors]]"
end
end