[HOT FIX] MS build issues regarding folder / command lenght usage or rc.exe (#2038)

This commit is contained in:
bashermens
2026-01-19 22:45:28 +01:00
committed by GitHub
parent fd07e02a8a
commit 41c53365ae
1119 changed files with 27 additions and 27 deletions

View File

@@ -0,0 +1,505 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#include "PaladinActions.h"
#include "AiFactory.h"
#include "Event.h"
#include "PlayerbotAI.h"
#include "PlayerbotAIConfig.h"
#include "PlayerbotFactory.h"
#include "Playerbots.h"
#include "SharedDefines.h"
#include "../../../../../src/server/scripts/Spells/spell_generic.cpp"
#include "GenericBuffUtils.h"
#include "Config.h"
#include "Group.h"
#include "ObjectAccessor.h"
using ai::buff::MakeAuraQualifierForBuff;
using ai::buff::UpgradeToGroupIfAppropriate;
// Helper : detect tank role on the target (player bot or not) return true if spec is tank or if the bot have tank strategies (bear/tank/tank face).
static inline bool IsTankRole(Player* p)
{
if (!p) return false;
if (p->HasTankSpec())
return true;
if (PlayerbotAI* otherAI = GET_PLAYERBOT_AI(p))
{
if (otherAI->HasStrategy("tank", BOT_STATE_NON_COMBAT) ||
otherAI->HasStrategy("tank", BOT_STATE_COMBAT) ||
otherAI->HasStrategy("tank face", BOT_STATE_NON_COMBAT) ||
otherAI->HasStrategy("tank face", BOT_STATE_COMBAT) ||
otherAI->HasStrategy("bear", BOT_STATE_NON_COMBAT) ||
otherAI->HasStrategy("bear", BOT_STATE_COMBAT))
return true;
}
return false;
}
// Added for solo paladin patch : determine if he's the only paladin on party
static inline bool IsOnlyPaladinInGroup(Player* bot)
{
if (!bot) return false;
Group* g = bot->GetGroup();
if (!g) return true; // solo
uint32 pals = 0u;
for (GroupReference* r = g->GetFirstMember(); r; r = r->next())
{
Player* p = r->GetSource();
if (!p || !p->IsInWorld()) continue;
if (p->getClass() == CLASS_PALADIN) ++pals;
}
return pals == 1u;
}
static inline bool GroupHasTankOfClass(Group* g, uint8 classId)
{
return GroupHasTankOfClass(g, static_cast<Classes>(classId));
}
inline std::string const GetActualBlessingOfMight(Unit* target)
{
if (!target->ToPlayer())
{
return "blessing of might";
}
int tab = AiFactory::GetPlayerSpecTab(target->ToPlayer());
switch (target->getClass())
{
case CLASS_MAGE:
case CLASS_PRIEST:
case CLASS_WARLOCK:
return "blessing of wisdom";
break;
case CLASS_SHAMAN:
if (tab == SHAMAN_TAB_ELEMENTAL || tab == SHAMAN_TAB_RESTORATION)
{
return "blessing of wisdom";
}
break;
case CLASS_DRUID:
if (tab == DRUID_TAB_RESTORATION || tab == DRUID_TAB_BALANCE)
{
return "blessing of wisdom";
}
break;
case CLASS_PALADIN:
if (tab == PALADIN_TAB_HOLY)
{
return "blessing of wisdom";
}
break;
}
return "blessing of might";
}
inline std::string const GetActualBlessingOfWisdom(Unit* target)
{
if (!target->ToPlayer())
{
return "blessing of might";
}
int tab = AiFactory::GetPlayerSpecTab(target->ToPlayer());
switch (target->getClass())
{
case CLASS_WARRIOR:
case CLASS_ROGUE:
case CLASS_DEATH_KNIGHT:
case CLASS_HUNTER:
return "blessing of might";
break;
case CLASS_SHAMAN:
if (tab == SHAMAN_TAB_ENHANCEMENT)
{
return "blessing of might";
}
break;
case CLASS_DRUID:
if (tab == DRUID_TAB_FERAL)
{
return "blessing of might";
}
break;
case CLASS_PALADIN:
if (tab == PALADIN_TAB_PROTECTION || tab == PALADIN_TAB_RETRIBUTION)
{
return "blessing of might";
}
break;
}
return "blessing of wisdom";
}
inline std::string const GetActualBlessingOfSanctuary(Unit* target, Player* bot)
{
if (!bot->HasSpell(SPELL_BLESSING_OF_SANCTUARY))
return "";
Player* tp = target->ToPlayer();
if (!tp)
return "";
if (auto* ai = GET_PLAYERBOT_AI(bot))
{
if (Unit* mt = ai->GetAiObjectContext()->GetValue<Unit*>("main tank")->Get())
{
if (mt == target)
return "blessing of sanctuary";
}
}
if (tp->HasTankSpec())
return "blessing of sanctuary";
return "";
}
Value<Unit*>* CastBlessingOnPartyAction::GetTargetValue()
{
return context->GetValue<Unit*>("party member without aura", MakeAuraQualifierForBuff(spell));
}
bool CastBlessingOfMightAction::Execute(Event event)
{
Unit* target = GetTarget();
if (!target)
return false;
std::string castName = GetActualBlessingOfMight(target);
auto RP = ai::chat::MakeGroupAnnouncer(bot);
castName = ai::buff::UpgradeToGroupIfAppropriate(bot, botAI, castName, /*announceOnMissing=*/true, RP);
return botAI->CastSpell(castName, target);
}
Value<Unit*>* CastBlessingOfMightOnPartyAction::GetTargetValue()
{
return context->GetValue<Unit*>(
"party member without aura",
"blessing of might,greater blessing of might,blessing of wisdom,greater blessing of wisdom,blessing of sanctuary,greater blessing of sanctuary"
);
}
bool CastBlessingOfMightOnPartyAction::Execute(Event event)
{
Unit* target = GetTarget();
if (!target)
return false;
std::string castName = GetActualBlessingOfMight(target);
auto RP = ai::chat::MakeGroupAnnouncer(bot);
castName = ai::buff::UpgradeToGroupIfAppropriate(bot, botAI, castName, /*announceOnMissing=*/true, RP);
return botAI->CastSpell(castName, target);
}
bool CastBlessingOfWisdomAction::Execute(Event event)
{
Unit* target = GetTarget();
if (!target)
return false;
std::string castName = GetActualBlessingOfWisdom(target);
auto RP = ai::chat::MakeGroupAnnouncer(bot);
castName = ai::buff::UpgradeToGroupIfAppropriate(bot, botAI, castName, /*announceOnMissing=*/true, RP);
return botAI->CastSpell(castName, target);
}
Value<Unit*>* CastBlessingOfWisdomOnPartyAction::GetTargetValue()
{
return context->GetValue<Unit*>(
"party member without aura",
"blessing of wisdom,greater blessing of wisdom,blessing of might,greater blessing of might,blessing of sanctuary,greater blessing of sanctuary"
);
}
bool CastBlessingOfWisdomOnPartyAction::Execute(Event event)
{
Unit* target = GetTarget();
if (!target)
return false;
Player* targetPlayer = target->ToPlayer();
if (Group* g = bot->GetGroup())
if (targetPlayer && !g->IsMember(targetPlayer->GetGUID()))
return false;
if (botAI->HasStrategy("bmana", BOT_STATE_NON_COMBAT) &&
targetPlayer && IsTankRole(targetPlayer))
{
LOG_DEBUG("playerbots", "[Wisdom/bmana] Skip tank {} (Kings only)", target->GetName());
return false;
}
std::string castName = GetActualBlessingOfWisdom(target);
if (castName.empty())
return false;
auto RP = ai::chat::MakeGroupAnnouncer(bot);
castName = ai::buff::UpgradeToGroupIfAppropriate(bot, botAI, castName, /*announceOnMissing=*/true, RP);
return botAI->CastSpell(castName, target);
}
Value<Unit*>* CastBlessingOfSanctuaryOnPartyAction::GetTargetValue()
{
return context->GetValue<Unit*>(
"party member without aura",
"blessing of sanctuary,greater blessing of sanctuary"
);
}
bool CastBlessingOfSanctuaryOnPartyAction::Execute(Event event)
{
if (!bot->HasSpell(SPELL_BLESSING_OF_SANCTUARY))
return false;
Unit* target = GetTarget();
if (!target)
{
// Fallback: GetTarget() can be null if no one needs a buff.
// Keep a valid pointer for the checks/logs that follow.
target = bot;
}
Player* targetPlayer = target ? target->ToPlayer() : nullptr;
// Small helpers to check relevant auras
const auto HasKingsAura = [&](Unit* u) -> bool {
return botAI->HasAura("blessing of kings", u) || botAI->HasAura("greater blessing of kings", u);
};
const auto HasSanctAura = [&](Unit* u) -> bool {
return botAI->HasAura("blessing of sanctuary", u) || botAI->HasAura("greater blessing of sanctuary", u);
};
if (Group* g = bot->GetGroup())
{
if (targetPlayer && !g->IsMember(targetPlayer->GetGUID()))
{
LOG_DEBUG("playerbots", "[Sanct] Initial target not in group, ignoring");
target = bot;
targetPlayer = bot->ToPlayer();
}
}
if (Player* self = bot->ToPlayer())
{
bool selfHasSanct = HasSanctAura(self);
bool needSelf = IsTankRole(self) && !selfHasSanct;
LOG_DEBUG("playerbots", "[Sanct] {} isTank={} selfHasSanct={} needSelf={}",
bot->GetName(), IsTankRole(self), selfHasSanct, needSelf);
if (needSelf)
{
target = self;
targetPlayer = self;
}
}
// Try to re-target a valid tank in group if needed
bool targetOk = false;
if (targetPlayer)
{
bool hasSanct = HasSanctAura(targetPlayer);
targetOk = IsTankRole(targetPlayer) && !hasSanct;
}
if (!targetOk)
{
if (Group* g = bot->GetGroup())
{
for (GroupReference* gref = g->GetFirstMember(); gref; gref = gref->next())
{
Player* p = gref->GetSource();
if (!p) continue;
if (!p->IsInWorld() || !p->IsAlive()) continue;
if (!IsTankRole(p)) continue;
bool hasSanct = HasSanctAura(p);
if (!hasSanct)
{
target = p; // prioritize this tank
targetPlayer = p;
targetOk = true;
break;
}
}
}
}
{
bool hasKings = HasKingsAura(target);
bool hasSanct = HasSanctAura(target);
bool knowSanct = bot->HasSpell(SPELL_BLESSING_OF_SANCTUARY);
LOG_DEBUG("playerbots", "[Sanct] Final target={} hasKings={} hasSanct={} knowSanct={}",
target->GetName(), hasKings, hasSanct, knowSanct);
}
std::string castName = GetActualBlessingOfSanctuary(target, bot);
// If internal logic didn't recognize the tank (e.g., bear druid), force single-target Sanctuary
if (castName.empty())
{
if (targetPlayer)
{
if (IsTankRole(targetPlayer))
castName = "blessing of sanctuary"; // force single-target
else
return false;
}
else
return false;
}
if (targetPlayer && !IsTankRole(targetPlayer))
{
auto RP = ai::chat::MakeGroupAnnouncer(bot);
castName = ai::buff::UpgradeToGroupIfAppropriate(bot, botAI, castName, /*announceOnMissing=*/true, RP);
}
else
{
castName = "blessing of sanctuary";
}
bool ok = botAI->CastSpell(castName, target);
LOG_DEBUG("playerbots", "[Sanct] Cast {} on {} result={}", castName, target->GetName(), ok);
return ok;
}
Value<Unit*>* CastBlessingOfKingsOnPartyAction::GetTargetValue()
{
return context->GetValue<Unit*>(
"party member without aura",
"blessing of kings,greater blessing of kings,blessing of sanctuary,greater blessing of sanctuary"
);
}
bool CastBlessingOfKingsOnPartyAction::Execute(Event event)
{
Unit* target = GetTarget();
if (!target)
return false;
Group* g = bot->GetGroup();
if (!g)
return false;
// Added for patch solo paladin, never buff itself to not remove his sanctuary buff
if (botAI->HasStrategy("bstats", BOT_STATE_NON_COMBAT) && IsOnlyPaladinInGroup(bot))
{
if (target->GetGUID() == bot->GetGUID())
{
LOG_DEBUG("playerbots", "[Kings/bstats-solo] Skip self to keep Sanctuary on {}", bot->GetName());
return false;
}
}
// End solo paladin patch
Player* targetPlayer = target->ToPlayer();
if (targetPlayer && !g->IsMember(targetPlayer->GetGUID()))
return false;
const bool hasBmana = botAI->HasStrategy("bmana", BOT_STATE_NON_COMBAT);
const bool hasBstats = botAI->HasStrategy("bstats", BOT_STATE_NON_COMBAT);
if (hasBmana)
{
if (!targetPlayer || !IsTankRole(targetPlayer))
{
LOG_DEBUG("playerbots", "[Kings/bmana] Skip non-tank {}", target->GetName());
return false;
}
}
if (targetPlayer)
{
const bool isTank = IsTankRole(targetPlayer);
const bool hasSanctFromMe =
target->HasAura(SPELL_BLESSING_OF_SANCTUARY, bot->GetGUID()) ||
target->HasAura(SPELL_GREATER_BLESSING_OF_SANCTUARY, bot->GetGUID());
const bool hasSanctAny =
botAI->HasAura("blessing of sanctuary", target) ||
botAI->HasAura("greater blessing of sanctuary", target);
if (isTank && hasSanctFromMe)
{
LOG_DEBUG("playerbots", "[Kings] Skip: {} has my Sanctuary and is a tank", target->GetName());
return false;
}
if (hasBstats && isTank && hasSanctAny)
{
LOG_DEBUG("playerbots", "[Kings] Skip (bstats): {} already has Sanctuary and is a tank", target->GetName());
return false;
}
}
std::string castName = "blessing of kings";
bool allowGreater = true;
if (hasBmana)
allowGreater = false;
if (allowGreater && hasBstats && targetPlayer)
{
switch (targetPlayer->getClass())
{
case CLASS_WARRIOR:
case CLASS_PALADIN:
case CLASS_DRUID:
case CLASS_DEATH_KNIGHT:
allowGreater = false;
break;
default:
break;
}
}
if (allowGreater)
{
auto RP = ai::chat::MakeGroupAnnouncer(bot);
castName = ai::buff::UpgradeToGroupIfAppropriate(bot, botAI, castName, /*announceOnMissing=*/true, RP);
}
return botAI->CastSpell(castName, target);
}
bool CastSealSpellAction::isUseful() { return AI_VALUE2(bool, "combat", "self target"); }
Value<Unit*>* CastTurnUndeadAction::GetTargetValue() { return context->GetValue<Unit*>("cc target", getName()); }
Unit* CastRighteousDefenseAction::GetTarget()
{
Unit* current_target = AI_VALUE(Unit*, "current target");
if (!current_target)
{
return NULL;
}
return current_target->GetVictim();
}
bool CastDivineSacrificeAction::isUseful()
{
return GetTarget() && (GetTarget() != nullptr) && CastSpellAction::isUseful() &&
!botAI->HasAura("divine guardian", GetTarget(), false, false, -1, true);
}
bool CastCancelDivineSacrificeAction::Execute(Event event)
{
botAI->RemoveAura("divine sacrifice");
return true;
}
bool CastCancelDivineSacrificeAction::isUseful()
{
return botAI->HasAura("divine sacrifice", GetTarget(), false, true, -1, true);
}

View File

@@ -0,0 +1,431 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_PALADINACTIONS_H
#define _PLAYERBOT_PALADINACTIONS_H
#include "AiObject.h"
#include "GenericSpellActions.h"
#include "SharedDefines.h"
class PlayerbotAI;
class Unit;
// seals
BUFF_ACTION(CastSealOfRighteousnessAction, "seal of righteousness");
BUFF_ACTION(CastSealOfJusticeAction, "seal of justice");
BUFF_ACTION(CastSealOfLightAction, "seal of light");
BUFF_ACTION(CastSealOfWisdomAction, "seal of wisdom");
BUFF_ACTION(CastSealOfCommandAction, "seal of command");
BUFF_ACTION(CastSealOfVengeanceAction, "seal of vengeance");
BUFF_ACTION(CastSealOfCorruptionAction, "seal of corruption");
// judgements
SPELL_ACTION(CastJudgementAction, "judgement");
SPELL_ACTION(CastJudgementOfLightAction, "judgement of light");
SPELL_ACTION(CastJudgementOfWisdomAction, "judgement of wisdom");
SPELL_ACTION(CastJudgementOfJusticeAction, "judgement of justice");
// auras
BUFF_ACTION(CastDevotionAuraAction, "devotion aura");
BUFF_ACTION(CastRetributionAuraAction, "retribution aura");
BUFF_ACTION(CastConcentrationAuraAction, "concentration aura");
BUFF_ACTION(CastShadowResistanceAuraAction, "shadow resistance aura");
BUFF_ACTION(CastFrostResistanceAuraAction, "frost resistance aura");
BUFF_ACTION(CastFireResistanceAuraAction, "fire resistance aura");
BUFF_ACTION(CastCrusaderAuraAction, "crusader aura");
BUFF_ACTION(CastSanctityAuraAction, "sanctity aura");
SPELL_ACTION(CastHolyShockAction, "holy shock");
// consecration
MELEE_ACTION(CastConsecrationAction, "consecration");
// repentance
SNARE_ACTION(CastRepentanceSnareAction, "repentance");
DEBUFF_ACTION(CastRepentanceAction, "repentance");
ENEMY_HEALER_ACTION(CastRepentanceOnHealerAction, "repentance");
// hamme of wrath
SPELL_ACTION(CastHammerOfWrathAction, "hammer of wrath");
// buffs
BUFF_ACTION(CastDivineFavorAction, "divine favor");
// blessings
// fury
BUFF_ACTION(CastRighteousFuryAction, "righteous fury");
class CastDivineStormAction : public CastMeleeSpellAction
{
public:
CastDivineStormAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "divine storm") {}
};
class CastCrusaderStrikeAction : public CastMeleeSpellAction
{
public:
CastCrusaderStrikeAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "crusader strike") {}
};
class CastSealSpellAction : public CastBuffSpellAction
{
public:
CastSealSpellAction(PlayerbotAI* botAI, std::string const name) : CastBuffSpellAction(botAI, name) {}
bool isUseful() override;
};
class CastBlessingOfMightAction : public CastBuffSpellAction
{
public:
CastBlessingOfMightAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "blessing of might") {}
bool Execute(Event event) override;
};
class CastBlessingOnPartyAction : public BuffOnPartyAction
{
public:
CastBlessingOnPartyAction(PlayerbotAI* botAI, std::string const name) : BuffOnPartyAction(botAI, name), name(name)
{
}
Value<Unit*>* GetTargetValue() override;
private:
std::string name;
};
class CastBlessingOfMightOnPartyAction : public BuffOnPartyAction
{
public:
CastBlessingOfMightOnPartyAction(PlayerbotAI* botAI) : BuffOnPartyAction(botAI, "blessing of might") {}
std::string const getName() override { return "blessing of might on party"; }
Value<Unit*>* GetTargetValue() override;
bool Execute(Event event) override;
};
class CastBlessingOfWisdomAction : public CastBuffSpellAction
{
public:
CastBlessingOfWisdomAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "blessing of wisdom") {}
bool Execute(Event event) override;
};
class CastBlessingOfWisdomOnPartyAction : public BuffOnPartyAction
{
public:
CastBlessingOfWisdomOnPartyAction(PlayerbotAI* botAI) : BuffOnPartyAction(botAI, "blessing of wisdom") {}
std::string const getName() override { return "blessing of wisdom on party"; }
Value<Unit*>* GetTargetValue() override;
bool Execute(Event event) override;
};
class CastBlessingOfKingsAction : public CastBuffSpellAction
{
public:
CastBlessingOfKingsAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "blessing of kings") {}
};
class CastBlessingOfKingsOnPartyAction : public CastBlessingOnPartyAction
{
public:
CastBlessingOfKingsOnPartyAction(PlayerbotAI* botAI) : CastBlessingOnPartyAction(botAI, "blessing of kings") {}
std::string const getName() override { return "blessing of kings on party"; }
Value<Unit*>* GetTargetValue() override; // added for Sanctuary priority
bool Execute(Event event) override; // added for 2 paladins logic
};
class CastBlessingOfSanctuaryAction : public CastBuffSpellAction
{
public:
CastBlessingOfSanctuaryAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "blessing of sanctuary") {}
};
class CastBlessingOfSanctuaryOnPartyAction : public BuffOnPartyAction
{
public:
CastBlessingOfSanctuaryOnPartyAction(PlayerbotAI* botAI) : BuffOnPartyAction(botAI, "blessing of sanctuary")
{
}
std::string const getName() override { return "blessing of sanctuary on party"; }
Value<Unit*>* GetTargetValue() override;
bool Execute(Event event) override;
};
class CastHolyLightAction : public CastHealingSpellAction
{
public:
CastHolyLightAction(PlayerbotAI* botAI) : CastHealingSpellAction(botAI, "holy light") {}
};
class CastHolyShockOnPartyAction : public HealPartyMemberAction
{
public:
CastHolyShockOnPartyAction(PlayerbotAI* botAI)
: HealPartyMemberAction(botAI, "holy shock", 25.0f, HealingManaEfficiency::LOW)
{
}
};
class CastHolyLightOnPartyAction : public HealPartyMemberAction
{
public:
CastHolyLightOnPartyAction(PlayerbotAI* botAI)
: HealPartyMemberAction(botAI, "holy light", 50.0f, HealingManaEfficiency::MEDIUM)
{
}
};
class CastFlashOfLightAction : public CastHealingSpellAction
{
public:
CastFlashOfLightAction(PlayerbotAI* botAI) : CastHealingSpellAction(botAI, "flash of light") {}
};
class CastFlashOfLightOnPartyAction : public HealPartyMemberAction
{
public:
CastFlashOfLightOnPartyAction(PlayerbotAI* botAI)
: HealPartyMemberAction(botAI, "flash of light", 15.0f, HealingManaEfficiency::HIGH)
{
}
};
class CastLayOnHandsAction : public CastHealingSpellAction
{
public:
CastLayOnHandsAction(PlayerbotAI* botAI) : CastHealingSpellAction(botAI, "lay on hands") {}
};
class CastLayOnHandsOnPartyAction : public HealPartyMemberAction
{
public:
CastLayOnHandsOnPartyAction(PlayerbotAI* botAI) : HealPartyMemberAction(botAI, "lay on hands") {}
};
class CastDivineProtectionAction : public CastBuffSpellAction
{
public:
CastDivineProtectionAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "divine protection") {}
};
class CastDivineProtectionOnPartyAction : public HealPartyMemberAction
{
public:
CastDivineProtectionOnPartyAction(PlayerbotAI* botAI) : HealPartyMemberAction(botAI, "divine protection") {}
std::string const getName() override { return "divine protection on party"; }
};
class CastDivineShieldAction : public CastBuffSpellAction
{
public:
CastDivineShieldAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "divine shield") {}
};
class CastHolyWrathAction : public CastMeleeSpellAction
{
public:
CastHolyWrathAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "holy wrath") {}
};
class CastHammerOfJusticeAction : public CastMeleeSpellAction
{
public:
CastHammerOfJusticeAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "hammer of justice") {}
};
class CastHammerOfTheRighteousAction : public CastMeleeSpellAction
{
public:
CastHammerOfTheRighteousAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "hammer of the righteous") {}
};
class CastPurifyPoisonAction : public CastCureSpellAction
{
public:
CastPurifyPoisonAction(PlayerbotAI* botAI) : CastCureSpellAction(botAI, "purify") {}
};
class CastPurifyDiseaseAction : public CastCureSpellAction
{
public:
CastPurifyDiseaseAction(PlayerbotAI* botAI) : CastCureSpellAction(botAI, "purify") {}
};
class CastPurifyPoisonOnPartyAction : public CurePartyMemberAction
{
public:
CastPurifyPoisonOnPartyAction(PlayerbotAI* botAI) : CurePartyMemberAction(botAI, "purify", DISPEL_POISON) {}
std::string const getName() override { return "purify poison on party"; }
};
class CastPurifyDiseaseOnPartyAction : public CurePartyMemberAction
{
public:
CastPurifyDiseaseOnPartyAction(PlayerbotAI* botAI) : CurePartyMemberAction(botAI, "purify", DISPEL_DISEASE) {}
std::string const getName() override { return "purify disease on party"; }
};
class CastHandOfReckoningAction : public CastSpellAction
{
public:
CastHandOfReckoningAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "hand of reckoning") {}
};
class CastRighteousDefenseAction : public CastSpellAction
{
public:
CastRighteousDefenseAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "righteous defense") {}
virtual Unit* GetTarget() override;
};
class CastCleansePoisonAction : public CastCureSpellAction
{
public:
CastCleansePoisonAction(PlayerbotAI* botAI) : CastCureSpellAction(botAI, "cleanse") {}
};
class CastCleanseDiseaseAction : public CastCureSpellAction
{
public:
CastCleanseDiseaseAction(PlayerbotAI* botAI) : CastCureSpellAction(botAI, "cleanse") {}
};
class CastCleanseMagicAction : public CastCureSpellAction
{
public:
CastCleanseMagicAction(PlayerbotAI* botAI) : CastCureSpellAction(botAI, "cleanse") {}
};
class CastCleansePoisonOnPartyAction : public CurePartyMemberAction
{
public:
CastCleansePoisonOnPartyAction(PlayerbotAI* botAI) : CurePartyMemberAction(botAI, "cleanse", DISPEL_POISON) {}
std::string const getName() override { return "cleanse poison on party"; }
};
class CastCleanseDiseaseOnPartyAction : public CurePartyMemberAction
{
public:
CastCleanseDiseaseOnPartyAction(PlayerbotAI* botAI) : CurePartyMemberAction(botAI, "cleanse", DISPEL_DISEASE) {}
std::string const getName() override { return "cleanse disease on party"; }
};
class CastCleanseMagicOnPartyAction : public CurePartyMemberAction
{
public:
CastCleanseMagicOnPartyAction(PlayerbotAI* botAI) : CurePartyMemberAction(botAI, "cleanse", DISPEL_MAGIC) {}
std::string const getName() override { return "cleanse magic on party"; }
};
BEGIN_SPELL_ACTION(CastAvengersShieldAction, "avenger's shield")
END_SPELL_ACTION()
BEGIN_SPELL_ACTION(CastExorcismAction, "exorcism")
END_SPELL_ACTION()
class CastHolyShieldAction : public CastBuffSpellAction
{
public:
CastHolyShieldAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "holy shield") {}
};
class CastRedemptionAction : public ResurrectPartyMemberAction
{
public:
CastRedemptionAction(PlayerbotAI* botAI) : ResurrectPartyMemberAction(botAI, "redemption") {}
};
class CastHammerOfJusticeOnEnemyHealerAction : public CastSpellOnEnemyHealerAction
{
public:
CastHammerOfJusticeOnEnemyHealerAction(PlayerbotAI* botAI)
: CastSpellOnEnemyHealerAction(botAI, "hammer of justice")
{
}
};
class CastHammerOfJusticeSnareAction : public CastSnareSpellAction
{
public:
CastHammerOfJusticeSnareAction(PlayerbotAI* botAI) : CastSnareSpellAction(botAI, "hammer of justice") {}
};
class CastTurnUndeadAction : public CastBuffSpellAction
{
public:
CastTurnUndeadAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "turn undead") {}
Value<Unit*>* GetTargetValue() override;
};
PROTECT_ACTION(CastBlessingOfProtectionProtectAction, "blessing of protection");
class CastDivinePleaAction : public CastBuffSpellAction
{
public:
CastDivinePleaAction(PlayerbotAI* ai) : CastBuffSpellAction(ai, "divine plea") {}
};
class ShieldOfRighteousnessAction : public CastMeleeSpellAction
{
public:
ShieldOfRighteousnessAction(PlayerbotAI* ai) : CastMeleeSpellAction(ai, "shield of righteousness") {}
};
class CastBeaconOfLightOnMainTankAction : public BuffOnMainTankAction
{
public:
CastBeaconOfLightOnMainTankAction(PlayerbotAI* ai) : BuffOnMainTankAction(ai, "beacon of light", true) {}
};
class CastSacredShieldOnMainTankAction : public BuffOnMainTankAction
{
public:
CastSacredShieldOnMainTankAction(PlayerbotAI* ai) : BuffOnMainTankAction(ai, "sacred shield", false) {}
};
class CastAvengingWrathAction : public CastBuffSpellAction
{
public:
CastAvengingWrathAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "avenging wrath") {}
};
class CastDivineIlluminationAction : public CastBuffSpellAction
{
public:
CastDivineIlluminationAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "divine illumination") {}
};
class CastDivineSacrificeAction : public CastBuffSpellAction
{
public:
CastDivineSacrificeAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "divine sacrifice") {}
bool isUseful() override;
};
class CastCancelDivineSacrificeAction : public Action
{
public:
CastCancelDivineSacrificeAction(PlayerbotAI* botAI) : Action(botAI, "cancel divine sacrifice") {}
bool Execute(Event event) override;
bool isUseful() override;
};
#endif

