Raid leader and mana/hp updates fixed

This commit is contained in:
neckkola
2022-01-19 23:35:04 -04:00
parent 5e475ad8cd
commit f26b491339
3 changed files with 50 additions and 7 deletions
+46 -7
View File
@@ -7713,11 +7713,25 @@ bool Bot::DoFinishedSpellSingleTarget(uint16 spell_id, Mob* spellTarget, EQ::spe
bool Bot::DoFinishedSpellGroupTarget(uint16 spell_id, Mob* spellTarget, EQ::spells::CastingSlot slot, bool& stopLogic) { bool Bot::DoFinishedSpellGroupTarget(uint16 spell_id, Mob* spellTarget, EQ::spells::CastingSlot slot, bool& stopLogic) {
bool isMainGroupMGB = false; bool isMainGroupMGB = false;
Raid* raid = entity_list.GetRaidByBotName(this->GetName());
if(isMainGroupMGB && (GetClass() != BARD)) { if(isMainGroupMGB && (GetClass() != BARD)) {
BotGroupSay(this, "MGB %s", spells[spell_id].name); BotGroupSay(this, "MGB %s", spells[spell_id].name);
SpellOnTarget(spell_id, this); SpellOnTarget(spell_id, this);
entity_list.AESpell(this, this, spell_id, true); entity_list.AESpell(this, this, spell_id, true);
} else { }
else if (raid)
{
for (RaidMember iter : raid->GetRaidGroupMembers(raid->GetGroup(this->GetName()))) {
if (iter.member) {
SpellOnTarget(spell_id, iter.member);
if (iter.member && iter.member->GetPetID())
SpellOnTarget(spell_id, iter.member ->GetPet());
}
}
}
else
{
Group *g = GetGroup(); Group *g = GetGroup();
if(g) { if(g) {
for(int i = 0; i < MAX_GROUP_MEMBERS; ++i) { for(int i = 0; i < MAX_GROUP_MEMBERS; ++i) {
@@ -9277,7 +9291,19 @@ bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, fl
else else
return false; return false;
} }
//added raid check
if (caster->IsRaidGrouped()) {
Raid* raid = entity_list.GetRaidByBotName(caster->GetName());
uint32 g = raid->GetGroup(caster->GetName());
if (g < 12) {
for (RaidMember &iter : raid->GetRaidGroupMembers(g)) {
if (iter.member) {
if (caster->AICastSpell(iter.member, chanceToCast, SpellType_Buff) || caster->AICastSpell(iter.member->GetPet(), chanceToCast, SpellType_Buff))
return true;
}
}
}
}
if(caster->HasGroup()) { if(caster->HasGroup()) {
Group *g = caster->GetGroup(); Group *g = caster->GetGroup();
if(g) { if(g) {
@@ -9333,6 +9359,19 @@ bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, fl
if (botCasterClass == BARD || caster->IsEngaged()) if (botCasterClass == BARD || caster->IsEngaged())
return false; return false;
//added raid check
if (caster->IsRaidGrouped()) {
Raid* raid = entity_list.GetRaidByBotName(caster->GetName());
uint32 g = raid->GetGroup(caster->GetName());
if (g < 12) {
for (RaidMember& iter : raid->GetRaidGroupMembers(g)) {
if (iter.member) {
if (caster->AICastSpell(iter.member, iChance, SpellType_PreCombatBuff) || caster->AICastSpell(iter.member->GetPet(), iChance, SpellType_PreCombatBuff))
return true;
}
}
}
}
if (caster->HasGroup()) { if (caster->HasGroup()) {
Group *g = caster->GetGroup(); Group *g = caster->GetGroup();
if (g) { if (g) {
@@ -10462,9 +10501,9 @@ void Bot::ProcessRaidInvite(Bot* invitee, Client* invitor) {
raid = new Raid(invitor); raid = new Raid(invitor);
entity_list.AddRaid(raid); entity_list.AddRaid(raid);
raid->SetRaidDetails(); raid->SetRaidDetails();
raid->SendRaidCreate(invitor); // raid->SendRaidCreate(invitor);
raid->SetLeader(invitor); //Added Jan 18 // raid->SetLeader(invitor); //Added Jan 18
raid->SendMakeLeaderPacketTo(raid->leadername, invitor); // raid->SendMakeLeaderPacketTo(raid->leadername, invitor);
if (g_invitor) if (g_invitor)
{ {
@@ -10490,8 +10529,8 @@ 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(invitor->GetName(), c);
raid->AddMember(c, 0, true, true, true); raid->AddMember(c, 0, true, true, true);
raid->SendMakeLeaderPacketTo(raid->leadername, c);
//raid->SetGroupLeader(c->GetName()); //Mitch Jan 18 //raid->SetGroupLeader(c->GetName()); //Mitch Jan 18
//raid->GroupUpdate(0, true); //raid->GroupUpdate(0, true);
if (raid->IsLocked()) { if (raid->IsLocked()) {
@@ -10582,8 +10621,8 @@ 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(invitor->GetName(), invitor); //Mitch Jan 18
raid->AddMember(invitor, 0xFFFFFFFF, true, false, true); raid->AddMember(invitor, 0xFFFFFFFF, true, false, true);
raid->SendMakeLeaderPacketTo(invitor->GetName(), invitor); //Mitch Jan 18
if (raid->IsLocked()) { if (raid->IsLocked()) {
raid->SendRaidLockTo(invitor); raid->SendRaidLockTo(invitor);
} }
+3
View File
@@ -95,6 +95,9 @@ void Bot::AI_Process_Raid()
SetFollowID(leash_owner->GetID()); SetFollowID(leash_owner->GetID());
} }
if (this->mana_timer.Check(false)) {
raid->SendHPManaEndPacketsFrom(this);
}
if (send_hp_update_timer.Check(false)) { if (send_hp_update_timer.Check(false)) {
raid->SendHPManaEndPacketsFrom(this); raid->SendHPManaEndPacketsFrom(this);
+1
View File
@@ -253,6 +253,7 @@ void Raid::RemoveMember(const char *characterName)
bot->SetFollowID(bot->GetOwner()->GetID()); bot->SetFollowID(bot->GetOwner()->GetID());
bot->SetGrouped(0); bot->SetGrouped(0);
bot->SetTarget(nullptr); bot->SetTarget(nullptr);
bot->SetRaidGrouped(0);
} }
#endif #endif