Reduce delay time

This commit is contained in:
Yunfan Li
2024-01-06 17:53:36 +08:00
parent 600228e3fd
commit 5fbd55dc56
2 changed files with 5 additions and 5 deletions

View File

@@ -2435,7 +2435,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget)
if (failWithDelay)
{
SetNextCheckDelay(sPlayerbotAIConfig->globalCoolDown);
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());
@@ -2502,7 +2502,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget)
if (bot->isMoving() && spell->GetCastTime())
{
// bot->StopMoving();
SetNextCheckDelay(sPlayerbotAIConfig->globalCoolDown);
SetNextCheckDelay(sPlayerbotAIConfig->reactDelay);
spell->cancel();
delete spell;
return false;
@@ -2656,7 +2656,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, float x, float y, float z, Item* ite
if (bot->isMoving() && spell->GetCastTime())
{
// bot->StopMoving();
SetNextCheckDelay(sPlayerbotAIConfig->globalCoolDown);
SetNextCheckDelay(sPlayerbotAIConfig->reactDelay);
spell->cancel();
delete spell;
return false;
@@ -2842,7 +2842,7 @@ bool PlayerbotAI::CastVehicleSpell(uint32 spellId, Unit* target)
if (failWithDelay)
{
SetNextCheckDelay(sPlayerbotAIConfig->globalCoolDown);
SetNextCheckDelay(sPlayerbotAIConfig->reactDelay);
return false;
}

View File

@@ -101,7 +101,7 @@ bool CastCustomSpellAction::Execute(Event event)
if (target != bot && !bot->HasInArc(CAST_ANGLE_IN_FRONT, target, sPlayerbotAIConfig->sightDistance))
{
sServerFacade->SetFacingTo(bot, target);
botAI->SetNextCheckDelay(sPlayerbotAIConfig->globalCoolDown);
botAI->SetNextCheckDelay(sPlayerbotAIConfig->reactDelay);
msg << "cast " << text;
botAI->HandleCommand(CHAT_MSG_WHISPER, msg.str(), master);