mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
- Added casting Blessing of Sanctuary on tank bots (#1329)
This commit is contained in:
@@ -12,13 +12,23 @@
|
|||||||
#include "PlayerbotFactory.h"
|
#include "PlayerbotFactory.h"
|
||||||
#include "Playerbots.h"
|
#include "Playerbots.h"
|
||||||
#include "SharedDefines.h"
|
#include "SharedDefines.h"
|
||||||
|
#include "../../../../../src/server/scripts/Spells/spell_generic.cpp"
|
||||||
|
|
||||||
inline std::string const GetActualBlessingOfMight(Unit* target)
|
inline std::string const GetActualBlessingOfMight(Unit* target, PlayerbotAI* botAI, Player* bot)
|
||||||
{
|
{
|
||||||
if (!target->ToPlayer())
|
Player* targetPlayer = target->ToPlayer();
|
||||||
|
|
||||||
|
if (!targetPlayer)
|
||||||
{
|
{
|
||||||
return "blessing of might";
|
return "blessing of might";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (targetPlayer->HasTankSpec() && !targetPlayer->HasAura(SPELL_BLESSING_OF_SANCTUARY) &&
|
||||||
|
bot->HasSpell(SPELL_BLESSING_OF_SANCTUARY))
|
||||||
|
{
|
||||||
|
return "blessing of sanctuary";
|
||||||
|
}
|
||||||
|
|
||||||
int tab = AiFactory::GetPlayerSpecTab(target->ToPlayer());
|
int tab = AiFactory::GetPlayerSpecTab(target->ToPlayer());
|
||||||
switch (target->getClass())
|
switch (target->getClass())
|
||||||
{
|
{
|
||||||
@@ -99,7 +109,7 @@ bool CastBlessingOfMightAction::Execute(Event event)
|
|||||||
if (!target)
|
if (!target)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return botAI->CastSpell(GetActualBlessingOfMight(target), target);
|
return botAI->CastSpell(GetActualBlessingOfMight(target, botAI, bot), target);
|
||||||
}
|
}
|
||||||
|
|
||||||
Value<Unit*>* CastBlessingOfMightOnPartyAction::GetTargetValue()
|
Value<Unit*>* CastBlessingOfMightOnPartyAction::GetTargetValue()
|
||||||
@@ -113,7 +123,7 @@ bool CastBlessingOfMightOnPartyAction::Execute(Event event)
|
|||||||
if (!target)
|
if (!target)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return botAI->CastSpell(GetActualBlessingOfMight(target), target);
|
return botAI->CastSpell(GetActualBlessingOfMight(target, botAI, bot), target);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CastBlessingOfWisdomAction::Execute(Event event)
|
bool CastBlessingOfWisdomAction::Execute(Event event)
|
||||||
@@ -169,4 +179,4 @@ bool CastCancelDivineSacrificeAction::Execute(Event event)
|
|||||||
bool CastCancelDivineSacrificeAction::isUseful()
|
bool CastCancelDivineSacrificeAction::isUseful()
|
||||||
{
|
{
|
||||||
return botAI->HasAura("divine sacrifice", GetTarget(), false, true, -1, true);
|
return botAI->HasAura("divine sacrifice", GetTarget(), false, true, -1, true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user