mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
[Bots] Add support for Bot scripting. (#2515)
* [Bots] Add support for Bot scripting. # Perl - Add support for `zone/bot.pl` and `zone/bot_v#.pl`. - Add support for `global/global_bot.pl`. - Add `$bot->SignalBot(signal_id)` to Perl. - Add `$bot->OwnerMessage(message)` to Perl. - Add `$entity_list->SignalAllBotsByOwnerCharacterID(character_id, signal_id)` to Perl. - Add `$entity_list->SignalBotByBotID(bot_id, signal_id)` to Perl. - Add `$entity_list->SignalBotByBotName(bot_name, signal_id)` to Perl. - Add `EVENT_SPELL_EFFECT_BOT` to Perl. - Add `EVENT_SPELL_EFFECT_BUFF_TIC_BOT` to Perl. # Lua - Add support for `zone/bot.lua` and `zone/bot_v#.lua`. - Add support for `global/global_bot.lua`. - Add `bot:SignalBot(signal_id)` to Lua. - Add `bot:OwnerMessage(message)` to Lua. - Add `entity_list:SignalAllBotsByOwnerCharacterID(character_id, signal_id)` to Lua. - Add `entity_list:SignalBotByBotID(bot_id, signal_id)` to Lua. - Add `entity_list:SignalBotByBotName(bot_name, signal_id)` to Lua. - Add `EVENT_SPELL_EFFECT_BOT` to Lua. - Add `EVENT_SPELL_EFFECT_BUFF_TIC_BOT` to Lua. # Supported Bot Events 1. `EVENT_CAST` 2. `EVENT_CAST_BEGIN` 3. `EVENT_CAST_ON` 4. `EVENT_COMBAT` 5. `EVENT_DEATH` 6. `EVENT_DEATH_COMPLETE` 7. `EVENT_SAY` 8. `EVENT_SIGNAL` 9. `EVENT_SLAY` 10. `EVENT_SLAY_NPC` 11. `EVENT_SPAWN` 12. `EVENT_TARGET_CHANGE` 13. `EVENT_TIMER` 14. `EVENT_USE_SKILL` # Common - Convert NPC pointers in common events to Mob pointers so bots are supported. - Convert signal IDs to `int` where it wasn't already, allowing negative signals to be sent properly. * Add EVENT_POPUP_RESPONSE. * Cleanup and fix EVENT_COMBAT/EVENT_SLAY/EVENT_NPC_SLAY. * Fix DoNPCEmote calls. * Update attack.cpp * Update event_codes.h * Update bot_command.cpp
This commit is contained in:
@@ -449,6 +449,21 @@ perl::array Perl_EntityList_GetBotListByClientName(EntityList* self, std::string
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void Perl_EntityList_SignalAllBotsByOwnerCharacterID(EntityList* self, uint32_t character_id, int signal_id) // @categories Script Utility
|
||||
{
|
||||
entity_list.SignalAllBotsByOwnerCharacterID(character_id, signal_id);
|
||||
}
|
||||
|
||||
void Perl_EntityList_SignalBotByBotID(EntityList* self, uint32_t bot_id, int signal_id) // @categories Script Utility
|
||||
{
|
||||
entity_list.SignalBotByBotID(bot_id, signal_id);
|
||||
}
|
||||
|
||||
void Perl_EntityList_SignalBotByBotName(EntityList* self, std::string bot_name, int signal_id) // @categories Script Utility
|
||||
{
|
||||
entity_list.SignalBotByBotName(bot_name, signal_id);
|
||||
}
|
||||
#endif
|
||||
|
||||
perl::array Perl_EntityList_GetNPCList(EntityList* self) // @categories Script Utility
|
||||
@@ -675,7 +690,14 @@ void perl_register_entitylist()
|
||||
package.add("RemoveObject", &Perl_EntityList_RemoveObject);
|
||||
package.add("RemoveTrap", &Perl_EntityList_RemoveTrap);
|
||||
package.add("ReplaceWithTarget", &Perl_EntityList_ReplaceWithTarget);
|
||||
#ifdef BOTS
|
||||
package.add("SignalAllBotsByOwnerCharacterID", &Perl_EntityList_SignalAllBotsByOwnerCharacterID);
|
||||
#endif
|
||||
package.add("SignalAllClients", &Perl_EntityList_SignalAllClients);
|
||||
#ifdef BOTS
|
||||
package.add("SignalBotByBotID", &Perl_EntityList_SignalBotByBotID);
|
||||
package.add("SignalBotByBotName", &Perl_EntityList_SignalBotByBotName);
|
||||
#endif
|
||||
package.add("SignalMobsByNPCID", &Perl_EntityList_SignalMobsByNPCID);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user