Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b98bd7f
aq40 test: crude but functional
acore-crap Nov 5, 2024
888e17b
Merge branch 'liyunfan1223:master' into CopyPasteException
valsan-azerty-boi Mar 5, 2025
bb6c33f
auto apply aq40 strat
valsan-azerty-boi Mar 5, 2025
6c3116e
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi Mar 27, 2025
743a507
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi Mar 28, 2025
33f32ba
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi Mar 30, 2025
84f9deb
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi Mar 31, 2025
7f1717e
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi Mar 31, 2025
d03c148
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi Apr 6, 2025
ec390ca
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi Apr 7, 2025
49e81eb
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi Apr 8, 2025
c05c5ff
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi Apr 9, 2025
f8a53f9
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi Apr 10, 2025
1eff832
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi Apr 11, 2025
d960d80
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi Apr 14, 2025
06f1eb0
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi Apr 17, 2025
e033308
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi Apr 19, 2025
5589f91
Merge branch 'master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi Apr 21, 2025
cb20f2c
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi Apr 22, 2025
6b81a9c
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi Apr 26, 2025
ed7cae4
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi Apr 29, 2025
40d0bfd
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi Apr 30, 2025
4cac420
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi May 1, 2025
ee444cd
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi May 2, 2025
a8670d6
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi May 3, 2025
24a580b
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi May 5, 2025
b2b8e74
Merge branch 'liyunfan1223:master' into ft/aq40-strat-by-acore-crap
valsan-azerty-boi May 10, 2025
39de97f
Update AiObjectContext.cpp
valsan-azerty-boi May 10, 2025
8e9adb8
Merge branch 'ft/aq40-strat-by-acore-crap' into AQ40
Celandriel Nov 5, 2025
2032fab
fix merge error.
Celandriel Nov 5, 2025
063d7c5
Formatting updates
Celandriel Nov 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/PlayerbotAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1531,6 +1531,9 @@ void PlayerbotAI::ApplyInstanceStrategies(uint32 mapId, bool tellMaster)
case 532:
strategyName = "karazhan"; // Karazhan
break;
case 531:
strategyName = "aq40";
break;
case 533:
strategyName = "naxx"; // Naxxramas
break;
Expand Down
29 changes: 27 additions & 2 deletions src/strategy/AiObjectContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,27 @@
#include "WarriorAiObjectContext.h"
#include "WorldPacketActionContext.h"
#include "WorldPacketTriggerContext.h"
#include "raids/RaidStrategyContext.h"
#include "raids/blackwinglair/RaidBwlActionContext.h"
#include "raids/blackwinglair/RaidBwlTriggerContext.h"
#include "raids/naxxramas/RaidNaxxActionContext.h"
#include "raids/naxxramas/RaidNaxxTriggerContext.h"
#include "raids/icecrown/RaidIccActionContext.h"
#include "raids/icecrown/RaidIccTriggerContext.h"
#include "raids/obsidiansanctum/RaidOsActionContext.h"
#include "raids/obsidiansanctum/RaidOsTriggerContext.h"
#include "raids/eyeofeternity/RaidEoEActionContext.h"
#include "raids/vaultofarchavon/RaidVoATriggerContext.h"
#include "raids/onyxia/RaidOnyxiaActionContext.h"
#include "raids/onyxia/RaidOnyxiaTriggerContext.h"
#include "raids/vaultofarchavon/RaidVoAActionContext.h"
#include "raids/eyeofeternity/RaidEoETriggerContext.h"
#include "raids/moltencore/RaidMcActionContext.h"
#include "raids/moltencore/RaidMcTriggerContext.h"
#include "raids/aq20/RaidAq20ActionContext.h"
#include "raids/aq20/RaidAq20TriggerContext.h"
#include "raids/aq40/RaidAq40ActionContext.h"
#include "raids/aq40/RaidAq40TriggerContext.h"
Comment on lines +30 to +50

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This large block of new #include directives is unsorted. Sorting them alphabetically would improve readability and make it easier to spot duplicates or missing headers in the future.

