-
Notifications
You must be signed in to change notification settings - Fork 0
Integration: Citizens
Timothé ROSAZ edited this page May 17, 2025
·
2 revisions
Citizens is a all-purpose NPC service for your servers.
This trait will allow you to :
- Make an NPC cast a spell on demand (
/spellcaster cast <spell_id>). - Add an automatic spell cast, with a cooldown and a condition.
The first point is trivial, so let's fous here on the second one.
If you have an NPC, and you want it to cast a spell. First, select it (/npc sel).
/spellcaster add <spell_id> [cooldown] [condition]
- The spell ID is mandatory and must be valid.
- The cooldown is optional.
- The format is
<amount><time_unit>. The allowed units are:- Hours : '
h', - Minutes : '
m', - Seconds : '
s', - Ticks : '
t'.
- Hours : '
- Examples:
30s,600t,20m, ...
- The condition must be a valid USS expression. The return value may be a boolean or a number (in which case all non-zeroes values will be considered as
false).
-
Once the cooldown is over, the NPC will periodically try to check if its condition is valid (i.e. returns
true). When it's the case, the corresponding spell will be cast, and the cooldown will be applied. -
A spellcaster may have an unlimited amount of spells to cast.
-
All spell cooldowns are distincts.
-
You can add quotes around the condition, to make it more readable.
- Cast a fire-ball when a player is around
/spellcaster add fireball 30s "sizeof(all players within 6 around %caster) > 0"
- Cast a heal when HP are below 12
/spellcaster add big_heal 2m "get_health(%caster)<=12"