From 01b04742b79144e7b10609dd6f79b7d950d05c30 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Thu, 8 Feb 2024 01:37:53 +0800 Subject: [PATCH] Loot when moving --- conf/playerbots.conf.dist | 2 +- src/strategy/actions/LootAction.cpp | 7 +- .../GenericPaladinStrategyActionNodeFactory.h | 120 +++++++++--------- 3 files changed, 67 insertions(+), 62 deletions(-) diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 7f54bfc7..59123fb3 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -485,7 +485,7 @@ AiPlayerbot.PremadeSpecName.3.2 = surv pve AiPlayerbot.PremadeSpecLink.3.2.60 = AiPlayerbot.PremadeSpecLink.3.2.80 = -0053041-5000032500033330523134321331 # Rogue -AiPlayerbot.PremadeSpecName.4.0 = ass pve +AiPlayerbot.PremadeSpecName.4.0 = as pve AiPlayerbot.PremadeSpecLink.4.0.60 = AiPlayerbot.PremadeSpecLink.4.0.80 = 005323005350100520103331051-005005003-502 AiPlayerbot.PremadeSpecName.4.1 = combat pve diff --git a/src/strategy/actions/LootAction.cpp b/src/strategy/actions/LootAction.cpp index 04d9f1c8..f0526328 100644 --- a/src/strategy/actions/LootAction.cpp +++ b/src/strategy/actions/LootAction.cpp @@ -84,6 +84,11 @@ bool OpenLootAction::DoLoot(LootObject& lootObject) return true; } + if (bot->isMoving()) + { + bot->StopMoving(); + } + if (creature) { SkillType skill = creature->GetCreatureTemplate()->GetRequiredLootSkill(); @@ -119,7 +124,7 @@ bool OpenLootAction::DoLoot(LootObject& lootObject) uint32 spellId = GetOpeningSpell(lootObject); if (!spellId) return false; - + return botAI->CastSpell(spellId, bot); } diff --git a/src/strategy/paladin/GenericPaladinStrategyActionNodeFactory.h b/src/strategy/paladin/GenericPaladinStrategyActionNodeFactory.h index b07b30f5..91866b60 100644 --- a/src/strategy/paladin/GenericPaladinStrategyActionNodeFactory.h +++ b/src/strategy/paladin/GenericPaladinStrategyActionNodeFactory.h @@ -48,58 +48,58 @@ class GenericPaladinStrategyActionNodeFactory : public NamedObjectFactory