project: bug fixes (#1986)
* deathindicator: Fixes #1951 * worldpoint: if chunkX|Y >= 13, null. Fixes #1667 Fixes #1949 Fixes #1981 * maxhit: null check autocast. Fixes #1977 * metronome: ensure tock is > 0 Fixes: #1973 * clanchat: check if clan is null Fixes #1959 * entityhider: null check values. Fixes #1966 * slayer: null check task Fixes #1974 * chatfilter: Use concurrent list. Fixes #1982 * vorkath: null check vorkath Fixes #1983
This commit is contained in:
@@ -25,13 +25,14 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.api.coords;
|
package net.runelite.api.coords;
|
||||||
|
|
||||||
import static net.runelite.api.Constants.CHUNK_SIZE;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import lombok.Value;
|
import lombok.Value;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
|
import static net.runelite.api.Constants.CHUNK_SIZE;
|
||||||
import net.runelite.api.Perspective;
|
import net.runelite.api.Perspective;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -97,8 +98,8 @@ public class WorldPoint
|
|||||||
* Checks whether a tile is located in the current scene.
|
* Checks whether a tile is located in the current scene.
|
||||||
*
|
*
|
||||||
* @param client the client
|
* @param client the client
|
||||||
* @param x the tiles x coordinate
|
* @param x the tiles x coordinate
|
||||||
* @param y the tiles y coordinate
|
* @param y the tiles y coordinate
|
||||||
* @return true if the tile is in the scene, false otherwise
|
* @return true if the tile is in the scene, false otherwise
|
||||||
*/
|
*/
|
||||||
public static boolean isInScene(Client client, int x, int y)
|
public static boolean isInScene(Client client, int x, int y)
|
||||||
@@ -127,7 +128,7 @@ public class WorldPoint
|
|||||||
* Gets the coordinate of the tile that contains the passed local point.
|
* Gets the coordinate of the tile that contains the passed local point.
|
||||||
*
|
*
|
||||||
* @param client the client
|
* @param client the client
|
||||||
* @param local the local coordinate
|
* @param local the local coordinate
|
||||||
* @return the tile coordinate containing the local point
|
* @return the tile coordinate containing the local point
|
||||||
*/
|
*/
|
||||||
public static WorldPoint fromLocal(Client client, LocalPoint local)
|
public static WorldPoint fromLocal(Client client, LocalPoint local)
|
||||||
@@ -139,9 +140,9 @@ public class WorldPoint
|
|||||||
* Gets the coordinate of the tile that contains the passed local point.
|
* Gets the coordinate of the tile that contains the passed local point.
|
||||||
*
|
*
|
||||||
* @param client the client
|
* @param client the client
|
||||||
* @param x the local x-axis coordinate
|
* @param x the local x-axis coordinate
|
||||||
* @param y the local x-axis coordinate
|
* @param y the local x-axis coordinate
|
||||||
* @param plane the plane
|
* @param plane the plane
|
||||||
* @return the tile coordinate containing the local point
|
* @return the tile coordinate containing the local point
|
||||||
*/
|
*/
|
||||||
public static WorldPoint fromLocal(Client client, int x, int y, int plane)
|
public static WorldPoint fromLocal(Client client, int x, int y, int plane)
|
||||||
@@ -157,10 +158,11 @@ public class WorldPoint
|
|||||||
* Gets the coordinate of the tile that contains the passed local point,
|
* Gets the coordinate of the tile that contains the passed local point,
|
||||||
* accounting for instances.
|
* accounting for instances.
|
||||||
*
|
*
|
||||||
* @param client the client
|
* @param client the client
|
||||||
* @param localPoint the local coordinate
|
* @param localPoint the local coordinate
|
||||||
* @return the tile coordinate containing the local point
|
* @return the tile coordinate containing the local point
|
||||||
*/
|
*/
|
||||||
|
@Nullable
|
||||||
public static WorldPoint fromLocalInstance(Client client, LocalPoint localPoint)
|
public static WorldPoint fromLocalInstance(Client client, LocalPoint localPoint)
|
||||||
{
|
{
|
||||||
if (client.isInInstancedRegion())
|
if (client.isInInstancedRegion())
|
||||||
@@ -173,6 +175,11 @@ public class WorldPoint
|
|||||||
int chunkX = sceneX / CHUNK_SIZE;
|
int chunkX = sceneX / CHUNK_SIZE;
|
||||||
int chunkY = sceneY / CHUNK_SIZE;
|
int chunkY = sceneY / CHUNK_SIZE;
|
||||||
|
|
||||||
|
if (chunkX >= 13 || chunkY >= 13)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// get the template chunk for the chunk
|
// get the template chunk for the chunk
|
||||||
int[][][] instanceTemplateChunks = client.getInstanceTemplateChunks();
|
int[][][] instanceTemplateChunks = client.getInstanceTemplateChunks();
|
||||||
int templateChunk = instanceTemplateChunks[client.getPlane()][chunkX][chunkY];
|
int templateChunk = instanceTemplateChunks[client.getPlane()][chunkX][chunkY];
|
||||||
@@ -198,6 +205,7 @@ public class WorldPoint
|
|||||||
/**
|
/**
|
||||||
* Get occurrences of a tile on the scene, accounting for instances. There may be
|
* Get occurrences of a tile on the scene, accounting for instances. There may be
|
||||||
* more than one if the same template chunk occurs more than once on the scene.
|
* more than one if the same template chunk occurs more than once on the scene.
|
||||||
|
*
|
||||||
* @param client
|
* @param client
|
||||||
* @param worldPoint
|
* @param worldPoint
|
||||||
* @return
|
* @return
|
||||||
@@ -238,7 +246,7 @@ public class WorldPoint
|
|||||||
/**
|
/**
|
||||||
* Rotate the coordinates in the chunk according to chunk rotation
|
* Rotate the coordinates in the chunk according to chunk rotation
|
||||||
*
|
*
|
||||||
* @param point point
|
* @param point point
|
||||||
* @param rotation rotation
|
* @param rotation rotation
|
||||||
* @return world point
|
* @return world point
|
||||||
*/
|
*/
|
||||||
@@ -363,6 +371,7 @@ public class WorldPoint
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if user in within certain zone specified by upper and lower bound
|
* Checks if user in within certain zone specified by upper and lower bound
|
||||||
|
*
|
||||||
* @param lowerBound
|
* @param lowerBound
|
||||||
* @param upperBound
|
* @param upperBound
|
||||||
* @param userLocation
|
* @param userLocation
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ package net.runelite.client.plugins.chatfilter;
|
|||||||
import com.google.common.base.CharMatcher;
|
import com.google.common.base.CharMatcher;
|
||||||
import com.google.common.base.Splitter;
|
import com.google.common.base.Splitter;
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.regex.PatternSyntaxException;
|
import java.util.regex.PatternSyntaxException;
|
||||||
@@ -45,11 +45,11 @@ import net.runelite.api.Player;
|
|||||||
import net.runelite.api.events.ConfigChanged;
|
import net.runelite.api.events.ConfigChanged;
|
||||||
import net.runelite.api.events.OverheadTextChanged;
|
import net.runelite.api.events.OverheadTextChanged;
|
||||||
import net.runelite.api.events.ScriptCallbackEvent;
|
import net.runelite.api.events.ScriptCallbackEvent;
|
||||||
|
import net.runelite.api.util.Text;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.eventbus.EventBus;
|
import net.runelite.client.eventbus.EventBus;
|
||||||
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.api.util.Text;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
@PluginDescriptor(
|
@PluginDescriptor(
|
||||||
@@ -68,7 +68,7 @@ public class ChatFilterPlugin extends Plugin
|
|||||||
private static final String CENSOR_MESSAGE = "Hey, everyone, I just tried to say something very silly!";
|
private static final String CENSOR_MESSAGE = "Hey, everyone, I just tried to say something very silly!";
|
||||||
|
|
||||||
private final CharMatcher jagexPrintableCharMatcher = Text.JAGEX_PRINTABLE_CHAR_MATCHER;
|
private final CharMatcher jagexPrintableCharMatcher = Text.JAGEX_PRINTABLE_CHAR_MATCHER;
|
||||||
private final List<Pattern> filteredPatterns = new ArrayList<>();
|
private final List<Pattern> filteredPatterns = new CopyOnWriteArrayList<>();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private Client client;
|
private Client client;
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ import net.runelite.api.events.PlayerDespawned;
|
|||||||
import net.runelite.api.events.PlayerSpawned;
|
import net.runelite.api.events.PlayerSpawned;
|
||||||
import net.runelite.api.events.ScriptCallbackEvent;
|
import net.runelite.api.events.ScriptCallbackEvent;
|
||||||
import net.runelite.api.events.VarClientStrChanged;
|
import net.runelite.api.events.VarClientStrChanged;
|
||||||
|
import net.runelite.api.util.Text;
|
||||||
import net.runelite.api.widgets.Widget;
|
import net.runelite.api.widgets.Widget;
|
||||||
import net.runelite.api.widgets.WidgetInfo;
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
import net.runelite.api.widgets.WidgetType;
|
import net.runelite.api.widgets.WidgetType;
|
||||||
@@ -80,7 +81,6 @@ import static net.runelite.client.ui.JagexColors.CHAT_CLAN_NAME_TRANSPARENT_BACK
|
|||||||
import static net.runelite.client.ui.JagexColors.CHAT_CLAN_TEXT_OPAQUE_BACKGROUND;
|
import static net.runelite.client.ui.JagexColors.CHAT_CLAN_TEXT_OPAQUE_BACKGROUND;
|
||||||
import static net.runelite.client.ui.JagexColors.CHAT_CLAN_TEXT_TRANSPARENT_BACKGROUND;
|
import static net.runelite.client.ui.JagexColors.CHAT_CLAN_TEXT_TRANSPARENT_BACKGROUND;
|
||||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||||
import net.runelite.api.util.Text;
|
|
||||||
|
|
||||||
@PluginDescriptor(
|
@PluginDescriptor(
|
||||||
name = "Clan Chat",
|
name = "Clan Chat",
|
||||||
@@ -411,7 +411,8 @@ public class ClanChatPlugin extends Plugin
|
|||||||
|
|
||||||
ChatMessageBuilder message = new ChatMessageBuilder()
|
ChatMessageBuilder message = new ChatMessageBuilder()
|
||||||
.append("[")
|
.append("[")
|
||||||
.append(channelColor, client.getClanChatName());
|
.append(channelColor, client.getClanChatName() == null ? "" : client.getClanChatName());
|
||||||
|
|
||||||
if (rankIcon > -1)
|
if (rankIcon > -1)
|
||||||
{
|
{
|
||||||
message
|
message
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ public class Bones
|
|||||||
|
|
||||||
public boolean add(Bone bone)
|
public boolean add(Bone bone)
|
||||||
{
|
{
|
||||||
if (this.map == null)
|
if (this.map == null || bone == null)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -399,7 +399,8 @@ public class DiscordPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int playerRegionID = WorldPoint.fromLocalInstance(client, client.getLocalPlayer().getLocalLocation()).getRegionID();
|
final WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, client.getLocalPlayer().getLocalLocation());
|
||||||
|
final int playerRegionID = worldPoint == null ? 0 : worldPoint.getRegionID();
|
||||||
|
|
||||||
if (playerRegionID == 0)
|
if (playerRegionID == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,6 +27,9 @@
|
|||||||
package net.runelite.client.plugins.entityhider;
|
package net.runelite.client.plugins.entityhider;
|
||||||
|
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
@@ -41,10 +44,6 @@ import net.runelite.client.eventbus.EventBus;
|
|||||||
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 java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
@PluginDescriptor(
|
@PluginDescriptor(
|
||||||
name = "Entity Hider",
|
name = "Entity Hider",
|
||||||
description = "Hide players, NPCs, and/or projectiles",
|
description = "Hide players, NPCs, and/or projectiles",
|
||||||
@@ -91,13 +90,18 @@ public class EntityHiderPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
updateConfig();
|
updateConfig();
|
||||||
|
|
||||||
|
if (event.getOldValue() == null || event.getNewValue() == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (event.getKey().equals("hideNPCsNames"))
|
if (event.getKey().equals("hideNPCsNames"))
|
||||||
{
|
{
|
||||||
List<String> oldList = Text.fromCSV(event.getOldValue());
|
List<String> oldList = Text.fromCSV(event.getOldValue());
|
||||||
List<String> newList = Text.fromCSV(event.getNewValue());
|
List<String> newList = Text.fromCSV(event.getNewValue());
|
||||||
|
|
||||||
ArrayList<String> removed = oldList.stream().filter(s -> !newList.contains(s)).collect(Collectors.toCollection(ArrayList::new));
|
List<String> removed = oldList.stream().filter(s -> !newList.contains(s)).collect(Collectors.toCollection(ArrayList::new));
|
||||||
ArrayList<String> added = newList.stream().filter(s -> !oldList.contains(s)).collect(Collectors.toCollection(ArrayList::new));
|
List<String> added = newList.stream().filter(s -> !oldList.contains(s)).collect(Collectors.toCollection(ArrayList::new));
|
||||||
|
|
||||||
removed.forEach(client::removeHiddenNpcName);
|
removed.forEach(client::removeHiddenNpcName);
|
||||||
added.forEach(client::addHiddenNpcName);
|
added.forEach(client::addHiddenNpcName);
|
||||||
@@ -189,7 +193,8 @@ public class EntityHiderPlugin extends Plugin
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int playerRegionID = WorldPoint.fromLocalInstance(client, localPlayer.getLocalLocation()).getRegionID();
|
final WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, client.getLocalPlayer().getLocalLocation());
|
||||||
|
final int playerRegionID = worldPoint == null ? 0 : worldPoint.getRegionID();
|
||||||
|
|
||||||
// 9520 = Castle Wars
|
// 9520 = Castle Wars
|
||||||
return playerRegionID != 9520;
|
return playerRegionID != 9520;
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import static net.runelite.api.Constants.CHUNK_SIZE;
|
import static net.runelite.api.Constants.CHUNK_SIZE;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
import net.runelite.api.MenuOpcode;
|
|
||||||
import net.runelite.api.MenuEntry;
|
import net.runelite.api.MenuEntry;
|
||||||
|
import net.runelite.api.MenuOpcode;
|
||||||
import net.runelite.api.Tile;
|
import net.runelite.api.Tile;
|
||||||
import net.runelite.api.coords.LocalPoint;
|
import net.runelite.api.coords.LocalPoint;
|
||||||
import net.runelite.api.coords.WorldPoint;
|
import net.runelite.api.coords.WorldPoint;
|
||||||
@@ -57,6 +57,7 @@ import net.runelite.api.events.FocusChanged;
|
|||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.GameStateChanged;
|
||||||
import net.runelite.api.events.MenuEntryAdded;
|
import net.runelite.api.events.MenuEntryAdded;
|
||||||
import net.runelite.api.events.MenuOptionClicked;
|
import net.runelite.api.events.MenuOptionClicked;
|
||||||
|
import net.runelite.api.util.Text;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.eventbus.EventBus;
|
import net.runelite.client.eventbus.EventBus;
|
||||||
import net.runelite.client.input.KeyManager;
|
import net.runelite.client.input.KeyManager;
|
||||||
@@ -64,7 +65,6 @@ import net.runelite.client.plugins.Plugin;
|
|||||||
import net.runelite.client.plugins.PluginDescriptor;
|
import net.runelite.client.plugins.PluginDescriptor;
|
||||||
import net.runelite.client.ui.overlay.OverlayManager;
|
import net.runelite.client.ui.overlay.OverlayManager;
|
||||||
import net.runelite.client.util.ColorUtil;
|
import net.runelite.client.util.ColorUtil;
|
||||||
import net.runelite.api.util.Text;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@PluginDescriptor(
|
@PluginDescriptor(
|
||||||
@@ -336,6 +336,10 @@ public class GroundMarkerPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final WorldPoint loc = WorldPoint.fromLocalInstance(client, tile.getLocalLocation());
|
final WorldPoint loc = WorldPoint.fromLocalInstance(client, tile.getLocalLocation());
|
||||||
|
if (loc == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
final int regionId = loc.getRegionID();
|
final int regionId = loc.getRegionID();
|
||||||
|
|
||||||
for (int i = this.amount.toInt(); i > 0; i--)
|
for (int i = this.amount.toInt(); i > 0; i--)
|
||||||
@@ -419,6 +423,11 @@ public class GroundMarkerPlugin extends Plugin
|
|||||||
|
|
||||||
WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, localPoint);
|
WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, localPoint);
|
||||||
|
|
||||||
|
if (worldPoint == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int regionId = worldPoint.getRegionID();
|
int regionId = worldPoint.getRegionID();
|
||||||
GroundMarkerPoint point = new GroundMarkerPoint(regionId, worldPoint.getRegionX(), worldPoint.getRegionY(), client.getPlane(), group);
|
GroundMarkerPoint point = new GroundMarkerPoint(regionId, worldPoint.getRegionX(), worldPoint.getRegionY(), client.getPlane(), group);
|
||||||
log.debug("Updating point: {} - {}", point, worldPoint);
|
log.debug("Updating point: {} - {}", point, worldPoint);
|
||||||
|
|||||||
@@ -175,6 +175,11 @@ public class HideUnder extends Plugin
|
|||||||
|
|
||||||
client.setLocalPlayerHidden(false);
|
client.setLocalPlayerHidden(false);
|
||||||
|
|
||||||
|
if (localPlayerWp == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (PlayerContainer player : playerContainer)
|
for (PlayerContainer player : playerContainer)
|
||||||
{
|
{
|
||||||
if (player.getTimer() > 0)
|
if (player.getTimer() > 0)
|
||||||
@@ -194,7 +199,7 @@ public class HideUnder extends Plugin
|
|||||||
if (client.getVar(Varbits.LMS_IN_GAME) == 1)
|
if (client.getVar(Varbits.LMS_IN_GAME) == 1)
|
||||||
{
|
{
|
||||||
final WorldPoint playerWp = WorldPoint.fromLocalInstance(client, player.getPlayer().getLocalLocation());
|
final WorldPoint playerWp = WorldPoint.fromLocalInstance(client, player.getPlayer().getLocalLocation());
|
||||||
if (localPlayerWp.distanceTo(playerWp) == 0)
|
if (playerWp != null && localPlayerWp.distanceTo(playerWp) == 0)
|
||||||
{
|
{
|
||||||
client.setLocalPlayerHidden(true);
|
client.setLocalPlayerHidden(true);
|
||||||
}
|
}
|
||||||
@@ -217,7 +222,8 @@ public class HideUnder extends Plugin
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int playerRegionID = WorldPoint.fromLocalInstance(client, localPlayer.getLocalLocation()).getRegionID();
|
final WorldPoint playerWp = WorldPoint.fromLocalInstance(client, localPlayer.getLocalLocation());
|
||||||
|
final int playerRegionID = playerWp == null ? 0 : playerWp.getRegionID();
|
||||||
|
|
||||||
// 9520 = Castle Wars
|
// 9520 = Castle Wars
|
||||||
return playerRegionID != 9520;
|
return playerRegionID != 9520;
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ import net.runelite.api.events.LocalPlayerDeath;
|
|||||||
import net.runelite.api.events.MenuOptionClicked;
|
import net.runelite.api.events.MenuOptionClicked;
|
||||||
import net.runelite.api.events.PlayerSpawned;
|
import net.runelite.api.events.PlayerSpawned;
|
||||||
import net.runelite.api.events.WidgetLoaded;
|
import net.runelite.api.events.WidgetLoaded;
|
||||||
|
import net.runelite.api.util.Text;
|
||||||
import net.runelite.api.widgets.WidgetID;
|
import net.runelite.api.widgets.WidgetID;
|
||||||
import net.runelite.api.widgets.WidgetInfo;
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
import net.runelite.client.RuneLite;
|
import net.runelite.client.RuneLite;
|
||||||
@@ -119,7 +120,6 @@ import net.runelite.client.task.Schedule;
|
|||||||
import net.runelite.client.ui.ClientToolbar;
|
import net.runelite.client.ui.ClientToolbar;
|
||||||
import net.runelite.client.ui.NavigationButton;
|
import net.runelite.client.ui.NavigationButton;
|
||||||
import net.runelite.client.util.ImageUtil;
|
import net.runelite.client.util.ImageUtil;
|
||||||
import net.runelite.api.util.Text;
|
|
||||||
import net.runelite.client.util.QuantityFormatter;
|
import net.runelite.client.util.QuantityFormatter;
|
||||||
import net.runelite.http.api.RuneLiteAPI;
|
import net.runelite.http.api.RuneLiteAPI;
|
||||||
import net.runelite.http.api.loottracker.GameItem;
|
import net.runelite.http.api.loottracker.GameItem;
|
||||||
@@ -508,6 +508,11 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
|
|
||||||
private void onGameStateChanged(final GameStateChanged event)
|
private void onGameStateChanged(final GameStateChanged event)
|
||||||
{
|
{
|
||||||
|
if (client.getLocalPlayer() == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (event.getGameState() == GameState.LOADING)
|
if (event.getGameState() == GameState.LOADING)
|
||||||
{
|
{
|
||||||
chestLooted = false;
|
chestLooted = false;
|
||||||
@@ -547,6 +552,11 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
|
|
||||||
private void onNpcLootReceived(final NpcLootReceived npcLootReceived)
|
private void onNpcLootReceived(final NpcLootReceived npcLootReceived)
|
||||||
{
|
{
|
||||||
|
if (client.getLocalPlayer() == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final NPC npc = npcLootReceived.getNpc();
|
final NPC npc = npcLootReceived.getNpc();
|
||||||
final Collection<ItemStack> items = npcLootReceived.getItems();
|
final Collection<ItemStack> items = npcLootReceived.getItems();
|
||||||
final String name = npc.getName();
|
final String name = npc.getName();
|
||||||
@@ -618,11 +628,17 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
|
|
||||||
private void onPlayerLootReceived(final PlayerLootReceived playerLootReceived)
|
private void onPlayerLootReceived(final PlayerLootReceived playerLootReceived)
|
||||||
{
|
{
|
||||||
|
if (client.getLocalPlayer() == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Ignore Last Man Standing player loots
|
// Ignore Last Man Standing player loots
|
||||||
if (isAtLMS())
|
if (isAtLMS())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.sendLootValueMessages)
|
if (this.sendLootValueMessages)
|
||||||
{
|
{
|
||||||
if (WorldType.isDeadmanWorld(client.getWorldType()) || WorldType.isHighRiskWorld(client.getWorldType()) ||
|
if (WorldType.isDeadmanWorld(client.getWorldType()) || WorldType.isHighRiskWorld(client.getWorldType()) ||
|
||||||
@@ -636,6 +652,7 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
.build()).build());
|
.build()).build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final Player player = playerLootReceived.getPlayer();
|
final Player player = playerLootReceived.getPlayer();
|
||||||
final Collection<ItemStack> items = playerLootReceived.getItems();
|
final Collection<ItemStack> items = playerLootReceived.getItems();
|
||||||
final String name = player.getName();
|
final String name = player.getName();
|
||||||
@@ -663,6 +680,11 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
|
|
||||||
private void onWidgetLoaded(WidgetLoaded event)
|
private void onWidgetLoaded(WidgetLoaded event)
|
||||||
{
|
{
|
||||||
|
if (client.getLocalPlayer() == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final ItemContainer container;
|
final ItemContainer container;
|
||||||
switch (event.getGroupId())
|
switch (event.getGroupId())
|
||||||
{
|
{
|
||||||
@@ -685,8 +707,9 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WorldPoint.fromLocalInstance(client, client.getLocalPlayer()
|
WorldPoint p = WorldPoint.fromLocalInstance(client, client.getLocalPlayer().getLocalLocation());
|
||||||
.getLocalLocation()).getRegionID() != THEATRE_OF_BLOOD_REGION)
|
|
||||||
|
if (p != null && p.getRegionID() != THEATRE_OF_BLOOD_REGION)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -781,6 +804,11 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
|
|
||||||
private void onChatMessage(ChatMessage event)
|
private void onChatMessage(ChatMessage event)
|
||||||
{
|
{
|
||||||
|
if (client.getLocalPlayer() == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (event.getType() != ChatMessageType.GAMEMESSAGE && event.getType() != ChatMessageType.SPAM)
|
if (event.getType() != ChatMessageType.GAMEMESSAGE && event.getType() != ChatMessageType.SPAM)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -916,6 +944,11 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void onItemContainerChanged(ItemContainerChanged event)
|
public void onItemContainerChanged(ItemContainerChanged event)
|
||||||
{
|
{
|
||||||
|
if (client.getLocalPlayer() == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (pvpDeath && RESPAWN_REGIONS.contains(client.getLocalPlayer().getWorldLocation().getRegionID()))
|
if (pvpDeath && RESPAWN_REGIONS.contains(client.getLocalPlayer().getWorldLocation().getRegionID()))
|
||||||
{
|
{
|
||||||
Multiset snapshot;
|
Multiset snapshot;
|
||||||
@@ -1088,6 +1121,11 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
|
|
||||||
private void processChestLoot(String chestType, ItemContainer inventoryContainer)
|
private void processChestLoot(String chestType, ItemContainer inventoryContainer)
|
||||||
{
|
{
|
||||||
|
if (client.getLocalPlayer() == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (inventorySnapshot != null)
|
if (inventorySnapshot != null)
|
||||||
{
|
{
|
||||||
Multiset<Integer> currentInventory = HashMultiset.create();
|
Multiset<Integer> currentInventory = HashMultiset.create();
|
||||||
@@ -1212,17 +1250,17 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
final ItemDefinition itemDefinition = itemManager.getItemDefinition(itemId);
|
final ItemDefinition itemDefinition = itemManager.getItemDefinition(itemId);
|
||||||
final int realItemId = itemDefinition.getNote() != -1 ? itemDefinition.getLinkedNoteId() : itemId;
|
final int realItemId = itemDefinition.getNote() != -1 ? itemDefinition.getLinkedNoteId() : itemId;
|
||||||
final long gePrice ;
|
final long gePrice;
|
||||||
final long haPrice ;
|
final long haPrice;
|
||||||
// If it's a death we want to get a coin value for untradeables lost
|
// If it's a death we want to get a coin value for untradeables lost
|
||||||
if (!itemDefinition.isTradeable() && quantity < 0)
|
if (!itemDefinition.isTradeable() && quantity < 0)
|
||||||
{
|
{
|
||||||
gePrice = (long) itemDefinition.getPrice() * (long) quantity;
|
gePrice = (long) itemDefinition.getPrice() * (long) quantity;
|
||||||
haPrice = (long) Math.round(itemDefinition.getPrice() * Constants.HIGH_ALCHEMY_MULTIPLIER) * (long) quantity;
|
haPrice = (long) Math.round(itemDefinition.getPrice() * Constants.HIGH_ALCHEMY_MULTIPLIER) * (long) quantity;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gePrice = (long) itemManager.getItemPrice(realItemId) * (long) quantity;
|
gePrice = (long) itemManager.getItemPrice(realItemId) * (long) quantity;
|
||||||
haPrice = (long) Math.round(itemManager.getItemPrice(realItemId) * Constants.HIGH_ALCHEMY_MULTIPLIER) * (long) quantity;
|
haPrice = (long) Math.round(itemManager.getItemPrice(realItemId) * Constants.HIGH_ALCHEMY_MULTIPLIER) * (long) quantity;
|
||||||
}
|
}
|
||||||
final boolean ignored = ignoredItems.contains(itemDefinition.getName());
|
final boolean ignored = ignoredItems.contains(itemDefinition.getName());
|
||||||
@@ -1290,6 +1328,11 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
// Pet Handling
|
// Pet Handling
|
||||||
private ItemStack handlePet(String name)
|
private ItemStack handlePet(String name)
|
||||||
{
|
{
|
||||||
|
if (client.getLocalPlayer() == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
gotPet = false;
|
gotPet = false;
|
||||||
|
|
||||||
int petID = getPetId(name);
|
int petID = getPetId(name);
|
||||||
|
|||||||
@@ -78,6 +78,10 @@ public class MagicMaxHitCalculator extends MaxHitCalculator
|
|||||||
}
|
}
|
||||||
|
|
||||||
SpellBaseDamageConfig autoCastSpell = SpellBaseDamageConfig.findSpellById(autoCastSpellId);
|
SpellBaseDamageConfig autoCastSpell = SpellBaseDamageConfig.findSpellById(autoCastSpellId);
|
||||||
|
if (autoCastSpell == null)
|
||||||
|
{
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
spellBaseDamage = autoCastSpell.getBaseDamage();
|
spellBaseDamage = autoCastSpell.getBaseDamage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,20 +26,20 @@
|
|||||||
package net.runelite.client.plugins.metronome;
|
package net.runelite.client.plugins.metronome;
|
||||||
|
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import javax.sound.sampled.LineUnavailableException;
|
|
||||||
import javax.sound.sampled.UnsupportedAudioFileException;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import net.runelite.api.SoundEffectVolume;
|
|
||||||
import javax.sound.sampled.AudioInputStream;
|
import javax.sound.sampled.AudioInputStream;
|
||||||
import javax.sound.sampled.AudioSystem;
|
import javax.sound.sampled.AudioSystem;
|
||||||
import javax.sound.sampled.Clip;
|
import javax.sound.sampled.Clip;
|
||||||
import javax.sound.sampled.FloatControl;
|
import javax.sound.sampled.FloatControl;
|
||||||
import java.io.File;
|
import javax.sound.sampled.LineUnavailableException;
|
||||||
|
import javax.sound.sampled.UnsupportedAudioFileException;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.SoundEffectID;
|
import net.runelite.api.SoundEffectID;
|
||||||
|
import net.runelite.api.SoundEffectVolume;
|
||||||
import net.runelite.api.events.ConfigChanged;
|
import net.runelite.api.events.ConfigChanged;
|
||||||
import net.runelite.api.events.GameTick;
|
import net.runelite.api.events.GameTick;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
@@ -186,7 +186,7 @@ public class MetronomePlugin extends Plugin
|
|||||||
|
|
||||||
if ((++tickCounter + this.tickOffset) % this.tickCount == 0)
|
if ((++tickCounter + this.tickOffset) % this.tickCount == 0)
|
||||||
{
|
{
|
||||||
if (++tockCounter % this.tockNumber == 0 & this.enableTock)
|
if ((this.enableTock && this.tockNumber > 0) && ++tockCounter % this.tockNumber == 0)
|
||||||
{
|
{
|
||||||
if (tockClip == null)
|
if (tockClip == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ import net.runelite.api.DecorativeObject;
|
|||||||
import net.runelite.api.GameObject;
|
import net.runelite.api.GameObject;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
import net.runelite.api.GroundObject;
|
import net.runelite.api.GroundObject;
|
||||||
import net.runelite.api.MenuOpcode;
|
|
||||||
import net.runelite.api.MenuEntry;
|
import net.runelite.api.MenuEntry;
|
||||||
|
import net.runelite.api.MenuOpcode;
|
||||||
import net.runelite.api.ObjectDefinition;
|
import net.runelite.api.ObjectDefinition;
|
||||||
import net.runelite.api.Scene;
|
import net.runelite.api.Scene;
|
||||||
import net.runelite.api.Tile;
|
import net.runelite.api.Tile;
|
||||||
@@ -346,6 +346,12 @@ public class ObjectIndicatorsPlugin extends Plugin implements KeyListener
|
|||||||
private void checkObjectPoints(TileObject object)
|
private void checkObjectPoints(TileObject object)
|
||||||
{
|
{
|
||||||
final WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, object.getLocalLocation());
|
final WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, object.getLocalLocation());
|
||||||
|
|
||||||
|
if (worldPoint == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final Set<ObjectPoint> objectPoints = points.get(worldPoint.getRegionID());
|
final Set<ObjectPoint> objectPoints = points.get(worldPoint.getRegionID());
|
||||||
|
|
||||||
if (objectPoints == null)
|
if (objectPoints == null)
|
||||||
@@ -445,6 +451,10 @@ public class ObjectIndicatorsPlugin extends Plugin implements KeyListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
final WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, object.getLocalLocation());
|
final WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, object.getLocalLocation());
|
||||||
|
if (worldPoint == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
final int regionId = worldPoint.getRegionID();
|
final int regionId = worldPoint.getRegionID();
|
||||||
final ObjectPoint point = new ObjectPoint(
|
final ObjectPoint point = new ObjectPoint(
|
||||||
name,
|
name,
|
||||||
|
|||||||
@@ -72,8 +72,9 @@ import net.runelite.api.events.InteractingChanged;
|
|||||||
import net.runelite.api.events.NpcDefinitionChanged;
|
import net.runelite.api.events.NpcDefinitionChanged;
|
||||||
import net.runelite.api.events.NpcDespawned;
|
import net.runelite.api.events.NpcDespawned;
|
||||||
import net.runelite.api.events.NpcSpawned;
|
import net.runelite.api.events.NpcSpawned;
|
||||||
import net.runelite.api.events.VarbitChanged;
|
|
||||||
import net.runelite.api.events.StatChanged;
|
import net.runelite.api.events.StatChanged;
|
||||||
|
import net.runelite.api.events.VarbitChanged;
|
||||||
|
import net.runelite.api.util.Text;
|
||||||
import net.runelite.api.vars.SlayerUnlock;
|
import net.runelite.api.vars.SlayerUnlock;
|
||||||
import net.runelite.api.widgets.Widget;
|
import net.runelite.api.widgets.Widget;
|
||||||
import net.runelite.api.widgets.WidgetInfo;
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
@@ -100,7 +101,6 @@ import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
|||||||
import net.runelite.client.util.AsyncBufferedImage;
|
import net.runelite.client.util.AsyncBufferedImage;
|
||||||
import net.runelite.client.util.ColorUtil;
|
import net.runelite.client.util.ColorUtil;
|
||||||
import net.runelite.client.util.ImageUtil;
|
import net.runelite.client.util.ImageUtil;
|
||||||
import net.runelite.api.util.Text;
|
|
||||||
import net.runelite.http.api.chat.ChatClient;
|
import net.runelite.http.api.chat.ChatClient;
|
||||||
|
|
||||||
@PluginDescriptor(
|
@PluginDescriptor(
|
||||||
@@ -843,7 +843,7 @@ public class SlayerPlugin extends Plugin
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
private void killedOne(int delta)
|
private void killedOne(int delta)
|
||||||
{
|
{
|
||||||
if (currentTask.getAmount() == 0)
|
if (currentTask == null || currentTask.getAmount() == 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -877,8 +877,13 @@ public class SlayerPlugin extends Plugin
|
|||||||
|
|
||||||
private boolean doubleTroubleExtraKill()
|
private boolean doubleTroubleExtraKill()
|
||||||
{
|
{
|
||||||
return WorldPoint.fromLocalInstance(client, client.getLocalPlayer().getLocalLocation()).getRegionID() == GROTESQUE_GUARDIANS_REGION &&
|
if (client.getLocalPlayer() == null)
|
||||||
SlayerUnlock.GROTESQUE_GUARDIAN_DOUBLE_COUNT.isEnabled(client);
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, client.getLocalPlayer().getLocalLocation());
|
||||||
|
final int playerRegionID = worldPoint == null ? 0 : worldPoint.getRegionID();
|
||||||
|
return playerRegionID == GROTESQUE_GUARDIANS_REGION && SlayerUnlock.GROTESQUE_GUARDIAN_DOUBLE_COUNT.isEnabled(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
// checks if any contiguous subsequence of seq0 exactly matches the String toMatch
|
// checks if any contiguous subsequence of seq0 exactly matches the String toMatch
|
||||||
|
|||||||
@@ -18,12 +18,12 @@ import net.runelite.api.events.NpcDefinitionChanged;
|
|||||||
import net.runelite.api.events.NpcDespawned;
|
import net.runelite.api.events.NpcDespawned;
|
||||||
import net.runelite.api.events.NpcSpawned;
|
import net.runelite.api.events.NpcSpawned;
|
||||||
import net.runelite.api.events.SpotAnimationChanged;
|
import net.runelite.api.events.SpotAnimationChanged;
|
||||||
|
import net.runelite.api.util.Text;
|
||||||
import net.runelite.client.graphics.ModelOutlineRenderer;
|
import net.runelite.client.graphics.ModelOutlineRenderer;
|
||||||
import net.runelite.client.plugins.theatre.RoomHandler;
|
import net.runelite.client.plugins.theatre.RoomHandler;
|
||||||
import net.runelite.client.plugins.theatre.TheatreConstant;
|
import net.runelite.client.plugins.theatre.TheatreConstant;
|
||||||
import net.runelite.client.plugins.theatre.TheatrePlugin;
|
import net.runelite.client.plugins.theatre.TheatrePlugin;
|
||||||
import net.runelite.client.plugins.theatre.TheatreRoom;
|
import net.runelite.client.plugins.theatre.TheatreRoom;
|
||||||
import net.runelite.api.util.Text;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class MaidenHandler extends RoomHandler
|
public class MaidenHandler extends RoomHandler
|
||||||
@@ -205,6 +205,11 @@ public class MaidenHandler extends RoomHandler
|
|||||||
|
|
||||||
WorldPoint wp = WorldPoint.fromLocalInstance(client, npc.getLocalLocation());
|
WorldPoint wp = WorldPoint.fromLocalInstance(client, npc.getLocalLocation());
|
||||||
|
|
||||||
|
if (wp == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (N1.contains(wp))
|
if (N1.contains(wp))
|
||||||
{
|
{
|
||||||
addNylo(npc, Nylos.SpawnLocation.N1);
|
addNylo(npc, Nylos.SpawnLocation.N1);
|
||||||
@@ -248,7 +253,7 @@ public class MaidenHandler extends RoomHandler
|
|||||||
|
|
||||||
public void onChatMessage(ChatMessage event)
|
public void onChatMessage(ChatMessage event)
|
||||||
{
|
{
|
||||||
if (event.getSender() != null && !event.getSender().equals(client.getLocalPlayer().getName()))
|
if (client.getLocalPlayer() == null || (event.getSender() != null && !event.getSender().equals(client.getLocalPlayer().getName())))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -196,8 +196,19 @@ public class DamageCounterPlugin extends Plugin
|
|||||||
//adding up the damage for the print message checks every tick(aka attack tick)
|
//adding up the damage for the print message checks every tick(aka attack tick)
|
||||||
private void DamageCounting()
|
private void DamageCounting()
|
||||||
{
|
{
|
||||||
|
if (client.getLocalPlayer() == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Player localPlayer = client.getLocalPlayer();
|
Player localPlayer = client.getLocalPlayer();
|
||||||
Actor interacting = localPlayer.getInteracting();
|
Actor interacting = localPlayer.getInteracting();
|
||||||
|
|
||||||
|
if (interacting.getName() == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (client.getGameState() == GameState.LOGGED_IN && interacting instanceof NPC)
|
if (client.getGameState() == GameState.LOGGED_IN && interacting instanceof NPC)
|
||||||
{
|
{
|
||||||
String interactingName = interacting.getName();
|
String interactingName = interacting.getName();
|
||||||
@@ -229,8 +240,20 @@ public class DamageCounterPlugin extends Plugin
|
|||||||
private void onNpcDespawned(NpcDespawned npc)
|
private void onNpcDespawned(NpcDespawned npc)
|
||||||
{
|
{
|
||||||
NPC actor = npc.getNpc();
|
NPC actor = npc.getNpc();
|
||||||
double Percent = calculatePercent(WorldPoint.fromLocalInstance(client,
|
if (client.getLocalPlayer() == null || actor.getName() == null)
|
||||||
client.getLocalPlayer().getLocalLocation()).getRegionID());
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, client.getLocalPlayer().getLocalLocation());
|
||||||
|
final int playerRegionID = worldPoint == null ? 0 : worldPoint.getRegionID();
|
||||||
|
|
||||||
|
if (playerRegionID == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
double Percent = calculatePercent(playerRegionID);
|
||||||
if (actor.isDead() && actor.getId() == NpcID.VERZIK_VITUR_8375 && status)
|
if (actor.isDead() && actor.getId() == NpcID.VERZIK_VITUR_8375 && status)
|
||||||
{
|
{
|
||||||
DamagePrint(actor, Percent);
|
DamagePrint(actor, Percent);
|
||||||
@@ -303,23 +326,23 @@ public class DamageCounterPlugin extends Plugin
|
|||||||
if (percent >= (2.0 / playerCount) * 100)
|
if (percent >= (2.0 / playerCount) * 100)
|
||||||
{
|
{
|
||||||
MessageDamage = "[Exceptional performance] Damage dealt to " + actor.getName() + ": "
|
MessageDamage = "[Exceptional performance] Damage dealt to " + actor.getName() + ": "
|
||||||
+ DAMAGEFORMAT.format(DamageCount) + " (" + String.format("%.2f", percent) + "%)";
|
+ DAMAGEFORMAT.format(DamageCount) + " (" + String.format("%.2f", percent) + "%)";
|
||||||
}
|
}
|
||||||
else if (percent >= (1.0 / playerCount) * 100)
|
else if (percent >= (1.0 / playerCount) * 100)
|
||||||
{
|
{
|
||||||
MessageDamage = "[Above-average performance] Damage dealt to " + actor.getName() + ": "
|
MessageDamage = "[Above-average performance] Damage dealt to " + actor.getName() + ": "
|
||||||
+ DAMAGEFORMAT.format(DamageCount) + " (" + String.format("%.2f", percent) + "%)";
|
+ DAMAGEFORMAT.format(DamageCount) + " (" + String.format("%.2f", percent) + "%)";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MessageDamage = "[Under performance] Damage dealt to " + actor.getName() + ": "
|
MessageDamage = "[Under performance] Damage dealt to " + actor.getName() + ": "
|
||||||
+ DAMAGEFORMAT.format(DamageCount) + " (" + String.format("%.2f", percent) + "%)";
|
+ DAMAGEFORMAT.format(DamageCount) + " (" + String.format("%.2f", percent) + "%)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MessageDamage = "Damage dealt to " + actor.getName() + ": "
|
MessageDamage = "Damage dealt to " + actor.getName() + ": "
|
||||||
+ DAMAGEFORMAT.format(DamageCount) + " (" + String.format("%.2f", percent) + "%)";
|
+ DAMAGEFORMAT.format(DamageCount) + " (" + String.format("%.2f", percent) + "%)";
|
||||||
}
|
}
|
||||||
|
|
||||||
sendChatMessage(MessageDamage);
|
sendChatMessage(MessageDamage);
|
||||||
@@ -330,22 +353,26 @@ public class DamageCounterPlugin extends Plugin
|
|||||||
public int getPlayers()
|
public int getPlayers()
|
||||||
{
|
{
|
||||||
List<Player> players = client.getPlayers();
|
List<Player> players = client.getPlayers();
|
||||||
int numPlayers = players.size();
|
|
||||||
|
|
||||||
return numPlayers;
|
return players.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
//whenever you have died in tob you will get a death message with damage
|
//whenever you have died in tob you will get a death message with damage
|
||||||
// made sure the message works at ToB area or else it will message every where
|
// made sure the message works at ToB area or else it will message every where
|
||||||
private void onLocalPlayerDeath(LocalPlayerDeath death)
|
private void onLocalPlayerDeath(LocalPlayerDeath death)
|
||||||
{
|
{
|
||||||
String DeathMessage = "You have died! You did " + DAMAGEFORMAT.format(DamageCount) + " damage to " +
|
if (client.getLocalPlayer() == null)
|
||||||
BossName + "!";
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String DeathMessage = "You have died! You did " + DAMAGEFORMAT.format(DamageCount) + " damage to " + BossName + "!";
|
||||||
String MessageTaken = "You have taken " + DAMAGEFORMAT.format(DamageTaken) + " damage from this fight!";
|
String MessageTaken = "You have taken " + DAMAGEFORMAT.format(DamageTaken) + " damage from this fight!";
|
||||||
for (int value : ToB_Region)
|
for (int value : ToB_Region)
|
||||||
{
|
{
|
||||||
if (WorldPoint.fromLocalInstance(client,
|
final WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, client.getLocalPlayer().getLocalLocation());
|
||||||
client.getLocalPlayer().getLocalLocation()).getRegionID() == value)
|
final int playerRegionID = worldPoint == null ? 0 : worldPoint.getRegionID();
|
||||||
|
if (playerRegionID == value)
|
||||||
{
|
{
|
||||||
sendChatMessage(DeathMessage);
|
sendChatMessage(DeathMessage);
|
||||||
sendChatMessage(MessageTaken);
|
sendChatMessage(MessageTaken);
|
||||||
|
|||||||
@@ -519,8 +519,14 @@ public class VorkathPlugin extends Plugin
|
|||||||
|
|
||||||
updateWooxWalkBar();
|
updateWooxWalkBar();
|
||||||
|
|
||||||
|
if (client.getLocalPlayer() == null || vorkath.getVorkath() == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final WorldPoint playerLoc = client.getLocalPlayer().getWorldLocation();
|
final WorldPoint playerLoc = client.getLocalPlayer().getWorldLocation();
|
||||||
final WorldPoint vorkLoc = vorkath.getVorkath().getWorldLocation();
|
final WorldPoint vorkLoc = vorkath.getVorkath().getWorldLocation();
|
||||||
|
|
||||||
final int maxX = vorkLoc.getX() + 14;
|
final int maxX = vorkLoc.getX() + 14;
|
||||||
final int minX = vorkLoc.getX() - 8;
|
final int minX = vorkLoc.getX() - 8;
|
||||||
final int baseX = playerLoc.getX();
|
final int baseX = playerLoc.getX();
|
||||||
|
|||||||
Reference in New Issue
Block a user