Jump to content

[Script] Event for Distance


Recommended Posts

I don't think there's an event, but you can make your own. Make a spell ability and put it on the NPC. Have the condition GetDistance() > SomeNumber on the spell. Then use the OnEffectStart event on the spells magic effect. The magic effect will become active when the NPC is far enough away from the player.

Link to comment
Share on other sites

Register the event (note that it registers for a single event, if you want to check for every time you need to re-register)

RegisterForDistanceLessThanEvent

Then catch the event (and re-register if needed)

OnDistanceLessThan

 

You may want to combine those with

RegisterForDistanceGreaterThanEvent

and

OnDistanceGreaterThan

 

The way I see it, you need to register for distance less than and distance greater than, and in OnDistanceGraterThan call RegisterForDistanceLessThan and vice versa (remember those register functions only register for one event so you need to re-register again once the event is triggered), so you you can use OnDistanceGreaterThan and OnDistanceLessThan like OnTriggerLeave and OnTriggerEnter.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...