Small bug fixes with encounters, also added eq.load_encounter_with_data(encounter_name, data_string) and unload as well. Allows you to send a message via the encounter system load

This commit is contained in:
KimLS
2014-10-31 22:09:09 -07:00
parent b417e23d97
commit 1619324d06
2 changed files with 63 additions and 3 deletions
+7 -1
View File
@@ -601,6 +601,12 @@ int LuaParser::_EventEncounter(std::string package_name, QuestEventID evt, std::
lua_pushstring(L, encounter_name.c_str());
lua_setfield(L, -2, "name");
if(extra_pointers) {
std::string *str = EQEmu::any_cast<std::string*>(extra_pointers->at(0));
lua_pushstring(L, str->c_str());
lua_setfield(L, -2, "data");
}
quest_manager.StartQuest(nullptr, nullptr, nullptr);
if(lua_pcall(L, 1, 1, 0)) {
std::string error = lua_tostring(L, -1);
@@ -839,7 +845,7 @@ void LuaParser::ReloadQuests() {
if(f) {
fclose(f);
if(luaL_dofile(L, "quests/global/script_init.lua")) {
if(luaL_dofile(L, path.c_str())) {
std::string error = lua_tostring(L, -1);
AddError(error);
}