@@ -98,7 +98,7 @@ void PartyBotAI::CloneFromPlayer(Player const* pPlayer)
98
98
{
99
99
me->SatisfyItemRequirements (pItem->GetProto ());
100
100
me->StoreNewItemInBestSlots (pItem->GetEntry (), 1 , pItem->GetEnchantmentId (EnchantmentSlot (0 )));
101
- }
101
+ }
102
102
}
103
103
}
104
104
@@ -137,7 +137,7 @@ bool PartyBotAI::IsValidDistancingTarget(Unit* pTarget, Unit* pEnemy)
137
137
pTarget->GetDistance (pEnemy) >= 15 .0f )
138
138
return true ;
139
139
}
140
-
140
+
141
141
return false ;
142
142
}
143
143
@@ -299,7 +299,7 @@ bool PartyBotAI::CanTryToCastSpell(Unit const* pTarget, SpellEntry const* pSpell
299
299
{
300
300
float const myThreat = pEnemy->GetThreatManager ().getThreat (me);
301
301
float const victimThreat = pEnemy->GetThreatManager ().getThreat (pEnemy->GetVictim ());
302
-
302
+
303
303
if (victimThreat < (myThreat + me->GetMaxHealth ()))
304
304
return false ;
305
305
}
@@ -543,7 +543,7 @@ void PartyBotAI::AddToPlayerGroup()
543
543
me->RemoveFromGroup ();
544
544
545
545
group->AddMember (me->GetObjectGuid (), me->GetName ());
546
- }
546
+ }
547
547
}
548
548
549
549
void PartyBotAI::OnPacketReceived (WorldPacket const * packet)
@@ -678,7 +678,7 @@ void PartyBotAI::UpdateAI(uint32 const diff)
678
678
m_receivedBgInvite = false ;
679
679
return ;
680
680
}
681
-
681
+
682
682
// Remain idle until we can join battleground.
683
683
return ;
684
684
}
@@ -720,7 +720,7 @@ void PartyBotAI::UpdateAI(uint32 const diff)
720
720
me->CastSpell (me, PB_SPELL_HONORLESS_TARGET, true );
721
721
}
722
722
}
723
-
723
+
724
724
return ;
725
725
}
726
726
@@ -842,7 +842,7 @@ void PartyBotAI::UpdateAI(uint32 const diff)
842
842
me->SetCheatOption (PLAYER_CHEAT_NO_CAST_TIME, true );
843
843
me->CastSpell (me, (*auraList.begin ())->GetId (), true );
844
844
me->SetCheatOption (PLAYER_CHEAT_NO_CAST_TIME, oldState);
845
- }
845
+ }
846
846
}
847
847
}
848
848
else if (me->IsMounted ())
@@ -1024,7 +1024,7 @@ void PartyBotAI::UpdateOutOfCombatAI_Paladin()
1024
1024
me->ClearTarget ();
1025
1025
return ;
1026
1026
}
1027
- }
1027
+ }
1028
1028
}
1029
1029
}
1030
1030
@@ -1227,7 +1227,7 @@ void PartyBotAI::UpdateInCombatAI_Paladin()
1227
1227
if (DoCastSpell (me, m_spells.paladin .pBlessingOfFreedom ) == SPELL_CAST_OK)
1228
1228
return ;
1229
1229
}
1230
-
1230
+
1231
1231
if (GetRole () != ROLE_HEALER &&
1232
1232
me->GetHealthPercent () < 30 .0f )
1233
1233
HealInjuredTarget (me);
@@ -1563,13 +1563,16 @@ void PartyBotAI::UpdateOutOfCombatAI_Mage()
1563
1563
{
1564
1564
if (m_spells.mage .pArcaneBrilliance )
1565
1565
{
1566
- if (CanTryToCastSpell (me, m_spells.mage .pArcaneBrilliance ))
1566
+ if (Player* pTarget = SelectBuffTarget ( m_spells.mage .pArcaneBrilliance ))
1567
1567
{
1568
- if (DoCastSpell (me , m_spells.mage .pArcaneBrilliance ) == SPELL_CAST_OK )
1568
+ if (CanTryToCastSpell (pTarget , m_spells.mage .pArcaneBrilliance ))
1569
1569
{
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
+ }
1573
1576
}
1574
1577
}
1575
1578
}
@@ -1782,7 +1785,7 @@ void PartyBotAI::UpdateInCombatAI_Mage()
1782
1785
{
1783
1786
if (DoCastSpell (me, m_spells.mage .pPresenceOfMind ) == SPELL_CAST_OK)
1784
1787
return ;
1785
- }
1788
+ }
1786
1789
1787
1790
if (m_spells.mage .pScorch &&
1788
1791
(pVictim->GetHealthPercent () < 20 .0f ) &&
@@ -2790,7 +2793,7 @@ void PartyBotAI::UpdateInCombatAI_Rogue()
2790
2793
if (m_spells.rogue .pRupture )
2791
2794
vSpells.push_back (m_spells.rogue .pRupture );
2792
2795
}
2793
-
2796
+
2794
2797
if (!vSpells.empty ())
2795
2798
{
2796
2799
SpellEntry const * pComboSpell = SelectRandomContainerElement (vSpells);
@@ -3039,7 +3042,7 @@ void PartyBotAI::UpdateInCombatAI_Druid()
3039
3042
if (DoCastSpell (me, m_spells.druid .pBarkskin ) == SPELL_CAST_OK)
3040
3043
return ;
3041
3044
}
3042
-
3045
+
3043
3046
if (form == FORM_NONE)
3044
3047
{
3045
3048
if (m_spells.druid .pHibernate &&
@@ -3112,7 +3115,7 @@ void PartyBotAI::UpdateInCombatAI_Druid()
3112
3115
Unit* pVictim = me->GetVictim ();
3113
3116
if (!pVictim)
3114
3117
return ;
3115
-
3118
+
3116
3119
if (form != FORM_NONE &&
3117
3120
me->HasUnitState (UNIT_STATE_ROOT) &&
3118
3121
me->HasAuraType (SPELL_AURA_MOD_SHAPESHIFT) &&
@@ -3121,7 +3124,7 @@ void PartyBotAI::UpdateInCombatAI_Druid()
3121
3124
3122
3125
if (GetRole () == ROLE_HEALER)
3123
3126
return ;
3124
-
3127
+
3125
3128
switch (form)
3126
3129
{
3127
3130
case FORM_CAT:
@@ -3224,7 +3227,7 @@ void PartyBotAI::UpdateInCombatAI_Druid()
3224
3227
if (DoCastSpell (pVictim, m_spells.druid .pClaw ) == SPELL_CAST_OK)
3225
3228
return ;
3226
3229
}
3227
-
3230
+
3228
3231
break ;
3229
3232
}
3230
3233
case FORM_BEAR:
@@ -3369,4 +3372,4 @@ void PartyBotAI::UpdateInCombatAI_Druid()
3369
3372
break ;
3370
3373
}
3371
3374
}
3372
- }
3375
+ }
0 commit comments