mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-22 12:18:27 +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:
@@ -615,6 +615,11 @@ std::string Perl_Bot_GetRaceAbbreviation(Bot* self)
|
||||
return GetPlayerRaceAbbreviation(self->GetBaseRace());
|
||||
}
|
||||
|
||||
void Perl_Bot_DeleteBot(Bot* self) // @categories Script Utility
|
||||
{
|
||||
self->DeleteBot();
|
||||
}
|
||||
|
||||
void perl_register_bot()
|
||||
{
|
||||
perl::interpreter state(PERL_GET_THX);
|
||||
@@ -655,6 +660,7 @@ void perl_register_bot()
|
||||
package.add("CountAugmentEquippedByID", &Perl_Bot_CountAugmentEquippedByID);
|
||||
package.add("CountBotItem", &Perl_Bot_CountBotItem);
|
||||
package.add("CountItemEquippedByID", &Perl_Bot_CountItemEquippedByID);
|
||||
package.add("DeleteBot", (void(*)(Bot*)) &Perl_Bot_DeleteBot);
|
||||
package.add("Escape", &Perl_Bot_Escape);
|
||||
package.add("Fling", (void(*)(Bot*, float, float, float))&Perl_Bot_Fling);
|
||||
package.add("Fling", (void(*)(Bot*, float, float, float, bool))&Perl_Bot_Fling);
|
||||
|
||||
Reference in New Issue
Block a user