Skip to content

Commit 02f184d

Browse files
committed
Fix Mage partybots not reapplying Arcane Brilliance.
1 parent e7fddd9 commit 02f184d

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

src/game/PlayerBots/PartyBotAI.cpp

+24-21
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void PartyBotAI::CloneFromPlayer(Player const* pPlayer)
9898
{
9999
me->SatisfyItemRequirements(pItem->GetProto());
100100
me->StoreNewItemInBestSlots(pItem->GetEntry(), 1, pItem->GetEnchantmentId(EnchantmentSlot(0)));
101-
}
101+
}
102102
}
103103
}
104104

@@ -137,7 +137,7 @@ bool PartyBotAI::IsValidDistancingTarget(Unit* pTarget, Unit* pEnemy)
137137
pTarget->GetDistance(pEnemy) >= 15.0f)
138138
return true;
139139
}
140-
140+
141141
return false;
142142
}
143143

@@ -299,7 +299,7 @@ bool PartyBotAI::CanTryToCastSpell(Unit const* pTarget, SpellEntry const* pSpell
299299
{
300300
float const myThreat = pEnemy->GetThreatManager().getThreat(me);
301301
float const victimThreat = pEnemy->GetThreatManager().getThreat(pEnemy->GetVictim());
302-
302+
303303
if (victimThreat < (myThreat + me->GetMaxHealth()))
304304
return false;
305305
}
@@ -543,7 +543,7 @@ void PartyBotAI::AddToPlayerGroup()
543543
me->RemoveFromGroup();
544544

545545
group->AddMember(me->GetObjectGuid(), me->GetName());
546-
}
546+
}
547547
}
548548

549549
void PartyBotAI::OnPacketReceived(WorldPacket const* packet)
@@ -678,7 +678,7 @@ void PartyBotAI::UpdateAI(uint32 const diff)
678678
m_receivedBgInvite = false;
679679
return;
680680
}
681-
681+
682682
// Remain idle until we can join battleground.
683683
return;
684684
}
@@ -720,7 +720,7 @@ void PartyBotAI::UpdateAI(uint32 const diff)
720720
me->CastSpell(me, PB_SPELL_HONORLESS_TARGET, true);
721721
}
722722
}
723-
723+
724724
return;
725725
}
726726

@@ -842,7 +842,7 @@ void PartyBotAI::UpdateAI(uint32 const diff)
842842
me->SetCheatOption(PLAYER_CHEAT_NO_CAST_TIME, true);
843843
me->CastSpell(me, (*auraList.begin())->GetId(), true);
844844
me->SetCheatOption(PLAYER_CHEAT_NO_CAST_TIME, oldState);
845-
}
845+
}
846846
}
847847
}
848848
else if (me->IsMounted())
@@ -1024,7 +1024,7 @@ void PartyBotAI::UpdateOutOfCombatAI_Paladin()
10241024
me->ClearTarget();
10251025
return;
10261026
}
1027-
}
1027+
}
10281028
}
10291029
}
10301030

@@ -1227,7 +1227,7 @@ void PartyBotAI::UpdateInCombatAI_Paladin()
12271227
if (DoCastSpell(me, m_spells.paladin.pBlessingOfFreedom) == SPELL_CAST_OK)
12281228
return;
12291229
}
1230-
1230+
12311231
if (GetRole() != ROLE_HEALER &&
12321232
me->GetHealthPercent() < 30.0f)
12331233
HealInjuredTarget(me);
@@ -1563,13 +1563,16 @@ void PartyBotAI::UpdateOutOfCombatAI_Mage()
15631563
{
15641564
if (m_spells.mage.pArcaneBrilliance)
15651565
{
1566-
if (CanTryToCastSpell(me, m_spells.mage.pArcaneBrilliance))
1566+
if (Player* pTarget = SelectBuffTarget(m_spells.mage.pArcaneBrilliance))
15671567
{
1568-
if (DoCastSpell(me, m_spells.mage.pArcaneBrilliance) == SPELL_CAST_OK)
1568+
if (CanTryToCastSpell(pTarget, m_spells.mage.pArcaneBrilliance))
15691569
{
1570-
m_isBuffing = true;
1571-
me->ClearTarget();
1572-
return;
1570+
if (DoCastSpell(pTarget, m_spells.mage.pArcaneBrilliance) == SPELL_CAST_OK)
1571+
{
1572+
m_isBuffing = true;
1573+
me->ClearTarget();
1574+
return;
1575+
}
15731576
}
15741577
}
15751578
}
@@ -1782,7 +1785,7 @@ void PartyBotAI::UpdateInCombatAI_Mage()
17821785
{
17831786
if (DoCastSpell(me, m_spells.mage.pPresenceOfMind) == SPELL_CAST_OK)
17841787
return;
1785-
}
1788+
}
17861789

17871790
if (m_spells.mage.pScorch &&
17881791
(pVictim->GetHealthPercent() < 20.0f) &&
@@ -2790,7 +2793,7 @@ void PartyBotAI::UpdateInCombatAI_Rogue()
27902793
if (m_spells.rogue.pRupture)
27912794
vSpells.push_back(m_spells.rogue.pRupture);
27922795
}
2793-
2796+
27942797
if (!vSpells.empty())
27952798
{
27962799
SpellEntry const* pComboSpell = SelectRandomContainerElement(vSpells);
@@ -3039,7 +3042,7 @@ void PartyBotAI::UpdateInCombatAI_Druid()
30393042
if (DoCastSpell(me, m_spells.druid.pBarkskin) == SPELL_CAST_OK)
30403043
return;
30413044
}
3042-
3045+
30433046
if (form == FORM_NONE)
30443047
{
30453048
if (m_spells.druid.pHibernate &&
@@ -3112,7 +3115,7 @@ void PartyBotAI::UpdateInCombatAI_Druid()
31123115
Unit* pVictim = me->GetVictim();
31133116
if (!pVictim)
31143117
return;
3115-
3118+
31163119
if (form != FORM_NONE &&
31173120
me->HasUnitState(UNIT_STATE_ROOT) &&
31183121
me->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT) &&
@@ -3121,7 +3124,7 @@ void PartyBotAI::UpdateInCombatAI_Druid()
31213124

31223125
if (GetRole() == ROLE_HEALER)
31233126
return;
3124-
3127+
31253128
switch (form)
31263129
{
31273130
case FORM_CAT:
@@ -3224,7 +3227,7 @@ void PartyBotAI::UpdateInCombatAI_Druid()
32243227
if (DoCastSpell(pVictim, m_spells.druid.pClaw) == SPELL_CAST_OK)
32253228
return;
32263229
}
3227-
3230+
32283231
break;
32293232
}
32303233
case FORM_BEAR:
@@ -3369,4 +3372,4 @@ void PartyBotAI::UpdateInCombatAI_Druid()
33693372
break;
33703373
}
33713374
}
3372-
}
3375+
}

0 commit comments

Comments
 (0)