Merge branch 'master' into 0911-merge
This commit is contained in:
@@ -28,9 +28,9 @@ package net.runelite.client.plugins.chatfilter;
|
||||
import com.google.common.base.CharMatcher;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.inject.Provides;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.regex.PatternSyntaxException;
|
||||
@@ -45,11 +45,11 @@ import net.runelite.api.Player;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.OverheadTextChanged;
|
||||
import net.runelite.api.events.ScriptCallbackEvent;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.api.util.Text;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@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 final CharMatcher jagexPrintableCharMatcher = Text.JAGEX_PRINTABLE_CHAR_MATCHER;
|
||||
private final List<Pattern> filteredPatterns = new ArrayList<>();
|
||||
private final List<Pattern> filteredPatterns = new CopyOnWriteArrayList<>();
|
||||
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@@ -64,6 +64,7 @@ import net.runelite.api.events.PlayerDespawned;
|
||||
import net.runelite.api.events.PlayerSpawned;
|
||||
import net.runelite.api.events.ScriptCallbackEvent;
|
||||
import net.runelite.api.events.VarClientStrChanged;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
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_TRANSPARENT_BACKGROUND;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||
import net.runelite.api.util.Text;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Clan Chat",
|
||||
@@ -411,7 +411,8 @@ public class ClanChatPlugin extends Plugin
|
||||
|
||||
ChatMessageBuilder message = new ChatMessageBuilder()
|
||||
.append("[")
|
||||
.append(channelColor, client.getClanChatName());
|
||||
.append(channelColor, client.getClanChatName() == null ? "" : client.getClanChatName());
|
||||
|
||||
if (rankIcon > -1)
|
||||
{
|
||||
message
|
||||
|
||||
@@ -128,7 +128,7 @@ public class Bones
|
||||
|
||||
public boolean add(Bone bone)
|
||||
{
|
||||
if (this.map == null)
|
||||
if (this.map == null || bone == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -399,7 +399,8 @@ public class DiscordPlugin extends Plugin
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
package net.runelite.client.plugins.entityhider;
|
||||
|
||||
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.Singleton;
|
||||
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.PluginDescriptor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Entity Hider",
|
||||
description = "Hide players, NPCs, and/or projectiles",
|
||||
@@ -91,13 +90,18 @@ public class EntityHiderPlugin extends Plugin
|
||||
{
|
||||
updateConfig();
|
||||
|
||||
if (event.getOldValue() == null || event.getNewValue() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getKey().equals("hideNPCsNames"))
|
||||
{
|
||||
List<String> oldList = Text.fromCSV(event.getOldValue());
|
||||
List<String> newList = Text.fromCSV(event.getNewValue());
|
||||
|
||||
ArrayList<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> removed = oldList.stream().filter(s -> !newList.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);
|
||||
added.forEach(client::addHiddenNpcName);
|
||||
@@ -189,7 +193,8 @@ public class EntityHiderPlugin extends Plugin
|
||||
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
|
||||
return playerRegionID != 9520;
|
||||
|
||||
@@ -336,6 +336,10 @@ public class GroundMarkerPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
final WorldPoint loc = WorldPoint.fromLocalInstance(client, tile.getLocalLocation());
|
||||
if (loc == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
final int regionId = loc.getRegionID();
|
||||
|
||||
for (int i = this.amount.toInt(); i > 0; i--)
|
||||
@@ -419,6 +423,11 @@ public class GroundMarkerPlugin extends Plugin
|
||||
|
||||
WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, localPoint);
|
||||
|
||||
if (worldPoint == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int regionId = worldPoint.getRegionID();
|
||||
GroundMarkerPoint point = new GroundMarkerPoint(regionId, worldPoint.getRegionX(), worldPoint.getRegionY(), client.getPlane(), group);
|
||||
log.debug("Updating point: {} - {}", point, worldPoint);
|
||||
|
||||
@@ -175,6 +175,11 @@ public class HideUnder extends Plugin
|
||||
|
||||
client.setLocalPlayerHidden(false);
|
||||
|
||||
if (localPlayerWp == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (PlayerContainer player : playerContainer)
|
||||
{
|
||||
if (player.getTimer() > 0)
|
||||
@@ -194,7 +199,7 @@ public class HideUnder extends Plugin
|
||||
if (client.getVar(Varbits.LMS_IN_GAME) == 1)
|
||||
{
|
||||
final WorldPoint playerWp = WorldPoint.fromLocalInstance(client, player.getPlayer().getLocalLocation());
|
||||
if (localPlayerWp.distanceTo(playerWp) == 0)
|
||||
if (playerWp != null && localPlayerWp.distanceTo(playerWp) == 0)
|
||||
{
|
||||
client.setLocalPlayerHidden(true);
|
||||
}
|
||||
@@ -217,7 +222,8 @@ public class HideUnder extends Plugin
|
||||
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
|
||||
return playerRegionID != 9520;
|
||||
|
||||
@@ -86,6 +86,7 @@ import net.runelite.api.events.LocalPlayerDeath;
|
||||
import net.runelite.api.events.MenuOptionClicked;
|
||||
import net.runelite.api.events.PlayerSpawned;
|
||||
import net.runelite.api.events.WidgetLoaded;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.api.widgets.WidgetID;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
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.NavigationButton;
|
||||
import net.runelite.client.util.ImageUtil;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.client.util.QuantityFormatter;
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
import net.runelite.http.api.loottracker.GameItem;
|
||||
@@ -508,6 +508,11 @@ public class LootTrackerPlugin extends Plugin
|
||||
|
||||
private void onGameStateChanged(final GameStateChanged event)
|
||||
{
|
||||
if (client.getLocalPlayer() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getGameState() == GameState.LOADING)
|
||||
{
|
||||
chestLooted = false;
|
||||
@@ -547,6 +552,11 @@ public class LootTrackerPlugin extends Plugin
|
||||
|
||||
private void onNpcLootReceived(final NpcLootReceived npcLootReceived)
|
||||
{
|
||||
if (client.getLocalPlayer() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final NPC npc = npcLootReceived.getNpc();
|
||||
final Collection<ItemStack> items = npcLootReceived.getItems();
|
||||
final String name = npc.getName();
|
||||
@@ -618,11 +628,17 @@ public class LootTrackerPlugin extends Plugin
|
||||
|
||||
private void onPlayerLootReceived(final PlayerLootReceived playerLootReceived)
|
||||
{
|
||||
if (client.getLocalPlayer() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Ignore Last Man Standing player loots
|
||||
if (isAtLMS())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.sendLootValueMessages)
|
||||
{
|
||||
if (WorldType.isDeadmanWorld(client.getWorldType()) || WorldType.isHighRiskWorld(client.getWorldType()) ||
|
||||
@@ -636,6 +652,7 @@ public class LootTrackerPlugin extends Plugin
|
||||
.build()).build());
|
||||
}
|
||||
}
|
||||
|
||||
final Player player = playerLootReceived.getPlayer();
|
||||
final Collection<ItemStack> items = playerLootReceived.getItems();
|
||||
final String name = player.getName();
|
||||
@@ -663,6 +680,11 @@ public class LootTrackerPlugin extends Plugin
|
||||
|
||||
private void onWidgetLoaded(WidgetLoaded event)
|
||||
{
|
||||
if (client.getLocalPlayer() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final ItemContainer container;
|
||||
switch (event.getGroupId())
|
||||
{
|
||||
@@ -685,8 +707,9 @@ public class LootTrackerPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
if (WorldPoint.fromLocalInstance(client, client.getLocalPlayer()
|
||||
.getLocalLocation()).getRegionID() != THEATRE_OF_BLOOD_REGION)
|
||||
WorldPoint p = WorldPoint.fromLocalInstance(client, client.getLocalPlayer().getLocalLocation());
|
||||
|
||||
if (p != null && p.getRegionID() != THEATRE_OF_BLOOD_REGION)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -758,7 +781,7 @@ public class LootTrackerPlugin extends Plugin
|
||||
}
|
||||
|
||||
final LootTrackerItem[] entries = buildEntries(stack(items));
|
||||
|
||||
|
||||
SwingUtilities.invokeLater(() -> panel.add(eventType, client.getLocalPlayer().getName(), -1, entries));
|
||||
LootRecord lootRecord = new LootRecord(eventType, client.getLocalPlayer().getName(), LootRecordType.EVENT,
|
||||
toGameItems(items), Instant.now());
|
||||
@@ -781,6 +804,11 @@ public class LootTrackerPlugin extends Plugin
|
||||
|
||||
private void onChatMessage(ChatMessage event)
|
||||
{
|
||||
if (client.getLocalPlayer() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getType() != ChatMessageType.GAMEMESSAGE && event.getType() != ChatMessageType.SPAM)
|
||||
{
|
||||
return;
|
||||
@@ -916,6 +944,11 @@ public class LootTrackerPlugin extends Plugin
|
||||
@SuppressWarnings("unchecked")
|
||||
public void onItemContainerChanged(ItemContainerChanged event)
|
||||
{
|
||||
if (client.getLocalPlayer() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (pvpDeath && RESPAWN_REGIONS.contains(client.getLocalPlayer().getWorldLocation().getRegionID()))
|
||||
{
|
||||
Multiset snapshot;
|
||||
@@ -1088,6 +1121,11 @@ public class LootTrackerPlugin extends Plugin
|
||||
|
||||
private void processChestLoot(String chestType, ItemContainer inventoryContainer)
|
||||
{
|
||||
if (client.getLocalPlayer() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (inventorySnapshot != null)
|
||||
{
|
||||
Multiset<Integer> currentInventory = HashMultiset.create();
|
||||
@@ -1212,17 +1250,17 @@ public class LootTrackerPlugin extends Plugin
|
||||
{
|
||||
final ItemDefinition itemDefinition = itemManager.getItemDefinition(itemId);
|
||||
final int realItemId = itemDefinition.getNote() != -1 ? itemDefinition.getLinkedNoteId() : itemId;
|
||||
final long gePrice ;
|
||||
final long haPrice ;
|
||||
final long gePrice;
|
||||
final long haPrice;
|
||||
// If it's a death we want to get a coin value for untradeables lost
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
final boolean ignored = ignoredItems.contains(itemDefinition.getName());
|
||||
@@ -1290,6 +1328,11 @@ public class LootTrackerPlugin extends Plugin
|
||||
// Pet Handling
|
||||
private ItemStack handlePet(String name)
|
||||
{
|
||||
if (client.getLocalPlayer() == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
gotPet = false;
|
||||
|
||||
int petID = getPetId(name);
|
||||
|
||||
@@ -78,6 +78,10 @@ public class MagicMaxHitCalculator extends MaxHitCalculator
|
||||
}
|
||||
|
||||
SpellBaseDamageConfig autoCastSpell = SpellBaseDamageConfig.findSpellById(autoCastSpellId);
|
||||
if (autoCastSpell == null)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
spellBaseDamage = autoCastSpell.getBaseDamage();
|
||||
}
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ public class MetronomePlugin extends Plugin
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -346,6 +346,12 @@ public class ObjectIndicatorsPlugin extends Plugin implements KeyListener
|
||||
private void checkObjectPoints(TileObject object)
|
||||
{
|
||||
final WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, object.getLocalLocation());
|
||||
|
||||
if (worldPoint == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Set<ObjectPoint> objectPoints = points.get(worldPoint.getRegionID());
|
||||
|
||||
if (objectPoints == null)
|
||||
@@ -445,6 +451,10 @@ public class ObjectIndicatorsPlugin extends Plugin implements KeyListener
|
||||
}
|
||||
|
||||
final WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, object.getLocalLocation());
|
||||
if (worldPoint == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
final int regionId = worldPoint.getRegionID();
|
||||
final ObjectPoint point = new ObjectPoint(
|
||||
name,
|
||||
|
||||
@@ -72,8 +72,9 @@ import net.runelite.api.events.InteractingChanged;
|
||||
import net.runelite.api.events.NpcDefinitionChanged;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
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.widgets.Widget;
|
||||
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.ColorUtil;
|
||||
import net.runelite.client.util.ImageUtil;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.http.api.chat.ChatClient;
|
||||
|
||||
@PluginDescriptor(
|
||||
@@ -843,7 +843,7 @@ public class SlayerPlugin extends Plugin
|
||||
@VisibleForTesting
|
||||
private void killedOne(int delta)
|
||||
{
|
||||
if (currentTask.getAmount() == 0)
|
||||
if (currentTask == null || currentTask.getAmount() == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -877,8 +877,13 @@ public class SlayerPlugin extends Plugin
|
||||
|
||||
private boolean doubleTroubleExtraKill()
|
||||
{
|
||||
return WorldPoint.fromLocalInstance(client, client.getLocalPlayer().getLocalLocation()).getRegionID() == GROTESQUE_GUARDIANS_REGION &&
|
||||
SlayerUnlock.GROTESQUE_GUARDIAN_DOUBLE_COUNT.isEnabled(client);
|
||||
if (client.getLocalPlayer() == null)
|
||||
{
|
||||
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
|
||||
|
||||
@@ -472,6 +472,10 @@ public class SuppliesTrackerPlugin extends Plugin
|
||||
throwingAmmoLoaded = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throwingAmmoLoaded = false;
|
||||
}
|
||||
}
|
||||
//Ammo tracking
|
||||
if (itemContainer.getItems().length > EQUIPMENT_AMMO_SLOT)
|
||||
|
||||
@@ -18,12 +18,12 @@ import net.runelite.api.events.NpcDefinitionChanged;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.api.events.SpotAnimationChanged;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.client.graphics.ModelOutlineRenderer;
|
||||
import net.runelite.client.plugins.theatre.RoomHandler;
|
||||
import net.runelite.client.plugins.theatre.TheatreConstant;
|
||||
import net.runelite.client.plugins.theatre.TheatrePlugin;
|
||||
import net.runelite.client.plugins.theatre.TheatreRoom;
|
||||
import net.runelite.api.util.Text;
|
||||
|
||||
@Slf4j
|
||||
public class MaidenHandler extends RoomHandler
|
||||
@@ -205,6 +205,11 @@ public class MaidenHandler extends RoomHandler
|
||||
|
||||
WorldPoint wp = WorldPoint.fromLocalInstance(client, npc.getLocalLocation());
|
||||
|
||||
if (wp == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (N1.contains(wp))
|
||||
{
|
||||
addNylo(npc, Nylos.SpawnLocation.N1);
|
||||
@@ -248,7 +253,7 @@ public class MaidenHandler extends RoomHandler
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -196,8 +196,19 @@ public class DamageCounterPlugin extends Plugin
|
||||
//adding up the damage for the print message checks every tick(aka attack tick)
|
||||
private void DamageCounting()
|
||||
{
|
||||
if (client.getLocalPlayer() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player localPlayer = client.getLocalPlayer();
|
||||
Actor interacting = localPlayer.getInteracting();
|
||||
|
||||
if (interacting.getName() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (client.getGameState() == GameState.LOGGED_IN && interacting instanceof NPC)
|
||||
{
|
||||
String interactingName = interacting.getName();
|
||||
@@ -229,8 +240,20 @@ public class DamageCounterPlugin extends Plugin
|
||||
private void onNpcDespawned(NpcDespawned npc)
|
||||
{
|
||||
NPC actor = npc.getNpc();
|
||||
double Percent = calculatePercent(WorldPoint.fromLocalInstance(client,
|
||||
client.getLocalPlayer().getLocalLocation()).getRegionID());
|
||||
if (client.getLocalPlayer() == null || actor.getName() == null)
|
||||
{
|
||||
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)
|
||||
{
|
||||
DamagePrint(actor, Percent);
|
||||
@@ -298,28 +321,28 @@ public class DamageCounterPlugin extends Plugin
|
||||
{
|
||||
int playerCount = getPlayers();
|
||||
String MessageDamage;
|
||||
if (playerCount >= 2 && playerCount <= 5)
|
||||
if (playerCount >= 2 && playerCount <= 5)
|
||||
{
|
||||
if (percent >= (2.0 / playerCount) * 100)
|
||||
if (percent >= (2.0 / playerCount) * 100)
|
||||
{
|
||||
MessageDamage = "[Exceptional performance] Damage dealt to " + actor.getName() + ": "
|
||||
+ DAMAGEFORMAT.format(DamageCount) + " (" + String.format("%.2f", percent) + "%)";
|
||||
}
|
||||
else if (percent >= (1.0 / playerCount) * 100)
|
||||
+ DAMAGEFORMAT.format(DamageCount) + " (" + String.format("%.2f", percent) + "%)";
|
||||
}
|
||||
else if (percent >= (1.0 / playerCount) * 100)
|
||||
{
|
||||
MessageDamage = "[Above-average performance] Damage dealt to " + actor.getName() + ": "
|
||||
+ DAMAGEFORMAT.format(DamageCount) + " (" + String.format("%.2f", percent) + "%)";
|
||||
}
|
||||
else
|
||||
+ DAMAGEFORMAT.format(DamageCount) + " (" + String.format("%.2f", percent) + "%)";
|
||||
}
|
||||
else
|
||||
{
|
||||
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() + ": "
|
||||
+ DAMAGEFORMAT.format(DamageCount) + " (" + String.format("%.2f", percent) + "%)";
|
||||
+ DAMAGEFORMAT.format(DamageCount) + " (" + String.format("%.2f", percent) + "%)";
|
||||
}
|
||||
|
||||
sendChatMessage(MessageDamage);
|
||||
@@ -330,22 +353,26 @@ public class DamageCounterPlugin extends Plugin
|
||||
public int 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
|
||||
// made sure the message works at ToB area or else it will message every where
|
||||
private void onLocalPlayerDeath(LocalPlayerDeath death)
|
||||
{
|
||||
String DeathMessage = "You have died! You did " + DAMAGEFORMAT.format(DamageCount) + " damage to " +
|
||||
BossName + "!";
|
||||
if (client.getLocalPlayer() == null)
|
||||
{
|
||||
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!";
|
||||
for (int value : ToB_Region)
|
||||
{
|
||||
if (WorldPoint.fromLocalInstance(client,
|
||||
client.getLocalPlayer().getLocalLocation()).getRegionID() == value)
|
||||
final WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, client.getLocalPlayer().getLocalLocation());
|
||||
final int playerRegionID = worldPoint == null ? 0 : worldPoint.getRegionID();
|
||||
if (playerRegionID == value)
|
||||
{
|
||||
sendChatMessage(DeathMessage);
|
||||
sendChatMessage(MessageTaken);
|
||||
|
||||
@@ -519,8 +519,14 @@ public class VorkathPlugin extends Plugin
|
||||
|
||||
updateWooxWalkBar();
|
||||
|
||||
if (client.getLocalPlayer() == null || vorkath.getVorkath() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final WorldPoint playerLoc = client.getLocalPlayer().getWorldLocation();
|
||||
final WorldPoint vorkLoc = vorkath.getVorkath().getWorldLocation();
|
||||
|
||||
final int maxX = vorkLoc.getX() + 14;
|
||||
final int minX = vorkLoc.getX() - 8;
|
||||
final int baseX = playerLoc.getX();
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
package net.runelite.client.ui;
|
||||
|
||||
import io.sentry.Sentry;
|
||||
import java.applet.Applet;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
@@ -60,11 +61,22 @@ final class ClientPanel extends JPanel
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
String message = "Detected a bad codebase. Resetting...\n"
|
||||
+ "Please restart client.\n";
|
||||
JOptionPane.showMessageDialog(new JFrame(), message, "Bad Codebase",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
StringFileUtils.writeStringToFile(RuneLite.RUNELITE_DIR + "/codebase", "http://127.0.0.1/");
|
||||
if (RuneLite.allowPrivateServer)
|
||||
{
|
||||
String message = "Detected a bad codebase. Resetting...\n"
|
||||
+ "Please restart client.\n";
|
||||
JOptionPane.showMessageDialog(new JFrame(), message, "Bad Codebase",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
StringFileUtils.writeStringToFile(RuneLite.RUNELITE_DIR + "/codebase", "http://127.0.0.1/");
|
||||
}
|
||||
else
|
||||
{
|
||||
JOptionPane.showMessageDialog(new JFrame(), "Error loading Oldschool RuneScape!", "Error",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
Sentry.capture(e);
|
||||
}
|
||||
|
||||
((Client) client).getLogger().error(null, e);
|
||||
System.exit(0);
|
||||
}
|
||||
client.start();
|
||||
|
||||
Reference in New Issue
Block a user