View File

@@ -0,0 +1,457 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#include "PaladinAiObjectContext.h"
#include "DpsPaladinStrategy.h"
#include "GenericPaladinNonCombatStrategy.h"
#include "HealPaladinStrategy.h"
#include "NamedObjectContext.h"
#include "OffhealRetPaladinStrategy.h"
#include "PaladinActions.h"
#include "PaladinBuffStrategies.h"
#include "PaladinTriggers.h"
#include "Playerbots.h"
#include "TankPaladinStrategy.h"
class PaladinStrategyFactoryInternal : public NamedObjectContext<Strategy>
{
public:
PaladinStrategyFactoryInternal()
{
creators["nc"] = &PaladinStrategyFactoryInternal::nc;
creators["cure"] = &PaladinStrategyFactoryInternal::cure;
creators["boost"] = &PaladinStrategyFactoryInternal::boost;
creators["cc"] = &PaladinStrategyFactoryInternal::cc;
creators["bthreat"] = &PaladinStrategyFactoryInternal::bthreat;
creators["healer dps"] = &PaladinStrategyFactoryInternal::healer_dps;
}
private:
static Strategy* nc(PlayerbotAI* botAI) { return new GenericPaladinNonCombatStrategy(botAI); }
static Strategy* cure(PlayerbotAI* botAI) { return new PaladinCureStrategy(botAI); }
static Strategy* boost(PlayerbotAI* botAI) { return new PaladinBoostStrategy(botAI); }
static Strategy* cc(PlayerbotAI* botAI) { return new PaladinCcStrategy(botAI); }
static Strategy* bthreat(PlayerbotAI* botAI) { return new PaladinBuffThreatStrategy(botAI); }
static Strategy* healer_dps(PlayerbotAI* botAI) { return new PaladinHealerDpsStrategy(botAI); }
};
class PaladinResistanceStrategyFactoryInternal : public NamedObjectContext<Strategy>
{
public:
PaladinResistanceStrategyFactoryInternal() : NamedObjectContext<Strategy>(false, true)
{
creators["rshadow"] = &PaladinResistanceStrategyFactoryInternal::rshadow;
creators["rfrost"] = &PaladinResistanceStrategyFactoryInternal::rfrost;
creators["rfire"] = &PaladinResistanceStrategyFactoryInternal::rfire;
creators["baoe"] = &PaladinResistanceStrategyFactoryInternal::baoe;
creators["barmor"] = &PaladinResistanceStrategyFactoryInternal::barmor;
creators["bcast"] = &PaladinResistanceStrategyFactoryInternal::bcast;
creators["bspeed"] = &PaladinResistanceStrategyFactoryInternal::bspeed;
}
private:
static Strategy* rshadow(PlayerbotAI* botAI) { return new PaladinShadowResistanceStrategy(botAI); }
static Strategy* rfrost(PlayerbotAI* botAI) { return new PaladinFrostResistanceStrategy(botAI); }
static Strategy* rfire(PlayerbotAI* botAI) { return new PaladinFireResistanceStrategy(botAI); }
static Strategy* baoe(PlayerbotAI* botAI) { return new PaladinBuffAoeStrategy(botAI); }
static Strategy* barmor(PlayerbotAI* botAI) { return new PaladinBuffArmorStrategy(botAI); }
static Strategy* bcast(PlayerbotAI* botAI) { return new PaladinBuffCastStrategy(botAI); }
static Strategy* bspeed(PlayerbotAI* botAI) { return new PaladinBuffSpeedStrategy(botAI); }
};
class PaladinBuffStrategyFactoryInternal : public NamedObjectContext<Strategy>
{
public:
PaladinBuffStrategyFactoryInternal() : NamedObjectContext<Strategy>(false, true)
{
creators["bhealth"] = &PaladinBuffStrategyFactoryInternal::bhealth;
creators["bmana"] = &PaladinBuffStrategyFactoryInternal::bmana;
creators["bdps"] = &PaladinBuffStrategyFactoryInternal::bdps;
creators["bstats"] = &PaladinBuffStrategyFactoryInternal::bstats;
}
private:
static Strategy* bhealth(PlayerbotAI* botAI) { return new PaladinBuffHealthStrategy(botAI); }
static Strategy* bmana(PlayerbotAI* botAI) { return new PaladinBuffManaStrategy(botAI); }
static Strategy* bdps(PlayerbotAI* botAI) { return new PaladinBuffDpsStrategy(botAI); }
static Strategy* bstats(PlayerbotAI* botAI) { return new PaladinBuffStatsStrategy(botAI); }
};
class PaladinCombatStrategyFactoryInternal : public NamedObjectContext<Strategy>
{
public:
PaladinCombatStrategyFactoryInternal() : NamedObjectContext<Strategy>(false, true)
{
creators["tank"] = &PaladinCombatStrategyFactoryInternal::tank;
creators["dps"] = &PaladinCombatStrategyFactoryInternal::dps;
creators["heal"] = &PaladinCombatStrategyFactoryInternal::heal;
creators["offheal"] = &PaladinCombatStrategyFactoryInternal::offheal;
}
private:
static Strategy* tank(PlayerbotAI* botAI) { return new TankPaladinStrategy(botAI); }
static Strategy* dps(PlayerbotAI* botAI) { return new DpsPaladinStrategy(botAI); }
static Strategy* heal(PlayerbotAI* botAI) { return new HealPaladinStrategy(botAI); }
static Strategy* offheal(PlayerbotAI* botAI) { return new OffhealRetPaladinStrategy(botAI); }
};
class PaladinTriggerFactoryInternal : public NamedObjectContext<Trigger>
{
public:
PaladinTriggerFactoryInternal()
{
creators["judgement"] = &PaladinTriggerFactoryInternal::judgement;
creators["judgement of wisdom"] = &PaladinTriggerFactoryInternal::judgement_of_wisdom;
creators["judgement of light"] = &PaladinTriggerFactoryInternal::judgement_of_light;
creators["blessing"] = &PaladinTriggerFactoryInternal::blessing;
creators["seal"] = &PaladinTriggerFactoryInternal::seal;
creators["art of war"] = &PaladinTriggerFactoryInternal::art_of_war;
creators["blessing on party"] = &PaladinTriggerFactoryInternal::blessing_on_party;
creators["crusader aura"] = &PaladinTriggerFactoryInternal::crusader_aura;
creators["retribution aura"] = &PaladinTriggerFactoryInternal::retribution_aura;
creators["devotion aura"] = &PaladinTriggerFactoryInternal::devotion_aura;
creators["sanctity aura"] = &PaladinTriggerFactoryInternal::sanctity_aura;
creators["concentration aura"] = &PaladinTriggerFactoryInternal::concentration_aura;
creators["shadow resistance aura"] = &PaladinTriggerFactoryInternal::shadow_resistance_aura;
creators["frost resistance aura"] = &PaladinTriggerFactoryInternal::frost_resistance_aura;
creators["fire resistance aura"] = &PaladinTriggerFactoryInternal::fire_resistance_aura;
creators["hammer of justice snare"] = &PaladinTriggerFactoryInternal::hammer_of_justice_snare;
creators["hammer of justice interrupt"] = &PaladinTriggerFactoryInternal::hammer_of_justice_interrupt;
creators["cleanse cure disease"] = &PaladinTriggerFactoryInternal::CleanseCureDisease;
creators["cleanse party member cure disease"] = &PaladinTriggerFactoryInternal::CleanseCurePartyMemberDisease;
creators["cleanse cure poison"] = &PaladinTriggerFactoryInternal::CleanseCurePoison;
creators["cleanse party member cure poison"] = &PaladinTriggerFactoryInternal::CleanseCurePartyMemberPoison;
creators["cleanse cure magic"] = &PaladinTriggerFactoryInternal::CleanseCureMagic;
creators["cleanse party member cure magic"] = &PaladinTriggerFactoryInternal::CleanseCurePartyMemberMagic;
creators["righteous fury"] = &PaladinTriggerFactoryInternal::righteous_fury;
creators["holy shield"] = &PaladinTriggerFactoryInternal::holy_shield;
creators["hammer of justice on enemy healer"] =
&PaladinTriggerFactoryInternal::hammer_of_justice_on_enemy_target;
creators["hammer of justice on snare target"] =
&PaladinTriggerFactoryInternal::hammer_of_justice_on_snare_target;
creators["divine favor"] = &PaladinTriggerFactoryInternal::divine_favor;
creators["turn undead"] = &PaladinTriggerFactoryInternal::turn_undead;
creators["avenger's shield"] = &PaladinTriggerFactoryInternal::avenger_shield;
creators["consecration"] = &PaladinTriggerFactoryInternal::consecration;
creators["repentance on enemy healer"] = &PaladinTriggerFactoryInternal::repentance_on_enemy_healer;
creators["repentance on snare target"] = &PaladinTriggerFactoryInternal::repentance_on_snare_target;
creators["repentance interrupt"] = &PaladinTriggerFactoryInternal::repentance_interrupt;
creators["beacon of light on main tank"] = &PaladinTriggerFactoryInternal::beacon_of_light_on_main_tank;
creators["sacred shield on main tank"] = &PaladinTriggerFactoryInternal::sacred_shield_on_main_tank;
creators["blessing of kings on party"] = &PaladinTriggerFactoryInternal::blessing_of_kings_on_party;
creators["blessing of wisdom on party"] = &PaladinTriggerFactoryInternal::blessing_of_wisdom_on_party;
creators["blessing of might on party"] = &PaladinTriggerFactoryInternal::blessing_of_might_on_party;
creators["blessing of sanctuary on party"] = &PaladinTriggerFactoryInternal::blessing_of_sanctuary_on_party;
creators["avenging wrath"] = &PaladinTriggerFactoryInternal::avenging_wrath;
}
private:
static Trigger* turn_undead(PlayerbotAI* botAI) { return new TurnUndeadTrigger(botAI); }
static Trigger* divine_favor(PlayerbotAI* botAI) { return new DivineFavorTrigger(botAI); }
static Trigger* holy_shield(PlayerbotAI* botAI) { return new HolyShieldTrigger(botAI); }
static Trigger* righteous_fury(PlayerbotAI* botAI) { return new RighteousFuryTrigger(botAI); }
static Trigger* judgement(PlayerbotAI* botAI) { return new JudgementTrigger(botAI); }
static Trigger* judgement_of_wisdom(PlayerbotAI* botAI) { return new JudgementOfWisdomTrigger(botAI); }
static Trigger* judgement_of_light(PlayerbotAI* botAI) { return new JudgementOfLightTrigger(botAI); }
static Trigger* blessing(PlayerbotAI* botAI) { return new BlessingTrigger(botAI); }
static Trigger* seal(PlayerbotAI* botAI) { return new SealTrigger(botAI); }
static Trigger* art_of_war(PlayerbotAI* botAI) { return new ArtOfWarTrigger(botAI); }
static Trigger* blessing_on_party(PlayerbotAI* botAI) { return new BlessingOnPartyTrigger(botAI); }
static Trigger* crusader_aura(PlayerbotAI* botAI) { return new CrusaderAuraTrigger(botAI); }
static Trigger* retribution_aura(PlayerbotAI* botAI) { return new RetributionAuraTrigger(botAI); }
static Trigger* devotion_aura(PlayerbotAI* botAI) { return new DevotionAuraTrigger(botAI); }
static Trigger* sanctity_aura(PlayerbotAI* botAI) { return new SanctityAuraTrigger(botAI); }
static Trigger* concentration_aura(PlayerbotAI* botAI) { return new ConcentrationAuraTrigger(botAI); }
static Trigger* shadow_resistance_aura(PlayerbotAI* botAI) { return new ShadowResistanceAuraTrigger(botAI); }
static Trigger* frost_resistance_aura(PlayerbotAI* botAI) { return new FrostResistanceAuraTrigger(botAI); }
static Trigger* fire_resistance_aura(PlayerbotAI* botAI) { return new FireResistanceAuraTrigger(botAI); }
static Trigger* hammer_of_justice_snare(PlayerbotAI* botAI) { return new HammerOfJusticeSnareTrigger(botAI); }
static Trigger* hammer_of_justice_interrupt(PlayerbotAI* botAI)
{
return new HammerOfJusticeInterruptSpellTrigger(botAI);
}
static Trigger* CleanseCureDisease(PlayerbotAI* botAI) { return new CleanseCureDiseaseTrigger(botAI); }
static Trigger* CleanseCurePartyMemberDisease(PlayerbotAI* botAI)
{
return new CleanseCurePartyMemberDiseaseTrigger(botAI);
}
static Trigger* CleanseCurePoison(PlayerbotAI* botAI) { return new CleanseCurePoisonTrigger(botAI); }
static Trigger* CleanseCurePartyMemberPoison(PlayerbotAI* botAI)
{
return new CleanseCurePartyMemberPoisonTrigger(botAI);
}
static Trigger* CleanseCureMagic(PlayerbotAI* botAI) { return new CleanseCureMagicTrigger(botAI); }
static Trigger* CleanseCurePartyMemberMagic(PlayerbotAI* botAI)
{
return new CleanseCurePartyMemberMagicTrigger(botAI);
}
static Trigger* hammer_of_justice_on_enemy_target(PlayerbotAI* botAI)
{
return new HammerOfJusticeEnemyHealerTrigger(botAI);
}
static Trigger* hammer_of_justice_on_snare_target(PlayerbotAI* botAI)
{
return new HammerOfJusticeSnareTrigger(botAI);
}
static Trigger* avenger_shield(PlayerbotAI* botAI) { return new AvengerShieldTrigger(botAI); }
static Trigger* consecration(PlayerbotAI* botAI) { return new ConsecrationTrigger(botAI); }
static Trigger* repentance_on_enemy_healer(PlayerbotAI* botAI) { return new RepentanceOnHealerTrigger(botAI); }
static Trigger* repentance_on_snare_target(PlayerbotAI* botAI) { return new RepentanceSnareTrigger(botAI); }
static Trigger* repentance_interrupt(PlayerbotAI* botAI) { return new RepentanceInterruptTrigger(botAI); }
static Trigger* beacon_of_light_on_main_tank(PlayerbotAI* ai) { return new BeaconOfLightOnMainTankTrigger(ai); }
static Trigger* sacred_shield_on_main_tank(PlayerbotAI* ai) { return new SacredShieldOnMainTankTrigger(ai); }
static Trigger* blessing_of_kings_on_party(PlayerbotAI* botAI) { return new BlessingOfKingsOnPartyTrigger(botAI); }
static Trigger* blessing_of_wisdom_on_party(PlayerbotAI* botAI)
{
return new BlessingOfWisdomOnPartyTrigger(botAI);
}
static Trigger* blessing_of_might_on_party(PlayerbotAI* botAI) { return new BlessingOfMightOnPartyTrigger(botAI); }
static Trigger* blessing_of_sanctuary_on_party(PlayerbotAI* botAI)
{
return new BlessingOfSanctuaryOnPartyTrigger(botAI);
}
static Trigger* avenging_wrath(PlayerbotAI* botAI) { return new AvengingWrathTrigger(botAI); }
};
class PaladinAiObjectContextInternal : public NamedObjectContext<Action>
{
public:
PaladinAiObjectContextInternal()
{
creators["seal of command"] = &PaladinAiObjectContextInternal::seal_of_command;
creators["seal of vengeance"] = &PaladinAiObjectContextInternal::seal_of_vengeance;
creators["seal of corruption"] = &PaladinAiObjectContextInternal::seal_of_corruption;
creators["blessing of might"] = &PaladinAiObjectContextInternal::blessing_of_might;
creators["blessing of wisdom"] = &PaladinAiObjectContextInternal::blessing_of_wisdom;
creators["blessing of kings"] = &PaladinAiObjectContextInternal::blessing_of_kings;
creators["blessing of sanctuary"] = &PaladinAiObjectContextInternal::blessing_of_sanctuary;
creators["divine storm"] = &PaladinAiObjectContextInternal::divine_storm;
creators["blessing of kings on party"] = &PaladinAiObjectContextInternal::blessing_of_kings_on_party;
creators["blessing of might on party"] = &PaladinAiObjectContextInternal::blessing_of_might_on_party;
creators["blessing of wisdom on party"] = &PaladinAiObjectContextInternal::blessing_of_wisdom_on_party;
creators["blessing of sanctuary on party"] = &PaladinAiObjectContextInternal::blessing_of_sanctuary_on_party;
creators["redemption"] = &PaladinAiObjectContextInternal::redemption;
creators["crusader strike"] = &PaladinAiObjectContextInternal::crusader_strike;
creators["crusader aura"] = &PaladinAiObjectContextInternal::crusader_aura;
creators["seal of light"] = &PaladinAiObjectContextInternal::seal_of_light;
creators["devotion aura"] = &PaladinAiObjectContextInternal::devotion_aura;
creators["concentration aura"] = &PaladinAiObjectContextInternal::concentration_aura;
creators["holy wrath"] = &PaladinAiObjectContextInternal::holy_wrath;
creators["consecration"] = &PaladinAiObjectContextInternal::consecration;
creators["cleanse disease"] = &PaladinAiObjectContextInternal::cleanse_disease;
creators["cleanse poison"] = &PaladinAiObjectContextInternal::cleanse_poison;
creators["cleanse magic"] = &PaladinAiObjectContextInternal::cleanse_magic;
creators["purify disease"] = &PaladinAiObjectContextInternal::purify_disease;
creators["purify poison"] = &PaladinAiObjectContextInternal::purify_poison;
creators["cleanse poison on party"] = &PaladinAiObjectContextInternal::cleanse_poison_on_party;
creators["cleanse disease on party"] = &PaladinAiObjectContextInternal::cleanse_disease_on_party;
creators["cleanse magic on party"] = &PaladinAiObjectContextInternal::cleanse_magic_on_party;
creators["purify poison on party"] = &PaladinAiObjectContextInternal::purify_poison_on_party;
creators["purify disease on party"] = &PaladinAiObjectContextInternal::purify_disease_on_party;
creators["seal of wisdom"] = &PaladinAiObjectContextInternal::seal_of_wisdom;
creators["seal of justice"] = &PaladinAiObjectContextInternal::seal_of_justice;
creators["seal of righteousness"] = &PaladinAiObjectContextInternal::seal_of_righteousness;
creators["flash of light"] = &PaladinAiObjectContextInternal::flash_of_light;
creators["hand of reckoning"] = &PaladinAiObjectContextInternal::hand_of_reckoning;
creators["avenger's shield"] = &PaladinAiObjectContextInternal::avengers_shield;
creators["exorcism"] = &PaladinAiObjectContextInternal::exorcism;
creators["judgement"] = &PaladinAiObjectContextInternal::judgement;
creators["judgement of light"] = &PaladinAiObjectContextInternal::judgement_of_light;
creators["judgement of wisdom"] = &PaladinAiObjectContextInternal::judgement_of_wisdom;
creators["divine shield"] = &PaladinAiObjectContextInternal::divine_shield;
creators["divine protection"] = &PaladinAiObjectContextInternal::divine_protection;
creators["divine protection on party"] = &PaladinAiObjectContextInternal::divine_protection_on_party;
creators["hammer of justice"] = &PaladinAiObjectContextInternal::hammer_of_justice;
creators["flash of light on party"] = &PaladinAiObjectContextInternal::flash_of_light_on_party;
creators["holy light"] = &PaladinAiObjectContextInternal::holy_light;
creators["holy light on party"] = &PaladinAiObjectContextInternal::holy_light_on_party;
creators["lay on hands"] = &PaladinAiObjectContextInternal::lay_on_hands;
creators["lay on hands on party"] = &PaladinAiObjectContextInternal::lay_on_hands_on_party;
creators["judgement of justice"] = &PaladinAiObjectContextInternal::judgement_of_justice;
creators["hammer of wrath"] = &PaladinAiObjectContextInternal::hammer_of_wrath;
creators["holy shield"] = &PaladinAiObjectContextInternal::holy_shield;
creators["hammer of the righteous"] = &PaladinAiObjectContextInternal::hammer_of_the_righteous;
creators["retribution aura"] = &PaladinAiObjectContextInternal::retribution_aura;
creators["shadow resistance aura"] = &PaladinAiObjectContextInternal::shadow_resistance_aura;
creators["frost resistance aura"] = &PaladinAiObjectContextInternal::frost_resistance_aura;
creators["fire resistance aura"] = &PaladinAiObjectContextInternal::fire_resistance_aura;
creators["righteous fury"] = &PaladinAiObjectContextInternal::righteous_fury;
creators["hammer of justice on enemy healer"] =
&PaladinAiObjectContextInternal::hammer_of_justice_on_enemy_healer;
creators["hammer of justice on snare target"] =
&PaladinAiObjectContextInternal::hammer_of_justice_on_snare_target;
creators["divine favor"] = &PaladinAiObjectContextInternal::divine_favor;
creators["turn undead"] = &PaladinAiObjectContextInternal::turn_undead;
creators["blessing of protection on party"] = &PaladinAiObjectContextInternal::blessing_of_protection_on_party;
creators["righteous defense"] = &PaladinAiObjectContextInternal::righteous_defense;
creators["repentance"] = &PaladinAiObjectContextInternal::repentance;
creators["repentance on snare target"] = &PaladinAiObjectContextInternal::repentance_on_snare_target;
creators["repentance on enemy healer"] = &PaladinAiObjectContextInternal::repentance_on_enemy_healer;
creators["sanctity aura"] = &PaladinAiObjectContextInternal::sanctity_aura;
creators["holy shock"] = &PaladinAiObjectContextInternal::holy_shock;
creators["holy shock on party"] = &PaladinAiObjectContextInternal::holy_shock_on_party;
creators["divine plea"] = &PaladinAiObjectContextInternal::divine_plea;
creators["shield of righteousness"] = &PaladinAiObjectContextInternal::shield_of_righteousness;
creators["beacon of light on main tank"] = &PaladinAiObjectContextInternal::beacon_of_light_on_main_tank;
creators["sacred shield on main tank"] = &PaladinAiObjectContextInternal::sacred_shield_on_main_tank;
creators["avenging wrath"] = &PaladinAiObjectContextInternal::avenging_wrath;
creators["divine illumination"] = &PaladinAiObjectContextInternal::divine_illumination;
creators["divine sacrifice"] = &PaladinAiObjectContextInternal::divine_sacrifice;
creators["cancel divine sacrifice"] = &PaladinAiObjectContextInternal::cancel_divine_sacrifice;
}
private:
static Action* blessing_of_protection_on_party(PlayerbotAI* botAI)
{
return new CastBlessingOfProtectionProtectAction(botAI);
}
static Action* turn_undead(PlayerbotAI* botAI) { return new CastTurnUndeadAction(botAI); }
static Action* divine_favor(PlayerbotAI* botAI) { return new CastDivineFavorAction(botAI); }
static Action* righteous_fury(PlayerbotAI* botAI) { return new CastRighteousFuryAction(botAI); }
static Action* seal_of_command(PlayerbotAI* botAI) { return new CastSealOfCommandAction(botAI); }
static Action* seal_of_vengeance(PlayerbotAI* botAI) { return new CastSealOfVengeanceAction(botAI); }
static Action* seal_of_corruption(PlayerbotAI* botAI) { return new CastSealOfCorruptionAction(botAI); }
static Action* blessing_of_sanctuary(PlayerbotAI* botAI) { return new CastBlessingOfSanctuaryAction(botAI); }
static Action* blessing_of_might(PlayerbotAI* botAI) { return new CastBlessingOfMightAction(botAI); }
static Action* blessing_of_wisdom(PlayerbotAI* botAI) { return new CastBlessingOfWisdomAction(botAI); }
static Action* blessing_of_kings(PlayerbotAI* botAI) { return new CastBlessingOfKingsAction(botAI); }
static Action* divine_storm(PlayerbotAI* botAI) { return new CastDivineStormAction(botAI); }
static Action* blessing_of_kings_on_party(PlayerbotAI* botAI)
{
return new CastBlessingOfKingsOnPartyAction(botAI);
}
static Action* blessing_of_might_on_party(PlayerbotAI* botAI)
{
return new CastBlessingOfMightOnPartyAction(botAI);
}
static Action* blessing_of_wisdom_on_party(PlayerbotAI* botAI)
{
return new CastBlessingOfWisdomOnPartyAction(botAI);
}
static Action* blessing_of_sanctuary_on_party(PlayerbotAI* botAI)
{
return new CastBlessingOfSanctuaryOnPartyAction(botAI);
}
static Action* redemption(PlayerbotAI* botAI) { return new CastRedemptionAction(botAI); }
static Action* crusader_strike(PlayerbotAI* botAI) { return new CastCrusaderStrikeAction(botAI); }
static Action* crusader_aura(PlayerbotAI* botAI) { return new CastCrusaderAuraAction(botAI); }
static Action* seal_of_light(PlayerbotAI* botAI) { return new CastSealOfLightAction(botAI); }
static Action* devotion_aura(PlayerbotAI* botAI) { return new CastDevotionAuraAction(botAI); }
static Action* concentration_aura(PlayerbotAI* botAI) { return new CastConcentrationAuraAction(botAI); }
static Action* holy_wrath(PlayerbotAI* botAI) { return new CastHolyWrathAction(botAI); }
static Action* consecration(PlayerbotAI* botAI) { return new CastConsecrationAction(botAI); }
static Action* cleanse_poison(PlayerbotAI* botAI) { return new CastCleansePoisonAction(botAI); }
static Action* cleanse_disease(PlayerbotAI* botAI) { return new CastCleanseDiseaseAction(botAI); }
static Action* cleanse_magic(PlayerbotAI* botAI) { return new CastCleanseMagicAction(botAI); }
static Action* purify_poison(PlayerbotAI* botAI) { return new CastPurifyPoisonAction(botAI); }
static Action* purify_disease(PlayerbotAI* botAI) { return new CastPurifyDiseaseAction(botAI); }
static Action* cleanse_poison_on_party(PlayerbotAI* botAI) { return new CastCleansePoisonOnPartyAction(botAI); }
static Action* cleanse_disease_on_party(PlayerbotAI* botAI) { return new CastCleanseDiseaseOnPartyAction(botAI); }
static Action* cleanse_magic_on_party(PlayerbotAI* botAI) { return new CastCleanseMagicOnPartyAction(botAI); }
static Action* purify_poison_on_party(PlayerbotAI* botAI) { return new CastPurifyPoisonOnPartyAction(botAI); }
static Action* purify_disease_on_party(PlayerbotAI* botAI) { return new CastPurifyDiseaseOnPartyAction(botAI); }
static Action* seal_of_wisdom(PlayerbotAI* botAI) { return new CastSealOfWisdomAction(botAI); }
static Action* seal_of_justice(PlayerbotAI* botAI) { return new CastSealOfJusticeAction(botAI); }
static Action* seal_of_righteousness(PlayerbotAI* botAI) { return new CastSealOfRighteousnessAction(botAI); }
static Action* flash_of_light(PlayerbotAI* botAI) { return new CastFlashOfLightAction(botAI); }
static Action* hand_of_reckoning(PlayerbotAI* botAI) { return new CastHandOfReckoningAction(botAI); }
static Action* avengers_shield(PlayerbotAI* botAI) { return new CastAvengersShieldAction(botAI); }
static Action* exorcism(PlayerbotAI* botAI) { return new CastExorcismAction(botAI); }
static Action* judgement(PlayerbotAI* botAI) { return new CastJudgementAction(botAI); }
static Action* judgement_of_light(PlayerbotAI* botAI) { return new CastJudgementOfLightAction(botAI); }
static Action* judgement_of_wisdom(PlayerbotAI* botAI) { return new CastJudgementOfWisdomAction(botAI); }
static Action* divine_shield(PlayerbotAI* botAI) { return new CastDivineShieldAction(botAI); }
static Action* divine_protection(PlayerbotAI* botAI) { return new CastDivineProtectionAction(botAI); }
static Action* divine_protection_on_party(PlayerbotAI* botAI)
{
return new CastDivineProtectionOnPartyAction(botAI);
}
static Action* hammer_of_justice(PlayerbotAI* botAI) { return new CastHammerOfJusticeAction(botAI); }
static Action* flash_of_light_on_party(PlayerbotAI* botAI) { return new CastFlashOfLightOnPartyAction(botAI); }
static Action* holy_light(PlayerbotAI* botAI) { return new CastHolyLightAction(botAI); }
static Action* holy_light_on_party(PlayerbotAI* botAI) { return new CastHolyLightOnPartyAction(botAI); }
static Action* lay_on_hands(PlayerbotAI* botAI) { return new CastLayOnHandsAction(botAI); }
static Action* lay_on_hands_on_party(PlayerbotAI* botAI) { return new CastLayOnHandsOnPartyAction(botAI); }
static Action* judgement_of_justice(PlayerbotAI* botAI) { return new CastJudgementOfJusticeAction(botAI); }
static Action* hammer_of_wrath(PlayerbotAI* botAI) { return new CastHammerOfWrathAction(botAI); }
static Action* holy_shield(PlayerbotAI* botAI) { return new CastHolyShieldAction(botAI); }
static Action* hammer_of_the_righteous(PlayerbotAI* botAI) { return new CastHammerOfTheRighteousAction(botAI); }
static Action* retribution_aura(PlayerbotAI* botAI) { return new CastRetributionAuraAction(botAI); }
static Action* shadow_resistance_aura(PlayerbotAI* botAI) { return new CastShadowResistanceAuraAction(botAI); }
static Action* frost_resistance_aura(PlayerbotAI* botAI) { return new CastFrostResistanceAuraAction(botAI); }
static Action* fire_resistance_aura(PlayerbotAI* botAI) { return new CastFireResistanceAuraAction(botAI); }
static Action* hammer_of_justice_on_enemy_healer(PlayerbotAI* botAI)
{
return new CastHammerOfJusticeOnEnemyHealerAction(botAI);
}
static Action* hammer_of_justice_on_snare_target(PlayerbotAI* botAI)
{
return new CastHammerOfJusticeSnareAction(botAI);
}
static Action* righteous_defense(PlayerbotAI* botAI) { return new CastRighteousDefenseAction(botAI); }
static Action* repentance(PlayerbotAI* botAI) { return new CastRepentanceAction(botAI); }
static Action* repentance_on_snare_target(PlayerbotAI* botAI) { return new CastRepentanceSnareAction(botAI); }
static Action* repentance_on_enemy_healer(PlayerbotAI* botAI) { return new CastRepentanceOnHealerAction(botAI); }
static Action* sanctity_aura(PlayerbotAI* botAI) { return new CastSanctityAuraAction(botAI); }
static Action* holy_shock(PlayerbotAI* botAI) { return new CastHolyShockAction(botAI); }
static Action* holy_shock_on_party(PlayerbotAI* botAI) { return new CastHolyShockOnPartyAction(botAI); }
static Action* divine_plea(PlayerbotAI* ai) { return new CastDivinePleaAction(ai); }
static Action* shield_of_righteousness(PlayerbotAI* ai) { return new ShieldOfRighteousnessAction(ai); }
static Action* beacon_of_light_on_main_tank(PlayerbotAI* ai) { return new CastBeaconOfLightOnMainTankAction(ai); }
static Action* sacred_shield_on_main_tank(PlayerbotAI* ai) { return new CastSacredShieldOnMainTankAction(ai); }
static Action* avenging_wrath(PlayerbotAI* ai) { return new CastAvengingWrathAction(ai); }
static Action* divine_illumination(PlayerbotAI* ai) { return new CastDivineIlluminationAction(ai); }
static Action* divine_sacrifice(PlayerbotAI* ai) { return new CastDivineSacrificeAction(ai); }
static Action* cancel_divine_sacrifice(PlayerbotAI* ai) { return new CastCancelDivineSacrificeAction(ai); }
};
SharedNamedObjectContextList<Strategy> PaladinAiObjectContext::sharedStrategyContexts;
SharedNamedObjectContextList<Action> PaladinAiObjectContext::sharedActionContexts;
SharedNamedObjectContextList<Trigger> PaladinAiObjectContext::sharedTriggerContexts;
SharedNamedObjectContextList<UntypedValue> PaladinAiObjectContext::sharedValueContexts;
PaladinAiObjectContext::PaladinAiObjectContext(PlayerbotAI* botAI)
: AiObjectContext(botAI, sharedStrategyContexts, sharedActionContexts, sharedTriggerContexts, sharedValueContexts)
{
}
void PaladinAiObjectContext::BuildSharedContexts()
{
BuildSharedStrategyContexts(sharedStrategyContexts);
BuildSharedActionContexts(sharedActionContexts);
BuildSharedTriggerContexts(sharedTriggerContexts);
BuildSharedValueContexts(sharedValueContexts);
}
void PaladinAiObjectContext::BuildSharedStrategyContexts(SharedNamedObjectContextList<Strategy>& strategyContexts)
{
AiObjectContext::BuildSharedStrategyContexts(strategyContexts);
strategyContexts.Add(new PaladinStrategyFactoryInternal());
strategyContexts.Add(new PaladinCombatStrategyFactoryInternal());
strategyContexts.Add(new PaladinBuffStrategyFactoryInternal());
strategyContexts.Add(new PaladinResistanceStrategyFactoryInternal());
}
void PaladinAiObjectContext::BuildSharedActionContexts(SharedNamedObjectContextList<Action>& actionContexts)
{
AiObjectContext::BuildSharedActionContexts(actionContexts);
actionContexts.Add(new PaladinAiObjectContextInternal());
}
void PaladinAiObjectContext::BuildSharedTriggerContexts(SharedNamedObjectContextList<Trigger>& triggerContexts)
{
AiObjectContext::BuildSharedTriggerContexts(triggerContexts);
triggerContexts.Add(new PaladinTriggerFactoryInternal());
}
void PaladinAiObjectContext::BuildSharedValueContexts(SharedNamedObjectContextList<UntypedValue>& valueContexts)
{
AiObjectContext::BuildSharedValueContexts(valueContexts);
}

