mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Reduce delay time
This commit is contained in:
@@ -2435,7 +2435,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget)
|
|||||||
|
|
||||||
if (failWithDelay)
|
if (failWithDelay)
|
||||||
{
|
{
|
||||||
SetNextCheckDelay(sPlayerbotAIConfig->globalCoolDown);
|
SetNextCheckDelay(sPlayerbotAIConfig->reactDelay);
|
||||||
// if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) {
|
// if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster())) {
|
||||||
// LOG_DEBUG("playerbots", "Spell cast fail with delay - target name: {}, spellid: {}, bot name: {}",
|
// LOG_DEBUG("playerbots", "Spell cast fail with delay - target name: {}, spellid: {}, bot name: {}",
|
||||||
// target->GetName(), spellId, bot->GetName());
|
// target->GetName(), spellId, bot->GetName());
|
||||||
@@ -2502,7 +2502,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget)
|
|||||||
if (bot->isMoving() && spell->GetCastTime())
|
if (bot->isMoving() && spell->GetCastTime())
|
||||||
{
|
{
|
||||||
// bot->StopMoving();
|
// bot->StopMoving();
|
||||||
SetNextCheckDelay(sPlayerbotAIConfig->globalCoolDown);
|
SetNextCheckDelay(sPlayerbotAIConfig->reactDelay);
|
||||||
spell->cancel();
|
spell->cancel();
|
||||||
delete spell;
|
delete spell;
|
||||||
return false;
|
return false;
|
||||||
@@ -2656,7 +2656,7 @@ bool PlayerbotAI::CastSpell(uint32 spellId, float x, float y, float z, Item* ite
|
|||||||
if (bot->isMoving() && spell->GetCastTime())
|
if (bot->isMoving() && spell->GetCastTime())
|
||||||
{
|
{
|
||||||
// bot->StopMoving();
|
// bot->StopMoving();
|
||||||
SetNextCheckDelay(sPlayerbotAIConfig->globalCoolDown);
|
SetNextCheckDelay(sPlayerbotAIConfig->reactDelay);
|
||||||
spell->cancel();
|
spell->cancel();
|
||||||
delete spell;
|
delete spell;
|
||||||
return false;
|
return false;
|
||||||
@@ -2842,7 +2842,7 @@ bool PlayerbotAI::CastVehicleSpell(uint32 spellId, Unit* target)
|
|||||||
|
|
||||||
if (failWithDelay)
|
if (failWithDelay)
|
||||||
{
|
{
|
||||||
SetNextCheckDelay(sPlayerbotAIConfig->globalCoolDown);
|
SetNextCheckDelay(sPlayerbotAIConfig->reactDelay);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ bool CastCustomSpellAction::Execute(Event event)
|
|||||||
if (target != bot && !bot->HasInArc(CAST_ANGLE_IN_FRONT, target, sPlayerbotAIConfig->sightDistance))
|
if (target != bot && !bot->HasInArc(CAST_ANGLE_IN_FRONT, target, sPlayerbotAIConfig->sightDistance))
|
||||||
{
|
{
|
||||||
sServerFacade->SetFacingTo(bot, target);
|
sServerFacade->SetFacingTo(bot, target);
|
||||||
botAI->SetNextCheckDelay(sPlayerbotAIConfig->globalCoolDown);
|
botAI->SetNextCheckDelay(sPlayerbotAIConfig->reactDelay);
|
||||||
|
|
||||||
msg << "cast " << text;
|
msg << "cast " << text;
|
||||||
botAI->HandleCommand(CHAT_MSG_WHISPER, msg.str(), master);
|
botAI->HandleCommand(CHAT_MSG_WHISPER, msg.str(), master);
|
||||||
|
|||||||
Reference in New Issue
Block a user