DB:Spawn Events: Difference between revisions
No edit summary |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
The behavior for how these work can be somewhat confusing the first time you try to trigger NPC spawn behavior. | The behavior for how these work can be somewhat confusing the first time you try to trigger NPC spawn behavior. | ||
Spawn Events represent ''stateful'' repeat events that start and end on intervals. | Spawn Events represent ''stateful'' repeat events that start and end on intervals. | ||
=== Schema === | === Schema === | ||
The authoritative documentation for the database schema for spawn events in the PEQ database is documented at https://docs.eqemu.io/schema/spawns/spawn_events/ . Listed below for convenience: | The authoritative documentation for the database schema for spawn events in the PEQ database is documented at https://docs.eqemu.io/schema/spawns/spawn_events/ . Listed below for convenience: | ||
Line 51: | Line 50: | ||
=== Example Use === | === Example Use === | ||
The following example image shows the PEQPHPEditor interface where we show the [[DB:Spawn_Condition]] on top, and the matching Spawn Events (described here). You only need to set the unit of time (i.e. next minute and next hour) and '''leave everything else set to 0'''. A 0 value will imply the current time when the scheduler ticks, and the next time that event triggers, those values will update automatically with the next current value with respect to the periodicity you've set (i.e. next hour, next day, next year). | |||
[[Image:Example_Spawn_Event.jpg]] | [[Image:Example_Spawn_Event.jpg]] | ||
Here the behavior we are trying to achieve is for Tani N`Mar to despawn between 6 and 7pm and respawn near instantly. Whatever you set the next hour value to, the event will occur next_hour - 1. |
Latest revision as of 15:29, 29 May 2023
The behavior for how these work can be somewhat confusing the first time you try to trigger NPC spawn behavior.
Spawn Events represent stateful repeat events that start and end on intervals.
Schema
The authoritative documentation for the database schema for spawn events in the PEQ database is documented at https://docs.eqemu.io/schema/spawns/spawn_events/ . Listed below for convenience:
id | Set automatically by the dbms (auto-incrementing) |
---|---|
zone | zone short name (i.e. "neriakc" or "kithicor"); if you are using the PEQPHPEditor, this is transparent to you and doesn't need to be manually set |
cond_id | Spawn condition identifier - Set this to match the id of a spawn condition you previously added |
name | Give it a descriptive name (i.e. EnableDay, DisableDay, EnableNight, DisableNight) |
period | This integer value represents units of minutes and determines the periodicity for this event. If you want the event to occur every 24 hours, set this to 1440. |
next_minute | |
next_hour | |
next_day | |
next_month | |
next_year | |
enabled | 0 = False, 1 = True |
action | |
argument | |
strict |
Example Use
The following example image shows the PEQPHPEditor interface where we show the DB:Spawn_Condition on top, and the matching Spawn Events (described here). You only need to set the unit of time (i.e. next minute and next hour) and leave everything else set to 0. A 0 value will imply the current time when the scheduler ticks, and the next time that event triggers, those values will update automatically with the next current value with respect to the periodicity you've set (i.e. next hour, next day, next year).
Here the behavior we are trying to achieve is for Tani N`Mar to despawn between 6 and 7pm and respawn near instantly. Whatever you set the next hour value to, the event will occur next_hour - 1.