Skip to content

Commit

Permalink
Merge pull request runelite#9940 from Alexsuperfly/agility-pyramid-to…
Browse files Browse the repository at this point in the history
…tal-exp

agility: account for bonus exp from agility pyramid
  • Loading branch information
Adam- authored Mar 6, 2020
2 parents 7b1819a + 1516027 commit f30889b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,15 @@ void incrementLapCount(Client client, XpTrackerService xpTrackerService)
final int currentExp = client.getSkillExperience(Skill.AGILITY);
final int goalXp = xpTrackerService.getEndGoalXp(Skill.AGILITY);
final int goalRemainingXp = goalXp - currentExp;
double courseTotalExp = course.getTotalXp();
if (course == Courses.PYRAMID)
{
// agility pyramid has a bonus exp drop on the last obstacle that scales with player level and caps at 1000
// the bonus is not already accounted for in the total exp number in the courses enum
courseTotalExp += Math.min(300 + 8 * client.getRealSkillLevel(Skill.AGILITY), 1000);
}

lapsTillGoal = goalRemainingXp > 0 ? (int) Math.ceil(goalRemainingXp / course.getTotalXp()) : 0;
lapsTillGoal = goalRemainingXp > 0 ? (int) Math.ceil(goalRemainingXp / courseTotalExp) : 0;
}

void resetLapCount()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ enum Courses
{
GNOME(86.5, 46, 9781),
DRAYNOR(120.0, 79, 12338),
AL_KHARID(180.0, 30, 13105, new WorldPoint(3299, 3194, 0)),
PYRAMID(722.0, 300, 13356, new WorldPoint(3364, 2830, 0)),
AL_KHARID(180.0, 0, 13105, new WorldPoint(3299, 3194, 0)),
PYRAMID(722.0, 0, 13356, new WorldPoint(3364, 2830, 0)),
VARROCK(238.0, 125, 12853),
PENGUIN(540.0, 65, 10559),
BARBARIAN(139.5, 60, 10039),
Expand Down

0 comments on commit f30889b

Please sign in to comment.