Skip to content

Commit 5ec93dd

Browse files
authored
Merge f191090 into 46f8d75
2 parents 46f8d75 + f191090 commit 5ec93dd

File tree

5 files changed

+56
-17
lines changed

5 files changed

+56
-17
lines changed

src/modules/Bots/playerbot/strategy/warrior/DpsWarriorStrategy.cpp

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ class DpsWarriorStrategyActionNodeFactory : public NamedObjectFactory<ActionNode
1010
public:
1111
DpsWarriorStrategyActionNodeFactory()
1212
{
13+
creators["mortal strike"] = &mortal_strike;
14+
creators["whirlwind"] = &whirlwind;
1315
creators["overpower"] = &overpower;
1416
creators["melee"] = &melee;
1517
creators["charge"] = &charge;
@@ -20,6 +22,20 @@ class DpsWarriorStrategyActionNodeFactory : public NamedObjectFactory<ActionNode
2022
creators["execute"] = &execute;
2123
}
2224
private:
25+
static ActionNode* mortal_strike(PlayerbotAI* ai)
26+
{
27+
return new ActionNode ("mortal strike",
28+
/*P*/ NULL,
29+
/*A*/ NextAction::array(0, new NextAction("bloodthirst"), NULL),
30+
/*C*/ NULL);
31+
}
32+
static ActionNode* whirlwind(PlayerbotAI* ai)
33+
{
34+
return new ActionNode ("whirlwind",
35+
/*P*/ NULL,
36+
/*A*/ NextAction::array(0, new NextAction("cleave"), NULL),
37+
/*C*/ NULL);
38+
}
2339
static ActionNode* overpower(PlayerbotAI* ai)
2440
{
2541
return new ActionNode ("overpower",
@@ -65,14 +81,14 @@ class DpsWarriorStrategyActionNodeFactory : public NamedObjectFactory<ActionNode
6581
static ActionNode* death_wish(PlayerbotAI* ai)
6682
{
6783
return new ActionNode ("death wish",
68-
/*P*/ NULL,
84+
/*P*/ NextAction::array(0, new NextAction("berserker stance"), NULL),
6985
/*A*/ NextAction::array(0, new NextAction("berserker rage"), NULL),
7086
/*C*/ NULL);
7187
}
7288
static ActionNode* execute(PlayerbotAI* ai)
7389
{
7490
return new ActionNode ("execute",
75-
/*P*/ NextAction::array(0, new NextAction("battle stance"), NULL),
91+
/*P*/ NULL,
7692
/*A*/ NextAction::array(0, new NextAction("heroic strike"), NULL),
7793
/*C*/ NULL);
7894
}
@@ -85,13 +101,17 @@ DpsWarriorStrategy::DpsWarriorStrategy(PlayerbotAI* ai) : GenericWarriorStrategy
85101

86102
NextAction** DpsWarriorStrategy::getDefaultActions()
87103
{
88-
return NextAction::array(0, new NextAction("bloodthirst", ACTION_NORMAL + 1), NULL);
104+
return NextAction::array(0, new NextAction("mortal strike", ACTION_NORMAL + 1), NULL);
89105
}
90106

91107
void DpsWarriorStrategy::InitTriggers(std::list<TriggerNode*> &triggers)
92108
{
93109
GenericWarriorStrategy::InitTriggers(triggers);
94110

111+
triggers.push_back(new TriggerNode(
112+
"rend",
113+
NextAction::array(0, new NextAction("rend", ACTION_NORMAL + 1), NULL)));
114+
95115
triggers.push_back(new TriggerNode(
96116
"enemy out of melee",
97117
NextAction::array(0, new NextAction("charge", ACTION_NORMAL + 9), NULL)));
@@ -126,5 +146,5 @@ void DpsWarrirorAoeStrategy::InitTriggers(std::list<TriggerNode*> &triggers)
126146

127147
triggers.push_back(new TriggerNode(
128148
"medium aoe",
129-
NextAction::array(0, new NextAction("cleave", ACTION_HIGH + 3), NULL)));
149+
NextAction::array(0, new NextAction("whirlwind", ACTION_HIGH + 4), new NextAction("cleave", ACTION_HIGH + 3), NULL)));
130150
}

src/modules/Bots/playerbot/strategy/warrior/GenericWarriorStrategy.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ void GenericWarriorStrategy::InitTriggers(std::list<TriggerNode*> &triggers)
5151
"battle shout",
5252
NextAction::array(0, new NextAction("battle shout", ACTION_HIGH + 1), NULL)));
5353

54-
triggers.push_back(new TriggerNode(
55-
"rend",
56-
NextAction::array(0, new NextAction("rend", ACTION_NORMAL + 1), NULL)));
57-
5854
triggers.push_back(new TriggerNode(
5955
"bloodrage",
6056
NextAction::array(0, new NextAction("bloodrage", ACTION_HIGH + 1), NULL)));

