mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +00:00
Add EVENT_TICK for NPCs
This event fires at the start of the tick processing so we can script on the actual tick.
This commit is contained in:
parent
1fc23beb78
commit
fe0758c984
@ -113,7 +113,8 @@ const char *QuestEventSubroutines[_LargestEventID] = {
|
||||
"EVENT_LEAVE_AREA",
|
||||
"EVENT_RESPAWN",
|
||||
"EVENT_DEATH_COMPLETE",
|
||||
"EVENT_UNHANDLED_OPCODE"
|
||||
"EVENT_UNHANDLED_OPCODE",
|
||||
"EVENT_TICK"
|
||||
};
|
||||
|
||||
PerlembParser::PerlembParser() : perl(nullptr) {
|
||||
|
||||
@ -82,6 +82,7 @@ typedef enum {
|
||||
EVENT_RESPAWN,
|
||||
EVENT_DEATH_COMPLETE,
|
||||
EVENT_UNHANDLED_OPCODE,
|
||||
EVENT_TICK,
|
||||
|
||||
_LargestEventID
|
||||
} QuestEventID;
|
||||
|
||||
@ -1713,7 +1713,8 @@ luabind::scope lua_register_events() {
|
||||
luabind::value("enter_area", static_cast<int>(EVENT_ENTER_AREA)),
|
||||
luabind::value("leave_area", static_cast<int>(EVENT_LEAVE_AREA)),
|
||||
luabind::value("death_complete", static_cast<int>(EVENT_DEATH_COMPLETE)),
|
||||
luabind::value("unhandled_opcode", static_cast<int>(EVENT_UNHANDLED_OPCODE))
|
||||
luabind::value("unhandled_opcode", static_cast<int>(EVENT_UNHANDLED_OPCODE)),
|
||||
luabind::value("tick", static_cast<int>(EVENT_TICK))
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -116,7 +116,8 @@ const char *LuaEvents[_LargestEventID] = {
|
||||
"event_leave_area",
|
||||
"event_respawn",
|
||||
"event_death_complete",
|
||||
"event_unhandled_opcode"
|
||||
"event_unhandled_opcode",
|
||||
"event_tick"
|
||||
};
|
||||
|
||||
extern Zone *zone;
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
#include "string_ids.h"
|
||||
#include "spawn2.h"
|
||||
#include "zone.h"
|
||||
#include "quest_parser_collection.h"
|
||||
|
||||
#include <cctype>
|
||||
#include <stdio.h>
|
||||
@ -601,6 +602,7 @@ bool NPC::Process()
|
||||
|
||||
if(tic_timer.Check())
|
||||
{
|
||||
parse->EventNPC(EVENT_TICK, this, nullptr, "", 0);
|
||||
BuffProcess();
|
||||
|
||||
if(curfp)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user