mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-21 10:30:01 +01:00
date: 2024-10-30
fos bronjahm v1
This commit is contained in:
parent
47544bf910
commit
07da4ad959
25
src/strategy/dungeons/wotlk/forgeofsouls/FosActionContext.h
Normal file
25
src/strategy/dungeons/wotlk/forgeofsouls/FosActionContext.h
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#ifndef _PLAYERBOT_WOTLKDUNGEONNEXACTIONCONTEXT_H
|
||||||
|
#define _PLAYERBOT_WOTLKDUNGEONNEXACTIONCONTEXT_H
|
||||||
|
|
||||||
|
#include "Action.h"
|
||||||
|
#include "NamedObjectContext.h"
|
||||||
|
#include "FosActions.h"
|
||||||
|
|
||||||
|
class WotlkDungeonFosActionContext : public NamedObjectContext<Action>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
WotlkDungeonFosActionContext() {
|
||||||
|
creators["csf target"] = &WotlkDungeonFosActionContext::move_from_whirlwind;
|
||||||
|
creators["firebomb spread"] = &WotlkDungeonNexActionContext::firebomb_spread;
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
static Action* move_from_whirlwind(PlayerbotAI* ai) { return new MoveFromWhirlwindAction(ai); }
|
||||||
|
static Action* firebomb_spread(PlayerbotAI* ai) { return new FirebombSpreadAction(ai); }
|
||||||
|
static Action* telestra_split_target(PlayerbotAI* ai) { return new TelestraSplitTargetAction(ai); }
|
||||||
|
static Action* csf_target(PlayerbotAI* ai) { return new }
|
||||||
|
static Action* chaotic_rift_target(PlayerbotAI* ai) { return new ChaoticRiftTargetAction(ai); }
|
||||||
|
static Action* dodge_spikes(PlayerbotAI* ai) { return new DodgeSpikesAction(ai); }
|
||||||
|
static Action* intense_cold_jump(PlayerbotAI* ai) { return new IntenseColdJumpAction(ai); }
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
30
src/strategy/dungeons/wotlk/forgeofsouls/FosActions.cpp
Normal file
30
src/strategy/dungeons/wotlk/forgeofsouls/FosActions.cpp
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#include "Playerbots.h"
|
||||||
|
#include "FosActions.h"
|
||||||
|
#include "FosStrategy.h"
|
||||||
|
|
||||||
|
bool MoveFromBronjahmAction::Execute(Event event)
|
||||||
|
{
|
||||||
|
Unit* boss = nullptr;
|
||||||
|
boss = AI_VALUE2(Unit*, "find target", "bronjahm");
|
||||||
|
if (!boss)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
float distance = bot->GetExactDist2d(boss->GetPosition());
|
||||||
|
float targetDis = 30.0f;
|
||||||
|
if (distance >= targetDis)
|
||||||
|
return false;
|
||||||
|
return MoveAway(boss, targetDis - distance);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AttackCorruptedSoulFragmentAction::Execute(Event event)
|
||||||
|
{
|
||||||
|
Unit* fragment = nullptr;
|
||||||
|
fragment = AI_VALUE2(Unit*, "find target", "corrupted soul fragment");
|
||||||
|
if (!fragment)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (AI_VALUE(Unit*, "current target") == fragment)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return Attack(fragment);
|
||||||
|
}
|
||||||
26
src/strategy/dungeons/wotlk/forgeofsouls/FosActions.h
Normal file
26
src/strategy/dungeons/wotlk/forgeofsouls/FosActions.h
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#ifndef _PLAYERBOT_WOTLKDUNGEONFOSACTIONS_H
|
||||||
|
#define _PLAYERBOT_WOTLKDUNGEONFOSACTIONS_H
|
||||||
|
|
||||||
|
#include "Action.h"
|
||||||
|
#include "AttackAction.h"
|
||||||
|
#include "PlayerbotAI.h"
|
||||||
|
#include "Playerbots.h"
|
||||||
|
#include "FosTriggers.h"
|
||||||
|
|
||||||
|
class MoveFromBronjahmAction : public MovementAction
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MoveFromBronjahmAction(PlayerbotAI* ai) : MovementAction(ai, "move from bronjahm") {}
|
||||||
|
bool Execute(Event event) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
class AttackCorruptedSoulFragmentAction : public AttackAction
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
AttackCorruptedSoulFragmentAction(PlayerbotAI* ai) : AttackAction(ai, "attack corrupted soul fragment") {}
|
||||||
|
bool Execute(Event event) override;
|
||||||
|
bool isUseful() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
26
src/strategy/dungeons/wotlk/forgeofsouls/FosMultipliers.cpp
Normal file
26
src/strategy/dungeons/wotlk/forgeofsouls/FosMultipliers.cpp
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#include "FosMultipliers.h"
|
||||||
|
#include "FosActions.h"
|
||||||
|
#include "GenericSpellActions.h"
|
||||||
|
#include "ChooseTargetActions.h"
|
||||||
|
#include "MovementActions.h"
|
||||||
|
#include "FosTriggers.h"
|
||||||
|
|
||||||
|
|
||||||
|
float BronjahmMultiplier::GetValue(Action* action) {
|
||||||
|
Unit* boss = nullptr;
|
||||||
|
boss = AI_VALUE2(Unit *, "find target", "bronjahm");
|
||||||
|
if (boss && boss->HasUnitState(UNIT_STATE_CASTING) && boss->FindCurrentSpellBySpellId(SPELL_CORRUPT_SOUL))
|
||||||
|
{
|
||||||
|
if (dynamic_cast<MovementAction*>(action) && !dynamic_cast<MoveFromBronjahmAction*>(action))
|
||||||
|
{
|
||||||
|
return 0.0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1.0f; }
|
||||||
|
|
||||||
|
float AttackFragmentMultiplier::GetValue(Action* action)
|
||||||
|
{
|
||||||
|
auto isTank = botAI->IsTank();
|
||||||
|
if (isTank && dynamic_cast<AttackCorruptedSoulFragmentAction>(action))
|
||||||
|
return 0.0f;
|
||||||
|
return 1.0f; }
|
||||||
24
src/strategy/dungeons/wotlk/forgeofsouls/FosMultipliers.h
Normal file
24
src/strategy/dungeons/wotlk/forgeofsouls/FosMultipliers.h
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#ifndef _PLAYERBOT_WOTLKDUNGEONFOSMULTIPLIERS_H
|
||||||
|
#define _PLAYERBOT_WOTLKDUNGEONFOSMULTIPLIERS_H
|
||||||
|
|
||||||
|
#include "Multiplier.h"
|
||||||
|
|
||||||
|
class BronjahmMultiplier : public Multiplier
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
BronjahmMultiplier(PlayerbotAI* ai) : Multiplier(ai, "bronjahm") {}
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual float GetValue(Action* action);
|
||||||
|
};
|
||||||
|
|
||||||
|
class AttackFragmentMultiplier : public Multiplier
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
AttackFragmentMultiplier(PlayerbotAI* ai) : Multiplier(ai, "attack fragment") { }
|
||||||
|
|
||||||
|
float GetValue(Action* action) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
5
src/strategy/dungeons/wotlk/forgeofsouls/FosStrategy.cpp
Normal file
5
src/strategy/dungeons/wotlk/forgeofsouls/FosStrategy.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#include "FosStrategy.h"
|
||||||
|
|
||||||
|
void WotlkDungeonFosStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) {}
|
||||||
|
|
||||||
|
void WotlkDungeonFosStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers) {}
|
||||||
16
src/strategy/dungeons/wotlk/forgeofsouls/FosStrategy.h
Normal file
16
src/strategy/dungeons/wotlk/forgeofsouls/FosStrategy.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#ifndef _PLAYERBOT_WOTLKDUNGEONFOSSTRATEGY_H
|
||||||
|
#define _PLAYERBOT_WOTLKDUNGEONFOSSTRATEGY_H
|
||||||
|
#include "Multiplier.h"
|
||||||
|
#include "Strategy.h"
|
||||||
|
|
||||||
|
class WotlkDungeonFosStrategy : public Strategy
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
WotlkDungeonFosStrategy(PlayerbotAI* ai) : Strategy(ai) {}
|
||||||
|
std::string const getName() override { return "fos"; }
|
||||||
|
void InitTriggers(std::vector<TriggerNode*> &triggers) override;
|
||||||
|
void InitMultipliers(std::vector<Multiplier*> &multipliers) override;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // !_PLAYERBOT_WOTLKDUNGEONFOSSTRATEGY_H
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
#ifndef _PLAYERBOT_WOTLKDUNGEONFOSTRIGGERCONTEXT_H
|
||||||
|
#define _PLAYERBOT_WOTLKDUNGEONFOSTRIGGERCONTEXT_H
|
||||||
|
|
||||||
|
#include "NamedObjectContext.h"
|
||||||
|
#include "AiObjectContext.h"
|
||||||
|
#include "FosTriggers.h"
|
||||||
|
#endif // !_PLAYERBOT_WOTLKDUNGEONFOSTRIGGERCONTEXT_H
|
||||||
11
src/strategy/dungeons/wotlk/forgeofsouls/FosTriggers.h
Normal file
11
src/strategy/dungeons/wotlk/forgeofsouls/FosTriggers.h
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#include "Trigger.h"
|
||||||
|
#include "PlayerbotAIConfig.h"
|
||||||
|
#include "GenericTriggers.h"
|
||||||
|
#include "DungeonStrategyUtils.h"
|
||||||
|
|
||||||
|
enum FosIDs
|
||||||
|
{
|
||||||
|
//Boss1
|
||||||
|
|
||||||
|
SPELL_CORRUPT_SOUL = 68839
|
||||||
|
};
|
||||||
Loading…
x
Reference in New Issue
Block a user