mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
* [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
151 lines
5.3 KiB
C++
151 lines
5.3 KiB
C++
#ifndef EQEMU_LUA_ENTITY_LIST_H
|
|
#define EQEMU_LUA_ENTITY_LIST_H
|
|
#ifdef LUA_EQEMU
|
|
|
|
#include "lua_ptr.h"
|
|
|
|
class EntityList;
|
|
class Lua_Mob;
|
|
class Lua_Client;
|
|
#ifdef BOTS
|
|
class Lua_Bot;
|
|
#endif
|
|
class Lua_NPC;
|
|
class Lua_Door;
|
|
class Lua_Corpse;
|
|
class Lua_Object;
|
|
class Lua_Group;
|
|
class Lua_Raid;
|
|
class Lua_Spawn;
|
|
struct Lua_Mob_List;
|
|
struct Lua_Client_List;
|
|
#ifdef BOTS
|
|
struct Lua_Bot_List;
|
|
#endif
|
|
struct Lua_NPC_List;
|
|
struct Lua_Corpse_List;
|
|
struct Lua_Object_List;
|
|
struct Lua_Doors_List;
|
|
struct Lua_Spawn_List;
|
|
|
|
namespace luabind {
|
|
struct scope;
|
|
}
|
|
|
|
luabind::scope lua_register_entity_list();
|
|
luabind::scope lua_register_mob_list();
|
|
luabind::scope lua_register_client_list();
|
|
luabind::scope lua_register_npc_list();
|
|
luabind::scope lua_register_corpse_list();
|
|
luabind::scope lua_register_object_list();
|
|
luabind::scope lua_register_door_list();
|
|
luabind::scope lua_register_spawn_list();
|
|
|
|
#ifdef BOTS
|
|
luabind::scope lua_register_bot_list();
|
|
#endif
|
|
|
|
class Lua_EntityList : public Lua_Ptr<EntityList>
|
|
{
|
|
typedef EntityList NativeType;
|
|
public:
|
|
Lua_EntityList() : Lua_Ptr(nullptr) { }
|
|
Lua_EntityList(EntityList *d) : Lua_Ptr(d) { }
|
|
virtual ~Lua_EntityList() { }
|
|
|
|
operator EntityList*() {
|
|
return reinterpret_cast<EntityList*>(GetLuaPtrData());
|
|
}
|
|
|
|
Lua_Mob GetMobID(int id);
|
|
Lua_Mob GetMob(const char *name);
|
|
Lua_Mob GetMob(int id);
|
|
Lua_Mob GetMobByNpcTypeID(int npc_type);
|
|
bool IsMobSpawnedByNpcTypeID(int npc_type);
|
|
Lua_NPC GetNPCByID(int id);
|
|
Lua_NPC GetNPCByNPCTypeID(int npc_type);
|
|
Lua_NPC GetNPCBySpawnID(uint32 spawn_id);
|
|
Lua_Client GetClientByName(const char *name);
|
|
Lua_Client GetClientByAccID(uint32 acct_id);
|
|
Lua_Client GetClientByID(int id);
|
|
Lua_Client GetClientByCharID(uint32 char_id);
|
|
Lua_Client GetClientByWID(uint32 wid);
|
|
Lua_Object GetObjectByID(int id);
|
|
Lua_Object GetObjectByDBID(uint32 db_id);
|
|
Lua_Door GetDoorsByID(int id);
|
|
Lua_Door GetDoorsByDBID(uint32 db_id);
|
|
Lua_Door GetDoorsByDoorID(uint32 door_id);
|
|
Lua_Door FindDoor(uint32 id);
|
|
Lua_Group GetGroupByMob(Lua_Mob mob);
|
|
Lua_Group GetGroupByClient(Lua_Client client);
|
|
Lua_Group GetGroupByID(int id);
|
|
Lua_Group GetGroupByLeaderName(const char *name);
|
|
Lua_Raid GetRaidByID(int id);
|
|
Lua_Raid GetRaidByClient(Lua_Client client);
|
|
Lua_Corpse GetCorpseByOwner(Lua_Client client);
|
|
Lua_Corpse GetCorpseByID(int id);
|
|
Lua_Corpse GetCorpseByName(const char *name);
|
|
Lua_Spawn GetSpawnByID(uint32 id);
|
|
void ClearClientPetitionQueue();
|
|
bool CanAddHateForMob(Lua_Mob p);
|
|
void Marquee(uint32 type, std::string message);
|
|
void Marquee(uint32 type, std::string message, uint32 duration);
|
|
void Marquee(uint32 type, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, std::string message);
|
|
void Message(uint32 guild_dbid, uint32 type, const char *message);
|
|
void MessageStatus(uint32 guild_dbid, int min_status, uint32 type, const char *message);
|
|
void MessageClose(Lua_Mob sender, bool skip_sender, float dist, uint32 type, const char *message);
|
|
void FilteredMessageClose(Lua_Mob sender, bool skip_sender, float dist, uint32 type, int filter, const char *message);
|
|
void RemoveFromTargets(Lua_Mob mob);
|
|
void RemoveFromTargets(Lua_Mob mob, bool RemoveFromXTargets);
|
|
void ReplaceWithTarget(Lua_Mob target, Lua_Mob new_target);
|
|
void OpenDoorsNear(Lua_Mob opener);
|
|
std::string MakeNameUnique(const char *name);
|
|
std::string RemoveNumbers(const char *name);
|
|
void SignalMobsByNPCID(uint32 npc_id, int signal);
|
|
uint32 DeleteNPCCorpses();
|
|
uint32 DeletePlayerCorpses();
|
|
void HalveAggro(Lua_Mob who);
|
|
void DoubleAggro(Lua_Mob who);
|
|
void ClearFeignAggro(Lua_Mob who);
|
|
bool Fighting(Lua_Mob who);
|
|
void RemoveFromHateLists(Lua_Mob who);
|
|
void RemoveFromHateLists(Lua_Mob who, bool set_to_one);
|
|
void MessageGroup(Lua_Mob who, bool skip_close, uint32 type, const char *message);
|
|
Lua_Client GetRandomClient();
|
|
Lua_Client GetRandomClient(float x, float y, float z, float distance);
|
|
Lua_Client GetRandomClient(float x, float y, float z, float distance, Lua_Client exclude_client);
|
|
Lua_Mob GetRandomMob();
|
|
Lua_Mob GetRandomMob(float x, float y, float z, float distance);
|
|
Lua_Mob GetRandomMob(float x, float y, float z, float distance, Lua_Mob exclude_mob);
|
|
Lua_NPC GetRandomNPC();
|
|
Lua_NPC GetRandomNPC(float x, float y, float z, float distance);
|
|
Lua_NPC GetRandomNPC(float x, float y, float z, float distance, Lua_NPC exclude_npc);
|
|
Lua_Mob_List GetMobList();
|
|
Lua_Client_List GetClientList();
|
|
Lua_Client_List GetShuffledClientList();
|
|
Lua_NPC_List GetNPCList();
|
|
Lua_Corpse_List GetCorpseList();
|
|
Lua_Object_List GetObjectList();
|
|
Lua_Doors_List GetDoorsList();
|
|
Lua_Spawn_List GetSpawnList();
|
|
void SignalAllClients(int signal);
|
|
void ChannelMessage(Lua_Mob from, int channel_num, int language, const char *message);
|
|
#ifdef BOTS
|
|
Lua_Bot GetBotByID(uint32 bot_id);
|
|
Lua_Bot GetBotByName(std::string bot_name);
|
|
Lua_Bot_List GetBotList();
|
|
Lua_Bot_List GetBotListByCharacterID(uint32 character_id);
|
|
Lua_Bot_List GetBotListByCharacterID(uint32 character_id, uint8 class_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);
|
|
void SignalAllBotsByOwnerCharacterID(uint32 character_id, int signal_id);
|
|
void SignalBotByBotID(uint32 bot_id, int signal_id);
|
|
void SignalBotByBotName(std::string bot_name, int signal_id);
|
|
#endif
|
|
};
|
|
|
|
#endif
|
|
#endif
|