diff --git a/src/main/java/com/playmonumenta/libraryofsouls/bestiary/BestiaryManager.java b/src/main/java/com/playmonumenta/libraryofsouls/bestiary/BestiaryManager.java index 6e3b084..beaa13e 100644 --- a/src/main/java/com/playmonumenta/libraryofsouls/bestiary/BestiaryManager.java +++ b/src/main/java/com/playmonumenta/libraryofsouls/bestiary/BestiaryManager.java @@ -174,12 +174,26 @@ public void entityDeathEvent(EntityDeathEvent event) { } }); } else { - // Not a boss, just record kill for the killer + // Not a boss, record kill for the killer try { mStorage.recordKill(player, soul); } catch (Exception ex) { mLogger.warning(ex.getMessage()); } + + // also check if any nearby player has not killed that mob before, and give them the kill + // good for both unlocking the entry in group play, and also to stop descriptions from showing up too many times + List otherPlayers = player.getWorld().getPlayers(); + otherPlayers.remove(player); + otherPlayers.removeIf(p -> p.getLocation().distanceSquared(player.getLocation()) > 20 * 20); + otherPlayers.removeIf(p -> getKillsForMob(p, soul) > 0); + for (Player p : otherPlayers) { + try { + mStorage.recordKill(p, soul); + } catch (Exception ex) { + mLogger.warning(ex.getMessage()); + } + } } } } catch (Exception ex) {