NPC queues aren’t referenced by names. They are queued by “ID” instead, this allows NPCs to override global behavior without checking NPC type in each queue.

Processing is done very similarly to players, and will not run if the queue isn’t ready or the NPC is delayed.

Command

npc_queue(id, delay, arg);

NPC queues may pass one int argument here for the queue to use. Inside the trigger, you use last_int to reference what you’ve passed..

Additional Args

Jagex has an asterisked variant of this command that lets you pass additional arguments: npc_queue*(id, delay)(args, …);

We do not support this currently, it was added later in history.

Trigger

The ai_queue trigger has 20 queue IDs available to use. The trigger’s subject is the NPC type. These queue IDs are arbitrary outside of a few conventions.

Hunt modes may be configured to run a queue when they find a target.

There are a few conventions used globally:

[ai_queue1,type] runs on retaliate - this means something has hit them and the NPC may react.

[ai_queue2,type] runs on damage - this means something has hit them and the NPC may apply that damage.

[ai_queue3,type] runs on death - this means something has dropped their health to 0 and the NPC may drop items or advance a player’s quest state.

[ai_queue8,type] runs on bind spells - this means something has hit them with a bind spell and movement should be blocked for a period of time.