Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Mage partybots not reapplying Arcane Brilliance. #2590

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 24 additions & 21 deletions src/game/PlayerBots/PartyBotAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void PartyBotAI::CloneFromPlayer(Player const* pPlayer)
{
me->SatisfyItemRequirements(pItem->GetProto());
me->StoreNewItemInBestSlots(pItem->GetEntry(), 1, pItem->GetEnchantmentId(EnchantmentSlot(0)));
}
}
}
}

Expand Down Expand Up @@ -137,7 +137,7 @@ bool PartyBotAI::IsValidDistancingTarget(Unit* pTarget, Unit* pEnemy)
pTarget->GetDistance(pEnemy) >= 15.0f)
return true;
}

return false;
}

Expand Down Expand Up @@ -299,7 +299,7 @@ bool PartyBotAI::CanTryToCastSpell(Unit const* pTarget, SpellEntry const* pSpell
{
float const myThreat = pEnemy->GetThreatManager().getThreat(me);
float const victimThreat = pEnemy->GetThreatManager().getThreat(pEnemy->GetVictim());

if (victimThreat < (myThreat + me->GetMaxHealth()))
return false;
}
Expand Down Expand Up @@ -543,7 +543,7 @@ void PartyBotAI::AddToPlayerGroup()
me->RemoveFromGroup();

group->AddMember(me->GetObjectGuid(), me->GetName());
}
}
}

void PartyBotAI::OnPacketReceived(WorldPacket const* packet)
Expand Down Expand Up @@ -678,7 +678,7 @@ void PartyBotAI::UpdateAI(uint32 const diff)
m_receivedBgInvite = false;
return;
}

// Remain idle until we can join battleground.
return;
}
Expand Down Expand Up @@ -720,7 +720,7 @@ void PartyBotAI::UpdateAI(uint32 const diff)
me->CastSpell(me, PB_SPELL_HONORLESS_TARGET, true);
}
}

return;
}

Expand Down Expand Up @@ -842,7 +842,7 @@ void PartyBotAI::UpdateAI(uint32 const diff)
me->SetCheatOption(PLAYER_CHEAT_NO_CAST_TIME, true);
me->CastSpell(me, (*auraList.begin())->GetId(), true);
me->SetCheatOption(PLAYER_CHEAT_NO_CAST_TIME, oldState);
}
}
}
}
else if (me->IsMounted())
Expand Down Expand Up @@ -1024,7 +1024,7 @@ void PartyBotAI::UpdateOutOfCombatAI_Paladin()
me->ClearTarget();
return;
}
}
}
}
}

Expand Down Expand Up @@ -1227,7 +1227,7 @@ void PartyBotAI::UpdateInCombatAI_Paladin()
if (DoCastSpell(me, m_spells.paladin.pBlessingOfFreedom) == SPELL_CAST_OK)
return;
}

if (GetRole() != ROLE_HEALER &&
me->GetHealthPercent() < 30.0f)
HealInjuredTarget(me);
Expand Down Expand Up @@ -1563,13 +1563,16 @@ void PartyBotAI::UpdateOutOfCombatAI_Mage()
{
if (m_spells.mage.pArcaneBrilliance)
{
if (CanTryToCastSpell(me, m_spells.mage.pArcaneBrilliance))
if (Player* pTarget = SelectBuffTarget(m_spells.mage.pArcaneBrilliance))
{
if (DoCastSpell(me, m_spells.mage.pArcaneBrilliance) == SPELL_CAST_OK)
if (CanTryToCastSpell(pTarget, m_spells.mage.pArcaneBrilliance))
{
m_isBuffing = true;
me->ClearTarget();
return;
if (DoCastSpell(pTarget, m_spells.mage.pArcaneBrilliance) == SPELL_CAST_OK)
{
m_isBuffing = true;
me->ClearTarget();
return;
}
}
}
}
Expand Down Expand Up @@ -1782,7 +1785,7 @@ void PartyBotAI::UpdateInCombatAI_Mage()
{
if (DoCastSpell(me, m_spells.mage.pPresenceOfMind) == SPELL_CAST_OK)
return;
}
}

if (m_spells.mage.pScorch &&
(pVictim->GetHealthPercent() < 20.0f) &&
Expand Down Expand Up @@ -2790,7 +2793,7 @@ void PartyBotAI::UpdateInCombatAI_Rogue()
if (m_spells.rogue.pRupture)
vSpells.push_back(m_spells.rogue.pRupture);
}

if (!vSpells.empty())
{
SpellEntry const* pComboSpell = SelectRandomContainerElement(vSpells);
Expand Down Expand Up @@ -3039,7 +3042,7 @@ void PartyBotAI::UpdateInCombatAI_Druid()
if (DoCastSpell(me, m_spells.druid.pBarkskin) == SPELL_CAST_OK)
return;
}

if (form == FORM_NONE)
{
if (m_spells.druid.pHibernate &&
Expand Down Expand Up @@ -3112,7 +3115,7 @@ void PartyBotAI::UpdateInCombatAI_Druid()
Unit* pVictim = me->GetVictim();
if (!pVictim)
return;

if (form != FORM_NONE &&
me->HasUnitState(UNIT_STATE_ROOT) &&
me->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT) &&
Expand All @@ -3121,7 +3124,7 @@ void PartyBotAI::UpdateInCombatAI_Druid()

if (GetRole() == ROLE_HEALER)
return;

switch (form)
{
case FORM_CAT:
Expand Down Expand Up @@ -3224,7 +3227,7 @@ void PartyBotAI::UpdateInCombatAI_Druid()
if (DoCastSpell(pVictim, m_spells.druid.pClaw) == SPELL_CAST_OK)
return;
}

break;
}
case FORM_BEAR:
Expand Down Expand Up @@ -3369,4 +3372,4 @@ void PartyBotAI::UpdateInCombatAI_Druid()
break;
}
}
}
}