Skip to content

Commit a7b885d

Browse files
authored
Merge pull request mod-playerbots#2629 from mod-playerbots/test-staging
Test staging
2 parents ba46fcd + 8f812e3 commit a7b885d

11 files changed

Lines changed: 26 additions & 34 deletions

File tree

src/Ai/Base/Actions/LootAction.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,9 @@ bool OpenLootAction::DoLoot(LootObject& lootObject)
140140
if (go && (go->GetGoState() != GO_STATE_READY))
141141
return false;
142142

143-
// This prevents dungeon chests like Tribunal Chest (Halls of Stone) from being ninja'd by the bots
144-
if (go && go->HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND))
143+
// This prevents dungeon chests like Tribunal Chest (Halls of Stone) from being ninja'd by the bots.
144+
// Quest objects carry the same flag but are gated on quest state, which ActivateToQuest answers.
145+
if (go && go->HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND) && !go->ActivateToQuest(bot))
145146
return false;
146147

147148
// This prevents raid chests like Gunship Armory (ICC) from being ninja'd by the bots

src/Ai/Base/Trigger/WithinAreaTrigger.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ bool WithinAreaTrigger::IsPointInAreaTriggerZone(AreaTrigger const* atEntry, uin
6262
float dz = z - atEntry->z;
6363
float dx = rotPlayerX - atEntry->x;
6464
float dy = rotPlayerY - atEntry->y;
65-
if ((fabs(dx) > atEntry->x / 2 + delta) || (fabs(dy) > atEntry->y / 2 + delta) ||
66-
(fabs(dz) > atEntry->z / 2 + delta))
65+
if ((fabs(dx) > atEntry->length / 2 + delta) || (fabs(dy) > atEntry->width / 2 + delta) ||
66+
(fabs(dz) > atEntry->height / 2 + delta))
6767
{
6868
return false;
6969
}

src/Ai/Base/Value/QuestValues.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ std::vector<GuidPosition> ActiveQuestObjectivesValue::Calculate()
278278

279279
if (quest->RequiredNpcOrGoCount[objective])
280280
{
281-
uint32 reqCount = quest->RequiredItemCount[objective];
281+
uint32 reqCount = quest->RequiredNpcOrGoCount[objective];
282282
uint32 hasCount = statusData.CreatureOrGOCount[objective];
283283

284284
if (!reqCount || hasCount >= reqCount)

src/Ai/Class/Druid/Strategy/BearDruidStrategy.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class BearDruidStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
1919
creators["bash"] = &bash;
2020
creators["swipe (bear)"] = &swipe_bear;
2121
creators["lacerate"] = &lacerate;
22+
creators["taunt spell"] = &growl; // Empty ActionNode needed to register as taunt spell
2223
}
2324

2425
private:
@@ -81,6 +82,16 @@ class BearDruidStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
8182
/*C*/ {}
8283
);
8384
}
85+
86+
static ActionNode* growl([[maybe_unused]] PlayerbotAI* botAI)
87+
{
88+
return new ActionNode(
89+
"growl",
90+
/*P*/ {},
91+
/*A*/ {},
92+
/*C*/ {}
93+
);
94+
}
8495
};
8596

8697
BearDruidStrategy::BearDruidStrategy(PlayerbotAI* botAI) : FeralDruidStrategy(botAI)

src/Ai/Dungeon/DungeonStrategyContext.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,6 @@
2525
#include "PoSStrategy.h"
2626
#include "TOCStrategy.h"
2727

28-
/*
29-
Full list/TODO:
30-
31-
Trial of the Champion - ToC
32-
Alliance Champions: Deathstalker Visceri, Eressea Dawnsinger, Mokra the Skullcrusher, Runok Wildmane, Zul'tore
33-
Horde Champions: Ambrose Boltspark, Colosos, Jacob Alerius, Jaelyne Evensong, Lana Stouthammer
34-
Argent Champion: Argent Confessor Paletress/Eadric the Pure
35-
The Black Knight
36-
Halls of Reflection - HoR
37-
Falric, Marwyn, The Lich King
38-
Pit of Saron - PoS
39-
Forgemaster Garfrost, Krick & Ick, Scourgelord Tyrannus
40-
The Forge of Souls - FoS
41-
Bronjahm, Devourer of Souls
42-
43-
*/
44-
4528
class DungeonStrategyContext : public NamedObjectContext<Strategy>
4629
{
4730
public:
@@ -67,7 +50,6 @@ class DungeonStrategyContext : public NamedObjectContext<Strategy>
6750
creators["wotlk-up"] = &DungeonStrategyContext::wotlk_up; // Utgarde Pinnacle
6851
creators["wotlk-cos"] = &DungeonStrategyContext::wotlk_cos; // The Culling of Stratholme
6952
creators["wotlk-toc"] = &DungeonStrategyContext::wotlk_toc; // Trial of the Champion
70-
creators["wotlk-hor"] = &DungeonStrategyContext::wotlk_hor; // Halls of Reflection
7153
creators["wotlk-pos"] = &DungeonStrategyContext::wotlk_pos; // Pit of Saron
7254
creators["wotlk-fos"] = &DungeonStrategyContext::wotlk_fos; // The Forge of Souls
7355
}
@@ -88,8 +70,6 @@ class DungeonStrategyContext : public NamedObjectContext<Strategy>
8870
static Strategy* wotlk_fos(PlayerbotAI* botAI) { return new WotlkDungeonFoSStrategy(botAI); }
8971
static Strategy* wotlk_pos(PlayerbotAI* botAI) { return new WotlkDungeonPoSStrategy(botAI); }
9072
static Strategy* wotlk_toc(PlayerbotAI* botAI) { return new WotlkDungeonToCStrategy(botAI); }
91-
// NYI from here down
92-
static Strategy* wotlk_hor(PlayerbotAI* botAI) { return new WotlkDungeonUKStrategy(botAI); }
9373
};
9474

