Jump to content

Want to add abilities to NPCs in an area


Recommended Posts

I'm trying to figure out a way to add spell effects to NPCs in the area of the Player, depending on the conditions defined in a script. Imagine a magic necklace that will weaken all NPCs in the area without the Player having to do anything but wear it. But I cannot figure out how to do this.

 

My best guess so far was to frequently place an activator box around the Player. And use GetStandingActor to detect when an NPC is inside it. But even after that, I don't know of a way to apply effects to the NPCs when this happens. Maybe I could also make the same activator cast an AoE spell when this happens, but that would mean constant spell castings and that's certainly no good.

 

Any ideas?

Link to comment
Share on other sites

  • 3 weeks later...

That would require a script on every NPC mate.

 

 

i.e.

 

Short once

 

If ( GetDistance Player < 256 )

if ( once == 0 )

AddSpell xxxxx ; (Curse)

Set once to 1

endif

Elseif ( GetDistance Player > 256)

if ( once == 1 )

RemoveSpell xxxx

endif

Endif

Edited by RubberMan01
Link to comment
Share on other sites

  • 1 month later...
  • Recently Browsing   0 members

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