mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Item spell cast
This commit is contained in:
@@ -38,6 +38,7 @@
|
|||||||
#include "GuildMgr.h"
|
#include "GuildMgr.h"
|
||||||
#include "SayAction.h"
|
#include "SayAction.h"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
std::vector<std::string> PlayerbotAI::dispel_whitelist = {
|
std::vector<std::string> PlayerbotAI::dispel_whitelist = {
|
||||||
@@ -2441,10 +2442,6 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget)
|
|||||||
if (failWithDelay)
|
if (failWithDelay)
|
||||||
{
|
{
|
||||||
SetNextCheckDelay(sPlayerbotAIConfig->reactDelay);
|
SetNextCheckDelay(sPlayerbotAIConfig->reactDelay);
|
||||||
// if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) {
|
|
||||||
// LOG_DEBUG("playerbots", "Spell cast fail with delay - target name: {}, spellid: {}, bot name: {}",
|
|
||||||
// target->GetName(), spellId, bot->GetName());
|
|
||||||
// }
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2963,7 +2960,7 @@ bool PlayerbotAI::IsInVehicle(bool canControl, bool canCast, bool canAttack, boo
|
|||||||
void PlayerbotAI::WaitForSpellCast(Spell* spell)
|
void PlayerbotAI::WaitForSpellCast(Spell* spell)
|
||||||
{
|
{
|
||||||
SpellInfo const* spellInfo = spell->GetSpellInfo();
|
SpellInfo const* spellInfo = spell->GetSpellInfo();
|
||||||
uint32 castTime = spellInfo->CalcCastTime(bot, spell);
|
uint32 castTime = spell->GetCastTime();
|
||||||
// float castTime = spell->GetCastTime();
|
// float castTime = spell->GetCastTime();
|
||||||
// if (spellInfo->IsChanneled())
|
// if (spellInfo->IsChanneled())
|
||||||
// {
|
// {
|
||||||
|
|||||||
@@ -230,10 +230,8 @@ bool UseItemAction::UseItem(Item* item, ObjectGuid goGuid, Item* itemTarget, Uni
|
|||||||
targetSelected = true;
|
targetSelected = true;
|
||||||
out << " on "<< chat->FormatItem(itemForSpell->GetTemplate());
|
out << " on "<< chat->FormatItem(itemForSpell->GetTemplate());
|
||||||
}
|
}
|
||||||
|
uint32 castTime = spellInfo->CalcCastTime();
|
||||||
Spell* spell = new Spell(bot, spellInfo, TRIGGERED_NONE);
|
botAI->SetNextCheckDelay(castTime + sPlayerbotAIConfig->reactDelay);
|
||||||
botAI->WaitForSpellCast(spell);
|
|
||||||
delete spell;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ float CastTimeMultiplier::GetValue(Action* action)
|
|||||||
if ((spellInfo->Targets & TARGET_FLAG_DEST_LOCATION) != 0 || (spellInfo->Targets & TARGET_FLAG_SOURCE_LOCATION) != 0)
|
if ((spellInfo->Targets & TARGET_FLAG_DEST_LOCATION) != 0 || (spellInfo->Targets & TARGET_FLAG_SOURCE_LOCATION) != 0)
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
|
|
||||||
uint32 castTime = spellInfo->CalcCastTime();
|
uint32 castTime = spellInfo->CalcCastTime(bot);
|
||||||
|
|
||||||
if (spellInfo->IsChanneled())
|
if (spellInfo->IsChanneled())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ float AvoidAoeStrategyMultiplier::GetValue(Action* action)
|
|||||||
else if (spellId && pSpellInfo->Targets & TARGET_FLAG_SOURCE_LOCATION)
|
else if (spellId && pSpellInfo->Targets & TARGET_FLAG_SOURCE_LOCATION)
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
|
|
||||||
uint32 castTime = pSpellInfo->CalcCastTime();
|
uint32 castTime = pSpellInfo->CalcCastTime(bot);
|
||||||
|
|
||||||
if (AI_VALUE2(bool, "has area debuff", "self target") && spellId && castTime > 0)
|
if (AI_VALUE2(bool, "has area debuff", "self target") && spellId && castTime > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user