Anonymous

In-game Functions: Difference between revisions

From Melvor Idle
Added increasing AR level caps
(→‎Examples: Changed up the examples a bit)
(Added increasing AR level caps)
Line 369: Line 369:


After modifying the dungeon completion count, run <code>game.queueRequirementRenders();</code> to apply UI updates without having to restart the game.
After modifying the dungeon completion count, run <code>game.queueRequirementRenders();</code> to apply UI updates without having to restart the game.
== Ancient Relics Level Caps ==
The <code>increaseLevelCap</code> and <code>setLevelCap</code> functions are used to modify the current level cap of a given skill in the {{AoD}} {{Icon|Ancient Relics}} [[gamemode]].
<syntaxhighlight lang="js">
game.<skill>.increaseLevelCap(value);
game.<skill>.setLevelCap(value);
game.<skill>.increaseAbyssalLevelCap(value);
game.<skill>.setAbyssalLevelCap(value);
</syntaxhighlight>
=== Attributes ===
{| class="wikitable"
|-
! Attribute !! Type !! Optional? !! Default Value !! Description
|-
| value || int || No || || The value to increase the level cap by, or set the level cap to
|}
=== Examples ===
<syntaxhighlight lang="js">
game.slayer.increaseLevelCap(20);
game.thieving.setAbyssalLevelCap(45);
</syntaxhighlight>
The first line will increase {{Skill|Slayer|Slayer's}} level cap by 20 levels whereas the second line will set {{AbyssalSkill|Thieving|Thieving's}} level cap to 45.
<syntaxhighlight lang="js">
game.skills.forEach(skill => {
skill.setLevelCap(skill.maxLevelCap);
if (skill.hasAbyssalLevels)
skill.setAbyssalLevelCap(skill.maxAbyssalLevelCap);
});
</syntaxhighlight>
The above code will set both the level caps and abyssal level caps of all skills to their maximum value.
{{Menu}}
{{Menu}}