src/modules/Bots/playerbot/strategy/warrior/TankWarriorStrategy.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ class TankWarriorStrategyActionNodeFactory : public NamedObjectFactory<ActionNod
1212
{
1313
creators["melee"] = &melee;
1414
creators["shield wall"] = &shield_wall;
15-
creators["rend"] = &rend;
1615
creators["revenge"] = &revenge;
1716
creators["devastate"] = &devastate;
1817
creators["shockwave"] = &shockwave;
@@ -33,13 +32,6 @@ class TankWarriorStrategyActionNodeFactory : public NamedObjectFactory<ActionNod
3332
/*A*/ NextAction::array(0, new NextAction("shield block"), NULL),
3433
/*C*/ NULL);
3534
}
36-
static ActionNode* rend(PlayerbotAI* ai)
37-
{
38-
return new ActionNode ("rend",
39-
/*P*/ NextAction::array(0, new NextAction("defensive stance"), NULL),
40-
/*A*/ NULL,
41-
/*C*/ NULL);
42-
}
4335
static ActionNode* revenge(PlayerbotAI* ai)
4436
{
4537
return new ActionNode ("revenge",
@@ -110,7 +102,7 @@ void TankWarriorStrategy::InitTriggers(std::list<TriggerNode*> &triggers)
110102

111103
triggers.push_back(new TriggerNode(
112104
"light aoe",
113-
NextAction::array(0, new NextAction("thunder clap", ACTION_HIGH + 2), new NextAction("demoralizing shout", ACTION_HIGH + 2), new NextAction("cleave", ACTION_HIGH + 1), NULL)));
105+
NextAction::array(0, new NextAction("demoralizing shout", ACTION_HIGH + 2), new NextAction("cleave", ACTION_HIGH + 1), NULL)));
114106

115107
triggers.push_back(new TriggerNode(
116108
"high aoe",

src/modules/Bots/playerbot/strategy/warrior/WarriorActions.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,29 @@ namespace ai
176176
CastBerserkerRageAction(PlayerbotAI* ai) : CastBuffSpellAction(ai, "berserker rage") {}
177177
};
178178

179+
class CastBerserkerStanceAction : public CastBuffSpellAction {
180+
public:
181+
CastBerserkerStanceAction(PlayerbotAI* ai) : CastBuffSpellAction(ai, "berserker stance") {}
182+
};
183+
184+
class CastVictoryRushAction : public CastMeleeSpellAction {
185+
public:
186+
CastVictoryRushAction(PlayerbotAI* ai) : CastMeleeSpellAction(ai, "victory rush") {}
187+
};
188+
189+
class CastMortalStrikeAction : public CastBattleMeleeSpellAction {
190+
public:
191+
CastMortalStrikeAction(PlayerbotAI* ai) : CastBattleMeleeSpellAction(ai, "mortal strike") {}
192+
};
193+
194+
class CastWhirlwindAction : public CastMeleeSpellAction {
195+
public:
196+
CastWhirlwindAction(PlayerbotAI* ai) : CastMeleeSpellAction(ai, "whirlwind") {}
197+
virtual NextAction** getPrerequisites() {
198+
return NextAction::merge(NextAction::array(0, new NextAction("berserker stance"), NULL), CastMeleeSpellAction::getPrerequisites());
199+
}
200+
};
201+
179202
class CastLastStandAction : public CastBuffSpellAction {
180203
public:
181204
CastLastStandAction(PlayerbotAI* ai) : CastBuffSpellAction(ai, "last stand") {}

src/modules/Bots/playerbot/strategy/warrior/WarriorAiObjectContext.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ namespace ai
105105
public:
106106
AiObjectContextInternal()
107107
{
108+
creators["berserker stance"] = &AiObjectContextInternal::berserker_stance;
109+
creators["victory rush"] = &AiObjectContextInternal::victory_rush;
110+
creators["mortal strike"] = &AiObjectContextInternal::mortal_strike;
111+
creators["whirlwind"] = &AiObjectContextInternal::whirlwind;
108112
creators["overpower"] = &AiObjectContextInternal::overpower;
109113
creators["charge"] = &AiObjectContextInternal::charge;
110114
creators["bloodthirst"] = &AiObjectContextInternal::bloodthirst;
@@ -140,6 +144,10 @@ namespace ai
140144
}
141145

142146
private:
147+
static Action* berserker_stance(PlayerbotAI* ai) { return new CastBerserkerStanceAction(ai); }
148+
static Action* victory_rush(PlayerbotAI* ai) { return new CastVictoryRushAction(ai); }
149+
static Action* mortal_strike(PlayerbotAI* ai) { return new CastMortalStrikeAction(ai); }
150+
static Action* whirlwind(PlayerbotAI* ai) { return new CastWhirlwindAction(ai); }
143151
static Action* last_stand(PlayerbotAI* ai) { return new CastLastStandAction(ai); }
144152
static Action* cleave(PlayerbotAI* ai) { return new CastCleaveAction(ai); }
145153
static Action* concussion_blow(PlayerbotAI* ai) { return new CastConcussionBlowAction(ai); }

0 commit comments

Comments
 (0)