[Quest API] Add Entity Variable Methods to Perl/Lua. (#2579)

* [Quest API] Add Entity Variable Methods to Perl/Lua.

# Perl
- Add `$mob->GetEntityVariables()`.
- Add `$object->GetEntityVariables()`.

# Lua
- Add `mob:GetEntityVariables()`.
- Add `object:GetEntityVariables()`.

# Notes
- Convert all overloads and methods to use `std::string` for entity variables.
- Allows operators to get a list of a Mob's entity variables.

* Update loottables.cpp
This commit is contained in:
Alex King
2022-11-26 16:24:01 -05:00
committed by GitHub
parent 290ebf3b26
commit 31d57342e1
17 changed files with 231 additions and 144 deletions
+7 -3
View File
@@ -5829,9 +5829,13 @@ int EntityList::MovePlayerCorpsesToGraveyard(bool force_move_from_instance)
}
void EntityList::DespawnGridNodes(int32 grid_id) {
for (auto mob_iterator : mob_list) {
Mob *mob = mob_iterator.second;
if (mob->IsNPC() && mob->GetRace() == 2254 && mob->EntityVariableExists("grid_id") && atoi(mob->GetEntityVariable("grid_id")) == grid_id) {
for (auto m : mob_list) {
Mob *mob = m.second;
if (
mob->IsNPC() &&
mob->GetRace() == 2254 &&
mob->EntityVariableExists("grid_id") &&
std::stoi(mob->GetEntityVariable("grid_id")) == grid_id) {
mob->Depop();
}
}