diff --git a/src/strategy/warlock/WarlockActions.cpp b/src/strategy/warlock/WarlockActions.cpp index 005e268e..627b042a 100644 --- a/src/strategy/warlock/WarlockActions.cpp +++ b/src/strategy/warlock/WarlockActions.cpp @@ -23,3 +23,5 @@ bool CastFearOnCcAction::isPossible() { return botAI->CanCastSpell("fear", GetTa bool CastFearOnCcAction::isUseful() { return true; } bool CastLifeTapAction::isUseful() { return AI_VALUE2(uint8, "health", "self target") > sPlayerbotAIConfig->lowHealth; } + +Unit* UseSoulstoneAction::GetTarget() { return botAI->GetMaster(); } diff --git a/src/strategy/warlock/WarlockActions.h b/src/strategy/warlock/WarlockActions.h index 8f41d0b1..4b29c59b 100644 --- a/src/strategy/warlock/WarlockActions.h +++ b/src/strategy/warlock/WarlockActions.h @@ -7,6 +7,7 @@ #define _PLAYERBOT_WARLOCKACTIONS_H #include "GenericSpellActions.h" +#include "UseItemAction.h" class PlayerbotAI; class Unit; @@ -302,4 +303,12 @@ class CastIncinerateAction : public CastSpellAction public: CastIncinerateAction(PlayerbotAI* ai) : CastSpellAction(ai, "incinerate") {} }; + +class UseSoulstoneAction : public UseSpellItemAction +{ +public: + UseSoulstoneAction(PlayerbotAI* ai) : UseSpellItemAction(ai, "soulstone") {} + + Unit* GetTarget() override; +}; #endif diff --git a/src/strategy/warlock/WarlockAiObjectContext.cpp b/src/strategy/warlock/WarlockAiObjectContext.cpp index 81f888f3..909e874d 100644 --- a/src/strategy/warlock/WarlockAiObjectContext.cpp +++ b/src/strategy/warlock/WarlockAiObjectContext.cpp @@ -184,6 +184,7 @@ public: creators["metamorphosis"] = &WarlockAiObjectContextInternal::metamorphosis; creators["soul fire"] = &WarlockAiObjectContextInternal::soul_fire; creators["incinerate"] = &WarlockAiObjectContextInternal::incinerate; + creators["soulstone"] = &WarlockAiObjectContextInternal::soulstone; } private: @@ -239,6 +240,7 @@ private: static Action* metamorphosis(PlayerbotAI* ai) { return new CastMetamorphosisAction(ai); } static Action* soul_fire(PlayerbotAI* ai) { return new CastSoulFireAction(ai); } static Action* incinerate(PlayerbotAI* ai) { return new CastIncinerateAction(ai); } + static Action* soulstone(PlayerbotAI* ai) { return new UseSoulstoneAction(ai); } }; WarlockAiObjectContext::WarlockAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI)