mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-16 08:36:10 +00:00
[FIX] Finalized structure! (do not start fixing PR merge structure conflict till this is merged) (#2025)
Finalized
This commit is contained in:
50
src/Scenario/ClassAi/DeathKnight/Action/DKActions.cpp
Normal file
50
src/Scenario/ClassAi/DeathKnight/Action/DKActions.cpp
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* 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 "DKActions.h"
|
||||
|
||||
#include "Duration.h"
|
||||
#include "GenericSpellActions.h"
|
||||
#include "Playerbots.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellMgr.h"
|
||||
|
||||
std::vector<NextAction> CastDeathchillAction::getPrerequisites()
|
||||
{
|
||||
return NextAction::merge({ NextAction("frost presence") },
|
||||
CastSpellAction::getPrerequisites());
|
||||
}
|
||||
|
||||
std::vector<NextAction> CastUnholyMeleeSpellAction::getPrerequisites()
|
||||
{
|
||||
return NextAction::merge({ NextAction("unholy presence") },
|
||||
CastMeleeSpellAction::getPrerequisites());
|
||||
}
|
||||
|
||||
std::vector<NextAction> CastFrostMeleeSpellAction::getPrerequisites()
|
||||
{
|
||||
return NextAction::merge({ NextAction("frost presence") },
|
||||
CastMeleeSpellAction::getPrerequisites());
|
||||
}
|
||||
|
||||
std::vector<NextAction> CastBloodMeleeSpellAction::getPrerequisites()
|
||||
{
|
||||
return NextAction::merge({ NextAction("blood presence") },
|
||||
CastMeleeSpellAction::getPrerequisites());
|
||||
}
|
||||
|
||||
bool CastRaiseDeadAction::Execute(Event event)
|
||||
{
|
||||
const bool result = CastBuffSpellAction::Execute(event);
|
||||
|
||||
if (!result)
|
||||
return false;
|
||||
|
||||
const uint32_t spellId = AI_VALUE2(uint32_t, "spell id", spell);
|
||||
|
||||
bot->AddSpellCooldown(spellId, 0, 3 * 60 * 1000);
|
||||
|
||||
return true;
|
||||
}
|
||||
343
src/Scenario/ClassAi/DeathKnight/Action/DKActions.h
Normal file
343
src/Scenario/ClassAi/DeathKnight/Action/DKActions.h
Normal file
@@ -0,0 +1,343 @@
|
||||
/*
|
||||
* 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_DKACTIONS_H
|
||||
#define _PLAYERBOT_DKACTIONS_H
|
||||
|
||||
#include "Event.h"
|
||||
#include "GenericSpellActions.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class CastBloodPresenceAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastBloodPresenceAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "blood presence") {}
|
||||
};
|
||||
|
||||
class CastFrostPresenceAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastFrostPresenceAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "frost presence") {}
|
||||
};
|
||||
|
||||
class CastUnholyPresenceAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastUnholyPresenceAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "unholy presence") {}
|
||||
};
|
||||
|
||||
class CastDeathchillAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastDeathchillAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "deathchill") {}
|
||||
|
||||
std::vector<NextAction> getPrerequisites() override;
|
||||
};
|
||||
|
||||
class CastDarkCommandAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastDarkCommandAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "dark command") {}
|
||||
};
|
||||
|
||||
BEGIN_RANGED_SPELL_ACTION(CastDeathGripAction, "death grip")
|
||||
END_SPELL_ACTION()
|
||||
|
||||
// Unholy presence
|
||||
class CastUnholyMeleeSpellAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastUnholyMeleeSpellAction(PlayerbotAI* botAI, std::string const spell) : CastMeleeSpellAction(botAI, spell) {}
|
||||
|
||||
std::vector<NextAction> getPrerequisites() override;
|
||||
};
|
||||
|
||||
// Frost presence
|
||||
class CastFrostMeleeSpellAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastFrostMeleeSpellAction(PlayerbotAI* botAI, std::string const spell) : CastMeleeSpellAction(botAI, spell) {}
|
||||
|
||||
std::vector<NextAction> getPrerequisites() override;
|
||||
};
|
||||
|
||||
// Blood presence
|
||||
class CastBloodMeleeSpellAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastBloodMeleeSpellAction(PlayerbotAI* botAI, std::string const spell) : CastMeleeSpellAction(botAI, spell) {}
|
||||
|
||||
std::vector<NextAction> getPrerequisites() override;
|
||||
};
|
||||
|
||||
class CastRuneStrikeAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastRuneStrikeAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "rune strike") {}
|
||||
};
|
||||
|
||||
class CastPestilenceAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastPestilenceAction(PlayerbotAI* ai) : CastSpellAction(ai, "pestilence") {}
|
||||
ActionThreatType getThreatType() override { return ActionThreatType::None; }
|
||||
};
|
||||
|
||||
class CastHowlingBlastAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastHowlingBlastAction(PlayerbotAI* ai) : CastSpellAction(ai, "howling blast") {}
|
||||
};
|
||||
|
||||
class CastIcyTouchAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastIcyTouchAction(PlayerbotAI* ai) : CastSpellAction(ai, "icy touch") {}
|
||||
};
|
||||
|
||||
class CastIcyTouchOnAttackerAction : public CastDebuffSpellOnAttackerAction
|
||||
{
|
||||
public:
|
||||
CastIcyTouchOnAttackerAction(PlayerbotAI* botAI)
|
||||
: CastDebuffSpellOnAttackerAction(botAI, "icy touch", true, .0f)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
// debuff ps
|
||||
|
||||
class CastPlagueStrikeAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastPlagueStrikeAction(PlayerbotAI* ai) : CastSpellAction(ai, "plague strike") {}
|
||||
};
|
||||
|
||||
class CastPlagueStrikeOnAttackerAction : public CastDebuffSpellOnMeleeAttackerAction
|
||||
{
|
||||
public:
|
||||
CastPlagueStrikeOnAttackerAction(PlayerbotAI* botAI)
|
||||
: CastDebuffSpellOnMeleeAttackerAction(botAI, "plague strike", true, .0f)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
// debuff
|
||||
BEGIN_DEBUFF_ACTION(CastMarkOfBloodAction, "mark of blood")
|
||||
END_SPELL_ACTION()
|
||||
|
||||
class CastMarkOfBloodOnAttackerAction : public CastDebuffSpellOnAttackerAction
|
||||
{
|
||||
public:
|
||||
CastMarkOfBloodOnAttackerAction(PlayerbotAI* botAI) : CastDebuffSpellOnAttackerAction(botAI, "mark of blood", true)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class CastUnholyBlightAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastUnholyBlightAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "unholy blight") {}
|
||||
};
|
||||
|
||||
class CastSummonGargoyleAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastSummonGargoyleAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "summon gargoyle") {}
|
||||
};
|
||||
|
||||
class CastGhoulFrenzyAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastGhoulFrenzyAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "ghoul frenzy", false, 5000) {}
|
||||
std::string const GetTargetName() override { return "pet target"; }
|
||||
};
|
||||
|
||||
BEGIN_MELEE_SPELL_ACTION(CastCorpseExplosionAction, "corpse explosion")
|
||||
END_SPELL_ACTION()
|
||||
|
||||
BEGIN_MELEE_SPELL_ACTION(CastAntiMagicShellAction, "anti magic shell")
|
||||
END_SPELL_ACTION()
|
||||
|
||||
BEGIN_MELEE_SPELL_ACTION(CastAntiMagicZoneAction, "anti magic zone")
|
||||
END_SPELL_ACTION()
|
||||
|
||||
class CastChainsOfIceAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastChainsOfIceAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "chains of ice") {}
|
||||
};
|
||||
|
||||
class CastHungeringColdAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastHungeringColdAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "hungering cold") {}
|
||||
};
|
||||
|
||||
class CastHeartStrikeAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastHeartStrikeAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "heart strike") {}
|
||||
};
|
||||
|
||||
class CastBloodStrikeAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastBloodStrikeAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "blood strike") {}
|
||||
};
|
||||
|
||||
class CastFrostStrikeAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastFrostStrikeAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "frost strike") {}
|
||||
};
|
||||
|
||||
class CastObliterateAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastObliterateAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "obliterate") {}
|
||||
};
|
||||
|
||||
class CastDeathStrikeAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastDeathStrikeAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "death strike") {}
|
||||
};
|
||||
|
||||
class CastScourgeStrikeAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastScourgeStrikeAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "scourge strike") {}
|
||||
};
|
||||
|
||||
class CastDeathCoilAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastDeathCoilAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "death coil") {}
|
||||
};
|
||||
|
||||
class CastBloodBoilAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastBloodBoilAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "blood boil") {}
|
||||
};
|
||||
|
||||
class CastDeathAndDecayAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastDeathAndDecayAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "death and decay") {}
|
||||
// ActionThreatType getThreatType() override { return ActionThreatType::Aoe; }
|
||||
};
|
||||
|
||||
class CastHornOfWinterAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastHornOfWinterAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "horn of winter") {}
|
||||
};
|
||||
|
||||
class CastImprovedIcyTalonsAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastImprovedIcyTalonsAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "improved icy talons") {}
|
||||
};
|
||||
|
||||
class CastBoneShieldAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastBoneShieldAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "bone shield") {}
|
||||
};
|
||||
|
||||
class CastDeathPactAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastDeathPactAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "death pact") {}
|
||||
};
|
||||
|
||||
class CastDeathRuneMasteryAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastDeathRuneMasteryAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "death rune mastery") {}
|
||||
};
|
||||
|
||||
class CastDancingRuneWeaponAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastDancingRuneWeaponAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "dancing rune weapon") {}
|
||||
};
|
||||
|
||||
class CastEmpowerRuneWeaponAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastEmpowerRuneWeaponAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "empower rune weapon") {}
|
||||
};
|
||||
|
||||
class CastArmyOfTheDeadAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastArmyOfTheDeadAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "army of the dead") {}
|
||||
};
|
||||
|
||||
class CastRaiseDeadAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastRaiseDeadAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "raise dead") {}
|
||||
virtual bool Execute(Event event) override;
|
||||
};
|
||||
|
||||
class CastKillingMachineAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastKillingMachineAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "killing machine") {}
|
||||
};
|
||||
|
||||
class CastIceboundFortitudeAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastIceboundFortitudeAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "icebound fortitude") {}
|
||||
};
|
||||
|
||||
class CastUnbreakableArmorAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastUnbreakableArmorAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "unbreakable armor") {}
|
||||
};
|
||||
|
||||
class CastVampiricBloodAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastVampiricBloodAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "vampiric blood") {}
|
||||
};
|
||||
|
||||
class CastMindFreezeAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastMindFreezeAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "mind freeze") {}
|
||||
};
|
||||
|
||||
class CastStrangulateAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastStrangulateAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "strangulate") {}
|
||||
};
|
||||
|
||||
class CastMindFreezeOnEnemyHealerAction : public CastSpellOnEnemyHealerAction
|
||||
{
|
||||
public:
|
||||
CastMindFreezeOnEnemyHealerAction(PlayerbotAI* botAI) : CastSpellOnEnemyHealerAction(botAI, "mind freeze") {}
|
||||
};
|
||||
|
||||
class CastRuneTapAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastRuneTapAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "rune tap") {}
|
||||
};
|
||||
|
||||
class CastBloodTapAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastBloodTapAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "blood tap") {}
|
||||
};
|
||||
|
||||
#endif
|
||||
318
src/Scenario/ClassAi/DeathKnight/DKAiObjectContext.cpp
Normal file
318
src/Scenario/ClassAi/DeathKnight/DKAiObjectContext.cpp
Normal file
@@ -0,0 +1,318 @@
|
||||
/*
|
||||
* 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 "DKAiObjectContext.h"
|
||||
|
||||
#include "BloodDKStrategy.h"
|
||||
#include "DKActions.h"
|
||||
#include "DKTriggers.h"
|
||||
#include "FrostDKStrategy.h"
|
||||
#include "GenericDKNonCombatStrategy.h"
|
||||
#include "GenericTriggers.h"
|
||||
#include "Playerbots.h"
|
||||
#include "PullStrategy.h"
|
||||
#include "UnholyDKStrategy.h"
|
||||
|
||||
class DeathKnightStrategyFactoryInternal : public NamedObjectContext<Strategy>
|
||||
{
|
||||
public:
|
||||
DeathKnightStrategyFactoryInternal()
|
||||
{
|
||||
creators["nc"] = &DeathKnightStrategyFactoryInternal::nc;
|
||||
creators["pull"] = &DeathKnightStrategyFactoryInternal::pull;
|
||||
creators["frost aoe"] = &DeathKnightStrategyFactoryInternal::frost_aoe;
|
||||
creators["unholy aoe"] = &DeathKnightStrategyFactoryInternal::unholy_aoe;
|
||||
}
|
||||
|
||||
private:
|
||||
static Strategy* nc(PlayerbotAI* botAI) { return new GenericDKNonCombatStrategy(botAI); }
|
||||
static Strategy* pull(PlayerbotAI* botAI) { return new PullStrategy(botAI, "icy touch"); }
|
||||
static Strategy* frost_aoe(PlayerbotAI* botAI) { return new FrostDKAoeStrategy(botAI); }
|
||||
static Strategy* unholy_aoe(PlayerbotAI* botAI) { return new UnholyDKAoeStrategy(botAI); }
|
||||
};
|
||||
|
||||
class DeathKnightCombatStrategyFactoryInternal : public NamedObjectContext<Strategy>
|
||||
{
|
||||
public:
|
||||
DeathKnightCombatStrategyFactoryInternal() : NamedObjectContext<Strategy>(false, true)
|
||||
{
|
||||
creators["tank"] = &DeathKnightCombatStrategyFactoryInternal::blood;
|
||||
creators["blood"] = &DeathKnightCombatStrategyFactoryInternal::blood;
|
||||
creators["frost"] = &DeathKnightCombatStrategyFactoryInternal::frost_dps;
|
||||
creators["unholy"] = &DeathKnightCombatStrategyFactoryInternal::unholy_dps;
|
||||
}
|
||||
|
||||
private:
|
||||
static Strategy* frost_dps(PlayerbotAI* botAI) { return new FrostDKStrategy(botAI); }
|
||||
static Strategy* unholy_dps(PlayerbotAI* botAI) { return new UnholyDKStrategy(botAI); }
|
||||
static Strategy* tank(PlayerbotAI* botAI) { return new BloodDKStrategy(botAI); }
|
||||
static Strategy* blood(PlayerbotAI* botAI) { return new BloodDKStrategy(botAI); }
|
||||
};
|
||||
|
||||
class DeathKnightDKBuffStrategyFactoryInternal : public NamedObjectContext<Strategy>
|
||||
{
|
||||
public:
|
||||
DeathKnightDKBuffStrategyFactoryInternal() : NamedObjectContext<Strategy>(false, true)
|
||||
{
|
||||
creators["bdps"] = &DeathKnightDKBuffStrategyFactoryInternal::bdps;
|
||||
}
|
||||
|
||||
private:
|
||||
static Strategy* bdps(PlayerbotAI* botAI) { return new DKBuffDpsStrategy(botAI); }
|
||||
};
|
||||
|
||||
class DeathKnightTriggerFactoryInternal : public NamedObjectContext<Trigger>
|
||||
{
|
||||
public:
|
||||
DeathKnightTriggerFactoryInternal()
|
||||
{
|
||||
creators["bone shield"] = &DeathKnightTriggerFactoryInternal::bone_shield;
|
||||
creators["pestilence glyph"] = &DeathKnightTriggerFactoryInternal::pestilence_glyph;
|
||||
creators["blood strike"] = &DeathKnightTriggerFactoryInternal::blood_strike;
|
||||
creators["plague strike"] = &DeathKnightTriggerFactoryInternal::plague_strike;
|
||||
creators["plague strike on attacker"] = &DeathKnightTriggerFactoryInternal::plague_strike_on_attacker;
|
||||
creators["icy touch"] = &DeathKnightTriggerFactoryInternal::icy_touch;
|
||||
creators["icy touch 3s"] = &DeathKnightTriggerFactoryInternal::icy_touch_3s;
|
||||
creators["dd cd and icy touch 3s"] = &DeathKnightTriggerFactoryInternal::dd_cd_and_icy_touch_3s;
|
||||
creators["death coil"] = &DeathKnightTriggerFactoryInternal::death_coil;
|
||||
creators["icy touch on attacker"] = &DeathKnightTriggerFactoryInternal::icy_touch_on_attacker;
|
||||
creators["improved icy talons"] = &DeathKnightTriggerFactoryInternal::improved_icy_talons;
|
||||
creators["plague strike"] = &DeathKnightTriggerFactoryInternal::plague_strike;
|
||||
creators["plague strike 3s"] = &DeathKnightTriggerFactoryInternal::plague_strike_3s;
|
||||
creators["dd cd and plague strike 3s"] = &DeathKnightTriggerFactoryInternal::dd_cd_and_plague_strike_3s;
|
||||
creators["horn of winter"] = &DeathKnightTriggerFactoryInternal::horn_of_winter;
|
||||
creators["mind freeze"] = &DeathKnightTriggerFactoryInternal::mind_freeze;
|
||||
creators["mind freeze on enemy healer"] = &DeathKnightTriggerFactoryInternal::mind_freeze_on_enemy_healer;
|
||||
creators["strangulate"] = &DeathKnightTriggerFactoryInternal::strangulate;
|
||||
creators["strangulate on enemy healer"] = &DeathKnightTriggerFactoryInternal::strangulate_on_enemy_healer;
|
||||
creators["blood tap"] = &DeathKnightTriggerFactoryInternal::blood_tap;
|
||||
creators["raise dead"] = &DeathKnightTriggerFactoryInternal::raise_dead;
|
||||
creators["chains of ice"] = &DeathKnightTriggerFactoryInternal::chains_of_ice;
|
||||
creators["unbreakable armor"] = &DeathKnightTriggerFactoryInternal::unbreakable_armor;
|
||||
creators["high blood rune"] = &DeathKnightTriggerFactoryInternal::high_blood_rune;
|
||||
creators["high frost rune"] = &DeathKnightTriggerFactoryInternal::high_frost_rune;
|
||||
creators["high unholy rune"] = &DeathKnightTriggerFactoryInternal::high_unholy_rune;
|
||||
creators["no rune"] = &DeathKnightTriggerFactoryInternal::no_rune;
|
||||
creators["freezing fog"] = &DeathKnightTriggerFactoryInternal::freezing_fog;
|
||||
creators["no desolation"] = &DeathKnightTriggerFactoryInternal::no_desolation;
|
||||
creators["dd cd and no desolation"] = &DeathKnightTriggerFactoryInternal::dd_cd_and_no_desolation;
|
||||
creators["death and decay cooldown"] = &DeathKnightTriggerFactoryInternal::death_and_decay_cooldown;
|
||||
creators["army of the dead"] = &DeathKnightTriggerFactoryInternal::army_of_the_dead;
|
||||
}
|
||||
|
||||
private:
|
||||
static Trigger* bone_shield(PlayerbotAI* botAI) { return new BoneShieldTrigger(botAI); }
|
||||
static Trigger* pestilence_glyph(PlayerbotAI* botAI) { return new PestilenceGlyphTrigger(botAI); }
|
||||
static Trigger* blood_strike(PlayerbotAI* botAI) { return new BloodStrikeTrigger(botAI); }
|
||||
static Trigger* plague_strike(PlayerbotAI* botAI) { return new PlagueStrikeDebuffTrigger(botAI); }
|
||||
static Trigger* plague_strike_3s(PlayerbotAI* botAI) { return new PlagueStrike3sDebuffTrigger(botAI); }
|
||||
static Trigger* dd_cd_and_plague_strike_3s(PlayerbotAI* botAI)
|
||||
{
|
||||
return new TwoTriggers(botAI, "death and decay cooldown", "plague strike 3s");
|
||||
}
|
||||
static Trigger* plague_strike_on_attacker(PlayerbotAI* botAI)
|
||||
{
|
||||
return new PlagueStrikeDebuffOnAttackerTrigger(botAI);
|
||||
}
|
||||
static Trigger* icy_touch(PlayerbotAI* botAI) { return new IcyTouchDebuffTrigger(botAI); }
|
||||
static Trigger* icy_touch_3s(PlayerbotAI* botAI) { return new IcyTouch3sDebuffTrigger(botAI); }
|
||||
static Trigger* dd_cd_and_icy_touch_3s(PlayerbotAI* botAI)
|
||||
{
|
||||
return new TwoTriggers(botAI, "death and decay cooldown", "icy touch 3s");
|
||||
}
|
||||
static Trigger* death_coil(PlayerbotAI* botAI) { return new DeathCoilTrigger(botAI); }
|
||||
static Trigger* icy_touch_on_attacker(PlayerbotAI* botAI) { return new IcyTouchDebuffOnAttackerTrigger(botAI); }
|
||||
static Trigger* improved_icy_talons(PlayerbotAI* botAI) { return new ImprovedIcyTalonsTrigger(botAI); }
|
||||
static Trigger* horn_of_winter(PlayerbotAI* botAI) { return new HornOfWinterTrigger(botAI); }
|
||||
static Trigger* mind_freeze(PlayerbotAI* botAI) { return new MindFreezeInterruptSpellTrigger(botAI); }
|
||||
static Trigger* mind_freeze_on_enemy_healer(PlayerbotAI* botAI)
|
||||
{
|
||||
return new MindFreezeOnEnemyHealerTrigger(botAI);
|
||||
}
|
||||
static Trigger* strangulate(PlayerbotAI* botAI) { return new StrangulateInterruptSpellTrigger(botAI); }
|
||||
static Trigger* strangulate_on_enemy_healer(PlayerbotAI* botAI)
|
||||
{
|
||||
return new StrangulateOnEnemyHealerTrigger(botAI);
|
||||
}
|
||||
static Trigger* blood_tap(PlayerbotAI* botAI) { return new BloodTapTrigger(botAI); }
|
||||
static Trigger* raise_dead(PlayerbotAI* botAI) { return new RaiseDeadTrigger(botAI); }
|
||||
static Trigger* chains_of_ice(PlayerbotAI* botAI) { return new ChainsOfIceSnareTrigger(botAI); }
|
||||
static Trigger* unbreakable_armor(PlayerbotAI* botAI) { return new UnbreakableArmorTrigger(botAI); }
|
||||
static Trigger* high_blood_rune(PlayerbotAI* botAI) { return new HighBloodRuneTrigger(botAI); }
|
||||
static Trigger* high_frost_rune(PlayerbotAI* botAI) { return new HighFrostRuneTrigger(botAI); }
|
||||
static Trigger* high_unholy_rune(PlayerbotAI* botAI) { return new HighUnholyRuneTrigger(botAI); }
|
||||
static Trigger* no_rune(PlayerbotAI* botAI) { return new NoRuneTrigger(botAI); }
|
||||
static Trigger* freezing_fog(PlayerbotAI* botAI) { return new FreezingFogTrigger(botAI); }
|
||||
static Trigger* no_desolation(PlayerbotAI* botAI) { return new DesolationTrigger(botAI); }
|
||||
static Trigger* dd_cd_and_no_desolation(PlayerbotAI* botAI)
|
||||
{
|
||||
return new TwoTriggers(botAI, "death and decay cooldown", "no desolation");
|
||||
}
|
||||
static Trigger* death_and_decay_cooldown(PlayerbotAI* botAI) { return new DeathAndDecayCooldownTrigger(botAI); }
|
||||
static Trigger* army_of_the_dead(PlayerbotAI* botAI) { return new ArmyOfTheDeadTrigger(botAI); }
|
||||
};
|
||||
|
||||
class DeathKnightAiObjectContextInternal : public NamedObjectContext<Action>
|
||||
{
|
||||
public:
|
||||
DeathKnightAiObjectContextInternal()
|
||||
{
|
||||
// Unholy
|
||||
creators["bone shield"] = &DeathKnightAiObjectContextInternal::bone_shield;
|
||||
creators["plague strike"] = &DeathKnightAiObjectContextInternal::plague_strike;
|
||||
creators["plague strike on attacker"] = &DeathKnightAiObjectContextInternal::plague_strike_on_attacker;
|
||||
creators["death grip"] = &DeathKnightAiObjectContextInternal::death_grip;
|
||||
creators["death coil"] = &DeathKnightAiObjectContextInternal::death_coil;
|
||||
creators["death strike"] = &DeathKnightAiObjectContextInternal::death_strike;
|
||||
creators["unholy blight"] = &DeathKnightAiObjectContextInternal::unholy_blight;
|
||||
creators["scourge strike"] = &DeathKnightAiObjectContextInternal::scourge_strike;
|
||||
creators["death and decay"] = &DeathKnightAiObjectContextInternal::death_and_decay;
|
||||
creators["unholy presence"] = &DeathKnightAiObjectContextInternal::unholy_presence;
|
||||
creators["raise dead"] = &DeathKnightAiObjectContextInternal::raise_dead;
|
||||
creators["army of the dead"] = &DeathKnightAiObjectContextInternal::army_of_the_dead;
|
||||
creators["summon gargoyle"] = &DeathKnightAiObjectContextInternal::summon_gargoyle;
|
||||
creators["anti magic shell"] = &DeathKnightAiObjectContextInternal::anti_magic_shell;
|
||||
creators["anti magic zone"] = &DeathKnightAiObjectContextInternal::anti_magic_zone;
|
||||
creators["ghoul frenzy"] = &DeathKnightAiObjectContextInternal::ghoul_frenzy;
|
||||
creators["corpse explosion"] = &DeathKnightAiObjectContextInternal::corpse_explosion;
|
||||
// Frost
|
||||
creators["icy touch"] = &DeathKnightAiObjectContextInternal::icy_touch;
|
||||
creators["icy touch on attacker"] = &DeathKnightAiObjectContextInternal::icy_touch_on_attacker;
|
||||
creators["obliterate"] = &DeathKnightAiObjectContextInternal::obliterate;
|
||||
creators["howling blast"] = &DeathKnightAiObjectContextInternal::howling_blast;
|
||||
creators["frost strike"] = &DeathKnightAiObjectContextInternal::frost_strike;
|
||||
creators["chains of ice"] = &DeathKnightAiObjectContextInternal::chains_of_ice;
|
||||
creators["rune strike"] = &DeathKnightAiObjectContextInternal::rune_strike;
|
||||
// creators["icy clutch"] = &DeathKnightAiObjectContextInternal::icy_clutch;
|
||||
creators["horn of winter"] = &DeathKnightAiObjectContextInternal::horn_of_winter;
|
||||
creators["killing machine"] = &DeathKnightAiObjectContextInternal::killing_machine;
|
||||
creators["frost presence"] = &DeathKnightAiObjectContextInternal::frost_presence;
|
||||
creators["deathchill"] = &DeathKnightAiObjectContextInternal::deathchill;
|
||||
creators["icebound fortitude"] = &DeathKnightAiObjectContextInternal::icebound_fortitude;
|
||||
creators["mind freeze"] = &DeathKnightAiObjectContextInternal::mind_freeze;
|
||||
creators["empower rune weapon"] = &DeathKnightAiObjectContextInternal::empower_rune_weapon;
|
||||
creators["hungering cold"] = &DeathKnightAiObjectContextInternal::hungering_cold;
|
||||
creators["unbreakable armor"] = &DeathKnightAiObjectContextInternal::unbreakable_armor;
|
||||
creators["improved icy talons"] = &DeathKnightAiObjectContextInternal::improved_icy_talons;
|
||||
// blood
|
||||
creators["blood strike"] = &DeathKnightAiObjectContextInternal::blood_strike;
|
||||
creators["blood tap"] = &DeathKnightAiObjectContextInternal::blood_tap;
|
||||
creators["pestilence"] = &DeathKnightAiObjectContextInternal::pestilence;
|
||||
creators["strangulate"] = &DeathKnightAiObjectContextInternal::strangulate;
|
||||
creators["blood boil"] = &DeathKnightAiObjectContextInternal::blood_boil;
|
||||
creators["heart strike"] = &DeathKnightAiObjectContextInternal::heart_strike;
|
||||
creators["mark of_blood"] = &DeathKnightAiObjectContextInternal::mark_of_blood;
|
||||
creators["blood presence"] = &DeathKnightAiObjectContextInternal::blood_presence;
|
||||
creators["rune tap"] = &DeathKnightAiObjectContextInternal::rune_tap;
|
||||
creators["vampiric blood"] = &DeathKnightAiObjectContextInternal::vampiric_blood;
|
||||
creators["death pact"] = &DeathKnightAiObjectContextInternal::death_pact;
|
||||
creators["death rune_mastery"] = &DeathKnightAiObjectContextInternal::death_rune_mastery;
|
||||
// creators["hysteria"] = &DeathKnightAiObjectContextInternal::hysteria;
|
||||
creators["dancing rune weapon"] = &DeathKnightAiObjectContextInternal::dancing_rune_weapon;
|
||||
creators["dark command"] = &DeathKnightAiObjectContextInternal::dark_command;
|
||||
}
|
||||
|
||||
private:
|
||||
// Unholy
|
||||
static Action* bone_shield(PlayerbotAI* botAI) { return new CastBoneShieldAction(botAI); }
|
||||
static Action* plague_strike(PlayerbotAI* botAI) { return new CastPlagueStrikeAction(botAI); }
|
||||
static Action* plague_strike_on_attacker(PlayerbotAI* botAI) { return new CastPlagueStrikeOnAttackerAction(botAI); }
|
||||
static Action* death_grip(PlayerbotAI* botAI) { return new CastDeathGripAction(botAI); }
|
||||
static Action* death_coil(PlayerbotAI* botAI) { return new CastDeathCoilAction(botAI); }
|
||||
static Action* death_strike(PlayerbotAI* botAI) { return new CastDeathStrikeAction(botAI); }
|
||||
static Action* unholy_blight(PlayerbotAI* botAI) { return new CastUnholyBlightAction(botAI); }
|
||||
static Action* scourge_strike(PlayerbotAI* botAI) { return new CastScourgeStrikeAction(botAI); }
|
||||
static Action* death_and_decay(PlayerbotAI* botAI) { return new CastDeathAndDecayAction(botAI); }
|
||||
static Action* unholy_presence(PlayerbotAI* botAI) { return new CastUnholyPresenceAction(botAI); }
|
||||
static Action* raise_dead(PlayerbotAI* botAI) { return new CastRaiseDeadAction(botAI); }
|
||||
static Action* army_of_the_dead(PlayerbotAI* botAI) { return new CastArmyOfTheDeadAction(botAI); }
|
||||
static Action* summon_gargoyle(PlayerbotAI* botAI) { return new CastSummonGargoyleAction(botAI); }
|
||||
static Action* anti_magic_shell(PlayerbotAI* botAI) { return new CastAntiMagicShellAction(botAI); }
|
||||
static Action* anti_magic_zone(PlayerbotAI* botAI) { return new CastAntiMagicZoneAction(botAI); }
|
||||
static Action* ghoul_frenzy(PlayerbotAI* botAI) { return new CastGhoulFrenzyAction(botAI); }
|
||||
static Action* corpse_explosion(PlayerbotAI* botAI) { return new CastCorpseExplosionAction(botAI); }
|
||||
// Frost
|
||||
static Action* icy_touch(PlayerbotAI* botAI) { return new CastIcyTouchAction(botAI); }
|
||||
static Action* icy_touch_on_attacker(PlayerbotAI* botAI) { return new CastIcyTouchOnAttackerAction(botAI); }
|
||||
static Action* obliterate(PlayerbotAI* botAI) { return new CastObliterateAction(botAI); }
|
||||
static Action* howling_blast(PlayerbotAI* botAI) { return new CastHowlingBlastAction(botAI); }
|
||||
static Action* frost_strike(PlayerbotAI* botAI) { return new CastFrostStrikeAction(botAI); }
|
||||
static Action* chains_of_ice(PlayerbotAI* botAI) { return new CastChainsOfIceAction(botAI); }
|
||||
static Action* rune_strike(PlayerbotAI* botAI) { return new CastRuneStrikeAction(botAI); }
|
||||
// static Action* icy_clutch(PlayerbotAI* botAI) { return new CastIcyClutchAction(botAI); }
|
||||
static Action* horn_of_winter(PlayerbotAI* botAI) { return new CastHornOfWinterAction(botAI); }
|
||||
static Action* killing_machine(PlayerbotAI* botAI) { return new CastKillingMachineAction(botAI); }
|
||||
static Action* frost_presence(PlayerbotAI* botAI) { return new CastFrostPresenceAction(botAI); }
|
||||
static Action* deathchill(PlayerbotAI* botAI) { return new CastDeathchillAction(botAI); }
|
||||
static Action* icebound_fortitude(PlayerbotAI* botAI) { return new CastIceboundFortitudeAction(botAI); }
|
||||
static Action* mind_freeze(PlayerbotAI* botAI) { return new CastMindFreezeAction(botAI); }
|
||||
static Action* empower_rune_weapon(PlayerbotAI* botAI) { return new CastEmpowerRuneWeaponAction(botAI); }
|
||||
static Action* hungering_cold(PlayerbotAI* botAI) { return new CastHungeringColdAction(botAI); }
|
||||
static Action* unbreakable_armor(PlayerbotAI* botAI) { return new CastUnbreakableArmorAction(botAI); }
|
||||
static Action* improved_icy_talons(PlayerbotAI* botAI) { return new CastImprovedIcyTalonsAction(botAI); }
|
||||
// blood
|
||||
static Action* blood_strike(PlayerbotAI* botAI) { return new CastBloodStrikeAction(botAI); }
|
||||
static Action* blood_tap(PlayerbotAI* botAI) { return new CastBloodTapAction(botAI); }
|
||||
static Action* pestilence(PlayerbotAI* botAI) { return new CastPestilenceAction(botAI); }
|
||||
static Action* strangulate(PlayerbotAI* botAI) { return new CastStrangulateAction(botAI); }
|
||||
static Action* blood_boil(PlayerbotAI* botAI) { return new CastBloodBoilAction(botAI); }
|
||||
static Action* heart_strike(PlayerbotAI* botAI) { return new CastHeartStrikeAction(botAI); }
|
||||
static Action* mark_of_blood(PlayerbotAI* botAI) { return new CastMarkOfBloodAction(botAI); }
|
||||
static Action* blood_presence(PlayerbotAI* botAI) { return new CastBloodPresenceAction(botAI); }
|
||||
static Action* rune_tap(PlayerbotAI* botAI) { return new CastRuneTapAction(botAI); }
|
||||
static Action* vampiric_blood(PlayerbotAI* botAI) { return new CastVampiricBloodAction(botAI); }
|
||||
static Action* death_pact(PlayerbotAI* botAI) { return new CastDeathPactAction(botAI); }
|
||||
static Action* death_rune_mastery(PlayerbotAI* botAI) { return new CastDeathRuneMasteryAction(botAI); }
|
||||
// static Action* hysteria(PlayerbotAI* botAI) { return new CastHysteriaAction(botAI); }
|
||||
static Action* dancing_rune_weapon(PlayerbotAI* botAI) { return new CastDancingRuneWeaponAction(botAI); }
|
||||
static Action* dark_command(PlayerbotAI* botAI) { return new CastDarkCommandAction(botAI); }
|
||||
static Action* mind_freeze_on_enemy_healer(PlayerbotAI* botAI)
|
||||
{
|
||||
return new CastMindFreezeOnEnemyHealerAction(botAI);
|
||||
}
|
||||
};
|
||||
|
||||
SharedNamedObjectContextList<Strategy> DKAiObjectContext::sharedStrategyContexts;
|
||||
SharedNamedObjectContextList<Action> DKAiObjectContext::sharedActionContexts;
|
||||
SharedNamedObjectContextList<Trigger> DKAiObjectContext::sharedTriggerContexts;
|
||||
SharedNamedObjectContextList<UntypedValue> DKAiObjectContext::sharedValueContexts;
|
||||
|
||||
DKAiObjectContext::DKAiObjectContext(PlayerbotAI* botAI)
|
||||
: AiObjectContext(botAI, sharedStrategyContexts, sharedActionContexts, sharedTriggerContexts, sharedValueContexts)
|
||||
{
|
||||
}
|
||||
|
||||
void DKAiObjectContext::BuildSharedContexts()
|
||||
{
|
||||
BuildSharedStrategyContexts(sharedStrategyContexts);
|
||||
BuildSharedActionContexts(sharedActionContexts);
|
||||
BuildSharedTriggerContexts(sharedTriggerContexts);
|
||||
BuildSharedValueContexts(sharedValueContexts);
|
||||
}
|
||||
|
||||
void DKAiObjectContext::BuildSharedStrategyContexts(SharedNamedObjectContextList<Strategy>& strategyContexts)
|
||||
{
|
||||
AiObjectContext::BuildSharedStrategyContexts(strategyContexts);
|
||||
strategyContexts.Add(new DeathKnightStrategyFactoryInternal());
|
||||
strategyContexts.Add(new DeathKnightCombatStrategyFactoryInternal());
|
||||
strategyContexts.Add(new DeathKnightDKBuffStrategyFactoryInternal());
|
||||
}
|
||||
|
||||
void DKAiObjectContext::BuildSharedActionContexts(SharedNamedObjectContextList<Action>& actionContexts)
|
||||
{
|
||||
AiObjectContext::BuildSharedActionContexts(actionContexts);
|
||||
actionContexts.Add(new DeathKnightAiObjectContextInternal());
|
||||
}
|
||||
|
||||
void DKAiObjectContext::BuildSharedTriggerContexts(SharedNamedObjectContextList<Trigger>& triggerContexts)
|
||||
{
|
||||
AiObjectContext::BuildSharedTriggerContexts(triggerContexts);
|
||||
triggerContexts.Add(new DeathKnightTriggerFactoryInternal());
|
||||
}
|
||||
|
||||
void DKAiObjectContext::BuildSharedValueContexts(SharedNamedObjectContextList<UntypedValue>& valueContexts)
|
||||
{
|
||||
AiObjectContext::BuildSharedValueContexts(valueContexts);
|
||||
}
|
||||
30
src/Scenario/ClassAi/DeathKnight/DKAiObjectContext.h
Normal file
30
src/Scenario/ClassAi/DeathKnight/DKAiObjectContext.h
Normal 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_DKAIOBJECTCONTEXT_H
|
||||
#define _PLAYERBOT_DKAIOBJECTCONTEXT_H
|
||||
|
||||
#include "AiObjectContext.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class DKAiObjectContext : public AiObjectContext
|
||||
{
|
||||
public:
|
||||
DKAiObjectContext(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
|
||||
165
src/Scenario/ClassAi/DeathKnight/Strategy/BloodDKStrategy.cpp
Normal file
165
src/Scenario/ClassAi/DeathKnight/Strategy/BloodDKStrategy.cpp
Normal file
@@ -0,0 +1,165 @@
|
||||
/*
|
||||
* 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 "BloodDKStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
class BloodDKStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
BloodDKStrategyActionNodeFactory()
|
||||
{
|
||||
creators["rune strike"] = &rune_strike;
|
||||
creators["heart strike"] = &heart_strike;
|
||||
creators["death strike"] = &death_strike;
|
||||
creators["icy touch"] = &icy_touch;
|
||||
creators["dark command"] = &dark_command;
|
||||
creators["taunt spell"] = &dark_command;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* rune_strike([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"rune strike",
|
||||
{
|
||||
NextAction("frost presence")
|
||||
},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
static ActionNode* icy_touch([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"icy touch",
|
||||
{
|
||||
NextAction("frost presence")
|
||||
},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
static ActionNode* heart_strike([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"heart strike",
|
||||
{
|
||||
NextAction("frost presence")
|
||||
},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* death_strike([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"death strike",
|
||||
{
|
||||
NextAction("frost presence")
|
||||
},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
static ActionNode* dark_command([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"dark command",
|
||||
{
|
||||
NextAction("frost presence")
|
||||
},
|
||||
/*A*/ {
|
||||
NextAction("death grip")
|
||||
},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
BloodDKStrategy::BloodDKStrategy(PlayerbotAI* botAI) : GenericDKStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new BloodDKStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
std::vector<NextAction> BloodDKStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("rune strike", ACTION_DEFAULT + 0.8f),
|
||||
NextAction("icy touch", ACTION_DEFAULT + 0.7f),
|
||||
NextAction("heart strike", ACTION_DEFAULT + 0.6f),
|
||||
NextAction("blood strike", ACTION_DEFAULT + 0.5f),
|
||||
NextAction("dancing rune weapon", ACTION_DEFAULT + 0.4f),
|
||||
NextAction("death coil", ACTION_DEFAULT + 0.3f),
|
||||
NextAction("plague strike", ACTION_DEFAULT + 0.2f),
|
||||
NextAction("horn of winter", ACTION_DEFAULT + 0.1f),
|
||||
NextAction("melee", ACTION_DEFAULT)
|
||||
};
|
||||
}
|
||||
|
||||
void BloodDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
GenericDKStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"rune strike",
|
||||
{
|
||||
NextAction("rune strike", ACTION_NORMAL + 3)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"blood tap",
|
||||
{
|
||||
NextAction("blood tap", ACTION_HIGH + 5)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"lose aggro",
|
||||
{
|
||||
NextAction("dark command", ACTION_HIGH + 3)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"low health",
|
||||
{
|
||||
NextAction("army of the dead", ACTION_HIGH + 4),
|
||||
NextAction("death strike", ACTION_HIGH + 3)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"critical health",
|
||||
{
|
||||
NextAction("vampiric blood", ACTION_HIGH + 5)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"icy touch",
|
||||
{
|
||||
NextAction("icy touch", ACTION_HIGH + 2)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"plague strike",
|
||||
{
|
||||
NextAction("plague strike", ACTION_HIGH + 2)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
24
src/Scenario/ClassAi/DeathKnight/Strategy/BloodDKStrategy.h
Normal file
24
src/Scenario/ClassAi/DeathKnight/Strategy/BloodDKStrategy.h
Normal 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_BLOODDKSTRATEGY_H
|
||||
#define _PLAYERBOT_BLOODDKSTRATEGY_H
|
||||
|
||||
#include "GenericDKStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class BloodDKStrategy : public GenericDKStrategy
|
||||
{
|
||||
public:
|
||||
BloodDKStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "blood"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_TANK | STRATEGY_TYPE_MELEE; }
|
||||
};
|
||||
|
||||
#endif
|
||||
169
src/Scenario/ClassAi/DeathKnight/Strategy/FrostDKStrategy.cpp
Normal file
169
src/Scenario/ClassAi/DeathKnight/Strategy/FrostDKStrategy.cpp
Normal file
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* 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 "FrostDKStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
class FrostDKStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
FrostDKStrategyActionNodeFactory()
|
||||
{
|
||||
creators["icy touch"] = &icy_touch;
|
||||
creators["obliterate"] = &obliterate;
|
||||
creators["howling blast"] = &howling_blast;
|
||||
creators["frost strike"] = &frost_strike;
|
||||
creators["rune strike"] = &rune_strike;
|
||||
creators["unbreakable armor"] = &unbreakable_armor;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* icy_touch([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"icy touch",
|
||||
/*P*/ { NextAction("blood presence") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* obliterate([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"obliterate",
|
||||
/*P*/ { NextAction("blood presence") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* rune_strike([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"rune strike",
|
||||
/*P*/ { NextAction("blood presence") },
|
||||
/*A*/ { NextAction("melee") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* frost_strike([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"frost strike",
|
||||
/*P*/ { NextAction("blood presence") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* howling_blast([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"howling blast",
|
||||
/*P*/ { NextAction("blood presence") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
static ActionNode* unbreakable_armor([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"unbreakable armor",
|
||||
/*P*/ { NextAction("blood tap") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
FrostDKStrategy::FrostDKStrategy(PlayerbotAI* botAI) : GenericDKStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new FrostDKStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
std::vector<NextAction> FrostDKStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("obliterate", ACTION_DEFAULT + 0.7f),
|
||||
NextAction("frost strike", ACTION_DEFAULT + 0.4f),
|
||||
NextAction("empower rune weapon", ACTION_DEFAULT + 0.3f),
|
||||
NextAction("horn of winter", ACTION_DEFAULT + 0.1f),
|
||||
NextAction("melee", ACTION_DEFAULT)
|
||||
};
|
||||
}
|
||||
|
||||
void FrostDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
GenericDKStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"unbreakable armor",
|
||||
{
|
||||
NextAction("unbreakable armor", ACTION_DEFAULT + 0.6f)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"freezing fog",
|
||||
{
|
||||
NextAction("howling blast", ACTION_DEFAULT + 0.5f)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"high blood rune",
|
||||
{
|
||||
NextAction("blood strike", ACTION_DEFAULT + 0.2f)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"army of the dead",
|
||||
{
|
||||
NextAction("army of the dead", ACTION_HIGH + 6)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"icy touch",
|
||||
{
|
||||
NextAction("icy touch", ACTION_HIGH + 2)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"plague strike",
|
||||
{
|
||||
NextAction("plague strike", ACTION_HIGH + 2)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
void FrostDKAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"medium aoe",
|
||||
{
|
||||
NextAction("howling blast", ACTION_HIGH + 4)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
33
src/Scenario/ClassAi/DeathKnight/Strategy/FrostDKStrategy.h
Normal file
33
src/Scenario/ClassAi/DeathKnight/Strategy/FrostDKStrategy.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 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_FROSTDKSTRATEGY_H
|
||||
#define _PLAYERBOT_FROSTDKSTRATEGY_H
|
||||
|
||||
#include "GenericDKStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class FrostDKStrategy : public GenericDKStrategy
|
||||
{
|
||||
public:
|
||||
FrostDKStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "frost"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_DPS | STRATEGY_TYPE_MELEE; }
|
||||
};
|
||||
|
||||
class FrostDKAoeStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
FrostDKAoeStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "frost aoe"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* 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 "GenericDKNonCombatStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
class GenericDKNonCombatStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
GenericDKNonCombatStrategyActionNodeFactory()
|
||||
{
|
||||
creators["bone shield"] = &bone_shield;
|
||||
creators["horn of winter"] = &horn_of_winter;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* bone_shield([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("bone shield",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* horn_of_winter([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("horn of winter",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
};
|
||||
|
||||
GenericDKNonCombatStrategy::GenericDKNonCombatStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new GenericDKNonCombatStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
void GenericDKNonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
NonCombatStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("no pet", { NextAction("raise dead", ACTION_NORMAL + 1) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("horn of winter", { NextAction("horn of winter", 21.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("bone shield", { NextAction("bone shield", 21.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("has pet", { NextAction("toggle pet spell", 60.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("new pet", { NextAction("set pet stance", 60.0f) }));
|
||||
}
|
||||
|
||||
void DKBuffDpsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_GENERICDKNONCOMBATSTRATEGY_H
|
||||
#define _PLAYERBOT_GENERICDKNONCOMBATSTRATEGY_H
|
||||
|
||||
#include "GenericDKStrategy.h"
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class GenericDKNonCombatStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
GenericDKNonCombatStrategy(PlayerbotAI* botAI);
|
||||
|
||||
std::string const getName() override { return "nc"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class DKBuffDpsStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
DKBuffDpsStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "bdps"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
193
src/Scenario/ClassAi/DeathKnight/Strategy/GenericDKStrategy.cpp
Normal file
193
src/Scenario/ClassAi/DeathKnight/Strategy/GenericDKStrategy.cpp
Normal file
@@ -0,0 +1,193 @@
|
||||
#/*
|
||||
* 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 "GenericDKStrategy.h"
|
||||
|
||||
#include "DKAiObjectContext.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
class GenericDKStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
GenericDKStrategyActionNodeFactory()
|
||||
{
|
||||
// blood
|
||||
// creators["rune tap"] = &rune_tap; cd
|
||||
// creators["vampiric blood"] = &vampiric_blood;
|
||||
// creators["death pact"] = &death_pact;
|
||||
// creators["hysteria"] = &hysteria; boost party
|
||||
// creators["dancing rune weapon"] = &dancing_rune_weapon; //cd
|
||||
// creators["dark command"] = &dark_command; taunt
|
||||
|
||||
// frost
|
||||
// creators["chains of ice"] = &chains_of_ice;
|
||||
// creators["icy clutch"] = &icy_clutch;
|
||||
creators["horn of winter"] = &horn_of_winter;
|
||||
creators["killing machine"] = &killing_machine; // buff
|
||||
// creators["deathchill"] = &deathchill; //boost
|
||||
creators["icebound fortitude"] = &icebound_fortitude;
|
||||
// creators["mind freeze"] = &mind_freeze; interrupt
|
||||
// creators["empower rune weapon"] = &empower_rune_weapon; boost
|
||||
// creators["hungering cold"] = &hungering_cold; snare
|
||||
// creators["unbreakable armor"] = &unbreakable_armor; boost +cd
|
||||
// creators["improved icy talons"] = &improved_icy_talons; boost party
|
||||
|
||||
// unholy
|
||||
creators["death and decay"] = &death_and_decay;
|
||||
// creators["raise dead"] = &raise_dead;
|
||||
// creators["army of the dead"] = &army of the dead;
|
||||
// creators["summon gargoyle"] = &army of the dead;
|
||||
// creators["anti magic shell"] = &anti_magic_shell; cd
|
||||
creators["anti magic zone"] = &anti_magic_zone;
|
||||
// creators["ghoul frenzy"] = &ghoul_frenzy;
|
||||
creators["corpse explosion"] = &corpse_explosion;
|
||||
creators["bone shield"] = &bone_shield;
|
||||
creators["heart strike"] = &heart_strike;
|
||||
creators["death grip"] = &death_grip;
|
||||
creators["plague strike"] = &plague_strike;
|
||||
creators["pestilence"] = &pestilence;
|
||||
creators["icy touch"] = &icy_touch;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* death_coil([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("death coil",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* death_grip([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("death grip",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("icy touch") },
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* plague_strike([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("plague strike",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* icy_touch([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("icy touch",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* heart_strike([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("heart strike",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* pestilence([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("pestilence",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* horn_of_winter([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("horn of winter",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* bone_shield([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("bone shield",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* killing_machine([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("killing machine",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("improved icy talons") },
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* corpse_explosion([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("corpse explosion",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* death_and_decay([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("death and decay",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* anti_magic_zone([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("anti magic zone",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("anti magic shell") },
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* icebound_fortitude([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("icebound fortitude",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
};
|
||||
|
||||
GenericDKStrategy::GenericDKStrategy(PlayerbotAI* botAI) : MeleeCombatStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new GenericDKStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
void GenericDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
MeleeCombatStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("no pet", { NextAction("raise dead", ACTION_NORMAL + 5) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("has pet", { NextAction("toggle pet spell", 60.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("new pet", { NextAction("set pet stance", 60.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("mind freeze", { NextAction("mind freeze", ACTION_HIGH + 1) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("mind freeze on enemy healer",
|
||||
{ NextAction("mind freeze on enemy healer", ACTION_HIGH + 1) }));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"horn of winter", { NextAction("horn of winter", ACTION_NORMAL + 1) }));
|
||||
triggers.push_back(new TriggerNode("critical health",
|
||||
{ NextAction("death pact", ACTION_HIGH + 5) }));
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("low health", { NextAction("icebound fortitude", ACTION_HIGH + 5),
|
||||
NextAction("rune tap", ACTION_HIGH + 4) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("medium aoe", { NextAction("death and decay", ACTION_HIGH + 9),
|
||||
NextAction("pestilence", ACTION_NORMAL + 4),
|
||||
NextAction("blood boil", ACTION_NORMAL + 3) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("pestilence glyph", { NextAction("pestilence", ACTION_HIGH + 9) }));
|
||||
}
|
||||
@@ -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_GENERICDKSTRATEGY_H
|
||||
#define _PLAYERBOT_GENERICDKSTRATEGY_H
|
||||
|
||||
#include "MeleeCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class GenericDKStrategy : public MeleeCombatStrategy
|
||||
{
|
||||
public:
|
||||
GenericDKStrategy(PlayerbotAI* botAI);
|
||||
|
||||
std::string const getName() override { return "DK"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
192
src/Scenario/ClassAi/DeathKnight/Strategy/UnholyDKStrategy.cpp
Normal file
192
src/Scenario/ClassAi/DeathKnight/Strategy/UnholyDKStrategy.cpp
Normal file
@@ -0,0 +1,192 @@
|
||||
/*
|
||||
* 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 "UnholyDKStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
class UnholyDKStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
UnholyDKStrategyActionNodeFactory()
|
||||
{
|
||||
creators["death strike"] = &death_strike;
|
||||
creators["scourge strike"] = &scourge_strike;
|
||||
creators["ghoul frenzy"] = &ghoul_frenzy;
|
||||
creators["corpse explosion"] = &corpse_explosion;
|
||||
creators["icy touch"] = &icy_touch;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* death_strike([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"death strike",
|
||||
/*P*/ { NextAction("blood presence") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
static ActionNode* ghoul_frenzy([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"ghoul frenzy",
|
||||
/*P*/ { NextAction("blood presence") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
static ActionNode* corpse_explosion([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"corpse explosion",
|
||||
/*P*/ { NextAction("blood presence") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* scourge_strike([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"scourge strike",
|
||||
/*P*/ { NextAction("blood presence") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
static ActionNode* icy_touch([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"icy touch",
|
||||
/*P*/ { NextAction("blood presence") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
UnholyDKStrategy::UnholyDKStrategy(PlayerbotAI* botAI) : GenericDKStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new UnholyDKStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
std::vector<NextAction> UnholyDKStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("death and decay", ACTION_HIGH + 5),
|
||||
NextAction("summon gargoyle", ACTION_DEFAULT + 0.4f),
|
||||
NextAction("horn of winter", ACTION_DEFAULT + 0.2f),
|
||||
NextAction("death coil", ACTION_DEFAULT + 0.1f),
|
||||
NextAction("melee", ACTION_DEFAULT)
|
||||
};
|
||||
}
|
||||
|
||||
void UnholyDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
GenericDKStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"death and decay cooldown",
|
||||
{
|
||||
NextAction("ghoul frenzy", ACTION_DEFAULT + 0.9f),
|
||||
NextAction("scourge strike", ACTION_DEFAULT + 0.8f),
|
||||
NextAction("icy touch", ACTION_DEFAULT + 0.7f),
|
||||
NextAction("blood strike", ACTION_DEFAULT + 0.6f),
|
||||
NextAction("plague strike", ACTION_DEFAULT + 0.5f),
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"dd cd and no desolation",
|
||||
{
|
||||
NextAction("blood strike", ACTION_DEFAULT + 0.75f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"high frost rune",
|
||||
{
|
||||
NextAction("icy touch", ACTION_NORMAL + 3)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"high blood rune",
|
||||
{
|
||||
NextAction("blood strike", ACTION_NORMAL + 2)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"high unholy rune",
|
||||
{
|
||||
NextAction("plague strike", ACTION_NORMAL + 1)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode("dd cd and plague strike 3s",
|
||||
{
|
||||
NextAction("plague strike", ACTION_HIGH + 1)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode("dd cd and icy touch 3s",
|
||||
{
|
||||
NextAction("icy touch", ACTION_HIGH + 2)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode("no rune",
|
||||
{
|
||||
NextAction("empower rune weapon", ACTION_HIGH + 1)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"army of the dead",
|
||||
{
|
||||
NextAction("army of the dead", ACTION_HIGH + 6)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode("bone shield",
|
||||
{
|
||||
NextAction("bone shield", ACTION_HIGH + 3)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void UnholyDKAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"loot available",
|
||||
{
|
||||
NextAction("corpse explosion", ACTION_NORMAL + 1)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"medium aoe",
|
||||
{
|
||||
NextAction("death and decay", ACTION_NORMAL + 3),
|
||||
NextAction("corpse explosion", ACTION_NORMAL + 3)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
33
src/Scenario/ClassAi/DeathKnight/Strategy/UnholyDKStrategy.h
Normal file
33
src/Scenario/ClassAi/DeathKnight/Strategy/UnholyDKStrategy.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 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_UNHOLYDKSTRATEGY_H
|
||||
#define _PLAYERBOT_UNHOLYDKSTRATEGY_H
|
||||
|
||||
#include "GenericDKStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class UnholyDKStrategy : public GenericDKStrategy
|
||||
{
|
||||
public:
|
||||
UnholyDKStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "unholy"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_DPS | STRATEGY_TYPE_MELEE; }
|
||||
};
|
||||
|
||||
class UnholyDKAoeStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
UnholyDKAoeStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "unholy aoe"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
78
src/Scenario/ClassAi/DeathKnight/Trigger/DKTriggers.cpp
Normal file
78
src/Scenario/ClassAi/DeathKnight/Trigger/DKTriggers.cpp
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* 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 "DKTriggers.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "GenericTriggers.h"
|
||||
#include "Playerbots.h"
|
||||
#include "SharedDefines.h"
|
||||
|
||||
bool DKPresenceTrigger::IsActive()
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
return !botAI->HasAura("blood presence", target) && !botAI->HasAura("unholy presence", target) &&
|
||||
!botAI->HasAura("frost presence", target);
|
||||
}
|
||||
|
||||
bool PestilenceGlyphTrigger::IsActive()
|
||||
{
|
||||
if (!SpellTrigger::IsActive())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!bot->HasAura(63334))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Aura* blood_plague = botAI->GetAura("blood plague", GetTarget(), true, true);
|
||||
Aura* frost_fever = botAI->GetAura("frost fever", GetTarget(), true, true);
|
||||
if ((blood_plague && blood_plague->GetDuration() <= 3000) || (frost_fever && frost_fever->GetDuration() <= 3000))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Based on runeSlotTypes
|
||||
bool HighBloodRuneTrigger::IsActive()
|
||||
{
|
||||
return bot->GetRuneCooldown(0) <= 2000 && bot->GetRuneCooldown(1) <= 2000;
|
||||
}
|
||||
|
||||
bool HighFrostRuneTrigger::IsActive()
|
||||
{
|
||||
return bot->GetRuneCooldown(4) <= 2000 && bot->GetRuneCooldown(5) <= 2000;
|
||||
}
|
||||
|
||||
bool HighUnholyRuneTrigger::IsActive()
|
||||
{
|
||||
return bot->GetRuneCooldown(2) <= 2000 && bot->GetRuneCooldown(3) <= 2000;
|
||||
}
|
||||
|
||||
bool NoRuneTrigger::IsActive()
|
||||
{
|
||||
for (uint32 i = 0; i < MAX_RUNES; ++i)
|
||||
{
|
||||
if (!bot->GetRuneCooldown(i))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DesolationTrigger::IsActive()
|
||||
{
|
||||
return bot->HasAura(66817) && BuffTrigger::IsActive();
|
||||
}
|
||||
|
||||
bool DeathAndDecayCooldownTrigger::IsActive()
|
||||
{
|
||||
uint32 spellId = AI_VALUE2(uint32, "spell id", name);
|
||||
if (!spellId)
|
||||
return true;
|
||||
|
||||
return bot->GetSpellCooldownDelay(spellId) >= 2000;
|
||||
}
|
||||
201
src/Scenario/ClassAi/DeathKnight/Trigger/DKTriggers.h
Normal file
201
src/Scenario/ClassAi/DeathKnight/Trigger/DKTriggers.h
Normal 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.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_DKTRIGGERS_H
|
||||
#define _PLAYERBOT_DKTRIGGERS_H
|
||||
|
||||
#include "GenericTriggers.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
BUFF_TRIGGER(HornOfWinterTrigger, "horn of winter");
|
||||
BUFF_TRIGGER(BoneShieldTrigger, "bone shield");
|
||||
BUFF_TRIGGER(ImprovedIcyTalonsTrigger, "improved icy talons");
|
||||
// DEBUFF_CHECKISOWNER_TRIGGER(PlagueStrikeDebuffTrigger, "blood plague");
|
||||
class PlagueStrikeDebuffTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
PlagueStrikeDebuffTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "blood plague", 1, true, .0f) {}
|
||||
};
|
||||
|
||||
class PlagueStrike3sDebuffTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
PlagueStrike3sDebuffTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "blood plague", 1, true, .0f, 3000) {}
|
||||
};
|
||||
|
||||
// DEBUFF_CHECKISOWNER_TRIGGER(IcyTouchDebuffTrigger, "frost fever");
|
||||
class IcyTouchDebuffTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
IcyTouchDebuffTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "frost fever", 1, true, .0f) {}
|
||||
};
|
||||
|
||||
class IcyTouch3sDebuffTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
IcyTouch3sDebuffTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "frost fever", 1, true, .0f, 3000) {}
|
||||
};
|
||||
|
||||
BUFF_TRIGGER(UnbreakableArmorTrigger, "unbreakable armor");
|
||||
class PlagueStrikeDebuffOnAttackerTrigger : public DebuffOnMeleeAttackerTrigger
|
||||
{
|
||||
public:
|
||||
PlagueStrikeDebuffOnAttackerTrigger(PlayerbotAI* botAI)
|
||||
: DebuffOnMeleeAttackerTrigger(botAI, "blood plague", true, .0f)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class IcyTouchDebuffOnAttackerTrigger : public DebuffOnMeleeAttackerTrigger
|
||||
{
|
||||
public:
|
||||
IcyTouchDebuffOnAttackerTrigger(PlayerbotAI* botAI) : DebuffOnMeleeAttackerTrigger(botAI, "frost fever", true, .0f)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class DKPresenceTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
DKPresenceTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "blood presence") {}
|
||||
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class BloodTapTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
BloodTapTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "blood tap") {}
|
||||
};
|
||||
|
||||
class RaiseDeadTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
RaiseDeadTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "raise dead") {}
|
||||
};
|
||||
|
||||
class RuneStrikeTrigger : public SpellCanBeCastTrigger
|
||||
{
|
||||
public:
|
||||
RuneStrikeTrigger(PlayerbotAI* botAI) : SpellCanBeCastTrigger(botAI, "rune strike") {}
|
||||
};
|
||||
|
||||
class DeathCoilTrigger : public SpellCanBeCastTrigger
|
||||
{
|
||||
public:
|
||||
DeathCoilTrigger(PlayerbotAI* botAI) : SpellCanBeCastTrigger(botAI, "death coil") {}
|
||||
};
|
||||
|
||||
class PestilenceGlyphTrigger : public SpellTrigger
|
||||
{
|
||||
public:
|
||||
PestilenceGlyphTrigger(PlayerbotAI* botAI) : SpellTrigger(botAI, "pestilence") {}
|
||||
virtual bool IsActive() override;
|
||||
};
|
||||
|
||||
class BloodStrikeTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
BloodStrikeTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "blood strike", 1, true) {}
|
||||
};
|
||||
|
||||
class HowlingBlastTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
HowlingBlastTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "howling blast", 1, true) {}
|
||||
};
|
||||
|
||||
class MindFreezeInterruptSpellTrigger : public InterruptSpellTrigger
|
||||
{
|
||||
public:
|
||||
MindFreezeInterruptSpellTrigger(PlayerbotAI* botAI) : InterruptSpellTrigger(botAI, "mind freeze") {}
|
||||
};
|
||||
|
||||
class StrangulateInterruptSpellTrigger : public InterruptSpellTrigger
|
||||
{
|
||||
public:
|
||||
StrangulateInterruptSpellTrigger(PlayerbotAI* botAI) : InterruptSpellTrigger(botAI, "strangulate") {}
|
||||
};
|
||||
|
||||
class KillingMachineTrigger : public BoostTrigger
|
||||
{
|
||||
public:
|
||||
KillingMachineTrigger(PlayerbotAI* botAI) : BoostTrigger(botAI, "killing machine") {}
|
||||
};
|
||||
|
||||
class MindFreezeOnEnemyHealerTrigger : public InterruptEnemyHealerTrigger
|
||||
{
|
||||
public:
|
||||
MindFreezeOnEnemyHealerTrigger(PlayerbotAI* botAI) : InterruptEnemyHealerTrigger(botAI, "mind freeze") {}
|
||||
};
|
||||
|
||||
class ChainsOfIceSnareTrigger : public SnareTargetTrigger
|
||||
{
|
||||
public:
|
||||
ChainsOfIceSnareTrigger(PlayerbotAI* botAI) : SnareTargetTrigger(botAI, "chains of ice") {}
|
||||
};
|
||||
|
||||
class StrangulateOnEnemyHealerTrigger : public InterruptEnemyHealerTrigger
|
||||
{
|
||||
public:
|
||||
StrangulateOnEnemyHealerTrigger(PlayerbotAI* botAI) : InterruptEnemyHealerTrigger(botAI, "strangulate") {}
|
||||
};
|
||||
|
||||
class HighBloodRuneTrigger : public Trigger
|
||||
{
|
||||
public:
|
||||
HighBloodRuneTrigger(PlayerbotAI* botAI) : Trigger(botAI, "high blood rune") {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class HighFrostRuneTrigger : public Trigger
|
||||
{
|
||||
public:
|
||||
HighFrostRuneTrigger(PlayerbotAI* botAI) : Trigger(botAI, "high frost rune") {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class HighUnholyRuneTrigger : public Trigger
|
||||
{
|
||||
public:
|
||||
HighUnholyRuneTrigger(PlayerbotAI* botAI) : Trigger(botAI, "high unholy rune") {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class NoRuneTrigger : public Trigger
|
||||
{
|
||||
public:
|
||||
NoRuneTrigger(PlayerbotAI* botAI) : Trigger(botAI, "no rune") {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class FreezingFogTrigger : public HasAuraTrigger
|
||||
{
|
||||
public:
|
||||
FreezingFogTrigger(PlayerbotAI* botAI) : HasAuraTrigger(botAI, "freezing fog") {}
|
||||
};
|
||||
|
||||
class DesolationTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
DesolationTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "desolation", 1, false, true, 10000) {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class DeathAndDecayCooldownTrigger : public SpellCooldownTrigger
|
||||
{
|
||||
public:
|
||||
DeathAndDecayCooldownTrigger(PlayerbotAI* botAI) : SpellCooldownTrigger(botAI, "death and decay") {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class ArmyOfTheDeadTrigger : public BoostTrigger
|
||||
{
|
||||
public:
|
||||
ArmyOfTheDeadTrigger(PlayerbotAI* botAI) : BoostTrigger(botAI, "army of the dead") {}
|
||||
};
|
||||
|
||||
#endif
|
||||
110
src/Scenario/ClassAi/Druid/Action/DruidActions.cpp
Normal file
110
src/Scenario/ClassAi/Druid/Action/DruidActions.cpp
Normal file
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* 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 "DruidActions.h"
|
||||
|
||||
#include "Event.h"
|
||||
#include "Playerbots.h"
|
||||
#include "ServerFacade.h"
|
||||
#include "AoeValues.h"
|
||||
#include "TargetValue.h"
|
||||
|
||||
std::vector<NextAction> CastAbolishPoisonAction::getAlternatives()
|
||||
{
|
||||
return NextAction::merge({ NextAction("cure poison") },
|
||||
CastSpellAction::getPrerequisites());
|
||||
}
|
||||
|
||||
std::vector<NextAction> CastAbolishPoisonOnPartyAction::getAlternatives()
|
||||
{
|
||||
return NextAction::merge({ NextAction("cure poison on party") },
|
||||
CastSpellAction::getPrerequisites());
|
||||
}
|
||||
|
||||
Value<Unit*>* CastEntanglingRootsCcAction::GetTargetValue()
|
||||
{
|
||||
return context->GetValue<Unit*>("cc target", "entangling roots");
|
||||
}
|
||||
|
||||
bool CastEntanglingRootsCcAction::Execute(Event event) { return botAI->CastSpell("entangling roots", GetTarget()); }
|
||||
|
||||
Value<Unit*>* CastHibernateCcAction::GetTargetValue() { return context->GetValue<Unit*>("cc target", "hibernate"); }
|
||||
|
||||
bool CastHibernateCcAction::Execute(Event event) { return botAI->CastSpell("hibernate", GetTarget()); }
|
||||
bool CastStarfallAction::isUseful()
|
||||
{
|
||||
if (!CastSpellAction::isUseful())
|
||||
return false;
|
||||
|
||||
// Avoid breaking CC
|
||||
WorldLocation aoePos = *context->GetValue<WorldLocation>("aoe position");
|
||||
Unit* ccTarget = context->GetValue<Unit*>("current cc target")->Get();
|
||||
if (ccTarget && ccTarget->IsAlive())
|
||||
{
|
||||
float dist2d = sServerFacade->GetDistance2d(ccTarget, aoePos.GetPositionX(), aoePos.GetPositionY());
|
||||
if (sServerFacade->IsDistanceLessOrEqualThan(dist2d, sPlayerbotAIConfig->aoeRadius))
|
||||
return false;
|
||||
}
|
||||
|
||||
// Avoid single-target usage on initial pull
|
||||
uint8 aoeCount = *context->GetValue<uint8>("aoe count");
|
||||
if (aoeCount < 2)
|
||||
{
|
||||
Unit* target = context->GetValue<Unit*>("current target")->Get();
|
||||
if (!target || (!botAI->HasAura("moonfire", target) && !botAI->HasAura("insect swarm", target)))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<NextAction> CastReviveAction::getPrerequisites()
|
||||
{
|
||||
return NextAction::merge({ NextAction("caster form") },
|
||||
ResurrectPartyMemberAction::getPrerequisites());
|
||||
}
|
||||
|
||||
std::vector<NextAction> CastRebirthAction::getPrerequisites()
|
||||
{
|
||||
return NextAction::merge({ NextAction("caster form") },
|
||||
ResurrectPartyMemberAction::getPrerequisites());
|
||||
}
|
||||
|
||||
bool CastRebirthAction::isUseful()
|
||||
{
|
||||
return CastSpellAction::isUseful() &&
|
||||
AI_VALUE2(float, "distance", GetTargetName()) <= sPlayerbotAIConfig->spellDistance;
|
||||
}
|
||||
|
||||
Unit* CastRejuvenationOnNotFullAction::GetTarget()
|
||||
{
|
||||
Group* group = bot->GetGroup();
|
||||
MinValueCalculator calc(100);
|
||||
for (GroupReference* gref = group->GetFirstMember(); gref; gref = gref->next())
|
||||
{
|
||||
Player* player = gref->GetSource();
|
||||
if (!player)
|
||||
continue;
|
||||
if (player->isDead() || player->IsFullHealth())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (player->GetDistance2d(bot) > sPlayerbotAIConfig->spellDistance)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (botAI->HasAura("rejuvenation", player))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
calc.probe(player->GetHealthPct(), player);
|
||||
}
|
||||
return (Unit*)calc.param;
|
||||
}
|
||||
|
||||
bool CastRejuvenationOnNotFullAction::isUseful()
|
||||
{
|
||||
return GetTarget();
|
||||
}
|
||||
333
src/Scenario/ClassAi/Druid/Action/DruidActions.h
Normal file
333
src/Scenario/ClassAi/Druid/Action/DruidActions.h
Normal file
@@ -0,0 +1,333 @@
|
||||
/*
|
||||
* 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_DRUIDACTIONS_H
|
||||
#define _PLAYERBOT_DRUIDACTIONS_H
|
||||
|
||||
#include "GenericSpellActions.h"
|
||||
#include "SharedDefines.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
class Unit;
|
||||
|
||||
class CastFaerieFireAction : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastFaerieFireAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "faerie fire") {}
|
||||
};
|
||||
|
||||
class CastFaerieFireFeralAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastFaerieFireFeralAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "faerie fire (feral)") {}
|
||||
};
|
||||
|
||||
class CastRejuvenationAction : public CastHealingSpellAction
|
||||
{
|
||||
public:
|
||||
CastRejuvenationAction(PlayerbotAI* botAI) : CastHealingSpellAction(botAI, "rejuvenation") {}
|
||||
};
|
||||
|
||||
class CastRegrowthAction : public CastHealingSpellAction
|
||||
{
|
||||
public:
|
||||
CastRegrowthAction(PlayerbotAI* botAI) : CastHealingSpellAction(botAI, "regrowth") {}
|
||||
};
|
||||
|
||||
class CastHealingTouchAction : public CastHealingSpellAction
|
||||
{
|
||||
public:
|
||||
CastHealingTouchAction(PlayerbotAI* botAI) : CastHealingSpellAction(botAI, "healing touch") {}
|
||||
};
|
||||
|
||||
class CastRejuvenationOnPartyAction : public HealPartyMemberAction
|
||||
{
|
||||
public:
|
||||
CastRejuvenationOnPartyAction(PlayerbotAI* botAI)
|
||||
: HealPartyMemberAction(botAI, "rejuvenation", 15.0f, HealingManaEfficiency::VERY_HIGH)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class CastRegrowthOnPartyAction : public HealPartyMemberAction
|
||||
{
|
||||
public:
|
||||
CastRegrowthOnPartyAction(PlayerbotAI* botAI)
|
||||
: HealPartyMemberAction(botAI, "regrowth", 35.0f, HealingManaEfficiency::HIGH)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class CastHealingTouchOnPartyAction : public HealPartyMemberAction
|
||||
{
|
||||
public:
|
||||
CastHealingTouchOnPartyAction(PlayerbotAI* botAI)
|
||||
: HealPartyMemberAction(botAI, "healing touch", 50.0f, HealingManaEfficiency::LOW)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class CastReviveAction : public ResurrectPartyMemberAction
|
||||
{
|
||||
public:
|
||||
CastReviveAction(PlayerbotAI* botAI) : ResurrectPartyMemberAction(botAI, "revive") {}
|
||||
|
||||
std::vector<NextAction> getPrerequisites() override;
|
||||
};
|
||||
|
||||
class CastRebirthAction : public ResurrectPartyMemberAction
|
||||
{
|
||||
public:
|
||||
CastRebirthAction(PlayerbotAI* botAI) : ResurrectPartyMemberAction(botAI, "rebirth") {}
|
||||
|
||||
std::vector<NextAction> getPrerequisites() override;
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
class CastMarkOfTheWildAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastMarkOfTheWildAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "mark of the wild") {}
|
||||
};
|
||||
|
||||
class CastMarkOfTheWildOnPartyAction : public BuffOnPartyAction
|
||||
{
|
||||
public:
|
||||
CastMarkOfTheWildOnPartyAction(PlayerbotAI* botAI) : BuffOnPartyAction(botAI, "mark of the wild") {}
|
||||
};
|
||||
|
||||
class CastSurvivalInstinctsAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastSurvivalInstinctsAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "survival instincts") {}
|
||||
};
|
||||
|
||||
class CastFrenziedRegenerationAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastFrenziedRegenerationAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "frenzied regeneration") {}
|
||||
};
|
||||
|
||||
class CastThornsAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastThornsAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "thorns") {}
|
||||
};
|
||||
|
||||
class CastThornsOnPartyAction : public BuffOnPartyAction
|
||||
{
|
||||
public:
|
||||
CastThornsOnPartyAction(PlayerbotAI* botAI) : BuffOnPartyAction(botAI, "thorns") {}
|
||||
};
|
||||
|
||||
class CastThornsOnMainTankAction : public BuffOnMainTankAction
|
||||
{
|
||||
public:
|
||||
CastThornsOnMainTankAction(PlayerbotAI* botAI) : BuffOnMainTankAction(botAI, "thorns", false) {}
|
||||
};
|
||||
|
||||
class CastOmenOfClarityAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastOmenOfClarityAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "omen of clarity") {}
|
||||
};
|
||||
|
||||
class CastWrathAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastWrathAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "wrath") {}
|
||||
};
|
||||
|
||||
class CastStarfallAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastStarfallAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "starfall") {}
|
||||
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
class CastHurricaneAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastHurricaneAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "hurricane") {}
|
||||
ActionThreatType getThreatType() override { return ActionThreatType::Aoe; }
|
||||
};
|
||||
|
||||
class CastMoonfireAction : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastMoonfireAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "moonfire", true) {}
|
||||
};
|
||||
|
||||
class CastInsectSwarmAction : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastInsectSwarmAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "insect swarm", true) {}
|
||||
};
|
||||
|
||||
class CastStarfireAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastStarfireAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "starfire") {}
|
||||
};
|
||||
|
||||
class CastEntanglingRootsAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastEntanglingRootsAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "entangling roots") {}
|
||||
};
|
||||
|
||||
class CastEntanglingRootsCcAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastEntanglingRootsCcAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "entangling roots on cc") {}
|
||||
Value<Unit*>* GetTargetValue() override;
|
||||
bool Execute(Event event) override;
|
||||
};
|
||||
|
||||
class CastHibernateAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastHibernateAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "hibernate") {}
|
||||
};
|
||||
|
||||
class CastHibernateCcAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastHibernateCcAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "hibernate on cc") {}
|
||||
Value<Unit*>* GetTargetValue() override;
|
||||
bool Execute(Event event) override;
|
||||
};
|
||||
|
||||
class CastNaturesGraspAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastNaturesGraspAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "nature's grasp") {}
|
||||
};
|
||||
|
||||
class CastCurePoisonAction : public CastCureSpellAction
|
||||
{
|
||||
public:
|
||||
CastCurePoisonAction(PlayerbotAI* botAI) : CastCureSpellAction(botAI, "cure poison") {}
|
||||
};
|
||||
|
||||
class CastCurePoisonOnPartyAction : public CurePartyMemberAction
|
||||
{
|
||||
public:
|
||||
CastCurePoisonOnPartyAction(PlayerbotAI* botAI) : CurePartyMemberAction(botAI, "cure poison", DISPEL_POISON) {}
|
||||
};
|
||||
|
||||
class CastAbolishPoisonAction : public CastCureSpellAction
|
||||
{
|
||||
public:
|
||||
CastAbolishPoisonAction(PlayerbotAI* botAI) : CastCureSpellAction(botAI, "abolish poison") {}
|
||||
std::vector<NextAction> getAlternatives() override;
|
||||
};
|
||||
|
||||
class CastAbolishPoisonOnPartyAction : public CurePartyMemberAction
|
||||
{
|
||||
public:
|
||||
CastAbolishPoisonOnPartyAction(PlayerbotAI* botAI) : CurePartyMemberAction(botAI, "abolish poison", DISPEL_POISON)
|
||||
{
|
||||
}
|
||||
|
||||
std::vector<NextAction> getAlternatives() override;
|
||||
};
|
||||
|
||||
class CastBarkskinAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastBarkskinAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "barkskin") {}
|
||||
};
|
||||
|
||||
class CastInnervateAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastInnervateAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "innervate") {}
|
||||
|
||||
std::string const GetTargetName() override { return "self target"; }
|
||||
};
|
||||
|
||||
class CastTranquilityAction : public CastAoeHealSpellAction
|
||||
{
|
||||
public:
|
||||
CastTranquilityAction(PlayerbotAI* botAI)
|
||||
: CastAoeHealSpellAction(botAI, "tranquility", 15.0f, HealingManaEfficiency::MEDIUM)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class CastNaturesSwiftnessAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastNaturesSwiftnessAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "nature's swiftness") {}
|
||||
};
|
||||
|
||||
class CastWildGrowthOnPartyAction : public HealPartyMemberAction
|
||||
{
|
||||
public:
|
||||
CastWildGrowthOnPartyAction(PlayerbotAI* ai)
|
||||
: HealPartyMemberAction(ai, "wild growth", 15.0f, HealingManaEfficiency::VERY_HIGH)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class CastPartySwiftmendAction : public HealPartyMemberAction
|
||||
{
|
||||
public:
|
||||
CastPartySwiftmendAction(PlayerbotAI* ai)
|
||||
: HealPartyMemberAction(ai, "swiftmend", 15.0f, HealingManaEfficiency::MEDIUM)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class CastPartyNourishAction : public HealPartyMemberAction
|
||||
{
|
||||
public:
|
||||
CastPartyNourishAction(PlayerbotAI* ai) : HealPartyMemberAction(ai, "nourish", 25.0f, HealingManaEfficiency::LOW) {}
|
||||
};
|
||||
|
||||
class CastDruidRemoveCurseOnPartyAction : public CurePartyMemberAction
|
||||
{
|
||||
public:
|
||||
CastDruidRemoveCurseOnPartyAction(PlayerbotAI* ai) : CurePartyMemberAction(ai, "remove curse", DISPEL_CURSE) {}
|
||||
};
|
||||
|
||||
class CastInsectSwarmOnAttackerAction : public CastDebuffSpellOnAttackerAction
|
||||
{
|
||||
public:
|
||||
CastInsectSwarmOnAttackerAction(PlayerbotAI* ai) : CastDebuffSpellOnAttackerAction(ai, "insect swarm") {}
|
||||
};
|
||||
|
||||
class CastMoonfireOnAttackerAction : public CastDebuffSpellOnAttackerAction
|
||||
{
|
||||
public:
|
||||
CastMoonfireOnAttackerAction(PlayerbotAI* ai) : CastDebuffSpellOnAttackerAction(ai, "moonfire") {}
|
||||
};
|
||||
|
||||
class CastEnrageAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastEnrageAction(PlayerbotAI* ai) : CastBuffSpellAction(ai, "enrage") {}
|
||||
};
|
||||
|
||||
class CastRejuvenationOnNotFullAction : public HealPartyMemberAction
|
||||
{
|
||||
public:
|
||||
CastRejuvenationOnNotFullAction(PlayerbotAI* ai)
|
||||
: HealPartyMemberAction(ai, "rejuvenation", 5.0f, HealingManaEfficiency::VERY_HIGH)
|
||||
{
|
||||
}
|
||||
bool isUseful() override;
|
||||
Unit* GetTarget() override;
|
||||
};
|
||||
|
||||
class CastForceOfNatureAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastForceOfNatureAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "force of nature") {}
|
||||
};
|
||||
|
||||
#endif
|
||||
13
src/Scenario/ClassAi/Druid/Action/DruidBearActions.cpp
Normal file
13
src/Scenario/ClassAi/Druid/Action/DruidBearActions.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* 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 "DruidBearActions.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
bool CastMaulAction::isUseful()
|
||||
{
|
||||
return CastMeleeSpellAction::isUseful() && AI_VALUE2(uint8, "rage", "self target") >= 45;
|
||||
}
|
||||
76
src/Scenario/ClassAi/Druid/Action/DruidBearActions.h
Normal file
76
src/Scenario/ClassAi/Druid/Action/DruidBearActions.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* 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_DRUIDBEARACTIONS_H
|
||||
#define _PLAYERBOT_DRUIDBEARACTIONS_H
|
||||
|
||||
#include "GenericSpellActions.h"
|
||||
#include "ReachTargetActions.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class CastFeralChargeBearAction : public CastReachTargetSpellAction
|
||||
{
|
||||
public:
|
||||
CastFeralChargeBearAction(PlayerbotAI* botAI) : CastReachTargetSpellAction(botAI, "feral charge - bear", 1.5f) {}
|
||||
};
|
||||
|
||||
class CastGrowlAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastGrowlAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "growl") {}
|
||||
};
|
||||
|
||||
class CastMaulAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastMaulAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "maul") {}
|
||||
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
class CastBashAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastBashAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "bash") {}
|
||||
};
|
||||
|
||||
class CastSwipeAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastSwipeAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "swipe") {}
|
||||
};
|
||||
|
||||
class CastDemoralizingRoarAction : public CastMeleeDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastDemoralizingRoarAction(PlayerbotAI* botAI) : CastMeleeDebuffSpellAction(botAI, "demoralizing roar") {}
|
||||
};
|
||||
|
||||
class CastMangleBearAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastMangleBearAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "mangle (bear)") {}
|
||||
};
|
||||
|
||||
class CastSwipeBearAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastSwipeBearAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "swipe (bear)") {}
|
||||
};
|
||||
|
||||
class CastLacerateAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastLacerateAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "lacerate") {}
|
||||
};
|
||||
|
||||
class CastBashOnEnemyHealerAction : public CastSpellOnEnemyHealerAction
|
||||
{
|
||||
public:
|
||||
CastBashOnEnemyHealerAction(PlayerbotAI* botAI) : CastSpellOnEnemyHealerAction(botAI, "bash") {}
|
||||
};
|
||||
|
||||
#endif
|
||||
1
src/Scenario/ClassAi/Druid/Action/DruidCatActions.cpp
Normal file
1
src/Scenario/ClassAi/Druid/Action/DruidCatActions.cpp
Normal file
@@ -0,0 +1 @@
|
||||
#include "DruidCatActions.h"
|
||||
117
src/Scenario/ClassAi/Druid/Action/DruidCatActions.h
Normal file
117
src/Scenario/ClassAi/Druid/Action/DruidCatActions.h
Normal file
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* 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_DRUIDCATACTIONS_H
|
||||
#define _PLAYERBOT_DRUIDCATACTIONS_H
|
||||
|
||||
#include "GenericSpellActions.h"
|
||||
#include "ReachTargetActions.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class CastFeralChargeCatAction : public CastReachTargetSpellAction
|
||||
{
|
||||
public:
|
||||
CastFeralChargeCatAction(PlayerbotAI* botAI) : CastReachTargetSpellAction(botAI, "feral charge - cat", 1.5f) {}
|
||||
};
|
||||
|
||||
class CastCowerAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastCowerAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "cower") {}
|
||||
};
|
||||
|
||||
class CastBerserkAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastBerserkAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "berserk") {}
|
||||
};
|
||||
|
||||
class CastTigersFuryAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastTigersFuryAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "tiger's fury") {}
|
||||
};
|
||||
|
||||
class CastSavageRoarAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastSavageRoarAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "savage roar") {}
|
||||
std::string const GetTargetName() override { return "current target"; }
|
||||
};
|
||||
|
||||
class CastRakeAction : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastRakeAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "rake", true, 6.0f) {}
|
||||
};
|
||||
|
||||
class CastRakeOnMeleeAttackersAction : public CastDebuffSpellOnMeleeAttackerAction
|
||||
{
|
||||
public:
|
||||
CastRakeOnMeleeAttackersAction(PlayerbotAI* botAI) : CastDebuffSpellOnMeleeAttackerAction(botAI, "rake", true, 6.0f) {}
|
||||
};
|
||||
|
||||
class CastClawAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastClawAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "claw") {}
|
||||
};
|
||||
|
||||
class CastMangleCatAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastMangleCatAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "mangle (cat)") {}
|
||||
};
|
||||
|
||||
class CastSwipeCatAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastSwipeCatAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "swipe (cat)") {}
|
||||
};
|
||||
|
||||
class CastFerociousBiteAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastFerociousBiteAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "ferocious bite") {}
|
||||
};
|
||||
|
||||
class CastRipAction : public CastMeleeDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastRipAction(PlayerbotAI* botAI) : CastMeleeDebuffSpellAction(botAI, "rip", true, 12.0f) {}
|
||||
};
|
||||
|
||||
class CastShredAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastShredAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "shred") {}
|
||||
};
|
||||
|
||||
class CastProwlAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastProwlAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "prowl") {}
|
||||
};
|
||||
|
||||
class CastDashAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastDashAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "dash") {}
|
||||
};
|
||||
|
||||
class CastRavageAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastRavageAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "ravage") {}
|
||||
};
|
||||
|
||||
class CastPounceAction : public CastMeleeSpellAction
|
||||
{
|
||||
public:
|
||||
CastPounceAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "pounce") {}
|
||||
};
|
||||
|
||||
#endif
|
||||
62
src/Scenario/ClassAi/Druid/Action/DruidShapeshiftActions.cpp
Normal file
62
src/Scenario/ClassAi/Druid/Action/DruidShapeshiftActions.cpp
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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 "DruidShapeshiftActions.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
bool CastBearFormAction::isPossible()
|
||||
{
|
||||
return CastBuffSpellAction::isPossible() && !botAI->HasAura("dire bear form", GetTarget());
|
||||
}
|
||||
|
||||
bool CastBearFormAction::isUseful()
|
||||
{
|
||||
return CastBuffSpellAction::isUseful() && !botAI->HasAura("dire bear form", GetTarget());
|
||||
}
|
||||
|
||||
std::vector<NextAction> CastDireBearFormAction::getAlternatives()
|
||||
{
|
||||
return NextAction::merge({ NextAction("bear form") },
|
||||
CastSpellAction::getAlternatives());
|
||||
}
|
||||
|
||||
bool CastTravelFormAction::isUseful()
|
||||
{
|
||||
bool firstmount = bot->GetLevel() >= 20;
|
||||
|
||||
// useful if no mount or with wsg flag
|
||||
return !bot->IsMounted() && (!firstmount || (bot->HasAura(23333) || bot->HasAura(23335) || bot->HasAura(34976))) &&
|
||||
!botAI->HasAura("dash", bot);
|
||||
}
|
||||
|
||||
bool CastCasterFormAction::isUseful()
|
||||
{
|
||||
return botAI->HasAnyAuraOf(GetTarget(), "dire bear form", "bear form", "cat form", "travel form", "aquatic form",
|
||||
"flight form", "swift flight form", "moonkin form", nullptr) &&
|
||||
AI_VALUE2(uint8, "mana", "self target") > sPlayerbotAIConfig->mediumHealth;
|
||||
}
|
||||
|
||||
bool CastCasterFormAction::Execute(Event event)
|
||||
{
|
||||
botAI->RemoveShapeshift();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CastCancelTreeFormAction::isUseful()
|
||||
{
|
||||
return botAI->HasAura(33891, bot);
|
||||
}
|
||||
|
||||
bool CastCancelTreeFormAction::Execute(Event event)
|
||||
{
|
||||
botAI->RemoveAura("tree of life");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CastTreeFormAction::isUseful()
|
||||
{
|
||||
return GetTarget() && CastSpellAction::isUseful() && !botAI->HasAura(33891, bot);
|
||||
}
|
||||
83
src/Scenario/ClassAi/Druid/Action/DruidShapeshiftActions.h
Normal file
83
src/Scenario/ClassAi/Druid/Action/DruidShapeshiftActions.h
Normal file
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* 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_DRUIDSHAPESHIFTACTIONS_H
|
||||
#define _PLAYERBOT_DRUIDSHAPESHIFTACTIONS_H
|
||||
|
||||
#include "GenericSpellActions.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class CastBearFormAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastBearFormAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "bear form") {}
|
||||
|
||||
bool isPossible() override;
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
class CastDireBearFormAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastDireBearFormAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "dire bear form") {}
|
||||
|
||||
std::vector<NextAction> getAlternatives() override;
|
||||
};
|
||||
|
||||
class CastCatFormAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastCatFormAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "cat form") {}
|
||||
};
|
||||
|
||||
class CastTreeFormAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastTreeFormAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "tree of life") {}
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
class CastMoonkinFormAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastMoonkinFormAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "moonkin form") {}
|
||||
};
|
||||
|
||||
class CastAquaticFormAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastAquaticFormAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "aquatic form") {}
|
||||
};
|
||||
|
||||
class CastTravelFormAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastTravelFormAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "travel form") {}
|
||||
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
class CastCasterFormAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastCasterFormAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "caster form") {}
|
||||
|
||||
bool isUseful() override;
|
||||
bool isPossible() override { return true; }
|
||||
bool Execute(Event event) override;
|
||||
};
|
||||
|
||||
class CastCancelTreeFormAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastCancelTreeFormAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "cancel tree form") {}
|
||||
|
||||
bool isUseful() override;
|
||||
bool isPossible() override { return true; }
|
||||
bool Execute(Event event) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
369
src/Scenario/ClassAi/Druid/DruidAiObjectContext.cpp
Normal file
369
src/Scenario/ClassAi/Druid/DruidAiObjectContext.cpp
Normal file
@@ -0,0 +1,369 @@
|
||||
/*
|
||||
* 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 "DruidAiObjectContext.h"
|
||||
|
||||
#include "BearTankDruidStrategy.h"
|
||||
#include "CasterDruidStrategy.h"
|
||||
#include "CatDpsDruidStrategy.h"
|
||||
#include "DruidActions.h"
|
||||
#include "DruidBearActions.h"
|
||||
#include "DruidCatActions.h"
|
||||
#include "DruidShapeshiftActions.h"
|
||||
#include "DruidTriggers.h"
|
||||
#include "GenericDruidNonCombatStrategy.h"
|
||||
#include "GenericDruidStrategy.h"
|
||||
#include "HealDruidStrategy.h"
|
||||
#include "MeleeDruidStrategy.h"
|
||||
#include "OffhealDruidCatStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
class DruidStrategyFactoryInternal : public NamedObjectContext<Strategy>
|
||||
{
|
||||
public:
|
||||
DruidStrategyFactoryInternal()
|
||||
{
|
||||
creators["nc"] = &DruidStrategyFactoryInternal::nc;
|
||||
creators["cat aoe"] = &DruidStrategyFactoryInternal::cat_aoe;
|
||||
creators["caster aoe"] = &DruidStrategyFactoryInternal::caster_aoe;
|
||||
creators["caster debuff"] = &DruidStrategyFactoryInternal::caster_debuff;
|
||||
creators["dps debuff"] = &DruidStrategyFactoryInternal::caster_debuff;
|
||||
creators["cure"] = &DruidStrategyFactoryInternal::cure;
|
||||
creators["melee"] = &DruidStrategyFactoryInternal::melee;
|
||||
creators["buff"] = &DruidStrategyFactoryInternal::buff;
|
||||
creators["boost"] = &DruidStrategyFactoryInternal::boost;
|
||||
creators["cc"] = &DruidStrategyFactoryInternal::cc;
|
||||
creators["healer dps"] = &DruidStrategyFactoryInternal::healer_dps;
|
||||
}
|
||||
|
||||
private:
|
||||
static Strategy* nc(PlayerbotAI* botAI) { return new GenericDruidNonCombatStrategy(botAI); }
|
||||
static Strategy* cat_aoe(PlayerbotAI* botAI) { return new CatAoeDruidStrategy(botAI); }
|
||||
static Strategy* caster_aoe(PlayerbotAI* botAI) { return new CasterDruidAoeStrategy(botAI); }
|
||||
static Strategy* caster_debuff(PlayerbotAI* botAI) { return new CasterDruidDebuffStrategy(botAI); }
|
||||
static Strategy* cure(PlayerbotAI* botAI) { return new DruidCureStrategy(botAI); }
|
||||
static Strategy* melee(PlayerbotAI* botAI) { return new MeleeDruidStrategy(botAI); }
|
||||
static Strategy* buff(PlayerbotAI* botAI) { return new GenericDruidBuffStrategy(botAI); }
|
||||
static Strategy* boost(PlayerbotAI* botAI) { return new DruidBoostStrategy(botAI); }
|
||||
static Strategy* cc(PlayerbotAI* botAI) { return new DruidCcStrategy(botAI); }
|
||||
static Strategy* healer_dps(PlayerbotAI* botAI) { return new DruidHealerDpsStrategy(botAI); }
|
||||
};
|
||||
|
||||
class DruidDruidStrategyFactoryInternal : public NamedObjectContext<Strategy>
|
||||
{
|
||||
public:
|
||||
DruidDruidStrategyFactoryInternal() : NamedObjectContext<Strategy>(false, true)
|
||||
{
|
||||
creators["bear"] = &DruidDruidStrategyFactoryInternal::bear;
|
||||
creators["tank"] = &DruidDruidStrategyFactoryInternal::bear;
|
||||
creators["cat"] = &DruidDruidStrategyFactoryInternal::cat;
|
||||
creators["caster"] = &DruidDruidStrategyFactoryInternal::caster;
|
||||
creators["dps"] = &DruidDruidStrategyFactoryInternal::cat;
|
||||
creators["heal"] = &DruidDruidStrategyFactoryInternal::heal;
|
||||
creators["offheal"] = &DruidDruidStrategyFactoryInternal::offheal;
|
||||
}
|
||||
|
||||
private:
|
||||
static Strategy* bear(PlayerbotAI* botAI) { return new BearTankDruidStrategy(botAI); }
|
||||
static Strategy* cat(PlayerbotAI* botAI) { return new CatDpsDruidStrategy(botAI); }
|
||||
static Strategy* caster(PlayerbotAI* botAI) { return new CasterDruidStrategy(botAI); }
|
||||
static Strategy* heal(PlayerbotAI* botAI) { return new HealDruidStrategy(botAI); }
|
||||
static Strategy* offheal(PlayerbotAI* botAI) { return new OffhealDruidCatStrategy(botAI); }
|
||||
};
|
||||
|
||||
class DruidTriggerFactoryInternal : public NamedObjectContext<Trigger>
|
||||
{
|
||||
public:
|
||||
DruidTriggerFactoryInternal()
|
||||
{
|
||||
creators["omen of clarity"] = &DruidTriggerFactoryInternal::omen_of_clarity;
|
||||
creators["thorns"] = &DruidTriggerFactoryInternal::thorns;
|
||||
creators["thorns on party"] = &DruidTriggerFactoryInternal::thorns_on_party;
|
||||
creators["thorns on main tank"] = &DruidTriggerFactoryInternal::thorns_on_main_tank;
|
||||
creators["bash"] = &DruidTriggerFactoryInternal::bash;
|
||||
creators["faerie fire (feral)"] = &DruidTriggerFactoryInternal::faerie_fire_feral;
|
||||
creators["faerie fire"] = &DruidTriggerFactoryInternal::faerie_fire;
|
||||
creators["insect swarm"] = &DruidTriggerFactoryInternal::insect_swarm;
|
||||
creators["moonfire"] = &DruidTriggerFactoryInternal::moonfire;
|
||||
creators["nature's grasp"] = &DruidTriggerFactoryInternal::natures_grasp;
|
||||
creators["tiger's fury"] = &DruidTriggerFactoryInternal::tigers_fury;
|
||||
creators["berserk"] = &DruidTriggerFactoryInternal::berserk;
|
||||
creators["savage roar"] = &DruidTriggerFactoryInternal::savage_roar;
|
||||
creators["rake"] = &DruidTriggerFactoryInternal::rake;
|
||||
creators["mark of the wild"] = &DruidTriggerFactoryInternal::mark_of_the_wild;
|
||||
creators["mark of the wild on party"] = &DruidTriggerFactoryInternal::mark_of_the_wild_on_party;
|
||||
creators["cure poison"] = &DruidTriggerFactoryInternal::cure_poison;
|
||||
creators["party member cure poison"] = &DruidTriggerFactoryInternal::party_member_cure_poison;
|
||||
creators["entangling roots"] = &DruidTriggerFactoryInternal::entangling_roots;
|
||||
creators["entangling roots kite"] = &DruidTriggerFactoryInternal::entangling_roots_kite;
|
||||
creators["hibernate"] = &DruidTriggerFactoryInternal::hibernate;
|
||||
creators["bear form"] = &DruidTriggerFactoryInternal::bear_form;
|
||||
creators["cat form"] = &DruidTriggerFactoryInternal::cat_form;
|
||||
creators["tree form"] = &DruidTriggerFactoryInternal::tree_form;
|
||||
creators["eclipse (solar)"] = &DruidTriggerFactoryInternal::eclipse_solar;
|
||||
creators["eclipse (lunar)"] = &DruidTriggerFactoryInternal::eclipse_lunar;
|
||||
creators["bash on enemy healer"] = &DruidTriggerFactoryInternal::bash_on_enemy_healer;
|
||||
creators["nature's swiftness"] = &DruidTriggerFactoryInternal::natures_swiftness;
|
||||
creators["party member remove curse"] = &DruidTriggerFactoryInternal::party_member_remove_curse;
|
||||
creators["eclipse (solar) cooldown"] = &DruidTriggerFactoryInternal::eclipse_solar_cooldown;
|
||||
creators["eclipse (lunar) cooldown"] = &DruidTriggerFactoryInternal::eclipse_lunar_cooldown;
|
||||
creators["mangle (cat)"] = &DruidTriggerFactoryInternal::mangle_cat;
|
||||
creators["ferocious bite time"] = &DruidTriggerFactoryInternal::ferocious_bite_time;
|
||||
creators["hurricane channel check"] = &DruidTriggerFactoryInternal::hurricane_channel_check;
|
||||
}
|
||||
|
||||
private:
|
||||
static Trigger* natures_swiftness(PlayerbotAI* botAI) { return new NaturesSwiftnessTrigger(botAI); }
|
||||
static Trigger* eclipse_solar(PlayerbotAI* botAI) { return new EclipseSolarTrigger(botAI); }
|
||||
static Trigger* eclipse_lunar(PlayerbotAI* botAI) { return new EclipseLunarTrigger(botAI); }
|
||||
static Trigger* thorns(PlayerbotAI* botAI) { return new ThornsTrigger(botAI); }
|
||||
static Trigger* thorns_on_party(PlayerbotAI* botAI) { return new ThornsOnPartyTrigger(botAI); }
|
||||
static Trigger* thorns_on_main_tank(PlayerbotAI* botAI) { return new ThornsOnMainTankTrigger(botAI); }
|
||||
static Trigger* bash(PlayerbotAI* botAI) { return new BashInterruptSpellTrigger(botAI); }
|
||||
static Trigger* faerie_fire_feral(PlayerbotAI* botAI) { return new FaerieFireFeralTrigger(botAI); }
|
||||
static Trigger* insect_swarm(PlayerbotAI* botAI) { return new InsectSwarmTrigger(botAI); }
|
||||
static Trigger* moonfire(PlayerbotAI* botAI) { return new MoonfireTrigger(botAI); }
|
||||
static Trigger* faerie_fire(PlayerbotAI* botAI) { return new FaerieFireTrigger(botAI); }
|
||||
static Trigger* natures_grasp(PlayerbotAI* botAI) { return new NaturesGraspTrigger(botAI); }
|
||||
static Trigger* tigers_fury(PlayerbotAI* botAI) { return new TigersFuryTrigger(botAI); }
|
||||
static Trigger* berserk(PlayerbotAI* botAI) { return new BerserkTrigger(botAI); }
|
||||
static Trigger* savage_roar(PlayerbotAI* botAI) { return new SavageRoarTrigger(botAI); }
|
||||
static Trigger* rake(PlayerbotAI* botAI) { return new RakeTrigger(botAI); }
|
||||
static Trigger* mark_of_the_wild(PlayerbotAI* botAI) { return new MarkOfTheWildTrigger(botAI); }
|
||||
static Trigger* mark_of_the_wild_on_party(PlayerbotAI* botAI) { return new MarkOfTheWildOnPartyTrigger(botAI); }
|
||||
static Trigger* cure_poison(PlayerbotAI* botAI) { return new CurePoisonTrigger(botAI); }
|
||||
static Trigger* party_member_cure_poison(PlayerbotAI* botAI) { return new PartyMemberCurePoisonTrigger(botAI); }
|
||||
static Trigger* entangling_roots(PlayerbotAI* botAI) { return new EntanglingRootsTrigger(botAI); }
|
||||
static Trigger* entangling_roots_kite(PlayerbotAI* botAI) { return new EntanglingRootsKiteTrigger(botAI); }
|
||||
static Trigger* hibernate(PlayerbotAI* botAI) { return new HibernateTrigger(botAI); }
|
||||
static Trigger* bear_form(PlayerbotAI* botAI) { return new BearFormTrigger(botAI); }
|
||||
static Trigger* cat_form(PlayerbotAI* botAI) { return new CatFormTrigger(botAI); }
|
||||
static Trigger* tree_form(PlayerbotAI* botAI) { return new TreeFormTrigger(botAI); }
|
||||
static Trigger* bash_on_enemy_healer(PlayerbotAI* botAI) { return new BashInterruptEnemyHealerSpellTrigger(botAI); }
|
||||
static Trigger* omen_of_clarity(PlayerbotAI* botAI) { return new OmenOfClarityTrigger(botAI); }
|
||||
static Trigger* party_member_remove_curse(PlayerbotAI* ai) { return new DruidPartyMemberRemoveCurseTrigger(ai); }
|
||||
static Trigger* eclipse_solar_cooldown(PlayerbotAI* ai) { return new EclipseSolarCooldownTrigger(ai); }
|
||||
static Trigger* eclipse_lunar_cooldown(PlayerbotAI* ai) { return new EclipseLunarCooldownTrigger(ai); }
|
||||
static Trigger* mangle_cat(PlayerbotAI* ai) { return new MangleCatTrigger(ai); }
|
||||
static Trigger* ferocious_bite_time(PlayerbotAI* ai) { return new FerociousBiteTimeTrigger(ai); }
|
||||
static Trigger* hurricane_channel_check(PlayerbotAI* ai) { return new HurricaneChannelCheckTrigger(ai); }
|
||||
};
|
||||
|
||||
class DruidAiObjectContextInternal : public NamedObjectContext<Action>
|
||||
{
|
||||
public:
|
||||
DruidAiObjectContextInternal()
|
||||
{
|
||||
creators["feral charge - bear"] = &DruidAiObjectContextInternal::feral_charge_bear;
|
||||
creators["feral charge - cat"] = &DruidAiObjectContextInternal::feral_charge_cat;
|
||||
creators["swipe (bear)"] = &DruidAiObjectContextInternal::swipe_bear;
|
||||
creators["faerie fire (feral)"] = &DruidAiObjectContextInternal::faerie_fire_feral;
|
||||
creators["faerie fire"] = &DruidAiObjectContextInternal::faerie_fire;
|
||||
creators["bear form"] = &DruidAiObjectContextInternal::bear_form;
|
||||
creators["dire bear form"] = &DruidAiObjectContextInternal::dire_bear_form;
|
||||
creators["moonkin form"] = &DruidAiObjectContextInternal::moonkin_form;
|
||||
creators["cat form"] = &DruidAiObjectContextInternal::cat_form;
|
||||
creators["tree form"] = &DruidAiObjectContextInternal::tree_form;
|
||||
creators["travel form"] = &DruidAiObjectContextInternal::travel_form;
|
||||
creators["aquatic form"] = &DruidAiObjectContextInternal::aquatic_form;
|
||||
creators["caster form"] = &DruidAiObjectContextInternal::caster_form;
|
||||
creators["cancel tree form"] = &DruidAiObjectContextInternal::cancel_tree_form;
|
||||
creators["mangle (bear)"] = &DruidAiObjectContextInternal::mangle_bear;
|
||||
creators["maul"] = &DruidAiObjectContextInternal::maul;
|
||||
creators["bash"] = &DruidAiObjectContextInternal::bash;
|
||||
creators["swipe"] = &DruidAiObjectContextInternal::swipe;
|
||||
creators["growl"] = &DruidAiObjectContextInternal::growl;
|
||||
creators["demoralizing roar"] = &DruidAiObjectContextInternal::demoralizing_roar;
|
||||
creators["hibernate"] = &DruidAiObjectContextInternal::hibernate;
|
||||
creators["entangling roots"] = &DruidAiObjectContextInternal::entangling_roots;
|
||||
creators["entangling roots on cc"] = &DruidAiObjectContextInternal::entangling_roots_on_cc;
|
||||
creators["hibernate"] = &DruidAiObjectContextInternal::hibernate;
|
||||
creators["hibernate on cc"] = &DruidAiObjectContextInternal::hibernate_on_cc;
|
||||
creators["wrath"] = &DruidAiObjectContextInternal::wrath;
|
||||
creators["starfall"] = &DruidAiObjectContextInternal::starfall;
|
||||
creators["insect swarm"] = &DruidAiObjectContextInternal::insect_swarm;
|
||||
creators["moonfire"] = &DruidAiObjectContextInternal::moonfire;
|
||||
creators["starfire"] = &DruidAiObjectContextInternal::starfire;
|
||||
creators["nature's grasp"] = &DruidAiObjectContextInternal::natures_grasp;
|
||||
creators["claw"] = &DruidAiObjectContextInternal::claw;
|
||||
creators["mangle (cat)"] = &DruidAiObjectContextInternal::mangle_cat;
|
||||
creators["swipe (cat)"] = &DruidAiObjectContextInternal::swipe_cat;
|
||||
creators["rake"] = &DruidAiObjectContextInternal::rake;
|
||||
creators["rake on attacker"] = &DruidAiObjectContextInternal::rake_on_attacker;
|
||||
creators["ferocious bite"] = &DruidAiObjectContextInternal::ferocious_bite;
|
||||
creators["rip"] = &DruidAiObjectContextInternal::rip;
|
||||
creators["cower"] = &DruidAiObjectContextInternal::cower;
|
||||
creators["survival instincts"] = &DruidAiObjectContextInternal::survival_instincts;
|
||||
creators["frenzied regeneration"] = &DruidAiObjectContextInternal::frenzied_regeneration;
|
||||
creators["thorns"] = &DruidAiObjectContextInternal::thorns;
|
||||
creators["thorns on party"] = &DruidAiObjectContextInternal::thorns_on_party;
|
||||
creators["thorns on main tank"] = &DruidAiObjectContextInternal::thorns_on_main_tank;
|
||||
creators["cure poison"] = &DruidAiObjectContextInternal::cure_poison;
|
||||
creators["cure poison on party"] = &DruidAiObjectContextInternal::cure_poison_on_party;
|
||||
creators["abolish poison"] = &DruidAiObjectContextInternal::abolish_poison;
|
||||
creators["abolish poison on party"] = &DruidAiObjectContextInternal::abolish_poison_on_party;
|
||||
creators["berserk"] = &DruidAiObjectContextInternal::berserk;
|
||||
creators["tiger's fury"] = &DruidAiObjectContextInternal::tigers_fury;
|
||||
creators["savage roar"] = &DruidAiObjectContextInternal::savage_roar;
|
||||
creators["mark of the wild"] = &DruidAiObjectContextInternal::mark_of_the_wild;
|
||||
creators["mark of the wild on party"] = &DruidAiObjectContextInternal::mark_of_the_wild_on_party;
|
||||
creators["regrowth"] = &DruidAiObjectContextInternal::regrowth;
|
||||
creators["rejuvenation"] = &DruidAiObjectContextInternal::rejuvenation;
|
||||
creators["healing touch"] = &DruidAiObjectContextInternal::healing_touch;
|
||||
creators["regrowth on party"] = &DruidAiObjectContextInternal::regrowth_on_party;
|
||||
creators["rejuvenation on party"] = &DruidAiObjectContextInternal::rejuvenation_on_party;
|
||||
creators["rejuvenation on not full"] = &DruidAiObjectContextInternal::rejuvenation_on_not_full;
|
||||
creators["healing touch on party"] = &DruidAiObjectContextInternal::healing_touch_on_party;
|
||||
creators["rebirth"] = &DruidAiObjectContextInternal::rebirth;
|
||||
creators["revive"] = &DruidAiObjectContextInternal::revive;
|
||||
creators["barkskin"] = &DruidAiObjectContextInternal::barkskin;
|
||||
creators["lacerate"] = &DruidAiObjectContextInternal::lacerate;
|
||||
creators["hurricane"] = &DruidAiObjectContextInternal::hurricane;
|
||||
creators["innervate"] = &DruidAiObjectContextInternal::innervate;
|
||||
creators["tranquility"] = &DruidAiObjectContextInternal::tranquility;
|
||||
creators["bash on enemy healer"] = &DruidAiObjectContextInternal::bash_on_enemy_healer;
|
||||
creators["omen of clarity"] = &DruidAiObjectContextInternal::omen_of_clarity;
|
||||
creators["nature's swiftness"] = &DruidAiObjectContextInternal::natures_swiftness;
|
||||
creators["prowl"] = &DruidAiObjectContextInternal::prowl;
|
||||
creators["dash"] = &DruidAiObjectContextInternal::dash;
|
||||
creators["shred"] = &DruidAiObjectContextInternal::shred;
|
||||
creators["ravage"] = &DruidAiObjectContextInternal::ravage;
|
||||
creators["pounce"] = &DruidAiObjectContextInternal::pounce;
|
||||
creators["wild growth on party"] = &DruidAiObjectContextInternal::wild_growth_on_party;
|
||||
creators["swiftmend on party"] = &DruidAiObjectContextInternal::swiftmend_on_party;
|
||||
creators["nourish on party"] = &DruidAiObjectContextInternal::nourish_on_party;
|
||||
creators["remove curse on party"] = &DruidAiObjectContextInternal::remove_curse_on_party;
|
||||
creators["insect swarm on attacker"] = &DruidAiObjectContextInternal::insect_swarm_on_attacker;
|
||||
creators["moonfire on attacker"] = &DruidAiObjectContextInternal::moonfire_on_attacker;
|
||||
creators["enrage"] = &DruidAiObjectContextInternal::enrage;
|
||||
creators["force of nature"] = &DruidAiObjectContextInternal::force_of_nature;
|
||||
}
|
||||
|
||||
private:
|
||||
static Action* natures_swiftness(PlayerbotAI* botAI) { return new CastNaturesSwiftnessAction(botAI); }
|
||||
static Action* omen_of_clarity(PlayerbotAI* botAI) { return new CastOmenOfClarityAction(botAI); }
|
||||
static Action* tranquility(PlayerbotAI* botAI) { return new CastTranquilityAction(botAI); }
|
||||
static Action* feral_charge_bear(PlayerbotAI* botAI) { return new CastFeralChargeBearAction(botAI); }
|
||||
static Action* feral_charge_cat(PlayerbotAI* botAI) { return new CastFeralChargeCatAction(botAI); }
|
||||
static Action* swipe_bear(PlayerbotAI* botAI) { return new CastSwipeBearAction(botAI); }
|
||||
static Action* faerie_fire_feral(PlayerbotAI* botAI) { return new CastFaerieFireFeralAction(botAI); }
|
||||
static Action* faerie_fire(PlayerbotAI* botAI) { return new CastFaerieFireAction(botAI); }
|
||||
static Action* bear_form(PlayerbotAI* botAI) { return new CastBearFormAction(botAI); }
|
||||
static Action* dire_bear_form(PlayerbotAI* botAI) { return new CastDireBearFormAction(botAI); }
|
||||
static Action* cat_form(PlayerbotAI* botAI) { return new CastCatFormAction(botAI); }
|
||||
static Action* tree_form(PlayerbotAI* botAI) { return new CastTreeFormAction(botAI); }
|
||||
static Action* travel_form(PlayerbotAI* botAI) { return new CastTravelFormAction(botAI); }
|
||||
static Action* aquatic_form(PlayerbotAI* botAI) { return new CastAquaticFormAction(botAI); }
|
||||
static Action* caster_form(PlayerbotAI* botAI) { return new CastCasterFormAction(botAI); }
|
||||
static Action* cancel_tree_form(PlayerbotAI* botAI) { return new CastCancelTreeFormAction(botAI); }
|
||||
static Action* mangle_bear(PlayerbotAI* botAI) { return new CastMangleBearAction(botAI); }
|
||||
static Action* maul(PlayerbotAI* botAI) { return new CastMaulAction(botAI); }
|
||||
static Action* bash(PlayerbotAI* botAI) { return new CastBashAction(botAI); }
|
||||
static Action* swipe(PlayerbotAI* botAI) { return new CastSwipeAction(botAI); }
|
||||
static Action* growl(PlayerbotAI* botAI) { return new CastGrowlAction(botAI); }
|
||||
static Action* demoralizing_roar(PlayerbotAI* botAI) { return new CastDemoralizingRoarAction(botAI); }
|
||||
static Action* moonkin_form(PlayerbotAI* botAI) { return new CastMoonkinFormAction(botAI); }
|
||||
static Action* hibernate(PlayerbotAI* botAI) { return new CastHibernateAction(botAI); }
|
||||
static Action* entangling_roots(PlayerbotAI* botAI) { return new CastEntanglingRootsAction(botAI); }
|
||||
static Action* hibernate_on_cc(PlayerbotAI* botAI) { return new CastHibernateCcAction(botAI); }
|
||||
static Action* entangling_roots_on_cc(PlayerbotAI* botAI) { return new CastEntanglingRootsCcAction(botAI); }
|
||||
static Action* wrath(PlayerbotAI* botAI) { return new CastWrathAction(botAI); }
|
||||
static Action* starfall(PlayerbotAI* botAI) { return new CastStarfallAction(botAI); }
|
||||
static Action* insect_swarm(PlayerbotAI* botAI) { return new CastInsectSwarmAction(botAI); }
|
||||
static Action* moonfire(PlayerbotAI* botAI) { return new CastMoonfireAction(botAI); }
|
||||
static Action* starfire(PlayerbotAI* botAI) { return new CastStarfireAction(botAI); }
|
||||
static Action* natures_grasp(PlayerbotAI* botAI) { return new CastNaturesGraspAction(botAI); }
|
||||
static Action* claw(PlayerbotAI* botAI) { return new CastClawAction(botAI); }
|
||||
static Action* mangle_cat(PlayerbotAI* botAI) { return new CastMangleCatAction(botAI); }
|
||||
static Action* swipe_cat(PlayerbotAI* botAI) { return new CastSwipeCatAction(botAI); }
|
||||
static Action* rake(PlayerbotAI* botAI) { return new CastRakeAction(botAI); }
|
||||
static Action* rake_on_attacker(PlayerbotAI* botAI) { return new CastRakeOnMeleeAttackersAction(botAI); }
|
||||
static Action* ferocious_bite(PlayerbotAI* botAI) { return new CastFerociousBiteAction(botAI); }
|
||||
static Action* rip(PlayerbotAI* botAI) { return new CastRipAction(botAI); }
|
||||
static Action* cower(PlayerbotAI* botAI) { return new CastCowerAction(botAI); }
|
||||
static Action* survival_instincts(PlayerbotAI* botAI) { return new CastSurvivalInstinctsAction(botAI); }
|
||||
static Action* frenzied_regeneration(PlayerbotAI* botAI) { return new CastFrenziedRegenerationAction(botAI); }
|
||||
static Action* thorns(PlayerbotAI* botAI) { return new CastThornsAction(botAI); }
|
||||
static Action* thorns_on_party(PlayerbotAI* botAI) { return new CastThornsOnPartyAction(botAI); }
|
||||
static Action* thorns_on_main_tank(PlayerbotAI* botAI) { return new CastThornsOnMainTankAction(botAI); }
|
||||
static Action* cure_poison(PlayerbotAI* botAI) { return new CastCurePoisonAction(botAI); }
|
||||
static Action* cure_poison_on_party(PlayerbotAI* botAI) { return new CastCurePoisonOnPartyAction(botAI); }
|
||||
static Action* abolish_poison(PlayerbotAI* botAI) { return new CastAbolishPoisonAction(botAI); }
|
||||
static Action* abolish_poison_on_party(PlayerbotAI* botAI) { return new CastAbolishPoisonOnPartyAction(botAI); }
|
||||
static Action* berserk(PlayerbotAI* botAI) { return new CastBerserkAction(botAI); }
|
||||
static Action* tigers_fury(PlayerbotAI* botAI) { return new CastTigersFuryAction(botAI); }
|
||||
static Action* savage_roar(PlayerbotAI* botAI) { return new CastSavageRoarAction(botAI); }
|
||||
static Action* mark_of_the_wild(PlayerbotAI* botAI) { return new CastMarkOfTheWildAction(botAI); }
|
||||
static Action* mark_of_the_wild_on_party(PlayerbotAI* botAI) { return new CastMarkOfTheWildOnPartyAction(botAI); }
|
||||
static Action* regrowth(PlayerbotAI* botAI) { return new CastRegrowthAction(botAI); }
|
||||
static Action* rejuvenation(PlayerbotAI* botAI) { return new CastRejuvenationAction(botAI); }
|
||||
static Action* healing_touch(PlayerbotAI* botAI) { return new CastHealingTouchAction(botAI); }
|
||||
static Action* regrowth_on_party(PlayerbotAI* botAI) { return new CastRegrowthOnPartyAction(botAI); }
|
||||
static Action* rejuvenation_on_party(PlayerbotAI* botAI) { return new CastRejuvenationOnPartyAction(botAI); }
|
||||
static Action* rejuvenation_on_not_full(PlayerbotAI* botAI) { return new CastRejuvenationOnNotFullAction(botAI); }
|
||||
static Action* healing_touch_on_party(PlayerbotAI* botAI) { return new CastHealingTouchOnPartyAction(botAI); }
|
||||
static Action* rebirth(PlayerbotAI* botAI) { return new CastRebirthAction(botAI); }
|
||||
static Action* revive(PlayerbotAI* botAI) { return new CastReviveAction(botAI); }
|
||||
static Action* barkskin(PlayerbotAI* botAI) { return new CastBarkskinAction(botAI); }
|
||||
static Action* lacerate(PlayerbotAI* botAI) { return new CastLacerateAction(botAI); }
|
||||
static Action* hurricane(PlayerbotAI* botAI) { return new CastHurricaneAction(botAI); }
|
||||
static Action* innervate(PlayerbotAI* botAI) { return new CastInnervateAction(botAI); }
|
||||
static Action* bash_on_enemy_healer(PlayerbotAI* botAI) { return new CastBashOnEnemyHealerAction(botAI); }
|
||||
static Action* ravage(PlayerbotAI* botAI) { return new CastRavageAction(botAI); }
|
||||
static Action* pounce(PlayerbotAI* botAI) { return new CastPounceAction(botAI); }
|
||||
static Action* prowl(PlayerbotAI* botAI) { return new CastProwlAction(botAI); }
|
||||
static Action* dash(PlayerbotAI* botAI) { return new CastDashAction(botAI); }
|
||||
static Action* shred(PlayerbotAI* botAI) { return new CastShredAction(botAI); }
|
||||
static Action* wild_growth_on_party(PlayerbotAI* ai) { return new CastWildGrowthOnPartyAction(ai); }
|
||||
static Action* swiftmend_on_party(PlayerbotAI* ai) { return new CastPartySwiftmendAction(ai); }
|
||||
static Action* nourish_on_party(PlayerbotAI* ai) { return new CastPartyNourishAction(ai); }
|
||||
static Action* remove_curse_on_party(PlayerbotAI* ai) { return new CastDruidRemoveCurseOnPartyAction(ai); }
|
||||
static Action* insect_swarm_on_attacker(PlayerbotAI* ai) { return new CastInsectSwarmOnAttackerAction(ai); }
|
||||
static Action* moonfire_on_attacker(PlayerbotAI* ai) { return new CastMoonfireOnAttackerAction(ai); }
|
||||
static Action* enrage(PlayerbotAI* ai) { return new CastEnrageAction(ai); }
|
||||
static Action* force_of_nature(PlayerbotAI* ai) { return new CastForceOfNatureAction(ai); }
|
||||
};
|
||||
|
||||
SharedNamedObjectContextList<Strategy> DruidAiObjectContext::sharedStrategyContexts;
|
||||
SharedNamedObjectContextList<Action> DruidAiObjectContext::sharedActionContexts;
|
||||
SharedNamedObjectContextList<Trigger> DruidAiObjectContext::sharedTriggerContexts;
|
||||
SharedNamedObjectContextList<UntypedValue> DruidAiObjectContext::sharedValueContexts;
|
||||
|
||||
DruidAiObjectContext::DruidAiObjectContext(PlayerbotAI* botAI)
|
||||
: AiObjectContext(botAI, sharedStrategyContexts, sharedActionContexts, sharedTriggerContexts, sharedValueContexts)
|
||||
{
|
||||
}
|
||||
|
||||
void DruidAiObjectContext::BuildSharedContexts()
|
||||
{
|
||||
BuildSharedStrategyContexts(sharedStrategyContexts);
|
||||
BuildSharedActionContexts(sharedActionContexts);
|
||||
BuildSharedTriggerContexts(sharedTriggerContexts);
|
||||
BuildSharedValueContexts(sharedValueContexts);
|
||||
}
|
||||
|
||||
void DruidAiObjectContext::BuildSharedStrategyContexts(SharedNamedObjectContextList<Strategy>& strategyContexts)
|
||||
{
|
||||
AiObjectContext::BuildSharedStrategyContexts(strategyContexts);
|
||||
strategyContexts.Add(new DruidStrategyFactoryInternal());
|
||||
strategyContexts.Add(new DruidDruidStrategyFactoryInternal());
|
||||
}
|
||||
|
||||
void DruidAiObjectContext::BuildSharedActionContexts(SharedNamedObjectContextList<Action>& actionContexts)
|
||||
{
|
||||
AiObjectContext::BuildSharedActionContexts(actionContexts);
|
||||
actionContexts.Add(new DruidAiObjectContextInternal());
|
||||
}
|
||||
|
||||
void DruidAiObjectContext::BuildSharedTriggerContexts(SharedNamedObjectContextList<Trigger>& triggerContexts)
|
||||
{
|
||||
AiObjectContext::BuildSharedTriggerContexts(triggerContexts);
|
||||
triggerContexts.Add(new DruidTriggerFactoryInternal());
|
||||
}
|
||||
|
||||
void DruidAiObjectContext::BuildSharedValueContexts(SharedNamedObjectContextList<UntypedValue>& valueContexts)
|
||||
{
|
||||
AiObjectContext::BuildSharedValueContexts(valueContexts);
|
||||
}
|
||||
30
src/Scenario/ClassAi/Druid/DruidAiObjectContext.h
Normal file
30
src/Scenario/ClassAi/Druid/DruidAiObjectContext.h
Normal 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_DRUIDAIOBJECTCONTEXT_H
|
||||
#define _PLAYERBOT_DRUIDAIOBJECTCONTEXT_H
|
||||
|
||||
#include "AiObjectContext.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class DruidAiObjectContext : public AiObjectContext
|
||||
{
|
||||
public:
|
||||
DruidAiObjectContext(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
|
||||
256
src/Scenario/ClassAi/Druid/Strategy/BearTankDruidStrategy.cpp
Normal file
256
src/Scenario/ClassAi/Druid/Strategy/BearTankDruidStrategy.cpp
Normal file
@@ -0,0 +1,256 @@
|
||||
/*
|
||||
* 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 "BearTankDruidStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
class BearTankDruidStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
BearTankDruidStrategyActionNodeFactory()
|
||||
{
|
||||
creators["melee"] = &melee;
|
||||
creators["feral charge - bear"] = &feral_charge_bear;
|
||||
creators["swipe (bear)"] = &swipe_bear;
|
||||
creators["faerie fire (feral)"] = &faerie_fire_feral;
|
||||
creators["bear form"] = &bear_form;
|
||||
creators["dire bear form"] = &dire_bear_form;
|
||||
creators["mangle (bear)"] = &mangle_bear;
|
||||
creators["maul"] = &maul;
|
||||
creators["bash"] = &bash;
|
||||
creators["swipe"] = &swipe;
|
||||
creators["lacerate"] = &lacerate;
|
||||
creators["demoralizing roar"] = &demoralizing_roar;
|
||||
creators["taunt spell"] = &growl;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* melee([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"melee",
|
||||
/*P*/ { NextAction("feral charge - bear") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* feral_charge_bear([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"feral charge - bear",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("reach melee") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* swipe_bear([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"swipe (bear)",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* faerie_fire_feral([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"faerie fire (feral)",
|
||||
/*P*/ { NextAction("feral charge - bear") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* bear_form([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"bear form",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* dire_bear_form([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"dire bear form",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ { NextAction("bear form") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* mangle_bear([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"mangle (bear)",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* maul([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"maul",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("melee") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* bash([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"bash",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("melee") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* swipe([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"swipe",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("melee") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* lacerate([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"lacerate",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("maul") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* growl([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"growl",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* demoralizing_roar([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"demoralizing roar",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
BearTankDruidStrategy::BearTankDruidStrategy(PlayerbotAI* botAI) : FeralDruidStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new BearTankDruidStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
std::vector<NextAction> BearTankDruidStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("mangle (bear)", ACTION_DEFAULT + 0.5f),
|
||||
NextAction("faerie fire (feral)", ACTION_DEFAULT + 0.4f),
|
||||
NextAction("lacerate", ACTION_DEFAULT + 0.3f),
|
||||
NextAction("maul", ACTION_DEFAULT + 0.2f),
|
||||
NextAction("enrage", ACTION_DEFAULT + 0.1f),
|
||||
NextAction("melee", ACTION_DEFAULT)
|
||||
};
|
||||
}
|
||||
|
||||
void BearTankDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
FeralDruidStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"enemy out of melee",
|
||||
{
|
||||
NextAction("feral charge - bear", ACTION_NORMAL + 8)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"bear form",
|
||||
{
|
||||
NextAction("dire bear form", ACTION_HIGH + 8)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"low health",
|
||||
{
|
||||
NextAction("frenzied regeneration", ACTION_HIGH + 7)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"faerie fire (feral)",
|
||||
{
|
||||
NextAction("faerie fire (feral)", ACTION_HIGH + 7)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"lose aggro",
|
||||
{
|
||||
NextAction("growl", ACTION_HIGH + 8)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"medium aoe",
|
||||
{
|
||||
NextAction("demoralizing roar", ACTION_HIGH + 6),
|
||||
NextAction("swipe (bear)", ACTION_HIGH + 6)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"light aoe",
|
||||
{
|
||||
NextAction("swipe (bear)", ACTION_HIGH + 5)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"bash",
|
||||
{
|
||||
NextAction("bash", ACTION_INTERRUPT + 2)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"bash on enemy healer",
|
||||
{
|
||||
NextAction("bash on enemy healer", ACTION_INTERRUPT + 1)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
24
src/Scenario/ClassAi/Druid/Strategy/BearTankDruidStrategy.h
Normal file
24
src/Scenario/ClassAi/Druid/Strategy/BearTankDruidStrategy.h
Normal 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_BEARTANKDRUIDSTRATEGY_H
|
||||
#define _PLAYERBOT_BEARTANKDRUIDSTRATEGY_H
|
||||
|
||||
#include "FeralDruidStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class BearTankDruidStrategy : public FeralDruidStrategy
|
||||
{
|
||||
public:
|
||||
BearTankDruidStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "bear"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_TANK | STRATEGY_TYPE_MELEE; }
|
||||
};
|
||||
|
||||
#endif
|
||||
254
src/Scenario/ClassAi/Druid/Strategy/CasterDruidStrategy.cpp
Normal file
254
src/Scenario/ClassAi/Druid/Strategy/CasterDruidStrategy.cpp
Normal file
@@ -0,0 +1,254 @@
|
||||
/*
|
||||
* 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 "CasterDruidStrategy.h"
|
||||
|
||||
#include "AiObjectContext.h"
|
||||
#include "FeralDruidStrategy.h"
|
||||
|
||||
class CasterDruidStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
CasterDruidStrategyActionNodeFactory()
|
||||
{
|
||||
creators["faerie fire"] = &faerie_fire;
|
||||
creators["hibernate"] = &hibernate;
|
||||
creators["entangling roots"] = &entangling_roots;
|
||||
creators["entangling roots on cc"] = &entangling_roots_on_cc;
|
||||
creators["wrath"] = &wrath;
|
||||
creators["starfall"] = &starfall;
|
||||
creators["insect swarm"] = &insect_swarm;
|
||||
creators["moonfire"] = &moonfire;
|
||||
creators["starfire"] = &starfire;
|
||||
creators["moonkin form"] = &moonkin_form;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* faerie_fire([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"faerie fire",
|
||||
/*P*/ { NextAction("moonkin form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* hibernate([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"hibernate",
|
||||
/*P*/ { NextAction("moonkin form") },
|
||||
/*A*/ { NextAction("entangling roots") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* entangling_roots([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"entangling roots",
|
||||
/*P*/ { NextAction("moonkin form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* entangling_roots_on_cc([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"entangling roots on cc",
|
||||
/*P*/ { NextAction("moonkin form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* wrath([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"wrath",
|
||||
/*P*/ { NextAction("moonkin form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* starfall([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"starfall",
|
||||
/*P*/ { NextAction("moonkin form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* insect_swarm([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"insect swarm",
|
||||
/*P*/ { NextAction("moonkin form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* moonfire([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"moonfire",
|
||||
/*P*/ { NextAction("moonkin form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* starfire([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"starfire",
|
||||
/*P*/ { NextAction("moonkin form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* moonkin_form([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"moonkin form",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
CasterDruidStrategy::CasterDruidStrategy(PlayerbotAI* botAI) : GenericDruidStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new CasterDruidStrategyActionNodeFactory());
|
||||
actionNodeFactories.Add(new ShapeshiftDruidStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
std::vector<NextAction> CasterDruidStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("starfall", ACTION_HIGH + 1.0f),
|
||||
NextAction("force of nature", ACTION_DEFAULT + 1.0f),
|
||||
NextAction("wrath", ACTION_DEFAULT + 0.1f),
|
||||
};
|
||||
}
|
||||
|
||||
void CasterDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
GenericDruidStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"eclipse (lunar) cooldown",
|
||||
{
|
||||
NextAction("starfire", ACTION_DEFAULT + 0.2f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"eclipse (solar) cooldown",
|
||||
{
|
||||
NextAction("wrath", ACTION_DEFAULT + 0.2f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"insect swarm",
|
||||
{
|
||||
NextAction("insect swarm", ACTION_NORMAL + 5)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"moonfire",
|
||||
{
|
||||
NextAction("moonfire", ACTION_NORMAL + 4)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"eclipse (solar)",
|
||||
{
|
||||
NextAction("wrath", ACTION_NORMAL + 6)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"eclipse (lunar)",
|
||||
{
|
||||
NextAction("starfire", ACTION_NORMAL + 6)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"medium mana",
|
||||
{
|
||||
NextAction("innervate", ACTION_HIGH + 9)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"enemy too close for spell",
|
||||
{
|
||||
NextAction("flee", ACTION_MOVE + 9)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void CasterDruidAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"hurricane channel check",
|
||||
{
|
||||
NextAction("cancel channel", ACTION_HIGH + 2)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"medium aoe",
|
||||
{
|
||||
NextAction("hurricane", ACTION_HIGH + 1)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"light aoe",
|
||||
{
|
||||
NextAction("insect swarm on attacker", ACTION_NORMAL + 3),
|
||||
NextAction("moonfire on attacker", ACTION_NORMAL + 3)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void CasterDruidDebuffStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"faerie fire",
|
||||
{
|
||||
NextAction("faerie fire", ACTION_HIGH)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
45
src/Scenario/ClassAi/Druid/Strategy/CasterDruidStrategy.h
Normal file
45
src/Scenario/ClassAi/Druid/Strategy/CasterDruidStrategy.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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_CASTERDRUIDSTRATEGY_H
|
||||
#define _PLAYERBOT_CASTERDRUIDSTRATEGY_H
|
||||
|
||||
#include "GenericDruidStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class CasterDruidStrategy : public GenericDruidStrategy
|
||||
{
|
||||
public:
|
||||
CasterDruidStrategy(PlayerbotAI* botAI);
|
||||
|
||||
public:
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "caster"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_DPS | STRATEGY_TYPE_RANGED; }
|
||||
};
|
||||
|
||||
class CasterDruidAoeStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
CasterDruidAoeStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {}
|
||||
|
||||
public:
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "caster aoe"; }
|
||||
};
|
||||
|
||||
class CasterDruidDebuffStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
CasterDruidDebuffStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {}
|
||||
|
||||
public:
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "caster debuff"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
314
src/Scenario/ClassAi/Druid/Strategy/CatDpsDruidStrategy.cpp
Normal file
314
src/Scenario/ClassAi/Druid/Strategy/CatDpsDruidStrategy.cpp
Normal file
@@ -0,0 +1,314 @@
|
||||
/*
|
||||
* 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 "CatDpsDruidStrategy.h"
|
||||
|
||||
#include "AiObjectContext.h"
|
||||
|
||||
class CatDpsDruidStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
CatDpsDruidStrategyActionNodeFactory()
|
||||
{
|
||||
creators["faerie fire (feral)"] = &faerie_fire_feral;
|
||||
creators["melee"] = &melee;
|
||||
creators["feral charge - cat"] = &feral_charge_cat;
|
||||
creators["cat form"] = &cat_form;
|
||||
creators["claw"] = &claw;
|
||||
creators["mangle (cat)"] = &mangle_cat;
|
||||
creators["rake"] = &rake;
|
||||
creators["ferocious bite"] = &ferocious_bite;
|
||||
creators["rip"] = &rip;
|
||||
creators["pounce"] = &pounce;
|
||||
creators["ravage"] = &ravage;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* faerie_fire_feral([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"faerie fire (feral)",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* melee([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"melee",
|
||||
/*P*/ { NextAction("feral charge - cat") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* feral_charge_cat([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"feral charge - cat",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("reach melee") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* cat_form([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"cat form",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* claw([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"claw",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("melee") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* mangle_cat([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"mangle (cat)",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* rake([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"rake",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* ferocious_bite([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"ferocious bite",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("rip") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* rip([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"rip",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* pounce([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"pounce",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("ravage") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* ravage([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"ravage",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("shred") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
CatDpsDruidStrategy::CatDpsDruidStrategy(PlayerbotAI* botAI) : FeralDruidStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new CatDpsDruidStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
std::vector<NextAction> CatDpsDruidStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("tiger's fury", ACTION_DEFAULT + 0.1f)
|
||||
};
|
||||
}
|
||||
|
||||
void CatDpsDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
FeralDruidStrategy::InitTriggers(triggers);
|
||||
|
||||
// Default priority
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"almost full energy available",
|
||||
{
|
||||
NextAction("shred", ACTION_DEFAULT + 0.4f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"combo points not full",
|
||||
{
|
||||
NextAction("shred", ACTION_DEFAULT + 0.4f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"almost full energy available",
|
||||
{
|
||||
NextAction("mangle (cat)", ACTION_DEFAULT + 0.3f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"combo points not full and high energy",
|
||||
{
|
||||
NextAction("mangle (cat)", ACTION_DEFAULT + 0.3f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"almost full energy available",
|
||||
{
|
||||
NextAction("claw", ACTION_DEFAULT + 0.2f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"combo points not full and high energy",
|
||||
{
|
||||
NextAction("claw", ACTION_DEFAULT + 0.2f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"faerie fire (feral)",
|
||||
{
|
||||
NextAction("faerie fire (feral)", ACTION_DEFAULT + 0.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
// Main spell
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"cat form", {
|
||||
NextAction("cat form", ACTION_HIGH + 8)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"savage roar", {
|
||||
NextAction("savage roar", ACTION_HIGH + 7)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"combo points available",
|
||||
{
|
||||
NextAction("rip", ACTION_HIGH + 6)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"ferocious bite time",
|
||||
{
|
||||
NextAction("ferocious bite", ACTION_HIGH + 5)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"target with combo points almost dead",
|
||||
{
|
||||
NextAction("ferocious bite", ACTION_HIGH + 4)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"mangle (cat)",
|
||||
{
|
||||
NextAction("mangle (cat)", ACTION_HIGH + 3)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"rake",
|
||||
{
|
||||
NextAction("rake", ACTION_HIGH + 2)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"medium threat",
|
||||
{
|
||||
NextAction("cower", ACTION_HIGH + 1)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
// AOE
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"medium aoe",
|
||||
{
|
||||
NextAction("swipe (cat)", ACTION_HIGH + 3)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"light aoe",
|
||||
{
|
||||
NextAction("rake on attacker", ACTION_HIGH + 2)
|
||||
}
|
||||
)
|
||||
);
|
||||
// Reach target
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"enemy out of melee",
|
||||
{
|
||||
NextAction("feral charge - cat", ACTION_HIGH + 9)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"enemy out of melee",
|
||||
{
|
||||
NextAction("dash", ACTION_HIGH + 8)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void CatAoeDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) {}
|
||||
35
src/Scenario/ClassAi/Druid/Strategy/CatDpsDruidStrategy.h
Normal file
35
src/Scenario/ClassAi/Druid/Strategy/CatDpsDruidStrategy.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 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_CATDPSDRUIDSTRATEGY_H
|
||||
#define _PLAYERBOT_CATDPSDRUIDSTRATEGY_H
|
||||
|
||||
#include "FeralDruidStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class CatDpsDruidStrategy : public FeralDruidStrategy
|
||||
{
|
||||
public:
|
||||
CatDpsDruidStrategy(PlayerbotAI* botAI);
|
||||
|
||||
public:
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "cat"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_MELEE; }
|
||||
};
|
||||
|
||||
class CatAoeDruidStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
CatAoeDruidStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {}
|
||||
|
||||
public:
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "cat aoe"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
113
src/Scenario/ClassAi/Druid/Strategy/FeralDruidStrategy.cpp
Normal file
113
src/Scenario/ClassAi/Druid/Strategy/FeralDruidStrategy.cpp
Normal file
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* 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 "FeralDruidStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
class FeralDruidStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
FeralDruidStrategyActionNodeFactory()
|
||||
{
|
||||
creators["survival instincts"] = &survival_instincts;
|
||||
creators["thorns"] = þs;
|
||||
creators["omen of clarity"] = &omen_of_clarity;
|
||||
creators["cure poison"] = &cure_poison;
|
||||
creators["cure poison on party"] = &cure_poison_on_party;
|
||||
creators["abolish poison"] = &abolish_poison;
|
||||
creators["abolish poison on party"] = &abolish_poison_on_party;
|
||||
creators["prowl"] = &prowl;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* survival_instincts([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("survival instincts",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("barkskin") },
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* thorns([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("thorns",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* omen_of_clarity([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("omen of clarity",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* cure_poison([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("cure poison",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* cure_poison_on_party([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("cure poison on party",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* abolish_poison([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("abolish poison",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* abolish_poison_on_party([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("abolish poison on party",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* prowl([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("prowl",
|
||||
/*P*/ { NextAction("cat form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
};
|
||||
|
||||
FeralDruidStrategy::FeralDruidStrategy(PlayerbotAI* botAI) : GenericDruidStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new FeralDruidStrategyActionNodeFactory());
|
||||
actionNodeFactories.Add(new ShapeshiftDruidStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
void FeralDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
GenericDruidStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode(
|
||||
"enemy out of melee", { NextAction("reach melee", ACTION_HIGH + 1) }));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"critical health", { NextAction("survival instincts", ACTION_EMERGENCY + 1) }));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"omen of clarity", { NextAction("omen of clarity", ACTION_HIGH + 9) }));
|
||||
triggers.push_back(new TriggerNode("player has flag",
|
||||
{ NextAction("dash", ACTION_EMERGENCY + 2) }));
|
||||
triggers.push_back(new TriggerNode("enemy flagcarrier near",
|
||||
{ NextAction("dash", ACTION_EMERGENCY + 2) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("berserk", { NextAction("berserk", ACTION_HIGH + 6) }));
|
||||
}
|
||||
86
src/Scenario/ClassAi/Druid/Strategy/FeralDruidStrategy.h
Normal file
86
src/Scenario/ClassAi/Druid/Strategy/FeralDruidStrategy.h
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* 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_FERALRUIDSTRATEGY_H
|
||||
#define _PLAYERBOT_FERALRUIDSTRATEGY_H
|
||||
|
||||
#include "GenericDruidStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class ShapeshiftDruidStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
ShapeshiftDruidStrategyActionNodeFactory()
|
||||
{
|
||||
creators["rejuvenation"] = &rejuvenation;
|
||||
creators["regrowth"] = ®rowth;
|
||||
creators["healing touch"] = &healing_touch;
|
||||
creators["rejuvenation on party"] = &rejuvenation_on_party;
|
||||
creators["regrowth on party"] = ®rowth_on_party;
|
||||
creators["healing touch on party"] = &healing_touch_on_party;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* regrowth([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("regrowth",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ { NextAction("healing touch") },
|
||||
/*C*/ { NextAction("melee", 10.0f) });
|
||||
}
|
||||
|
||||
static ActionNode* rejuvenation([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("rejuvenation",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* healing_touch([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("healing touch",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* regrowth_on_party([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("regrowth on party",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ { NextAction("healing touch on party") },
|
||||
/*C*/ { NextAction("melee", 10.0f) });
|
||||
}
|
||||
|
||||
static ActionNode* rejuvenation_on_party([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("rejuvenation on party",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* healing_touch_on_party([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("healing touch on party",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
};
|
||||
|
||||
class FeralDruidStrategy : public GenericDruidStrategy
|
||||
{
|
||||
protected:
|
||||
FeralDruidStrategy(PlayerbotAI* botAI);
|
||||
|
||||
public:
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_MELEE; }
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,194 @@
|
||||
/*
|
||||
* 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 "GenericDruidNonCombatStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
#include "AiFactory.h"
|
||||
|
||||
class GenericDruidNonCombatStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
GenericDruidNonCombatStrategyActionNodeFactory()
|
||||
{
|
||||
creators["thorns"] = þs;
|
||||
creators["thorns on party"] = þs_on_party;
|
||||
creators["mark of the wild"] = &mark_of_the_wild;
|
||||
creators["mark of the wild on party"] = &mark_of_the_wild_on_party;
|
||||
// creators["innervate"] = &innervate;
|
||||
creators["regrowth_on_party"] = ®rowth_on_party;
|
||||
creators["rejuvenation on party"] = &rejuvenation_on_party;
|
||||
creators["remove curse on party"] = &remove_curse_on_party;
|
||||
creators["abolish poison on party"] = &abolish_poison_on_party;
|
||||
creators["revive"] = &revive;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* thorns([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("thorns",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* thorns_on_party([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("thorns on party",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* mark_of_the_wild([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("mark of the wild",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* mark_of_the_wild_on_party([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("mark of the wild on party",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
static ActionNode* regrowth_on_party([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("regrowth on party",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
static ActionNode* rejuvenation_on_party([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("rejuvenation on party",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
static ActionNode* remove_curse_on_party([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("remove curse on party",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
static ActionNode* abolish_poison_on_party([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("abolish poison on party",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
static ActionNode* revive([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("revive",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
};
|
||||
|
||||
GenericDruidNonCombatStrategy::GenericDruidNonCombatStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new GenericDruidNonCombatStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
void GenericDruidNonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
NonCombatStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("mark of the wild", { NextAction("mark of the wild", 14.0f) }));
|
||||
triggers.push_back(new TriggerNode("party member cure poison", { NextAction("abolish poison on party", 20.0f) }));
|
||||
triggers.push_back(new TriggerNode("party member dead", { NextAction("revive", ACTION_CRITICAL_HEAL + 10) }));
|
||||
|
||||
triggers.push_back(new TriggerNode("often", { NextAction("apply oil", 1.0f) }));
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("party member critical health",
|
||||
{
|
||||
NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 7),
|
||||
NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 6),
|
||||
NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 5),
|
||||
}));
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("party member low health",
|
||||
{
|
||||
NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 5),
|
||||
NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 4),
|
||||
NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 3),
|
||||
}));
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("party member medium health",
|
||||
{ NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 3),
|
||||
NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 2),
|
||||
NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 1),
|
||||
}));
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("party member almost full health",
|
||||
{ NextAction("wild growth on party", ACTION_LIGHT_HEAL + 3), NextAction("rejuvenation on party", ACTION_LIGHT_HEAL + 2) }));
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("party member remove curse",
|
||||
{ NextAction("remove curse on party", ACTION_DISPEL + 7) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("new pet", { NextAction("set pet stance", 60.0f) }));
|
||||
|
||||
triggers.push_back(new TriggerNode("party member critical health", {
|
||||
NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 7),
|
||||
NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 6),
|
||||
NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 5),
|
||||
}));
|
||||
triggers.push_back(new TriggerNode("party member low health", {
|
||||
NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 5),
|
||||
NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 4),
|
||||
NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 3),
|
||||
}));
|
||||
triggers.push_back(new TriggerNode("party member medium health", {
|
||||
NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 3),
|
||||
NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 2),
|
||||
NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 1),
|
||||
}));
|
||||
triggers.push_back(new TriggerNode("party member almost full health", {
|
||||
NextAction("wild growth on party", ACTION_LIGHT_HEAL + 3),
|
||||
NextAction("rejuvenation on party", ACTION_LIGHT_HEAL + 2),
|
||||
}));
|
||||
triggers.push_back(new TriggerNode("party member remove curse", {
|
||||
NextAction("remove curse on party", ACTION_DISPEL + 7),
|
||||
}));
|
||||
|
||||
int specTab = AiFactory::GetPlayerSpecTab(botAI->GetBot());
|
||||
if (specTab == 0 || specTab == 2) // Balance or Restoration
|
||||
triggers.push_back(new TriggerNode("often", { NextAction("apply oil", 1.0f) }));
|
||||
if (specTab == 1) // Feral
|
||||
triggers.push_back(new TriggerNode("often", { NextAction("apply stone", 1.0f) }));
|
||||
|
||||
}
|
||||
|
||||
GenericDruidBuffStrategy::GenericDruidBuffStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new GenericDruidNonCombatStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
void GenericDruidBuffStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
NonCombatStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("mark of the wild on party", {
|
||||
NextAction("mark of the wild on party", 13.0f),
|
||||
}));
|
||||
triggers.push_back(new TriggerNode("thorns on main tank", {
|
||||
NextAction("thorns on main tank", 11.0f),
|
||||
}));
|
||||
triggers.push_back(new TriggerNode("thorns", {
|
||||
NextAction("thorns", 10.0f),
|
||||
}));
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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_GENERICDRUIDNONCOMBATSTRATEGY_H
|
||||
#define _PLAYERBOT_GENERICDRUIDNONCOMBATSTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class GenericDruidNonCombatStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
GenericDruidNonCombatStrategy(PlayerbotAI* botAI);
|
||||
|
||||
std::string const getName() override { return "nc"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class GenericDruidBuffStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
GenericDruidBuffStrategy(PlayerbotAI* botAI);
|
||||
|
||||
std::string const getName() override { return "buff"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
158
src/Scenario/ClassAi/Druid/Strategy/GenericDruidStrategy.cpp
Normal file
158
src/Scenario/ClassAi/Druid/Strategy/GenericDruidStrategy.cpp
Normal file
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
* 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 "GenericDruidStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
class GenericDruidStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
GenericDruidStrategyActionNodeFactory()
|
||||
{
|
||||
creators["melee"] = &melee;
|
||||
creators["caster form"] = &caster_form;
|
||||
creators["cure poison"] = &cure_poison;
|
||||
creators["cure poison on party"] = &cure_poison_on_party;
|
||||
creators["abolish poison"] = &abolish_poison;
|
||||
creators["abolish poison on party"] = &abolish_poison_on_party;
|
||||
creators["rebirth"] = &rebirth;
|
||||
creators["entangling roots on cc"] = &entangling_roots_on_cc;
|
||||
creators["innervate"] = &innervate;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* melee([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("melee",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* caster_form([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("caster form",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* cure_poison([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("cure poison",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* cure_poison_on_party([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("cure poison on party",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* abolish_poison([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("abolish poison",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* abolish_poison_on_party([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("abolish poison on party",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* rebirth([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("rebirth",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* entangling_roots_on_cc([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("entangling roots on cc",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ {});
|
||||
}
|
||||
|
||||
static ActionNode* innervate([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("innervate",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("mana potion") },
|
||||
/*C*/ {});
|
||||
}
|
||||
};
|
||||
|
||||
GenericDruidStrategy::GenericDruidStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new GenericDruidStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
void GenericDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
CombatStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("low health", { NextAction("barkskin", ACTION_HIGH + 7) }));
|
||||
|
||||
triggers.push_back(new TriggerNode("combat party member dead",
|
||||
{ NextAction("rebirth", ACTION_HIGH + 9) }));
|
||||
triggers.push_back(new TriggerNode("being attacked",
|
||||
{ NextAction("nature's grasp", ACTION_HIGH + 1) }));
|
||||
triggers.push_back(new TriggerNode("new pet", { NextAction("set pet stance", 60.0f) }));
|
||||
}
|
||||
|
||||
void DruidCureStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("party member cure poison",
|
||||
{ NextAction("abolish poison on party", ACTION_DISPEL + 1) }));
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("party member remove curse",
|
||||
{ NextAction("remove curse on party", ACTION_DISPEL + 7) }));
|
||||
|
||||
}
|
||||
|
||||
void DruidBoostStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode(
|
||||
"nature's swiftness", { NextAction("nature's swiftness", ACTION_HIGH + 9) }));
|
||||
}
|
||||
|
||||
void DruidCcStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode(
|
||||
"entangling roots", { NextAction("entangling roots on cc", ACTION_HIGH + 2) }));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"entangling roots kite", { NextAction("entangling roots", ACTION_HIGH + 2) }));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"hibernate", { NextAction("hibernate on cc", ACTION_HIGH + 3) }));
|
||||
}
|
||||
|
||||
void DruidHealerDpsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("healer should attack",
|
||||
{
|
||||
NextAction("cancel tree form", ACTION_DEFAULT + 0.3f),
|
||||
NextAction("moonfire", ACTION_DEFAULT + 0.2f),
|
||||
NextAction("wrath", ACTION_DEFAULT + 0.1f),
|
||||
NextAction("starfire", ACTION_DEFAULT),
|
||||
}));
|
||||
|
||||
}
|
||||
58
src/Scenario/ClassAi/Druid/Strategy/GenericDruidStrategy.h
Normal file
58
src/Scenario/ClassAi/Druid/Strategy/GenericDruidStrategy.h
Normal 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_GENERICDRUIDSTRATEGY_H
|
||||
#define _PLAYERBOT_GENERICDRUIDSTRATEGY_H
|
||||
|
||||
#include "CombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class GenericDruidStrategy : public CombatStrategy
|
||||
{
|
||||
protected:
|
||||
GenericDruidStrategy(PlayerbotAI* botAI);
|
||||
|
||||
public:
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class DruidCureStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
DruidCureStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "cure"; }
|
||||
};
|
||||
|
||||
class DruidBoostStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
DruidBoostStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "boost"; }
|
||||
};
|
||||
|
||||
class DruidCcStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
DruidCcStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "cc"; }
|
||||
};
|
||||
|
||||
class DruidHealerDpsStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
DruidHealerDpsStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "healer dps"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
101
src/Scenario/ClassAi/Druid/Strategy/HealDruidStrategy.cpp
Normal file
101
src/Scenario/ClassAi/Druid/Strategy/HealDruidStrategy.cpp
Normal file
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* 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 "HealDruidStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
class HealDruidStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
HealDruidStrategyActionNodeFactory() {
|
||||
creators["nourish on party"] = &nourtish_on_party;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* nourtish_on_party([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("nourish on party",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("healing touch on party") },
|
||||
/*C*/ {});
|
||||
}
|
||||
};
|
||||
|
||||
HealDruidStrategy::HealDruidStrategy(PlayerbotAI* botAI) : GenericDruidStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new HealDruidStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
void HealDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
GenericDruidStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode(
|
||||
"party member to heal out of spell range",
|
||||
{ NextAction("reach party member to heal", ACTION_CRITICAL_HEAL + 9) }));
|
||||
|
||||
// CRITICAL
|
||||
triggers.push_back(
|
||||
new TriggerNode("party member critical health",
|
||||
{
|
||||
NextAction("tree form", ACTION_CRITICAL_HEAL + 4.1f),
|
||||
NextAction("swiftmend on party", ACTION_CRITICAL_HEAL + 4),
|
||||
NextAction("regrowth on party", ACTION_CRITICAL_HEAL + 3),
|
||||
NextAction("wild growth on party", ACTION_CRITICAL_HEAL + 2),
|
||||
NextAction("nourish on party", ACTION_CRITICAL_HEAL + 1),
|
||||
}));
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("party member critical health",
|
||||
{ NextAction("nature's swiftness", ACTION_CRITICAL_HEAL + 4) }));
|
||||
|
||||
triggers.push_back(new TriggerNode(
|
||||
"group heal setting",
|
||||
{
|
||||
NextAction("tree form", ACTION_MEDIUM_HEAL + 2.3f),
|
||||
NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 2.2f),
|
||||
NextAction("rejuvenation on not full", ACTION_MEDIUM_HEAL + 2.1f),
|
||||
}));
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("medium group heal setting",
|
||||
{
|
||||
NextAction("tree form", ACTION_CRITICAL_HEAL + 0.6f),
|
||||
NextAction("tranquility", ACTION_CRITICAL_HEAL + 0.5f) }));
|
||||
|
||||
// LOW
|
||||
triggers.push_back(
|
||||
new TriggerNode("party member low health",
|
||||
{ NextAction("tree form", ACTION_MEDIUM_HEAL + 1.5f),
|
||||
NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 1.4f),
|
||||
NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 1.3f),
|
||||
NextAction("swiftmend on party", ACTION_MEDIUM_HEAL + 1.2),
|
||||
NextAction("nourish on party", ACTION_MEDIUM_HEAL + 1.1f),
|
||||
}));
|
||||
|
||||
// MEDIUM
|
||||
triggers.push_back(
|
||||
new TriggerNode("party member medium health",
|
||||
{
|
||||
NextAction("tree form", ACTION_MEDIUM_HEAL + 0.5f),
|
||||
NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 0.4f),
|
||||
NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 0.3f),
|
||||
NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 0.2f),
|
||||
NextAction("nourish on party", ACTION_MEDIUM_HEAL + 0.1f) }));
|
||||
|
||||
// almost full
|
||||
triggers.push_back(
|
||||
new TriggerNode("party member almost full health",
|
||||
{ NextAction("wild growth on party", ACTION_LIGHT_HEAL + 0.3f),
|
||||
NextAction("rejuvenation on party", ACTION_LIGHT_HEAL + 0.2f),
|
||||
NextAction("regrowth on party", ACTION_LIGHT_HEAL + 0.1f) }));
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("medium mana", { NextAction("innervate", ACTION_HIGH + 5) }));
|
||||
|
||||
triggers.push_back(new TriggerNode("enemy too close for spell",
|
||||
{ NextAction("flee", ACTION_MOVE + 9) }));
|
||||
}
|
||||
24
src/Scenario/ClassAi/Druid/Strategy/HealDruidStrategy.h
Normal file
24
src/Scenario/ClassAi/Druid/Strategy/HealDruidStrategy.h
Normal 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_HEALDRUIDSTRATEGY_H
|
||||
#define _PLAYERBOT_HEALDRUIDSTRATEGY_H
|
||||
|
||||
#include "GenericDruidStrategy.h"
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class HealDruidStrategy : public GenericDruidStrategy
|
||||
{
|
||||
public:
|
||||
HealDruidStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "heal"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_RANGED | STRATEGY_TYPE_HEAL; }
|
||||
};
|
||||
|
||||
#endif
|
||||
32
src/Scenario/ClassAi/Druid/Strategy/MeleeDruidStrategy.cpp
Normal file
32
src/Scenario/ClassAi/Druid/Strategy/MeleeDruidStrategy.cpp
Normal 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 "MeleeDruidStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
MeleeDruidStrategy::MeleeDruidStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {}
|
||||
|
||||
std::vector<NextAction> MeleeDruidStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("faerie fire", ACTION_DEFAULT + 0.1f),
|
||||
NextAction("melee", ACTION_DEFAULT)
|
||||
};
|
||||
}
|
||||
|
||||
void MeleeDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"omen of clarity",
|
||||
{
|
||||
NextAction("omen of clarity", ACTION_HIGH + 9)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
CombatStrategy::InitTriggers(triggers);
|
||||
}
|
||||
21
src/Scenario/ClassAi/Druid/Strategy/MeleeDruidStrategy.h
Normal file
21
src/Scenario/ClassAi/Druid/Strategy/MeleeDruidStrategy.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* 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_MELEEDRUIDSTRATEGY_H
|
||||
#define _PLAYERBOT_MELEEDRUIDSTRATEGY_H
|
||||
|
||||
#include "CombatStrategy.h"
|
||||
|
||||
class MeleeDruidStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
MeleeDruidStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "melee"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
307
src/Scenario/ClassAi/Druid/Strategy/OffhealDruidCatStrategy.cpp
Normal file
307
src/Scenario/ClassAi/Druid/Strategy/OffhealDruidCatStrategy.cpp
Normal file
@@ -0,0 +1,307 @@
|
||||
/*
|
||||
* 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 "OffhealDruidCatStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
#include "Strategy.h"
|
||||
|
||||
class OffhealDruidCatStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
OffhealDruidCatStrategyActionNodeFactory()
|
||||
{
|
||||
creators["cat form"] = &cat_form;
|
||||
creators["mangle (cat)"] = &mangle_cat;
|
||||
creators["shred"] = &shred;
|
||||
creators["rake"] = &rake;
|
||||
creators["rip"] = &rip;
|
||||
creators["ferocious bite"] = &ferocious_bite;
|
||||
creators["savage roar"] = &savage_roar;
|
||||
creators["faerie fire (feral)"] = &faerie_fire_feral;
|
||||
creators["healing touch on party"] = &healing_touch_on_party;
|
||||
creators["regrowth on party"] = ®rowth_on_party;
|
||||
creators["rejuvenation on party"] = &rejuvenation_on_party;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* cat_form([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"cat form",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* mangle_cat([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"mangle (cat)",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* shred([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"shred",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("claw") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* rake([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"rake",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* rip([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"rip",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* ferocious_bite([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"ferocious bite",
|
||||
/*P*/ {},
|
||||
/*A*/ { NextAction("rip") },
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* savage_roar([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"savage roar",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* faerie_fire_feral([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"faerie fire (feral)",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ {}
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* healing_touch_on_party([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"healing touch on party",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ { NextAction("cat form") }
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* regrowth_on_party([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"regrowth on party",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ { NextAction("cat form") }
|
||||
);
|
||||
}
|
||||
|
||||
static ActionNode* rejuvenation_on_party([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode(
|
||||
"rejuvenation on party",
|
||||
/*P*/ { NextAction("caster form") },
|
||||
/*A*/ {},
|
||||
/*C*/ { NextAction("cat form") }
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
OffhealDruidCatStrategy::OffhealDruidCatStrategy(PlayerbotAI* botAI) : FeralDruidStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new OffhealDruidCatStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
std::vector<NextAction> OffhealDruidCatStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("mangle (cat)", ACTION_DEFAULT + 0.5f),
|
||||
NextAction("shred", ACTION_DEFAULT + 0.4f),
|
||||
NextAction("rake", ACTION_DEFAULT + 0.3f),
|
||||
NextAction("melee", ACTION_DEFAULT),
|
||||
NextAction("cat form", ACTION_DEFAULT - 0.1f)
|
||||
};
|
||||
}
|
||||
|
||||
void OffhealDruidCatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
FeralDruidStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"cat form",
|
||||
{
|
||||
NextAction("cat form", ACTION_HIGH + 8)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"savage roar",
|
||||
{
|
||||
NextAction("savage roar", ACTION_HIGH + 7)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"combo points available",
|
||||
{
|
||||
NextAction("rip", ACTION_HIGH + 6)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"ferocious bite time",
|
||||
{
|
||||
NextAction("ferocious bite", ACTION_HIGH + 5)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"target with combo points almost dead",
|
||||
{
|
||||
NextAction("ferocious bite", ACTION_HIGH + 4)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"mangle (cat)",
|
||||
{
|
||||
NextAction("mangle (cat)", ACTION_HIGH + 3)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"rake",
|
||||
{
|
||||
NextAction("rake", ACTION_HIGH + 2)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"almost full energy available",
|
||||
{
|
||||
NextAction("shred", ACTION_DEFAULT + 0.4f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"combo points not full",
|
||||
{
|
||||
NextAction("shred", ACTION_DEFAULT + 0.4f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"faerie fire (feral)",
|
||||
{
|
||||
NextAction("faerie fire (feral)", ACTION_NORMAL)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"enemy out of melee",
|
||||
{
|
||||
NextAction("feral charge - cat", ACTION_HIGH + 9),
|
||||
NextAction("dash", ACTION_HIGH + 8)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"medium aoe",
|
||||
{
|
||||
NextAction("swipe (cat)", ACTION_HIGH + 3)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"low energy",
|
||||
{
|
||||
NextAction("tiger's fury", ACTION_NORMAL + 1)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"party member critical health",
|
||||
{
|
||||
NextAction("regrowth on party", ACTION_CRITICAL_HEAL + 6),
|
||||
NextAction("healing touch on party", ACTION_CRITICAL_HEAL + 5)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"party member low health",
|
||||
{
|
||||
NextAction("healing touch on party", ACTION_MEDIUM_HEAL + 5)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"party member medium health",
|
||||
{
|
||||
NextAction("rejuvenation on party", ACTION_LIGHT_HEAL + 8)
|
||||
}
|
||||
)
|
||||
);
|
||||
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(
|
||||
"low mana",
|
||||
{
|
||||
NextAction("innervate", ACTION_HIGH + 4)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -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_OFFHEALDRUIDCATSTRATEGY_H
|
||||
#define _PLAYERBOT_OFFHEALDRUIDCATSTRATEGY_H
|
||||
|
||||
#include "FeralDruidStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class OffhealDruidCatStrategy : public FeralDruidStrategy
|
||||
{
|
||||
public:
|
||||
OffhealDruidCatStrategy(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
|
||||
63
src/Scenario/ClassAi/Druid/Trigger/DruidTriggers.cpp
Normal file
63
src/Scenario/ClassAi/Druid/Trigger/DruidTriggers.cpp
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* 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 "DruidTriggers.h"
|
||||
#include "Player.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
bool MarkOfTheWildOnPartyTrigger::IsActive()
|
||||
{
|
||||
return BuffOnPartyTrigger::IsActive() && !botAI->HasAura("gift of the wild", GetTarget());
|
||||
}
|
||||
|
||||
bool MarkOfTheWildTrigger::IsActive()
|
||||
{
|
||||
return BuffTrigger::IsActive() && !botAI->HasAura("gift of the wild", GetTarget());
|
||||
}
|
||||
|
||||
bool ThornsOnPartyTrigger::IsActive()
|
||||
{
|
||||
return BuffOnPartyTrigger::IsActive() && !botAI->HasAura("thorns", GetTarget());
|
||||
}
|
||||
|
||||
bool EntanglingRootsKiteTrigger::IsActive()
|
||||
{
|
||||
return DebuffTrigger::IsActive() && AI_VALUE(uint8, "attacker count") < 3 && !GetTarget()->GetPower(POWER_MANA);
|
||||
}
|
||||
|
||||
bool ThornsTrigger::IsActive() { return BuffTrigger::IsActive() && !botAI->HasAura("thorns", GetTarget()); }
|
||||
|
||||
bool BearFormTrigger::IsActive() { return !botAI->HasAnyAuraOf(bot, "bear form", "dire bear form", nullptr); }
|
||||
|
||||
bool TreeFormTrigger::IsActive() { return !botAI->HasAura(33891, bot); }
|
||||
|
||||
bool CatFormTrigger::IsActive() { return !botAI->HasAura("cat form", bot); }
|
||||
|
||||
const std::set<uint32> HurricaneChannelCheckTrigger::HURRICANE_SPELL_IDS = {
|
||||
16914, // Hurricane Rank 1
|
||||
17401, // Hurricane Rank 2
|
||||
17402, // Hurricane Rank 3
|
||||
27012, // Hurricane Rank 4
|
||||
48467 // Hurricane Rank 5
|
||||
};
|
||||
|
||||
bool HurricaneChannelCheckTrigger::IsActive()
|
||||
{
|
||||
Player* bot = botAI->GetBot();
|
||||
|
||||
// Check if the bot is channeling a spell
|
||||
if (Spell* spell = bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
|
||||
{
|
||||
// Only trigger if the spell being channeled is Hurricane
|
||||
if (HURRICANE_SPELL_IDS.count(spell->m_spellInfo->Id))
|
||||
{
|
||||
uint8 attackerCount = AI_VALUE(uint8, "attacker count");
|
||||
return attackerCount < minEnemies;
|
||||
}
|
||||
}
|
||||
|
||||
// Not channeling Hurricane
|
||||
return false;
|
||||
}
|
||||
283
src/Scenario/ClassAi/Druid/Trigger/DruidTriggers.h
Normal file
283
src/Scenario/ClassAi/Druid/Trigger/DruidTriggers.h
Normal file
@@ -0,0 +1,283 @@
|
||||
/*
|
||||
* 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_DRUIDTRIGGERS_H
|
||||
#define _PLAYERBOT_DRUIDTRIGGERS_H
|
||||
|
||||
#include "CureTriggers.h"
|
||||
#include "GenericTriggers.h"
|
||||
#include "Player.h"
|
||||
#include "PlayerbotAI.h"
|
||||
#include "Playerbots.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "Trigger.h"
|
||||
#include <set>
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class MarkOfTheWildOnPartyTrigger : public BuffOnPartyTrigger
|
||||
{
|
||||
public:
|
||||
MarkOfTheWildOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "mark of the wild", 2 * 2000) {}
|
||||
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class MarkOfTheWildTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
MarkOfTheWildTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "mark of the wild", 2 * 2000) {}
|
||||
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class ThornsOnPartyTrigger : public BuffOnPartyTrigger
|
||||
{
|
||||
public:
|
||||
ThornsOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "thorns", 2 * 2000) {}
|
||||
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class ThornsOnMainTankTrigger : public BuffOnMainTankTrigger
|
||||
{
|
||||
public:
|
||||
ThornsOnMainTankTrigger(PlayerbotAI* botAI) : BuffOnMainTankTrigger(botAI, "thorns", false, 2 * 2000) {}
|
||||
};
|
||||
|
||||
class ThornsTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
ThornsTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "thorns", 2 * 2000) {}
|
||||
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class OmenOfClarityTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
OmenOfClarityTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "omen of clarity") {}
|
||||
};
|
||||
|
||||
class RakeTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
RakeTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "rake", 1, true) {}
|
||||
};
|
||||
|
||||
class InsectSwarmTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
InsectSwarmTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "insect swarm", 1, true) {}
|
||||
};
|
||||
|
||||
class MoonfireTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
MoonfireTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "moonfire", 1, true) {}
|
||||
};
|
||||
|
||||
class FaerieFireTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
FaerieFireTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "faerie fire", 1, false, 25.0f) {}
|
||||
};
|
||||
|
||||
class FaerieFireFeralTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
FaerieFireFeralTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "faerie fire (feral)") {}
|
||||
};
|
||||
|
||||
class BashInterruptSpellTrigger : public InterruptSpellTrigger
|
||||
{
|
||||
public:
|
||||
BashInterruptSpellTrigger(PlayerbotAI* botAI) : InterruptSpellTrigger(botAI, "bash") {}
|
||||
};
|
||||
|
||||
class TigersFuryTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
TigersFuryTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "tiger's fury") {}
|
||||
};
|
||||
|
||||
class BerserkTrigger : public BoostTrigger
|
||||
{
|
||||
public:
|
||||
BerserkTrigger(PlayerbotAI* botAI) : BoostTrigger(botAI, "berserk") {}
|
||||
};
|
||||
|
||||
class SavageRoarTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
SavageRoarTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "savage roar") {}
|
||||
};
|
||||
|
||||
class NaturesGraspTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
NaturesGraspTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "nature's grasp") {}
|
||||
};
|
||||
|
||||
class EntanglingRootsTrigger : public HasCcTargetTrigger
|
||||
{
|
||||
public:
|
||||
EntanglingRootsTrigger(PlayerbotAI* botAI) : HasCcTargetTrigger(botAI, "entangling roots") {}
|
||||
};
|
||||
|
||||
class EntanglingRootsKiteTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
EntanglingRootsKiteTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "entangling roots") {}
|
||||
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class HibernateTrigger : public HasCcTargetTrigger
|
||||
{
|
||||
public:
|
||||
HibernateTrigger(PlayerbotAI* botAI) : HasCcTargetTrigger(botAI, "hibernate") {}
|
||||
};
|
||||
|
||||
class CurePoisonTrigger : public NeedCureTrigger
|
||||
{
|
||||
public:
|
||||
CurePoisonTrigger(PlayerbotAI* botAI) : NeedCureTrigger(botAI, "cure poison", DISPEL_POISON) {}
|
||||
};
|
||||
|
||||
class PartyMemberCurePoisonTrigger : public PartyMemberNeedCureTrigger
|
||||
{
|
||||
public:
|
||||
PartyMemberCurePoisonTrigger(PlayerbotAI* botAI) : PartyMemberNeedCureTrigger(botAI, "cure poison", DISPEL_POISON)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class BearFormTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
BearFormTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "bear form") {}
|
||||
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class TreeFormTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
TreeFormTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "tree of life") {}
|
||||
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class CatFormTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
CatFormTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "cat form") {}
|
||||
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class EclipseSolarTrigger : public HasAuraTrigger
|
||||
{
|
||||
public:
|
||||
EclipseSolarTrigger(PlayerbotAI* botAI) : HasAuraTrigger(botAI, "eclipse (solar)") {}
|
||||
};
|
||||
|
||||
class EclipseLunarTrigger : public HasAuraTrigger
|
||||
{
|
||||
public:
|
||||
EclipseLunarTrigger(PlayerbotAI* botAI) : HasAuraTrigger(botAI, "eclipse (lunar)") {}
|
||||
};
|
||||
|
||||
class BashInterruptEnemyHealerSpellTrigger : public InterruptEnemyHealerTrigger
|
||||
{
|
||||
public:
|
||||
BashInterruptEnemyHealerSpellTrigger(PlayerbotAI* botAI) : InterruptEnemyHealerTrigger(botAI, "bash") {}
|
||||
};
|
||||
|
||||
class NaturesSwiftnessTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
NaturesSwiftnessTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "nature's swiftness") {}
|
||||
};
|
||||
|
||||
class DruidPartyMemberRemoveCurseTrigger : public PartyMemberNeedCureTrigger
|
||||
{
|
||||
public:
|
||||
DruidPartyMemberRemoveCurseTrigger(PlayerbotAI* ai)
|
||||
: PartyMemberNeedCureTrigger(ai, "druid remove curse", DISPEL_CURSE)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class EclipseSolarCooldownTrigger : public SpellCooldownTrigger
|
||||
{
|
||||
public:
|
||||
EclipseSolarCooldownTrigger(PlayerbotAI* ai) : SpellCooldownTrigger(ai, "eclipse (solar)") {}
|
||||
bool IsActive() override { return bot->HasSpellCooldown(48517); }
|
||||
};
|
||||
|
||||
class EclipseLunarCooldownTrigger : public SpellCooldownTrigger
|
||||
{
|
||||
public:
|
||||
EclipseLunarCooldownTrigger(PlayerbotAI* ai) : SpellCooldownTrigger(ai, "eclipse (lunar)") {}
|
||||
bool IsActive() override { return bot->HasSpellCooldown(48518); }
|
||||
};
|
||||
|
||||
class MangleCatTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
MangleCatTrigger(PlayerbotAI* ai) : DebuffTrigger(ai, "mangle (cat)", 1, false, 0.0f) {}
|
||||
bool IsActive() override
|
||||
{
|
||||
return DebuffTrigger::IsActive() && !botAI->HasAura("mangle (bear)", GetTarget(), false, false, -1, true)
|
||||
&& !botAI->HasAura("trauma", GetTarget(), false, false, -1, true);
|
||||
}
|
||||
};
|
||||
|
||||
class FerociousBiteTimeTrigger : public Trigger
|
||||
{
|
||||
public:
|
||||
FerociousBiteTimeTrigger(PlayerbotAI* ai) : Trigger(ai, "ferocious bite time") {}
|
||||
bool IsActive() override
|
||||
{
|
||||
Unit* target = AI_VALUE(Unit*, "current target");
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
uint8 cp = AI_VALUE2(uint8, "combo", "current target");
|
||||
if (cp < 5)
|
||||
return false;
|
||||
|
||||
Aura* roar = botAI->GetAura("savage roar", bot);
|
||||
bool roarCheck = !roar || roar->GetDuration() > 10000;
|
||||
if (!roarCheck)
|
||||
return false;
|
||||
|
||||
Aura* rip = botAI->GetAura("rip", target, true);
|
||||
bool ripCheck = !rip || rip->GetDuration() > 10000;
|
||||
if (!ripCheck)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class HurricaneChannelCheckTrigger : public Trigger
|
||||
{
|
||||
public:
|
||||
HurricaneChannelCheckTrigger(PlayerbotAI* botAI, uint32 minEnemies = 2)
|
||||
: Trigger(botAI, "hurricane channel check"), minEnemies(minEnemies)
|
||||
{
|
||||
}
|
||||
|
||||
bool IsActive() override;
|
||||
|
||||
protected:
|
||||
uint32 minEnemies;
|
||||
static const std::set<uint32> HURRICANE_SPELL_IDS;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* 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 "AttackEnemyPlayersStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void AttackEnemyPlayersStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("enemy player near",
|
||||
{ NextAction("attack enemy player", 55.0f) }));
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* 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_ATTACKENEMYPAYERSSTRATEGYACTION_H
|
||||
#define _PLAYERBOT_ATTACKENEMYPAYERSSTRATEGYACTION_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class AttackEnemyPlayersStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
AttackEnemyPlayersStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "pvp"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -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 "BattlegroundStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void BGStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("often", { NextAction("bg join", relevance)}));
|
||||
triggers.push_back(new TriggerNode("bg invite active", { NextAction("bg status check", relevance)}));
|
||||
triggers.push_back(new TriggerNode("timer", { NextAction("bg strategy check", relevance)}));
|
||||
}
|
||||
|
||||
BGStrategy::BGStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) {}
|
||||
|
||||
void BattlegroundStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("bg waiting", { NextAction("bg move to start", ACTION_BG)}));
|
||||
triggers.push_back(new TriggerNode("bg active", { NextAction("bg move to objective", ACTION_BG)}));
|
||||
triggers.push_back(new TriggerNode("often", { NextAction("bg check objective", ACTION_BG + 1)}));
|
||||
triggers.push_back(new TriggerNode("dead", { NextAction("bg reset objective force", ACTION_EMERGENCY)}));
|
||||
}
|
||||
|
||||
void WarsongStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("bg active", { NextAction("bg check flag", ACTION_EMERGENCY )}));
|
||||
triggers.push_back(new TriggerNode("enemy flagcarrier near", { NextAction("attack enemy flag carrier", ACTION_RAID + 1.0f)}));
|
||||
triggers.push_back(new TriggerNode("team flagcarrier near", { NextAction("bg protect fc", ACTION_RAID)}));
|
||||
triggers.push_back(new TriggerNode("often", { NextAction("bg use buff", ACTION_BG)}));
|
||||
triggers.push_back(new TriggerNode("low health", { NextAction("bg use buff", ACTION_MOVE)}));
|
||||
triggers.push_back(new TriggerNode("low mana", { NextAction("bg use buff", ACTION_MOVE)}));
|
||||
triggers.push_back(new TriggerNode("player has flag", { NextAction("bg move to objective", ACTION_EMERGENCY)}));
|
||||
triggers.push_back(new TriggerNode("timer bg", { NextAction("bg reset objective force", ACTION_EMERGENCY)}));
|
||||
}
|
||||
|
||||
void AlteracStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("alliance no snowfall gy", { NextAction("bg move to objective", ACTION_EMERGENCY)}));
|
||||
triggers.push_back(new TriggerNode("timer bg", { NextAction("bg reset objective force", ACTION_EMERGENCY)}));
|
||||
}
|
||||
|
||||
void ArathiStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("bg active", { NextAction("bg check flag", ACTION_EMERGENCY)}));
|
||||
triggers.push_back(new TriggerNode("often", { NextAction("bg use buff", ACTION_BG)}));
|
||||
triggers.push_back(new TriggerNode("low health", { NextAction("bg use buff", ACTION_MOVE)}));
|
||||
triggers.push_back(new TriggerNode("low mana", { NextAction("bg use buff", ACTION_MOVE)}));
|
||||
}
|
||||
|
||||
void EyeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("bg active", { NextAction("bg check flag", ACTION_EMERGENCY)}));
|
||||
triggers.push_back(new TriggerNode("often", { NextAction("bg use buff", ACTION_BG)}));
|
||||
triggers.push_back(new TriggerNode("low health", { NextAction("bg use buff", ACTION_MOVE)}));
|
||||
triggers.push_back(new TriggerNode("low mana", { NextAction("bg use buff", ACTION_MOVE)}));
|
||||
triggers.push_back(new TriggerNode("enemy flagcarrier near", { NextAction("attack enemy flag carrier", ACTION_RAID)}));
|
||||
triggers.push_back(new TriggerNode("player has flag",{ NextAction("bg move to objective", ACTION_EMERGENCY)}));
|
||||
}
|
||||
|
||||
//TODO: Do Priorities
|
||||
void IsleStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("bg active", { NextAction("bg check flag", ACTION_MOVE)}));
|
||||
triggers.push_back(new TriggerNode("timer", { NextAction("enter vehicle", ACTION_MOVE + 8.0f)}));
|
||||
triggers.push_back(new TriggerNode("random", { NextAction("leave vehicle", ACTION_MOVE + 7.0f)}));
|
||||
triggers.push_back(new TriggerNode("in vehicle", { NextAction("hurl boulder", ACTION_MOVE + 9.0f)}));
|
||||
triggers.push_back(new TriggerNode("in vehicle", { NextAction("fire cannon", ACTION_MOVE + 9.0f)}));
|
||||
triggers.push_back(new TriggerNode("in vehicle", { NextAction("napalm", ACTION_MOVE + 9.0f)}));
|
||||
triggers.push_back(new TriggerNode("enemy is close", { NextAction("steam blast", ACTION_MOVE + 9.0f)}));
|
||||
triggers.push_back(new TriggerNode("in vehicle", { NextAction("ram", ACTION_MOVE + 9.0f)}));
|
||||
triggers.push_back(new TriggerNode("enemy is close", { NextAction("ram", ACTION_MOVE + 9.1f)}));
|
||||
triggers.push_back(new TriggerNode("enemy out of melee", { NextAction("steam rush", ACTION_MOVE + 9.2f)}));
|
||||
triggers.push_back(new TriggerNode("in vehicle", { NextAction("incendiary rocket", ACTION_MOVE + 9.0f)}));
|
||||
triggers.push_back(new TriggerNode("in vehicle", { NextAction("rocket blast", ACTION_MOVE + 9.0f)}));
|
||||
// this is bugged: it doesn't work, and stops glaive throw working (which is needed to take down gate)
|
||||
// triggers.push_back(new TriggerNode("in vehicle", { NextAction("blade salvo", ACTION_MOVE + 9.0f)}));
|
||||
triggers.push_back(new TriggerNode("in vehicle", { NextAction("glaive throw", ACTION_MOVE + 9.0f)}));
|
||||
}
|
||||
|
||||
void ArenaStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("no possible targets", { NextAction("arena tactics", ACTION_BG)}));
|
||||
}
|
||||
91
src/Scenario/ClassAi/Generic/Strategy/BattlegroundStrategy.h
Normal file
91
src/Scenario/ClassAi/Generic/Strategy/BattlegroundStrategy.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* 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_BATTLEGROUNDSTRATEGY_H
|
||||
#define _PLAYERBOT_BATTLEGROUNDSTRATEGY_H
|
||||
|
||||
#include "PassTroughStrategy.h"
|
||||
|
||||
class BGStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
BGStrategy(PlayerbotAI* botAI);
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "bg"; }
|
||||
};
|
||||
|
||||
class BattlegroundStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
BattlegroundStrategy(PlayerbotAI* botAI) : Strategy(botAI){};
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "Battleground"; }
|
||||
};
|
||||
|
||||
class WarsongStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
WarsongStrategy(PlayerbotAI* botAI) : Strategy(botAI){};
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_GENERIC; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "warsong"; }
|
||||
};
|
||||
|
||||
class AlteracStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
AlteracStrategy(PlayerbotAI* botAI) : Strategy(botAI){};
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_GENERIC; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "alterac"; }
|
||||
};
|
||||
|
||||
class ArathiStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
ArathiStrategy(PlayerbotAI* botAI) : Strategy(botAI){};
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_GENERIC; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "arathi"; }
|
||||
};
|
||||
|
||||
class EyeStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
EyeStrategy(PlayerbotAI* botAI) : Strategy(botAI){};
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_GENERIC; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "eye"; }
|
||||
};
|
||||
|
||||
class IsleStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
IsleStrategy(PlayerbotAI* botAI) : Strategy(botAI){};
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_GENERIC; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "isle"; }
|
||||
};
|
||||
|
||||
class ArenaStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
ArenaStrategy(PlayerbotAI* botAI) : Strategy(botAI){};
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_GENERIC; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "arena"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
69
src/Scenario/ClassAi/Generic/Strategy/CastTimeStrategy.cpp
Normal file
69
src/Scenario/ClassAi/Generic/Strategy/CastTimeStrategy.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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 "CastTimeStrategy.h"
|
||||
|
||||
#include "GenericSpellActions.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
float CastTimeMultiplier::GetValue(Action* action)
|
||||
{
|
||||
if (action == nullptr)
|
||||
return 1.0f;
|
||||
|
||||
if (!action->GetTarget() || action->GetTarget() != AI_VALUE(Unit*, "current target"))
|
||||
return 1.0f;
|
||||
|
||||
if (/*targetHealth < sPlayerbotAIConfig->criticalHealth && */ dynamic_cast<CastSpellAction*>(action))
|
||||
{
|
||||
CastSpellAction* spellAction = dynamic_cast<CastSpellAction*>(action);
|
||||
uint32 spellId = AI_VALUE2(uint32, "spell id", spellAction->getSpell());
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!spellInfo)
|
||||
return 1.0f;
|
||||
|
||||
if ((spellInfo->Targets & TARGET_FLAG_DEST_LOCATION) != 0 ||
|
||||
(spellInfo->Targets & TARGET_FLAG_SOURCE_LOCATION) != 0)
|
||||
return 1.0f;
|
||||
|
||||
uint32 castTime = spellInfo->CalcCastTime(bot);
|
||||
|
||||
if (spellInfo->IsChanneled())
|
||||
{
|
||||
int32 duration = spellInfo->GetDuration();
|
||||
// bot->ApplySpellMod(spellInfo->Id, SPELLMOD_DURATION, duration);
|
||||
duration = std::min(duration, 3000);
|
||||
if (duration > 0)
|
||||
castTime += duration;
|
||||
}
|
||||
|
||||
Unit* target = action->GetTarget();
|
||||
if (!target || !target->IsAlive() || !target->IsInWorld())
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
if (castTime > (1000 * target->GetHealth() / AI_VALUE(float, "estimated group dps")))
|
||||
{
|
||||
return 0.1f;
|
||||
}
|
||||
}
|
||||
// if (castTime >= 3000)
|
||||
// return 0.0f;
|
||||
|
||||
// if (castTime >= 1500)
|
||||
// return 0.5f;
|
||||
|
||||
// if (castTime >= 1000)
|
||||
// return 0.25f;
|
||||
// // }
|
||||
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
void CastTimeStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
{
|
||||
multipliers.push_back(new CastTimeMultiplier(botAI));
|
||||
}
|
||||
30
src/Scenario/ClassAi/Generic/Strategy/CastTimeStrategy.h
Normal file
30
src/Scenario/ClassAi/Generic/Strategy/CastTimeStrategy.h
Normal 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_CASTTIMESTRATEGY_H
|
||||
#define _PLAYERBOT_CASTTIMESTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class CastTimeMultiplier : public Multiplier
|
||||
{
|
||||
public:
|
||||
CastTimeMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "cast time") {}
|
||||
|
||||
float GetValue(Action* action) override;
|
||||
};
|
||||
|
||||
class CastTimeStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
CastTimeStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "cast time"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,193 @@
|
||||
/*
|
||||
* 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 "ChatCommandHandlerStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
class ChatCommandActionNodeFactoryInternal : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
ChatCommandActionNodeFactoryInternal() { creators["tank attack chat shortcut"] = &tank_attack_chat_shortcut; }
|
||||
|
||||
private:
|
||||
static ActionNode* tank_attack_chat_shortcut(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("tank attack chat shortcut",
|
||||
/*P*/ {},
|
||||
/*A*/ {},
|
||||
/*C*/ { NextAction("attack my target", 100.0f) });
|
||||
}
|
||||
};
|
||||
|
||||
void ChatCommandHandlerStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
PassTroughStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("rep", { NextAction("reputation", relevance) }));
|
||||
triggers.push_back(new TriggerNode("q", { NextAction("query quest", relevance),
|
||||
NextAction("query item usage", relevance) }));
|
||||
triggers.push_back(new TriggerNode("add all loot", { NextAction("add all loot", relevance),
|
||||
NextAction("loot", relevance) }));
|
||||
triggers.push_back(new TriggerNode("u", { NextAction("use", relevance) }));
|
||||
triggers.push_back(new TriggerNode("c", { NextAction("item count", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("items", { NextAction("item count", relevance) }));
|
||||
triggers.push_back(new TriggerNode("inv", { NextAction("item count", relevance) }));
|
||||
triggers.push_back(new TriggerNode("e", { NextAction("equip", relevance) }));
|
||||
triggers.push_back(new TriggerNode("ue", { NextAction("unequip", relevance) }));
|
||||
triggers.push_back(new TriggerNode("t", { NextAction("trade", relevance) }));
|
||||
triggers.push_back(new TriggerNode("nt", { NextAction("trade", relevance) }));
|
||||
triggers.push_back(new TriggerNode("s", { NextAction("sell", relevance) }));
|
||||
triggers.push_back(new TriggerNode("b", { NextAction("buy", relevance) }));
|
||||
triggers.push_back(new TriggerNode("r", { NextAction("reward", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("attack", { NextAction("attack my target", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("accept", { NextAction("accept quest", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("follow", { NextAction("follow chat shortcut", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("stay", { NextAction("stay chat shortcut", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("move from group", { NextAction("move from group chat shortcut", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("flee", { NextAction("flee chat shortcut", relevance) }));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"tank attack", { NextAction("tank attack chat shortcut", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("grind", { NextAction("grind chat shortcut", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("talk", { NextAction("gossip hello", relevance),
|
||||
NextAction("talk to quest giver", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("enter vehicle", { NextAction("enter vehicle", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("leave vehicle", { NextAction("leave vehicle", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("cast", { NextAction("cast custom spell", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("castnc", { NextAction("cast custom nc spell", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("revive", { NextAction("spirit healer", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("runaway", { NextAction("runaway chat shortcut", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("warning", { NextAction("runaway chat shortcut", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("max dps", { NextAction("max dps chat shortcut", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("attackers", { NextAction("tell attackers", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("target", { NextAction("tell target", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("ready", { NextAction("ready check", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("bwl", { NextAction("bwl chat shortcut", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("dps", { NextAction("tell estimated dps", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("disperse", { NextAction("disperse set", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("open items", { NextAction("open items", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("qi", { NextAction("query item usage", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("unlock items", { NextAction("unlock items", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("unlock traded item", { NextAction("unlock traded item", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("wipe", { NextAction("wipe", relevance) }));
|
||||
triggers.push_back(new TriggerNode("tame", { NextAction("tame", relevance) }));
|
||||
triggers.push_back(new TriggerNode("glyphs", { NextAction("glyphs", relevance) })); // Added for custom Glyphs
|
||||
triggers.push_back(new TriggerNode("glyph equip", { NextAction("glyph equip", relevance) })); // Added for custom Glyphs
|
||||
triggers.push_back(new TriggerNode("pet", { NextAction("pet", relevance) }));
|
||||
triggers.push_back(new TriggerNode("pet attack", { NextAction("pet attack", relevance) }));
|
||||
triggers.push_back(new TriggerNode("roll", { NextAction("roll", relevance) }));
|
||||
}
|
||||
|
||||
ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new ChatCommandActionNodeFactoryInternal());
|
||||
|
||||
supported.push_back("quests");
|
||||
supported.push_back("stats");
|
||||
supported.push_back("leave");
|
||||
supported.push_back("reputation");
|
||||
supported.push_back("log");
|
||||
supported.push_back("los");
|
||||
supported.push_back("rpg status");
|
||||
supported.push_back("rpg do quest");
|
||||
supported.push_back("aura");
|
||||
supported.push_back("drop");
|
||||
supported.push_back("share");
|
||||
supported.push_back("ll");
|
||||
supported.push_back("ss");
|
||||
supported.push_back("release");
|
||||
supported.push_back("teleport");
|
||||
supported.push_back("taxi");
|
||||
supported.push_back("repair");
|
||||
supported.push_back("talents");
|
||||
supported.push_back("spells");
|
||||
supported.push_back("co");
|
||||
supported.push_back("nc");
|
||||
supported.push_back("de");
|
||||
supported.push_back("trainer");
|
||||
supported.push_back("maintenance");
|
||||
supported.push_back("remove glyph");
|
||||
supported.push_back("autogear");
|
||||
supported.push_back("equip upgrade");
|
||||
supported.push_back("chat");
|
||||
supported.push_back("home");
|
||||
supported.push_back("destroy");
|
||||
supported.push_back("reset botAI");
|
||||
supported.push_back("emote");
|
||||
supported.push_back("buff");
|
||||
supported.push_back("help");
|
||||
supported.push_back("gb");
|
||||
supported.push_back("bank");
|
||||
supported.push_back("invite");
|
||||
supported.push_back("lfg");
|
||||
supported.push_back("spell");
|
||||
supported.push_back("rti");
|
||||
supported.push_back("position");
|
||||
supported.push_back("summon");
|
||||
supported.push_back("who");
|
||||
supported.push_back("save mana");
|
||||
supported.push_back("formation");
|
||||
supported.push_back("stance");
|
||||
supported.push_back("sendmail");
|
||||
supported.push_back("mail");
|
||||
supported.push_back("outfit");
|
||||
supported.push_back("go");
|
||||
supported.push_back("debug");
|
||||
supported.push_back("cdebug");
|
||||
supported.push_back("cs");
|
||||
supported.push_back("wts");
|
||||
supported.push_back("hire");
|
||||
supported.push_back("craft");
|
||||
supported.push_back("flag");
|
||||
supported.push_back("range");
|
||||
supported.push_back("ra");
|
||||
supported.push_back("give leader");
|
||||
supported.push_back("cheat");
|
||||
supported.push_back("ginvite");
|
||||
supported.push_back("guild promote");
|
||||
supported.push_back("guild demote");
|
||||
supported.push_back("guild remove");
|
||||
supported.push_back("guild leave");
|
||||
supported.push_back("rtsc");
|
||||
supported.push_back("drink");
|
||||
supported.push_back("calc");
|
||||
supported.push_back("open items");
|
||||
supported.push_back("qi");
|
||||
supported.push_back("unlock items");
|
||||
supported.push_back("unlock traded item");
|
||||
supported.push_back("tame");
|
||||
supported.push_back("glyphs"); // Added for custom Glyphs
|
||||
supported.push_back("glyph equip"); // Added for custom Glyphs
|
||||
supported.push_back("pet");
|
||||
supported.push_back("pet attack");
|
||||
}
|
||||
@@ -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_CHATCOMMANDHANDLERSTRATEGY_H
|
||||
#define _PLAYERBOT_CHATCOMMANDHANDLERSTRATEGY_H
|
||||
|
||||
#include "PassTroughStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class ChatCommandHandlerStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
ChatCommandHandlerStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "chat"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
94
src/Scenario/ClassAi/Generic/Strategy/CombatStrategy.cpp
Normal file
94
src/Scenario/ClassAi/Generic/Strategy/CombatStrategy.cpp
Normal 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 "CombatStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
#include "Strategy.h"
|
||||
|
||||
void CombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"enemy out of spell",
|
||||
{
|
||||
NextAction("reach spell", ACTION_HIGH)
|
||||
}
|
||||
)
|
||||
);
|
||||
// drop target relevance 99 (lower than Worldpacket triggers)
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"invalid target",
|
||||
{
|
||||
NextAction("drop target", 99)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"mounted",
|
||||
{
|
||||
NextAction("check mount state", 54)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"combat stuck",
|
||||
{
|
||||
NextAction("reset", 1.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"not facing target",
|
||||
{
|
||||
NextAction("set facing", ACTION_MOVE + 7)
|
||||
}
|
||||
)
|
||||
);
|
||||
// The pet-attack trigger is commented out because it was forcing the bot's pet to attack, overriding stay and follow commands.
|
||||
// Pets will automatically attack the bot's enemy if they are in "defensive" or "aggressive"
|
||||
// stance, or if the master issues an attack command.
|
||||
}
|
||||
|
||||
AvoidAoeStrategy::AvoidAoeStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
std::vector<NextAction> AvoidAoeStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("avoid aoe", ACTION_EMERGENCY)
|
||||
};
|
||||
}
|
||||
|
||||
void AvoidAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
}
|
||||
|
||||
void AvoidAoeStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
{
|
||||
}
|
||||
|
||||
TankFaceStrategy::TankFaceStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
std::vector<NextAction> TankFaceStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("tank face", ACTION_MOVE)
|
||||
};
|
||||
}
|
||||
|
||||
void TankFaceStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
}
|
||||
|
||||
std::vector<NextAction> CombatFormationStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("combat formation move", ACTION_NORMAL)
|
||||
};
|
||||
}
|
||||
49
src/Scenario/ClassAi/Generic/Strategy/CombatStrategy.h
Normal file
49
src/Scenario/ClassAi/Generic/Strategy/CombatStrategy.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 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_COMBATSTRATEGY_H
|
||||
#define _PLAYERBOT_COMBATSTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class CombatStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
CombatStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_COMBAT; }
|
||||
};
|
||||
|
||||
class AvoidAoeStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
explicit AvoidAoeStrategy(PlayerbotAI* ai);
|
||||
const std::string getName() override { return "avoid aoe"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class TankFaceStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
explicit TankFaceStrategy(PlayerbotAI* ai);
|
||||
const std::string getName() override { return "tank face"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class CombatFormationStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
CombatFormationStrategy(PlayerbotAI* ai) : Strategy(ai) {}
|
||||
const std::string getName() override { return "formation"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
134
src/Scenario/ClassAi/Generic/Strategy/ConserveManaStrategy.cpp
Normal file
134
src/Scenario/ClassAi/Generic/Strategy/ConserveManaStrategy.cpp
Normal file
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
* 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 "ConserveManaStrategy.h"
|
||||
|
||||
#include "GenericSpellActions.h"
|
||||
#include "LastSpellCastValue.h"
|
||||
#include "PlayerbotAIConfig.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
// float ConserveManaMultiplier::GetValue(Action* action)
|
||||
// {
|
||||
// if (!action)
|
||||
// return 1.0f;
|
||||
|
||||
// uint8 health = AI_VALUE2(uint8, "health", "self target");
|
||||
// uint8 targetHealth = AI_VALUE2(uint8, "health", "current target");
|
||||
// uint8 mana = AI_VALUE2(uint8, "mana", "self target");
|
||||
// bool hasMana = AI_VALUE2(bool, "has mana", "self target");
|
||||
// bool mediumMana = hasMana && mana < sPlayerbotAIConfig->mediumMana;
|
||||
|
||||
// if (health < sPlayerbotAIConfig->lowHealth)
|
||||
// return 1.0f;
|
||||
|
||||
// Unit* target = AI_VALUE(Unit*, "current target");
|
||||
// if (action->GetTarget() != target)
|
||||
// return 1.0f;
|
||||
|
||||
// CastSpellAction* spellAction = dynamic_cast<CastSpellAction*>(action);
|
||||
// if (!spellAction)
|
||||
// return 1.0f;
|
||||
|
||||
// std::string const spell = spellAction->getName();
|
||||
// uint32 spellId = AI_VALUE2(uint32, "spell id", spell);
|
||||
// SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
// if (!spellInfo || spellInfo->PowerType != POWER_MANA)
|
||||
// return 1.0f;
|
||||
|
||||
// if (mediumMana && dynamic_cast<CastBuffSpellAction*>(action))
|
||||
// return 0.0f;
|
||||
|
||||
// if (target && ((int)target->GetLevel() - (int)bot->GetLevel()) >= 0)
|
||||
// return 1.0f;
|
||||
|
||||
// return 1.0f;
|
||||
// }
|
||||
|
||||
// float SaveManaMultiplier::GetValue(Action* action)
|
||||
// {
|
||||
// if (!action)
|
||||
// return 1.0f;
|
||||
|
||||
// if (action->GetTarget() != AI_VALUE(Unit*, "current target"))
|
||||
// return 1.0f;
|
||||
|
||||
// double saveLevel = AI_VALUE(double, "mana save level");
|
||||
// if (saveLevel <= 1.0)
|
||||
// return 1.0f;
|
||||
|
||||
// CastSpellAction* spellAction = dynamic_cast<CastSpellAction*>(action);
|
||||
// if (!spellAction)
|
||||
// return 1.0f;
|
||||
|
||||
// std::string const spell = spellAction->getName();
|
||||
// uint32 spellId = AI_VALUE2(uint32, "spell id", spell);
|
||||
// SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
// if (!spellInfo || spellInfo->PowerType != POWER_MANA)
|
||||
// return 1.0f;
|
||||
|
||||
// int32 cost = spellInfo->ManaCost;
|
||||
// if (!cost)
|
||||
// return 1.0f;
|
||||
|
||||
// time_t lastCastTime = AI_VALUE2(time_t, "last spell cast time", spell);
|
||||
// if (!lastCastTime)
|
||||
// return 1.0f;
|
||||
|
||||
// time_t elapsed = time(nullptr) - lastCastTime;
|
||||
// if ((double)elapsed < 10 * saveLevel)
|
||||
// return 0.0f;
|
||||
|
||||
// return 1.0f;
|
||||
// }
|
||||
|
||||
// void ConserveManaStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
// {
|
||||
// multipliers.push_back(new ConserveManaMultiplier(botAI));
|
||||
// }
|
||||
|
||||
float HealerAutoSaveManaMultiplier::GetValue(Action* action)
|
||||
{
|
||||
uint8 mana = bot->GetPowerPct(Powers::POWER_MANA);
|
||||
if (mana > sPlayerbotAIConfig->saveManaThreshold)
|
||||
return 1.0f;
|
||||
CastHealingSpellAction* healingAction = dynamic_cast<CastHealingSpellAction*>(action);
|
||||
|
||||
if (!healingAction)
|
||||
return 1.0f;
|
||||
|
||||
Unit* target = healingAction->GetTarget();
|
||||
if (!target)
|
||||
return 1.0f;
|
||||
bool isTank = target->ToPlayer() ? botAI->IsTank(target->ToPlayer()) : false;
|
||||
uint8 health = target->GetHealthPct();
|
||||
HealingManaEfficiency manaEfficiency = healingAction->manaEfficiency;
|
||||
uint8 estAmount = healingAction->estAmount;
|
||||
uint8 lossAmount = 100 - health;
|
||||
if (isTank)
|
||||
{
|
||||
estAmount /= 1.5; // tanks have more health
|
||||
if (health >= sPlayerbotAIConfig->mediumHealth &&
|
||||
(lossAmount < estAmount || manaEfficiency <= HealingManaEfficiency::MEDIUM))
|
||||
return 0.0f;
|
||||
if (health >= sPlayerbotAIConfig->lowHealth &&
|
||||
(lossAmount < estAmount || manaEfficiency <= HealingManaEfficiency::LOW))
|
||||
return 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (health >= sPlayerbotAIConfig->mediumHealth &&
|
||||
(lossAmount < estAmount || manaEfficiency <= HealingManaEfficiency::MEDIUM))
|
||||
return 0.0f;
|
||||
if (lossAmount < estAmount || manaEfficiency <= HealingManaEfficiency::LOW)
|
||||
return 0.0f;
|
||||
}
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
void HealerAutoSaveManaStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
{
|
||||
multipliers.push_back(new HealerAutoSaveManaMultiplier(botAI));
|
||||
}
|
||||
30
src/Scenario/ClassAi/Generic/Strategy/ConserveManaStrategy.h
Normal file
30
src/Scenario/ClassAi/Generic/Strategy/ConserveManaStrategy.h
Normal 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_CONSERVEMANASTRATEGY_H
|
||||
#define _PLAYERBOT_CONSERVEMANASTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class HealerAutoSaveManaMultiplier : public Multiplier
|
||||
{
|
||||
public:
|
||||
HealerAutoSaveManaMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "save mana") {}
|
||||
|
||||
float GetValue(Action* action) override;
|
||||
};
|
||||
|
||||
class HealerAutoSaveManaStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
HealerAutoSaveManaStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "save mana"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
32
src/Scenario/ClassAi/Generic/Strategy/DeadStrategy.cpp
Normal file
32
src/Scenario/ClassAi/Generic/Strategy/DeadStrategy.cpp
Normal 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 "DeadStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void DeadStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
PassTroughStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("often", { NextAction("auto release", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("bg active", { NextAction("auto release", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("dead", { NextAction("find corpse", relevance) }));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"corpse near", { NextAction("revive from corpse", relevance - 1.0f) }));
|
||||
triggers.push_back(new TriggerNode("resurrect request",
|
||||
{ NextAction("accept resurrect", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("falling far", { NextAction("repop", relevance + 1.f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("location stuck", { NextAction("repop", relevance + 1) }));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"can self resurrect", { NextAction("self resurrect", relevance + 2.0f) }));
|
||||
}
|
||||
|
||||
DeadStrategy::DeadStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) {}
|
||||
22
src/Scenario/ClassAi/Generic/Strategy/DeadStrategy.h
Normal file
22
src/Scenario/ClassAi/Generic/Strategy/DeadStrategy.h
Normal 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_DEADSTRATEGY_H
|
||||
#define _PLAYERBOT_DEADSTRATEGY_H
|
||||
|
||||
#include "PassTroughStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class DeadStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
DeadStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "dead"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
8
src/Scenario/ClassAi/Generic/Strategy/DebugStrategy.cpp
Normal file
8
src/Scenario/ClassAi/Generic/Strategy/DebugStrategy.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
* 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 "DebugStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
56
src/Scenario/ClassAi/Generic/Strategy/DebugStrategy.h
Normal file
56
src/Scenario/ClassAi/Generic/Strategy/DebugStrategy.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* 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_DEBUGSTRATEGY_H
|
||||
#define _PLAYERBOT_DEBUGSTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class DebugStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
DebugStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
std::string const getName() override { return "debug"; }
|
||||
};
|
||||
|
||||
class DebugMoveStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
DebugMoveStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
std::string const getName() override { return "debug move"; }
|
||||
};
|
||||
|
||||
class DebugRpgStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
DebugRpgStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
std::string const getName() override { return "debug rpg"; }
|
||||
};
|
||||
|
||||
class DebugSpellStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
DebugSpellStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
std::string const getName() override { return "debug spell"; }
|
||||
};
|
||||
|
||||
class DebugQuestStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
DebugQuestStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT | STRATEGY_TYPE_COMBAT; }
|
||||
std::string const getName() override { return "debug quest"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
20
src/Scenario/ClassAi/Generic/Strategy/DpsAssistStrategy.cpp
Normal file
20
src/Scenario/ClassAi/Generic/Strategy/DpsAssistStrategy.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* 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 "DpsAssistStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void DpsAssistStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("not dps target active", { NextAction("dps assist", 50.0f) }));
|
||||
}
|
||||
|
||||
void DpsAoeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("not dps aoe target active", { NextAction("dps aoe", 50.0f) }));
|
||||
}
|
||||
32
src/Scenario/ClassAi/Generic/Strategy/DpsAssistStrategy.h
Normal file
32
src/Scenario/ClassAi/Generic/Strategy/DpsAssistStrategy.h
Normal 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.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_DPSASSISTSTRATEGY_H
|
||||
#define _PLAYERBOT_DPSASSISTSTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class DpsAssistStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
DpsAssistStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "dps assist"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class DpsAoeStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
DpsAoeStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "dps aoe"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_DPS; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
24
src/Scenario/ClassAi/Generic/Strategy/DuelStrategy.cpp
Normal file
24
src/Scenario/ClassAi/Generic/Strategy/DuelStrategy.cpp
Normal 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.
|
||||
*/
|
||||
|
||||
#include "DuelStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void DuelStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
PassTroughStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(
|
||||
new TriggerNode("duel requested", { NextAction("accept duel", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("no attackers", { NextAction("attack duel opponent", 70.0f) }));
|
||||
}
|
||||
|
||||
DuelStrategy::DuelStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) {}
|
||||
|
||||
void StartDuelStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) {}
|
||||
|
||||
StartDuelStrategy::StartDuelStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
31
src/Scenario/ClassAi/Generic/Strategy/DuelStrategy.h
Normal file
31
src/Scenario/ClassAi/Generic/Strategy/DuelStrategy.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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_DUELSTRATEGY_H
|
||||
#define _PLAYERBOT_DUELSTRATEGY_H
|
||||
|
||||
#include "PassTroughStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class DuelStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
DuelStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "duel"; }
|
||||
};
|
||||
|
||||
class StartDuelStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
StartDuelStrategy(PlayerbotAI* botAI);
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "start duel"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
35
src/Scenario/ClassAi/Generic/Strategy/EmoteStrategy.cpp
Normal file
35
src/Scenario/ClassAi/Generic/Strategy/EmoteStrategy.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 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 "EmoteStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void EmoteStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
if (sPlayerbotAIConfig->randomBotEmote)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("often", { NextAction("talk", 1.0f) }));
|
||||
triggers.push_back(new TriggerNode("seldom", { NextAction("emote", 1.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("receive text emote", { NextAction("emote", 10.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("receive emote", { NextAction("emote", 10.0f) }));
|
||||
}
|
||||
|
||||
if (sPlayerbotAIConfig->randomBotTalk)
|
||||
{
|
||||
triggers.push_back(new TriggerNode(
|
||||
"often",
|
||||
{ NextAction("suggest what to do", 10.0f), NextAction("suggest dungeon", 3.0f),
|
||||
NextAction("suggest trade", 3.0f) }));
|
||||
}
|
||||
|
||||
if (sPlayerbotAIConfig->enableGreet)
|
||||
triggers.push_back(
|
||||
new TriggerNode("new player nearby", { NextAction("greet", 1.0f) }));
|
||||
|
||||
triggers.push_back(new TriggerNode("often", { NextAction("rpg mount anim", 1.0f) }));
|
||||
}
|
||||
22
src/Scenario/ClassAi/Generic/Strategy/EmoteStrategy.h
Normal file
22
src/Scenario/ClassAi/Generic/Strategy/EmoteStrategy.h
Normal 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_EMOTESTRATEGY_H
|
||||
#define _PLAYERBOT_EMOTESTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class EmoteStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
EmoteStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "emote"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
24
src/Scenario/ClassAi/Generic/Strategy/FleeStrategy.cpp
Normal file
24
src/Scenario/ClassAi/Generic/Strategy/FleeStrategy.cpp
Normal 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.
|
||||
*/
|
||||
|
||||
#include "FleeStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void FleeStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("panic", { NextAction("flee", ACTION_EMERGENCY + 9) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("outnumbered", { NextAction("flee", ACTION_EMERGENCY + 9) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("critical health", { NextAction("flee", ACTION_MEDIUM_HEAL) }));
|
||||
}
|
||||
|
||||
void FleeFromAddsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("has nearest adds", { NextAction("runaway", 50.0f) }));
|
||||
}
|
||||
31
src/Scenario/ClassAi/Generic/Strategy/FleeStrategy.h
Normal file
31
src/Scenario/ClassAi/Generic/Strategy/FleeStrategy.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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_FLEESTRATEGY_H
|
||||
#define _PLAYERBOT_FLEESTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class FleeStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
FleeStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "flee"; };
|
||||
};
|
||||
|
||||
class FleeFromAddsStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
FleeFromAddsStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "flee from adds"; };
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* 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 "FollowMasterStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
std::vector<NextAction> FollowMasterStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("follow", 1.0f)
|
||||
};
|
||||
}
|
||||
|
||||
void FollowMasterStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
}
|
||||
23
src/Scenario/ClassAi/Generic/Strategy/FollowMasterStrategy.h
Normal file
23
src/Scenario/ClassAi/Generic/Strategy/FollowMasterStrategy.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 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_FOLLOWMASTERSTRATEGY_H
|
||||
#define _PLAYERBOT_FOLLOWMASTERSTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class FollowMasterStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
FollowMasterStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "follow"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
41
src/Scenario/ClassAi/Generic/Strategy/GrindingStrategy.cpp
Normal file
41
src/Scenario/ClassAi/Generic/Strategy/GrindingStrategy.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 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 "GrindingStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
std::vector<NextAction> GrindingStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("drink", 4.2f),
|
||||
NextAction("food", 4.1f),
|
||||
};
|
||||
}
|
||||
|
||||
void GrindingStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
// reduce lower than loot
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"no target",
|
||||
{
|
||||
NextAction("attack anything", 4.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void MoveRandomStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"often",
|
||||
{
|
||||
NextAction("move random", 1.5f)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
31
src/Scenario/ClassAi/Generic/Strategy/GrindingStrategy.h
Normal file
31
src/Scenario/ClassAi/Generic/Strategy/GrindingStrategy.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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_GRINDINGSTRATEGY_H
|
||||
#define _PLAYERBOT_GRINDINGSTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class GrindingStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
GrindingStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "grind"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_DPS; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class MoveRandomStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
MoveRandomStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
std::string const getName() override { return "move random"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
#endif
|
||||
16
src/Scenario/ClassAi/Generic/Strategy/GroupStrategy.cpp
Normal file
16
src/Scenario/ClassAi/Generic/Strategy/GroupStrategy.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* 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 "GroupStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void GroupStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("often", { NextAction("invite nearby", 4.0f) }));
|
||||
triggers.push_back(new TriggerNode("random", { NextAction("invite guild", 4.0f) }));
|
||||
triggers.push_back(new TriggerNode("random", { NextAction("leave far away", 4.0f) }));
|
||||
triggers.push_back(new TriggerNode("seldom", { NextAction("reset instances", 1.0f) }));
|
||||
}
|
||||
23
src/Scenario/ClassAi/Generic/Strategy/GroupStrategy.h
Normal file
23
src/Scenario/ClassAi/Generic/Strategy/GroupStrategy.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 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_GROUPSTRATEGY_H
|
||||
#define _PLAYERBOT_GROUPSTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class GroupStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
GroupStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "group"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_GENERIC; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
17
src/Scenario/ClassAi/Generic/Strategy/GuardStrategy.cpp
Normal file
17
src/Scenario/ClassAi/Generic/Strategy/GuardStrategy.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* 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 "GuardStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
std::vector<NextAction> GuardStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("guard", 4.0f)
|
||||
};
|
||||
}
|
||||
|
||||
void GuardStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) {}
|
||||
23
src/Scenario/ClassAi/Generic/Strategy/GuardStrategy.h
Normal file
23
src/Scenario/ClassAi/Generic/Strategy/GuardStrategy.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 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_GUARDSTRATEGY_H
|
||||
#define _PLAYERBOT_GUARDSTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class GuardStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
GuardStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "guard"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
22
src/Scenario/ClassAi/Generic/Strategy/GuildStrategy.cpp
Normal file
22
src/Scenario/ClassAi/Generic/Strategy/GuildStrategy.cpp
Normal 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.
|
||||
*/
|
||||
|
||||
#include "GuildStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void GuildStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("often", { NextAction("offer petition nearby", 4.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("often", { NextAction("guild manage nearby", 4.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("petition signed", { NextAction("turn in petition", 10.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("buy tabard", { NextAction("buy tabard", 10.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("leave large guild", { NextAction("guild leave", 4.0f) }));
|
||||
}
|
||||
23
src/Scenario/ClassAi/Generic/Strategy/GuildStrategy.h
Normal file
23
src/Scenario/ClassAi/Generic/Strategy/GuildStrategy.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 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_GUILDSTRATEGY_H
|
||||
#define _PLAYERBOT_GUILDSTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class GuildStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
GuildStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "guild"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_GENERIC; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
15
src/Scenario/ClassAi/Generic/Strategy/KiteStrategy.cpp
Normal file
15
src/Scenario/ClassAi/Generic/Strategy/KiteStrategy.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* 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 "KiteStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
KiteStrategy::KiteStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void KiteStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("has aggro", { NextAction("runaway", 51.0f) }));
|
||||
}
|
||||
22
src/Scenario/ClassAi/Generic/Strategy/KiteStrategy.h
Normal file
22
src/Scenario/ClassAi/Generic/Strategy/KiteStrategy.h
Normal 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_KITESTRATEGY_H
|
||||
#define _PLAYERBOT_KITESTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class KiteStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
KiteStrategy(PlayerbotAI* botAI);
|
||||
|
||||
std::string const getName() override { return "kite"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
19
src/Scenario/ClassAi/Generic/Strategy/LfgStrategy.cpp
Normal file
19
src/Scenario/ClassAi/Generic/Strategy/LfgStrategy.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* 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 "LfgStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void LfgStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("random", { NextAction("lfg join", relevance) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("seldom", { NextAction("lfg leave", relevance) }));
|
||||
triggers.push_back(new TriggerNode(
|
||||
"unknown dungeon", { NextAction("give leader in dungeon", relevance) }));
|
||||
}
|
||||
|
||||
LfgStrategy::LfgStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) {}
|
||||
21
src/Scenario/ClassAi/Generic/Strategy/LfgStrategy.h
Normal file
21
src/Scenario/ClassAi/Generic/Strategy/LfgStrategy.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* 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_LFGSTRATEGY_H
|
||||
#define _PLAYERBOT_LFGSTRATEGY_H
|
||||
|
||||
#include "PassTroughStrategy.h"
|
||||
|
||||
class LfgStrategy : public PassTroughStrategy
|
||||
{
|
||||
public:
|
||||
LfgStrategy(PlayerbotAI* botAI);
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "lfg"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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 "LootNonCombatStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void LootNonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("loot available", { NextAction("loot", 6.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("far from loot target", { NextAction("move to loot", 7.0f) }));
|
||||
triggers.push_back(new TriggerNode("can loot", { NextAction("open loot", 8.0f) }));
|
||||
triggers.push_back(new TriggerNode("often", { NextAction("add all loot", 5.0f) }));
|
||||
}
|
||||
|
||||
void GatherStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("timer", { NextAction("add gathering loot", 5.0f) }));
|
||||
}
|
||||
|
||||
void RevealStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("often", { NextAction("reveal gathering item", 50.0f) }));
|
||||
}
|
||||
|
||||
void UseBobberStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("can use fishing bobber", { NextAction("use fishing bobber", 20.0f) }));
|
||||
triggers.push_back(
|
||||
new TriggerNode("random", { NextAction("remove bobber strategy", 20.0f) }));
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 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_LOOTNONCOMBATSTRATEGY_H
|
||||
#define _PLAYERBOT_LOOTNONCOMBATSTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class LootNonCombatStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
LootNonCombatStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "loot"; }
|
||||
};
|
||||
|
||||
class GatherStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
GatherStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "gather"; }
|
||||
};
|
||||
|
||||
class RevealStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
RevealStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "reveal"; }
|
||||
};
|
||||
|
||||
class UseBobberStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
UseBobberStrategy(PlayerbotAI* botAI) : Strategy(botAI){}
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override {return "use bobber";}
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* 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 "MaintenanceStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
std::vector<NextAction> MaintenanceStrategy::getDefaultActions() { return {}; }
|
||||
|
||||
void MaintenanceStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"random",
|
||||
{
|
||||
NextAction("clean quest log", 6.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"random",
|
||||
{
|
||||
NextAction("use random recipe", 1.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"random",
|
||||
{
|
||||
NextAction("disenchant random item", 1.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"random",
|
||||
{
|
||||
NextAction("enchant random item", 1.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"random",
|
||||
{
|
||||
NextAction("smart destroy item", 1.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"move stuck",
|
||||
{
|
||||
NextAction("reset", 1.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"random",
|
||||
{
|
||||
NextAction("use random quest item", 0.9f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"random",
|
||||
{
|
||||
NextAction("auto share quest", 0.9f)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
24
src/Scenario/ClassAi/Generic/Strategy/MaintenanceStrategy.h
Normal file
24
src/Scenario/ClassAi/Generic/Strategy/MaintenanceStrategy.h
Normal 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_MAINTANCESTRATEGY_H
|
||||
#define _PLAYERBOT_MAINTANCESTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class MaintenanceStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
MaintenanceStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "maintenance"; }
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
14
src/Scenario/ClassAi/Generic/Strategy/MarkRtiStrategy.cpp
Normal file
14
src/Scenario/ClassAi/Generic/Strategy/MarkRtiStrategy.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* 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 "MarkRtiStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void MarkRtiStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("no rti target", { NextAction("mark rti", ACTION_NORMAL) }));
|
||||
}
|
||||
22
src/Scenario/ClassAi/Generic/Strategy/MarkRtiStrategy.h
Normal file
22
src/Scenario/ClassAi/Generic/Strategy/MarkRtiStrategy.h
Normal 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_MARKRTISTRATEGY_H
|
||||
#define _PLAYERBOT_MARKRTISTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class MarkRtiStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
MarkRtiStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "mark rti"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#include "MeleeCombatStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void MeleeCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
CombatStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode(
|
||||
"enemy out of melee", { NextAction("reach melee", ACTION_HIGH + 1) }));
|
||||
}
|
||||
|
||||
void SetBehindCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
CombatStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("not behind target",
|
||||
{ NextAction("set behind", ACTION_MOVE + 7) }));
|
||||
}
|
||||
32
src/Scenario/ClassAi/Generic/Strategy/MeleeCombatStrategy.h
Normal file
32
src/Scenario/ClassAi/Generic/Strategy/MeleeCombatStrategy.h
Normal 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.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_MELEECOMBATSTRATEGY_H
|
||||
#define _PLAYERBOT_MELEECOMBATSTRATEGY_H
|
||||
|
||||
#include "CombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class MeleeCombatStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
MeleeCombatStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_MELEE; }
|
||||
std::string const getName() override { return "close"; }
|
||||
};
|
||||
|
||||
class SetBehindCombatStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
SetBehindCombatStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "behind"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* 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 "MoveFromGroupStrategy.h"
|
||||
#include "PassiveMultiplier.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
std::vector<NextAction> MoveFromGroupStrategy::getDefaultActions()
|
||||
{
|
||||
return {
|
||||
NextAction("move from group", 1.0f)
|
||||
};
|
||||
}
|
||||
|
||||
void MoveFromGroupStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
{
|
||||
multipliers.push_back(new PassiveMultiplier(botAI));
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 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_MOVEFROMGROUPSTRATEGY_H
|
||||
#define _PLAYERBOT_MOVEFROMGROUPSTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class MoveFromGroupStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
MoveFromGroupStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
std::string const getName() override { return "move from group"; }
|
||||
std::vector<NextAction> getDefaultActions() override;
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
65
src/Scenario/ClassAi/Generic/Strategy/NonCombatStrategy.cpp
Normal file
65
src/Scenario/ClassAi/Generic/Strategy/NonCombatStrategy.cpp
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* 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 "NonCombatStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void NonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("random", { NextAction("clean quest log", 1.0f) }));
|
||||
triggers.push_back(new TriggerNode("timer", { NextAction("check mount state", 1.0f) }));
|
||||
}
|
||||
|
||||
void CollisionStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode("collision", { NextAction("move out of collision", 2.0f) }));
|
||||
}
|
||||
|
||||
void MountStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
}
|
||||
|
||||
void WorldBuffStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"need world buff",
|
||||
{
|
||||
NextAction("world buff", 1.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void MasterFishingStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"very often",
|
||||
{
|
||||
NextAction("move near water" , 10.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"very often",
|
||||
{
|
||||
NextAction("go fishing" , 10.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
triggers.push_back(
|
||||
new TriggerNode(
|
||||
"random",
|
||||
{
|
||||
NextAction("end master fishing", 12.0f),
|
||||
NextAction("equip upgrades", 6.0f)
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
69
src/Scenario/ClassAi/Generic/Strategy/NonCombatStrategy.h
Normal file
69
src/Scenario/ClassAi/Generic/Strategy/NonCombatStrategy.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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_NONCOMBATSTRATEGY_H
|
||||
#define _PLAYERBOT_NONCOMBATSTRATEGY_H
|
||||
|
||||
#include "PassTroughStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class NonCombatStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
NonCombatStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class CollisionStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
CollisionStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "collision"; }
|
||||
};
|
||||
|
||||
class MountStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
MountStrategy(PlayerbotAI* botAI) : Strategy(botAI){};
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "mount"; }
|
||||
};
|
||||
|
||||
class AttackTaggedStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
AttackTaggedStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
std::string const getName() override { return "attack tagged"; }
|
||||
};
|
||||
|
||||
class WorldBuffStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
WorldBuffStrategy(PlayerbotAI* ai) : Strategy(ai) {}
|
||||
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "worldbuff"; }
|
||||
};
|
||||
|
||||
class MasterFishingStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
MasterFishingStrategy(PlayerbotAI* botAI) : Strategy(botAI){}
|
||||
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override {return "master fishing";}
|
||||
};
|
||||
#endif
|
||||
15
src/Scenario/ClassAi/Generic/Strategy/PassTroughStrategy.cpp
Normal file
15
src/Scenario/ClassAi/Generic/Strategy/PassTroughStrategy.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* 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 "PassTroughStrategy.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
void PassTroughStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
for (std::vector<std::string>::iterator i = supported.begin(); i != supported.end(); i++)
|
||||
triggers.push_back(
|
||||
new TriggerNode(i->c_str(), { NextAction(i->c_str(), relevance) }));
|
||||
}
|
||||
25
src/Scenario/ClassAi/Generic/Strategy/PassTroughStrategy.h
Normal file
25
src/Scenario/ClassAi/Generic/Strategy/PassTroughStrategy.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 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_PASSTHROUGHSTRATEGY_H
|
||||
#define _PLAYERBOT_PASSTHROUGHSTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class PassTroughStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
PassTroughStrategy(PlayerbotAI* botAI, float relevance = 100.0f) : Strategy(botAI), relevance(relevance) {}
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
|
||||
protected:
|
||||
std::vector<std::string> supported;
|
||||
float relevance;
|
||||
};
|
||||
|
||||
#endif
|
||||
14
src/Scenario/ClassAi/Generic/Strategy/PassiveStrategy.cpp
Normal file
14
src/Scenario/ClassAi/Generic/Strategy/PassiveStrategy.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* 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 "PassiveStrategy.h"
|
||||
|
||||
#include "PassiveMultiplier.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void PassiveStrategy::InitMultipliers(std::vector<Multiplier*>& multipliers)
|
||||
{
|
||||
multipliers.push_back(new PassiveMultiplier(botAI));
|
||||
}
|
||||
22
src/Scenario/ClassAi/Generic/Strategy/PassiveStrategy.h
Normal file
22
src/Scenario/ClassAi/Generic/Strategy/PassiveStrategy.h
Normal 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_PASSIVESTRATEGY_H
|
||||
#define _PLAYERBOT_PASSIVESTRATEGY_H
|
||||
|
||||
#include "Strategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class PassiveStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
PassiveStrategy(PlayerbotAI* botAI) : Strategy(botAI) {}
|
||||
|
||||
void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
|
||||
std::string const getName() override { return "passive"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user