Merge pull request #9360 from Nightfirecat/fix-jad-zuk-task-tracking
slayerplugin: Correct Jad and Zuk task tracking
This commit is contained in:
@@ -535,7 +535,15 @@ public class SlayerPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
killedOne();
|
||||
final int taskKillExp = Task.getTask(taskName).getExpectedKillExp();
|
||||
|
||||
// Only count exp gain as a kill if the task either has no expected exp for a kill, or if the exp gain is equal
|
||||
// to the expected exp gain for the task.
|
||||
if (taskKillExp == 0 || taskKillExp == slayerExp - cachedXp)
|
||||
{
|
||||
killedOne();
|
||||
}
|
||||
|
||||
cachedXp = slayerExp;
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ enum Task
|
||||
ICEFIENDS("Icefiends", ItemID.ICE_DIAMOND),
|
||||
INFERNAL_MAGES("Infernal mages", ItemID.INFERNAL_MAGE, "Malevolent mage"),
|
||||
IRON_DRAGONS("Iron dragons", ItemID.IRON_DRAGON_MASK),
|
||||
JAD("TzTok-Jad", ItemID.TZREKJAD),
|
||||
JAD("TzTok-Jad", ItemID.TZREKJAD, 25250),
|
||||
JELLIES("Jellies", ItemID.JELLY, "Jelly"),
|
||||
JUNGLE_HORROR("Jungle horrors", ItemID.ENSOULED_HORROR_HEAD),
|
||||
KALPHITE("Kalphite", ItemID.KALPHITE_SOLDIER),
|
||||
@@ -171,7 +171,7 @@ enum Task
|
||||
ZILYANA("Commander Zilyana", ItemID.PET_ZILYANA),
|
||||
ZOMBIES("Zombies", ItemID.ZOMBIE_HEAD, "Undead"),
|
||||
ZULRAH("Zulrah", ItemID.PET_SNAKELING),
|
||||
ZUK("TzKal-Zuk", ItemID.TZREKZUK);
|
||||
ZUK("TzKal-Zuk", ItemID.TZREKZUK, 101890);
|
||||
//</editor-fold>
|
||||
|
||||
private static final Map<String, Task> tasks;
|
||||
@@ -181,6 +181,7 @@ enum Task
|
||||
private final String[] targetNames;
|
||||
private final int weaknessThreshold;
|
||||
private final int weaknessItem;
|
||||
private final int expectedKillExp;
|
||||
|
||||
static
|
||||
{
|
||||
@@ -202,6 +203,7 @@ enum Task
|
||||
this.weaknessThreshold = -1;
|
||||
this.weaknessItem = -1;
|
||||
this.targetNames = targetNames;
|
||||
this.expectedKillExp = 0;
|
||||
}
|
||||
|
||||
Task(String name, int itemSpriteId, int weaknessThreshold, int weaknessItem, String... targetNames)
|
||||
@@ -212,6 +214,18 @@ enum Task
|
||||
this.weaknessThreshold = weaknessThreshold;
|
||||
this.weaknessItem = weaknessItem;
|
||||
this.targetNames = targetNames;
|
||||
this.expectedKillExp = 0;
|
||||
}
|
||||
|
||||
Task(String name, int itemSpriteId, int expectedKillExp)
|
||||
{
|
||||
Preconditions.checkArgument(itemSpriteId >= 0);
|
||||
this.name = name;
|
||||
this.itemSpriteId = itemSpriteId;
|
||||
this.weaknessThreshold = -1;
|
||||
this.weaknessItem = -1;
|
||||
this.targetNames = new String[0];
|
||||
this.expectedKillExp = expectedKillExp;
|
||||
}
|
||||
|
||||
static Task getTask(String taskName)
|
||||
|
||||
Reference in New Issue
Block a user