mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-20 22:08:22 +00:00
Spawn on login working
This commit is contained in:
+2
-2
@@ -2300,8 +2300,8 @@ bool Bot::Process()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Bot AI
|
// Bot AI
|
||||||
Raid* raid = entity_list.GetRaidByBot(this);
|
uint32 raid = entity_list.GetRaidByBot(this)->GetID();
|
||||||
if (raid)
|
if (raid >= 0)
|
||||||
AI_Process_Raid();
|
AI_Process_Raid();
|
||||||
else
|
else
|
||||||
AI_Process();
|
AI_Process();
|
||||||
|
|||||||
+1
-1
@@ -75,7 +75,7 @@ void Bot::AI_Process_Raid()
|
|||||||
|
|
||||||
// We also need a leash owner and follow mob (subset of primary AI criteria)
|
// We also need a leash owner and follow mob (subset of primary AI criteria)
|
||||||
Client* leash_owner = nullptr;
|
Client* leash_owner = nullptr;
|
||||||
if (r_group > 0) {
|
if (r_group >= 0) {
|
||||||
leash_owner = raid->GetGroupLeader(r_group)->CastToClient();
|
leash_owner = raid->GetGroupLeader(r_group)->CastToClient();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
+18
-13
@@ -571,20 +571,25 @@ void Client::CompleteConnect()
|
|||||||
SetRaidGrouped(true);
|
SetRaidGrouped(true);
|
||||||
raid->LearnMembers();
|
raid->LearnMembers();
|
||||||
#ifdef BOTS
|
#ifdef BOTS
|
||||||
|
std::list<BotsAvailableList> bots_list;
|
||||||
|
database.botdb.LoadBotsList(this->CharacterID(), bots_list);
|
||||||
std::vector<RaidMember> r_members = raid->GetMembers();
|
std::vector<RaidMember> r_members = raid->GetMembers();
|
||||||
for (RaidMember iter : r_members) {
|
for (const RaidMember& iter : r_members) {
|
||||||
if (iter.member && iter.member->IsBot() && iter.member->GetOwner()->CastToClient()->CharacterID() == this->CharacterID()) {
|
if (iter.membername) {
|
||||||
char buffer[70];
|
for (const BotsAvailableList& b_iter : bots_list)
|
||||||
sprintf(buffer, "spawn %s", iter.member->GetName());
|
{
|
||||||
bot_command_real_dispatch(this, buffer);
|
if (strcmp(iter.membername, b_iter.Name) == 0)
|
||||||
//iter.member->CastToBot()->Spawn(this);
|
{
|
||||||
iter.member->CastToBot()->SetRaidGrouped(true);
|
char buffer[71] = "^spawn ";
|
||||||
uint32 r_group = raid->GetGroup(iter.member->GetName());
|
strcat(buffer, iter.membername);
|
||||||
if (r_group > 0) {
|
bot_command_real_dispatch(this, buffer);
|
||||||
iter.member->CastToBot()->SetFollowID(raid->GetGroupLeader(r_group)->CastToClient()->GetID());
|
Bot* b = entity_list.GetBotByBotName(iter.membername);
|
||||||
}
|
if (b)
|
||||||
else {
|
{
|
||||||
iter.member->CastToBot()->SetFollowID(raid->GetLeader()->GetID());
|
b->SetRaidGrouped(true);
|
||||||
|
//b->SetFollowID(this->GetID());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user