In-game Functions: Difference between revisions

Line 113: Line 113:
== player.addXP ==
== player.addXP ==
The player.addXP function can be used to add experience to any skill. Note that the game will not visually show the updated XP until after refresh or 1 new action.
The player.addXP function can be used to add experience to any skill. Note that the game will not visually show the updated XP until after refresh or 1 new action.
  <nowiki>player.addXP(skillID, xp, forceSkill, dropRares)</nowiki>
  <nowiki>player.addXP(skillID, xp)</nowiki>
=== Attributes ===
=== Attributes ===
{| class="wikitable"
{| class="wikitable"
Line 122: Line 122:
|-
|-
| xp || int || No || || Amount of experience to add. Note that this is the amount of experience added before bonuses such as that from the {{ItemIcon|Firemaking Skillcape}} or {{PetIcon|Pyro}}
| xp || int || No || || Amount of experience to add. Note that this is the amount of experience added before bonuses such as that from the {{ItemIcon|Firemaking Skillcape}} or {{PetIcon|Pyro}}
|-
| forceSkill || boolean || Yes || false || Determines whether experience boosts normally conditional on the skill (such as that granted by the {{ItemIcon|Ancient Ring of Skills}}) are applied regardless of the skill experience is being added to
|-
| dropRares || boolean || Yes || true || Determines if rolls for items that have a chance of dropping when the player earns experience are performed (currently includes [[Mastery Tokens]], {{ItemIcon|Crown of Rhaelyx}} parts, and {{ItemIcon|Mysterious Stone|Mysterious Stones}})
|}
|}
=== Examples ===
=== Examples ===
166

edits