Add AoE warning plugin

This commit is contained in:
Toocanzs
2017-11-26 11:04:09 -05:00
committed by Adam
parent d0cb93c433
commit 541cf986c5
9 changed files with 660 additions and 7 deletions

View File

@@ -34,6 +34,8 @@ import net.runelite.api.MainBufferProvider;
import net.runelite.api.MenuAction;
import net.runelite.api.MessageNode;
import net.runelite.api.PacketBuffer;
import net.runelite.api.Point;
import net.runelite.api.Projectile;
import net.runelite.api.Skill;
import net.runelite.client.RuneLite;
import net.runelite.client.events.*;
@@ -186,7 +188,7 @@ public class Hooks
public static void menuActionHook(int var0, int widgetId, int menuAction, int id, String menuOption, String menuTarget, int var6, int var7)
{
/* Along the way, the RuneScape client may change a menuAction by incrementing it with 2000.
* I have no idea why, but it does. Their code contains the same conditional statement.
* I have no idea why, but it does. Their code contains the same conditional statement.
*/
if (menuAction >= 2000)
{
@@ -231,6 +233,27 @@ public class Hooks
eventBus.post(chatMessage);
}
/**
* Called when a projectile is set to move towards a point. For
* projectiles that target the ground, like AoE projectiles from
* Lizardman Shamans, this is only called once
*
* @param projectile The projectile being moved
* @param targetX X position of where the projectile is being moved to
* @param targetY Y position of where the projectile is being moved to
* @param targetZ Z position of where the projectile is being moved to
* @param cycle
*/
public static void projectileMoved(Projectile projectile, int targetX, int targetY, int targetZ, int cycle)
{
Point position = new Point(targetX, targetY);
ProjectileMoved projectileMoved = new ProjectileMoved();
projectileMoved.setProjectile(projectile);
projectileMoved.setPosition(position);
projectileMoved.setPlane(targetZ);
eventBus.post(projectileMoved);
}
public static void setMessage(MessageNode messageNode, int type, String name, String sender, String value)
{
// Hook is fired prior to actually setting these on the MessageNode, so send them