mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-05 11:53:49 +00:00
- Added generic boss aura triggers and actions (#1242)
- Added Freya strategy - Added or updated aura resistance strategies for ulduar
This commit is contained in:
52
src/strategy/actions/BossAuraActions.cpp
Normal file
52
src/strategy/actions/BossAuraActions.cpp
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include <HunterBuffStrategies.h>
|
||||
#include <PaladinBuffStrategies.h>
|
||||
#include <PlayerbotAI.h>
|
||||
|
||||
#include "BossAuraActions.h"
|
||||
#include "BossAuraTriggers.h"
|
||||
|
||||
const std::string ADD_STRATEGY_CHAR = "+";
|
||||
|
||||
bool BossFireResistanceAction::isUseful()
|
||||
{
|
||||
BossFireResistanceTrigger bossFireResistanceTrigger(botAI, bossName);
|
||||
return bossFireResistanceTrigger.IsActive();
|
||||
}
|
||||
|
||||
bool BossFireResistanceAction::Execute(Event event)
|
||||
{
|
||||
PaladinFireResistanceStrategy paladinFireResistanceStrategy(botAI);
|
||||
botAI->ChangeStrategy(ADD_STRATEGY_CHAR + paladinFireResistanceStrategy.getName(), BotState::BOT_STATE_COMBAT);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BossFrostResistanceAction::isUseful()
|
||||
{
|
||||
BossFrostResistanceTrigger bossFrostResistanceTrigger(botAI, bossName);
|
||||
return bossFrostResistanceTrigger.IsActive();
|
||||
}
|
||||
|
||||
bool BossFrostResistanceAction::Execute(Event event)
|
||||
{
|
||||
PaladinFrostResistanceStrategy paladinFrostResistanceStrategy(botAI);
|
||||
botAI->ChangeStrategy(ADD_STRATEGY_CHAR + paladinFrostResistanceStrategy.getName(), BotState::BOT_STATE_COMBAT);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BossNatureResistanceAction::isUseful()
|
||||
{
|
||||
BossNatureResistanceTrigger bossNatureResistanceTrigger(botAI, bossName);
|
||||
return bossNatureResistanceTrigger.IsActive();
|
||||
}
|
||||
|
||||
bool BossNatureResistanceAction::Execute(Event event)
|
||||
{
|
||||
HunterNatureResistanceStrategy hunterNatureResistanceStrategy(botAI);
|
||||
botAI->ChangeStrategy(ADD_STRATEGY_CHAR + hunterNatureResistanceStrategy.getName(), BotState::BOT_STATE_COMBAT);
|
||||
return true;
|
||||
}
|
||||
57
src/strategy/actions/BossAuraActions.h
Normal file
57
src/strategy/actions/BossAuraActions.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_BOSSAURAACTION_H
|
||||
#define _PLAYERBOT_BOSSAURAACTION_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "Action.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class BossFireResistanceAction : public Action
|
||||
{
|
||||
public:
|
||||
BossFireResistanceAction(PlayerbotAI* botAI, std::string const bossName)
|
||||
: Action(botAI, bossName + " fire resistance action"), bossName(bossName)
|
||||
{
|
||||
}
|
||||
bool Execute(Event event) override;
|
||||
bool isUseful() override;
|
||||
|
||||
private:
|
||||
std::string bossName;
|
||||
};
|
||||
|
||||
class BossFrostResistanceAction : public Action
|
||||
{
|
||||
public:
|
||||
BossFrostResistanceAction(PlayerbotAI* botAI, std::string const bossName)
|
||||
: Action(botAI, bossName + " frost resistance action"), bossName(bossName)
|
||||
{
|
||||
}
|
||||
bool Execute(Event event) override;
|
||||
bool isUseful() override;
|
||||
|
||||
private:
|
||||
std::string bossName;
|
||||
};
|
||||
|
||||
class BossNatureResistanceAction : public Action
|
||||
{
|
||||
public:
|
||||
BossNatureResistanceAction(PlayerbotAI* botAI, std::string const bossName)
|
||||
: Action(botAI, bossName + " nature resistance action"), bossName(bossName)
|
||||
{
|
||||
}
|
||||
bool Execute(Event event) override;
|
||||
bool isUseful() override;
|
||||
|
||||
private:
|
||||
std::string bossName;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user