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 -->
Improve the blood DK rotation, add hysteria use, improve blood pact use.
Basic Blood priority should be:
1. Keep diseases up
2. Use rune strike whenever possible
3. Use frost and death runes on Icy Touch (highest threat ability)
4. Use unholy runes on death strike to trigger more death runes
5. use blood runes on heart/blood strike
Hysteria should be used on a physical dps, or a tank if no physical dps
is available. Never a caster or healer.
Summon ghoul should be saved for death pact usage. They are honestly a
liability that aggros everything in range without the unholy talent that
turns them into a pet anyways.
## Feature Evaluation
<!--
If your PR is very minimal (comment typo, wrong ID reference, etc), and
it is very obvious it will not have
any impact on performance, you may skip these question. If necessary, a
maintainer may ask you for them later.
-->
<!-- Please answer the following: -->
- Describe the **minimum logic** required to achieve the intended
behavior.
Removed plague strike from the general rotation. It should only be used
for disease application.
Added death strike on "high unholy rune" trigger instead.
Remove raise dead from generic dk. Only cast it right before death pact.
Add hysteria to bloods default actions.
- Describe the **processing cost** when this logic executes across many
bots.
Minimal change
## 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.
-->
To test rotation changes:
Use a combat parsing addon such as Details! or watch the combat log of a
Blood DK bot.
They should now use death strike instead of using unholy runes on plague
strike.
To test hysteria:
Ungrouped blood dk bots can be observed using it on themselves.
Create a group with the blood dk + casters/healers only. Observe that
they never use hysteria on the casters.
Create a group with blood dk + physical dps. Observe that they use
hysteria on a dps and not themselves.
To test blood pact:
I used GM command .damage to get my Blood DK bot into "critical health"
trigger. They will use raise dead then blood pact.
## 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?
- - [x] No
- - [ ] Yes (**explain why**)
- Does this change add new decision branches or increase maintenance
complexity?
- - [x] No
- - [ ] Yes (**explain below**)
## Messages to Translate
<!--
Bot messages have to be translatable, but you don't need to do the
translations here. You only need to make sure
the message is in a translatable format, and list in the table the
message_key and the default English message.
Search for GetBotTextOrDefault in the codebase for examples.
-->
Does this change add bot messages to translate?
- - [x] No
- - [ ] Yes (**list messages in the table**)
| Message key | Default message |
| --------------- | ------------------ |
| | |
| | |
## 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.
-->
Used for brainstorming and exploring the codebase to find similar
patterns.
## Final Checklist
- - [x] Stability is not compromised.
- - [x] Performance impact is understood, tested, and acceptable.
- - [x] Added logic complexity is justified and explained.
- - [x] Documentation updated if needed (Conf comments, WiKi commands).
## Notes for Reviewers
<!-- Anything else that's helpful to review or test your pull request.
-->
182 lines
4.5 KiB
C++
182 lines
4.5 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.
|
|
*/
|
|
|
|
#include "BloodDKStrategy.h"
|
|
|
|
#include "Playerbots.h"
|
|
|
|
class BloodDKStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
|
|
{
|
|
public:
|
|
BloodDKStrategyActionNodeFactory()
|
|
{
|
|
creators["rune strike"] = &rune_strike;
|
|
creators["heart strike"] = &heart_strike;
|
|
creators["death strike"] = &death_strike;
|
|
creators["icy touch"] = &icy_touch;
|
|
creators["dark command"] = &dark_command;
|
|
creators["taunt spell"] = &dark_command;
|
|
}
|
|
|
|
private:
|
|
static ActionNode* rune_strike([[maybe_unused]] PlayerbotAI* botAI)
|
|
{
|
|
return new ActionNode(
|
|
"rune strike",
|
|
{
|
|
NextAction("frost presence")
|
|
},
|
|
/*A*/ {},
|
|
/*C*/ {}
|
|
);
|
|
}
|
|
static ActionNode* icy_touch([[maybe_unused]] PlayerbotAI* botAI)
|
|
{
|
|
return new ActionNode(
|
|
"icy touch",
|
|
{
|
|
NextAction("frost presence")
|
|
},
|
|
/*A*/ {},
|
|
/*C*/ {}
|
|
);
|
|
}
|
|
static ActionNode* heart_strike([[maybe_unused]] PlayerbotAI* botAI)
|
|
{
|
|
return new ActionNode(
|
|
"heart strike",
|
|
{
|
|
NextAction("frost presence")
|
|
},
|
|
/*A*/ {
|
|
NextAction("blood strike")
|
|
},
|
|
/*C*/ {}
|
|
);
|
|
}
|
|
|
|
static ActionNode* death_strike([[maybe_unused]] PlayerbotAI* botAI)
|
|
{
|
|
return new ActionNode(
|
|
"death strike",
|
|
{
|
|
NextAction("frost presence")
|
|
},
|
|
/*A*/ {},
|
|
/*C*/ {}
|
|
);
|
|
}
|
|
static ActionNode* dark_command([[maybe_unused]] PlayerbotAI* botAI)
|
|
{
|
|
return new ActionNode(
|
|
"dark command",
|
|
{
|
|
NextAction("frost presence")
|
|
},
|
|
/*A*/ {
|
|
NextAction("death grip")
|
|
},
|
|
/*C*/ {}
|
|
);
|
|
}
|
|
};
|
|
|
|
BloodDKStrategy::BloodDKStrategy(PlayerbotAI* botAI) : GenericDKStrategy(botAI)
|
|
{
|
|
actionNodeFactories.Add(new BloodDKStrategyActionNodeFactory());
|
|
}
|
|
|
|
std::vector<NextAction> BloodDKStrategy::getDefaultActions()
|
|
{
|
|
return {
|
|
NextAction("rune strike", ACTION_DEFAULT + 0.6f),
|
|
NextAction("icy touch", ACTION_DEFAULT + 0.5f),
|
|
NextAction("heart strike", ACTION_DEFAULT + 0.4f),
|
|
NextAction("dancing rune weapon", ACTION_DEFAULT + 0.3f),
|
|
NextAction("death coil", ACTION_DEFAULT + 0.2f),
|
|
NextAction("horn of winter", ACTION_DEFAULT + 0.1f),
|
|
NextAction("melee", ACTION_DEFAULT)
|
|
};
|
|
}
|
|
|
|
void BloodDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
|
{
|
|
GenericDKStrategy::InitTriggers(triggers);
|
|
|
|
triggers.push_back(
|
|
new TriggerNode(
|
|
"hysteria no cd",
|
|
{
|
|
NextAction("hysteria", ACTION_NORMAL + 4)
|
|
}
|
|
)
|
|
);
|
|
triggers.push_back(
|
|
new TriggerNode(
|
|
"rune strike",
|
|
{
|
|
NextAction("rune strike", ACTION_NORMAL + 3)
|
|
}
|
|
)
|
|
);
|
|
triggers.push_back(
|
|
new TriggerNode(
|
|
"blood tap",
|
|
{
|
|
NextAction("blood tap", ACTION_HIGH + 5)
|
|
}
|
|
)
|
|
);
|
|
triggers.push_back(
|
|
new TriggerNode(
|
|
"lose aggro",
|
|
{
|
|
NextAction("dark command", ACTION_HIGH + 3)
|
|
}
|
|
)
|
|
);
|
|
triggers.push_back(
|
|
new TriggerNode(
|
|
"low health",
|
|
{
|
|
NextAction("army of the dead", ACTION_HIGH + 4),
|
|
NextAction("death strike", ACTION_HIGH + 3)
|
|
}
|
|
)
|
|
);
|
|
triggers.push_back(
|
|
new TriggerNode(
|
|
"critical health",
|
|
{
|
|
NextAction("vampiric blood", ACTION_HIGH + 5)
|
|
}
|
|
)
|
|
);
|
|
triggers.push_back(
|
|
new TriggerNode(
|
|
"icy touch",
|
|
{
|
|
NextAction("icy touch", ACTION_HIGH + 2)
|
|
}
|
|
)
|
|
);
|
|
triggers.push_back(
|
|
new TriggerNode(
|
|
"plague strike",
|
|
{
|
|
NextAction("plague strike", ACTION_HIGH + 2)
|
|
}
|
|
)
|
|
);
|
|
triggers.push_back(
|
|
new TriggerNode(
|
|
"high unholy rune",
|
|
{
|
|
NextAction("death strike", ACTION_HIGH + 1)
|
|
}
|
|
)
|
|
);
|
|
}
|