[Quest API] Add GetRandomBot() to Perl/Lua (#2543)

* [Quest API] Add GetRandomBot() to Perl/lua.

# Perl
- Add `$entity_list->GetRandomBot()` to Perl.
- Add `$entity_list->GetRandomBot(x, y, z, distance)` to Perl.
- Add `$entity_list->GetRandomBot(x, y, z, distance, exclude_bot)` to Perl.

# Lua
- Add `eq.get_entity_list():GetRandomBot()` to Lua.
- Add `eq.get_entity_list():GetRandomBot(x, y, z, distance)` to Lua.
- Add `eq.get_entity_list():GetRandomBot(x, y, z, distance, exclude_bot)` to Lua.

# Notes
- Allows operators to grab a random Bot from entity list similar to Client, Mob, and NPC.

* Cleanup and fix Perl distance.

- Perl distance was sending as already squared, Lua was not.
- Send as non-squared and square in the method so that both work the same.

* Update entity.cpp

* Update entity.cpp
This commit is contained in:
Kinglykrab
2022-11-16 18:54:15 -05:00
committed by GitHub
parent 93d8471487
commit bd95daa1f3
5 changed files with 103 additions and 12 deletions
+3
View File
@@ -136,6 +136,9 @@ public:
Lua_Bot_List GetBotList();
Lua_Bot_List GetBotListByCharacterID(uint32 character_id);
Lua_Bot_List GetBotListByClientName(std::string client_name);
Lua_Bot GetRandomBot();
Lua_Bot GetRandomBot(float x, float y, float z, float distance);
Lua_Bot GetRandomBot(float x, float y, float z, float distance, Lua_Bot exclude_bot);
#endif
};