mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-22 21:16:24 +00:00
Big update.
This commit is contained in:
56
src/strategy/warlock/DpsWarlockStrategy.cpp
Normal file
56
src/strategy/warlock/DpsWarlockStrategy.cpp
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "DpsWarlockStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
class DpsWarlockStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
DpsWarlockStrategyActionNodeFactory()
|
||||
{
|
||||
creators["shadow bolt"] = &shadow_bolt;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* shadow_bolt(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("shadow bolt",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("shoot"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
DpsWarlockStrategy::DpsWarlockStrategy(PlayerbotAI* botAI) : GenericWarlockStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new DpsWarlockStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
NextAction** DpsWarlockStrategy::getDefaultActions()
|
||||
{
|
||||
return NextAction::array(0, new NextAction("incinirate", 10.0f), new NextAction("shadow bolt", 10.0f), nullptr);
|
||||
}
|
||||
|
||||
void DpsWarlockStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
GenericWarlockStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("backlash", NextAction::array(0, new NextAction("shadow bolt", 20.0f), nullptr)));
|
||||
}
|
||||
|
||||
void DpsAoeWarlockStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("rain of fire", 37.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("corruption on attacker", NextAction::array(0, new NextAction("corruption on attacker", 27.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("curse of agony on attacker", NextAction::array(0, new NextAction("curse of agony on attacker", 28.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("siphon life on attacker", NextAction::array(0, new NextAction("siphon life on attacker", 29.0f), nullptr)));
|
||||
}
|
||||
|
||||
void DpsWarlockDebuffStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("corruption", NextAction::array(0, new NextAction("corruption", 22.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("curse of agony", NextAction::array(0, new NextAction("curse of agony", 21.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("siphon life", NextAction::array(0, new NextAction("siphon life", 23.0f), nullptr)));
|
||||
}
|
||||
40
src/strategy/warlock/DpsWarlockStrategy.h
Normal file
40
src/strategy/warlock/DpsWarlockStrategy.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_DPSWARLOCKSTRATEGY_H
|
||||
#define _PLAYERBOT_DPSWARLOCKSTRATEGY_H
|
||||
|
||||
#include "GenericWarlockStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class DpsWarlockStrategy : public GenericWarlockStrategy
|
||||
{
|
||||
public:
|
||||
DpsWarlockStrategy(PlayerbotAI* botAI);
|
||||
|
||||
std::string const getName() override { return "dps"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
NextAction** getDefaultActions() override;
|
||||
};
|
||||
|
||||
class DpsAoeWarlockStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
DpsAoeWarlockStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "aoe"; }
|
||||
};
|
||||
|
||||
class DpsWarlockDebuffStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
DpsWarlockDebuffStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) { }
|
||||
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
std::string const getName() override { return "dps debuff"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
80
src/strategy/warlock/GenericWarlockNonCombatStrategy.cpp
Normal file
80
src/strategy/warlock/GenericWarlockNonCombatStrategy.cpp
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "GenericWarlockNonCombatStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
class GenericWarlockNonCombatStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
GenericWarlockNonCombatStrategyActionNodeFactory()
|
||||
{
|
||||
creators["fel armor"] = &fel_armor;
|
||||
creators["demon armor"] = &demon_armor;
|
||||
creators["summon voidwalker"] = &summon_voidwalker;
|
||||
creators["summon felguard"] = &summon_felguard;
|
||||
creators["summon succubus"] = &summon_succubus;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* fel_armor(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("fel armor",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("demon armor"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
|
||||
static ActionNode* demon_armor(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("demon armor",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("demon skin"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
|
||||
static ActionNode* summon_voidwalker(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("summon voidwalker",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("summon imp"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
|
||||
static ActionNode* summon_felguard(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("summon felguard",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("summon succubus"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
|
||||
static ActionNode* summon_succubus(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("summon succubus",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("summon voidwalker"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
GenericWarlockNonCombatStrategy::GenericWarlockNonCombatStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new GenericWarlockNonCombatStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
void GenericWarlockNonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
NonCombatStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("demon armor", NextAction::array(0, new NextAction("fel armor", 21.0f), nullptr)));
|
||||
}
|
||||
|
||||
void WarlockPetStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("summon felguard", 60.0f), nullptr)));
|
||||
// TODO Warlock pets
|
||||
|
||||
triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("apply oil", 1.0f), nullptr)));
|
||||
}
|
||||
30
src/strategy/warlock/GenericWarlockNonCombatStrategy.h
Normal file
30
src/strategy/warlock/GenericWarlockNonCombatStrategy.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_GENERICWARLOCKNONCOMBATSTRATEGY_H
|
||||
#define _PLAYERBOT_GENERICWARLOCKNONCOMBATSTRATEGY_H
|
||||
|
||||
#include "NonCombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class GenericWarlockNonCombatStrategy : public NonCombatStrategy
|
||||
{
|
||||
public:
|
||||
GenericWarlockNonCombatStrategy(PlayerbotAI* botAI);
|
||||
|
||||
std::string const getName() override { return "nc"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class WarlockPetStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
WarlockPetStrategy(PlayerbotAI* botAI) : Strategy(botAI) { }
|
||||
|
||||
std::string const getName() override { return "pet"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
64
src/strategy/warlock/GenericWarlockStrategy.cpp
Normal file
64
src/strategy/warlock/GenericWarlockStrategy.cpp
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "GenericWarlockStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
class GenericWarlockStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
GenericWarlockStrategyActionNodeFactory()
|
||||
{
|
||||
//creators["summon voidwalker"] = &summon_voidwalker;
|
||||
creators["banish"] = &banish;
|
||||
}
|
||||
|
||||
private:
|
||||
//static ActionNode* summon_voidwalker(PlayerbotAI* botAI)
|
||||
//{
|
||||
//return new ActionNode ("summon voidwalker",
|
||||
/*P*/ //nullptr,
|
||||
/*A*/ //NextAction::array(0, new NextAction("drain soul"), nullptr),
|
||||
/*C*/ //nullptr);
|
||||
//}
|
||||
static ActionNode* banish(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("banish",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("fear"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
GenericWarlockStrategy::GenericWarlockStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new GenericWarlockStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
NextAction** GenericWarlockStrategy::getDefaultActions()
|
||||
{
|
||||
return NextAction::array(0, new NextAction("shoot", 10.0f), nullptr);
|
||||
}
|
||||
|
||||
void GenericWarlockStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
CombatStrategy::InitTriggers(triggers);
|
||||
|
||||
triggers.push_back(new TriggerNode("shadow trance", NextAction::array(0, new NextAction("shadow bolt", 20.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("drain life", 40.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("medium mana", NextAction::array(0, new NextAction("life tap", ACTION_EMERGENCY + 5), nullptr)));
|
||||
triggers.push_back(new TriggerNode("target critical health", NextAction::array(0, new NextAction("drain soul", 30.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("immolate", NextAction::array(0, new NextAction("immolate", 13.0f), new NextAction("conflagrate", 13.0f), nullptr)));
|
||||
}
|
||||
|
||||
void WarlockBoostStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("amplify curse", NextAction::array(0, new NextAction("amplify curse", 41.0f), nullptr)));
|
||||
}
|
||||
|
||||
void WarlockCcStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
triggers.push_back(new TriggerNode("banish", NextAction::array(0, new NextAction("banish on cc", 32.0f), nullptr)));
|
||||
triggers.push_back(new TriggerNode("fear", NextAction::array(0, new NextAction("fear on cc", 33.0f), nullptr)));
|
||||
}
|
||||
40
src/strategy/warlock/GenericWarlockStrategy.h
Normal file
40
src/strategy/warlock/GenericWarlockStrategy.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_GENERICWARLOCKSTRATEGY_H
|
||||
#define _PLAYERBOT_GENERICWARLOCKSTRATEGY_H
|
||||
|
||||
#include "CombatStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class GenericWarlockStrategy : public CombatStrategy
|
||||
{
|
||||
public:
|
||||
GenericWarlockStrategy(PlayerbotAI* botAI);
|
||||
|
||||
std::string const getName() override { return "warlock"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
NextAction** getDefaultActions() override;
|
||||
};
|
||||
|
||||
class WarlockBoostStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
WarlockBoostStrategy(PlayerbotAI* botAI) : Strategy(botAI) { };
|
||||
|
||||
std::string const getName() override { return "boost"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
class WarlockCcStrategy : public Strategy
|
||||
{
|
||||
public:
|
||||
WarlockCcStrategy(PlayerbotAI* botAI) : Strategy(botAI) { };
|
||||
|
||||
std::string const getName() override { return "cc"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
57
src/strategy/warlock/TankWarlockStrategy.cpp
Normal file
57
src/strategy/warlock/TankWarlockStrategy.cpp
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "TankWarlockStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
class GenericWarlockStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
||||
{
|
||||
public:
|
||||
GenericWarlockStrategyActionNodeFactory()
|
||||
{
|
||||
creators["summon voidwalker"] = &summon_voidwalker;
|
||||
creators["summon felguard"] = &summon_felguard;
|
||||
creators["summon succubus"] = &summon_succubus;
|
||||
}
|
||||
|
||||
private:
|
||||
static ActionNode* summon_voidwalker(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("summon voidwalker",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("summon imp"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
|
||||
static ActionNode* summon_felguard(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode ("summon felguard",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("summon succubus"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
|
||||
static ActionNode* summon_succubus(PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("summon succubus",
|
||||
/*P*/ nullptr,
|
||||
/*A*/ NextAction::array(0, new NextAction("summon voidwalker"), nullptr),
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
TankWarlockStrategy::TankWarlockStrategy(PlayerbotAI* botAI) : GenericWarlockStrategy(botAI)
|
||||
{
|
||||
actionNodeFactories.Add(new GenericWarlockStrategyActionNodeFactory());
|
||||
}
|
||||
|
||||
NextAction** TankWarlockStrategy::getDefaultActions()
|
||||
{
|
||||
return NextAction::array(0, new NextAction("shoot", 10.0f), nullptr);
|
||||
}
|
||||
|
||||
void TankWarlockStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
{
|
||||
GenericWarlockStrategy::InitTriggers(triggers);
|
||||
}
|
||||
22
src/strategy/warlock/TankWarlockStrategy.h
Normal file
22
src/strategy/warlock/TankWarlockStrategy.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_TANKWARLOCKSTRATEGY_H
|
||||
#define _PLAYERBOT_TANKWARLOCKSTRATEGY_H
|
||||
|
||||
#include "GenericWarlockStrategy.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class TankWarlockStrategy : public GenericWarlockStrategy
|
||||
{
|
||||
public:
|
||||
TankWarlockStrategy(PlayerbotAI* botAI);
|
||||
|
||||
std::string const getName() override { return "tank"; }
|
||||
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
|
||||
NextAction** getDefaultActions() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
47
src/strategy/warlock/WarlockActions.cpp
Normal file
47
src/strategy/warlock/WarlockActions.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "WarlockActions.h"
|
||||
#include "Event.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
bool CastDrainSoulAction::isUseful()
|
||||
{
|
||||
return AI_VALUE2(uint32, "item count", "soul shard") < uint32(AI_VALUE(uint8, "bag space") * 0.2);
|
||||
}
|
||||
|
||||
Value<Unit*>* CastBanishAction::GetTargetValue()
|
||||
{
|
||||
return context->GetValue<Unit*>("cc target", "banish");
|
||||
}
|
||||
|
||||
bool CastBanishAction::Execute(Event event)
|
||||
{
|
||||
return botAI->CastSpell("banish", GetTarget());
|
||||
}
|
||||
|
||||
Value<Unit*>* CastFearOnCcAction::GetTargetValue()
|
||||
{
|
||||
return context->GetValue<Unit*>("cc target", "fear");
|
||||
}
|
||||
|
||||
bool CastFearOnCcAction::Execute(Event event)
|
||||
{
|
||||
return botAI->CastSpell("fear", GetTarget());
|
||||
}
|
||||
|
||||
bool CastFearOnCcAction::isPossible()
|
||||
{
|
||||
return botAI->CanCastSpell("fear", GetTarget());
|
||||
}
|
||||
|
||||
bool CastFearOnCcAction::isUseful()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CastLifeTapAction::isUseful()
|
||||
{
|
||||
return AI_VALUE2(uint8, "health", "self target") > sPlayerbotAIConfig->lowHealth;
|
||||
}
|
||||
215
src/strategy/warlock/WarlockActions.h
Normal file
215
src/strategy/warlock/WarlockActions.h
Normal file
@@ -0,0 +1,215 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_WARLOCKACTIONS_H
|
||||
#define _PLAYERBOT_WARLOCKACTIONS_H
|
||||
|
||||
#include "GenericSpellActions.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
class Unit;
|
||||
|
||||
class CastDemonSkinAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastDemonSkinAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "demon skin") { }
|
||||
};
|
||||
|
||||
class CastDemonArmorAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastDemonArmorAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "demon armor") { }
|
||||
};
|
||||
|
||||
class CastFelArmorAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastFelArmorAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "fel armor") { }
|
||||
};
|
||||
|
||||
BEGIN_RANGED_SPELL_ACTION(CastShadowBoltAction, "shadow bolt")
|
||||
END_SPELL_ACTION()
|
||||
|
||||
class CastDrainSoulAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastDrainSoulAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "drain soul") { }
|
||||
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
class CastDrainManaAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastDrainManaAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "drain mana") { }
|
||||
};
|
||||
|
||||
class CastDrainLifeAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastDrainLifeAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "drain life") { }
|
||||
};
|
||||
|
||||
class CastCurseOfAgonyAction : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastCurseOfAgonyAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "curse of agony") { }
|
||||
};
|
||||
|
||||
class CastCurseOfWeaknessAction : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastCurseOfWeaknessAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "curse of weakness") { }
|
||||
};
|
||||
|
||||
class CastCorruptionAction : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastCorruptionAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "corruption") { }
|
||||
};
|
||||
|
||||
class CastCorruptionOnAttackerAction : public CastDebuffSpellOnAttackerAction
|
||||
{
|
||||
public:
|
||||
CastCorruptionOnAttackerAction(PlayerbotAI* botAI) : CastDebuffSpellOnAttackerAction(botAI, "corruption") { }
|
||||
};
|
||||
|
||||
class CastCurseOfAgonyOnAttackerAction : public CastDebuffSpellOnAttackerAction
|
||||
{
|
||||
public:
|
||||
CastCurseOfAgonyOnAttackerAction(PlayerbotAI* botAI) : CastDebuffSpellOnAttackerAction(botAI, "curse of agony") { }
|
||||
};
|
||||
|
||||
class CastSummonVoidwalkerAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastSummonVoidwalkerAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "summon voidwalker") { }
|
||||
};
|
||||
|
||||
class CastSummonFelguardAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastSummonFelguardAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "summon felguard") { }
|
||||
};
|
||||
|
||||
class CastSummonImpAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastSummonImpAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "summon imp") { }
|
||||
};
|
||||
|
||||
class CastSummonSuccubusAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastSummonSuccubusAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "summon succubus") { }
|
||||
};
|
||||
|
||||
class CastCreateHealthstoneAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastCreateHealthstoneAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "create healthstone") { }
|
||||
};
|
||||
|
||||
class CastCreateFirestoneAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastCreateFirestoneAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "create firestone") { }
|
||||
};
|
||||
|
||||
class CastCreateSpellstoneAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastCreateSpellstoneAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "create spellstone") { }
|
||||
};
|
||||
|
||||
class CastBanishAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastBanishAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "banish on cc") { }
|
||||
|
||||
Value<Unit*>* GetTargetValue() override;
|
||||
bool Execute(Event event) override;
|
||||
};
|
||||
|
||||
class CastSeedOfCorruptionAction : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastSeedOfCorruptionAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "seed of corruption") { }
|
||||
};
|
||||
|
||||
class CastRainOfFireAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastRainOfFireAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "rain of fire") { }
|
||||
};
|
||||
|
||||
class CastShadowfuryAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastShadowfuryAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "shadowfury") { }
|
||||
};
|
||||
|
||||
class CastImmolateAction : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastImmolateAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "immolate") { }
|
||||
};
|
||||
|
||||
class CastConflagrateAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastConflagrateAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "conflagrate") { }
|
||||
};
|
||||
|
||||
class CastIncinirateAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastIncinirateAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "incinirate") { }
|
||||
};
|
||||
|
||||
class CastFearAction : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastFearAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "fear") { }
|
||||
};
|
||||
|
||||
class CastFearOnCcAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastFearOnCcAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "fear on cc") { }
|
||||
|
||||
Value<Unit*>* GetTargetValue() override;
|
||||
bool Execute(Event event) override;
|
||||
bool isPossible() override;
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
class CastLifeTapAction: public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastLifeTapAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "life tap") { }
|
||||
|
||||
std::string const GetTargetName() override { return "self target"; }
|
||||
bool isUseful() override;
|
||||
};
|
||||
|
||||
class CastAmplifyCurseAction : public CastBuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastAmplifyCurseAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "amplify curse") { }
|
||||
};
|
||||
|
||||
class CastSiphonLifeAction : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastSiphonLifeAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "siphon life") { }
|
||||
};
|
||||
|
||||
class CastSiphonLifeOnAttackerAction : public CastDebuffSpellOnAttackerAction
|
||||
{
|
||||
public:
|
||||
CastSiphonLifeOnAttackerAction(PlayerbotAI* botAI) : CastDebuffSpellOnAttackerAction(botAI, "siphon life") { }
|
||||
};
|
||||
|
||||
#endif
|
||||
180
src/strategy/warlock/WarlockAiObjectContext.cpp
Normal file
180
src/strategy/warlock/WarlockAiObjectContext.cpp
Normal file
@@ -0,0 +1,180 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "WarlockAiObjectContext.h"
|
||||
#include "DpsWarlockStrategy.h"
|
||||
#include "GenericWarlockNonCombatStrategy.h"
|
||||
#include "TankWarlockStrategy.h"
|
||||
#include "WarlockActions.h"
|
||||
#include "WarlockTriggers.h"
|
||||
#include "NamedObjectContext.h"
|
||||
#include "UseItemAction.h"
|
||||
#include "PullStrategy.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
class WarlockStrategyFactoryInternal : public NamedObjectContext<Strategy>
|
||||
{
|
||||
public:
|
||||
WarlockStrategyFactoryInternal()
|
||||
{
|
||||
creators["nc"] = &WarlockStrategyFactoryInternal::nc;
|
||||
creators["pull"] = &WarlockStrategyFactoryInternal::pull;
|
||||
creators["aoe"] = &WarlockStrategyFactoryInternal::aoe;
|
||||
creators["dps debuff"] = &WarlockStrategyFactoryInternal::dps_debuff;
|
||||
creators["boost"] = &WarlockStrategyFactoryInternal::boost;
|
||||
creators["cc"] = &WarlockStrategyFactoryInternal::cc;
|
||||
creators["pet"] = &WarlockStrategyFactoryInternal::pet;
|
||||
}
|
||||
|
||||
private:
|
||||
static Strategy* pet(PlayerbotAI* botAI) { return new WarlockPetStrategy(botAI); }
|
||||
static Strategy* nc(PlayerbotAI* botAI) { return new GenericWarlockNonCombatStrategy(botAI); }
|
||||
static Strategy* aoe(PlayerbotAI* botAI) { return new DpsAoeWarlockStrategy(botAI); }
|
||||
static Strategy* dps_debuff(PlayerbotAI* botAI) { return new DpsWarlockDebuffStrategy(botAI); }
|
||||
static Strategy* pull(PlayerbotAI* botAI) { return new PullStrategy(botAI, "shoot"); }
|
||||
static Strategy* boost(PlayerbotAI* botAI) { return new WarlockBoostStrategy(botAI); }
|
||||
static Strategy* cc(PlayerbotAI* botAI) { return new WarlockCcStrategy(botAI); }
|
||||
};
|
||||
|
||||
class WarlockCombatStrategyFactoryInternal : public NamedObjectContext<Strategy>
|
||||
{
|
||||
public:
|
||||
WarlockCombatStrategyFactoryInternal() : NamedObjectContext<Strategy>(false, true)
|
||||
{
|
||||
creators["dps"] = &WarlockCombatStrategyFactoryInternal::dps;
|
||||
creators["tank"] = &WarlockCombatStrategyFactoryInternal::tank;
|
||||
}
|
||||
|
||||
private:
|
||||
static Strategy* tank(PlayerbotAI* botAI) { return new TankWarlockStrategy(botAI); }
|
||||
static Strategy* dps(PlayerbotAI* botAI) { return new DpsWarlockStrategy(botAI); }
|
||||
};
|
||||
|
||||
class WarlockTriggerFactoryInternal : public NamedObjectContext<Trigger>
|
||||
{
|
||||
public:
|
||||
WarlockTriggerFactoryInternal()
|
||||
{
|
||||
creators["shadow trance"] = &WarlockTriggerFactoryInternal::shadow_trance;
|
||||
creators["demon armor"] = &WarlockTriggerFactoryInternal::demon_armor;
|
||||
creators["no healthstone"] = &WarlockTriggerFactoryInternal::HasHealthstone;
|
||||
creators["no firestone"] = &WarlockTriggerFactoryInternal::HasFirestone;
|
||||
creators["no spellstone"] = &WarlockTriggerFactoryInternal::HasSpellstone;
|
||||
creators["corruption"] = &WarlockTriggerFactoryInternal::corruption;
|
||||
creators["corruption on attacker"] = &WarlockTriggerFactoryInternal::corruption_on_attacker;
|
||||
creators["curse of agony"] = &WarlockTriggerFactoryInternal::curse_of_agony;
|
||||
creators["curse of agony on attacker"] = &WarlockTriggerFactoryInternal::curse_of_agony_on_attacker;
|
||||
creators["banish"] = &WarlockTriggerFactoryInternal::banish;
|
||||
creators["spellstone"] = &WarlockTriggerFactoryInternal::spellstone;
|
||||
creators["backlash"] = &WarlockTriggerFactoryInternal::backlash;
|
||||
creators["fear"] = &WarlockTriggerFactoryInternal::fear;
|
||||
creators["immolate"] = &WarlockTriggerFactoryInternal::immolate;
|
||||
creators["amplify curse"] = &WarlockTriggerFactoryInternal::amplify_curse;
|
||||
creators["siphon life"] = &WarlockTriggerFactoryInternal::siphon_life;
|
||||
creators["siphon life on attacker"] = &WarlockTriggerFactoryInternal::siphon_life_on_attacker;
|
||||
}
|
||||
|
||||
private:
|
||||
static Trigger* amplify_curse(PlayerbotAI* botAI) { return new AmplifyCurseTrigger(botAI); }
|
||||
static Trigger* shadow_trance(PlayerbotAI* botAI) { return new ShadowTranceTrigger(botAI); }
|
||||
static Trigger* demon_armor(PlayerbotAI* botAI) { return new DemonArmorTrigger(botAI); }
|
||||
static Trigger* HasHealthstone(PlayerbotAI* botAI) { return new HasHealthstoneTrigger(botAI); }
|
||||
static Trigger* HasFirestone(PlayerbotAI* botAI) { return new HasFirestoneTrigger(botAI); }
|
||||
static Trigger* HasSpellstone(PlayerbotAI* botAI) { return new HasSpellstoneTrigger(botAI); }
|
||||
static Trigger* corruption(PlayerbotAI* botAI) { return new CorruptionTrigger(botAI); }
|
||||
static Trigger* corruption_on_attacker(PlayerbotAI* botAI) { return new CorruptionOnAttackerTrigger(botAI); }
|
||||
static Trigger* siphon_life(PlayerbotAI* botAI) { return new SiphonLifeTrigger(botAI); }
|
||||
static Trigger* siphon_life_on_attacker(PlayerbotAI* botAI) { return new SiphonLifeOnAttackerTrigger(botAI); }
|
||||
static Trigger* curse_of_agony(PlayerbotAI* botAI) { return new CurseOfAgonyTrigger(botAI); }
|
||||
static Trigger* curse_of_agony_on_attacker(PlayerbotAI* botAI) { return new CastCurseOfAgonyOnAttackerTrigger(botAI); }
|
||||
static Trigger* banish(PlayerbotAI* botAI) { return new BanishTrigger(botAI); }
|
||||
static Trigger* spellstone(PlayerbotAI* botAI) { return new SpellstoneTrigger(botAI); }
|
||||
static Trigger* backlash(PlayerbotAI* botAI) { return new BacklashTrigger(botAI); }
|
||||
static Trigger* fear(PlayerbotAI* botAI) { return new FearTrigger(botAI); }
|
||||
static Trigger* immolate(PlayerbotAI* botAI) { return new ImmolateTrigger(botAI); }
|
||||
};
|
||||
|
||||
class WarlockAiObjectContextInternal : public NamedObjectContext<Action>
|
||||
{
|
||||
public:
|
||||
WarlockAiObjectContextInternal()
|
||||
{
|
||||
creators["fel armor"] = &WarlockAiObjectContextInternal::fel_armor;
|
||||
creators["demon armor"] = &WarlockAiObjectContextInternal::demon_armor;
|
||||
creators["demon skin"] = &WarlockAiObjectContextInternal::demon_skin;
|
||||
creators["create healthstone"] = &WarlockAiObjectContextInternal::create_healthstone;
|
||||
creators["create firestone"] = &WarlockAiObjectContextInternal::create_firestone;
|
||||
creators["create spellstone"] = &WarlockAiObjectContextInternal::create_spellstone;
|
||||
creators["spellstone"] = &WarlockAiObjectContextInternal::spellstone;
|
||||
creators["summon voidwalker"] = &WarlockAiObjectContextInternal::summon_voidwalker;
|
||||
creators["summon felguard"] = &WarlockAiObjectContextInternal::summon_felguard;
|
||||
creators["summon succubus"] = &WarlockAiObjectContextInternal::summon_succubus;
|
||||
creators["summon imp"] = &WarlockAiObjectContextInternal::summon_imp;
|
||||
creators["immolate"] = &WarlockAiObjectContextInternal::immolate;
|
||||
creators["corruption"] = &WarlockAiObjectContextInternal::corruption;
|
||||
creators["corruption on attacker"] = &WarlockAiObjectContextInternal::corruption_on_attacker;
|
||||
creators["siphon life"] = &WarlockAiObjectContextInternal::siphon_life;
|
||||
creators["siphon life on attacker"] = &WarlockAiObjectContextInternal::siphon_life_on_attacker;
|
||||
creators["curse of agony"] = &WarlockAiObjectContextInternal::curse_of_agony;
|
||||
creators["curse of agony on attacker"] = &WarlockAiObjectContextInternal::curse_of_agony_on_attacker;
|
||||
creators["shadow bolt"] = &WarlockAiObjectContextInternal::shadow_bolt;
|
||||
creators["drain soul"] = &WarlockAiObjectContextInternal::drain_soul;
|
||||
creators["drain mana"] = &WarlockAiObjectContextInternal::drain_mana;
|
||||
creators["drain life"] = &WarlockAiObjectContextInternal::drain_life;
|
||||
creators["banish"] = &WarlockAiObjectContextInternal::banish;
|
||||
creators["banish on cc"] = &WarlockAiObjectContextInternal::banish_on_cc;
|
||||
creators["seed of corruption"] = &WarlockAiObjectContextInternal::seed_of_corruption;
|
||||
creators["rain of fire"] = &WarlockAiObjectContextInternal::rain_of_fire;
|
||||
creators["shadowfury"] = &WarlockAiObjectContextInternal::shadowfury;
|
||||
creators["life tap"] = &WarlockAiObjectContextInternal::life_tap;
|
||||
creators["fear"] = &WarlockAiObjectContextInternal::fear;
|
||||
creators["fear on cc"] = &WarlockAiObjectContextInternal::fear_on_cc;
|
||||
creators["incinirate"] = &WarlockAiObjectContextInternal::incinirate;
|
||||
creators["conflagrate"] = &WarlockAiObjectContextInternal::conflagrate;
|
||||
creators["amplify curse"] = &WarlockAiObjectContextInternal::amplify_curse;
|
||||
}
|
||||
|
||||
private:
|
||||
static Action* amplify_curse(PlayerbotAI* botAI) { return new CastAmplifyCurseAction(botAI); }
|
||||
static Action* conflagrate(PlayerbotAI* botAI) { return new CastConflagrateAction(botAI); }
|
||||
static Action* incinirate(PlayerbotAI* botAI) { return new CastIncinirateAction(botAI); }
|
||||
static Action* fear_on_cc(PlayerbotAI* botAI) { return new CastFearOnCcAction(botAI); }
|
||||
static Action* fear(PlayerbotAI* botAI) { return new CastFearAction(botAI); }
|
||||
static Action* immolate(PlayerbotAI* botAI) { return new CastImmolateAction(botAI); }
|
||||
static Action* summon_imp(PlayerbotAI* botAI) { return new CastSummonImpAction(botAI); }
|
||||
static Action* summon_succubus(PlayerbotAI* botAI) { return new CastSummonSuccubusAction(botAI); }
|
||||
static Action* fel_armor(PlayerbotAI* botAI) { return new CastFelArmorAction(botAI); }
|
||||
static Action* demon_armor(PlayerbotAI* botAI) { return new CastDemonArmorAction(botAI); }
|
||||
static Action* demon_skin(PlayerbotAI* botAI) { return new CastDemonSkinAction(botAI); }
|
||||
static Action* create_healthstone(PlayerbotAI* botAI) { return new CastCreateHealthstoneAction(botAI); }
|
||||
static Action* create_firestone(PlayerbotAI* botAI) { return new CastCreateFirestoneAction(botAI); }
|
||||
static Action* create_spellstone(PlayerbotAI* botAI) { return new CastCreateSpellstoneAction(botAI); }
|
||||
static Action* spellstone(PlayerbotAI* botAI) { return new UseSpellItemAction(botAI, "spellstone", true); }
|
||||
static Action* summon_voidwalker(PlayerbotAI* botAI) { return new CastSummonVoidwalkerAction(botAI); }
|
||||
static Action* summon_felguard(PlayerbotAI* botAI) { return new CastSummonFelguardAction(botAI); }
|
||||
static Action* corruption(PlayerbotAI* botAI) { return new CastCorruptionAction(botAI); }
|
||||
static Action* corruption_on_attacker(PlayerbotAI* botAI) { return new CastCorruptionOnAttackerAction(botAI); }
|
||||
static Action* siphon_life(PlayerbotAI* botAI) { return new CastSiphonLifeAction(botAI); }
|
||||
static Action* siphon_life_on_attacker(PlayerbotAI* botAI) { return new CastSiphonLifeOnAttackerAction(botAI); }
|
||||
static Action* curse_of_agony(PlayerbotAI* botAI) { return new CastCurseOfAgonyAction(botAI); }
|
||||
static Action* curse_of_agony_on_attacker(PlayerbotAI* botAI) { return new CastCurseOfAgonyOnAttackerAction(botAI); }
|
||||
static Action* shadow_bolt(PlayerbotAI* botAI) { return new CastShadowBoltAction(botAI); }
|
||||
static Action* drain_soul(PlayerbotAI* botAI) { return new CastDrainSoulAction(botAI); }
|
||||
static Action* drain_mana(PlayerbotAI* botAI) { return new CastDrainManaAction(botAI); }
|
||||
static Action* drain_life(PlayerbotAI* botAI) { return new CastDrainLifeAction(botAI); }
|
||||
static Action* banish(PlayerbotAI* botAI) { return new CastBanishAction(botAI); }
|
||||
static Action* banish_on_cc(PlayerbotAI* botAI) { return new CastBanishAction(botAI); }
|
||||
static Action* seed_of_corruption(PlayerbotAI* botAI) { return new CastSeedOfCorruptionAction(botAI); }
|
||||
static Action* rain_of_fire(PlayerbotAI* botAI) { return new CastRainOfFireAction(botAI); }
|
||||
static Action* shadowfury(PlayerbotAI* botAI) { return new CastShadowfuryAction(botAI); }
|
||||
static Action* life_tap(PlayerbotAI* botAI) { return new CastLifeTapAction(botAI); }
|
||||
};
|
||||
|
||||
WarlockAiObjectContext::WarlockAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI)
|
||||
{
|
||||
strategyContexts.Add(new WarlockStrategyFactoryInternal());
|
||||
strategyContexts.Add(new WarlockCombatStrategyFactoryInternal());
|
||||
actionContexts.Add(new WarlockAiObjectContextInternal());
|
||||
triggerContexts.Add(new WarlockTriggerFactoryInternal());
|
||||
}
|
||||
18
src/strategy/warlock/WarlockAiObjectContext.h
Normal file
18
src/strategy/warlock/WarlockAiObjectContext.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_WARLOCKAIOBJECTCONTEXT_H
|
||||
#define _PLAYERBOT_WARLOCKAIOBJECTCONTEXT_H
|
||||
|
||||
#include "AiObjectContext.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class WarlockAiObjectContext : public AiObjectContext
|
||||
{
|
||||
public:
|
||||
WarlockAiObjectContext(PlayerbotAI* botAI);
|
||||
};
|
||||
|
||||
#endif
|
||||
22
src/strategy/warlock/WarlockTriggers.cpp
Normal file
22
src/strategy/warlock/WarlockTriggers.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "WarlockTriggers.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
bool DemonArmorTrigger::IsActive()
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
return !botAI->HasAura("demon skin", target) && !botAI->HasAura("demon armor", target) && !botAI->HasAura("fel armor", target);
|
||||
}
|
||||
|
||||
bool SpellstoneTrigger::IsActive()
|
||||
{
|
||||
return BuffTrigger::IsActive() && AI_VALUE2(uint32, "item count", getName()) > 0;
|
||||
}
|
||||
|
||||
bool WarlockConjuredItemTrigger::IsActive()
|
||||
{
|
||||
return ItemCountTrigger::IsActive() && AI_VALUE2(uint32, "item count", "soul shard") > 0;
|
||||
}
|
||||
108
src/strategy/warlock/WarlockTriggers.h
Normal file
108
src/strategy/warlock/WarlockTriggers.h
Normal file
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_WARLOCKTRIGGERS_H
|
||||
#define _PLAYERBOT_WARLOCKTRIGGERS_H
|
||||
|
||||
#include "GenericTriggers.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class DemonArmorTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
DemonArmorTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "demon armor") { }
|
||||
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class SpellstoneTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
SpellstoneTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "spellstone") { }
|
||||
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
DEBUFF_TRIGGER(CurseOfAgonyTrigger, "curse of agony");
|
||||
DEBUFF_TRIGGER(CorruptionTrigger, "corruption");
|
||||
DEBUFF_TRIGGER(SiphonLifeTrigger, "siphon life");
|
||||
|
||||
class CorruptionOnAttackerTrigger : public DebuffOnAttackerTrigger
|
||||
{
|
||||
public:
|
||||
CorruptionOnAttackerTrigger(PlayerbotAI* botAI) : DebuffOnAttackerTrigger(botAI, "corruption") { }
|
||||
};
|
||||
|
||||
class CastCurseOfAgonyOnAttackerTrigger : public DebuffOnAttackerTrigger
|
||||
{
|
||||
public:
|
||||
CastCurseOfAgonyOnAttackerTrigger(PlayerbotAI* botAI) : DebuffOnAttackerTrigger(botAI, "curse of agony") { }
|
||||
};
|
||||
|
||||
class SiphonLifeOnAttackerTrigger : public DebuffOnAttackerTrigger
|
||||
{
|
||||
public:
|
||||
SiphonLifeOnAttackerTrigger(PlayerbotAI* botAI) : DebuffOnAttackerTrigger(botAI, "siphon life") { }
|
||||
};
|
||||
|
||||
DEBUFF_TRIGGER(ImmolateTrigger, "immolate");
|
||||
|
||||
class ShadowTranceTrigger : public HasAuraTrigger
|
||||
{
|
||||
public:
|
||||
ShadowTranceTrigger(PlayerbotAI* botAI) : HasAuraTrigger(botAI, "shadow trance") { }
|
||||
};
|
||||
|
||||
class BacklashTrigger : public HasAuraTrigger
|
||||
{
|
||||
public:
|
||||
BacklashTrigger(PlayerbotAI* botAI) : HasAuraTrigger(botAI, "backlash") { }
|
||||
};
|
||||
|
||||
class BanishTrigger : public HasCcTargetTrigger
|
||||
{
|
||||
public:
|
||||
BanishTrigger(PlayerbotAI* botAI) : HasCcTargetTrigger(botAI, "banish") { }
|
||||
};
|
||||
|
||||
class WarlockConjuredItemTrigger : public ItemCountTrigger
|
||||
{
|
||||
public:
|
||||
WarlockConjuredItemTrigger(PlayerbotAI* botAI, std::string const item) : ItemCountTrigger(botAI, item, 1) { }
|
||||
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class HasSpellstoneTrigger : public WarlockConjuredItemTrigger
|
||||
{
|
||||
public:
|
||||
HasSpellstoneTrigger(PlayerbotAI* botAI) : WarlockConjuredItemTrigger(botAI, "spellstone") { }
|
||||
};
|
||||
|
||||
class HasFirestoneTrigger : public WarlockConjuredItemTrigger
|
||||
{
|
||||
public:
|
||||
HasFirestoneTrigger(PlayerbotAI* botAI) : WarlockConjuredItemTrigger(botAI, "firestone") { }
|
||||
};
|
||||
|
||||
class HasHealthstoneTrigger : public WarlockConjuredItemTrigger
|
||||
{
|
||||
public:
|
||||
HasHealthstoneTrigger(PlayerbotAI* botAI) : WarlockConjuredItemTrigger(botAI, "healthstone") { }
|
||||
};
|
||||
|
||||
class FearTrigger : public HasCcTargetTrigger
|
||||
{
|
||||
public:
|
||||
FearTrigger(PlayerbotAI* botAI) : HasCcTargetTrigger(botAI, "fear") { }
|
||||
};
|
||||
|
||||
class AmplifyCurseTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
AmplifyCurseTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "amplify curse") { }
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user