Merge pull request #2766 from Dyldozer/master
LootManager: Nightmare Fix
This commit is contained in:
@@ -292,6 +292,7 @@ public final class AnimationID
|
||||
public static final int ROCKSLUG_DEATH = 1568;
|
||||
public static final int ZYGOMITE_DEATH = 3327;
|
||||
public static final int IMP_DEATH = 172;
|
||||
public static final int NIGHTMARE_DEATH = 8612;
|
||||
|
||||
// POH Animations
|
||||
public static final int INCENSE_BURNER = 3687;
|
||||
|
||||
@@ -53,7 +53,6 @@ import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.ItemDespawned;
|
||||
import net.runelite.api.events.ItemQuantityChanged;
|
||||
import net.runelite.api.events.ItemSpawned;
|
||||
import net.runelite.api.events.NpcDefinitionChanged;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.PlayerDespawned;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
@@ -84,6 +83,7 @@ public class LootManager
|
||||
.put(NpcID.CORRUPTED_DRAGON, AnimationID.CRYSTALLINE_DRAGON_DEATH)
|
||||
.put(NpcID.CORRUPTED_DARK_BEAST, AnimationID.CRYSTALLINE_DARK_BEAST_DEATH)
|
||||
.put(NpcID.CORRUPTED_BEAR, AnimationID.CRYSTALLINE_BEAR_DEATH)
|
||||
.put(NpcID.THE_NIGHTMARE_9430, AnimationID.NIGHTMARE_DEATH)
|
||||
.build();
|
||||
|
||||
private final EventBus eventBus;
|
||||
@@ -106,7 +106,6 @@ public class LootManager
|
||||
this.client = client;
|
||||
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(NpcDefinitionChanged.class, this, this::onNpcChanged);
|
||||
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
||||
eventBus.subscribe(PlayerDespawned.class, this, this::onPlayerDespawned);
|
||||
eventBus.subscribe(ItemSpawned.class, this, this::onItemSpawned);
|
||||
@@ -247,6 +246,11 @@ public class LootManager
|
||||
// Big Kraken drops loot wherever player is standing when animation starts.
|
||||
krakenPlayerLocation = client.getLocalPlayer().getWorldLocation();
|
||||
}
|
||||
else if (id == NpcID.THE_NIGHTMARE_9430)
|
||||
{
|
||||
delayedLootNpc = npc;
|
||||
delayedLootTickLimit = 16;
|
||||
}
|
||||
else
|
||||
{
|
||||
// These NPCs drop loot on death animation, which is right now.
|
||||
@@ -255,16 +259,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)
|
||||
{
|
||||
if (delayedLootNpc != null && delayedLootTickLimit-- > 0)
|
||||
|
||||
Reference in New Issue
Block a user