[Quest API] Add EVENT_CONSIDER to Perl and Lua. (#1531)

* [Quest API] Add EVENT_CONSIDER to Perl and Lua.
- Exports $entity_id in Perl.
- Exports e.entity_id in Lua.

Allows you to perform events on consider for server operators.

* Missing comma.

* Formatting.

* Add return capability to EVENT_CONSIDER and EVENT_CONSIDER_CORPSE so operators can break out of consider functions.
This commit is contained in:
Kinglykrab
2021-09-13 15:30:17 -04:00
committed by GitHub
parent 9589bf6bf8
commit 6e76f89ca2
7 changed files with 30 additions and 2 deletions
+7
View File
@@ -122,6 +122,7 @@ const char *QuestEventSubroutines[_LargestEventID] = {
"EVENT_BOT_COMMAND",
"EVENT_WARP",
"EVENT_TEST_BUFF",
"EVENT_CONSIDER",
"EVENT_CONSIDER_CORPSE"
};
@@ -1645,6 +1646,12 @@ void PerlembParser::ExportEventVariables(
ExportVar(package_name.c_str(), "from_z", sep.arg[2]);
break;
}
case EVENT_CONSIDER: {
ExportVar(package_name.c_str(), "entity_id", std::stoi(data));
break;
}
case EVENT_CONSIDER_CORPSE: {
ExportVar(package_name.c_str(), "corpse_entity_id", std::stoi(data));
break;