View File

@@ -0,0 +1,30 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_PALADINAIOBJECTCONTEXT_H
#define _PLAYERBOT_PALADINAIOBJECTCONTEXT_H
#include "AiObjectContext.h"
class PlayerbotAI;
class PaladinAiObjectContext : public AiObjectContext
{
public:
PaladinAiObjectContext(PlayerbotAI* botAI);
static void BuildSharedContexts();
static void BuildSharedStrategyContexts(SharedNamedObjectContextList<Strategy>& strategyContexts);
static void BuildSharedActionContexts(SharedNamedObjectContextList<Action>& actionContexts);
static void BuildSharedTriggerContexts(SharedNamedObjectContextList<Trigger>& triggerContexts);
static void BuildSharedValueContexts(SharedNamedObjectContextList<UntypedValue>& valueContexts);
static SharedNamedObjectContextList<Strategy> sharedStrategyContexts;
static SharedNamedObjectContextList<Action> sharedActionContexts;
static SharedNamedObjectContextList<Trigger> sharedTriggerContexts;
static SharedNamedObjectContextList<UntypedValue> sharedValueContexts;
};
#endif

View File

@@ -0,0 +1,212 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#include "DpsPaladinStrategy.h"
#include "Playerbots.h"
#include "Strategy.h"
class DpsPaladinStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
{
public:
DpsPaladinStrategyActionNodeFactory()
{
creators["sanctity aura"] = &sanctity_aura;
creators["retribution aura"] = &retribution_aura;
creators["seal of corruption"] = &seal_of_corruption;
creators["seal of vengeance"] = &seal_of_vengeance;
creators["seal of command"] = &seal_of_command;
creators["blessing of might"] = &blessing_of_might;
creators["crusader strike"] = &crusader_strike;
creators["repentance"] = &repentance;
creators["repentance on enemy healer"] = &repentance_on_enemy_healer;
creators["repentance on snare target"] = &repentance_on_snare_target;
creators["repentance of shield"] = &repentance_or_shield;
}
private:
static ActionNode* seal_of_corruption([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"seal of corruption",
/*P*/ {},
/*A*/ { NextAction("seal of vengeance") },
/*C*/ {}
);
}
static ActionNode* seal_of_vengeance([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"seal of vengeance",
/*P*/ {},
/*A*/ { NextAction("seal of command") },
/*C*/ {}
);
}
static ActionNode* seal_of_command([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"seal of command",
/*P*/ {},
/*A*/ { NextAction("seal of righteousness") },
/*C*/ {}
);
}
static ActionNode* blessing_of_might([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"blessing of might",
/*P*/ {},
/*A*/ { NextAction("blessing of kings") },
/*C*/ {}
);
}
static ActionNode* crusader_strike([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"crusader strike",
/*P*/ {},
/*A*/ {},
/*C*/ {}
);
}
static ActionNode* repentance([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"repentance",
/*P*/ {},
/*A*/ { NextAction("hammer of justice") },
/*C*/ {}
);
}
static ActionNode* repentance_on_enemy_healer([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"repentance on enemy healer",
/*P*/ {},
/*A*/ { NextAction("hammer of justice on enemy healer") },
/*C*/ {}
);
}
static ActionNode* repentance_on_snare_target([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"repentance on snare target",
/*P*/ {},
/*A*/ { NextAction("hammer of justice on snare target") },
/*C*/ {}
);
}
static ActionNode* sanctity_aura([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"sanctity aura",
/*P*/ {},
/*A*/ { NextAction("retribution aura") },
/*C*/ {}
);
}
static ActionNode* retribution_aura([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"retribution aura",
/*P*/ {},
/*A*/ { NextAction("devotion aura") },
/*C*/ {}
);
}
static ActionNode* repentance_or_shield([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"repentance",
/*P*/ {},
/*A*/ { NextAction("divine shield") },
/*C*/ {}
);
}
};
DpsPaladinStrategy::DpsPaladinStrategy(PlayerbotAI* botAI) : GenericPaladinStrategy(botAI)
{
actionNodeFactories.Add(new DpsPaladinStrategyActionNodeFactory());
}
std::vector<NextAction> DpsPaladinStrategy::getDefaultActions()
{
return {
NextAction("hammer of wrath", ACTION_DEFAULT + 0.6f),
NextAction("judgement of wisdom", ACTION_DEFAULT + 0.5f),
NextAction("crusader strike", ACTION_DEFAULT + 0.4f),
NextAction("divine storm", ACTION_DEFAULT + 0.3f),
NextAction("consecration", ACTION_DEFAULT + 0.1f),
NextAction("melee", ACTION_DEFAULT)
};
}
void DpsPaladinStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
GenericPaladinStrategy::InitTriggers(triggers);
triggers.push_back(
new TriggerNode(
"art of war",
{
NextAction("exorcism", ACTION_DEFAULT + 0.2f)
}
)
);
triggers.push_back(
new TriggerNode(
"seal",
{
NextAction("seal of corruption", ACTION_HIGH)
}
)
);
triggers.push_back(
new TriggerNode(
"low mana",
{
NextAction("seal of wisdom", ACTION_HIGH + 5)
}
)
);
triggers.push_back(
new TriggerNode(
"avenging wrath",
{
NextAction("avenging wrath", ACTION_HIGH + 2)
}
)
);
triggers.push_back(
new TriggerNode(
"medium aoe",
{
NextAction("divine storm", ACTION_HIGH + 4),
NextAction("consecration", ACTION_HIGH + 3)
}
)
);
triggers.push_back(
new TriggerNode(
"enemy out of melee",
{
NextAction("reach melee", ACTION_HIGH + 1)
}
)
);
}

