mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-03-07 01:20:29 +00:00
[HOT FIX] MS build issues regarding folder / command lenght usage or rc.exe (#2038)
This commit is contained in:
70
src/Ai/Dungeon/Gundrak/Action/GundrakActions.cpp
Normal file
70
src/Ai/Dungeon/Gundrak/Action/GundrakActions.cpp
Normal file
@@ -0,0 +1,70 @@
|
||||
#include "Playerbots.h"
|
||||
#include "GundrakActions.h"
|
||||
#include "GundrakStrategy.h"
|
||||
|
||||
bool AvoidPoisonNovaAction::Execute(Event event)
|
||||
{
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "slad'ran");
|
||||
if (!boss) { return false; }
|
||||
|
||||
float distance = bot->GetExactDist2d(boss->GetPosition());
|
||||
float radius = 15.0f;
|
||||
float distanceExtra = 2.0f;
|
||||
|
||||
if (distance < radius + distanceExtra)
|
||||
{
|
||||
return MoveAway(boss, radius + distanceExtra - distance);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AttackSnakeWrapAction::Execute(Event event)
|
||||
{
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "slad'ran");
|
||||
if (!boss) { return false; }
|
||||
|
||||
Unit* snakeWrap = nullptr;
|
||||
// Target is not findable from threat table using AI_VALUE2(),
|
||||
// therefore need to search manually for the unit name
|
||||
GuidVector targets = AI_VALUE(GuidVector, "possible targets no los");
|
||||
|
||||
for (auto& target : targets)
|
||||
{
|
||||
Unit* unit = botAI->GetUnit(target);
|
||||
if (unit && unit->GetEntry() == NPC_SNAKE_WRAP)
|
||||
{
|
||||
Unit* currentTarget = AI_VALUE(Unit*, "current target");
|
||||
if (!currentTarget || currentTarget->GetEntry() != NPC_SNAKE_WRAP)
|
||||
{
|
||||
return Attack(unit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AvoidWhirlingSlashAction::Execute(Event event)
|
||||
{
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "gal'darah");
|
||||
if (!boss) { return false; }
|
||||
|
||||
float distance = bot->GetExactDist2d(boss->GetPosition());
|
||||
float radius = 5.0f;
|
||||
float distanceExtra = 2.0f;
|
||||
|
||||
if (distance < radius + distanceExtra)
|
||||
{
|
||||
if (botAI->IsTank(bot))
|
||||
{
|
||||
// The boss chases tank during this, leads to jittery stutter-stepping
|
||||
// by the tank if we don't pre-move additional range. 2*radius seems ok
|
||||
return MoveAway(boss, (2.0f * radius) + distanceExtra - distance);
|
||||
}
|
||||
// else
|
||||
return MoveAway(boss, radius + distanceExtra - distance);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
31
src/Ai/Dungeon/Gundrak/Action/GundrakActions.h
Normal file
31
src/Ai/Dungeon/Gundrak/Action/GundrakActions.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef _PLAYERBOT_WOTLKDUNGEONGDACTIONS_H
|
||||
#define _PLAYERBOT_WOTLKDUNGEONGDACTIONS_H
|
||||
|
||||
#include "Action.h"
|
||||
#include "AttackAction.h"
|
||||
#include "PlayerbotAI.h"
|
||||
#include "Playerbots.h"
|
||||
#include "GundrakTriggers.h"
|
||||
|
||||
class AvoidPoisonNovaAction : public MovementAction
|
||||
{
|
||||
public:
|
||||
AvoidPoisonNovaAction(PlayerbotAI* ai) : MovementAction(ai, "avoid poison nova") {}
|
||||
bool Execute(Event event) override;
|
||||
};
|
||||
|
||||
class AttackSnakeWrapAction : public AttackAction
|
||||
{
|
||||
public:
|
||||
AttackSnakeWrapAction(PlayerbotAI* ai) : AttackAction(ai, "attack snake wrap") {}
|
||||
bool Execute(Event event) override;
|
||||
};
|
||||
|
||||
class AvoidWhirlingSlashAction : public MovementAction
|
||||
{
|
||||
public:
|
||||
AvoidWhirlingSlashAction(PlayerbotAI* ai) : MovementAction(ai, "avoid whirling slash") {}
|
||||
bool Execute(Event event) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
22
src/Ai/Dungeon/Gundrak/GundrakActionContext.h
Normal file
22
src/Ai/Dungeon/Gundrak/GundrakActionContext.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef _PLAYERBOT_WOTLKDUNGEONGDACTIONCONTEXT_H
|
||||
#define _PLAYERBOT_WOTLKDUNGEONGDACTIONCONTEXT_H
|
||||
|
||||
#include "Action.h"
|
||||
#include "NamedObjectContext.h"
|
||||
#include "GundrakActions.h"
|
||||
|
||||
class WotlkDungeonGDActionContext : public NamedObjectContext<Action>
|
||||
{
|
||||
public:
|
||||
WotlkDungeonGDActionContext() {
|
||||
creators["avoid poison nova"] = &WotlkDungeonGDActionContext::avoid_poison_nova;
|
||||
creators["attack snake wrap"] = &WotlkDungeonGDActionContext::attack_snake_wrap;
|
||||
creators["avoid whirling slash"] = &WotlkDungeonGDActionContext::avoid_whirling_slash;
|
||||
}
|
||||
private:
|
||||
static Action* avoid_poison_nova(PlayerbotAI* ai) { return new AvoidPoisonNovaAction(ai); }
|
||||
static Action* attack_snake_wrap(PlayerbotAI* ai) { return new AttackSnakeWrapAction(ai); }
|
||||
static Action* avoid_whirling_slash(PlayerbotAI* ai) { return new AvoidWhirlingSlashAction(ai); }
|
||||
};
|
||||
|
||||
#endif
|
||||
23
src/Ai/Dungeon/Gundrak/GundrakTriggerContext.h
Normal file
23
src/Ai/Dungeon/Gundrak/GundrakTriggerContext.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef _PLAYERBOT_WOTLKDUNGEONGDTRIGGERCONTEXT_H
|
||||
#define _PLAYERBOT_WOTLKDUNGEONGDTRIGGERCONTEXT_H
|
||||
|
||||
#include "NamedObjectContext.h"
|
||||
#include "AiObjectContext.h"
|
||||
#include "GundrakTriggers.h"
|
||||
|
||||
class WotlkDungeonGDTriggerContext : public NamedObjectContext<Trigger>
|
||||
{
|
||||
public:
|
||||
WotlkDungeonGDTriggerContext()
|
||||
{
|
||||
creators["poison nova"] = &WotlkDungeonGDTriggerContext::poison_nova;
|
||||
creators["snake wrap"] = &WotlkDungeonGDTriggerContext::snake_wrap;
|
||||
creators["whirling slash"] = &WotlkDungeonGDTriggerContext::whirling_slash;
|
||||
}
|
||||
private:
|
||||
static Trigger* poison_nova(PlayerbotAI* ai) { return new SladranPoisonNovaTrigger(ai); }
|
||||
static Trigger* snake_wrap(PlayerbotAI* ai) { return new SladranSnakeWrapTrigger(ai); }
|
||||
static Trigger* whirling_slash(PlayerbotAI* ai) { return new GaldarahWhirlingSlashTrigger(ai); }
|
||||
};
|
||||
|
||||
#endif
|
||||
62
src/Ai/Dungeon/Gundrak/Multiplier/GundrakMultipliers.cpp
Normal file
62
src/Ai/Dungeon/Gundrak/Multiplier/GundrakMultipliers.cpp
Normal file
@@ -0,0 +1,62 @@
|
||||
#include "GundrakMultipliers.h"
|
||||
#include "GundrakActions.h"
|
||||
#include "GenericSpellActions.h"
|
||||
#include "ChooseTargetActions.h"
|
||||
#include "MovementActions.h"
|
||||
#include "GundrakTriggers.h"
|
||||
#include "Action.h"
|
||||
|
||||
float SladranMultiplier::GetValue(Action* action)
|
||||
{
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "slad'ran");
|
||||
if (!boss) { return 1.0f; }
|
||||
|
||||
if (boss->FindCurrentSpellBySpellId(SPELL_POISON_NOVA))
|
||||
{
|
||||
if (dynamic_cast<MovementAction*>(action) && !dynamic_cast<AvoidPoisonNovaAction*>(action))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (!botAI->IsDps(bot)) { return 1.0f; }
|
||||
|
||||
if (action->getThreatType() == Action::ActionThreatType::Aoe)
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
Unit* snakeWrap = nullptr;
|
||||
GuidVector targets = AI_VALUE(GuidVector, "possible targets no los");
|
||||
for (auto& target : targets)
|
||||
{
|
||||
Unit* unit = botAI->GetUnit(target);
|
||||
if (unit && unit->GetEntry() == NPC_SNAKE_WRAP)
|
||||
{
|
||||
snakeWrap = unit;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Prevent auto-target acquisition during snake wraps
|
||||
if (snakeWrap && dynamic_cast<DpsAssistAction*>(action))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
float GaldarahMultiplier::GetValue(Action* action)
|
||||
{
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "gal'darah");
|
||||
if (!boss) { return 1.0f; }
|
||||
|
||||
if (boss->HasAura(SPELL_WHIRLING_SLASH))
|
||||
{
|
||||
if (dynamic_cast<MovementAction*>(action) && !dynamic_cast<AvoidWhirlingSlashAction*>(action))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
return 1.0f;
|
||||
}
|
||||
24
src/Ai/Dungeon/Gundrak/Multiplier/GundrakMultipliers.h
Normal file
24
src/Ai/Dungeon/Gundrak/Multiplier/GundrakMultipliers.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef _PLAYERBOT_WOTLKDUNGEONGDMULTIPLIERS_H
|
||||
#define _PLAYERBOT_WOTLKDUNGEONGDMULTIPLIERS_H
|
||||
|
||||
#include "Multiplier.h"
|
||||
|
||||
class SladranMultiplier : public Multiplier
|
||||
{
|
||||
public:
|
||||
SladranMultiplier(PlayerbotAI* ai) : Multiplier(ai, "slad'ran") {}
|
||||
|
||||
public:
|
||||
virtual float GetValue(Action* action);
|
||||
};
|
||||
|
||||
class GaldarahMultiplier : public Multiplier
|
||||
{
|
||||
public:
|
||||
GaldarahMultiplier(PlayerbotAI* ai) : Multiplier(ai, "gal'darah") {}
|
||||
|
||||
public:
|
||||
virtual float GetValue(Action* action);
|
||||
};
|
||||
|
||||
#endif
|
||||
29
src/Ai/Dungeon/Gundrak/Strategy/GundrakStrategy.cpp
Normal file
29
src/Ai/Dungeon/Gundrak/Strategy/GundrakStrategy.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "GundrakStrategy.h"
|
||||
#include "GundrakMultipliers.h"
|
||||
|
||||
void WotlkDungeonGDStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||
{
|
||||
// Moorabi
|
||||
|
||||
// Drakkari Colossus
|
||||
|
||||
// Slad'ran
|
||||
// TODO: Might need to add target priority for heroic on the snakes or to burn down boss.
|
||||
// Will re-test in heroic, decent dps groups should be able to blast him down with no funky strats.
|
||||
triggers.push_back(new TriggerNode("poison nova",
|
||||
{ NextAction("avoid poison nova", ACTION_RAID + 5) }));
|
||||
triggers.push_back(new TriggerNode("snake wrap",
|
||||
{ NextAction("attack snake wrap", ACTION_RAID + 4) }));
|
||||
|
||||
// Gal'darah
|
||||
triggers.push_back(new TriggerNode("whirling slash",
|
||||
{ NextAction("avoid whirling slash", ACTION_RAID + 5) }));
|
||||
|
||||
// Eck the Ferocious (Heroic only)
|
||||
}
|
||||
|
||||
void WotlkDungeonGDStrategy::InitMultipliers(std::vector<Multiplier*> &multipliers)
|
||||
{
|
||||
multipliers.push_back(new SladranMultiplier(botAI));
|
||||
multipliers.push_back(new GaldarahMultiplier(botAI));
|
||||
}
|
||||
17
src/Ai/Dungeon/Gundrak/Strategy/GundrakStrategy.h
Normal file
17
src/Ai/Dungeon/Gundrak/Strategy/GundrakStrategy.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef _PLAYERBOT_WOTLKDUNGEONGDSTRATEGY_H
|
||||
#define _PLAYERBOT_WOTLKDUNGEONGDSTRATEGY_H
|
||||
|
||||
#include "Multiplier.h"
|
||||
#include "AiObjectContext.h"
|
||||
#include "Strategy.h"
|
||||
|
||||
class WotlkDungeonGDStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
WotlkDungeonGDStrategy(PlayerbotAI* ai) : Strategy(ai) {}
|
||||
virtual std::string const getName() override { return "gundrak"; }
|
||||
virtual void InitTriggers(std::vector<TriggerNode*> &triggers) override;
|
||||
virtual void InitMultipliers(std::vector<Multiplier*> &multipliers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
37
src/Ai/Dungeon/Gundrak/Trigger/GundrakTriggers.cpp
Normal file
37
src/Ai/Dungeon/Gundrak/Trigger/GundrakTriggers.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#include "Playerbots.h"
|
||||
#include "GundrakTriggers.h"
|
||||
#include "AiObject.h"
|
||||
#include "AiObjectContext.h"
|
||||
|
||||
bool SladranPoisonNovaTrigger::IsActive()
|
||||
{
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "slad'ran");
|
||||
if (!boss) { return false; }
|
||||
|
||||
return bool(boss->FindCurrentSpellBySpellId(SPELL_POISON_NOVA));
|
||||
}
|
||||
|
||||
bool SladranSnakeWrapTrigger::IsActive()
|
||||
{
|
||||
if (!botAI->IsDps(bot)) { return false; }
|
||||
|
||||
// Target is not findable from threat table using AI_VALUE2(),
|
||||
// therefore need to search manually for the unit name
|
||||
GuidVector targets = AI_VALUE(GuidVector, "possible targets");
|
||||
|
||||
for (auto& target : targets)
|
||||
{
|
||||
Unit* unit = botAI->GetUnit(target);
|
||||
if (unit && unit->GetEntry() == NPC_SNAKE_WRAP)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GaldarahWhirlingSlashTrigger::IsActive()
|
||||
{
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "gal'darah");
|
||||
return boss && boss->HasAura(SPELL_WHIRLING_SLASH);
|
||||
}
|
||||
45
src/Ai/Dungeon/Gundrak/Trigger/GundrakTriggers.h
Normal file
45
src/Ai/Dungeon/Gundrak/Trigger/GundrakTriggers.h
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifndef _PLAYERBOT_WOTLKDUNGEONGDTRIGGERS_H
|
||||
#define _PLAYERBOT_WOTLKDUNGEONGDTRIGGERS_H
|
||||
|
||||
#include "Trigger.h"
|
||||
#include "PlayerbotAIConfig.h"
|
||||
#include "GenericTriggers.h"
|
||||
#include "DungeonStrategyUtils.h"
|
||||
|
||||
enum GundrakIDs
|
||||
{
|
||||
// Slad'ran
|
||||
SPELL_POISON_NOVA_N = 55081,
|
||||
SPELL_POISON_NOVA_H = 59842,
|
||||
NPC_SNAKE_WRAP = 29742,
|
||||
|
||||
// Gal'darah
|
||||
SPELL_WHIRLING_SLASH_N = 55250,
|
||||
SPELL_WHIRLING_SLASH_H = 59824,
|
||||
};
|
||||
|
||||
#define SPELL_POISON_NOVA DUNGEON_MODE(bot, SPELL_POISON_NOVA_N, SPELL_POISON_NOVA_H)
|
||||
#define SPELL_WHIRLING_SLASH DUNGEON_MODE(bot, SPELL_WHIRLING_SLASH_N, SPELL_WHIRLING_SLASH_H)
|
||||
|
||||
class SladranPoisonNovaTrigger : public Trigger
|
||||
{
|
||||
public:
|
||||
SladranPoisonNovaTrigger(PlayerbotAI* ai) : Trigger(ai, "slad'ran poison nova") {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class SladranSnakeWrapTrigger : public Trigger
|
||||
{
|
||||
public:
|
||||
SladranSnakeWrapTrigger(PlayerbotAI* ai) : Trigger(ai, "slad'ran snake wrap") {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class GaldarahWhirlingSlashTrigger : public Trigger
|
||||
{
|
||||
public:
|
||||
GaldarahWhirlingSlashTrigger(PlayerbotAI* ai) : Trigger(ai, "gal'darah whirling slash") {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user