mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 05:08:26 +00:00
[Quest API] Add DeleteBot() to Perl/Lua (#4167)
### Perl
- Add $bot->DeleteBot().
```
sub EVENT_SAY {
if ($text =~/#deletebot/i && $client->Admin() >= 100) {
my @bot_list = $entity_list->GetBotList();
foreach $ent (@bot_list) {
if ($ent) {
quest::shout("Deleting " . $ent->GetCleanName());
$ent->DeleteBot();
$ent->Camp(0);
}
}
}
}
```
### Lua
- Add bot:DeleteBot().
```
function event_say(e)
if(e.message:findi("#deletebot")) then
local bot_list = eq.get_entity_list():GetBotList();
for ent in bot_list.entries do
if (ent) then
e.self:Message(7,"Deleting " .. ent:GetCleanName() .. "");
ent:DeleteBot();
ent:Camp(false);
end
end
end
end
```
### Notes
- Allows operators to delete bots.
This commit is contained in:
@@ -659,6 +659,11 @@ void Lua_Bot::SetBucket(std::string bucket_name, std::string bucket_value, std::
|
||||
self->SetBucket(bucket_name, bucket_value, expiration);
|
||||
}
|
||||
|
||||
void Lua_Bot::DeleteBot() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->DeleteBot();
|
||||
}
|
||||
|
||||
luabind::scope lua_register_bot() {
|
||||
return luabind::class_<Lua_Bot, Lua_Mob>("Bot")
|
||||
.def(luabind::constructor<>())
|
||||
@@ -698,6 +703,7 @@ luabind::scope lua_register_bot() {
|
||||
.def("ClearSpellRecastTimer", (void(Lua_Bot::*)(uint16))&Lua_Bot::ClearSpellRecastTimer)
|
||||
.def("CountBotItem", (uint32(Lua_Bot::*)(uint32))&Lua_Bot::CountBotItem)
|
||||
.def("CountItemEquippedByID", (int(Lua_Bot::*)(uint32))&Lua_Bot::CountItemEquippedByID)
|
||||
.def("DeleteBot", (void(Lua_Bot::*)(void))&Lua_Bot::DeleteBot)
|
||||
.def("DeleteBucket", (void(Lua_Bot::*)(std::string))&Lua_Bot::DeleteBucket)
|
||||
.def("Escape", (void(Lua_Bot::*)(void))&Lua_Bot::Escape)
|
||||
.def("Fling", (void(Lua_Bot::*)(float,float,float))&Lua_Bot::Fling)
|
||||
|
||||
Reference in New Issue
Block a user