DB:Spawn Events: Difference between revisions

From EQArchives
Jump to navigationJump to search
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
The database schema for spawn events in the PEQ database is documented at https://docs.eqemu.io/schema/spawns/spawn_events/ .  However, 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.  You only need to set the unit of time (i.e. next hour or next day) and '''leave everything else set to 0'''.  A 0 value will imply the current time when the scheduler ticks.


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:
{| class="wikitable"
{| class="wikitable"
! id  
! id  
Line 47: Line 48:
|-
|-
|}
|}
=== 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]]
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).

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.