View File

@@ -0,0 +1,24 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_DPSPALADINSTRATEGY_H
#define _PLAYERBOT_DPSPALADINSTRATEGY_H
#include "GenericPaladinStrategy.h"
class PlayerbotAI;
class DpsPaladinStrategy : public GenericPaladinStrategy
{
public:
DpsPaladinStrategy(PlayerbotAI* botAI);
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "dps"; }
std::vector<NextAction> getDefaultActions() override;
uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_DPS | STRATEGY_TYPE_MELEE; }
};
#endif

View File

@@ -0,0 +1,32 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#include "GenericPaladinNonCombatStrategy.h"
#include "GenericPaladinStrategyActionNodeFactory.h"
#include "Playerbots.h"
#include "AiFactory.h"
GenericPaladinNonCombatStrategy::GenericPaladinNonCombatStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI)
{
actionNodeFactories.Add(new GenericPaladinStrategyActionNodeFactory());
}
void GenericPaladinNonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
NonCombatStrategy::InitTriggers(triggers);
triggers.push_back(new TriggerNode("party member dead", { NextAction("redemption", ACTION_CRITICAL_HEAL + 10) }));
triggers.push_back(new TriggerNode("party member almost full health", { NextAction("flash of light on party", 25.0f) }));
triggers.push_back(new TriggerNode("party member medium health", { NextAction("flash of light on party", 26.0f) }));
triggers.push_back(new TriggerNode("party member low health", { NextAction("holy light on party", 27.0f) }));
triggers.push_back(new TriggerNode("party member critical health", { NextAction("holy light on party", 28.0f) }));
int specTab = AiFactory::GetPlayerSpecTab(botAI->GetBot());
if (specTab == 0 || specTab == 1) // Holy or Protection
triggers.push_back(new TriggerNode("often", { NextAction("apply oil", 1.0f) }));
if (specTab == 2) // Retribution
triggers.push_back(new TriggerNode("often", { NextAction("apply stone", 1.0f) }));
}

