Created page with "The `ai_queue` trigger has 20 different queues available to use. The trigger’s subject is the NPC type. 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 pl..."
 
 
(11 intermediate revisions by one other user not shown)
Line 1: Line 1:
The `ai_queue` trigger has 20 different queues available to use. The trigger’s subject is the NPC type.
NPC queues don’t use names like player queues. They are queued by “ID” instead, to allow NPCs to override global behavior without checking NPC type in each queue.


There are a few conventions used globally:
Processing is done very similarly to players and will not run if the queue isn’t ready to execute or the NPC is delayed.  
[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.
== Command ==
<code>npc_queue(id, delay, arg);</code>


[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.
''An active NPC pointer must be set!''


[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.
Developers may pass one int argument here to use when it runs.


Outside of these conventions, developers may use any queue “ID” to handle special logic.
==== Additional Args ====
We do not support this - for documentation purposes only:


Hunts may be configured to run queues when they find a target.
Jagex has an asterisked variant of this command that lets you pass additional arguments: <code>npc_queue*(id, delay)(args, …);</code>
 
== Trigger ==
The <code>ai_queue</code> trigger has 20 queue IDs available to use. The trigger’s subject is the NPC type. It looks like <code>[ai_queueID,type]</code>.
 
When the trigger runs you may use <code>last_int</code> to reference the arg passed to the queue.
 
==== Conventions ====
These queue IDs are arbitrary outside of a few conventions:
 
<code>[ai_queue1,type]</code> runs on '''retaliate''' - this means something has hit them and will set their mode to attack back.
 
<code>[ai_queue2,type]</code> runs on '''damage''' - this means something has hit them and damage is being applied.
 
<code>[ai_queue3,type]</code> runs on '''death''' - this means something has dropped their health to 0 and will drop items, or advance a player’s quest state.
 
<code>[ai_queue8,type]</code> runs on '''bind spells''' - this means something has hit them with a bind spell and movement will be blocked for a period of time.
 
== Hunt Modes ==
Hunt modes may be configured to run a queue when they find a target.
 
This allows a developer to implement extra logic before deciding (or not deciding) to attack.

Latest revision as of 19:57, 12 January 2025

NPC queues don’t use names like player queues. They are queued by “ID” instead, to allow 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 to execute or the NPC is delayed.

Command edit edit source

npc_queue(id, delay, arg);

An active NPC pointer must be set!

Developers may pass one int argument here to use when it runs.

Additional Args edit edit source

We do not support this - for documentation purposes only:

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

Trigger edit edit source

The ai_queue trigger has 20 queue IDs available to use. The trigger’s subject is the NPC type. It looks like [ai_queueID,type].

When the trigger runs you may use last_int to reference the arg passed to the queue.

Conventions edit edit source

These queue IDs are arbitrary outside of a few conventions:

[ai_queue1,type] runs on retaliate - this means something has hit them and will set their mode to attack back.

[ai_queue2,type] runs on damage - this means something has hit them and damage is being applied.

[ai_queue3,type] runs on death - this means something has dropped their health to 0 and will 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 will be blocked for a period of time.

Hunt Modes edit edit source

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

This allows a developer to implement extra logic before deciding (or not deciding) to attack.