mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-17 09:04:36 +00:00
Unholy dk
This commit is contained in:
@@ -152,7 +152,16 @@ bool OutNumberedTrigger::IsActive()
|
||||
bool BuffTrigger::IsActive()
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
return SpellTrigger::IsActive() && !botAI->HasAura(spell, target, false, checkIsOwner);
|
||||
if (!target)
|
||||
return false;
|
||||
if (!SpellTrigger::IsActive())
|
||||
return false;
|
||||
Aura* aura = botAI->GetAura(spell, target, checkIsOwner, checkDuration);
|
||||
if (!aura)
|
||||
return true;
|
||||
if (beforeDuration && aura->GetDuration() < beforeDuration)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
Value<Unit*>* BuffOnPartyTrigger::GetTargetValue()
|
||||
|
||||
@@ -308,10 +308,12 @@ public:
|
||||
class BuffTrigger : public SpellTrigger
|
||||
{
|
||||
public:
|
||||
BuffTrigger(PlayerbotAI* botAI, std::string const spell, int32 checkInterval = 1, bool checkIsOwner = false)
|
||||
BuffTrigger(PlayerbotAI* botAI, std::string const spell, int32 checkInterval = 1, bool checkIsOwner = false, bool checkDuration = false, uint32 beforeDuration = 0)
|
||||
: SpellTrigger(botAI, spell, checkInterval)
|
||||
{
|
||||
this->checkIsOwner = checkIsOwner;
|
||||
this->checkDuration = checkDuration;
|
||||
this->beforeDuration = beforeDuration;
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -320,6 +322,8 @@ public:
|
||||
|
||||
protected:
|
||||
bool checkIsOwner;
|
||||
bool checkDuration;
|
||||
uint32 beforeDuration;
|
||||
};
|
||||
|
||||
class BuffOnPartyTrigger : public BuffTrigger
|
||||
@@ -379,8 +383,8 @@ class DebuffTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
DebuffTrigger(PlayerbotAI* botAI, std::string const spell, int32 checkInterval = 1, bool checkIsOwner = false,
|
||||
float needLifeTime = 8.0f)
|
||||
: BuffTrigger(botAI, spell, checkInterval, checkIsOwner), needLifeTime(needLifeTime)
|
||||
float needLifeTime = 8.0f, uint32 beforeDuration = 0)
|
||||
: BuffTrigger(botAI, spell, checkInterval, checkIsOwner, false, beforeDuration), needLifeTime(needLifeTime)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user