major class spells

This commit is contained in:
Yunfan Li
2023-09-02 22:37:11 +08:00
parent 5f5faf00cd
commit 14b94e20fb
42 changed files with 203 additions and 67 deletions

View File

@@ -239,6 +239,15 @@ bool SpellNoCooldownTrigger::IsActive()
return !bot->HasSpellCooldown(spellId);
}
bool SpellCooldownTrigger::IsActive()
{
uint32 spellId = AI_VALUE2(uint32, "spell id", name);
if (!spellId)
return false;
return bot->HasSpellCooldown(spellId);
}
RandomTrigger::RandomTrigger(PlayerbotAI* botAI, std::string const name, int32 probability) : Trigger(botAI, name), probability(probability), lastCheck(getMSTime())
{
}

View File

@@ -143,6 +143,15 @@ class SpellNoCooldownTrigger : public SpellTrigger
bool IsActive() override;
};
class SpellCooldownTrigger : public SpellTrigger
{
public:
SpellCooldownTrigger(PlayerbotAI* botAI, std::string const spell) : SpellTrigger(botAI, spell) { }
std::string const GetTargetName() override { return "self target"; }
bool IsActive() override;
};
// TODO: check other targets
class InterruptSpellTrigger : public SpellTrigger
{
@@ -470,7 +479,6 @@ class HasAuraTrigger : public Trigger
std::string const GetTargetName() override { return "self target"; }
bool IsActive() override;
};
class HasAuraStackTrigger : public Trigger {
@@ -750,7 +758,7 @@ class HasAreaDebuffTrigger : public Trigger {
class BuffOnMainTankTrigger : public BuffTrigger
{
public:
BuffOnMainTankTrigger(PlayerbotAI* botAI, std::string spell, bool checkIsOwner = false) : BuffTrigger(botAI, spell, 1, checkIsOwner) {}
BuffOnMainTankTrigger(PlayerbotAI* botAI, std::string spell, bool checkIsOwner = false, int checkInterval = 1) : BuffTrigger(botAI, spell, checkInterval, checkIsOwner) {}
public:
virtual Value<Unit*>* GetTargetValue();
};