Update to encounter timers so they can actually work from hooked events

This commit is contained in:
Russell Kinasz
2015-06-05 12:23:42 -07:00
parent dbd07106d7
commit 0b17dc73f1
7 changed files with 76 additions and 14 deletions
+11 -4
View File
@@ -22,6 +22,7 @@
#include "lua_door.h"
#include "lua_object.h"
#include "lua_packet.h"
#include "lua_encounter.h"
#include "zone.h"
#include "lua_parser_events.h"
@@ -704,14 +705,20 @@ void handle_spell_null(QuestInterface *parse, lua_State* L, NPC* npc, Client* cl
std::vector<EQEmu::Any> *extra_pointers) {
}
void handle_encounter_timer(QuestInterface *parse, lua_State* L, std::string data, uint32 extra_data,
void handle_encounter_timer(QuestInterface *parse, lua_State* L, Encounter* encounter, std::string data, uint32 extra_data,
std::vector<EQEmu::Any> *extra_pointers) {
lua_pushstring(L, data.c_str());
lua_setfield(L, -2, "timer");
}
void handle_encounter_load(QuestInterface *parse, lua_State* L, std::string data, uint32 extra_data,
void handle_encounter_load(QuestInterface *parse, lua_State* L, Encounter* encounter, std::string data, uint32 extra_data,
std::vector<EQEmu::Any> *extra_pointers) {
if (encounter) {
Lua_Encounter l_enc(encounter);
luabind::adl::object l_enc_o = luabind::adl::object(L, l_enc);
l_enc_o.push(L);
lua_setfield(L, -2, "encounter");
}
if (extra_pointers) {
std::string *str = EQEmu::any_cast<std::string*>(extra_pointers->at(0));
lua_pushstring(L, str->c_str());
@@ -719,7 +726,7 @@ void handle_encounter_load(QuestInterface *parse, lua_State* L, std::string data
}
}
void handle_encounter_unload(QuestInterface *parse, lua_State* L, std::string data, uint32 extra_data,
void handle_encounter_unload(QuestInterface *parse, lua_State* L, Encounter* encounter, std::string data, uint32 extra_data,
std::vector<EQEmu::Any> *extra_pointers) {
if (extra_pointers) {
std::string *str = EQEmu::any_cast<std::string*>(extra_pointers->at(0));
@@ -728,7 +735,7 @@ void handle_encounter_unload(QuestInterface *parse, lua_State* L, std::string da
}
}
void handle_encounter_null(QuestInterface *parse, lua_State* L, std::string data, uint32 extra_data,
void handle_encounter_null(QuestInterface *parse, lua_State* L, Encounter* encounter, std::string data, uint32 extra_data,
std::vector<EQEmu::Any> *extra_pointers) {
}