Search in sources :

Example 1 with ProjectileMoved

use of net.runelite.api.events.ProjectileMoved in project runelite by runelite.

the class Hooks method projectileMoved.

/**
 * 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) {
    LocalPoint position = new LocalPoint(targetX, targetY);
    ProjectileMoved projectileMoved = new ProjectileMoved();
    projectileMoved.setProjectile(projectile);
    projectileMoved.setPosition(position);
    projectileMoved.setZ(targetZ);
    eventBus.post(projectileMoved);
}
Also used : LocalPoint(net.runelite.api.coords.LocalPoint) ProjectileMoved(net.runelite.api.events.ProjectileMoved)

Aggregations

LocalPoint (net.runelite.api.coords.LocalPoint)1 ProjectileMoved (net.runelite.api.events.ProjectileMoved)1