Fix BrokenOnDeathItems death value by adding repair price

Jagex uses the repair price when determing items lost on death by value. adds test for this case as well
This commit is contained in:
TheStonedTurtle
2019-07-21 12:03:33 -07:00
parent 44cf040cac
commit 742133e456
3 changed files with 92 additions and 60 deletions

View File

@@ -613,4 +613,24 @@ public class ItemsKeptOnDeathPluginTest
final List<ItemStack> kept = deathItems.getKeptItems();
assertTrue(kept.contains(new ItemStack(ItemID.SHADOW_SWORD, 1)));
}
@Test
public void brokenOnDeathTestRepairPrice()
{
// Dragon defender price should actually be pulled from BrokenOnDeathItem, and be lost on death
final Item[] inv = new Item[]
{
mItem(ItemID.BARROWS_GLOVES, 1, "Barrows gloves", false, 130000),
mItem(ItemID.DRAGON_DEFENDER, 1, "Dragon defender", false, 68007),
mItem(ItemID.DRAGON_SCIMITAR, 1, "Dragon scimitar", true, 63123),
mItem(ItemID.HELM_OF_NEITIZNOT, 1, "Helm of neitiznot", true, 45519),
};
plugin.wildyLevel = 21;
final DeathItems deathItems = plugin.calculateKeptLostItems(inv, new Item[0]);
final List<ItemStack> lost = deathItems.getLostItems();
assertTrue(lost.contains(new ItemStack(ItemID.DRAGON_DEFENDER, 1)));
}
}