Anonymous

In-game Functions: Difference between revisions

From Melvor Idle
→‎Ancient Relics Level Caps: Added random level cap increases
(→‎Dungeon Completions: Added way to removed undefined entries to dungeon completions)
(→‎Ancient Relics Level Caps: Added random level cap increases)
Line 373: Line 373:


== Ancient Relics Level Caps ==
== Ancient Relics Level Caps ==
=== Increasing or Setting 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]].
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">
<syntaxhighlight lang="js">
Line 381: Line 382:
</syntaxhighlight>
</syntaxhighlight>


=== Attributes ===
==== Attributes ====
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 389: Line 390:
|}
|}


=== Examples ===
==== Examples ====
  <syntaxhighlight lang="js">
  <syntaxhighlight lang="js">
  game.slayer.increaseLevelCap(20);
  game.slayer.increaseLevelCap(20);
Line 403: Line 404:
</syntaxhighlight>
</syntaxhighlight>
The above code will set both the level caps and abyssal level caps of all skills to their maximum value.
The above code will set both the level caps and abyssal level caps of all skills to their maximum value.
 
=== Awarding random level caps ===
The below script will award 5 random level cap increases without increasing combat level caps. The only value that must be changed is the <code>capType</code> at the beginning of the script. 0 is a pre-Bane level cap increase, 2 is a TotH level cap increase, and 4 is an ItA level cap increase.
<syntaxhighlight lang="js">
let capType = 0; // 0 = pre-Bane, 2 = TotH, 4 = ItA
let capIncrease = game.currentGamemode.levelCapIncreases[capType];
game.validateRandomLevelCapIncreases();
if (capIncrease.randomIncreases.length > 0 && capIncrease.randomCount > 0) {
if (capIncrease.randomIncreasesLeft === 0)
game.levelCapIncreasesBeingSelected.push(capIncrease);
capIncrease.randomIncreasesLeft += capIncrease.randomCount;
game.renderQueue.sidebarSkillUnlock = true;
game.queueNextRandomLevelCapModal();
}
</syntaxhighlight>
If you wish to also increase combat level caps then the following can be used.
<syntaxhighlight lang="js">
let capType = 0; // 0 = pre-Bane, 2 = TotH, 4 = ItA
let capIncrease = game.currentGamemode.levelCapIncreases[capType];
game.increaseSkillLevelCaps(capIncrease, capIncrease.requirementSets.get(0));
</syntaxhighlight>
{{Menu}}
{{Menu}}