mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 15:39:25 +02:00
<!--
Thank you for contributing to mod-playerbots, please make sure that
you...
1. Submit your PR to the test-staging branch, not master.
2. Read the guidelines below before submitting.
3. Don't delete parts of this template.
DESIGN PHILOSOPHY: We prioritize STABILITY, PERFORMANCE, AND
PREDICTABILITY over behavioral realism.
Every action and decision executes PER BOT AND PER TRIGGER. Small
increases in logic complexity scale
poorly across thousands of bots and negatively affect all. We prioritize
a stable system over a smarter
one. Bots don't need to behave perfectly; believable behavior is the
goal, not human simulation.
Default behavior must be cheap in processing; expensive behavior must be
opt-in.
Before submitting, make sure your changes aligns with these principles.
-->
## Pull Request Description
<!-- Describe what this change does and why it is needed -->
Restoration Druid now use lifebloom when get Clearcasting proc.
## How to Test the Changes
<!--
- Step-by-step instructions to test the change.
- Any required setup (e.g. multiple players, number of bots, specific
configuration).
- Expected behavior and how to verify it.
-->
1. Invite to group restoration druid and tank
2. Attack target (for example dummy)
3. When druid heals and get clearcasting should cast lifebloom on tank
## Impact Assessment
<!-- As a generic test, before and after measure of pmon (playerbot pmon
tick) can help you here. -->
- Does this change increase per-bot/per-tick processing or risk scaling
poorly with thousands of bots?
- - [x] No, not at all
- - [ ] Minimal impact (**explain below**)
- - [ ] Moderate impact (**explain below**)
- Does this change modify default bot behavior?
- - [ ] No
- - [x] Yes (**explain why**)
Restoration druid by default use lifebloom on tank when got clearcasting
proc.
- Does this change add new decision branches or increase maintenance
complexity?
- - [x] No
- - [ ] Yes (**explain below**)
## AI Assistance
<!--
AI assistance is allowed, but all submitted code must be fully
understood, reviewed, and owned by the contributor.
We expect contributors to be honest about what they do and do not
understand.
-->
Was AI assistance used while working on this change?
- - [ ] No
- - [x] Yes (**explain below**)
<!--
If yes, please specify:
- Purpose of usage (e.g. brainstorming, refactoring, documentation, code
generation).
- Which parts of the change were influenced or generated, and whether it
was thoroughly reviewed.
-->
Copilot CLI to review.
<!--
TRANSLATIONS:
Anything new that the bots say in chat must be in a translatable format.
This is done using GetBotTextOrDefault,
which you can search for in the codebase to find examples. Your code
needs to have English as the default fallback,
while the full translations need to be in an SQL update file. The
languages in the file are the nine language
options supported by AzerothCore: English, Korean, French, German,
Chinese, Taiwanese, Spanish, Spanish Mexico, and
Russian. See
data/sql/playerbots/updates/2025_12_27_ai_playerbot_fishing_text.sql as
an example of a translation SQL
update, whose content are called within the codebase at
src/strategy/actions/FishingAction.cpp
-->
## Final Checklist
- - [x] Stability is not compromised.
- - [x] Performance impact is understood, tested, and acceptable.
- - [x] Added logic complexity is justified and explained.
- - [x] Any new bot dialogue lines are translated.
- - [x] Documentation updated if needed (Conf comments, WiKi commands).
## Notes for Reviewers
<!-- Anything else that's helpful to review or test your pull request.
-->
<img width="728" height="268" alt="obraz"
src="https://github.com/user-attachments/assets/25bf2b22-d8e5-4755-9f44-d24246cceae2"
/>
<img width="506" height="196" alt="obraz"
src="https://github.com/user-attachments/assets/f4e4897c-496a-412f-bde7-a88f15d9099c"
/>
301 lines
7.6 KiB
C++
301 lines
7.6 KiB
C++
/*
|
|
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
|
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
|
*/
|
|
|
|
#ifndef _PLAYERBOT_DRUIDTRIGGERS_H
|
|
#define _PLAYERBOT_DRUIDTRIGGERS_H
|
|
|
|
#include "CureTriggers.h"
|
|
#include "GenericTriggers.h"
|
|
#include "Player.h"
|
|
#include "PlayerbotAI.h"
|
|
#include "Playerbots.h"
|
|
#include "SharedDefines.h"
|
|
#include "Trigger.h"
|
|
#include <set>
|
|
|
|
class PlayerbotAI;
|
|
|
|
class MarkOfTheWildOnPartyTrigger : public BuffOnPartyTrigger
|
|
{
|
|
public:
|
|
MarkOfTheWildOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "mark of the wild", 2 * 2000) {}
|
|
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class MarkOfTheWildTrigger : public BuffTrigger
|
|
{
|
|
public:
|
|
MarkOfTheWildTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "mark of the wild", 2 * 2000) {}
|
|
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class ThornsOnPartyTrigger : public BuffOnPartyTrigger
|
|
{
|
|
public:
|
|
ThornsOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "thorns", 2 * 2000) {}
|
|
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class ThornsOnMainTankTrigger : public BuffOnMainTankTrigger
|
|
{
|
|
public:
|
|
ThornsOnMainTankTrigger(PlayerbotAI* botAI) : BuffOnMainTankTrigger(botAI, "thorns", false, 2 * 2000) {}
|
|
};
|
|
|
|
class ThornsTrigger : public BuffTrigger
|
|
{
|
|
public:
|
|
ThornsTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "thorns", 2 * 2000) {}
|
|
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class OmenOfClarityTrigger : public BuffTrigger
|
|
{
|
|
public:
|
|
OmenOfClarityTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "omen of clarity") {}
|
|
};
|
|
|
|
class ClearcastingTrigger : public HasAuraTrigger
|
|
{
|
|
public:
|
|
ClearcastingTrigger(PlayerbotAI* botAI) : HasAuraTrigger(botAI, "clearcasting") {}
|
|
};
|
|
|
|
class RakeTrigger : public DebuffTrigger
|
|
{
|
|
public:
|
|
RakeTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "rake", 1, true) {}
|
|
};
|
|
|
|
class InsectSwarmTrigger : public DebuffTrigger
|
|
{
|
|
public:
|
|
InsectSwarmTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "insect swarm", 1, true) {}
|
|
};
|
|
|
|
class MoonfireTrigger : public DebuffTrigger
|
|
{
|
|
public:
|
|
MoonfireTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "moonfire", 1, true) {}
|
|
};
|
|
|
|
class FaerieFireTrigger : public DebuffTrigger
|
|
{
|
|
public:
|
|
FaerieFireTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "faerie fire", 1, false, 25.0f) {}
|
|
};
|
|
|
|
class FaerieFireFeralTrigger : public DebuffTrigger
|
|
{
|
|
public:
|
|
FaerieFireFeralTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "faerie fire (feral)") {}
|
|
};
|
|
|
|
class BashInterruptSpellTrigger : public InterruptSpellTrigger
|
|
{
|
|
public:
|
|
BashInterruptSpellTrigger(PlayerbotAI* botAI) : InterruptSpellTrigger(botAI, "bash") {}
|
|
};
|
|
|
|
class TigersFuryTrigger : public BuffTrigger
|
|
{
|
|
public:
|
|
TigersFuryTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "tiger's fury") {}
|
|
};
|
|
|
|
class BerserkTrigger : public BoostTrigger
|
|
{
|
|
public:
|
|
BerserkTrigger(PlayerbotAI* botAI) : BoostTrigger(botAI, "berserk") {}
|
|
};
|
|
|
|
class SavageRoarTrigger : public BuffTrigger
|
|
{
|
|
public:
|
|
SavageRoarTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "savage roar") {}
|
|
};
|
|
|
|
class NaturesGraspTrigger : public BuffTrigger
|
|
{
|
|
public:
|
|
NaturesGraspTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "nature's grasp") {}
|
|
};
|
|
|
|
class EntanglingRootsTrigger : public HasCcTargetTrigger
|
|
{
|
|
public:
|
|
EntanglingRootsTrigger(PlayerbotAI* botAI) : HasCcTargetTrigger(botAI, "entangling roots") {}
|
|
};
|
|
|
|
class EntanglingRootsKiteTrigger : public DebuffTrigger
|
|
{
|
|
public:
|
|
EntanglingRootsKiteTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "entangling roots") {}
|
|
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class HibernateTrigger : public HasCcTargetTrigger
|
|
{
|
|
public:
|
|
HibernateTrigger(PlayerbotAI* botAI) : HasCcTargetTrigger(botAI, "hibernate") {}
|
|
};
|
|
|
|
class CurePoisonTrigger : public NeedCureTrigger
|
|
{
|
|
public:
|
|
CurePoisonTrigger(PlayerbotAI* botAI) : NeedCureTrigger(botAI, "cure poison", DISPEL_POISON) {}
|
|
};
|
|
|
|
class PartyMemberCurePoisonTrigger : public PartyMemberNeedCureTrigger
|
|
{
|
|
public:
|
|
PartyMemberCurePoisonTrigger(PlayerbotAI* botAI) : PartyMemberNeedCureTrigger(botAI, "cure poison", DISPEL_POISON)
|
|
{
|
|
}
|
|
};
|
|
|
|
class BearFormTrigger : public BuffTrigger
|
|
{
|
|
public:
|
|
BearFormTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "bear form") {}
|
|
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class TreeFormTrigger : public BuffTrigger
|
|
{
|
|
public:
|
|
TreeFormTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "tree of life") {}
|
|
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class CatFormTrigger : public BuffTrigger
|
|
{
|
|
public:
|
|
CatFormTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "cat form") {}
|
|
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class EclipseSolarTrigger : public HasAuraTrigger
|
|
{
|
|
public:
|
|
EclipseSolarTrigger(PlayerbotAI* botAI) : HasAuraTrigger(botAI, "eclipse (solar)") {}
|
|
};
|
|
|
|
class EclipseLunarTrigger : public HasAuraTrigger
|
|
{
|
|
public:
|
|
EclipseLunarTrigger(PlayerbotAI* botAI) : HasAuraTrigger(botAI, "eclipse (lunar)") {}
|
|
};
|
|
|
|
class BashInterruptEnemyHealerSpellTrigger : public InterruptEnemyHealerTrigger
|
|
{
|
|
public:
|
|
BashInterruptEnemyHealerSpellTrigger(PlayerbotAI* botAI) : InterruptEnemyHealerTrigger(botAI, "bash") {}
|
|
};
|
|
|
|
class NaturesSwiftnessTrigger : public BuffTrigger
|
|
{
|
|
public:
|
|
NaturesSwiftnessTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "nature's swiftness") {}
|
|
};
|
|
|
|
class DruidPartyMemberRemoveCurseTrigger : public PartyMemberNeedCureTrigger
|
|
{
|
|
public:
|
|
DruidPartyMemberRemoveCurseTrigger(PlayerbotAI* ai)
|
|
: PartyMemberNeedCureTrigger(ai, "druid remove curse", DISPEL_CURSE)
|
|
{
|
|
}
|
|
};
|
|
|
|
class EclipseSolarCooldownTrigger : public SpellCooldownTrigger
|
|
{
|
|
public:
|
|
EclipseSolarCooldownTrigger(PlayerbotAI* ai) : SpellCooldownTrigger(ai, "eclipse (solar)") {}
|
|
bool IsActive() override { return bot->HasSpellCooldown(48517); }
|
|
};
|
|
|
|
class EclipseLunarCooldownTrigger : public SpellCooldownTrigger
|
|
{
|
|
public:
|
|
EclipseLunarCooldownTrigger(PlayerbotAI* ai) : SpellCooldownTrigger(ai, "eclipse (lunar)") {}
|
|
bool IsActive() override { return bot->HasSpellCooldown(48518); }
|
|
};
|
|
|
|
class MangleCatTrigger : public DebuffTrigger
|
|
{
|
|
public:
|
|
MangleCatTrigger(PlayerbotAI* ai) : DebuffTrigger(ai, "mangle (cat)", 1, false, 0.0f) {}
|
|
bool IsActive() override
|
|
{
|
|
return DebuffTrigger::IsActive() && !botAI->HasAura("mangle (bear)", GetTarget(), false, false, -1, true)
|
|
&& !botAI->HasAura("trauma", GetTarget(), false, false, -1, true);
|
|
}
|
|
};
|
|
|
|
class FerociousBiteTimeTrigger : public Trigger
|
|
{
|
|
public:
|
|
FerociousBiteTimeTrigger(PlayerbotAI* ai) : Trigger(ai, "ferocious bite time") {}
|
|
bool IsActive() override
|
|
{
|
|
Unit* target = AI_VALUE(Unit*, "current target");
|
|
if (!target)
|
|
return false;
|
|
|
|
uint8 cp = AI_VALUE2(uint8, "combo", "current target");
|
|
if (cp < 5)
|
|
return false;
|
|
|
|
Aura* roar = botAI->GetAura("savage roar", bot);
|
|
bool roarCheck = !roar || roar->GetDuration() > 10000;
|
|
if (!roarCheck)
|
|
return false;
|
|
|
|
Aura* rip = botAI->GetAura("rip", target, true);
|
|
bool ripCheck = !rip || rip->GetDuration() > 10000;
|
|
if (!ripCheck)
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
};
|
|
|
|
class HurricaneChannelCheckTrigger : public Trigger
|
|
{
|
|
public:
|
|
HurricaneChannelCheckTrigger(PlayerbotAI* botAI, uint32 minEnemies = 2)
|
|
: Trigger(botAI, "hurricane channel check"), minEnemies(minEnemies)
|
|
{
|
|
}
|
|
|
|
bool IsActive() override;
|
|
|
|
protected:
|
|
uint32 minEnemies;
|
|
static const std::set<uint32> HURRICANE_SPELL_IDS;
|
|
};
|
|
|
|
class NoHealerDpsStrategyTrigger : public Trigger
|
|
{
|
|
public:
|
|
NoHealerDpsStrategyTrigger(PlayerbotAI* botAI) : Trigger(botAI, "no healer dps strategy") {}
|
|
|
|
bool IsActive() override
|
|
{
|
|
return !botAI->HasStrategy("healer dps", BOT_STATE_COMBAT);
|
|
}
|
|
};
|
|
|
|
#endif
|