Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/main/java/com/attacktimer/AttackTimerMetronomePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.events.ConfigChanged;
import net.runelite.client.game.ItemEquipmentStats;
import net.runelite.client.game.ItemManager;
import net.runelite.client.game.ItemStats;
import net.runelite.client.game.NPCManager;
Expand Down Expand Up @@ -135,6 +136,16 @@ public enum AttackState {
private static final int TWINFLAME_STAFF_WEAPON_ID = 30634;
private static final int ECHO_VENATOR_BOW_WEAPON_ID = 30434;
private static final int VENATOR_BOW_WEAPON_ID = 27610;
private static final int BLACK_GEM_KERIS_ID = 30891; // https://oldschool.runescape.wiki/w/Keris_partisan_of_amascut

// Add other weapons here if in the Runelite dev shell this prints a different value to it's actual speed:
//
// var itemManager = inject(ItemManager.class);
// log.info("Speed {}", itemManager.getItemStats(<id_to_test>).getEquipment().getAspeed());
private static final Map<Integer, Integer> NON_STANDARD_ATTACK_SPEEDS =
new ImmutableMap.Builder<Integer, Integer>()
.put(BLACK_GEM_KERIS_ID, 4)
.build();

// These animations are the ones which exceed the duration of their attack cooldown
// so in this case DO NOT fall back the animation as it is un-reliable.
Expand Down Expand Up @@ -245,6 +256,11 @@ private int getWeaponId()

private ItemStats getWeaponStats(int weaponId)
{
if (NON_STANDARD_ATTACK_SPEEDS.containsKey(weaponId))
{
return new ItemStats(true, -1, -1,
ItemEquipmentStats.builder().aspeed(NON_STANDARD_ATTACK_SPEEDS.get(weaponId)).build());
}
return itemManager.getItemStats(weaponId);
}

Expand Down
Loading