mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 11:28:25 +00:00
[Bots] Add Quest API Support for Limits. (#2522)
* [Bots] Add Quest API Support for Limits. # Perl - Add `$client->GetBotCreationLimit()` to Perl. - Add `$client->GetBotCreationLimit(class_id)` to Perl. - Add `$client->GetBotRequiredLevel()` to Perl. - Add `$client->GetBotRequiredLevel(class_id)` to Perl. - Add `$client->GetBotSpawnLimit()` to Perl. - Add `$client->GetBotSpawnLimit(class_id)` to Perl. - Add `$client->SetBotCreationLimit(creation_limit)` to Perl. - Add `$client->SetBotCreationLimit(creation_limit, class_id)` to Perl. - Add `$client->SetBotRequiredLevel(required_level)` to Perl. - Add `$client->SetBotRequiredLevel(required_level, class_id)` to Perl. - Add `$client->SetBotSpawnLimit(spawn_limit)` to Perl. - Add `$client->SetBotSpawnLimit(spawn_limit, class_id)` to Perl. - Add `$entity_list->GetBotListByCharacterID(character_id, class_id)` to Perl. # Lua - Add `client:GetBotCreationLimit()` to Lua. - Add `client:GetBotCreationLimit(class_id)` to Lua. - Add `client:GetBotRequiredLevel()` to Lua. - Add `client:GetBotRequiredLevel(class_id)` to Lua. - Add `client:GetBotSpawnLimit()` to Lua. - Add `client:GetBotSpawnLimit(class_id)` to Lua. - Add `client:SetBotCreationLimit(creation_limit)` to Lua. - Add `client:SetBotCreationLimit(creation_limit, class_id)` to Lua. - Add `client:SetBotRequiredLevel(required_level)` to Lua. - Add `client:SetBotRequiredLevel(required_level, class_id)` to Lua. - Add `client:SetBotSpawnLimit(spawn_limit)` to Lua. - Add `client:SetBotSpawnLimit(spawn_limit, class_id)` to Lua. - Add `entity_list:GetBotListByCharacterID(character_id, class_id)` to Lua. # Notes - Allows operators to set creation and spawn limits based on class, as well as required level. - Using the class-inspecific methods sets the global limit or required level. - Global limits are checked prior to class-specific limits and if they are not met, creation or spawn is disallowed. - Modified preexisting Quest API to make use of this new stuff under the hood. * Update bot_command.cpp * Add client bot file.
This commit is contained in:
@@ -413,6 +413,20 @@ Lua_Bot_List Lua_EntityList::GetBotListByCharacterID(uint32 character_id) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
Lua_Bot_List Lua_EntityList::GetBotListByCharacterID(uint32 character_id, uint8 class_id) {
|
||||
Lua_Safe_Call_Class(Lua_Bot_List);
|
||||
Lua_Bot_List ret;
|
||||
auto bot_list = self->GetBotListByCharacterID(character_id, class_id);
|
||||
|
||||
if (bot_list.size()) {
|
||||
for (auto bot : bot_list) {
|
||||
ret.entries.push_back(Lua_Bot(bot));
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Lua_Bot_List Lua_EntityList::GetBotListByClientName(std::string client_name) {
|
||||
Lua_Safe_Call_Class(Lua_Bot_List);
|
||||
Lua_Bot_List ret;
|
||||
@@ -607,6 +621,7 @@ luabind::scope lua_register_entity_list() {
|
||||
.def("GetBotByName", (Lua_Bot(Lua_EntityList::*)(std::string))&Lua_EntityList::GetBotByName)
|
||||
.def("GetBotList", (Lua_Bot_List(Lua_EntityList::*)(void))&Lua_EntityList::GetBotList)
|
||||
.def("GetBotListByCharacterID", (Lua_Bot_List(Lua_EntityList::*)(uint32))&Lua_EntityList::GetBotListByCharacterID)
|
||||
.def("GetBotListByCharacterID", (Lua_Bot_List(Lua_EntityList::*)(uint32,uint8))&Lua_EntityList::GetBotListByCharacterID)
|
||||
.def("GetBotListByClientName", (Lua_Bot_List(Lua_EntityList::*)(std::string))&Lua_EntityList::GetBotListByClientName)
|
||||
#endif
|
||||
.def("GetClientByAccID", (Lua_Client(Lua_EntityList::*)(uint32))&Lua_EntityList::GetClientByAccID)
|
||||
|
||||
Reference in New Issue
Block a user