xp-tracker: support league & dmm modifiers for kills remaining
This commit is contained in:
@@ -123,7 +123,7 @@ class XpState
|
|||||||
* @param npc currently interacted NPC
|
* @param npc currently interacted NPC
|
||||||
* @param npcHealth health of currently interacted NPC
|
* @param npcHealth health of currently interacted NPC
|
||||||
*/
|
*/
|
||||||
void updateNpcExperience(Skill skill, NPC npc, Integer npcHealth)
|
void updateNpcExperience(Skill skill, NPC npc, Integer npcHealth, int xpModifier)
|
||||||
{
|
{
|
||||||
if (npc == null || npc.getCombatLevel() <= 0 || npcHealth == null)
|
if (npc == null || npc.getCombatLevel() <= 0 || npcHealth == null)
|
||||||
{
|
{
|
||||||
@@ -131,7 +131,7 @@ class XpState
|
|||||||
}
|
}
|
||||||
|
|
||||||
final XpStateSingle state = getSkill(skill);
|
final XpStateSingle state = getSkill(skill);
|
||||||
final int actionExp = (int) (npcHealth * getCombatXPModifier(skill));
|
final int actionExp = (int) (npcHealth * getCombatXPModifier(skill) * xpModifier);
|
||||||
final XpAction action = state.getXpAction(XpActionType.ACTOR_HEALTH);
|
final XpAction action = state.getXpAction(XpActionType.ACTOR_HEALTH);
|
||||||
|
|
||||||
if (action.isActionsHistoryInitialized())
|
if (action.isActionsHistoryInitialized())
|
||||||
|
|||||||
@@ -377,8 +377,9 @@ public class XpTrackerPlugin extends Plugin
|
|||||||
final Actor interacting = client.getLocalPlayer().getInteracting();
|
final Actor interacting = client.getLocalPlayer().getInteracting();
|
||||||
if (interacting instanceof NPC && COMBAT.contains(skill))
|
if (interacting instanceof NPC && COMBAT.contains(skill))
|
||||||
{
|
{
|
||||||
|
final int xpModifier = worldSetToType(client.getWorldType()).getXpModifier();
|
||||||
final NPC npc = (NPC) interacting;
|
final NPC npc = (NPC) interacting;
|
||||||
xpState.updateNpcExperience(skill, npc, npcManager.getHealth(npc.getId()));
|
xpState.updateNpcExperience(skill, npc, npcManager.getHealth(npc.getId()), xpModifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
final XpUpdateResult updateResult = xpState.updateSkill(skill, currentXp, startGoalXp, endGoalXp);
|
final XpUpdateResult updateResult = xpState.updateSkill(skill, currentXp, startGoalXp, endGoalXp);
|
||||||
|
|||||||
@@ -24,14 +24,20 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.xptracker;
|
package net.runelite.client.plugins.xptracker;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import net.runelite.api.WorldType;
|
import net.runelite.api.WorldType;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@RequiredArgsConstructor
|
||||||
enum XpWorldType
|
enum XpWorldType
|
||||||
{
|
{
|
||||||
NORMAL,
|
NORMAL(1),
|
||||||
TOURNEY,
|
TOURNEY(1),
|
||||||
DMM,
|
DMM(5),
|
||||||
LEAGUE;
|
LEAGUE(5);
|
||||||
|
|
||||||
|
private final int xpModifier;
|
||||||
|
|
||||||
static XpWorldType of(WorldType type)
|
static XpWorldType of(WorldType type)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user