View Single Post
  #1  
Old 10-11-2018, 03:30 AM
greyfox8888
Fire Beetle
 
Join Date: Feb 2009
Location: eq
Posts: 5
Default Need NPC to trigger iff it's in melee range

EDIT: Sorry I meant to post this in Quest: Q&A ...

I am working on an encounter in which the boss picks a random target from its hate list and summons an add which immediately begins to path/attack that target.

Now for the part that I am unsure about. I would like the add to cast an AOE spell and then depop the moment it gets into melee range of its target. You can think of the add acting like a homing missile which detonates on impact. The goal being that the players must kite the adds and never get within melee range or they go boom.

Is there someway to trigger an event only when the mob is in melee range of its target?

EVENT_AGGRO, and EVENT_COMBAT trigger right when the add is assigned a target on the hate list. I have tried using IF ($npc->IsEngaged()), but that triggers the same time EVENT_COMBAT triggers. I have also tried setting up a timer that would update a proximity around the add. That method kind of worked but was really inconsistent. I figure the 1 second delay to check proximity just isn't the best option for checking melee range of 2 moving mobs (add, and target).

Any ideas on how to implement this would be greatly appreciated. I am new to this so it wouldn't surprise me if there is a plugin or something of the likes
that I have totally over looked. Anything that can help me trigger an event once a mob is within melee range, or has dealt X amount of damage to an NPC would be perfect.
Reply With Quote