-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #632 from Bobblybook/master
Utgarde Pinnacle, CoS & additional value entry
- Loading branch information
Showing
31 changed files
with
665 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeActionContext.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef _PLAYERBOT_WOTLKDUNGEONCOSACTIONCONTEXT_H | ||
#define _PLAYERBOT_WOTLKDUNGEONCOSACTIONCONTEXT_H | ||
|
||
#include "Action.h" | ||
#include "NamedObjectContext.h" | ||
#include "CullingOfStratholmeActions.h" | ||
|
||
class WotlkDungeonCoSActionContext : public NamedObjectContext<Action> | ||
{ | ||
public: | ||
WotlkDungeonCoSActionContext() { | ||
creators["explode ghoul spread"] = &WotlkDungeonCoSActionContext::explode_ghoul_spread; | ||
creators["epoch stack"] = &WotlkDungeonCoSActionContext::epoch_stack; | ||
} | ||
private: | ||
static Action* explode_ghoul_spread(PlayerbotAI* ai) { return new ExplodeGhoulSpreadAction(ai); } | ||
static Action* epoch_stack(PlayerbotAI* ai) { return new EpochStackAction(ai); } | ||
}; | ||
|
||
#endif |
54 changes: 54 additions & 0 deletions
54
src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeActions.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#include "Playerbots.h" | ||
#include "CullingOfStratholmeActions.h" | ||
#include "CullingOfStratholmeStrategy.h" | ||
|
||
|
||
bool ExplodeGhoulSpreadAction::Execute(Event event) | ||
{ | ||
Unit* boss = AI_VALUE2(Unit*, "find target", "salramm the fleshcrafter"); | ||
if (!boss) { return false; } | ||
|
||
float distance = 10.0f; | ||
float distanceExtra = 2.0f; | ||
GuidVector corpses = AI_VALUE(GuidVector, "nearest corpses"); | ||
for (auto i = corpses.begin(); i != corpses.end(); ++i) | ||
{ | ||
Unit* unit = botAI->GetUnit(*i); | ||
if (unit && unit->GetEntry() == NPC_GHOUL_MINION) | ||
{ | ||
float currentDistance = bot->GetExactDist2d(unit); | ||
if (currentDistance < distance + distanceExtra) | ||
{ | ||
return MoveAway(unit, distance + distanceExtra - currentDistance); | ||
} | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
bool EpochStackAction::isUseful() | ||
{ | ||
// Minimum hunter range is 5, but values too close to this seem to cause issues.. | ||
// Hunter bots will try and melee in between ranged attacks, or just melee entirely at 5 as they are in range. | ||
// 7.5 or 8.0 solves this for this boss. | ||
// Unfortunately at this range the boss will charge. So I guess just don't stack as a hunter.. | ||
// if(bot->getClass() == CLASS_HUNTER) | ||
// { | ||
// return AI_VALUE2(float, "distance", "current target") > 7.5f; | ||
// } | ||
// else | ||
return !(bot->getClass() == CLASS_HUNTER) && AI_VALUE2(float, "distance", "current target") > 5.0f; | ||
} | ||
bool EpochStackAction::Execute(Event event) | ||
{ | ||
Unit* boss = AI_VALUE2(Unit*, "find target", "chrono-lord epoch"); | ||
if (!boss) { return false; } | ||
|
||
float maxMovement = 10.0f; | ||
// if(bot->getClass() == CLASS_HUNTER) | ||
// { | ||
// return Move(bot->GetAngle(boss), fmin(bot->GetExactDist2d(boss) - 6.5f, maxMovement)); | ||
// } | ||
// else | ||
return Move(bot->GetAngle(boss), fmin(bot->GetExactDist2d(boss), maxMovement)); | ||
} |
26 changes: 26 additions & 0 deletions
26
src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeActions.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef _PLAYERBOT_WOTLKDUNGEONCOSACTIONS_H | ||
#define _PLAYERBOT_WOTLKDUNGEONCOSACTIONS_H | ||
|
||
#include "Action.h" | ||
#include "AttackAction.h" | ||
#include "GenericSpellActions.h" | ||
#include "PlayerbotAI.h" | ||
#include "Playerbots.h" | ||
#include "CullingOfStratholmeTriggers.h" | ||
|
||
class ExplodeGhoulSpreadAction : public MovementAction | ||
{ | ||
public: | ||
ExplodeGhoulSpreadAction(PlayerbotAI* ai) : MovementAction(ai, "explode ghoul spread") {} | ||
bool Execute(Event event) override; | ||
}; | ||
|
||
class EpochStackAction : public MovementAction | ||
{ | ||
public: | ||
EpochStackAction(PlayerbotAI* ai) : MovementAction(ai, "epoch stack") {} | ||
bool Execute(Event event) override; | ||
bool isUseful() override; | ||
}; | ||
|
||
#endif |
19 changes: 19 additions & 0 deletions
19
src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeMultipliers.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "CullingOfStratholmeMultipliers.h" | ||
#include "CullingOfStratholmeActions.h" | ||
#include "GenericSpellActions.h" | ||
#include "ChooseTargetActions.h" | ||
#include "MovementActions.h" | ||
#include "CullingOfStratholmeTriggers.h" | ||
#include "Action.h" | ||
|
||
float EpochMultiplier::GetValue(Action* action) | ||
{ | ||
Unit* boss = AI_VALUE2(Unit*, "find target", "chrono-lord epoch"); | ||
if (!boss) { return 1.0f; } | ||
|
||
if (bot->getClass() == CLASS_HUNTER) { return 1.0f; } | ||
|
||
if (dynamic_cast<FleeAction*>(action)) { return 0.0f; } | ||
|
||
return 1.0f; | ||
} |
15 changes: 15 additions & 0 deletions
15
src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeMultipliers.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#ifndef _PLAYERBOT_WOTLKDUNGEONCOSMULTIPLIERS_H | ||
#define _PLAYERBOT_WOTLKDUNGEONCOSMULTIPLIERS_H | ||
|
||
#include "Multiplier.h" | ||
|
||
class EpochMultiplier : public Multiplier | ||
{ | ||
public: | ||
EpochMultiplier(PlayerbotAI* ai) : Multiplier(ai, "chrono-lord epoch") {} | ||
|
||
public: | ||
virtual float GetValue(Action* action); | ||
}; | ||
|
||
#endif |
27 changes: 27 additions & 0 deletions
27
src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeStrategy.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include "CullingOfStratholmeStrategy.h" | ||
#include "CullingOfStratholmeMultipliers.h" | ||
|
||
|
||
void WotlkDungeonCoSStrategy::InitTriggers(std::vector<TriggerNode*> &triggers) | ||
{ | ||
// Meathook | ||
// Can tank this in a fixed position to allow healer to LoS the stun, probably not necessary | ||
|
||
// Salramm the Fleshcrafter | ||
triggers.push_back(new TriggerNode("explode ghoul", | ||
NextAction::array(0, new NextAction("explode ghoul spread", ACTION_MOVE + 5), nullptr))); | ||
|
||
// Chrono-Lord Epoch | ||
// Not sure if this actually works, I think I've seen him charge melee characters..? | ||
triggers.push_back(new TriggerNode("epoch ranged", | ||
NextAction::array(0, new NextAction("epoch stack", ACTION_MOVE + 5), nullptr))); | ||
|
||
// Mal'Ganis | ||
|
||
// Infinite Corruptor (Heroic only) | ||
} | ||
|
||
void WotlkDungeonCoSStrategy::InitMultipliers(std::vector<Multiplier*> &multipliers) | ||
{ | ||
multipliers.push_back(new EpochMultiplier(botAI)); | ||
} |
18 changes: 18 additions & 0 deletions
18
src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeStrategy.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef _PLAYERBOT_WOTLKDUNGEONCOSSTRATEGY_H | ||
#define _PLAYERBOT_WOTLKDUNGEONCOSSTRATEGY_H | ||
|
||
#include "Multiplier.h" | ||
#include "AiObjectContext.h" | ||
#include "Strategy.h" | ||
|
||
|
||
class WotlkDungeonCoSStrategy : public Strategy | ||
{ | ||
public: | ||
WotlkDungeonCoSStrategy(PlayerbotAI* ai) : Strategy(ai) {} | ||
virtual std::string const getName() override { return "culling of stratholme"; } | ||
virtual void InitTriggers(std::vector<TriggerNode*> &triggers) override; | ||
virtual void InitMultipliers(std::vector<Multiplier*> &multipliers) override; | ||
}; | ||
|
||
#endif |
22 changes: 22 additions & 0 deletions
22
src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeTriggerContext.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef _PLAYERBOT_WOTLKDUNGEONCOSTRIGGERCONTEXT_H | ||
#define _PLAYERBOT_WOTLKDUNGEONCOSTRIGGERCONTEXT_H | ||
|
||
#include "NamedObjectContext.h" | ||
#include "AiObjectContext.h" | ||
#include "CullingOfStratholmeTriggers.h" | ||
|
||
class WotlkDungeonCoSTriggerContext : public NamedObjectContext<Trigger> | ||
{ | ||
public: | ||
WotlkDungeonCoSTriggerContext() | ||
{ | ||
creators["explode ghoul"] = &WotlkDungeonCoSTriggerContext::explode_ghoul; | ||
creators["epoch ranged"] = &WotlkDungeonCoSTriggerContext::epoch_ranged; | ||
|
||
} | ||
private: | ||
static Trigger* explode_ghoul(PlayerbotAI* ai) { return new ExplodeGhoulTrigger(ai); } | ||
static Trigger* epoch_ranged(PlayerbotAI* ai) { return new EpochRangedTrigger(ai); } | ||
}; | ||
|
||
#endif |
32 changes: 32 additions & 0 deletions
32
src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeTriggers.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "Playerbots.h" | ||
#include "CullingOfStratholmeTriggers.h" | ||
#include "AiObject.h" | ||
#include "AiObjectContext.h" | ||
|
||
|
||
bool ExplodeGhoulTrigger::IsActive() | ||
{ | ||
Unit* boss = AI_VALUE2(Unit*, "find target", "salramm the fleshcrafter"); | ||
if (!boss) { return false; } | ||
|
||
float distance = 10.0f; | ||
float distanceExtra = 2.0f; | ||
GuidVector corpses = AI_VALUE(GuidVector, "nearest corpses"); | ||
for (auto i = corpses.begin(); i != corpses.end(); ++i) | ||
{ | ||
Unit* unit = botAI->GetUnit(*i); | ||
if (unit && unit->GetEntry() == NPC_RISEN_GHOUL) | ||
{ | ||
if (bot->GetExactDist2d(unit) < distance + distanceExtra) | ||
{ | ||
return true; | ||
} | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
bool EpochRangedTrigger::IsActive() | ||
{ | ||
return !botAI->IsMelee(bot) && AI_VALUE2(Unit*, "find target", "chrono-lord epoch"); | ||
} |
29 changes: 29 additions & 0 deletions
29
src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeTriggers.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef _PLAYERBOT_WOTLKDUNGEONCOSTRIGGERS_H | ||
#define _PLAYERBOT_WOTLKDUNGEONCOSTRIGGERS_H | ||
|
||
#include "Trigger.h" | ||
#include "PlayerbotAIConfig.h" | ||
#include "GenericTriggers.h" | ||
#include "DungeonStrategyUtils.h" | ||
|
||
enum CullingOfStratholmeIDs | ||
{ | ||
// Salramm the Fleshcrafter | ||
NPC_GHOUL_MINION = 27733, | ||
}; | ||
|
||
class ExplodeGhoulTrigger : public Trigger | ||
{ | ||
public: | ||
ExplodeGhoulTrigger(PlayerbotAI* ai) : Trigger(ai, "explode ghoul") {} | ||
bool IsActive() override; | ||
}; | ||
|
||
class EpochRangedTrigger : public Trigger | ||
{ | ||
public: | ||
EpochRangedTrigger(PlayerbotAI* ai) : Trigger(ai, "chrono-lord epoch ranged") {} | ||
bool IsActive() override; | ||
}; | ||
|
||
#endif |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.