From f20d3aea6c91c32106bfba9e5297caf482cf36c3 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Fri, 6 Sep 2024 20:29:56 +0800 Subject: [PATCH] Unholy dk --- conf/playerbots.conf.dist | 4 +-- src/strategy/actions/GenericSpellActions.cpp | 14 +++++--- src/strategy/actions/GenericSpellActions.h | 8 +++-- src/strategy/deathknight/BloodDKStrategy.cpp | 5 ++- src/strategy/deathknight/DKActions.h | 4 +-- .../deathknight/DKAiObjectContext.cpp | 11 ++++++ src/strategy/deathknight/DKTriggers.cpp | 4 +-- src/strategy/deathknight/DKTriggers.h | 18 ++++++++-- src/strategy/deathknight/FrostDKStrategy.cpp | 5 ++- .../deathknight/GenericDKStrategy.cpp | 18 ---------- src/strategy/deathknight/UnholyDKStrategy.cpp | 36 +++++++++++++------ src/strategy/triggers/GenericTriggers.cpp | 11 +++++- src/strategy/triggers/GenericTriggers.h | 10 ++++-- 13 files changed, 98 insertions(+), 50 deletions(-) diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 87008706..37228098 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -910,8 +910,8 @@ AiPlayerbot.PremadeSpecLink.6.1.60 = -32003350332203012300023101351 AiPlayerbot.PremadeSpecLink.6.1.80 = -32002350352203012300033101351-230200305003 AiPlayerbot.PremadeSpecName.6.2 = unholy pve AiPlayerbot.PremadeSpecGlyph.6.2 = 43542,43673,45804,43544,43672,43549 -AiPlayerbot.PremadeSpecLink.6.2.60 = --2301303050032151000150013113151 -AiPlayerbot.PremadeSpecLink.6.2.80 = -320033500002-2301303050032151000150013133151 +AiPlayerbot.PremadeSpecLink.6.2.60 = --2301303050032151000150013132051 +AiPlayerbot.PremadeSpecLink.6.2.80 = -320043500002-2301303050032151000150013133051 AiPlayerbot.PremadeSpecName.6.3 = double aura blood pve AiPlayerbot.PremadeSpecGlyph.6.3 = 45805,43673,43827,43544,43672,43554 AiPlayerbot.PremadeSpecLink.6.3.60 = 005512153330030320102013-305 diff --git a/src/strategy/actions/GenericSpellActions.cpp b/src/strategy/actions/GenericSpellActions.cpp index 2425a223..9285f20a 100644 --- a/src/strategy/actions/GenericSpellActions.cpp +++ b/src/strategy/actions/GenericSpellActions.cpp @@ -162,8 +162,14 @@ bool CastMeleeDebuffSpellAction::isUseful() bool CastAuraSpellAction::isUseful() { - return GetTarget() && (GetTarget() != nullptr) && CastSpellAction::isUseful() && - !botAI->HasAura(spell, GetTarget(), false, isOwner); + if (!GetTarget() || !CastSpellAction::isUseful()) + return false; + Aura* aura = botAI->GetAura(spell, GetTarget(), isOwner, checkDuration); + if (!aura) + return true; + if (beforeDuration && aura->GetDuration() < beforeDuration) + return true; + return false; } CastEnchantItemAction::CastEnchantItemAction(PlayerbotAI* botAI, std::string const spell) @@ -251,8 +257,8 @@ Value* CastDebuffSpellOnMeleeAttackerAction::GetTargetValue() return context->GetValue("melee attacker without aura", spell); } -CastBuffSpellAction::CastBuffSpellAction(PlayerbotAI* botAI, std::string const spell, bool checkIsOwner) - : CastAuraSpellAction(botAI, spell, checkIsOwner) +CastBuffSpellAction::CastBuffSpellAction(PlayerbotAI* botAI, std::string const spell, bool checkIsOwner, uint32 beforeDuration) + : CastAuraSpellAction(botAI, spell, checkIsOwner, false, beforeDuration) { range = botAI->GetRange("spell"); } diff --git a/src/strategy/actions/GenericSpellActions.h b/src/strategy/actions/GenericSpellActions.h index b9870011..2ab49bb0 100644 --- a/src/strategy/actions/GenericSpellActions.h +++ b/src/strategy/actions/GenericSpellActions.h @@ -37,16 +37,20 @@ protected: class CastAuraSpellAction : public CastSpellAction { public: - CastAuraSpellAction(PlayerbotAI* botAI, std::string const spell, bool isOwner = false) + CastAuraSpellAction(PlayerbotAI* botAI, std::string const spell, bool isOwner = false, bool checkDuration = false, uint32 beforeDuration = 0) : CastSpellAction(botAI, spell) { this->isOwner = isOwner; + this->beforeDuration = beforeDuration; + this->checkDuration = checkDuration; } bool isUseful() override; protected: bool isOwner; + bool checkDuration; + uint32 beforeDuration; }; class CastMeleeSpellAction : public CastSpellAction @@ -107,7 +111,7 @@ public: class CastBuffSpellAction : public CastAuraSpellAction { public: - CastBuffSpellAction(PlayerbotAI* botAI, std::string const spell, bool checkIsOwner = false); + CastBuffSpellAction(PlayerbotAI* botAI, std::string const spell, bool checkIsOwner = false, uint32 beforeDuration = 0); std::string const GetTargetName() override { return "self target"; } }; diff --git a/src/strategy/deathknight/BloodDKStrategy.cpp b/src/strategy/deathknight/BloodDKStrategy.cpp index 7daf494d..03bc454c 100644 --- a/src/strategy/deathknight/BloodDKStrategy.cpp +++ b/src/strategy/deathknight/BloodDKStrategy.cpp @@ -104,5 +104,8 @@ void BloodDKStrategy::InitTriggers(std::vector& triggers) new NextAction("death strike", ACTION_HIGH + 3), nullptr))); triggers.push_back( new TriggerNode("critical health", NextAction::array(0, new NextAction("vampiric blood", ACTION_HIGH + 5), nullptr))); - + triggers.push_back( + new TriggerNode("icy touch", NextAction::array(0, new NextAction("icy touch", ACTION_HIGH + 2), nullptr))); + triggers.push_back(new TriggerNode( + "plague strike", NextAction::array(0, new NextAction("plague strike", ACTION_HIGH + 2), nullptr))); } diff --git a/src/strategy/deathknight/DKActions.h b/src/strategy/deathknight/DKActions.h index 2fe9c708..355a5c52 100644 --- a/src/strategy/deathknight/DKActions.h +++ b/src/strategy/deathknight/DKActions.h @@ -165,7 +165,7 @@ public: class CastGhoulFrenzyAction : public CastBuffSpellAction { public: - CastGhoulFrenzyAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "ghoul frenzy") {} + CastGhoulFrenzyAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "ghoul frenzy", false, 5000) {} std::string const GetTargetName() override { return "pet target"; } }; @@ -242,7 +242,7 @@ class CastDeathAndDecayAction : public CastSpellAction { public: CastDeathAndDecayAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "death and decay") {} - ActionThreatType getThreatType() override { return ActionThreatType::Aoe; } + // ActionThreatType getThreatType() override { return ActionThreatType::Aoe; } }; class CastHornOfWinterAction : public CastSpellAction diff --git a/src/strategy/deathknight/DKAiObjectContext.cpp b/src/strategy/deathknight/DKAiObjectContext.cpp index 5f7eb941..45d4b65f 100644 --- a/src/strategy/deathknight/DKAiObjectContext.cpp +++ b/src/strategy/deathknight/DKAiObjectContext.cpp @@ -10,6 +10,7 @@ #include "DKTriggers.h" #include "FrostDKStrategy.h" #include "GenericDKNonCombatStrategy.h" +#include "GenericTriggers.h" #include "Playerbots.h" #include "PullStrategy.h" #include "UnholyDKStrategy.h" @@ -73,10 +74,14 @@ public: creators["plague strike"] = &DeathKnightTriggerFactoryInternal::plague_strike; creators["plague strike on attacker"] = &DeathKnightTriggerFactoryInternal::plague_strike_on_attacker; creators["icy touch"] = &DeathKnightTriggerFactoryInternal::icy_touch; + creators["icy touch 8s"] = &DeathKnightTriggerFactoryInternal::icy_touch_8s; + creators["dd cd and icy touch 8s"] = &DeathKnightTriggerFactoryInternal::dd_cd_and_icy_touch_8s; creators["death coil"] = &DeathKnightTriggerFactoryInternal::death_coil; creators["icy touch on attacker"] = &DeathKnightTriggerFactoryInternal::icy_touch_on_attacker; creators["improved icy talons"] = &DeathKnightTriggerFactoryInternal::improved_icy_talons; creators["plague strike"] = &DeathKnightTriggerFactoryInternal::plague_strike; + creators["plague strike 8s"] = &DeathKnightTriggerFactoryInternal::plague_strike_8s; + creators["dd cd and plague strike 8s"] = &DeathKnightTriggerFactoryInternal::dd_cd_and_plague_strike_8s; creators["horn of winter"] = &DeathKnightTriggerFactoryInternal::horn_of_winter; creators["mind freeze"] = &DeathKnightTriggerFactoryInternal::mind_freeze; creators["mind freeze on enemy healer"] = &DeathKnightTriggerFactoryInternal::mind_freeze_on_enemy_healer; @@ -91,6 +96,7 @@ public: creators["high unholy rune"] = &DeathKnightTriggerFactoryInternal::high_unholy_rune; creators["freezing fog"] = &DeathKnightTriggerFactoryInternal::freezing_fog; creators["no desolation"] = &DeathKnightTriggerFactoryInternal::no_desolation; + creators["dd cd and no desolation"] = &DeathKnightTriggerFactoryInternal::dd_cd_and_no_desolation; creators["death and decay cooldown"] = &DeathKnightTriggerFactoryInternal::death_and_decay_cooldown; creators["army of the dead"] = &DeathKnightTriggerFactoryInternal::army_of_the_dead; } @@ -100,11 +106,15 @@ private: static Trigger* pestilence_glyph(PlayerbotAI* botAI) { return new PestilenceGlyphTrigger(botAI); } static Trigger* blood_strike(PlayerbotAI* botAI) { return new BloodStrikeTrigger(botAI); } static Trigger* plague_strike(PlayerbotAI* botAI) { return new PlagueStrikeDebuffTrigger(botAI); } + static Trigger* plague_strike_8s(PlayerbotAI* botAI) { return new PlagueStrike8sDebuffTrigger(botAI); } + static Trigger* dd_cd_and_plague_strike_8s(PlayerbotAI* botAI) { return new TwoTriggers(botAI, "death and decay cooldown", "plague strike 8s"); } static Trigger* plague_strike_on_attacker(PlayerbotAI* botAI) { return new PlagueStrikeDebuffOnAttackerTrigger(botAI); } static Trigger* icy_touch(PlayerbotAI* botAI) { return new IcyTouchDebuffTrigger(botAI); } + static Trigger* icy_touch_8s(PlayerbotAI* botAI) { return new IcyTouch8sDebuffTrigger(botAI); } + static Trigger* dd_cd_and_icy_touch_8s(PlayerbotAI* botAI) { return new TwoTriggers(botAI, "death and decay cooldown", "icy touch 8s"); } static Trigger* death_coil(PlayerbotAI* botAI) { return new DeathCoilTrigger(botAI); } static Trigger* icy_touch_on_attacker(PlayerbotAI* botAI) { return new IcyTouchDebuffOnAttackerTrigger(botAI); } static Trigger* improved_icy_talons(PlayerbotAI* botAI) { return new ImprovedIcyTalonsTrigger(botAI); } @@ -128,6 +138,7 @@ private: static Trigger* high_unholy_rune(PlayerbotAI* botAI) { return new HighUnholyRuneTrigger(botAI); } static Trigger* freezing_fog(PlayerbotAI* botAI) { return new FreezingFogTrigger(botAI); } static Trigger* no_desolation(PlayerbotAI* botAI) { return new DesolationTrigger(botAI); } + static Trigger* dd_cd_and_no_desolation(PlayerbotAI* botAI) { return new TwoTriggers(botAI, "death and decay cooldown", "no desolation"); } static Trigger* death_and_decay_cooldown(PlayerbotAI* botAI) { return new DeathAndDecayCooldownTrigger(botAI); } static Trigger* army_of_the_dead(PlayerbotAI* botAI) { return new ArmyOfTheDeadTrigger(botAI); } }; diff --git a/src/strategy/deathknight/DKTriggers.cpp b/src/strategy/deathknight/DKTriggers.cpp index ebec33cc..2d1cbb15 100644 --- a/src/strategy/deathknight/DKTriggers.cpp +++ b/src/strategy/deathknight/DKTriggers.cpp @@ -53,7 +53,7 @@ bool HighUnholyRuneTrigger::IsActive() } bool DesolationTrigger::IsActive() { - return bot->HasAura(66817) && !botAI->HasAura("desolation", GetTarget(), false, true, -1, true); + return bot->HasAura(66817) && BuffTrigger::IsActive(); } bool DeathAndDecayCooldownTrigger::IsActive() @@ -62,5 +62,5 @@ bool DeathAndDecayCooldownTrigger::IsActive() if (!spellId) return true; - return bot->GetSpellCooldownDelay(spellId) >= 2000; + return bot->GetSpellCooldownDelay(spellId) >= 3000; } \ No newline at end of file diff --git a/src/strategy/deathknight/DKTriggers.h b/src/strategy/deathknight/DKTriggers.h index 7f6c6c81..ef82394b 100644 --- a/src/strategy/deathknight/DKTriggers.h +++ b/src/strategy/deathknight/DKTriggers.h @@ -17,14 +17,26 @@ BUFF_TRIGGER(ImprovedIcyTalonsTrigger, "improved icy talons"); class PlagueStrikeDebuffTrigger : public DebuffTrigger { public: - PlagueStrikeDebuffTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "blood plague", true, .0f) {} + PlagueStrikeDebuffTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "blood plague", 1, true, .0f) {} +}; + +class PlagueStrike8sDebuffTrigger : public DebuffTrigger +{ +public: + PlagueStrike8sDebuffTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "blood plague", 1, true, .0f, 3000) {} }; // DEBUFF_CHECKISOWNER_TRIGGER(IcyTouchDebuffTrigger, "frost fever"); class IcyTouchDebuffTrigger : public DebuffTrigger { public: - IcyTouchDebuffTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "frost fever", true, .0f) {} + IcyTouchDebuffTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "frost fever", 1, true, .0f) {} +}; + +class IcyTouch8sDebuffTrigger : public DebuffTrigger +{ +public: + IcyTouch8sDebuffTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "frost fever", 1, true, .0f, 3000) {} }; BUFF_TRIGGER(UnbreakableArmorTrigger, "unbreakable armor"); @@ -162,7 +174,7 @@ public: class DesolationTrigger : public BuffTrigger { public: - DesolationTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "desolation") {} + DesolationTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "desolation", 1, false, true, 10000) {} bool IsActive() override; }; diff --git a/src/strategy/deathknight/FrostDKStrategy.cpp b/src/strategy/deathknight/FrostDKStrategy.cpp index b05060c7..6ec84558 100644 --- a/src/strategy/deathknight/FrostDKStrategy.cpp +++ b/src/strategy/deathknight/FrostDKStrategy.cpp @@ -109,7 +109,10 @@ void FrostDKStrategy::InitTriggers(std::vector& triggers) triggers.push_back(new TriggerNode( "army of the dead", NextAction::array(0, new NextAction("army of the dead", ACTION_HIGH + 6), nullptr))); - + triggers.push_back( + new TriggerNode("icy touch", NextAction::array(0, new NextAction("icy touch", ACTION_HIGH + 2), nullptr))); + triggers.push_back(new TriggerNode( + "plague strike", NextAction::array(0, new NextAction("plague strike", ACTION_HIGH + 2), nullptr))); // triggers.push_back(new TriggerNode("empower rune weapon", NextAction::array(0, new NextAction("empower rune // weapon", ACTION_NORMAL + 4), nullptr))); } diff --git a/src/strategy/deathknight/GenericDKStrategy.cpp b/src/strategy/deathknight/GenericDKStrategy.cpp index 5fb8556f..55146a56 100644 --- a/src/strategy/deathknight/GenericDKStrategy.cpp +++ b/src/strategy/deathknight/GenericDKStrategy.cpp @@ -184,24 +184,6 @@ void GenericDKStrategy::InitTriggers(std::vector& triggers) triggers.push_back( new TriggerNode("low health", NextAction::array(0, new NextAction("icebound fortitude", ACTION_HIGH + 5), new NextAction("rune tap", ACTION_HIGH + 4), nullptr))); - // triggers.push_back(new TriggerNode("medium health", - // NextAction::array(0, new NextAction("rune tap", ACTION_NORMAL + 4), - // new NextAction("death strike", ACTION_NORMAL + 3), nullptr))); - triggers.push_back( - new TriggerNode("icy touch", NextAction::array(0, new NextAction("icy touch", ACTION_HIGH + 2), nullptr))); - triggers.push_back( - new TriggerNode("icy touch on attacker", - NextAction::array(0, new NextAction("icy touch on attacker", ACTION_HIGH + 1), nullptr))); - triggers.push_back(new TriggerNode( - "plague strike", NextAction::array(0, new NextAction("plague strike", ACTION_HIGH + 2), nullptr))); - triggers.push_back( - new TriggerNode("plague strike on attacker", - NextAction::array(0, new NextAction("plague strike on attacker", ACTION_HIGH + 1), nullptr))); - // triggers.push_back(new TriggerNode("high aoe", - // NextAction::array(0, - // new NextAction("death and decay", ACTION_NORMAL + 5), - // new NextAction("pestilence", ACTION_NORMAL + 4), - // new NextAction("blood boil", ACTION_NORMAL + 3), nullptr))); triggers.push_back( new TriggerNode("medium aoe", NextAction::array(0, new NextAction("death and decay", ACTION_HIGH + 9), new NextAction("pestilence", ACTION_NORMAL + 4), diff --git a/src/strategy/deathknight/UnholyDKStrategy.cpp b/src/strategy/deathknight/UnholyDKStrategy.cpp index ac106a7f..c05d0d19 100644 --- a/src/strategy/deathknight/UnholyDKStrategy.cpp +++ b/src/strategy/deathknight/UnholyDKStrategy.cpp @@ -42,7 +42,7 @@ private: static ActionNode* ghoul_frenzy([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("ghoul frenzy", - /*P*/ nullptr, + /*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr), /*A*/ nullptr, /*C*/ nullptr); } @@ -78,11 +78,11 @@ UnholyDKStrategy::UnholyDKStrategy(PlayerbotAI* botAI) : GenericDKStrategy(botAI NextAction** UnholyDKStrategy::getDefaultActions() { return NextAction::array( - 0, new NextAction("death and decay", ACTION_DEFAULT + 1.0f), + 0, new NextAction("death and decay", ACTION_HIGH + 5), new NextAction("summon gargoyle", ACTION_DEFAULT + 0.4f), new NextAction("empower rune weapon", ACTION_DEFAULT + 0.3f), - new NextAction("death coil", ACTION_DEFAULT + 0.2f), - new NextAction("horn of winter", ACTION_DEFAULT + 0.1f), + new NextAction("horn of winter", ACTION_DEFAULT + 0.2f), + new NextAction("death coil", ACTION_DEFAULT + 0.1f), new NextAction("melee", ACTION_DEFAULT), nullptr); } @@ -95,24 +95,38 @@ void UnholyDKStrategy::InitTriggers(std::vector& triggers) new NextAction("scourge strike", ACTION_DEFAULT + 0.8f), new NextAction("blood boil", ACTION_DEFAULT + 0.7f), new NextAction("icy touch", ACTION_DEFAULT + 0.6f), + new NextAction("plague strike", ACTION_DEFAULT + 0.5f), nullptr))); + triggers.push_back(new TriggerNode("dd cd and no desolation", + NextAction::array(0, new NextAction("blood strike", ACTION_DEFAULT + 0.75f), nullptr))); + + triggers.push_back( + new TriggerNode("icy touch", NextAction::array(0, new NextAction("icy touch", ACTION_HIGH + 2), nullptr))); triggers.push_back(new TriggerNode( - "high frost rune", NextAction::array(0, new NextAction("icy touch", ACTION_DEFAULT + 0.6f), nullptr))); + "plague strike", NextAction::array(0, new NextAction("plague strike", ACTION_HIGH + 1), nullptr))); triggers.push_back(new TriggerNode( - "high unholy rune", NextAction::array(0, - new NextAction("ghoul frenzy", ACTION_DEFAULT + 0.9f), - new NextAction("plague strike", ACTION_DEFAULT + 0.5f), nullptr))); + "high frost rune", NextAction::array(0, + new NextAction("icy touch", ACTION_NORMAL + 3), nullptr))); triggers.push_back(new TriggerNode( - "high blood rune", NextAction::array(0, new NextAction("blood boil", ACTION_DEFAULT + 0.7f), nullptr))); + "high unholy rune", NextAction::array(0, + new NextAction("plague strike", ACTION_NORMAL + 2), nullptr))); + + triggers.push_back(new TriggerNode( + "high blood rune", NextAction::array(0, new NextAction("blood strike", ACTION_NORMAL + 1), nullptr))); + + // triggers.push_back( + // new TriggerNode("dd cd and plague strike 8s", NextAction::array(0, new NextAction("plague strike", ACTION_HIGH + 2), nullptr))); + + // triggers.push_back( + // new TriggerNode("dd cd and icy touch 8s", NextAction::array(0, new NextAction("icy touch", ACTION_HIGH + 1), nullptr))); + // triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction(, ACTION_NORMAL + 2), nullptr))); triggers.push_back(new TriggerNode( "army of the dead", NextAction::array(0, new NextAction("army of the dead", ACTION_HIGH + 6), nullptr))); - triggers.push_back(new TriggerNode("no desolation", - NextAction::array(0, new NextAction("blood strike", ACTION_HIGH + 4), nullptr))); triggers.push_back( new TriggerNode("bone shield", NextAction::array(0, new NextAction("bone shield", ACTION_HIGH + 1), nullptr))); } diff --git a/src/strategy/triggers/GenericTriggers.cpp b/src/strategy/triggers/GenericTriggers.cpp index 7826616f..f700e472 100644 --- a/src/strategy/triggers/GenericTriggers.cpp +++ b/src/strategy/triggers/GenericTriggers.cpp @@ -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* BuffOnPartyTrigger::GetTargetValue() diff --git a/src/strategy/triggers/GenericTriggers.h b/src/strategy/triggers/GenericTriggers.h index b7217447..e9990c3e 100644 --- a/src/strategy/triggers/GenericTriggers.h +++ b/src/strategy/triggers/GenericTriggers.h @@ -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) { }