RegisterCreatureEvent specifying multiple creatures in Lua script

137 Views Asked by At

In "RegisterCreatureEvent( entry, event, function )", it defines entry as "The ID of one or more Creatures". How do I go about specifying multiple creatures?

Edit: It was pointed out to me that creatures is plural because there can be more than one copy of a creature spawned in the world. You cannot specify multiple entries in RegisterCreatureEvent.

1

There are 1 best solutions below

0
Piglet On

The library implements the id only as a number, so you cannot provide multiple ids in a table.

https://github.com/ElunaLuaEngine/Eluna/blob/8f5c4699b2531c408b615f55270541a7267c742b/GlobalMethods.h

You should try to use Creature familiy ids here.

http://elunaluaengine.github.io/Creature/GetCreatureFamily.html

CREATURE_FAMILY_VOIDWALKER can perhaps be used to register events for all voidwalkers.

But that's just a guess from reading the docs and some sourcode. I have no way to test this.