#include "dungeons/DungeonStrategyContext.h"
#include "dungeons/wotlk/WotlkDungeonActionContext.h"
#include "dungeons/wotlk/WotlkDungeonTriggerContext.h"
Expand Down Expand Up @@ -109,11 +130,13 @@ void AiObjectContext::BuildSharedActionContexts(SharedNamedObjectContextList<Act
actionContexts.Add(new ActionContext());
actionContexts.Add(new ChatActionContext());
actionContexts.Add(new WorldPacketActionContext());
actionContexts.Add(new RaidAq20ActionContext());
actionContexts.Add(new RaidMcActionContext());
actionContexts.Add(new RaidBwlActionContext());
actionContexts.Add(new RaidKarazhanActionContext());
actionContexts.Add(new RaidGruulsLairActionContext());
actionContexts.Add(new RaidOnyxiaActionContext());
actionContexts.Add(new RaidAq20ActionContext());
actionContexts.Add(new RaidAq40ActionContext());
actionContexts.Add(new RaidNaxxActionContext());
actionContexts.Add(new RaidOsActionContext());
actionContexts.Add(new RaidEoEActionContext());
Expand Down Expand Up @@ -143,11 +166,13 @@ void AiObjectContext::BuildSharedTriggerContexts(SharedNamedObjectContextList<Tr
triggerContexts.Add(new TriggerContext());
triggerContexts.Add(new ChatTriggerContext());
triggerContexts.Add(new WorldPacketTriggerContext());
triggerContexts.Add(new RaidAq20TriggerContext());
triggerContexts.Add(new RaidMcTriggerContext());
triggerContexts.Add(new RaidBwlTriggerContext());
triggerContexts.Add(new RaidKarazhanTriggerContext());
triggerContexts.Add(new RaidGruulsLairTriggerContext());
triggerContexts.Add(new RaidOnyxiaTriggerContext());
triggerContexts.Add(new RaidAq20TriggerContext());
triggerContexts.Add(new RaidAq40TriggerContext());
triggerContexts.Add(new RaidNaxxTriggerContext());
triggerContexts.Add(new RaidOsTriggerContext());
triggerContexts.Add(new RaidEoETriggerContext());
Expand Down
10 changes: 8 additions & 2 deletions src/strategy/raids/RaidStrategyContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
#include "RaidNaxxStrategy.h"
#include "RaidOsStrategy.h"
#include "RaidEoEStrategy.h"
#include "RaidMcStrategy.h"
#include "RaidAq20Strategy.h"
#include "RaidAq40Strategy.h"
#include "RaidIccStrategy.h"
Comment on lines +13 to +16

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This file now contains several duplicate entries, which can lead to compilation issues and makes the code harder to maintain. Specifically:

  • #include "RaidMcStrategy.h" and #include "RaidAq20Strategy.h" are included twice.
  • The creator entry for "aq20" is duplicated in the constructor.
  • The static method aq20 is defined twice.

Please remove these duplicate entries.

#include "RaidVoAStrategy.h"
#include "RaidUlduarStrategy.h"
#include "RaidOnyxiaStrategy.h"
Expand All @@ -20,11 +24,12 @@ class RaidStrategyContext : public NamedObjectContext<Strategy>
public:
RaidStrategyContext() : NamedObjectContext<Strategy>(false, true)
{
creators["aq20"] = &RaidStrategyContext::aq20;
creators["mc"] = &RaidStrategyContext::mc;
creators["bwl"] = &RaidStrategyContext::bwl;
creators["karazhan"] = &RaidStrategyContext::karazhan;
creators["gruulslair"] = &RaidStrategyContext::gruulslair;
creators["aq20"] = &RaidStrategyContext::aq20;
creators["aq40"] = &RaidStrategyContext::aq40;
creators["naxx"] = &RaidStrategyContext::naxx;
creators["wotlk-os"] = &RaidStrategyContext::wotlk_os;
creators["wotlk-eoe"] = &RaidStrategyContext::wotlk_eoe;
Expand All @@ -35,11 +40,12 @@ class RaidStrategyContext : public NamedObjectContext<Strategy>
}

private:
static Strategy* aq20(PlayerbotAI* botAI) { return new RaidAq20Strategy(botAI); }
static Strategy* mc(PlayerbotAI* botAI) { return new RaidMcStrategy(botAI); }
static Strategy* bwl(PlayerbotAI* botAI) { return new RaidBwlStrategy(botAI); }
static Strategy* karazhan(PlayerbotAI* botAI) { return new RaidKarazhanStrategy(botAI); }
static Strategy* gruulslair(PlayerbotAI* botAI) { return new RaidGruulsLairStrategy(botAI); }
static Strategy* aq20(PlayerbotAI* botAI) { return new RaidAq20Strategy(botAI); }
static Strategy* aq40(PlayerbotAI* botAI) { return new RaidAq40Strategy(botAI); }
static Strategy* naxx(PlayerbotAI* botAI) { return new RaidNaxxStrategy(botAI); }
static Strategy* wotlk_os(PlayerbotAI* botAI) { return new RaidOsStrategy(botAI); }
static Strategy* wotlk_eoe(PlayerbotAI* botAI) { return new RaidEoEStrategy(botAI); }
Expand Down
44 changes: 44 additions & 0 deletions src/strategy/raids/aq40/RaidAq40ActionContext.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#ifndef _PLAYERBOT_RAIDAQ40ACTIONCONTEXT_H
#define _PLAYERBOT_RAIDAQ40ACTIONCONTEXT_H

#include "Action.h"
#include "NamedObjectContext.h"
#include "RaidAq40Actions.h"

class RaidAq40ActionContext : public NamedObjectContext<Action>
{
public:
RaidAq40ActionContext()
{
creators["aq40 use resistance buffs"] = &RaidAq40ActionContext::use_resistance_buffs;
creators["aq40 move from other emperor"] = &RaidAq40ActionContext::move_from_other_emperor;
creators["aq40 attack emperor vek'lor"] = &RaidAq40ActionContext::attack_emperor_veklor;
creators["aq40 attack emperor vek'nilash"] = &RaidAq40ActionContext::attack_emperor_veknilash;
creators["aq40 attack emperor pests"] = &RaidAq40ActionContext::attack_emperor_pests;
creators["aq40 move towards emperor vek'lor"] = &RaidAq40ActionContext::move_towards_emperor_veklor;
creators["aq40 move towards emperor vek'nilash"] = &RaidAq40ActionContext::move_towards_emperor_veknilash;
creators["searing pain"] = &RaidAq40ActionContext::warlock_searing_pain;
creators["frostbolt"] = &RaidAq40ActionContext::mage_cast_frostbolt;
creators["aq40 melee viscidus"] = &RaidAq40ActionContext::melee_viscidus;
creators["aq40 ouro burrowed flee"] = &RaidAq40ActionContext::ouro_burrowed_flee;
creators["aq40 cthun1 get positioned"] = &RaidAq40ActionContext::cthun1_get_positioned;
creators["aq40 cthun2 get positioned"] = &RaidAq40ActionContext::cthun2_get_positioned;
}

private:
static Action* use_resistance_buffs(PlayerbotAI *ai) { return new Aq40UseResistanceBuffsAction(ai); }
static Action* move_from_other_emperor(PlayerbotAI* ai) { return new Aq40MoveFromOtherEmperorAction(ai); }
static Action* attack_emperor_veklor(PlayerbotAI* ai) { return new Aq40AttackEmperorVekLorAction(ai); }
static Action* attack_emperor_veknilash(PlayerbotAI* ai) { return new Aq40AttackEmperorVekNilashAction(ai); }
static Action* attack_emperor_pests(PlayerbotAI* ai) { return new Aq40AttackEmperorPestsAction(ai); }
static Action* move_towards_emperor_veklor(PlayerbotAI* ai) { return (Action *)(new Aq40MoveTowardsEmperorVekLorAction(ai)); }
static Action* move_towards_emperor_veknilash(PlayerbotAI* ai) { return (Action *)(new Aq40MoveTowardsEmperorVekNilashAction(ai)); }
Comment on lines +34 to +35

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The C-style cast (Action *) is unnecessary and potentially unsafe. C++ allows for implicit upcasting from a derived class pointer to a base class pointer, so the cast is not needed. It's also inconsistent with other creator functions in this file. Please remove the explicit cast.

Suggested change
static Action* move_towards_emperor_veklor(PlayerbotAI* ai) { return (Action *)(new Aq40MoveTowardsEmperorVekLorAction(ai)); }
static Action* move_towards_emperor_veknilash(PlayerbotAI* ai) { return (Action *)(new Aq40MoveTowardsEmperorVekNilashAction(ai)); }
static Action* move_towards_emperor_veklor(PlayerbotAI* ai) { return new Aq40MoveTowardsEmperorVekLorAction(ai); }
static Action* move_towards_emperor_veknilash(PlayerbotAI* ai) { return new Aq40MoveTowardsEmperorVekNilashAction(ai); }

static Action* warlock_searing_pain(PlayerbotAI* ai) { return new Aq40WarlockCastSearingPainAction(ai); }
static Action* mage_cast_frostbolt(PlayerbotAI* ai) { return new Aq40MageCastFrostboltAction(ai); }
static Action* melee_viscidus(PlayerbotAI* ai) { return new Aq40MeleeViscidusAction(ai); }
static Action* ouro_burrowed_flee(PlayerbotAI* ai) { return new Aq40OuroBurrowedFleeAction(ai); }
static Action* cthun1_get_positioned(PlayerbotAI* ai) { return new Aq40Cthun1PositionAction(ai); }
static Action* cthun2_get_positioned(PlayerbotAI* ai) { return new Aq40Cthun2PositionAction(ai); }
};

#endif
Loading
Loading