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
+20 -10
View File
@@ -2300,8 +2300,8 @@ bool Bot::Process()
} }
// Bot AI // Bot AI
uint32 raid = entity_list.GetRaidByBot(this)->GetID(); Raid* bot_raid = entity_list.GetRaidByBotName(this->GetName());
if (raid >= 0) if (bot_raid)
AI_Process_Raid(); AI_Process_Raid();
else else
AI_Process(); AI_Process();
@@ -8388,7 +8388,7 @@ void Bot::Camp(bool databaseSave) {
RemoveBotFromGroup(this, GetGroup()); RemoveBotFromGroup(this, GetGroup());
//Mitch //Mitch
Raid* bot_raid = entity_list.GetRaidByBot(this); Raid* bot_raid = entity_list.GetRaidByBotName(this->GetName());
if (bot_raid) if (bot_raid)
bot_raid->RemoveMember(this->GetName()); bot_raid->RemoveMember(this->GetName());
@@ -8405,8 +8405,13 @@ void Bot::Camp(bool databaseSave) {
} }
void Bot::Zone() { void Bot::Zone() {
if(HasGroup()) Raid* raid = entity_list.GetRaidByBotName(this->GetName());
if (raid) {
raid->MemberZoned(this->CastToClient());
}
else if (HasGroup()) {
GetGroup()->MemberZoned(this); GetGroup()->MemberZoned(this);
}
Save(); Save();
Depop(); Depop();
@@ -8656,7 +8661,11 @@ void Bot::ProcessClientZoneChange(Client* botOwner) {
Bot* tempBot = *itr; Bot* tempBot = *itr;
if(tempBot) { if(tempBot) {
if(tempBot->HasGroup()) { Raid* raid = entity_list.GetRaidByBotName(tempBot->GetName());
if (raid) {
tempBot->Zone();
}
else if(tempBot->HasGroup()) {
Group* g = tempBot->GetGroup(); Group* g = tempBot->GetGroup();
if(g && g->IsGroupMember(botOwner)) { if(g && g->IsGroupMember(botOwner)) {
if(botOwner && botOwner->IsClient()) { if(botOwner && botOwner->IsClient()) {
@@ -10454,7 +10463,8 @@ void Bot::ProcessRaidInvite(Bot* invitee, Client* invitor) {
entity_list.AddRaid(raid); entity_list.AddRaid(raid);
raid->SetRaidDetails(); raid->SetRaidDetails();
raid->SendRaidCreate(invitor); raid->SendRaidCreate(invitor);
raid->SendMakeGroupLeaderPacketTo(raid->leadername, invitor); raid->SetLeader(invitor); //Added Jan 18
raid->SendMakeLeaderPacketTo(raid->leadername, invitor);
if (g_invitor) if (g_invitor)
{ {
@@ -10480,9 +10490,9 @@ void Bot::ProcessRaidInvite(Bot* invitee, Client* invitor) {
c = g_invitor->members[x]->CastToClient(); c = g_invitor->members[x]->CastToClient();
if (x == 0) { if (x == 0) {
raid->SendRaidCreate(c); raid->SendRaidCreate(c);
raid->SendMakeLeaderPacketTo(raid->leadername, c); raid->SendMakeLeaderPacketTo(invitor->GetName(), c);
raid->AddMember(c, 0, false, true, false); raid->AddMember(c, 0, true, true, true);
raid->SetGroupLeader(c->GetName()); //raid->SetGroupLeader(c->GetName()); //Mitch Jan 18
//raid->GroupUpdate(0, true); //raid->GroupUpdate(0, true);
if (raid->IsLocked()) { if (raid->IsLocked()) {
raid->SendRaidLockTo(c); raid->SendRaidLockTo(c);
@@ -10572,7 +10582,7 @@ void Bot::ProcessRaidInvite(Bot* invitee, Client* invitor) {
{ {
//Second, add the single invitor //Second, add the single invitor
raid->SendRaidCreate(invitor); raid->SendRaidCreate(invitor);
raid->SendMakeLeaderPacketTo(raid->leadername, invitor); raid->SendMakeLeaderPacketTo(invitor->GetName(), invitor); //Mitch Jan 18
raid->AddMember(invitor, 0xFFFFFFFF, true, false, true); raid->AddMember(invitor, 0xFFFFFFFF, true, false, true);
if (raid->IsLocked()) { if (raid->IsLocked()) {
raid->SendRaidLockTo(invitor); raid->SendRaidLockTo(invitor);
+11 -6
View File
@@ -52,7 +52,7 @@ void Bot::AI_Process_Raid()
#define PASSIVE (GetBotStance() == EQ::constants::stancePassive) #define PASSIVE (GetBotStance() == EQ::constants::stancePassive)
#define NOT_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); Client* bot_owner = (GetBotOwner() && GetBotOwner()->IsClient() ? GetBotOwner()->CastToClient() : nullptr);
uint32 r_group = raid->GetGroup(GetName()); 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) // 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 < 12) {
leash_owner = raid->GetGroupLeader(r_group)->CastToClient(); leash_owner = raid->GetGroupLeader(r_group);
} }
else { else {
leash_owner = raid->GetLeader(); leash_owner = bot_owner;
} }
if (!leash_owner) { if (!leash_owner) {
@@ -95,6 +95,11 @@ void Bot::AI_Process_Raid()
SetFollowID(leash_owner->GetID()); SetFollowID(leash_owner->GetID());
} }
if (send_hp_update_timer.Check(false)) {
raid->SendHPManaEndPacketsFrom(this);
}
// Berserk updates should occur if primary AI criteria are met // Berserk updates should occur if primary AI criteria are met
if (GetClass() == WARRIOR || GetClass() == BERSERKER) { if (GetClass() == WARRIOR || GetClass() == BERSERKER) {
@@ -1531,7 +1536,7 @@ bool Bot::AICastSpell_Raid(Mob* tar, uint8 iChance, uint32 iSpellTypes) {
// Bot AI Raid // Bot AI Raid
Raid* raid = entity_list.GetRaidByBot(this); Raid* raid = entity_list.GetRaidByBotName(this->GetName());
if (!raid) if (!raid)
return false; 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 Bot::GetNumberNeedingHealedInRaidGroup(uint8 hpr, bool includePets) {
uint8 needHealed = 0; uint8 needHealed = 0;
Raid* raid = nullptr; Raid* raid = nullptr;
raid = entity_list.GetRaidByBot(this); raid = entity_list.GetRaidByBotName(this->GetName());
uint32 r_group = raid->GetGroup(this->GetName()); uint32 r_group = raid->GetGroup(this->GetName());
std::vector<RaidMember> raid_group_members = raid->GetRaidGroupMembers(r_group); std::vector<RaidMember> raid_group_members = raid->GetRaidGroupMembers(r_group);
for (RaidMember iter : raid_group_members) { for (RaidMember iter : raid_group_members) {
+1 -1
View File
@@ -32,7 +32,7 @@
bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) { bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) {
// Bot AI // Bot AI
Raid* raid = entity_list.GetRaidByBot(this); Raid* raid = entity_list.GetRaidByBotName(this->GetName());
if (raid) { if (raid) {
return AICastSpell_Raid(tar, iChance, iSpellTypes); return AICastSpell_Raid(tar, iChance, iSpellTypes);
//return true; //return true;
+6 -1
View File
@@ -6988,7 +6988,12 @@ void Client::Handle_OP_GroupInvite2(const EQApplicationPacket *app)
} }
#ifdef BOTS #ifdef BOTS
else if (Invitee->IsBot()) { 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 #endif
} }
+4 -3
View File
@@ -2048,15 +2048,16 @@ Raid* EntityList::GetRaidByClient(Client* client)
return nullptr; return nullptr;
} }
Raid* EntityList::GetRaidByBot(Bot* bot) Raid* EntityList::GetRaidByBotName(const char* name)
{ {
std::list<Raid*>::iterator iterator; std::list<Raid*>::iterator iterator;
iterator = raid_list.begin(); iterator = raid_list.begin();
while (iterator != raid_list.end()) { while (iterator != raid_list.end()) {
for (auto& member : (*iterator)->members) { for (auto& member : (*iterator)->members) {
if (member.member) { if (member.membername) {
if (member.member == bot->CastToClient()) { if (strcmp(member.membername, name) == 0) {
//client->p_raid_instance = *iterator; //client->p_raid_instance = *iterator;
return *iterator; return *iterator;
} }
+1 -1
View File
@@ -198,7 +198,7 @@ public:
Raid *GetRaidByID(uint32 id); Raid *GetRaidByID(uint32 id);
Raid *GetRaidByLeaderName(const char *leader); Raid *GetRaidByLeaderName(const char *leader);
#ifdef BOTS #ifdef BOTS
Raid* GetRaidByBot(Bot* bot); Raid* GetRaidByBotName(const char* name);
#endif #endif
Corpse *GetCorpseByOwner(Client* client); Corpse *GetCorpseByOwner(Client* client);