From 0b3292c1d0d609c3d727ba96497d72b75baa57d5 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Mon, 9 Sep 2024 22:30:17 +0800 Subject: [PATCH 1/5] Temporary ammo init fix --- src/RandomItemMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RandomItemMgr.cpp b/src/RandomItemMgr.cpp index 157ca308..2905174c 100644 --- a/src/RandomItemMgr.cpp +++ b/src/RandomItemMgr.cpp @@ -2322,7 +2322,7 @@ void RandomItemMgr::BuildAmmoCache() for (uint32 subClass = ITEM_SUBCLASS_ARROW; subClass <= ITEM_SUBCLASS_BULLET; subClass++) { QueryResult results = WorldDatabase.Query( - "SELECT entry, Flags FROM item_template WHERE class = {} AND subclass = {} AND RequiredLevel <= {} " + "SELECT entry, Flags FROM item_template WHERE class = {} AND subclass = {} AND RequiredLevel <= {} and duration = 0 " "ORDER BY stackable DESC, RequiredLevel DESC", ITEM_CLASS_PROJECTILE, subClass, level); if (!results) From b81ccfa8295ca414d034d64e4900328c5b564b4c Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Mon, 9 Sep 2024 22:34:16 +0800 Subject: [PATCH 2/5] Reduce inner focus usage --- src/strategy/priest/GenericPriestStrategy.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/strategy/priest/GenericPriestStrategy.cpp b/src/strategy/priest/GenericPriestStrategy.cpp index 8ef2c3ae..40bae42d 100644 --- a/src/strategy/priest/GenericPriestStrategy.cpp +++ b/src/strategy/priest/GenericPriestStrategy.cpp @@ -31,6 +31,8 @@ void GenericPriestStrategy::InitTriggers(std::vector& triggers) // NextAction("inner focus", 42.0f), nullptr))); triggers.push_back(new TriggerNode("medium mana", // NextAction::array(0, new NextAction("symbol of hope", ACTION_EMERGENCY), nullptr))); triggers.push_back(new // TriggerNode("low mana", NextAction::array(0, new NextAction("consume magic", 10.0f), nullptr))); + // triggers.push_back( + // new TriggerNode("inner focus", NextAction::array(0, new NextAction("inner focus", 42.0f), nullptr))); triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("desperate prayer", ACTION_HIGH + 5), nullptr))); // triggers.push_back(new TriggerNode("enemy is close", NextAction::array(0, new @@ -43,7 +45,10 @@ void GenericPriestStrategy::InitTriggers(std::vector& triggers) new TriggerNode("low health", NextAction::array(0, new NextAction("power word: shield", ACTION_HIGH), NULL))); triggers.push_back( - new TriggerNode("medium mana", NextAction::array(0, new NextAction("shadowfiend", ACTION_HIGH + 1), NULL))); + new TriggerNode("medium mana", + NextAction::array(0, + new NextAction("shadowfiend", ACTION_HIGH + 2), + new NextAction("inner focus", ACTION_HIGH + 1), nullptr))); triggers.push_back( new TriggerNode("low mana", NextAction::array(0, new NextAction("hymn of hope", ACTION_HIGH), NULL))); @@ -72,8 +77,6 @@ void PriestCureStrategy::InitTriggers(std::vector& triggers) void PriestBoostStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back( - new TriggerNode("inner focus", NextAction::array(0, new NextAction("inner focus", 42.0f), nullptr))); triggers.push_back( new TriggerNode("power infusion", NextAction::array(0, new NextAction("power infusion", 41.0f), nullptr))); triggers.push_back(new TriggerNode("boost", NextAction::array(0, new NextAction("shadowfiend", 20.0f), nullptr))); From bca621a883c573b6d888fba8f69d0f8e0bc159a9 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Tue, 10 Sep 2024 11:52:22 +0800 Subject: [PATCH 3/5] Disable pet taunt --- src/strategy/actions/GenericActions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strategy/actions/GenericActions.cpp b/src/strategy/actions/GenericActions.cpp index 84997212..9682d2ef 100644 --- a/src/strategy/actions/GenericActions.cpp +++ b/src/strategy/actions/GenericActions.cpp @@ -38,7 +38,7 @@ bool TogglePetSpellAutoCastAction::Execute(Event event) bool shouldApply = true; // imp's spell, felhunte's intelligence, cat stealth if (spellId == 4511 || spellId == 1742 || spellId == 54424 || spellId == 57564 || spellId == 57565 || - spellId == 57566 || spellId == 57567 || spellId == 24450) + spellId == 57566 || spellId == 57567 || spellId == 24450 || spellId == 53477) { shouldApply = false; } From 25c46037cdd5c5872b63b83e16de26386a823ebc Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Tue, 10 Sep 2024 20:45:46 +0800 Subject: [PATCH 4/5] Reset prioritized targets --- conf/playerbots.conf.dist | 2 +- src/PlayerbotAI.cpp | 1 + src/strategy/actions/ChatShortcutActions.cpp | 2 +- src/strategy/actions/UseMeetingStoneAction.cpp | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 518ae5ea..f186c5f7 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -802,7 +802,7 @@ AiPlayerbot.PremadeSpecGlyph.2.0 = 41106,43367,45741,43369,43365,41109 AiPlayerbot.PremadeSpecLink.2.0.60 = 50350151020013053100515221 AiPlayerbot.PremadeSpecLink.2.0.80 = 50350152220013053100515221-503201312 AiPlayerbot.PremadeSpecName.2.1 = prot pve -AiPlayerbot.PremadeSpecGlyph.2.1 = 41100,43367,43869,43369,43365,45745 +AiPlayerbot.PremadeSpecGlyph.2.1 = 41099,43367,43869,43369,43365,45745 AiPlayerbot.PremadeSpecLink.2.1.60 = -05005135203102311333112321 AiPlayerbot.PremadeSpecLink.2.1.80 = -05005135203102311333312321-502302012003 AiPlayerbot.PremadeSpecName.2.2 = ret pve diff --git a/src/PlayerbotAI.cpp b/src/PlayerbotAI.cpp index 453544ff..460544c8 100644 --- a/src/PlayerbotAI.cpp +++ b/src/PlayerbotAI.cpp @@ -682,6 +682,7 @@ void PlayerbotAI::Reset(bool full) aiObjectContext->GetValue("old target")->Set(nullptr); aiObjectContext->GetValue("current target")->Set(nullptr); + aiObjectContext->GetValue("prioritized targets")->Reset(); aiObjectContext->GetValue("pull target")->Set(ObjectGuid::Empty); aiObjectContext->GetValue("rpg target")->Set(GuidPosition()); aiObjectContext->GetValue("loot target")->Set(LootObject()); diff --git a/src/strategy/actions/ChatShortcutActions.cpp b/src/strategy/actions/ChatShortcutActions.cpp index f158ca29..30d4c2f8 100644 --- a/src/strategy/actions/ChatShortcutActions.cpp +++ b/src/strategy/actions/ChatShortcutActions.cpp @@ -35,7 +35,7 @@ bool FollowChatShortcutAction::Execute(Event event) // botAI->Reset(); botAI->ChangeStrategy("+follow,-passive,-grind,-move from group", BOT_STATE_NON_COMBAT); botAI->ChangeStrategy("-follow,-passive,-grind,-move from group", BOT_STATE_COMBAT); - botAI->GetAiObjectContext()->GetValue("prioritized targets")->Set({}); + botAI->GetAiObjectContext()->GetValue("prioritized targets")->Reset(); PositionMap& posMap = context->GetValue("position")->Get(); PositionInfo pos = posMap["return"]; diff --git a/src/strategy/actions/UseMeetingStoneAction.cpp b/src/strategy/actions/UseMeetingStoneAction.cpp index f5d61b01..071b5b44 100644 --- a/src/strategy/actions/UseMeetingStoneAction.cpp +++ b/src/strategy/actions/UseMeetingStoneAction.cpp @@ -218,7 +218,7 @@ bool SummonAction::Teleport(Player* summoner, Player* player) { bot->ResurrectPlayer(1.0f, false); botAI->TellMasterNoFacing("I live, again!"); - botAI->GetAiObjectContext()->GetValue("prioritized targets")->Set({}); + botAI->GetAiObjectContext()->GetValue("prioritized targets")->Reset(); } player->GetMotionMaster()->Clear(); From 1005184adc0ba86373557560082e3013bcc9cfa3 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Tue, 10 Sep 2024 23:29:02 +0800 Subject: [PATCH 5/5] Fix prioritized targets reset --- src/PlayerbotAI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PlayerbotAI.cpp b/src/PlayerbotAI.cpp index 460544c8..3ebbe5f7 100644 --- a/src/PlayerbotAI.cpp +++ b/src/PlayerbotAI.cpp @@ -682,7 +682,7 @@ void PlayerbotAI::Reset(bool full) aiObjectContext->GetValue("old target")->Set(nullptr); aiObjectContext->GetValue("current target")->Set(nullptr); - aiObjectContext->GetValue("prioritized targets")->Reset(); + aiObjectContext->GetValue("prioritized targets")->Reset(); aiObjectContext->GetValue("pull target")->Set(ObjectGuid::Empty); aiObjectContext->GetValue("rpg target")->Set(GuidPosition()); aiObjectContext->GetValue("loot target")->Set(LootObject());