Difference between revisions of "@NpcActCast"
From SphereWiki
Line 1: | Line 1: | ||
==Description== | ==Description== | ||
− | This trigger is fired when the NPC is about to select | + | This trigger is fired when the NPC is about to select a[[spell]] to cast. |
+ | When assigning spells to a NPC make sure these spells does not have the SPELLFLAG_PLAYERONLY flag. | ||
Line 31: | Line 32: | ||
|- | |- | ||
| ARGN2 || O || If 1 the spell is being cast by a wand. (If the NPC is wielding a wand it has a 50% chance to cast the spell from the wand instead of the spellbook. | | ARGN2 || O || If 1 the spell is being cast by a wand. (If the NPC is wielding a wand it has a 50% chance to cast the spell from the wand instead of the spellbook. | ||
− | |} | + | |- |
+ | | local.healthreshold || IO || This value determines at what health threshold (in percent) the NPC will successfully select a [[spell]] with the SPELLFLAG_HEAL flag. The value is taken from the [[sphere.ini]] property NPCHealThreshold and the default value is 30. | ||
+ | |} | ||
==Return Values== | ==Return Values== |
Revision as of 19:48, 3 January 2023
Description
This trigger is fired when the NPC is about to select aspell to cast. When assigning spells to a NPC make sure these spells does not have the SPELLFLAG_PLAYERONLY flag.
Fires on:
References
The following object references are explicitly available for this trigger:
Name | Description |
ARGO | The current NPC's target. |
I | The NPC caster. |
SRC | The NPC caster. |
REF1 | The new target, this will override the target set on ARGO. |
Arguments
The following arguments are set for this trigger. If an argument is marked as "In" then a value will be passed in to the trigger, if an argument is marked as "Out" then it can be set to a value to affect Sphere's behaviour:
Argument | In/Out | Description |
ARGN1 | IO | The spell being cast, this can be a spell not found in the NPC's spellbook. |
ARGN2 | O | If 1 the spell is being cast by a wand. (If the NPC is wielding a wand it has a 50% chance to cast the spell from the wand instead of the spellbook. |
local.healthreshold | IO | This value determines at what health threshold (in percent) the NPC will successfully select a spell with the SPELLFLAG_HEAL flag. The value is taken from the sphere.ini property NPCHealThreshold and the default value is 30. |
Return Values
The following return values are explicitly defined for this trigger:
Return Value | Description |
1 | Interrupts the spell selection. |