Kyleeld patch 1 (#151)

* safespot

* Update Player.java

int getRsOverheadIcon();

* FreezeTimers

FreezeTimers

* various updates (#150)

updates to pvp tools, wilderness locations & location chatter

* Update WildernessLocation.java

* Update Client.java

void toggleRenderSelf();

* Update RSClient.java

* Update Player.java

remove change
This commit is contained in:
Kyleeld
2019-04-29 21:39:44 +01:00
committed by Tyler Bochard
parent d4aca9cbcf
commit 9f7787771e
24 changed files with 2174 additions and 1434 deletions

View File

@@ -1611,6 +1611,8 @@ public interface Client extends GameEngine
void draw2010Menu();
NodeCache getHealthBarCache();
void toggleRenderSelf();
void invokeMenuAction(int var1, int var2, int var3, int var4, String var5, String var6, int var7, int var8);

View File

@@ -77,7 +77,7 @@ public interface Player extends Actor
* @return the overhead icon
*/
HeadIcon getOverheadIcon();
/**
* Gets the displayed skull icon of the player.
* Only works on the local player.

View File

@@ -0,0 +1,32 @@
package net.runelite.client.plugins.freezetimers;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
@ConfigGroup("freezetimers")
public interface FreezeTimersConfig extends Config
{
@ConfigItem(
keyName = "showOverlay",
name = "Show Players",
description = "Configure if the player overlay should be shown",
position = 1
)
default boolean showPlayers()
{
return true;
}
@ConfigItem(
keyName = "showNpcs",
name = "Show NPCs",
description = "Configure if the npc overlay should be shown",
position = 2
)
default boolean showNpcs()
{
return false;
}
}

View File

@@ -0,0 +1,170 @@
package net.runelite.client.plugins.freezetimers;
import net.runelite.api.Actor;
import net.runelite.api.Client;
import net.runelite.api.GraphicID;
import net.runelite.api.Player;
import net.runelite.api.Point;
import net.runelite.client.ui.FontManager;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayLayer;
import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.OverlayPriority;
import net.runelite.client.ui.overlay.OverlayUtil;
import net.runelite.client.util.ImageUtil;
import javax.inject.Inject;
import java.awt.*;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import static java.awt.Color.RED;
import static java.awt.Color.WHITE;
import static java.awt.Color.green;
public class FreezeTimersOverlay extends Overlay
{
@Inject
private Timers timers;
private final FreezeTimersConfig config;
private final Client client;
private final Font timerFont = FontManager.getRunescapeBoldFont().deriveFont(14.0f);
private final BufferedImage FREEZE_IMAGE = ImageUtil.getResourceStreamFromClass(getClass(), "freeze.png");
private final BufferedImage TB_IMAGE = ImageUtil.getResourceStreamFromClass(getClass(), "teleblock.png");
private final BufferedImage VENG_IMAGE = ImageUtil.getResourceStreamFromClass(getClass(), "veng.png");
@Inject
public FreezeTimersOverlay(FreezeTimersConfig config, Client client)
{
this.config = config;
this.client = client;
setPriority(OverlayPriority.HIGHEST);
setPosition(OverlayPosition.DYNAMIC);
setLayer(OverlayLayer.UNDER_WIDGETS);
}
@Override
public Dimension render(Graphics2D graphics)
{
if (config.showPlayers())
{
client.getPlayers().forEach((p) -> renderOverlayFor(graphics, p));
}
if (config.showNpcs())
{
client.getNpcs().forEach((npc) -> renderOverlayFor(graphics, npc));
}
return null;
}
private void renderOverlayFor(Graphics2D g, Actor actor)
{
if (timers.areAllTimersZero(actor))
{
return;
}
int overlaysDrawn = 0;
if (drawFreezeOverlay(g, actor, overlaysDrawn))
{
overlaysDrawn++;
}
if (drawTBOverlay(g, actor, overlaysDrawn))
{
overlaysDrawn++;
}
if (drawVengOverlay(g, actor, overlaysDrawn))
{
overlaysDrawn++;
}
}
private boolean drawFreezeOverlay(Graphics2D g, Actor actor, int overlaysDrawn)
{
long currentTick = System.currentTimeMillis();
if (timers.getTimerEnd(actor, TimerType.FREEZE) <= currentTick)
{
return false;
}
long finishedAt = timers.getTimerEnd(actor, TimerType.FREEZE);
String text = processTickCounter(finishedAt);
renderActorText(g, actor, text, overlaysDrawn, FREEZE_IMAGE);
return true;
}
private boolean drawTBOverlay(Graphics2D g, Actor actor, int overlaysDrawn)
{
long currentTick = System.currentTimeMillis();
if (timers.getTimerEnd(actor, TimerType.TELEBLOCK) <= currentTick)
{
return false;
}
long finishedAt = timers.getTimerEnd(actor, TimerType.TELEBLOCK);
String text = processTickCounter(finishedAt);
renderActorText(g, actor, text, overlaysDrawn, TB_IMAGE);
return true;
}
private boolean drawVengOverlay(Graphics2D g, Actor actor, int overlaysDrawn)
{
long currentTick = System.currentTimeMillis();
if (timers.getTimerEnd(actor, TimerType.VENG) <= currentTick)
{
return false;
}
long finishedAt = timers.getTimerEnd(actor, TimerType.VENG);
String text = processTickCounter(finishedAt);
renderActorText(g, actor, text, overlaysDrawn, VENG_IMAGE);
if (actor.getGraphic() == GraphicID.VENGEANCE || actor.getGraphic() == GraphicID.VENGEANCE_OTHER)
{
g.setColor(RED);
Polygon poly = actor.getCanvasTilePoly();
if (poly != null)
{
OverlayUtil.renderPolygon(g, poly, RED);
}
OverlayUtil.renderTextLocation(g, new Point((int)poly.getBounds2D().getCenterX(),
(int)poly.getBounds2D().getCenterY()), actor.getName(), RED);
}
return true;
}
private void renderActorText(Graphics2D g, Actor actor, String text, int overlaysDrawn, BufferedImage image)
{
int yOffset = (overlaysDrawn * 18);
g.setFont(timerFont);
g.setColor(WHITE);
Rectangle rect = actor.getConvexHull().getBounds();
int xOffset = (int) rect.getWidth();
OverlayUtil.renderActorTextAndImage(g, actor, text, Color.WHITE, image, yOffset,
xOffset);
g.setColor(RED);
g.draw(actor.getConvexHull().getBounds());
}
private String processTickCounter(long finishedAt)
{
long currentTick = System.currentTimeMillis();
long tickDifference = finishedAt - currentTick;
long seconds = tickDifference / 1000;
seconds++;
int minutes = (int) (seconds / 60);
seconds = seconds % 60;
String text = seconds > 9 ? seconds + "" : "0" + seconds;
if (minutes > 0)
{
text = minutes + ":" + text;
}
return text + "";
}
}

View File

@@ -0,0 +1,87 @@
package net.runelite.client.plugins.freezetimers;
import com.google.inject.Provides;
import net.runelite.api.Client;
import net.runelite.api.events.GameTick;
import net.runelite.api.events.GraphicChanged;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.plugins.PluginManager;
import net.runelite.client.plugins.PluginType;
import net.runelite.client.ui.overlay.OverlayManager;
import javax.inject.Inject;
@PluginDescriptor(
name = "Freeze Timers",
description = "Shows a freeze timer overlay on players",
tags = {"freeze", "timers", "barrage", "teleblock", "pklite"},
type = PluginType.PVP
)
public class FreezeTimersPlugin extends Plugin
{
@Inject
private Client client;
@Inject
private OverlayManager overlayManager;
@Inject
private Timers timers;
@Inject
private PrayerTracker prayerTracker;
@Inject
private FreezeTimersOverlay overlay;
public void startUp()
{
overlayManager.add(overlay);
}
public void shutDown()
{
overlayManager.remove(overlay);
}
@Provides
public FreezeTimersConfig getConfig(ConfigManager configManager)
{
return configManager.getConfig(FreezeTimersConfig.class);
}
@Subscribe
public void onGraphicChanged(GraphicChanged graphicChanged)
{
int oldGraphic = prayerTracker.getSpotanimLastTick(graphicChanged.getActor());
int newGraphic = graphicChanged.getActor().getGraphic();
if (oldGraphic == newGraphic)
{
return;
}
PlayerSpellEffect effect = PlayerSpellEffect.getFromSpotAnim(newGraphic);
if (effect == PlayerSpellEffect.NONE)
{
return;
}
long length = effect.getTimerLengthTicks();
if (effect.isHalvable() && prayerTracker.getPrayerIconLastTick(graphicChanged.getActor()) == 2)
{
length /= 2;
}
timers.setTimerEnd(graphicChanged.getActor(), effect.getType(),
System.currentTimeMillis() + length);
}
@Subscribe
public void onGameTick(GameTick tickEvent)
{
timers.gameTick();
prayerTracker.gameTick();
}
}

View File

@@ -0,0 +1,44 @@
package net.runelite.client.plugins.freezetimers;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
public enum PlayerSpellEffect
{
BIND("Bind", 181,5000, true, 0, TimerType.FREEZE),
SNARE("Snare", 180, 10000, true, 1, TimerType.FREEZE),
ENTANGLE("Entangle", 179, 15000, true, 2, TimerType.FREEZE),
RUSH("Ice Rush", 361, 5000, false, 3, TimerType.FREEZE),
BURST("Ice Burst", 363, 10000, false, 4, TimerType.FREEZE),
BLITZ("Ice Blitz", 367, 15000, false, 5, TimerType.FREEZE),
BARRAGE("Ice Barrage", 369, 20000, false, 6, TimerType.FREEZE),
TELEBLOCK("Teleblock", 345, 300000, true, 7, TimerType.TELEBLOCK),
VENG("Vengeance", 726, 30000, false, 8, TimerType.VENG),
VENG_OTHER("Vengeance Other", 725, 30000, false, 9, TimerType.VENG),
NONE("Nothing", -69, 420, true, 9999, TimerType.THIS_SHIT_BROKE);
@Getter
private final String name;
@Getter
private final int spotAnimId;
@Getter
private final int timerLengthTicks;
@Getter
private boolean halvable;
@Getter
private final int spriteIdx;
@Getter
private final TimerType type;
public static PlayerSpellEffect getFromSpotAnim(int spotAnim)
{
for(PlayerSpellEffect effect : values())
{
if(effect.getSpotAnimId() == spotAnim)
return effect;
}
return NONE;
}
}

View File

@@ -0,0 +1,62 @@
package net.runelite.client.plugins.freezetimers;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Actor;
import net.runelite.api.Client;
import net.runelite.api.NPC;
import net.runelite.api.Player;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.util.HashMap;
@Slf4j
@Singleton
public class PrayerTracker
{
@Inject
private Client client;
private HashMap<Actor, HashMap<String, Integer>> lastTick = new HashMap<>();
private HashMap<Actor, HashMap<String, Integer>> newTick = new HashMap<>();
public void gameTick()
{
lastTick.clear();
lastTick.putAll(newTick);
newTick.clear();
for (Player p : client.getPlayers())
{
processActor(p);
}
for (NPC npc : client.getNpcs())
{
processActor(npc);
}
}
private void processActor(Actor actor)
{
if (!newTick.containsKey(actor))
{
newTick.put(actor, new HashMap<>());
}
if (actor instanceof Player)
{
newTick.get(actor).put("PrayerIcon", ((Player) actor).getOverheadIcon().ordinal());
}
newTick.get(actor).put("SpotAnim", actor.getGraphic());
}
public int getPrayerIconLastTick(Actor p)
{
return lastTick.getOrDefault(p, new HashMap<>()).getOrDefault("PrayerIcon", -1337);
}
public int getSpotanimLastTick(Actor p)
{
return lastTick.getOrDefault(p, new HashMap<>()).getOrDefault("SpotAnim", -1337);
}
}

View File

@@ -0,0 +1,9 @@
package net.runelite.client.plugins.freezetimers;
public enum TimerType
{
FREEZE,
VENG,
TELEBLOCK,
THIS_SHIT_BROKE;
}

View File

@@ -0,0 +1,57 @@
package net.runelite.client.plugins.freezetimers;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Actor;
import net.runelite.api.Client;
import net.runelite.api.Player;
import javax.inject.Inject;
import javax.inject.Singleton;
import java.util.HashMap;
@Slf4j
@Singleton
public class Timers
{
@Inject
private Client client;
private HashMap<Actor, HashMap<TimerType, Long>> timerMap = new HashMap<>();
public void gameTick()
{
}
public void setTimerEnd(Actor actor, TimerType type, long n)
{
if (!timerMap.containsKey(actor))
{
timerMap.put(actor, new HashMap<>());
}
timerMap.get(actor).put(type, n);
}
public long getTimerEnd(Actor actor, TimerType type)
{
if (!timerMap.containsKey(actor))
{
timerMap.put(actor, new HashMap<>());
}
return timerMap.get(actor).getOrDefault(type, (long)0);
}
public boolean areAllTimersZero(Actor actor)
{
for (TimerType type : TimerType.values())
{
if (getTimerEnd(actor, type) != 0)
{
return false;
}
}
return true;
}
}

View File

@@ -1,40 +1,40 @@
/*
* Copyright (c) 2018, https://runelitepl.us
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.locationchatter;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Keybind;
@ConfigGroup("locationchatter")
public interface LocationChatterConfig extends Config
{
@ConfigItem(keyName = "keybind", name = "Send to CC", description = "Configure button to send current location to CC")
default Keybind keybind()
{
return Keybind.NOT_SET;
}
}
/*
* Copyright (c) 2018, https://runelitepl.us
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.locationchatter;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Keybind;
@ConfigGroup("locationchatter")
public interface LocationChatterConfig extends Config
{
@ConfigItem(keyName = "keybind", name = "Send to CC", description = "Configure button to send current location to CC")
default Keybind keybind()
{
return Keybind.NOT_SET;
}
}

View File

@@ -1,164 +1,169 @@
/*
* Copyright (c) 2018, https://runelitepl.us
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.locationchatter;
import com.google.inject.Provides;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Client;
import net.runelite.api.ScriptID;
import net.runelite.api.VarClientStr;
import net.runelite.api.events.GameTick;
import net.runelite.api.events.VarClientStrChanged;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.client.callback.ClientThread;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.input.KeyManager;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.plugins.PluginManager;
import net.runelite.client.plugins.PluginType;
import net.runelite.client.plugins.wildernesslocations.WildernessLocationsPlugin;
import net.runelite.client.util.HotkeyListener;
import javax.inject.Inject;
@Slf4j
@PluginDescriptor(
name = "Location Chatter",
tags = {"location", "exilent", "pklite", "spammer"},
type = PluginType.PVP
)
public class LocationChatterPlugin extends Plugin
{
@Inject
private Client client;
@Inject
private ClientThread clientThread;
@Inject
LocationChatterConfig config;
@Inject
private KeyManager keyManager;
@Inject
private PluginManager pluginManager;
private WildernessLocationsPlugin wildyLocsPlugin;
private String oldChat = "";
private int currentCooldown = 0;
private final int COOLDOWN_TICKS = 30;
private final HotkeyListener hotkeyListener = new HotkeyListener(() -> config.keybind())
{
@Override
public void hotkeyPressed()
{
sendLocToCC();
}
};
@Override
public void startUp()
{
for (Plugin pl : pluginManager.getPlugins())
{
if (pl instanceof WildernessLocationsPlugin)
{
wildyLocsPlugin = (WildernessLocationsPlugin) pl;
}
}
keyManager.registerKeyListener(hotkeyListener);
}
@Override
public void shutDown()
{
keyManager.unregisterKeyListener(hotkeyListener);
}
@Provides
LocationChatterConfig getConfig(ConfigManager configManager)
{
return configManager.getConfig(LocationChatterConfig.class);
}
@Subscribe
public void onGameTick(GameTick tickEvent)
{
if (currentCooldown != 0)
{
currentCooldown--;
}
}
@Subscribe
public void onVarClientStrChanged(VarClientStrChanged varClient)
{
String newChat = client.getVar(VarClientStr.CHATBOX_TYPED_TEXT);
if (varClient.getIndex() == VarClientStr.CHATBOX_TYPED_TEXT.getIndex() && !newChat.equals(oldChat))
{
oldChat = newChat;
}
}
private boolean inClanChat()
{
return client.getWidget(WidgetInfo.CLAN_CHAT_TITLE) != null;
}
private void sendMessage(String text)
{
int mode = 0;
if (inClanChat() && text.startsWith("/"))
{
mode = 2;
}
int finalMode = mode;
Runnable r = () ->
{
String cached = oldChat;
client.setVar(VarClientStr.CHATBOX_TYPED_TEXT, text);
client.runScript(ScriptID.CHATBOX_INPUT, finalMode, text);
oldChat = cached;
client.setVar(VarClientStr.CHATBOX_TYPED_TEXT, oldChat);
};
clientThread.invoke(r);
}
private void sendLocToCC()
{
String location = wildyLocsPlugin.getLocationString();
if (location.equals(""))
{
return;
}
sendMessage("/World: " + client.getWorld() + " Location: " + location);
currentCooldown = COOLDOWN_TICKS;
}
}
/*
* Copyright (c) 2018, https://runelitepl.us
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.locationchatter;
import com.google.inject.Provides;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Client;
import net.runelite.api.ScriptID;
import net.runelite.api.VarClientStr;
import net.runelite.api.events.GameTick;
import net.runelite.api.events.VarClientStrChanged;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.client.callback.ClientThread;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.input.KeyManager;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.plugins.PluginManager;
import net.runelite.client.plugins.PluginType;
import net.runelite.client.plugins.wildernesslocations.WildernessLocationsPlugin;
import net.runelite.client.util.HotkeyListener;
import javax.inject.Inject;
@Slf4j
@PluginDescriptor(
name = "Location Chatter",
tags = {"location", "exilent", "pklite", "spammer"},
type = PluginType.PVP
)
public class LocationChatterPlugin extends Plugin
{
@Inject
private Client client;
@Inject
private ClientThread clientThread;
@Inject
LocationChatterConfig config;
@Inject
private KeyManager keyManager;
@Inject
private PluginManager pluginManager;
private WildernessLocationsPlugin wildyLocsPlugin;
private String oldChat = "";
private int currentCooldown = 0;
private final int COOLDOWN_TICKS = 30;
private final HotkeyListener hotkeyListener = new HotkeyListener(() -> config.keybind())
{
@Override
public void hotkeyPressed()
{
sendLocToCC();
}
};
@Override
public void startUp()
{
for (Plugin pl : pluginManager.getPlugins())
{
if (pl instanceof WildernessLocationsPlugin)
{
wildyLocsPlugin = (WildernessLocationsPlugin) pl;
}
}
keyManager.registerKeyListener(hotkeyListener);
}
@Override
public void shutDown()
{
keyManager.unregisterKeyListener(hotkeyListener);
}
@Provides
LocationChatterConfig getConfig(ConfigManager configManager)
{
return configManager.getConfig(LocationChatterConfig.class);
}
@Subscribe
public void onGameTick(GameTick tickEvent)
{
if (currentCooldown != 0)
{
currentCooldown--;
}
}
@Subscribe
public void onVarClientStrChanged(VarClientStrChanged varClient)
{
String newChat = client.getVar(VarClientStr.CHATBOX_TYPED_TEXT);
if (varClient.getIndex() == VarClientStr.CHATBOX_TYPED_TEXT.getIndex() && !newChat.equals(oldChat))
{
oldChat = newChat;
}
}
private boolean inClanChat()
{
return client.getWidget(WidgetInfo.CLAN_CHAT_TITLE) != null;
}
private void sendMessage(String text)
{
int mode = 0;
if (inClanChat() && text.startsWith("/"))
{
mode = 2;
}
int finalMode = mode;
Runnable r = () ->
{
String cached = oldChat;
client.setVar(VarClientStr.CHATBOX_TYPED_TEXT, text);
client.runScript(ScriptID.CHATBOX_INPUT, finalMode, text);
oldChat = cached;
client.setVar(VarClientStr.CHATBOX_TYPED_TEXT, oldChat);
};
clientThread.invoke(r);
}
private void sendLocToCC()
{
if (currentCooldown != 0)
{
return;
}
String location = wildyLocsPlugin.getLocationString();
if (location.equals(""))
{
return;
}
sendMessage("/World: " + client.getWorld() + " Location: " + location);
currentCooldown = COOLDOWN_TICKS;
}
}

View File

@@ -1,135 +1,146 @@
/*
* Copyright (c) 2019. PKLite - All Rights Reserved
* Unauthorized modification, distribution, or possession of this source file, via any medium is strictly prohibited.
* Proprietary and confidential. Refer to PKLite License file for more information on
* full terms of this copyright and to determine what constitutes authorized use.
* Written by PKLite(ST0NEWALL, others) <stonewall@thots.cc.usa>, 2019
*
*/
package net.runelite.client.plugins.pvptools;
import java.awt.Color;
import java.security.Key;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Keybind;
@ConfigGroup("pvptools")
public interface PvpToolsConfig extends Config
{
@ConfigItem(
keyName = "countPlayers",
name = "Count Players",
description = "When in PvP zones, counts the attackable players in and not in player's CC",
position = 3
)
default boolean countPlayers()
{
return true;
}
@ConfigItem(
keyName = "countOverHeads",
name = "Count Enemy Overheads",
description = "Counts the number of each protection prayer attackable targets not in your CC are currently" +
" using",
position = 4
)
default boolean countOverHeads()
{
return true;
}
@ConfigItem(
keyName = "fallInHelper",
name = "Fall In Helper",
description = "Hides all non-friendly player entities other than the one that is attacking you.",
position = 5
)
default boolean fallInHelper()
{
return true;
}
@ConfigItem(
keyName = "hotkey",
name = "Fall In Hotkey",
description = "Turns the fall in helper on or off when you press this hotkey",
position = 6
)
default Keybind hotkey()
{
return Keybind.NOT_SET;
}
@ConfigItem(
keyName = "attackOptionsClan",
name = "Move CC Attack Option",
description = "Moves the attack option for people in the same CC",
position = 7,
group = "Right-Click Attack Options"
)
default boolean attackOptionsClan()
{
return false;
}
@ConfigItem(
keyName = "attackOptionsFriend",
name = "Move Friend Attack Options",
description = "Moves the attack option for people on your friends list",
position = 8,
group = "Right-Click Attack Options"
)
default boolean attackOptionsFriend()
{
return false;
}
@ConfigItem(
keyName = "levelRangeAttackOptions",
name = "Moves Other Attack Options",
description = "Moves the attack option for people that are outside your level range",
position = 9,
group = "Right-Click Attack Options"
)
default boolean levelRangeAttackOptions()
{
return false;
}
@ConfigItem(
keyName = "riskCalculator",
name = "Risk Calculator",
description = "Enables a panel in the PvP Tools Panel that shows the players current risk",
position = 13
)
default boolean riskCalculatorEnabled()
{
return true;
}
@ConfigItem(
keyName = "missingPlayers",
name = "Missing CC Players",
description = "Adds a button to the PvP Tools panel that opens a window showing which CC members are not at" +
" the current players location",
position = 14
)
default boolean missingPlayersEnabled() { return true; }
@ConfigItem(
keyName = "currentPlayers",
name = "Current CC Players",
description = "Adds a button to the PvP Tools panel that opens a window showing which CC members currently at" +
" the players location",
position = 15
)
default boolean currentPlayersEnabled()
{
return true;
}
}
/*
* Copyright (c) 2019. PKLite - All Rights Reserved
* Unauthorized modification, distribution, or possession of this source file, via any medium is strictly prohibited.
* Proprietary and confidential. Refer to PKLite License file for more information on
* full terms of this copyright and to determine what constitutes authorized use.
* Written by PKLite(ST0NEWALL, others) <stonewall@thots.cc.usa>, 2019
*
*/
package net.runelite.client.plugins.pvptools;
import java.awt.Color;
import java.security.Key;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Keybind;
@ConfigGroup("pvptools")
public interface PvpToolsConfig extends Config
{
@ConfigItem(
keyName = "countPlayers",
name = "Count Players",
description = "When in PvP zones, counts the attackable players in and not in player's CC",
position = 3
)
default boolean countPlayers()
{
return true;
}
@ConfigItem(
keyName = "countOverHeads",
name = "Count Enemy Overheads",
description = "Counts the number of each protection prayer attackable targets not in your CC are currently" +
" using",
position = 4
)
default boolean countOverHeads()
{
return true;
}
@ConfigItem(
keyName = "fallInHelper",
name = "Fall In Helper",
description = "Hides all non-friendly player entities other than the one that is attacking you.",
position = 5
)
default boolean fallInHelper()
{
return true;
}
@ConfigItem(
keyName = "hotkey",
name = "Fall In Hotkey",
description = "Turns the fall in helper on or off when you press this hotkey",
position = 6
)
default Keybind hotkey()
{
return Keybind.NOT_SET;
}
@ConfigItem(
keyName = "renderSelfHotkey",
name = "Render Self Hotkey",
description = "Toggles renderself when you press the hotkey",
position = 7
)
default Keybind renderSelf()
{
return Keybind.NOT_SET;
}
@ConfigItem(
keyName = "attackOptionsClan",
name = "Move CC Attack Option",
description = "Moves the attack option for people in the same CC",
position = 8,
group = "Right-Click Attack Options"
)
default boolean attackOptionsClan()
{
return false;
}
@ConfigItem(
keyName = "attackOptionsFriend",
name = "Move Friend Attack Options",
description = "Moves the attack option for people on your friends list",
position = 9,
group = "Right-Click Attack Options"
)
default boolean attackOptionsFriend()
{
return false;
}
@ConfigItem(
keyName = "levelRangeAttackOptions",
name = "Moves Other Attack Options",
description = "Moves the attack option for people that are outside your level range",
position = 10,
group = "Right-Click Attack Options"
)
default boolean levelRangeAttackOptions()
{
return false;
}
@ConfigItem(
keyName = "riskCalculator",
name = "Risk Calculator",
description = "Enables a panel in the PvP Tools Panel that shows the players current risk",
position = 14
)
default boolean riskCalculatorEnabled()
{
return true;
}
@ConfigItem(
keyName = "missingPlayers",
name = "Missing CC Players",
description = "Adds a button to the PvP Tools panel that opens a window showing which CC members are not at" +
" the current players location",
position = 15
)
default boolean missingPlayersEnabled() { return true; }
@ConfigItem(
keyName = "currentPlayers",
name = "Current CC Players",
description = "Adds a button to the PvP Tools panel that opens a window showing which CC members currently at" +
" the players location",
position = 16
)
default boolean currentPlayersEnabled()
{
return true;
}
}

View File

@@ -0,0 +1,52 @@
/*
*
* Copyright (c) 2019. PKLite
* Redistributions and modifications of this software are permitted as long as this notice remains in its original unmodified state at the top of this file. If there are any questions, comments, or feedback about this software, please direct all inquiries directly to the following authors.
* PKLite discord: https://discord.gg/Dp3HuFM
* Written by PKLite(ST0NEWALL, others) <stonewall@stonewall@pklite.xyz>, 2019
*
*/
package net.runelite.client.plugins.safespot;
import java.awt.Color;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
@ConfigGroup("safespot")
public interface SafeSpotConfig extends Config
{
@ConfigItem(
position = 1,
keyName = "playerSafeSpots",
name = "Render for Players",
description = "Renders 1 way safe spots vs other players"
)
default boolean playerSafeSpots()
{
return true;
}
@ConfigItem(
position = 2,
keyName = "npcSafeSpots",
name = "Render for NPCs",
description = "Renders 1 way safe spots vs NPCs"
)
default boolean npcSafeSpots()
{
return false;
}
@ConfigItem(
position = 3,
keyName = "tileColor",
name = "Tile Color",
description = "Color of safe spot tile"
)
default Color tileColor()
{
return Color.MAGENTA;
}
}

View File

@@ -0,0 +1,67 @@
/*
*
* Copyright (c) 2019. PKLite
* Redistributions and modifications of this software are permitted as long as this notice remains in its original unmodified state at the top of this file. If there are any questions, comments, or feedback about this software, please direct all inquiries directly to the following authors.
* PKLite discord: https://discord.gg/Dp3HuFM
* Written by PKLite(ST0NEWALL, others) <stonewall@stonewall@pklite.xyz>, 2019
*
*/
package net.runelite.client.plugins.safespot;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Polygon;
import javax.inject.Inject;
import net.runelite.api.Client;
import net.runelite.api.Perspective;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayLayer;
import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.OverlayPriority;
import net.runelite.client.ui.overlay.OverlayUtil;
public class SafeSpotOverlay extends Overlay
{
private final Client client;
private final SafeSpotPlugin safeSpotPlugin;
private final SafeSpotConfig config;
@Inject
public SafeSpotOverlay(Client client, SafeSpotPlugin safeSpotPlugin, SafeSpotConfig config)
{
this.client = client;
this.safeSpotPlugin = safeSpotPlugin;
this.config = config;
setPosition(OverlayPosition.DYNAMIC);
setPriority(OverlayPriority.LOW);
setLayer(OverlayLayer.ABOVE_SCENE);
}
@Override
public Dimension render(Graphics2D graphics)
{
if (safeSpotPlugin.isSafeSpotsRenderable())
{
if(safeSpotPlugin.getSafeSpotList() != null)
{
if (safeSpotPlugin.getSafeSpotList().size() > 0)
{
safeSpotPlugin.getSafeSpotList().forEach(tile ->
{
if (tile != null && tile.getLocalLocation() != null)
{
final Polygon poly = Perspective.getCanvasTilePoly(client, tile.getLocalLocation());
if (poly != null)
{
OverlayUtil.renderPolygon(graphics, poly, config.tileColor());
}
}
});
}
}
}
return null;
}
}

View File

@@ -0,0 +1,166 @@
/*
* Copyright (c) 2019. PKLite
* Redistributions and modifications of this software are permitted as long as this notice remains in its original unmodified state at the top of this file. If there are any questions, comments, or feedback about this software, please direct all inquiries directly to the following authors.
* PKLite discord: https://discord.gg/Dp3HuFM
* Written by PKLite(ST0NEWALL, others) <stonewall@stonewall@pklite.xyz>, 2019
*
*/
package net.runelite.client.plugins.safespot;
import com.google.inject.Provides;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import lombok.Getter;
import net.runelite.api.Actor;
import net.runelite.api.Client;
import net.runelite.api.CollisionDataFlag;
import net.runelite.api.NPC;
import net.runelite.api.Player;
import net.runelite.api.Tile;
import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldArea;
import net.runelite.api.coords.WorldPoint;
import net.runelite.api.events.GameTick;
import net.runelite.api.events.InteractingChanged;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.plugins.PluginType;
import net.runelite.client.ui.overlay.OverlayManager;
@PluginDescriptor(
name = "1 Way Safe Spots",
description = "Renders tile overlays for one way safe spots",
tags = {"safe spot", "pvp", "safespots", "pklite"},
type = PluginType.UTILITY,
enabledByDefault = false
)
public class SafeSpotPlugin extends Plugin
{
@Inject
private Client client;
@Inject
OverlayManager overlayManager;
@Inject
private SafeSpotConfig config;
@Getter
private ArrayList<Tile> safeSpotList;
@Getter
private boolean safeSpotsRenderable = false;
private SafeSpotOverlay safeSpotOverlay;
private int tickCount = 0;
@Provides
SafeSpotConfig config(ConfigManager configManager)
{
return configManager.getConfig(SafeSpotConfig.class);
}
@Override
protected void startUp() throws Exception
{
safeSpotOverlay = new SafeSpotOverlay(client, this, config);
overlayManager.add(safeSpotOverlay);
}
@Override
protected void shutDown() throws Exception
{
overlayManager.remove(safeSpotOverlay);
}
@Subscribe
private void onInteractingChanged(InteractingChanged event)
{
if (event.getSource() != client.getLocalPlayer())
{
return;
}
if (event.getTarget() == null && (config.npcSafeSpots() || config.playerSafeSpots()))
{
tickCount = 10;
}
}
@Subscribe
public void onGameTick(GameTick event)
{
if (client.getLocalPlayer().getInteracting() != null)
{
if (client.getLocalPlayer().getInteracting() instanceof Player && config.playerSafeSpots())
{
safeSpotsRenderable = true;
updateSafeSpots();
}
if (client.getLocalPlayer().getInteracting() instanceof NPC && config.npcSafeSpots())
{
safeSpotsRenderable = true;
updateSafeSpots();
}
}
else
{
safeSpotsRenderable = false;
}
if (tickCount > 0)
{
tickCount--;
safeSpotsRenderable = true;
}
}
/**
* Call this method to update the ArrayList of safespot tiles
*/
private void updateSafeSpots()
{
if (client.getLocalPlayer().getInteracting() != null)
{
Actor enemy = client.getLocalPlayer().getInteracting();
WorldArea worldArea = new WorldArea(enemy.getWorldLocation().getX() - 12,
enemy.getWorldLocation().getY() - 12, 24, 24, client.getPlane());
List<WorldPoint> worldPoints = worldArea.toWorldPointList();
safeSpotList = getSafeSpotList(enemy, worldPoints);
}
}
/**
* The ArrayList of 1-way safe spots
* @param actor - The Actor that the tiles are a safe spot against
* @param worldPoints - Worldpoints in the current scene
* @return an ArrayList of Tiles where current player can attack actor but actor cannot attack local player
*/
private ArrayList<Tile> getSafeSpotList(Actor actor, List<WorldPoint> worldPoints)
{
ArrayList<Tile> safeSpotList = new ArrayList<>();
Tile[][][] tiles = client.getScene().getTiles();
for (WorldPoint w:worldPoints)
{
LocalPoint toPoint = LocalPoint.fromWorld(client, w);
Tile fromTile = tiles[client.getPlane()][actor.getLocalLocation().getSceneX()]
[actor.getLocalLocation().getSceneY()];
Tile toTile = tiles[client.getPlane()][toPoint.getSceneX()]
[toPoint.getSceneY()];
final int plane = client.getLocalPlayer().getWorldArea().getPlane();
int bit = client.getCollisionMaps()[plane].getFlags()[toPoint.getSceneX()][toPoint.getSceneY()];
if (toTile.hasLineOfSightTo(fromTile) && !fromTile.hasLineOfSightTo(toTile))
{
if (!((bit & CollisionDataFlag.BLOCK_MOVEMENT_OBJECT ) == CollisionDataFlag.BLOCK_MOVEMENT_OBJECT ||
(bit & CollisionDataFlag.BLOCK_MOVEMENT_FLOOR_DECORATION )
== CollisionDataFlag.BLOCK_MOVEMENT_FLOOR_DECORATION ||
(bit & CollisionDataFlag.BLOCK_MOVEMENT_FLOOR ) == CollisionDataFlag.BLOCK_MOVEMENT_FLOOR ||
(bit & CollisionDataFlag.BLOCK_MOVEMENT_FULL ) == CollisionDataFlag.BLOCK_MOVEMENT_FULL))
{
safeSpotList.add(toTile);
}
}
}
return safeSpotList;
}
}

View File

@@ -1,61 +1,39 @@
/*
* Copyright (c) 2018, https://runelitepl.us
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.wildernesslocations;
import java.awt.Dimension;
import java.awt.Graphics2D;
import javax.inject.Inject;
import net.runelite.api.Client;
import net.runelite.client.plugins.wildernesslocations.WildernessLocationsPlugin;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayLayer;
import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.OverlayPriority;
import net.runelite.client.ui.overlay.components.TextComponent;
public class WildernessLocationsOverlay
extends Overlay {
private final WildernessLocationsPlugin plugin;
private TextComponent textComponent;
public class WildernessLocationsOverlay extends Overlay
{
private final WildernessLocationsPlugin plugin;
private TextComponent textComponent;
@Inject
public WildernessLocationsOverlay(Client client, WildernessLocationsPlugin plugin) {
this.plugin = plugin;
setLayer(OverlayLayer.ABOVE_WIDGETS);
setPriority(OverlayPriority.HIGH);
setPosition(OverlayPosition.BOTTOM_RIGHT);
textComponent = new TextComponent();
}
@Inject
public WildernessLocationsOverlay(Client client, WildernessLocationsPlugin plugin)
{
this.plugin = plugin;
setLayer(OverlayLayer.ABOVE_WIDGETS);
setPriority(OverlayPriority.HIGH);
setPosition(OverlayPosition.BOTTOM_RIGHT);
textComponent = new TextComponent();
@Override
public Dimension render(Graphics2D graphics) {
if (plugin.isRenderLocation()) {
textComponent.setText(plugin.getLocationString());
return textComponent.render(graphics);
}
return null;
}
}
@Override
public Dimension render(Graphics2D graphics)
{
if (plugin.isRenderLocation())
{
textComponent.setText(plugin.getLocationString());
return textComponent.render(graphics);
}
return null;
}
}

View File

@@ -1,27 +1,3 @@
/*
* Copyright (c) 2018, https://runelitepl.us
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.wildernesslocations;
@@ -39,16 +15,17 @@ import net.runelite.api.coords.WorldPoint;
import net.runelite.api.events.GameTick;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginType;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.plugins.PluginType;
import net.runelite.client.plugins.PluginManager;
import net.runelite.client.ui.overlay.OverlayManager;
import net.runelite.client.util.WildernessLocation;
@PluginDescriptor(
name = "Wild Locations",
description = "Indicates the players current location in the wild",
tags = {"Wildy", "Wilderness Location", "location", "loc", "pvp", "pklite"},
type = PluginType.PVP
name = "Wild Locations",
description = "Indicates the players current location in the wild",
tags = {"Wildy", "Wilderness Location", "location", "loc", "pvp", "pklite"},
type = PluginType.PVP
)
public class WildernessLocationsPlugin extends Plugin
{

View File

@@ -1,261 +1,275 @@
/*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.ui.overlay;
import com.google.common.base.Strings;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Polygon;
import java.awt.RenderingHints;
import java.awt.Stroke;
import java.awt.geom.Area;
import java.awt.image.BufferedImage;
import net.runelite.api.Actor;
import net.runelite.api.Client;
import net.runelite.api.Perspective;
import net.runelite.api.Point;
import net.runelite.api.TileObject;
import net.runelite.api.coords.LocalPoint;
/**
* Created by Kyle Fricilone on Jun 09, 2017.
*/
public class OverlayUtil
{
private static final int MINIMAP_DOT_RADIUS = 4;
private static final double UNIT = Math.PI / 1024.0d;
public static void renderPolygon(Graphics2D graphics, Polygon poly, Color color)
{
graphics.setColor(color);
final Stroke originalStroke = graphics.getStroke();
graphics.setStroke(new BasicStroke(2));
graphics.drawPolygon(poly);
graphics.setColor(new Color(0, 0, 0, 50));
graphics.fillPolygon(poly);
graphics.setStroke(originalStroke);
}
public static void renderMinimapLocation(Graphics2D graphics, Point mini, Color color)
{
graphics.setColor(Color.BLACK);
graphics.fillOval(mini.getX() - MINIMAP_DOT_RADIUS / 2, mini.getY() - MINIMAP_DOT_RADIUS / 2 + 1, MINIMAP_DOT_RADIUS, MINIMAP_DOT_RADIUS);
graphics.setColor(color);
graphics.fillOval(mini.getX() - MINIMAP_DOT_RADIUS / 2, mini.getY() - MINIMAP_DOT_RADIUS / 2, MINIMAP_DOT_RADIUS, MINIMAP_DOT_RADIUS);
}
public static void renderMinimapRect(Client client, Graphics2D graphics, Point center, int width, int height, Color color)
{
double angle = client.getMapAngle() * UNIT;
graphics.setColor(color);
graphics.rotate(angle, center.getX(), center.getY());
graphics.drawRect(center.getX() - width / 2, center.getY() - height / 2, width, height);
graphics.rotate(-angle , center.getX(), center.getY());
}
public static void renderTextLocation(Graphics2D graphics, Point txtLoc, String text, Color color)
{
if (Strings.isNullOrEmpty(text))
{
return;
}
int x = txtLoc.getX();
int y = txtLoc.getY();
graphics.setColor(Color.BLACK);
graphics.drawString(text, x + 1, y + 1);
graphics.setColor(color);
graphics.drawString(text, x, y);
}
public static void renderImageLocation(Client client, Graphics2D graphics, LocalPoint localPoint, BufferedImage image, int zOffset)
{
net.runelite.api.Point imageLocation = Perspective.getCanvasImageLocation(client, localPoint, image, zOffset);
if (imageLocation != null)
{
renderImageLocation(graphics, imageLocation, image);
}
}
public static void renderImageLocation(Graphics2D graphics, Point imgLoc, BufferedImage image)
{
int x = imgLoc.getX();
int y = imgLoc.getY();
graphics.drawImage(image, x, y, null);
}
public static void renderActorOverlay(Graphics2D graphics, Actor actor, String text, Color color)
{
Polygon poly = actor.getCanvasTilePoly();
if (poly != null)
{
renderPolygon(graphics, poly, color);
}
Point textLocation = actor.getCanvasTextLocation(graphics, text, actor.getLogicalHeight() + 40);
if (textLocation != null)
{
renderTextLocation(graphics, textLocation, text, color);
}
}
public static void renderActorOverlayImage(Graphics2D graphics, Actor actor, BufferedImage image, Color color, int zOffset)
{
Polygon poly = actor.getCanvasTilePoly();
if (poly != null)
{
renderPolygon(graphics, poly, color);
}
Point imageLocation = actor.getCanvasImageLocation(image, zOffset);
if (imageLocation != null)
{
renderImageLocation(graphics, imageLocation, image);
}
}
public static void renderTileOverlay(Graphics2D graphics, TileObject tileObject, String text, Color color)
{
Polygon poly = tileObject.getCanvasTilePoly();
if (poly != null)
{
renderPolygon(graphics, poly, color);
}
Point minimapLocation = tileObject.getMinimapLocation();
if (minimapLocation != null)
{
renderMinimapLocation(graphics, minimapLocation, color);
}
Point textLocation = tileObject.getCanvasTextLocation(graphics, text, 0);
if (textLocation != null)
{
renderTextLocation(graphics, textLocation, text, color);
}
}
public static void renderTileOverlay(Client client, Graphics2D graphics, LocalPoint localLocation, BufferedImage image, Color color)
{
Polygon poly = Perspective.getCanvasTilePoly(client, localLocation);
if (poly != null)
{
renderPolygon(graphics, poly, color);
}
renderImageLocation(client, graphics, localLocation, image, 0);
}
public static void renderHoverableArea(Graphics2D graphics, Area area, net.runelite.api.Point mousePosition, Color fillColor, Color borderColor, Color borderHoverColor)
{
if (area != null)
{
if (area.contains(mousePosition.getX(), mousePosition.getY()))
{
graphics.setColor(borderHoverColor);
}
else
{
graphics.setColor(borderColor);
}
graphics.draw(area);
graphics.setColor(fillColor);
graphics.fill(area);
}
}
public static void setGraphicProperties(Graphics2D graphics)
{
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
}
public static java.awt.Point padPosition(OverlayPosition position, Dimension dimension, final int padding)
{
final java.awt.Point result = new java.awt.Point();
switch (position)
{
case DYNAMIC:
case TOOLTIP:
break;
case BOTTOM_LEFT:
result.x += dimension.width + (dimension.width == 0 ? 0 : padding);
break;
case BOTTOM_RIGHT:
result.x -= dimension.width + (dimension.width == 0 ? 0 : padding);
break;
case TOP_LEFT:
case TOP_CENTER:
result.y += dimension.height + (dimension.height == 0 ? 0 : padding);
break;
case CANVAS_TOP_RIGHT:
case TOP_RIGHT:
result.y += dimension.height + (dimension.height == 0 ? 0 : padding);
break;
case ABOVE_CHATBOX_RIGHT:
result.y -= dimension.height + (dimension.height == 0 ? 0 : padding);
break;
}
return result;
}
public static java.awt.Point transformPosition(OverlayPosition position, Dimension dimension)
{
final java.awt.Point result = new java.awt.Point();
switch (position)
{
case DYNAMIC:
case TOOLTIP:
case TOP_LEFT:
break;
case TOP_CENTER:
result.x = result.x - dimension.width / 2;
break;
case BOTTOM_LEFT:
result.y = result.y - dimension.height;
break;
case BOTTOM_RIGHT:
case ABOVE_CHATBOX_RIGHT:
result.y = result.y - dimension.height;
// FALLTHROUGH
case CANVAS_TOP_RIGHT:
case TOP_RIGHT:
result.x = result.x - dimension.width;
break;
}
return result;
}
}
/*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.ui.overlay;
import com.google.common.base.Strings;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Polygon;
import java.awt.RenderingHints;
import java.awt.Stroke;
import java.awt.geom.Area;
import java.awt.image.BufferedImage;
import net.runelite.api.Actor;
import net.runelite.api.Client;
import net.runelite.api.Perspective;
import net.runelite.api.Player;
import net.runelite.api.Point;
import net.runelite.api.TileObject;
import net.runelite.api.coords.LocalPoint;
/**
* Created by Kyle Fricilone on Jun 09, 2017.
*/
public class OverlayUtil
{
private static final int MINIMAP_DOT_RADIUS = 4;
private static final double UNIT = Math.PI / 1024.0d;
public static void renderPolygon(Graphics2D graphics, Polygon poly, Color color)
{
graphics.setColor(color);
final Stroke originalStroke = graphics.getStroke();
graphics.setStroke(new BasicStroke(2));
graphics.drawPolygon(poly);
graphics.setColor(new Color(0, 0, 0, 50));
graphics.fillPolygon(poly);
graphics.setStroke(originalStroke);
}
public static void renderMinimapLocation(Graphics2D graphics, Point mini, Color color)
{
graphics.setColor(Color.BLACK);
graphics.fillOval(mini.getX() - MINIMAP_DOT_RADIUS / 2, mini.getY() - MINIMAP_DOT_RADIUS / 2 + 1, MINIMAP_DOT_RADIUS, MINIMAP_DOT_RADIUS);
graphics.setColor(color);
graphics.fillOval(mini.getX() - MINIMAP_DOT_RADIUS / 2, mini.getY() - MINIMAP_DOT_RADIUS / 2, MINIMAP_DOT_RADIUS, MINIMAP_DOT_RADIUS);
}
public static void renderMinimapRect(Client client, Graphics2D graphics, Point center, int width, int height, Color color)
{
double angle = client.getMapAngle() * UNIT;
graphics.setColor(color);
graphics.rotate(angle, center.getX(), center.getY());
graphics.drawRect(center.getX() - width / 2, center.getY() - height / 2, width, height);
graphics.rotate(-angle , center.getX(), center.getY());
}
public static void renderTextLocation(Graphics2D graphics, Point txtLoc, String text, Color color)
{
if (Strings.isNullOrEmpty(text))
{
return;
}
int x = txtLoc.getX();
int y = txtLoc.getY();
graphics.setColor(Color.BLACK);
graphics.drawString(text, x + 1, y + 1);
graphics.setColor(color);
graphics.drawString(text, x, y);
}
public static void renderImageLocation(Client client, Graphics2D graphics, LocalPoint localPoint, BufferedImage image, int zOffset)
{
net.runelite.api.Point imageLocation = Perspective.getCanvasImageLocation(client, localPoint, image, zOffset);
if (imageLocation != null)
{
renderImageLocation(graphics, imageLocation, image);
}
}
public static void renderImageLocation(Graphics2D graphics, Point imgLoc, BufferedImage image)
{
int x = imgLoc.getX();
int y = imgLoc.getY();
graphics.drawImage(image, x, y, null);
}
public static void renderActorOverlay(Graphics2D graphics, Actor actor, String text, Color color)
{
Polygon poly = actor.getCanvasTilePoly();
if (poly != null)
{
renderPolygon(graphics, poly, color);
}
Point textLocation = actor.getCanvasTextLocation(graphics, text, actor.getLogicalHeight() + 40);
if (textLocation != null)
{
renderTextLocation(graphics, textLocation, text, color);
}
}
public static void renderActorOverlayImage(Graphics2D graphics, Actor actor, BufferedImage image, Color color, int zOffset)
{
Polygon poly = actor.getCanvasTilePoly();
if (poly != null)
{
renderPolygon(graphics, poly, color);
}
Point imageLocation = actor.getCanvasImageLocation(image, zOffset);
if (imageLocation != null)
{
renderImageLocation(graphics, imageLocation, image);
}
}
public static void renderTileOverlay(Graphics2D graphics, TileObject tileObject, String text, Color color)
{
Polygon poly = tileObject.getCanvasTilePoly();
if (poly != null)
{
renderPolygon(graphics, poly, color);
}
Point minimapLocation = tileObject.getMinimapLocation();
if (minimapLocation != null)
{
renderMinimapLocation(graphics, minimapLocation, color);
}
Point textLocation = tileObject.getCanvasTextLocation(graphics, text, 0);
if (textLocation != null)
{
renderTextLocation(graphics, textLocation, text, color);
}
}
public static void renderTileOverlay(Client client, Graphics2D graphics, LocalPoint localLocation, BufferedImage image, Color color)
{
Polygon poly = Perspective.getCanvasTilePoly(client, localLocation);
if (poly != null)
{
renderPolygon(graphics, poly, color);
}
renderImageLocation(client, graphics, localLocation, image, 0);
}
public static void renderHoverableArea(Graphics2D graphics, Area area, net.runelite.api.Point mousePosition, Color fillColor, Color borderColor, Color borderHoverColor)
{
if (area != null)
{
if (area.contains(mousePosition.getX(), mousePosition.getY()))
{
graphics.setColor(borderHoverColor);
}
else
{
graphics.setColor(borderColor);
}
graphics.draw(area);
graphics.setColor(fillColor);
graphics.fill(area);
}
}
public static void setGraphicProperties(Graphics2D graphics)
{
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
}
public static java.awt.Point padPosition(OverlayPosition position, Dimension dimension, final int padding)
{
final java.awt.Point result = new java.awt.Point();
switch (position)
{
case DYNAMIC:
case TOOLTIP:
break;
case BOTTOM_LEFT:
result.x += dimension.width + (dimension.width == 0 ? 0 : padding);
break;
case BOTTOM_RIGHT:
result.x -= dimension.width + (dimension.width == 0 ? 0 : padding);
break;
case TOP_LEFT:
case TOP_CENTER:
result.y += dimension.height + (dimension.height == 0 ? 0 : padding);
break;
case CANVAS_TOP_RIGHT:
case TOP_RIGHT:
result.y += dimension.height + (dimension.height == 0 ? 0 : padding);
break;
case ABOVE_CHATBOX_RIGHT:
result.y -= dimension.height + (dimension.height == 0 ? 0 : padding);
break;
}
return result;
}
public static java.awt.Point transformPosition(OverlayPosition position, Dimension dimension)
{
final java.awt.Point result = new java.awt.Point();
switch (position)
{
case DYNAMIC:
case TOOLTIP:
case TOP_LEFT:
break;
case TOP_CENTER:
result.x = result.x - dimension.width / 2;
break;
case BOTTOM_LEFT:
result.y = result.y - dimension.height;
break;
case BOTTOM_RIGHT:
case ABOVE_CHATBOX_RIGHT:
result.y = result.y - dimension.height;
// FALLTHROUGH
case CANVAS_TOP_RIGHT:
case TOP_RIGHT:
result.x = result.x - dimension.width;
break;
}
return result;
}
public static void renderActorTextAndImage(Graphics2D graphics, Actor actor, String text, Color color,
BufferedImage image, int yOffset, int xOffset)
{
Point textLocation = new Point(actor.getConvexHull().getBounds().x + xOffset,
actor.getConvexHull().getBounds().y + yOffset);
renderImageLocation(graphics, textLocation, image);
xOffset = image.getWidth() + 1;
yOffset = (image.getHeight() - (int) graphics.getFontMetrics().getStringBounds(text, graphics).getHeight());
textLocation = new Point(textLocation.getX() + xOffset, textLocation.getY() + image.getHeight() - yOffset);
renderTextLocation(graphics, textLocation, text, color);
}
}

View File

@@ -1,98 +1,93 @@
package net.runelite.client.util;
import lombok.Getter;
import net.runelite.api.coords.WorldArea;
public enum WildernessLocation {
REV_CAVE_OTHER("Rev Cave", new Location(3128, 10232, 3225, 10059), 0),
REV_BLACK_DRAGS("Rev Black Drags", new Location(3223, 10216, 3254, 10190), 0),
REV_DARK_BEAST("Rev Dark Beast", new Location(3243, 10154, 3264, 10136), 0),
REV_MAIN_CHAMBER("Main Rev Chamber", new Location(3227, 10187, 3261, 10157), 0),
REV_ENTRANCE_INSIDE("Inside Rev Ent.", new Location(3238, 10236, 3243, 10231), 0),
ICE_ROCK("Ice Rock", new Location(2957, 3942, 2984, 3929), 0),
WILDY_AGILITY_COURSE("Wildy Agility Course", new Location(2988, 3967, 3008, 3906), 0),
FIRE_GIANT_ENTRANCE("Fire Giant Entrance", new Location(3042, 3929, 3051, 3920), 0),
PIRATE_HUT("Pirate Hut", new Location(3037, 3959, 3045, 3948), 0),
MAGE_BANK("Mage Bank", new Location(3082, 3960, 3103, 3952), 0),
MAGE_ARENA("Mage Arena", new Location(3088, 3949, 3123, 3919), 0),
LEVER("Lever", new Location(3149, 3933, 3162, 3917), 0),
WEB("Web", new Location(3153, 3961, 3163, 3948), 0),
RESOURCE_ARENA("Resource Arena", new Location(3174, 3946, 3195, 3923), 0),
AXE_HUT("Axe Hut", new Location(3187, 3962, 3194, 3957), 0),
SCORPIA("Scorpia", new Location(3216, 3949, 3248, 3935), 0),
ROGUE_CASTLE("Rogue Castle", new Location(3275, 3947, 3299, 3920), 0),
FIFTY_PORTS("50 ports", new Location(3301, 3923, 3315, 3909), 0),
VOLCANO("Volcano", new Location(3345, 3957, 3390, 3916), 0),
NEW_GATE("New Gate", new Location(3345, 3957, 3390, 3916), 0),
GLORY_HOLE("Glory Hole", new Location(3352, 3897, 3386, 3869), 0),
GLORY_HILL("Glory Hill", new Location(3331, 3890, 3348, 3866), 0),
GDZ("Gdz", new Location(3279, 3895, 3296, 3875), 0),
GAP("Gap", new Location(3238, 3855, 3258, 3841), 0),
OLD_GATE("Old Gate", new Location(3211, 3906, 3238, 3882), 0),
LAVA_DRAGS("Lava Drags", new Location(3175, 3857, 3221, 3805), 0),
SPIDER_HILL("Spider Hill", new Location(3156, 3896, 3182, 3871), 0),
RUNE_ROCKS("Rune Rocks", new Location(3055, 3890, 3072, 3876), 0),
ICE_GATE("Ice Gate", new Location(2945, 3913, 2978, 3878), 0),
VENENATIS("Venenatis", new Location(3298, 3759, 3353, 3722), 0),
SINGLE_STRIP("Single Strip", new Location(3333, 3842, 3348, 3774), 0),
CALLISTO("Callisto", new Location(3266, 3863, 3315, 3827), 0),
DWARVES("Dwarves", new Location(3230, 3805, 3264, 3779), 0),
VETTION("Vet'tion", new Location(3183, 3796, 3227, 3765), 0),
EAST_DRAGONS("East Drags", new Location(3326, 3704, 3365, 3671), 0),
HILL_GIANTS("Hill Giants", new Location(3282, 3687, 3300, 3674), 0),
ENTS("Ents", new Location(3300, 3627, 3320, 3584), 0),
CHAOS_TEMPLE("Chaos Temple", new Location(3220, 3632, 3255, 3593), 0),
NINETEEN_OBELISK("19s", new Location(3220, 3672, 3234, 3660), 0),
CORP_CAVE("Corp Cave", new Location(3201, 3684, 3219, 3672), 0),
THIRTEEN_OBELISK("13s", new Location(3145, 3628, 3168, 3609), 0),
SOUTH_REV_ENTRANCE("Lvl 18 Rev Ent", new Location(3071, 3660, 3092, 3645), 0),
GRAVES("Graves", new Location(3128, 3686, 3181, 3658), 0),
GRAVEYARD_DRAGS("Graveyard Drags", new Location(3129, 3717, 3172, 3691), 0),
CHINS("Chins", new Location(3128, 3792, 3160, 3754), 0),
REV_ENTRANCE("Rev Entrance", new Location(3118, 3837, 3142, 3818), 0),
HOB_OBELISK("35 Obelisk", new Location(3097, 3804, 3115, 3785), 0),
HOBGOBLINS("Hobgoblins", new Location(3073, 3775, 3104, 3745), 0),
GWD("God Wars Dungeon", new Location(3010, 3745, 3027, 3727), 0),
LAVA_MAZE_TELE("Lava Maze Tele", new Location(3019, 3842, 3044, 3812), 0),
KBD_CAGE("KBD CAGE", new Location(3007, 3855, 3021, 3839), 0),
GHORROCK("44s", new Location(2973, 3870, 2987, 3859), 0),
CHAOS_FANATIC("Chaos Fanatic", new Location(2971, 3854, 2992, 3834), 0),
HIGH_ALTAR("High Altar", new Location(2945, 3826, 2970, 3813), 0),
CEMETERY("Cemetery", new Location(2956, 3767, 2996, 3736), 0),
CRAZY_ARCHAEOLOGIST("Crazy Archaeologist", new Location(2952, 3709, 2985, 3678), 0),
DARK_WARRIOR_FORTRESS("Dark Warriors", new Location(3014, 3648, 3046, 3616), 0),
WEST_DRAGONS("West Drags", new Location(2960, 3627, 2992, 3598), 0),
BANDIT_CAMP("Bandit Camp", new Location(3017, 3712, 3059, 3681), 0);
private final String name1;
private final WorldArea worldArea;
public enum WildernessLocation
{
private WildernessLocation(String name, Location location, int plane) {
name1 = name;
worldArea = new WorldArea(location.x, location.y, location.width, location.height, plane);
}
REV_CAVE_OTHER("Rev Cave", new Location(3128, 10232, 3225, 10059), 0),
REV_BLACK_DRAGS("Rev Black Drags", new Location(3223, 10216, 3254, 10190), 0),
REV_DARK_BEAST("Rev Dark Beast", new Location(3243, 10154, 3264, 10136), 0),
REV_MAIN_CHAMBER("Main Rev Chamber", new Location(3227, 10187, 3261, 10157), 0),
REV_ENTRANCE_INSIDE("Inside Rev Ent.", new Location(3238, 10236, 3243, 10231), 0),
ICE_ROCK("Ice Rock", new Location(2957, 3942, 2984, 3929), 0),
WILDY_AGILITY_COURSE("Wildy Agility Course", new Location(2988, 3967, 3008, 3906), 0),
FIRE_GIANT_ENTRANCE("Fire Giant Entrance", new Location(3042, 3929, 3051, 3920), 0),
PIRATE_HUT("Pirate Hut", new Location(3037, 3959, 3045, 3948), 0),
MAGE_BANK("Mage Bank", new Location(3082, 3960, 3103, 3952), 0),
MAGE_ARENA("Mage Arena", new Location(3088, 3949, 3123, 3919), 0),
LEVER("Lever", new Location(3149, 3933, 3162, 3917), 0),
WEB("Web", new Location(3153, 3961, 3163, 3948), 0),
RESOURCE_ARENA("Resource Arena", new Location(3174, 3946, 3195, 3923), 0),
AXE_HUT("Axe Hut", new Location(3187, 3962, 3194, 3957), 0),
SCORPIA("Scorpia", new Location(3216, 3949, 3248, 3935), 0),
ROGUE_CASTLE("Rogue Castle", new Location(3275, 3947, 3299, 3920), 0),
FIFTY_PORTS("50 ports", new Location(3301, 3923, 3315, 3909), 0),
VOLCANO("Volcano", new Location(3345, 3957, 3390, 3916), 0),
NEW_GATE("New Gate", new Location(3345, 3957, 3390, 3916), 0),
GLORY_HOLE("Glory Hole", new Location(3352, 3897, 3386, 3869), 0),
GLORY_HILL("Glory Hill", new Location(3331, 3890, 3348, 3866), 0),
GDZ("Gdz", new Location(3279, 3895, 3296, 3875), 0),
GAP("Gap", new Location(3238, 3855, 3258, 3841), 0),
OLD_GATE("Old Gate", new Location(3211, 3906, 3238, 3882), 0),
LAVA_DRAGS("Lava Drags", new Location(3175, 3857, 3221, 3805), 0),
SPIDER_HILL("Spider Hill", new Location(3156, 3896, 3182, 3871), 0),
RUNE_ROCKS("Rune Rocks", new Location(3055, 3890, 3072, 3876), 0),
ICE_GATE("Ice Gate", new Location(2945, 3913, 2978, 3878), 0),
VENENATIS("Venenatis", new Location(3298, 3759, 3353, 3722), 0),
SINGLE_STRIP("Single Strip", new Location(3333, 3842, 3348, 3774), 0),
CALLISTO("Callisto", new Location(3266, 3863, 3315, 3827), 0),
DWARVES("Dwarves", new Location(3230, 3805, 3264, 3779), 0),
VETTION("Vet'tion", new Location(3183, 3796, 3227, 3765), 0),
EAST_DRAGONS("East Drags", new Location(3326, 3704, 3365, 3671), 0),
HILL_GIANTS("Hill Giants", new Location(3282, 3687, 3300, 3674), 0),
ENTS("Ents", new Location(3300, 3627, 3320, 3584), 0),
CHAOS_TEMPLE("Chaos Temple", new Location(3220, 3632, 3255, 3593), 0),
NINETEEN_OBELISK("19s", new Location(3220, 3672, 3234, 3660), 0),
CORP_CAVE("Corp Cave", new Location(3201, 3684, 3219, 3672), 0),
THIRTEEN_OBELISK("13s", new Location(3145, 3628, 3168, 3609), 0),
SOUTH_REV_ENTRANCE("Lvl 18 Rev Ent", new Location(3071, 3660, 3092, 3645), 0),
GRAVES("Graves", new Location(3128, 3686, 3181, 3658), 0),
GRAVEYARD_DRAGS("Graveyard Drags", new Location(3129, 3717, 3172, 3691), 0),
CHINS("Chins", new Location(3128, 3792, 3160, 3754), 0),
REV_ENTRANCE("Rev Entrance", new Location(3118, 3837, 3142, 3818), 0),
HOB_OBELISK("35 Obelisk", new Location(3097, 3804, 3115, 3785), 0),
HOBGOBLINS("Hobgoblins", new Location(3073, 3775, 3104, 3745), 0),
GWD("God Wars Dungeon", new Location(3010, 3745, 3027, 3727), 0),
LAVA_MAZE_TELE("Lava Maze Tele", new Location(3019, 3842, 3044, 3812), 0),
KBD_CAGE("KBD CAGE", new Location(3007, 3855, 3021, 3839), 0),
GHORROCK("44s", new Location(2973, 3870, 2987, 3859), 0),
CHAOS_FANATIC("Chaos Fanatic", new Location(2971, 3854, 2992, 3834), 0),
HIGH_ALTAR("High Altar", new Location(2945, 3826, 2970, 3813), 0),
CEMETERY("Cemetery", new Location(2956, 3767, 2996, 3736), 0),
CRAZY_ARCHAEOLOGIST("Crazy Archaeologist", new Location(2952, 3709, 2985, 3678), 0),
DARK_WARRIOR_FORTRESS("Dark Warriors", new Location(3014, 3648, 3046, 3616), 0),
WEST_DRAGONS("West Drags", new Location(2960, 3627, 2992, 3598), 0),
BANDIT_CAMP("Bandit Camp", new Location(3017, 3712, 3059, 3681), 0);
public String getName() {
return name1;
}
public WorldArea getWorldArea() {
return worldArea;
}
public static class Location {
public int x;
public int y;
public int width;
public int height;
Location(int x, int y, int x1, int y1) {
x = x;
y = y1;
width = x1 - x;
height = y - y1;
}
}
@Getter
private final String name;
@Getter
private final WorldArea worldArea;
WildernessLocation(String name, Location location, int plane)
{
this.name = name;
this.worldArea = new WorldArea(location.x, location.y, location.width, location.height, plane);
}
public static class Location
{
public int x;
public int y;
public int width;
public int height;
Location(int x, int y, int x1, int y1)
{
this.x = x;
this.y = y1;
this.width = x1 - x;
this.height = y - y1;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

View File

@@ -972,4 +972,8 @@ public interface RSClient extends RSGameEngine, Client
@Import("healthbarCache")
@Override
RSNodeCache getHealthBarCache();
@Import("renderSelf")
void toggleRenderSelf();
}