Skip to content
This repository has been archived by the owner on Apr 8, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'runelite/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Owain94 committed Nov 5, 2019
2 parents a46fc00 + a7e8871 commit e880d09
Show file tree
Hide file tree
Showing 20 changed files with 231 additions and 215 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Adam <Adam@sigterm.info>
* Copyright (c) 2017-2019, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand All @@ -22,20 +22,19 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package net.runelite.api.events;

import lombok.Value;
import net.runelite.api.Skill;
import lombok.Data;

/**
* An event where the experience level of a {@link Skill} has been modified.
* An event where the experience, level, or boosted level of a {@link Skill} has been modified.
*/
@Data
public class ExperienceChanged implements Event
@Value
public class StatChanged implements Event
{
/**
* The modified skill.
*/
private Skill skill;
private final Skill skill;
private final int xp;
private final int level;
private final int boostedLevel;
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,18 @@ public enum UntradeableItemMapping
CRYSTAL_LEGS(ItemID.CRYSTAL_LEGS, 2, ItemID.CRYSTAL_ARMOUR_SEED),
CRYSTAL_LEGS_INACTIVE(ItemID.CRYSTAL_LEGS_INACTIVE, 2, ItemID.CRYSTAL_ARMOUR_SEED),
CRYSTAL_BODY(ItemID.CRYSTAL_BODY, 3, ItemID.CRYSTAL_ARMOUR_SEED),
CRYSTAL_BODY_INACTIVE(ItemID.CRYSTAL_BODY_INACTIVE, 3, ItemID.CRYSTAL_ARMOUR_SEED);
CRYSTAL_BODY_INACTIVE(ItemID.CRYSTAL_BODY_INACTIVE, 3, ItemID.CRYSTAL_ARMOUR_SEED),

TATTERED_MOON_PAGE(ItemID.TATTERED_MOON_PAGE, 1000, ItemID.COINS_995),
TATTERED_SUN_PAGE(ItemID.TATTERED_SUN_PAGE, 1000, ItemID.COINS_995),
TATTERED_TEMPLE_PAGE(ItemID.TATTERED_TEMPLE_PAGE, 1000, ItemID.COINS_995),

LONG_BONE(ItemID.LONG_BONE, 1000, ItemID.COINS_995),
CURVED_BONE(ItemID.CURVED_BONE, 2000, ItemID.COINS_995),
PERFECT_SHELL(ItemID.PERFECT_SHELL, 600, ItemID.COINS_995),
PERFECT_SNAIL_SHELL(ItemID.PERFECT_SNAIL_SHELL, 600, ItemID.COINS_995),
SNAIL_SHELL(ItemID.SNAIL_SHELL, 600, ItemID.COINS_995),
TORTOISE_SHELL(ItemID.TORTOISE_SHELL, 250, ItemID.COINS_995);

private static final ImmutableMap<Integer, UntradeableItemMapping> UNTRADEABLE_RECLAIM_MAP;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import lombok.Getter;
import net.runelite.api.Client;
import net.runelite.api.Skill;
import net.runelite.api.events.ExperienceChanged;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.StatChanged;
import net.runelite.client.eventbus.EventBus;

@Singleton
Expand All @@ -34,7 +34,7 @@ private XpDropManager(
this.client = client;
this.eventBus = eventBus;
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
eventBus.subscribe(ExperienceChanged.class, this, this::onExperienceChanged);
eventBus.subscribe(StatChanged.class, this, this::onStatChanged);
}

private void onGameStateChanged(GameStateChanged event)
Expand All @@ -43,7 +43,7 @@ private void onGameStateChanged(GameStateChanged event)
tickShow = 0;
}

