Fixes nightmare loot tracking

This commit is contained in:
Dylan white
2020-08-04 00:47:35 -05:00
parent 2dab73417f
commit fae4183c2e
2 changed files with 29 additions and 33 deletions

View File

@@ -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;

View File

@@ -84,6 +84,7 @@ public class LootManager
.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)
.put(NpcID.THE_NIGHTMARE_9430, AnimationID.NIGHTMARE_DEATH)
.build(); .build();
private final EventBus eventBus; private final EventBus eventBus;
@@ -106,7 +107,6 @@ public class LootManager
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)