mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-21 02:20:00 +01:00
- Added casting Blessing of Sanctuary on tank bots (#1329)
This commit is contained in:
parent
faee49beaa
commit
1195e67c97
@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user