Fixes nightmare loot tracking
This commit is contained in:
@@ -292,6 +292,7 @@ public final class AnimationID
|
|||||||
public static final int ROCKSLUG_DEATH = 1568;
|
public static final int ROCKSLUG_DEATH = 1568;
|
||||||
public static final int ZYGOMITE_DEATH = 3327;
|
public static final int ZYGOMITE_DEATH = 3327;
|
||||||
public static final int IMP_DEATH = 172;
|
public static final int IMP_DEATH = 172;
|
||||||
|
public static final int NIGHTMARE_DEATH = 8612;
|
||||||
|
|
||||||
// POH Animations
|
// POH Animations
|
||||||
public static final int INCENSE_BURNER = 3687;
|
public static final int INCENSE_BURNER = 3687;
|
||||||
|
|||||||
@@ -65,26 +65,27 @@ import net.runelite.client.events.PlayerLootReceived;
|
|||||||
public class LootManager
|
public class LootManager
|
||||||
{
|
{
|
||||||
private static final Map<Integer, Integer> NPC_DEATH_ANIMATIONS = ImmutableMap.<Integer, Integer>builder()
|
private static final Map<Integer, Integer> NPC_DEATH_ANIMATIONS = ImmutableMap.<Integer, Integer>builder()
|
||||||
.put(NpcID.CAVE_KRAKEN, AnimationID.CAVE_KRAKEN_DEATH)
|
.put(NpcID.CAVE_KRAKEN, AnimationID.CAVE_KRAKEN_DEATH)
|
||||||
.put(NpcID.CRYSTALLINE_BAT, AnimationID.CRYSTALLINE_BAT_DEATH)
|
.put(NpcID.CRYSTALLINE_BAT, AnimationID.CRYSTALLINE_BAT_DEATH)
|
||||||
.put(NpcID.CRYSTALLINE_RAT, AnimationID.CRYSTALLINE_RAT_DEATH)
|
.put(NpcID.CRYSTALLINE_RAT, AnimationID.CRYSTALLINE_RAT_DEATH)
|
||||||
.put(NpcID.CRYSTALLINE_SPIDER, AnimationID.CRYSTALLINE_SPIDER_DEATH)
|
.put(NpcID.CRYSTALLINE_SPIDER, AnimationID.CRYSTALLINE_SPIDER_DEATH)
|
||||||
.put(NpcID.CRYSTALLINE_WOLF, AnimationID.CRYSTALLINE_WOLF_DEATH)
|
.put(NpcID.CRYSTALLINE_WOLF, AnimationID.CRYSTALLINE_WOLF_DEATH)
|
||||||
.put(NpcID.CRYSTALLINE_UNICORN, AnimationID.CRYSTALLINE_UNICORN_DEATH)
|
.put(NpcID.CRYSTALLINE_UNICORN, AnimationID.CRYSTALLINE_UNICORN_DEATH)
|
||||||
.put(NpcID.CRYSTALLINE_SCORPION, AnimationID.CORRUPTED_SCORPION_DEATH)
|
.put(NpcID.CRYSTALLINE_SCORPION, AnimationID.CORRUPTED_SCORPION_DEATH)
|
||||||
.put(NpcID.CRYSTALLINE_DRAGON, AnimationID.CRYSTALLINE_DRAGON_DEATH)
|
.put(NpcID.CRYSTALLINE_DRAGON, AnimationID.CRYSTALLINE_DRAGON_DEATH)
|
||||||
.put(NpcID.CRYSTALLINE_DARK_BEAST, AnimationID.CRYSTALLINE_DARK_BEAST_DEATH)
|
.put(NpcID.CRYSTALLINE_DARK_BEAST, AnimationID.CRYSTALLINE_DARK_BEAST_DEATH)
|
||||||
.put(NpcID.CRYSTALLINE_BEAR, AnimationID.CRYSTALLINE_BEAR_DEATH)
|
.put(NpcID.CRYSTALLINE_BEAR, AnimationID.CRYSTALLINE_BEAR_DEATH)
|
||||||
.put(NpcID.CORRUPTED_BAT, AnimationID.CRYSTALLINE_BAT_DEATH)
|
.put(NpcID.CORRUPTED_BAT, AnimationID.CRYSTALLINE_BAT_DEATH)
|
||||||
.put(NpcID.CORRUPTED_RAT, AnimationID.CRYSTALLINE_RAT_DEATH)
|
.put(NpcID.CORRUPTED_RAT, AnimationID.CRYSTALLINE_RAT_DEATH)
|
||||||
.put(NpcID.CORRUPTED_SPIDER, AnimationID.CRYSTALLINE_SPIDER_DEATH)
|
.put(NpcID.CORRUPTED_SPIDER, AnimationID.CRYSTALLINE_SPIDER_DEATH)
|
||||||
.put(NpcID.CORRUPTED_WOLF, AnimationID.CRYSTALLINE_WOLF_DEATH)
|
.put(NpcID.CORRUPTED_WOLF, AnimationID.CRYSTALLINE_WOLF_DEATH)
|
||||||
.put(NpcID.CORRUPTED_UNICORN, AnimationID.CRYSTALLINE_UNICORN_DEATH)
|
.put(NpcID.CORRUPTED_UNICORN, AnimationID.CRYSTALLINE_UNICORN_DEATH)
|
||||||
.put(NpcID.CORRUPTED_SCORPION, AnimationID.CORRUPTED_SCORPION_DEATH)
|
.put(NpcID.CORRUPTED_SCORPION, AnimationID.CORRUPTED_SCORPION_DEATH)
|
||||||
.put(NpcID.CORRUPTED_DRAGON, AnimationID.CRYSTALLINE_DRAGON_DEATH)
|
.put(NpcID.CORRUPTED_DRAGON, AnimationID.CRYSTALLINE_DRAGON_DEATH)
|
||||||
.put(NpcID.CORRUPTED_DARK_BEAST, AnimationID.CRYSTALLINE_DARK_BEAST_DEATH)
|
.put(NpcID.CORRUPTED_DARK_BEAST, AnimationID.CRYSTALLINE_DARK_BEAST_DEATH)
|
||||||
.put(NpcID.CORRUPTED_BEAR, AnimationID.CRYSTALLINE_BEAR_DEATH)
|
.put(NpcID.CORRUPTED_BEAR, AnimationID.CRYSTALLINE_BEAR_DEATH)
|
||||||
.build();
|
.put(NpcID.THE_NIGHTMARE_9430, AnimationID.NIGHTMARE_DEATH)
|
||||||
|
.build();
|
||||||
|
|
||||||
private final EventBus eventBus;
|
private final EventBus eventBus;
|
||||||
private final Client client;
|
private final Client client;
|
||||||
@@ -98,15 +99,14 @@ public class LootManager
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private LootManager(
|
private LootManager(
|
||||||
final EventBus eventBus,
|
final EventBus eventBus,
|
||||||
final Client client
|
final Client client
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
this.client = client;
|
this.client = client;
|
||||||
|
|
||||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||||
eventBus.subscribe(NpcDefinitionChanged.class, this, this::onNpcChanged);
|
|
||||||
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
||||||
eventBus.subscribe(PlayerDespawned.class, this, this::onPlayerDespawned);
|
eventBus.subscribe(PlayerDespawned.class, this, this::onPlayerDespawned);
|
||||||
eventBus.subscribe(ItemSpawned.class, this, this::onItemSpawned);
|
eventBus.subscribe(ItemSpawned.class, this, this::onItemSpawned);
|
||||||
@@ -247,6 +247,11 @@ public class LootManager
|
|||||||
// Big Kraken drops loot wherever player is standing when animation starts.
|
// Big Kraken drops loot wherever player is standing when animation starts.
|
||||||
krakenPlayerLocation = client.getLocalPlayer().getWorldLocation();
|
krakenPlayerLocation = client.getLocalPlayer().getWorldLocation();
|
||||||
}
|
}
|
||||||
|
else if (id == NpcID.THE_NIGHTMARE_9430)
|
||||||
|
{
|
||||||
|
delayedLootNpc = npc;
|
||||||
|
delayedLootTickLimit = 16;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// These NPCs drop loot on death animation, which is right now.
|
// These NPCs drop loot on death animation, which is right now.
|
||||||
@@ -255,16 +260,6 @@ public class LootManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onNpcChanged(NpcDefinitionChanged npcChanged)
|
|
||||||
{
|
|
||||||
final NPC npc = npcChanged.getNpc();
|
|
||||||
if (npc.getId() == NpcID.THE_NIGHTMARE_9433)
|
|
||||||
{
|
|
||||||
delayedLootNpc = npc;
|
|
||||||
delayedLootTickLimit = 15;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onGameTick(GameTick gameTick)
|
private void onGameTick(GameTick gameTick)
|
||||||
{
|
{
|
||||||
if (delayedLootNpc != null && delayedLootTickLimit-- > 0)
|
if (delayedLootNpc != null && delayedLootTickLimit-- > 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user