private void onExperienceChanged(ExperienceChanged event)
private void onStatChanged(StatChanged event)
{
final Skill skill = event.getSkill();
final int xp = client.getSkillExperience(skill);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,10 @@
import net.runelite.api.TileObject;
import net.runelite.api.coords.WorldPoint;
import net.runelite.api.events.BeforeRender;
import net.runelite.api.events.BoostedLevelChanged;
import net.runelite.api.events.ConfigChanged;
import net.runelite.api.events.DecorativeObjectChanged;
import net.runelite.api.events.DecorativeObjectDespawned;
import net.runelite.api.events.DecorativeObjectSpawned;
import net.runelite.api.events.ExperienceChanged;
import net.runelite.api.events.GameObjectChanged;
import net.runelite.api.events.GameObjectDespawned;
import net.runelite.api.events.GameObjectSpawned;
Expand All @@ -67,6 +65,7 @@
import net.runelite.api.events.ItemDespawned;
import net.runelite.api.events.ItemSpawned;
import net.runelite.api.events.MenuOpened;
import net.runelite.api.events.StatChanged;
import net.runelite.api.events.WallObjectChanged;
import net.runelite.api.events.WallObjectDespawned;
import net.runelite.api.events.WallObjectSpawned;
Expand Down Expand Up @@ -201,8 +200,7 @@ private void addSubscriptions()
{
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
eventBus.subscribe(ExperienceChanged.class, this, this::onExperienceChanged);
eventBus.subscribe(BoostedLevelChanged.class, this, this::onBoostedLevelChanged);
eventBus.subscribe(StatChanged .class, this, this::onStatChanged);
eventBus.subscribe(ItemSpawned.class, this, this::onItemSpawned);
eventBus.subscribe(ItemDespawned.class, this, this::onItemDespawned);
eventBus.subscribe(GameTick.class, this, this::onGameTick);
Expand Down Expand Up @@ -295,9 +293,16 @@ public void updateConfig()
this.showAgilityArenaTimer = config.showAgilityArenaTimer();
}

private void onExperienceChanged(ExperienceChanged event)
public void onStatChanged(StatChanged statChanged)
{
if (event.getSkill() != AGILITY || !this.showLapCount)
if (statChanged.getSkill() != AGILITY)
{
return;
}

agilityLevel = statChanged.getBoostedLevel();

if (!this.showLapCount)
{
return;
}
Expand Down Expand Up @@ -330,15 +335,6 @@ private void onExperienceChanged(ExperienceChanged event)
}
}

private void onBoostedLevelChanged(BoostedLevelChanged boostedLevelChanged)
{
Skill skill = boostedLevelChanged.getSkill();
if (skill == AGILITY)
{
agilityLevel = client.getBoostedSkillLevel(skill);
}
}

private void onItemSpawned(ItemSpawned itemSpawned)
{
if (obstacles.isEmpty())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
import net.runelite.api.Constants;
import net.runelite.api.Prayer;
import net.runelite.api.Skill;
import net.runelite.api.events.BoostedLevelChanged;
import net.runelite.api.events.ConfigChanged;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.GameTick;
import net.runelite.api.events.StatChanged;
import net.runelite.client.Notifier;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.EventBus;
Expand Down Expand Up @@ -174,7 +174,7 @@ private void addSubscriptions()
{
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
eventBus.subscribe(BoostedLevelChanged.class, this, this::onBoostedLevelChanged);
eventBus.subscribe(StatChanged.class, this, this::onStatChanged);
eventBus.subscribe(GameTick.class, this, this::onGameTick);
}

Expand Down Expand Up @@ -211,9 +211,9 @@ private void onConfigChanged(ConfigChanged event)
}
}

