Jump to content

Make a creature cast a spell every X seconds


Mindmaster

Recommended Posts

Basically, I am trying to make a certain NPC cast a spell every X seconds in lua. It seems there are multiple ways to get this to happen, but the problem is that when it calls back to my function it won't know which creature initiated the event and there can be many of the same. So event if I do:

-- casts the spell every 15 seconds up to 5 times

cancel=creature:RegisterEvent(castspell,15000,5)

How do I figure out which of the guys is casting it? (This is important because I would want to remove these events if the npc dies, and have the npc in particular cast the spell.)

castspell would have to accept no variables as parameters, so is there a way to do this without the complexity?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use