Bot Group Work

Fixed botid=charid spawn on zone issue
Added a group_list update on zone to refresh from database to fix a dangling pointer to a Bot object that was camped but was previously in a group within the zone being entered.
Modified Bot::ProcessBotGroupInvite to use the client of the bot when doing the Bot initialization so that a leader can invite another owner's Bot
This commit is contained in:
neckkola
2022-01-03 11:52:08 -04:00
parent bcf28bc35c
commit ba0c03af08
3 changed files with 74 additions and 16 deletions
+12 -11
View File
@@ -2632,19 +2632,20 @@ bool BotDatabase::LoadGroupedBotsByGroupID(const uint32 owner_id, const uint32 g
{
if (!group_id || !owner_id)
return false;
//modified query for usecase of a BOTID sharing a CHARACTERID.
//in this usecase, when the BOTID=CHARACTERID of BOT OWNER, this BOTID would be added to the GROUP
query = StringFormat(
"SELECT `charid`"
" FROM `group_id`"
" WHERE `groupid` = '%u'"
" AND `charid` IN ("
" SELECT `bot_id`"
" FROM `bot_data`"
" WHERE `owner_id` = '%u'"
" )",
"SELECT `mob_id` FROM `vw_groups` "
"WHERE `group_id` = '%u' "
"AND `mob_type`='B' "
"AND `mob_id` IN (SELECT `bot_id` FROM `bot_data` WHERE `owner_id` = '%u');"
, group_id, owner_id);
/*query = StringFormat(
"SELECT `charid` FROM `group_id` WHERE `groupid` = '%u'"
" AND `charid` IN (SELECT `bot_id` FROM `bot_data` WHERE `owner_id` = '%u')"
" AND `group_id.name` NOT IN (SELECT `name` FROM `character_data`)",
group_id,
owner_id
);
owner_id);*/
auto results = database.QueryDatabase(query);
if (!results.Success())