private void onBoostedLevelChanged(BoostedLevelChanged boostedLevelChanged)
private void onStatChanged(StatChanged statChanged)
{
Skill skill = boostedLevelChanged.getSkill();
Skill skill = statChanged.getSkill();

if (!BOOSTABLE_COMBAT_SKILLS.contains(skill) && !BOOSTABLE_NON_COMBAT_SKILLS.contains(skill))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,29 +63,29 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati
.put(new WorldPoint(2383, 3370, 0), "West of the outpost")
.put(new WorldPoint(3312, 3375, 0), "North-west of Exam Centre, on the hill.")
.put(new WorldPoint(3121, 3384, 0), "North-east of Draynor Manor, near River Lum.")
.put(new WorldPoint(3430, 3388, 0), "West of Mort Myre Swamp.")
.put(new WorldPoint(3430, 3388, 0), "West of Mort Myre Swamp (BKR).")
.put(new WorldPoint(2920, 3403, 0), "South-east of Taverley, near Lady of the Lake.")
.put(new WorldPoint(2594, 2899, 0), "South-east of Feldip Hills, by the crimson swifts (AKS).")
.put(new WorldPoint(2387, 3435, 0), "West of Tree Gnome Stronghold, near the pen containing terrorbirds.")
.put(new WorldPoint(2512, 3467, 0), "Baxtorian Falls (Bring rope).")
.put(new WorldPoint(2381, 3468, 0), "West of Tree Gnome Stronghold, north of the pen with terrorbirds.")
.put(new WorldPoint(3005, 3475, 0), "Ice Mountain, west of Edgeville.")
.put(new WorldPoint(2585, 3505, 0), "By the shore line north of the Coal Trucks.")
.put(new WorldPoint(3443, 3515, 0), "South of Slayer Tower.")
.put(new WorldPoint(3443, 3515, 0), "South of Slayer Tower (CKS).")
.put(new WorldPoint(2416, 3516, 0), "Tree Gnome Stronghold, west of Grand Tree, near swamp.")
.put(new WorldPoint(3429, 3523, 0), "South of Slayer Tower.")
.put(new WorldPoint(2363, 3531, 0), "North-east of Eagles' Peak.")
.put(new WorldPoint(3429, 3523, 0), "South of Slayer Tower (CKS).")
.put(new WorldPoint(2363, 3531, 0), "North-east of Eagles' Peak (AKQ).")
.put(new WorldPoint(2919, 3535, 0), "East of Burthorpe pub.")
.put(new WorldPoint(3548, 3560, 0), "Inside Fenkenstrain's Castle.")
.put(new WorldPoint(1456, 3620, 0), "Graveyard west of Shayzien (DJR).")
.put(new WorldPoint(2735, 3638, 0), "East of Rellekka, north-west of Golden Apple Tree (AJR).")
.put(new WorldPoint(2681, 3653, 0), "Rellekka, in the garden of the south-east house.")
.put(new WorldPoint(2537, 3881, 0), "Miscellania.")
.put(new WorldPoint(2537, 3881, 0), "Miscellania (CIP).")
.put(new WorldPoint(2828, 3234, 0), "Southern coast of Crandor.")
.put(new WorldPoint(1247, 3726, 0), "Just inside the Farming Guild")
.put(new WorldPoint(3770, 3898, 0), "On the small island north-east of Fossil Island's mushroom forest.")
// Hard
.put(new WorldPoint(2209, 3161, 0), "North-east of Tyras Camp.")
.put(new WorldPoint(2209, 3161, 0), "North-east of Tyras Camp (BJS).")
.put(new WorldPoint(2181, 3206, 0), "South of Elf Camp.")
.put(new WorldPoint(3081, 3209, 0), "Small Island (CLP).")
.put(new WorldPoint(3374, 3250, 0), "Duel Arena combat area.")
Expand All @@ -98,12 +98,12 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati
.put(new WorldPoint(2581, 3030, 0), "Gu'Tanoth island, enter cave north-west of Feldip Hills (AKS).")
.put(new WorldPoint(2961, 3024, 0), "Ship yard (DKP).")
.put(new WorldPoint(2339, 3311, 0), "East of Prifddinas on Arandar mountain pass.")
.put(new WorldPoint(3440, 3341, 0), "Nature Spirit's grotto.")
.put(new WorldPoint(2763, 2974, 0), "Cairn Isle, west of Shilo Village.")
.put(new WorldPoint(3440, 3341, 0), "Nature Spirit's grotto (BIP).")
.put(new WorldPoint(2763, 2974, 0), "Cairn Isle, west of Shilo Village (CKR).")
.put(new WorldPoint(3138, 2969, 0), "West of Bandit Camp in Kharidian Desert.")
.put(new WorldPoint(2924, 2963, 0), "On the southern part of eastern Karamja.")
.put(new WorldPoint(2838, 2914, 0), "Kharazi Jungle, near water pool.")
.put(new WorldPoint(3441, 3419, 0), "Mort Myre Swamp.")
.put(new WorldPoint(2838, 2914, 0), "Kharazi Jungle, near water pool (CKR).")
.put(new WorldPoint(3441, 3419, 0), "Mort Myre Swamp (BKR).")
.put(new WorldPoint(2950, 2902, 0), "South-east of Kharazi Jungle.")
.put(new WorldPoint(2775, 2891, 0), "South-west of Kharazi Jungle.")
.put(new WorldPoint(3113, 3602, 0), "Wilderness. North of Edgeville (level 11).")
Expand All @@ -113,8 +113,8 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati
.put(new WorldPoint(3305, 3692, 0), "Wilderness. West of eastern green dragon.")
.put(new WorldPoint(3055, 3696, 0), "Wilderness. Bandit Camp.")
.put(new WorldPoint(3302, 3696, 0), "Wilderness. West of eastern green dragon.")
.put(new WorldPoint(1479, 3696, 0), "Lizardman Canyon.")
.put(new WorldPoint(2712, 3732, 0), "North-east of Rellekka.")
.put(new WorldPoint(1479, 3696, 0), "Lizardman Canyon (DJR).")
.put(new WorldPoint(2712, 3732, 0), "North-east of Rellekka (DKS).")
.put(new WorldPoint(2970, 3749, 0), "Wilderness. Forgotten Cemetery.")
.put(new WorldPoint(3094, 3764, 0), "Wilderness. Mining site north of Bandit Camp.")
.put(new WorldPoint(3311, 3769, 0), "Wilderness. North of Venenatis.")
Expand Down Expand Up @@ -188,7 +188,7 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati
.put(new WorldPoint(1698, 3792, 0), "Arceuus church.")
.put(new WorldPoint(2951, 3820, 0), "Wilderness. Chaos Temple (level 38).")
.put(new WorldPoint(2202, 3825, 0), "Pirates' Cove, between Lunar Isle and Rellekka.")
.put(new WorldPoint(1761, 3853, 0), "Arceuus essence mine.")
.put(new WorldPoint(1761, 3853, 0), "Arceuus essence mine (CIS).")
.put(new WorldPoint(2090, 3863, 0), "South of Lunar Isle, west of Astral altar.")
.put(new WorldPoint(1442, 3878, 0), "Sulphur Mine.")
.put(new WorldPoint(3380, 3929, 0), "Wilderness. Near Volcano.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@
import net.runelite.api.Skill;
import net.runelite.api.coords.WorldPoint;
import net.runelite.api.events.AreaSoundEffectPlayed;
import net.runelite.api.events.BoostedLevelChanged;
import net.runelite.api.events.CommandExecuted;
import net.runelite.api.events.ExperienceChanged;
import net.runelite.api.events.MenuEntryAdded;
import net.runelite.api.events.SoundEffectPlayed;
import net.runelite.api.events.StatChanged;
import net.runelite.api.events.VarbitChanged;
import net.runelite.api.kit.KitType;
import net.runelite.client.config.ConfigManager;
Expand Down Expand Up @@ -301,9 +300,13 @@ private void onCommandExecuted(CommandExecuted commandExecuted)

client.queueChangedSkill(skill);

ExperienceChanged experienceChanged = new ExperienceChanged();
experienceChanged.setSkill(skill);
eventBus.post(ExperienceChanged.class, experienceChanged);
StatChanged statChanged = new StatChanged(
skill,
totalXp,
level,
level
);
eventBus.post(StatChanged.class, statChanged);
break;
}
case "setstat":
Expand All @@ -320,13 +323,13 @@ private void onCommandExecuted(CommandExecuted commandExecuted)

client.queueChangedSkill(skill);

ExperienceChanged experienceChanged = new ExperienceChanged();
experienceChanged.setSkill(skill);
eventBus.post(ExperienceChanged.class, experienceChanged);

BoostedLevelChanged boostedLevelChanged = new BoostedLevelChanged();
boostedLevelChanged.setSkill(skill);
eventBus.post(BoostedLevelChanged.class, boostedLevelChanged);
StatChanged statChanged = new StatChanged(
skill,
xp,
level,
level
);
eventBus.post(StatChanged.class, statChanged);
break;
}
case "anim":
Expand Down
Loading

0 comments on commit e880d09

Please sign in to comment.