me start
This commit is contained in:
@@ -293,6 +293,15 @@ public enum Varbits
|
||||
*/
|
||||
THEATRE_OF_BLOOD(6440),
|
||||
|
||||
/**
|
||||
* Theatre of Blood orb varbits each number stands for the player's health on a scale of 1-27 (I think), 0 hides the orb
|
||||
*/
|
||||
THEATRE_OF_BLOOD_ORB_1(6442),
|
||||
THEATRE_OF_BLOOD_ORB_2(6443),
|
||||
THEATRE_OF_BLOOD_ORB_3(6444),
|
||||
THEATRE_OF_BLOOD_ORB_4(6445),
|
||||
THEATRE_OF_BLOOD_ORB_5(6446),
|
||||
|
||||
/**
|
||||
* Nightmare Zone
|
||||
*/
|
||||
|
||||
@@ -25,12 +25,13 @@
|
||||
package net.runelite.client.plugins.dpscounter;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.Getter;
|
||||
import lombok.ToString;
|
||||
import net.runelite.api.NpcID;
|
||||
|
||||
@Getter
|
||||
@ToString
|
||||
enum Boss
|
||||
{
|
||||
@@ -45,15 +46,66 @@ enum Boss
|
||||
KING_BLACK_DRAGON(1.075f, NpcID.KING_BLACK_DRAGON, NpcID.KING_BLACK_DRAGON_2642, NpcID.KING_BLACK_DRAGON_6502),
|
||||
KRIL_TSUROTH(1.375f, NpcID.KRIL_TSUTSAROTH, NpcID.KRIL_TSUTSAROTH_6495),
|
||||
VENETENATIS(1.4f, NpcID.VENENATIS, NpcID.VENENATIS_6610),
|
||||
VETION(1.225f, NpcID.VETION, NpcID.VETION_REBORN);
|
||||
VETION(1.225f, NpcID.VETION, NpcID.VETION_REBORN),
|
||||
MAIDEN(1f, NpcID.THE_MAIDEN_OF_SUGADINTI, NpcID.THE_MAIDEN_OF_SUGADINTI_8361, NpcID.THE_MAIDEN_OF_SUGADINTI_8362, NpcID.THE_MAIDEN_OF_SUGADINTI_8363, NpcID.THE_MAIDEN_OF_SUGADINTI_8364, NpcID.THE_MAIDEN_OF_SUGADINTI_8365),
|
||||
BLOAT(new float[]{1.7f, 1.775f, 1.85f}, NpcID.PESTILENT_BLOAT),
|
||||
NYLOCAS_BOSS(new float[]{1.175f, 1.2f, 1.225f}, NpcID.NYLOCAS_VASILIAS, NpcID.NYLOCAS_VASILIAS_8355, NpcID.NYLOCAS_VASILIAS_8356, NpcID.NYLOCAS_VASILIAS_8357),
|
||||
SOTETSEG(new float[]{1.525f, 1.6f, 1.675f}, NpcID.SOTETSEG, NpcID.SOTETSEG_8388),
|
||||
XARPUS(1f, NpcID.XARPUS_8340, NpcID.XARPUS_8341),
|
||||
VERZIK_P1(1.05f, NpcID.VERZIK_VITUR_8370),
|
||||
VERZIK_P2(new float[]{1.35f, 1.4f, 1.425f}, NpcID.VERZIK_VITUR_8372),
|
||||
VERZIK_P3(new float[]{1.675f, 1.75f, 1.85f}, NpcID.VERZIK_VITUR_8374);
|
||||
|
||||
private static final Set<Boss> TOB_BOSSES = ImmutableSet.of(MAIDEN, BLOAT, NYLOCAS_BOSS, SOTETSEG, XARPUS, VERZIK_P1, VERZIK_P2, VERZIK_P3);
|
||||
|
||||
@Getter
|
||||
private final int[] ids;
|
||||
private final float modifier; // Some NPCs have a modifier to the experience a player receives.
|
||||
private final int[] minions;
|
||||
private final float[] modifier; // Some NPCs have a modifier to the experience a player receives.
|
||||
|
||||
Boss(float modifier, int... ids)
|
||||
{
|
||||
this.modifier = modifier;
|
||||
this.modifier = new float[]{modifier};
|
||||
this.ids = ids;
|
||||
this.minions = null;
|
||||
}
|
||||
|
||||
Boss(float[] modifiers, int... ids)
|
||||
{
|
||||
this(modifiers, null, ids);
|
||||
}
|
||||
|
||||
Boss(float[] modifiers, int[] minions, int ... ids)
|
||||
{
|
||||
this.ids = ids;
|
||||
this.modifier = modifiers;
|
||||
this.minions = minions;
|
||||
}
|
||||
|
||||
float getModifier()
|
||||
{
|
||||
return modifier[0];
|
||||
}
|
||||
|
||||
float getModifier(int partySize)
|
||||
{
|
||||
if (modifier.length == 1)
|
||||
{
|
||||
return modifier[0];
|
||||
}
|
||||
|
||||
if (partySize == 5)
|
||||
{
|
||||
return modifier[2];
|
||||
}
|
||||
else if (partySize == 4)
|
||||
{
|
||||
return modifier[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
return modifier[0];
|
||||
}
|
||||
}
|
||||
|
||||
private static final Map<Integer, Boss> BOSS_MAP;
|
||||
@@ -63,6 +115,11 @@ enum Boss
|
||||
return BOSS_MAP.get(id);
|
||||
}
|
||||
|
||||
static boolean isTOB(Boss boss)
|
||||
{
|
||||
return TOB_BOSSES.contains(boss);
|
||||
}
|
||||
|
||||
static
|
||||
{
|
||||
ImmutableMap.Builder<Integer, Boss> builder = ImmutableMap.builder();
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package net.runelite.client.plugins.dpscounter;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Provides;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
@@ -13,6 +15,7 @@ import net.runelite.api.MenuAction;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.events.ExperienceChanged;
|
||||
import net.runelite.api.events.InteractingChanged;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
@@ -51,6 +54,10 @@ public class DpsCounterPlugin extends Plugin
|
||||
@Inject
|
||||
private DpsOverlay dpsOverlay;
|
||||
|
||||
static private final Set<Varbits> TOB_PARTY_ORBS_VARBITS = ImmutableSet.of(Varbits.THEATRE_OF_BLOOD_ORB_1,
|
||||
Varbits.THEATRE_OF_BLOOD_ORB_2, Varbits.THEATRE_OF_BLOOD_ORB_3, Varbits.THEATRE_OF_BLOOD_ORB_4,
|
||||
Varbits.THEATRE_OF_BLOOD_ORB_5);
|
||||
|
||||
private Boss boss;
|
||||
private NPC bossNpc;
|
||||
private int lastHpExp = -1;
|
||||
@@ -125,7 +132,20 @@ public class DpsCounterPlugin extends Plugin
|
||||
}
|
||||
|
||||
final int delta = xp - lastHpExp;
|
||||
final int hit = getHit(boss.getModifier(), delta);
|
||||
|
||||
float modifier;
|
||||
if (Boss.isTOB(boss))
|
||||
{
|
||||
int partySize = getTobPartySize();
|
||||
System.out.println(partySize);
|
||||
modifier = boss.getModifier(partySize);
|
||||
}
|
||||
else
|
||||
{
|
||||
modifier = boss.getModifier();
|
||||
}
|
||||
|
||||
final int hit = getHit(modifier, delta);
|
||||
lastHpExp = xp;
|
||||
|
||||
// Update local member
|
||||
@@ -245,4 +265,22 @@ public class DpsCounterPlugin extends Plugin
|
||||
float damageOutput = (deltaExperience * modifierBase) / 1.3333f;
|
||||
return Math.round(damageOutput);
|
||||
}
|
||||
|
||||
private int getTobPartySize()
|
||||
{
|
||||
int partySize = 0;
|
||||
for (Varbits varbit : TOB_PARTY_ORBS_VARBITS)
|
||||
{
|
||||
if (client.getVar(varbit) != 0)
|
||||
{
|
||||
partySize++;
|
||||
System.out.println(varbit.getId() + ": " + client.getVar(varbit));
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return partySize;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user