9575
#endif

src/Ai/Dungeon/WotlkDungeonActionContext.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,5 @@
2222
#include "FoSActionContext.h"
2323
#include "PoSActionContext.h"
2424
#include "TOCActionContext.h"
25-
// #include "HallsOfReflection/HallsOfReflectionActionContext.h"
2625

2726
#endif

src/Ai/Dungeon/WotlkDungeonTriggerContext.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,5 @@
2222
#include "FoSTriggerContext.h"
2323
#include "PoSTriggerContext.h"
2424
#include "TOCTriggerContext.h"
25-
// #include "HallsOfReflection/HallsOfReflectionTriggerContext.h"
2625

2726
#endif

src/Ai/Raid/OS/OSActions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ bool AvoidFlameTsunamiAction::Execute(Event /*event*/)
124124
// I always saw these accurate to around 6 decimal places, but if there are issues,
125125
// can switch this to abs comparison of floats which would technically be more robust.
126126
int posY = (int) unit->GetPositionY();
127-
if (posY == 505 || posY == 555) // RIGHT WAVE
127+
if (posY == 500 || posY == 564) // RIGHT WAVE
128128
{
129129
bool wavePassed = currentPos.GetPositionX() > unit->GetPositionX();
130130
if (wavePassed)

src/Bot/PlayerbotAI.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,7 @@ void PlayerbotAI::ApplyInstanceStrategies(uint32 mapId, bool tellMaster)
16251625
"aq20", "blacktemple", "bwl", "gruulslair", "hyjal", "icc", "karazhan",
16261626
"magtheridon", "moltencore", "naxx", "onyxia", "rs", "ssc", "tbc-ac", "tempestkeep",
16271627
"ulduar", "voa", "wotlk-an", "wotlk-cos", "wotlk-dtk", "wotlk-eoe", "wotlk-fos",
1628-
"wotlk-gd", "wotlk-hol", "wotlk-hor", "wotlk-hos", "wotlk-nex", "wotlk-occ",
1628+
"wotlk-gd", "wotlk-hol", "wotlk-hos", "wotlk-nex", "wotlk-occ",
16291629
"wotlk-ok", "wotlk-os", "wotlk-pos", "wotlk-toc", "wotlk-uk", "wotlk-up",
16301630
"wotlk-vh", "zulaman"
16311631
};
@@ -1741,9 +1741,6 @@ void PlayerbotAI::ApplyInstanceStrategies(uint32 mapId, bool tellMaster)
17411741
case 658:
17421742
strategyName = "wotlk-pos"; // Pit of Saron
17431743
break;
1744-
case 668:
1745-
strategyName = "wotlk-hor"; // Halls of Reflection
1746-
break;
17471744
case 724:
17481745
strategyName = "rs"; // Ruby Sanctum
17491746
break;

src/Mgr/Item/LootObjectStack.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,12 @@ bool LootObject::IsLootPossible(Player* bot)
308308
// Prevent bot from running to chests that are unlootable (e.g. Gunship Armory before completing the event) or on
309309
// respawn time
310310
GameObject* go = botAI->GetGameObject(guid);
311-
if (go && (go->HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND | GO_FLAG_NOT_SELECTABLE) || !go->isSpawned()))
311+
if (go && (go->HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE) || !go->isSpawned()))
312+
return false;
313+
314+
// Conditional objects (quest chests, goobers, ...) are gated client-side on quest state.
315+
// A bot has no client, so make the same call the server makes for one.
316+
if (go && go->HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND) && !go->ActivateToQuest(bot))
312317
return false;
313318

314319
if (skillId == SKILL_NONE)

0 commit comments

Comments
 (0)