In-game Functions: Difference between revisions

→‎Examples: Changed up the examples a bit
m (→‎Examples: Swapped one of the examples to abyssal realm)
(→‎Examples: Changed up the examples a bit)
Line 364: Line 364:
  <syntaxhighlight lang="js">
  <syntaxhighlight lang="js">
  game.combat.player.manager.addDungeonCompletion(game.dungeons.getObjectByID('melvorF:Into_the_Mist'));
  game.combat.player.manager.addDungeonCompletion(game.dungeons.getObjectByID('melvorF:Into_the_Mist'));
  game.combat.player.manager.setDungeonCompleteCount(game.dungeons.getObjectByID('melvorF:Into_the_Mist'), 15);
  game.combat.player.manager.setDungeonCompleteCount(game.dungeons.getObjectByID('melvorItA:Into_The_Abyss'), 15);
</syntaxhighlight>
</syntaxhighlight>
The first line will add a single completion to {{ZoneIcon|Into the Mist}} while the second line will set the dungeon completions to 15.
The first line will add a single completion to {{ZoneIcon|Into the Mist}} while the second line will set {{ZoneIcon|Into the Abyss}} completions to 15.


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.
{{Menu}}
{{Menu}}