View File

@@ -0,0 +1,22 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_GENERICPALADINNONCOMBATSTRATEGY_H
#define _PLAYERBOT_GENERICPALADINNONCOMBATSTRATEGY_H
#include "NonCombatStrategy.h"
class PlayerbotAI;
class GenericPaladinNonCombatStrategy : public NonCombatStrategy
{
public:
GenericPaladinNonCombatStrategy(PlayerbotAI* botAI);
std::string const getName() override { return "nc"; }
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
};
#endif

View File

@@ -0,0 +1,87 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#include "GenericPaladinStrategy.h"
#include "GenericPaladinStrategyActionNodeFactory.h"
#include "Playerbots.h"
GenericPaladinStrategy::GenericPaladinStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI)
{
actionNodeFactories.Add(new GenericPaladinStrategyActionNodeFactory());
}
void GenericPaladinStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
CombatStrategy::InitTriggers(triggers);
triggers.push_back(new TriggerNode("critical health", { NextAction("divine shield",
ACTION_HIGH + 5) }));
triggers.push_back(
new TriggerNode("hammer of justice interrupt",
{ NextAction("hammer of justice", ACTION_INTERRUPT) }));
triggers.push_back(new TriggerNode(
"hammer of justice on enemy healer",
{ NextAction("hammer of justice on enemy healer", ACTION_INTERRUPT) }));
triggers.push_back(new TriggerNode(
"hammer of justice on snare target",
{ NextAction("hammer of justice on snare target", ACTION_INTERRUPT) }));
triggers.push_back(new TriggerNode(
"critical health", { NextAction("lay on hands", ACTION_EMERGENCY) }));
triggers.push_back(
new TriggerNode("party member critical health",
{ NextAction("lay on hands on party", ACTION_EMERGENCY + 1) }));
triggers.push_back(new TriggerNode(
"protect party member",
{ NextAction("blessing of protection on party", ACTION_EMERGENCY + 2) }));
triggers.push_back(
new TriggerNode("high mana", { NextAction("divine plea", ACTION_HIGH) }));
}
void PaladinCureStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode(
"cleanse cure disease", { NextAction("cleanse disease", ACTION_DISPEL + 2) }));
triggers.push_back(
new TriggerNode("cleanse party member cure disease",
{ NextAction("cleanse disease on party", ACTION_DISPEL + 1) }));
triggers.push_back(new TriggerNode(
"cleanse cure poison", { NextAction("cleanse poison", ACTION_DISPEL + 2) }));
triggers.push_back(
new TriggerNode("cleanse party member cure poison",
{ NextAction("cleanse poison on party", ACTION_DISPEL + 1) }));
triggers.push_back(new TriggerNode(
"cleanse cure magic", { NextAction("cleanse magic", ACTION_DISPEL + 2) }));
triggers.push_back(
new TriggerNode("cleanse party member cure magic",
{ NextAction("cleanse magic on party", ACTION_DISPEL + 1) }));
}
void PaladinBoostStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
// triggers.push_back(new TriggerNode("divine favor", { NextAction("divine favor",
// ACTION_HIGH + 1) }));
}
void PaladinCcStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(
new TriggerNode("turn undead", { NextAction("turn undead", ACTION_HIGH + 1) }));
}
void PaladinHealerDpsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(
new TriggerNode("healer should attack",
{
NextAction("hammer of wrath", ACTION_DEFAULT + 0.6f),
NextAction("holy shock", ACTION_DEFAULT + 0.5f),
NextAction("shield of righteousness", ACTION_DEFAULT + 0.4f),
NextAction("judgement of light", ACTION_DEFAULT + 0.3f),
NextAction("consecration", ACTION_DEFAULT + 0.2f),
NextAction("exorcism", ACTION_DEFAULT+ 0.1f),
}));
}

