dps counter: add option to only count boss damage

This commit is contained in:
Adam
2020-11-28 14:32:09 -05:00
parent d8e97dd1f7
commit e9acabf549
2 changed files with 19 additions and 1 deletions

View File

@@ -63,4 +63,15 @@ public interface DpsConfig extends Config
{
return false;
}
@ConfigItem(
position = 3,
keyName = "bossDamage",
name = "Only boss damage",
description = "Only count damage done to the boss, and not to other NPCs"
)
default boolean bossDamage()
{
return false;
}
}

View File

@@ -186,6 +186,13 @@ public class DpsCounterPlugin extends Plugin
if (hitsplat.isMine())
{
final int npcId = ((NPC) actor).getId();
boolean isBoss = BOSSES.contains(npcId);
if (dpsConfig.bossDamage() && !isBoss)
{
return;
}
int hit = hitsplat.getAmount();
// Update local member
PartyMember localMember = partyService.getLocalMember();
@@ -207,7 +214,7 @@ public class DpsCounterPlugin extends Plugin
{
final int npcId = ((NPC) actor).getId();
boolean isBoss = BOSSES.contains(npcId);
if (actor != player.getInteracting() && !isBoss)
if ((dpsConfig.bossDamage() || actor != player.getInteracting()) && !isBoss)
{
// only track damage to npcs we are attacking, or is a nearby common boss
return;