mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Warlock soulstone action (#753)
* - added warlock soulstone action * - added master as soulstone target
This commit is contained in:
@@ -23,3 +23,5 @@ bool CastFearOnCcAction::isPossible() { return botAI->CanCastSpell("fear", GetTa
|
|||||||
bool CastFearOnCcAction::isUseful() { return true; }
|
bool CastFearOnCcAction::isUseful() { return true; }
|
||||||
|
|
||||||
bool CastLifeTapAction::isUseful() { return AI_VALUE2(uint8, "health", "self target") > sPlayerbotAIConfig->lowHealth; }
|
bool CastLifeTapAction::isUseful() { return AI_VALUE2(uint8, "health", "self target") > sPlayerbotAIConfig->lowHealth; }
|
||||||
|
|
||||||
|
Unit* UseSoulstoneAction::GetTarget() { return botAI->GetMaster(); }
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#define _PLAYERBOT_WARLOCKACTIONS_H
|
#define _PLAYERBOT_WARLOCKACTIONS_H
|
||||||
|
|
||||||
#include "GenericSpellActions.h"
|
#include "GenericSpellActions.h"
|
||||||
|
#include "UseItemAction.h"
|
||||||
|
|
||||||
class PlayerbotAI;
|
class PlayerbotAI;
|
||||||
class Unit;
|
class Unit;
|
||||||
@@ -302,4 +303,12 @@ class CastIncinerateAction : public CastSpellAction
|
|||||||
public:
|
public:
|
||||||
CastIncinerateAction(PlayerbotAI* ai) : CastSpellAction(ai, "incinerate") {}
|
CastIncinerateAction(PlayerbotAI* ai) : CastSpellAction(ai, "incinerate") {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class UseSoulstoneAction : public UseSpellItemAction
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
UseSoulstoneAction(PlayerbotAI* ai) : UseSpellItemAction(ai, "soulstone") {}
|
||||||
|
|
||||||
|
Unit* GetTarget() override;
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -184,6 +184,7 @@ public:
|
|||||||
creators["metamorphosis"] = &WarlockAiObjectContextInternal::metamorphosis;
|
creators["metamorphosis"] = &WarlockAiObjectContextInternal::metamorphosis;
|
||||||
creators["soul fire"] = &WarlockAiObjectContextInternal::soul_fire;
|
creators["soul fire"] = &WarlockAiObjectContextInternal::soul_fire;
|
||||||
creators["incinerate"] = &WarlockAiObjectContextInternal::incinerate;
|
creators["incinerate"] = &WarlockAiObjectContextInternal::incinerate;
|
||||||
|
creators["soulstone"] = &WarlockAiObjectContextInternal::soulstone;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -239,6 +240,7 @@ private:
|
|||||||
static Action* metamorphosis(PlayerbotAI* ai) { return new CastMetamorphosisAction(ai); }
|
static Action* metamorphosis(PlayerbotAI* ai) { return new CastMetamorphosisAction(ai); }
|
||||||
static Action* soul_fire(PlayerbotAI* ai) { return new CastSoulFireAction(ai); }
|
static Action* soul_fire(PlayerbotAI* ai) { return new CastSoulFireAction(ai); }
|
||||||
static Action* incinerate(PlayerbotAI* ai) { return new CastIncinerateAction(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)
|
WarlockAiObjectContext::WarlockAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI)
|
||||||
|
|||||||
Reference in New Issue
Block a user