View File

@@ -0,0 +1,58 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_GENERICPALADINSTRATEGY_H
#define _PLAYERBOT_GENERICPALADINSTRATEGY_H
#include "CombatStrategy.h"
class PlayerbotAI;
class GenericPaladinStrategy : public CombatStrategy
{
public:
GenericPaladinStrategy(PlayerbotAI* botAI);
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "paladin"; }
};
class PaladinCureStrategy : public Strategy
{
public:
PaladinCureStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "cure"; }
};
class PaladinBoostStrategy : public Strategy
{
public:
PaladinBoostStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "boost"; }
};
class PaladinCcStrategy : public Strategy
{
public:
PaladinCcStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "cc"; }
};
class PaladinHealerDpsStrategy : public Strategy
{
public:
PaladinHealerDpsStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "healer dps"; }
};
#endif

View File

@@ -0,0 +1,258 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_GENERICPALADINSTRATEGYACTIONNODEFACTORY_H
#define _PLAYERBOT_GENERICPALADINSTRATEGYACTIONNODEFACTORY_H
#include "Action.h"
#include "NamedObjectContext.h"
class PlayerbotAI;
class GenericPaladinStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
{
public:
GenericPaladinStrategyActionNodeFactory()
{
// creators["seal of light"] = &seal_of_light;
creators["cleanse poison"] = &cleanse_poison;
creators["cleanse disease"] = &cleanse_disease;
creators["cleanse magic"] = &cleanse_magic;
creators["cleanse poison on party"] = &cleanse_poison_on_party;
creators["cleanse disease on party"] = &cleanse_disease_on_party;
creators["seal of wisdom"] = &seal_of_wisdom;
creators["seal of justice"] = &seal_of_justice;
creators["hand of reckoning"] = &hand_of_reckoning;
creators["judgement"] = &judgement;
creators["judgement of wisdom"] = &judgement_of_wisdom;
creators["divine shield"] = &divine_shield;
creators["flash of light"] = &flash_of_light;
creators["flash of light on party"] = &flash_of_light_on_party;
creators["holy wrath"] = &holy_wrath;
creators["lay on hands"] = &lay_on_hands;
creators["lay on hands on party"] = &lay_on_hands_on_party;
creators["hammer of wrath"] = &hammer_of_wrath;
creators["retribution aura"] = &retribution_aura;
creators["blessing of kings"] = &blessing_of_kings;
creators["blessing of wisdom"] = &blessing_of_wisdom;
creators["blessing of kings on party"] = &blessing_of_kings_on_party;
creators["blessing of wisdom on party"] = &blessing_of_wisdom_on_party;
creators["blessing of sanctuary on party"] = &blessing_of_sanctuary_on_party;
creators["blessing of sanctuary"] = &blessing_of_sanctuary;
creators["seal of command"] = &seal_of_command;
creators["taunt spell"] = &hand_of_reckoning;
creators["righteous defense"] = &righteous_defense;
creators["avenger's shield"] = &avengers_shield;
creators["divine sacrifice"] = &divine_sacrifice;
}
private:
static ActionNode* blessing_of_sanctuary(PlayerbotAI* /* ai */)
{
return new ActionNode("blessing of sanctuary",
/*P*/ {},
/*A*/ {},
/*C*/ {});
}
static ActionNode* blessing_of_kings(PlayerbotAI* /* ai */)
{
return new ActionNode("blessing of kings",
/*P*/ {},
/*A*/ {},
/*C*/ {});
}
static ActionNode* blessing_of_wisdom(PlayerbotAI* /* ai */)
{
return new ActionNode("blessing of wisdom",
/*P*/ {},
/*A*/ {},
/*C*/ {});
}
static ActionNode* blessing_of_kings_on_party(PlayerbotAI* /* ai */)
{
return new ActionNode("blessing of kings on party",
/*P*/ {},
/*A*/ {},
/*C*/ {});
}
static ActionNode* blessing_of_wisdom_on_party(PlayerbotAI* /* ai */)
{
return new ActionNode("blessing of wisdom on party",
/*P*/ {},
/*A*/ {},
/*C*/ {});
}
static ActionNode* blessing_of_sanctuary_on_party(PlayerbotAI* /* ai */)
{
return new ActionNode("blessing of sanctuary on party",
/*P*/ {},
/*A*/ {},
/*C*/ {});
}
static ActionNode* retribution_aura(PlayerbotAI* /* ai */)
{
return new ActionNode("retribution aura",
/*P*/ {},
/*A*/ { NextAction("devotion aura") },
/*C*/ {});
}
static ActionNode* lay_on_hands(PlayerbotAI* /* ai */)
{
return new ActionNode("lay on hands",
/*P*/ {},
/*A*/ {}, // { NextAction("divine shield"), new
// NextAction("flash of light"), NULL),
/*C*/ {});
}
static ActionNode* lay_on_hands_on_party(PlayerbotAI* /* ai */)
{
return new ActionNode("lay on hands on party",
/*P*/ {},
/*A*/ {}, // { NextAction("flash of light"), NULL),
/*C*/ {});
}
// static ActionNode* seal_of_light(PlayerbotAI* /* ai */)
// {
// return new ActionNode ("seal of light",
// /*P*/ NULL,
// /*A*/ { NextAction("seal of justice"), NULL),
// /*C*/ NULL);
// }
static ActionNode* cleanse_poison(PlayerbotAI* /* ai */)
{
return new ActionNode("cleanse poison",
/*P*/ {},
/*A*/ { NextAction("purify poison") },
/*C*/ {});
}
static ActionNode* cleanse_magic(PlayerbotAI* /* ai */)
{
return new ActionNode("cleanse magic",
/*P*/ {},
/*A*/ {},
/*C*/ {});
}
static ActionNode* cleanse_disease(PlayerbotAI* /* ai */)
{
return new ActionNode("cleanse disease",
/*P*/ {},
/*A*/ { NextAction("purify disease") },
/*C*/ {});
}
static ActionNode* cleanse_poison_on_party(PlayerbotAI* /* ai */)
{
return new ActionNode("cleanse poison on party",
/*P*/ {},
/*A*/ { NextAction("purify poison on party") },
/*C*/ {});
}
static ActionNode* cleanse_disease_on_party(PlayerbotAI* /* ai */)
{
return new ActionNode("cleanse disease on party",
/*P*/ {},
/*A*/ { NextAction("purify disease on party") },
/*C*/ {});
}
static ActionNode* seal_of_wisdom(PlayerbotAI* /* ai */)
{
return new ActionNode ("seal of wisdom",
/*P*/ {},
/*A*/ { NextAction("seal of righteousness") },
/*C*/ {});
}
static ActionNode* seal_of_justice(PlayerbotAI* /* ai */)
{
return new ActionNode("seal of justice",
/*P*/ {},
/*A*/ { NextAction("seal of righteousness") },
/*C*/ {});
}
static ActionNode* hand_of_reckoning(PlayerbotAI* /* ai */)
{
return new ActionNode("hand of reckoning",
/*P*/ {},
/*A*/ { NextAction("righteous defense") },
/*C*/ {});
}
static ActionNode* righteous_defense(PlayerbotAI* /* ai */)
{
return new ActionNode("righteous defense",
/*P*/ {},
/*A*/ { NextAction("avenger's shield") },
/*C*/ {});
}
static ActionNode* avengers_shield(PlayerbotAI* /* ai */)
{
return new ActionNode("avenger's shield",
/*P*/ {},
/*A*/ { NextAction("judgement of wisdom") },
/*C*/ {});
}
static ActionNode* divine_sacrifice(PlayerbotAI* /* ai */)
{
return new ActionNode("divine sacrifice",
/*P*/ {},
/*A*/ {},
/*C*/ { NextAction("cancel divine sacrifice") });
}
static ActionNode* judgement_of_wisdom(PlayerbotAI* /* ai */)
{
return new ActionNode("judgement of wisdom",
/*P*/ {},
/*A*/ { NextAction("judgement of light") },
/*C*/ {});
}
static ActionNode* judgement(PlayerbotAI* /* ai */)
{
return new ActionNode("judgement",
/*P*/ {},
/*A*/ {},
/*C*/ {});
}
static ActionNode* divine_shield(PlayerbotAI* /* ai */)
{
return new ActionNode("divine shield",
/*P*/ {},
/*A*/ { NextAction("divine protection") },
/*C*/ {});
}
static ActionNode* flash_of_light(PlayerbotAI* /* ai */)
{
return new ActionNode("flash of light",
/*P*/ {},
/*A*/ { NextAction("holy light") },
/*C*/ {});
}
static ActionNode* flash_of_light_on_party(PlayerbotAI* /* ai */)
{
return new ActionNode("flash of light on party",
/*P*/ {},
/*A*/ { NextAction("holy light on party") },
/*C*/ {});
}
static ActionNode* holy_wrath(PlayerbotAI* /* ai */)
{
return new ActionNode("holy wrath",
/*P*/ {},
/*A*/ {},
/*C*/ {});
}
static ActionNode* hammer_of_wrath(PlayerbotAI* /* ai */)
{
return new ActionNode("hammer of wrath",
/*P*/ {},
/*A*/ {},
/*C*/ {});
}
static ActionNode* seal_of_command(PlayerbotAI* /* ai */)
{
return new ActionNode("seal of command",
/*P*/ {},
/*A*/ { NextAction("seal of righteousness") },
/*C*/ {});
}
};
#endif

View File

@@ -0,0 +1,124 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#include "HealPaladinStrategy.h"
#include "Playerbots.h"
#include "Strategy.h"
class HealPaladinStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
{
};
HealPaladinStrategy::HealPaladinStrategy(PlayerbotAI* botAI) : GenericPaladinStrategy(botAI)
{
actionNodeFactories.Add(new HealPaladinStrategyActionNodeFactory());
}
std::vector<NextAction> HealPaladinStrategy::getDefaultActions()
{
return { NextAction("judgement of light", ACTION_DEFAULT) };
}
void HealPaladinStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
GenericPaladinStrategy::InitTriggers(triggers);
triggers.push_back(
new TriggerNode(
"seal",
{
NextAction("seal of wisdom", ACTION_HIGH)
}
)
);
triggers.push_back(
new TriggerNode(
"medium mana",
{
NextAction("divine illumination", ACTION_HIGH + 2)
}
)
);
triggers.push_back(
new TriggerNode(
"low mana",
{
NextAction("divine favor", ACTION_HIGH + 1)
}
)
);
triggers.push_back(
new TriggerNode(
"party member to heal out of spell range",
{
NextAction("reach party member to heal", ACTION_EMERGENCY + 3)
}
)
);
triggers.push_back(
new TriggerNode(
"medium group heal setting",
{
NextAction("divine sacrifice", ACTION_CRITICAL_HEAL + 5),
NextAction("avenging wrath", ACTION_HIGH + 4),
}
)
);
triggers.push_back(
new TriggerNode(
"party member critical health",
{
NextAction("holy shock on party", ACTION_CRITICAL_HEAL + 6),
NextAction("divine sacrifice", ACTION_CRITICAL_HEAL + 5),
NextAction("holy light on party", ACTION_CRITICAL_HEAL + 4)
}
)
);
triggers.push_back(
new TriggerNode(
"party member low health",
{
NextAction("holy light on party", ACTION_MEDIUM_HEAL + 5)
}
)
);
triggers.push_back(
new TriggerNode(
"party member medium health",
{
NextAction("holy light on party", ACTION_LIGHT_HEAL + 9),
NextAction("flash of light on party", ACTION_LIGHT_HEAL + 8)
}
)
);
triggers.push_back(
new TriggerNode(
"party member almost full health",
{
NextAction("flash of light on party", ACTION_LIGHT_HEAL + 3)
}
)
);
triggers.push_back(
new TriggerNode(
"beacon of light on main tank",
{
NextAction("beacon of light on main tank", ACTION_CRITICAL_HEAL + 7)
}
)
);
triggers.push_back(
new TriggerNode(
"sacred shield on main tank",
{
NextAction("sacred shield on main tank", ACTION_CRITICAL_HEAL + 6)
}
)
);
}

View File

@@ -0,0 +1,24 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_HEALPALADINSTRATEGY_H
#define _PLAYERBOT_HEALPALADINSTRATEGY_H
#include "GenericPaladinStrategy.h"
class PlayerbotAI;
class HealPaladinStrategy : public GenericPaladinStrategy
{
public:
HealPaladinStrategy(PlayerbotAI* botAI);
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "heal"; }
std::vector<NextAction> getDefaultActions() override;
uint32 GetType() const override { return STRATEGY_TYPE_HEAL | STRATEGY_TYPE_RANGED; }
};
#endif

View File

@@ -0,0 +1,243 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#include "OffhealRetPaladinStrategy.h"
#include "Playerbots.h"
#include "Strategy.h"
class OffhealRetPaladinStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
{
public:
OffhealRetPaladinStrategyActionNodeFactory()
{
creators["retribution aura"] = &retribution_aura;
creators["seal of corruption"] = &seal_of_corruption;
creators["seal of vengeance"] = &seal_of_vengeance;
creators["seal of command"] = &seal_of_command;
creators["blessing of might"] = &blessing_of_might;
creators["crusader strike"] = &crusader_strike;
creators["divine plea"] = &divine_plea;
}
private:
static ActionNode* retribution_aura([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"retribution aura",
/*P*/ {},
/*A*/ { NextAction("devotion aura") },
/*C*/ {}
);
}
static ActionNode* seal_of_corruption([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"seal of corruption",
/*P*/ {},
/*A*/ { NextAction("seal of vengeance") },
/*C*/ {}
);
}
static ActionNode* seal_of_vengeance([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"seal of vengeance",
/*P*/ {},
/*A*/ { NextAction("seal of command") },
/*C*/ {}
);
}
static ActionNode* seal_of_command([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"seal of command",
/*P*/ {},
/*A*/ { NextAction("seal of righteousness") },
/*C*/ {}
);
}
static ActionNode* blessing_of_might([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"blessing of might",
/*P*/ {},
/*A*/ { NextAction("blessing of kings") },
/*C*/ {}
);
}
static ActionNode* crusader_strike([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"crusader strike",
/*P*/ {},
/*A*/ {},
/*C*/ {}
);
}
static ActionNode* divine_plea([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"divine plea",
/*P*/ {},
/*A*/ {},
/*C*/ {}
);
}
};
OffhealRetPaladinStrategy::OffhealRetPaladinStrategy(PlayerbotAI* botAI) : GenericPaladinStrategy(botAI)
{
actionNodeFactories.Add(new OffhealRetPaladinStrategyActionNodeFactory());
}
std::vector<NextAction> OffhealRetPaladinStrategy::getDefaultActions()
{
return {
NextAction("hammer of wrath", ACTION_DEFAULT + 0.6f),
NextAction("judgement of wisdom", ACTION_DEFAULT + 0.5f),
NextAction("crusader strike", ACTION_DEFAULT + 0.4f),
NextAction("divine storm", ACTION_DEFAULT + 0.3f),
NextAction("melee", ACTION_DEFAULT)
};
}
void OffhealRetPaladinStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
GenericPaladinStrategy::InitTriggers(triggers);
// Damage Triggers
triggers.push_back(
new TriggerNode(
"seal",
{
NextAction("seal of corruption", ACTION_HIGH)
}
)
);
triggers.push_back(
new TriggerNode(
"low mana",
{
NextAction("seal of wisdom", ACTION_HIGH + 5),
NextAction("divine plea", ACTION_HIGH + 4)
}
)
);
triggers.push_back(
new TriggerNode(
"art of war",
{
NextAction("exorcism", ACTION_HIGH + 1)
}
)
);
triggers.push_back(
new TriggerNode(
"avenging wrath",
{
NextAction("avenging wrath", ACTION_HIGH + 2)
}
)
);
triggers.push_back(
new TriggerNode(
"medium aoe",
{
NextAction("divine storm", ACTION_HIGH + 4),
NextAction("consecration", ACTION_HIGH + 3)
}
)
);
triggers.push_back(
new TriggerNode(
"enemy out of melee",
{
NextAction("reach melee", ACTION_HIGH + 1)
}
)
);
triggers.push_back(
new TriggerNode(
"retribution aura",
{
NextAction("retribution aura", ACTION_NORMAL)
}
)
);
triggers.push_back(
new TriggerNode(
"blessing of might",
{
NextAction("blessing of might", ACTION_NORMAL + 1)
}
)
);
triggers.push_back(
new TriggerNode(
"low health",
{
NextAction("holy light", ACTION_CRITICAL_HEAL + 2)
}
)
);
// Healing Triggers
triggers.push_back(
new TriggerNode(
"party member critical health",
{
NextAction("holy shock on party", ACTION_CRITICAL_HEAL + 6),
NextAction("holy light on party", ACTION_CRITICAL_HEAL + 4)
}
)
);
triggers.push_back(
new TriggerNode(
"party member low health",
{
NextAction("holy light on party", ACTION_MEDIUM_HEAL + 5)
}
)
);
triggers.push_back(
new TriggerNode(
"party member medium health",
{
NextAction("flash of light on party", ACTION_LIGHT_HEAL + 8)
}
)
);
triggers.push_back(
new TriggerNode(
"party member almost full health",
{
NextAction("flash of light on party", ACTION_LIGHT_HEAL + 3)
}
)
);
triggers.push_back(
new TriggerNode(
"party member to heal out of spell range",
{
NextAction("reach party member to heal", ACTION_EMERGENCY + 3)
}
)
);
triggers.push_back(
new TriggerNode(
"beacon of light on main tank",
{
NextAction("beacon of light on main tank", ACTION_CRITICAL_HEAL + 7)
}
)
);
}

View File

@@ -0,0 +1,27 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_OFFHEALRETPALADINSTRATEGY_H
#define _PLAYERBOT_OFFHEALRETPALADINSTRATEGY_H
#include "GenericPaladinStrategy.h"
class PlayerbotAI;
class OffhealRetPaladinStrategy : public GenericPaladinStrategy
{
public:
OffhealRetPaladinStrategy(PlayerbotAI* botAI);
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "offheal"; }
std::vector<NextAction> getDefaultActions() override;
uint32 GetType() const override
{
return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_DPS | STRATEGY_TYPE_HEAL | STRATEGY_TYPE_MELEE;
}
};
#endif

View File

@@ -0,0 +1,94 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#include "PaladinBuffStrategies.h"
#include "Playerbots.h"
void PaladinBuffManaStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode("blessing of wisdom on party",
{ NextAction("blessing of wisdom on party", 11.0f) }));
triggers.push_back(new TriggerNode("blessing of kings on party",
{ NextAction("blessing of kings on party", 10.5f) }));
}
void PaladinBuffHealthStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(
new TriggerNode("blessing of sanctuary on party",
{ NextAction("blessing of sanctuary on party", 11.0f) }));
}
void PaladinBuffDpsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(
new TriggerNode("blessing of might on party",
{ NextAction("blessing of might on party", 11.0f) }));
}
void PaladinShadowResistanceStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(
new TriggerNode("shadow resistance aura",
{ NextAction("shadow resistance aura", ACTION_NORMAL) }));
}
void PaladinFrostResistanceStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(
new TriggerNode("frost resistance aura",
{ NextAction("frost resistance aura", ACTION_NORMAL) }));
}
void PaladinFireResistanceStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode(
"fire resistance aura", { NextAction("fire resistance aura", ACTION_NORMAL) }));
}
void PaladinBuffArmorStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode("devotion aura",
{ NextAction("devotion aura", ACTION_NORMAL) }));
}
void PaladinBuffAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode(
"retribution aura", { NextAction("retribution aura", ACTION_NORMAL) }));
}
void PaladinBuffCastStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode(
"concentration aura", { NextAction("concentration aura", ACTION_NORMAL) }));
}
void PaladinBuffSpeedStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode(
"crusader aura", { NextAction("crusader aura", ACTION_NORMAL) }));
}
void PaladinBuffThreatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode(
"righteous fury", { NextAction("righteous fury", ACTION_HIGH + 8) }));
}
void PaladinBuffStatsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
// First Sanctuary (prio > Kings)
triggers.push_back(
new TriggerNode("blessing of sanctuary on party",
{ NextAction("blessing of sanctuary on party", 12.0f) }));
// After Kings
triggers.push_back(
new TriggerNode("blessing of kings on party",
{ NextAction("blessing of kings on party", 11.0f) }));
}

View File

@@ -0,0 +1,121 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_PALADINBUFFSTRATEGIES_H
#define _PLAYERBOT_PALADINBUFFSTRATEGIES_H
#include "Strategy.h"
class PlayerbotAI;
class PaladinBuffManaStrategy : public Strategy
{
public:
PaladinBuffManaStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "bmana"; }
};
class PaladinBuffHealthStrategy : public Strategy
{
public:
PaladinBuffHealthStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "bhealth"; }
};
class PaladinBuffDpsStrategy : public Strategy
{
public:
PaladinBuffDpsStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "bdps"; }
};
class PaladinBuffArmorStrategy : public Strategy
{
public:
PaladinBuffArmorStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "barmor"; }
};
class PaladinBuffAoeStrategy : public Strategy
{
public:
PaladinBuffAoeStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "baoe"; }
};
class PaladinBuffCastStrategy : public Strategy
{
public:
PaladinBuffCastStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "bcast"; }
};
class PaladinBuffSpeedStrategy : public Strategy
{
public:
PaladinBuffSpeedStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "bspeed"; }
};
class PaladinBuffThreatStrategy : public Strategy
{
public:
PaladinBuffThreatStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "bthreat"; }
};
class PaladinBuffStatsStrategy : public Strategy
{
public:
PaladinBuffStatsStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "bstats"; }
};
class PaladinShadowResistanceStrategy : public Strategy
{
public:
PaladinShadowResistanceStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "rshadow"; }
};
class PaladinFrostResistanceStrategy : public Strategy
{
public:
PaladinFrostResistanceStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "rfrost"; }
};
class PaladinFireResistanceStrategy : public Strategy
{
public:
PaladinFireResistanceStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "rfire"; }
};
#endif

