mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-23 05:26:22 +00:00
debuff on attacker
This commit is contained in:
@@ -292,3 +292,7 @@ Value<Unit*>* BuffOnMainTankAction::GetTargetValue()
|
||||
return context->GetValue<Unit*>("main tank", spell);
|
||||
}
|
||||
|
||||
bool CastDebuffSpellAction::isUseful()
|
||||
{
|
||||
return CastAuraSpellAction::isUseful() && GetTarget() && (GetTarget()->GetHealth() / AI_VALUE(float, "expected group dps")) >= needLifeTime;
|
||||
}
|
||||
@@ -50,13 +50,16 @@ class CastMeleeSpellAction : public CastSpellAction
|
||||
class CastDebuffSpellAction : public CastAuraSpellAction
|
||||
{
|
||||
public:
|
||||
CastDebuffSpellAction(PlayerbotAI* botAI, std::string const spell, bool isOwner = false) : CastAuraSpellAction(botAI, spell, isOwner) { }
|
||||
CastDebuffSpellAction(PlayerbotAI* botAI, std::string const spell, bool isOwner = false, float needLifeTime = 8.0f) : CastAuraSpellAction(botAI, spell, isOwner), needLifeTime(needLifeTime) { }
|
||||
bool isUseful() override;
|
||||
private:
|
||||
float needLifeTime;
|
||||
};
|
||||
|
||||
class CastDebuffSpellOnAttackerAction : public CastAuraSpellAction
|
||||
class CastDebuffSpellOnAttackerAction : public CastDebuffSpellAction
|
||||
{
|
||||
public:
|
||||
CastDebuffSpellOnAttackerAction(PlayerbotAI* botAI, std::string const spell, bool isOwner = true) : CastAuraSpellAction(botAI, spell, isOwner) { }
|
||||
CastDebuffSpellOnAttackerAction(PlayerbotAI* botAI, std::string const spell, bool isOwner = true, float needLifeTime = 8.0f) : CastDebuffSpellAction(botAI, spell, isOwner, needLifeTime) { }
|
||||
|
||||
Value<Unit*>* GetTargetValue() override;
|
||||
std::string const getName() override { return spell + " on attacker"; }
|
||||
|
||||
Reference in New Issue
Block a user