End of Day Jan 18

This commit is contained in:
neckkola
2022-01-18 22:33:09 -04:00
parent 29ec914565
commit 5e475ad8cd
6 changed files with 44 additions and 23 deletions
+21 -11
View File
@@ -2300,8 +2300,8 @@ bool Bot::Process()
}
// Bot AI
uint32 raid = entity_list.GetRaidByBot(this)->GetID();
if (raid >= 0)
Raid* bot_raid = entity_list.GetRaidByBotName(this->GetName());
if (bot_raid)
AI_Process_Raid();
else
AI_Process();
@@ -8388,7 +8388,7 @@ void Bot::Camp(bool databaseSave) {
RemoveBotFromGroup(this, GetGroup());
//Mitch
Raid* bot_raid = entity_list.GetRaidByBot(this);
Raid* bot_raid = entity_list.GetRaidByBotName(this->GetName());
if (bot_raid)
bot_raid->RemoveMember(this->GetName());
@@ -8405,9 +8405,14 @@ void Bot::Camp(bool databaseSave) {
}
void Bot::Zone() {
if(HasGroup())
Raid* raid = entity_list.GetRaidByBotName(this->GetName());
if (raid) {
raid->MemberZoned(this->CastToClient());
}
else if (HasGroup()) {
GetGroup()->MemberZoned(this);
}
Save();
Depop();
}
@@ -8656,7 +8661,11 @@ void Bot::ProcessClientZoneChange(Client* botOwner) {
Bot* tempBot = *itr;
if(tempBot) {
if(tempBot->HasGroup()) {
Raid* raid = entity_list.GetRaidByBotName(tempBot->GetName());
if (raid) {
tempBot->Zone();
}
else if(tempBot->HasGroup()) {
Group* g = tempBot->GetGroup();
if(g && g->IsGroupMember(botOwner)) {
if(botOwner && botOwner->IsClient()) {
@@ -10454,7 +10463,8 @@ void Bot::ProcessRaidInvite(Bot* invitee, Client* invitor) {
entity_list.AddRaid(raid);
raid->SetRaidDetails();
raid->SendRaidCreate(invitor);
raid->SendMakeGroupLeaderPacketTo(raid->leadername, invitor);
raid->SetLeader(invitor); //Added Jan 18
raid->SendMakeLeaderPacketTo(raid->leadername, invitor);
if (g_invitor)
{
@@ -10480,9 +10490,9 @@ void Bot::ProcessRaidInvite(Bot* invitee, Client* invitor) {
c = g_invitor->members[x]->CastToClient();
if (x == 0) {
raid->SendRaidCreate(c);
raid->SendMakeLeaderPacketTo(raid->leadername, c);
raid->AddMember(c, 0, false, true, false);
raid->SetGroupLeader(c->GetName());
raid->SendMakeLeaderPacketTo(invitor->GetName(), c);
raid->AddMember(c, 0, true, true, true);
//raid->SetGroupLeader(c->GetName()); //Mitch Jan 18
//raid->GroupUpdate(0, true);
if (raid->IsLocked()) {
raid->SendRaidLockTo(c);
@@ -10572,7 +10582,7 @@ void Bot::ProcessRaidInvite(Bot* invitee, Client* invitor) {
{
//Second, add the single invitor
raid->SendRaidCreate(invitor);
raid->SendMakeLeaderPacketTo(raid->leadername, invitor);
raid->SendMakeLeaderPacketTo(invitor->GetName(), invitor); //Mitch Jan 18
raid->AddMember(invitor, 0xFFFFFFFF, true, false, true);
if (raid->IsLocked()) {
raid->SendRaidLockTo(invitor);
+11 -6
View File
@@ -52,7 +52,7 @@ void Bot::AI_Process_Raid()
#define PASSIVE (GetBotStance() == EQ::constants::stancePassive)
#define NOT_PASSIVE (GetBotStance() != EQ::constants::stancePassive)
Raid* raid = entity_list.GetRaidByBot(this);
Raid* raid = entity_list.GetRaidByBotName(this->GetName());
Client* bot_owner = (GetBotOwner() && GetBotOwner()->IsClient() ? GetBotOwner()->CastToClient() : nullptr);
uint32 r_group = raid->GetGroup(GetName());
@@ -75,11 +75,11 @@ void Bot::AI_Process_Raid()
// We also need a leash owner and follow mob (subset of primary AI criteria)
Client* leash_owner = nullptr;
if (r_group >= 0) {
leash_owner = raid->GetGroupLeader(r_group)->CastToClient();
if (r_group < 12) {
leash_owner = raid->GetGroupLeader(r_group);
}
else {
leash_owner = raid->GetLeader();
leash_owner = bot_owner;
}
if (!leash_owner) {
@@ -94,7 +94,12 @@ void Bot::AI_Process_Raid()
follow_mob = leash_owner;
SetFollowID(leash_owner->GetID());
}
if (send_hp_update_timer.Check(false)) {
raid->SendHPManaEndPacketsFrom(this);
}
// Berserk updates should occur if primary AI criteria are met
if (GetClass() == WARRIOR || GetClass() == BERSERKER) {
@@ -1531,7 +1536,7 @@ bool Bot::AICastSpell_Raid(Mob* tar, uint8 iChance, uint32 iSpellTypes) {
// Bot AI Raid
Raid* raid = entity_list.GetRaidByBot(this);
Raid* raid = entity_list.GetRaidByBotName(this->GetName());
if (!raid)
return false;
@@ -2592,7 +2597,7 @@ void Raid::RaidBotGroupSay(Bot* b, uint8 language, uint8 lang_skill, const char*
uint8 Bot::GetNumberNeedingHealedInRaidGroup(uint8 hpr, bool includePets) {
uint8 needHealed = 0;
Raid* raid = nullptr;
raid = entity_list.GetRaidByBot(this);
raid = entity_list.GetRaidByBotName(this->GetName());
uint32 r_group = raid->GetGroup(this->GetName());
std::vector<RaidMember> raid_group_members = raid->GetRaidGroupMembers(r_group);
for (RaidMember iter : raid_group_members) {
+1 -1
View File
@@ -32,7 +32,7 @@
bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) {
// Bot AI
Raid* raid = entity_list.GetRaidByBot(this);
Raid* raid = entity_list.GetRaidByBotName(this->GetName());
if (raid) {
return AICastSpell_Raid(tar, iChance, iSpellTypes);
//return true;
+6 -1
View File
@@ -6988,7 +6988,12 @@ void Client::Handle_OP_GroupInvite2(const EQApplicationPacket *app)
}
#ifdef BOTS
else if (Invitee->IsBot()) {
Bot::ProcessBotGroupInvite(this, std::string(Invitee->GetName()));
Client* inviter = entity_list.GetClientByName(gis->inviter_name);
Bot* invitee = entity_list.GetBotByBotName(gis->invitee_name);
if (inviter->IsRaidGrouped())
Bot::ProcessRaidInvite(invitee, inviter);
else
Bot::ProcessBotGroupInvite(this, std::string(Invitee->GetName()));
}
#endif
}
+4 -3
View File
@@ -2048,15 +2048,16 @@ Raid* EntityList::GetRaidByClient(Client* client)
return nullptr;
}
Raid* EntityList::GetRaidByBot(Bot* bot)
Raid* EntityList::GetRaidByBotName(const char* name)
{
std::list<Raid*>::iterator iterator;
iterator = raid_list.begin();
while (iterator != raid_list.end()) {
for (auto& member : (*iterator)->members) {
if (member.member) {
if (member.member == bot->CastToClient()) {
if (member.membername) {
if (strcmp(member.membername, name) == 0) {
//client->p_raid_instance = *iterator;
return *iterator;
}
+1 -1
View File
@@ -198,7 +198,7 @@ public:
Raid *GetRaidByID(uint32 id);
Raid *GetRaidByLeaderName(const char *leader);
#ifdef BOTS
Raid* GetRaidByBot(Bot* bot);
Raid* GetRaidByBotName(const char* name);
#endif
Corpse *GetCorpseByOwner(Client* client);