View File

@@ -0,0 +1,201 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#include "TankPaladinStrategy.h"
#include "Playerbots.h"
class TankPaladinStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
{
public:
TankPaladinStrategyActionNodeFactory()
{
creators["seal of corruption"] = &seal_of_corruption;
creators["seal of vengeance"] = &seal_of_vengeance;
creators["seal of command"] = &seal_of_command;
creators["hand of reckoning"] = &hand_of_reckoning;
creators["taunt spell"] = &hand_of_reckoning;
}
private:
static ActionNode* seal_of_command([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"seal of command",
/*P*/ {},
/*A*/ { NextAction("seal of corruption") },
/*C*/ {}
);
}
static ActionNode* seal_of_corruption([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"seal of corruption",
/*P*/ {},
/*A*/ { NextAction("seal of vengeance") },
/*C*/ {}
);
}
static ActionNode* seal_of_vengeance([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"seal of vengeance",
/*P*/ {},
/*A*/ { NextAction("seal of righteousness") },
/*C*/ {}
);
}
static ActionNode* hand_of_reckoning([[maybe_unused]] PlayerbotAI* botAI)
{
return new ActionNode(
"hand of reckoning",
/*P*/ {},
/*A*/ { NextAction("righteous defense") },
/*C*/ {}
);
}
};
TankPaladinStrategy::TankPaladinStrategy(PlayerbotAI* botAI) : GenericPaladinStrategy(botAI)
{
actionNodeFactories.Add(new TankPaladinStrategyActionNodeFactory());
}
std::vector<NextAction> TankPaladinStrategy::getDefaultActions()
{
return {
NextAction("shield of righteousness", ACTION_DEFAULT + 0.6f),
NextAction("hammer of the righteous", ACTION_DEFAULT + 0.5f),
NextAction("judgement of wisdom", ACTION_DEFAULT + 0.4f),
NextAction("melee", ACTION_DEFAULT)
};
}
void TankPaladinStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
GenericPaladinStrategy::InitTriggers(triggers);
triggers.push_back(
new TriggerNode(
"seal",
{
NextAction("seal of corruption", ACTION_HIGH)
}
)
);
triggers.push_back(
new TriggerNode(
"low mana",
{
NextAction("seal of wisdom", ACTION_HIGH + 9)
}
)
);
triggers.push_back(new TriggerNode(
"light aoe",
{
NextAction("avenger's shield", ACTION_HIGH + 5)
}
)
);
triggers.push_back(
new TriggerNode(
"medium aoe",
{
NextAction("consecration", ACTION_HIGH + 7),
NextAction("avenger's shield", ACTION_HIGH + 6)
}
)
);
triggers.push_back(
new TriggerNode(
"lose aggro",
{
NextAction("hand of reckoning", ACTION_HIGH + 7)
}
)
);
triggers.push_back(
new TriggerNode(
"medium health",
{ NextAction("holy shield", ACTION_HIGH + 4)
}
)
);
triggers.push_back(
new TriggerNode(
"low health",
{
NextAction("holy shield", ACTION_HIGH + 4)
}
)
);
triggers.push_back(
new TriggerNode(
"critical health",
{
NextAction("holy shield", ACTION_HIGH + 4)
}
)
);
triggers.push_back(
new TriggerNode(
"avenging wrath",
{
NextAction("avenging wrath", ACTION_HIGH + 2)
}
)
);
triggers.push_back(
new TriggerNode(
"target critical health",
{
NextAction("hammer of wrath", ACTION_CRITICAL_HEAL)
}
)
);
triggers.push_back(
new TriggerNode(
"righteous fury",
{
NextAction("righteous fury", ACTION_HIGH + 8)
}
)
);
triggers.push_back(
new TriggerNode(
"medium group heal setting",
{
NextAction("divine sacrifice", ACTION_HIGH + 5)
}
)
);
triggers.push_back(
new TriggerNode(
"enough mana",
{
NextAction("consecration", ACTION_HIGH + 4)
}
)
);
triggers.push_back(
new TriggerNode(
"not facing target",
{
NextAction("set facing", ACTION_NORMAL + 7)
}
)
);
triggers.push_back(
new TriggerNode(
"enemy out of melee",
{
NextAction("reach melee", ACTION_HIGH + 1)
}
)
);
}

View File

@@ -0,0 +1,24 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_TANKPALADINSTRATEGY_H
#define _PLAYERBOT_TANKPALADINSTRATEGY_H
#include "GenericPaladinStrategy.h"
class PlayerbotAI;
class TankPaladinStrategy : public GenericPaladinStrategy
{
public:
TankPaladinStrategy(PlayerbotAI* botAI);
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "tank"; }
std::vector<NextAction> getDefaultActions() override;
uint32 GetType() const override { return STRATEGY_TYPE_TANK | STRATEGY_TYPE_MELEE; }
};
#endif

View File

@@ -0,0 +1,32 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#include "PaladinTriggers.h"
#include "PaladinActions.h"
#include "PlayerbotAIConfig.h"
#include "Playerbots.h"
bool SealTrigger::IsActive()
{
Unit* target = GetTarget();
return !botAI->HasAura("seal of justice", target) && !botAI->HasAura("seal of command", target) &&
!botAI->HasAura("seal of vengeance", target) && !botAI->HasAura("seal of corruption", target) &&
!botAI->HasAura("seal of righteousness", target) && !botAI->HasAura("seal of light", target) &&
(!botAI->HasAura("seal of wisdom", target) || AI_VALUE2(uint8, "mana", "self target") > 70);
}
bool CrusaderAuraTrigger::IsActive()
{
Unit* target = GetTarget();
return AI_VALUE2(bool, "mounted", "self target") && !botAI->HasAura("crusader aura", target);
}
bool BlessingTrigger::IsActive()
{
Unit* target = GetTarget();
return SpellTrigger::IsActive() && !botAI->HasAnyAuraOf(target, "blessing of might", "blessing of wisdom",
"blessing of kings", "blessing of sanctuary", nullptr);
}

View File

@@ -0,0 +1,251 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_PALADINTRIGGERS_H
#define _PLAYERBOT_PALADINTRIGGERS_H
#include "CureTriggers.h"
#include "GenericTriggers.h"
#include "SharedDefines.h"
#include "Unit.h"
class PlayerbotAI;
inline std::string const GetActualBlessingOfMight(Unit* target)
{
switch (target->getClass())
{
case CLASS_MAGE:
case CLASS_PRIEST:
case CLASS_WARLOCK:
return "blessing of wisdom";
}
return "blessing of might";
}
inline std::string const GetActualBlessingOfWisdom(Unit* target)
{
switch (target->getClass())
{
case CLASS_WARRIOR:
case CLASS_ROGUE:
case CLASS_DEATH_KNIGHT:
return "blessing of might";
}
return "blessing of wisdom";
}
BUFF_TRIGGER(HolyShieldTrigger, "holy shield");
BUFF_TRIGGER(RighteousFuryTrigger, "righteous fury");
BUFF_TRIGGER(RetributionAuraTrigger, "retribution aura");
BUFF_TRIGGER(SanctityAuraTrigger, "sanctity aura");
class CrusaderAuraTrigger : public BuffTrigger
{
public:
CrusaderAuraTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "crusader aura") {}
bool IsActive() override;
};
class SealTrigger : public BuffTrigger
{
public:
SealTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "seal") {}
bool IsActive() override;
};
// judgements
DEBUFF_TRIGGER(JudgementTrigger, "judgement");
DEBUFF_TRIGGER(JudgementOfLightTrigger, "judgement of light");
DEBUFF_TRIGGER(JudgementOfWisdomTrigger, "judgement of wisdom");
DEBUFF_TRIGGER(ConsecrationTrigger, "consecration");
// repentance triggers
INTERRUPT_HEALER_TRIGGER(RepentanceOnHealerTrigger, "repentance on enemy healer");
SNARE_TRIGGER(RepentanceSnareTrigger, "repentance on snare target");
INTERRUPT_TRIGGER(RepentanceInterruptTrigger, "repentance");
class BlessingOnPartyTrigger : public BuffOnPartyTrigger
{
public:
BlessingOnPartyTrigger(PlayerbotAI* botAI)
: BuffOnPartyTrigger(botAI, "blessing of kings,blessing of might,blessing of wisdom", 2 * 2000)
{
}
};
class BlessingTrigger : public BuffTrigger
{
public:
BlessingTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "blessing of sanctuary", 2 * 2000) {}
bool IsActive() override;
};
class HammerOfJusticeInterruptSpellTrigger : public InterruptSpellTrigger
{
public:
HammerOfJusticeInterruptSpellTrigger(PlayerbotAI* botAI) : InterruptSpellTrigger(botAI, "hammer of justice") {}
};
class HammerOfJusticeSnareTrigger : public SnareTargetTrigger
{
public:
HammerOfJusticeSnareTrigger(PlayerbotAI* botAI) : SnareTargetTrigger(botAI, "hammer of justice") {}
};
class ArtOfWarTrigger : public HasAuraTrigger
{
public:
ArtOfWarTrigger(PlayerbotAI* botAI) : HasAuraTrigger(botAI, "the art of war") {}
};
class ShadowResistanceAuraTrigger : public BuffTrigger
{
public:
ShadowResistanceAuraTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "shadow resistance aura") {}
};
class FrostResistanceAuraTrigger : public BuffTrigger
{
public:
FrostResistanceAuraTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "frost resistance aura") {}
};
class FireResistanceAuraTrigger : public BuffTrigger
{
public:
FireResistanceAuraTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "fire resistance aura") {}
};
class DevotionAuraTrigger : public BuffTrigger
{
public:
DevotionAuraTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "devotion aura") {}
};
BUFF_TRIGGER(ConcentrationAuraTrigger, "concentration aura");
class CleanseCureDiseaseTrigger : public NeedCureTrigger
{
public:
CleanseCureDiseaseTrigger(PlayerbotAI* botAI) : NeedCureTrigger(botAI, "cleanse", DISPEL_DISEASE) {}
};
class CleanseCurePartyMemberDiseaseTrigger : public PartyMemberNeedCureTrigger
{
public:
CleanseCurePartyMemberDiseaseTrigger(PlayerbotAI* botAI)
: PartyMemberNeedCureTrigger(botAI, "cleanse", DISPEL_DISEASE)
{
}
};
class CleanseCurePoisonTrigger : public NeedCureTrigger
{
public:
CleanseCurePoisonTrigger(PlayerbotAI* botAI) : NeedCureTrigger(botAI, "cleanse", DISPEL_POISON) {}
};
class CleanseCurePartyMemberPoisonTrigger : public PartyMemberNeedCureTrigger
{
public:
CleanseCurePartyMemberPoisonTrigger(PlayerbotAI* botAI)
: PartyMemberNeedCureTrigger(botAI, "cleanse", DISPEL_POISON)
{
}
};
class CleanseCureMagicTrigger : public NeedCureTrigger
{
public:
CleanseCureMagicTrigger(PlayerbotAI* botAI) : NeedCureTrigger(botAI, "cleanse", DISPEL_MAGIC) {}
};
class CleanseCurePartyMemberMagicTrigger : public PartyMemberNeedCureTrigger
{
public:
CleanseCurePartyMemberMagicTrigger(PlayerbotAI* botAI) : PartyMemberNeedCureTrigger(botAI, "cleanse", DISPEL_MAGIC)
{
}
};
class HammerOfJusticeEnemyHealerTrigger : public InterruptEnemyHealerTrigger
{
public:
HammerOfJusticeEnemyHealerTrigger(PlayerbotAI* botAI) : InterruptEnemyHealerTrigger(botAI, "hammer of justice") {}
};
class DivineFavorTrigger : public BuffTrigger
{
public:
DivineFavorTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "divine favor") {}
};
class TurnUndeadTrigger : public HasCcTargetTrigger
{
public:
TurnUndeadTrigger(PlayerbotAI* botAI) : HasCcTargetTrigger(botAI, "turn undead") {}
};
DEBUFF_TRIGGER(AvengerShieldTrigger, "avenger's shield");
class BeaconOfLightOnMainTankTrigger : public BuffOnMainTankTrigger
{
public:
BeaconOfLightOnMainTankTrigger(PlayerbotAI* ai) : BuffOnMainTankTrigger(ai, "beacon of light", true) {}
};
class SacredShieldOnMainTankTrigger : public BuffOnMainTankTrigger
{
public:
SacredShieldOnMainTankTrigger(PlayerbotAI* ai) : BuffOnMainTankTrigger(ai, "sacred shield", false) {}
};
class BlessingOfKingsOnPartyTrigger : public BuffOnPartyTrigger
{
public:
BlessingOfKingsOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "blessing of kings", 2 * 2000) {}
};
class BlessingOfWisdomOnPartyTrigger : public BuffOnPartyTrigger
{
public:
BlessingOfWisdomOnPartyTrigger(PlayerbotAI* botAI)
: BuffOnPartyTrigger(botAI, "blessing of might,blessing of wisdom", 2 * 2000)
{
}
};
class BlessingOfMightOnPartyTrigger : public BuffOnPartyTrigger
{
public:
BlessingOfMightOnPartyTrigger(PlayerbotAI* botAI)
: BuffOnPartyTrigger(botAI, "blessing of might,blessing of wisdom", 2 * 2000)
{
}
};
class BlessingOfSanctuaryOnPartyTrigger : public BuffOnPartyTrigger
{
public:
BlessingOfSanctuaryOnPartyTrigger(PlayerbotAI* botAI)
: BuffOnPartyTrigger(botAI, "blessing of sanctuary", 2 * 2000)
{
}
};
class AvengingWrathTrigger : public BoostTrigger
{
public:
AvengingWrathTrigger(PlayerbotAI* botAI) : BoostTrigger(botAI, "avenging wrath") {}
};
#endif