add twisted league support
add twisted league support for XP Drops
This commit is contained in:
@@ -69,6 +69,7 @@ public class XpDropPlugin extends Plugin
|
|||||||
private static final int XPDROP_PADDING = 2; // space between xp drop icons
|
private static final int XPDROP_PADDING = 2; // space between xp drop icons
|
||||||
private static final double HITPOINT_RATIO = 1.33; // Base rate of hp xp per point damage
|
private static final double HITPOINT_RATIO = 1.33; // Base rate of hp xp per point damage
|
||||||
private static final double DMM_MULTIPLIER_RATIO = 10;
|
private static final double DMM_MULTIPLIER_RATIO = 10;
|
||||||
|
private static final double TL_MULTIPLIER_RATIO = 5;
|
||||||
@Inject
|
@Inject
|
||||||
private Client client;
|
private Client client;
|
||||||
@Inject
|
@Inject
|
||||||
@@ -352,12 +353,18 @@ public class XpDropPlugin extends Plugin
|
|||||||
private void calculateDamageDealt(int diff)
|
private void calculateDamageDealt(int diff)
|
||||||
{
|
{
|
||||||
double damageDealt = diff / HITPOINT_RATIO;
|
double damageDealt = diff / HITPOINT_RATIO;
|
||||||
// DeadMan mode has an XP modifier
|
|
||||||
|
// DeadMan mode has an XP modifier of 10x
|
||||||
if (client.getWorldType().contains(WorldType.DEADMAN))
|
if (client.getWorldType().contains(WorldType.DEADMAN))
|
||||||
{
|
{
|
||||||
damageDealt = damageDealt / DMM_MULTIPLIER_RATIO;
|
damageDealt = damageDealt / DMM_MULTIPLIER_RATIO;
|
||||||
}
|
}
|
||||||
|
// Twisted League mode has an XP modifier of 5x
|
||||||
|
if (client.getWorldType().contains(WorldType.LEAGUE))
|
||||||
|
{
|
||||||
|
damageDealt = damageDealt / TL_MULTIPLIER_RATIO;
|
||||||
|
}
|
||||||
|
|
||||||
// Some NPCs have an XP modifier, account for it here.
|
// Some NPCs have an XP modifier, account for it here.
|
||||||
Actor a = client.getLocalPlayer().getInteracting();
|
Actor a = client.getLocalPlayer().getInteracting();
|
||||||
if (!(a instanceof NPC) && !(a instanceof Player))
|
if (!(a instanceof NPC) && !(a instanceof Player))
|
||||||
|
|||||||
Reference in New Issue
Block a user