@@ -97,7 +97,7 @@ public class AmmoPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
// Check for weapon slot items. This overrides the ammo slot,
|
// Check for weapon slot items. This overrides the ammo slot,
|
||||||
// as the player will use the thrown weapon (eg. chinchompas, knives, darts)
|
// as the player will use the thrown weapon (eg. chinchompas, knives, darts)
|
||||||
if (items.length >= EquipmentInventorySlot.WEAPON.getSlotIdx() - 1)
|
if (items.length > EquipmentInventorySlot.WEAPON.getSlotIdx())
|
||||||
{
|
{
|
||||||
final Item weapon = items[EquipmentInventorySlot.WEAPON.getSlotIdx()];
|
final Item weapon = items[EquipmentInventorySlot.WEAPON.getSlotIdx()];
|
||||||
final ItemComposition weaponComp = itemManager.getItemComposition(weapon.getId());
|
final ItemComposition weaponComp = itemManager.getItemComposition(weapon.getId());
|
||||||
|
|||||||
@@ -118,4 +118,18 @@ public interface IdleNotifierConfig extends Config
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "pkers",
|
||||||
|
name = "PKer Notifier",
|
||||||
|
position = 9,
|
||||||
|
description = "Notifies if an attackable player based on your level range appears on screen.",
|
||||||
|
group = "pvp",
|
||||||
|
warning = "This will not notify you if the player is in your cc or is online on your friends list."
|
||||||
|
)
|
||||||
|
default boolean notifyPkers()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
package net.runelite.client.plugins.idlenotifier;
|
package net.runelite.client.plugins.idlenotifier;
|
||||||
|
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -50,16 +52,18 @@ import net.runelite.api.events.GameTick;
|
|||||||
import net.runelite.api.events.GraphicChanged;
|
import net.runelite.api.events.GraphicChanged;
|
||||||
import net.runelite.api.events.HitsplatApplied;
|
import net.runelite.api.events.HitsplatApplied;
|
||||||
import net.runelite.api.events.InteractingChanged;
|
import net.runelite.api.events.InteractingChanged;
|
||||||
|
import net.runelite.api.events.PlayerSpawned;
|
||||||
import net.runelite.client.Notifier;
|
import net.runelite.client.Notifier;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.eventbus.Subscribe;
|
import net.runelite.client.eventbus.Subscribe;
|
||||||
import net.runelite.client.plugins.Plugin;
|
import net.runelite.client.plugins.Plugin;
|
||||||
import net.runelite.client.plugins.PluginDescriptor;
|
import net.runelite.client.plugins.PluginDescriptor;
|
||||||
|
import net.runelite.client.util.PvPUtil;
|
||||||
|
|
||||||
@PluginDescriptor(
|
@PluginDescriptor(
|
||||||
name = "Idle Notifier",
|
name = "Idle Notifier",
|
||||||
description = "Send a notification when going idle, or when HP/Prayer reaches a threshold",
|
description = "Send a notification when going idle, or when HP/Prayer reaches a threshold",
|
||||||
tags = {"health", "hitpoints", "notifications", "prayer"}
|
tags = {"health", "hitpoints", "notifications", "prayer", "pvp", "pker"}
|
||||||
)
|
)
|
||||||
public class IdleNotifierPlugin extends Plugin
|
public class IdleNotifierPlugin extends Plugin
|
||||||
{
|
{
|
||||||
@@ -238,6 +242,29 @@ public class IdleNotifierPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
private void onPlayerSpawned(PlayerSpawned event)
|
||||||
|
{
|
||||||
|
final Player p = event.getPlayer();
|
||||||
|
if (config.notifyPkers())
|
||||||
|
{
|
||||||
|
if (p != null)
|
||||||
|
{
|
||||||
|
if (p != client.getLocalPlayer())
|
||||||
|
{
|
||||||
|
if (PvPUtil.isAttackable(client, p) && !client.isFriended(p.getName(), false)
|
||||||
|
&& !client.isClanMember(p.getName()))
|
||||||
|
{
|
||||||
|
String playerName = p.getName();
|
||||||
|
int combat = p.getCombatLevel();
|
||||||
|
notifier.notify("PK'er warning! A level " + combat + " player named " + playerName +
|
||||||
|
" appeared!", TrayIcon.MessageType.WARNING);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onInteractingChanged(InteractingChanged event)
|
public void onInteractingChanged(InteractingChanged event)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user