mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-21 07:59:25 +02:00
# Pull Request The purposes of this PR are to (1) establish a general raid helper framework for the benefit of future raid strategies and (2) make some improvements to problematic areas of the raid strategy code. List of changes: 1. Added new RaidBossHelpers.cpp and RaidBossHelpers.h files in the Raid folder. 3. Moved reused helpers from Karazhan, Gruul, and Magtheridon strategies to the new helper files. 4. Modified the prior function that assigned a DPS bot to store and erase timers and trackers in associative containers--the function now includes parameters for mapId (so a bot that is not in the instance will not be assigned) and for the ability to exclude a bot (useful for excluding particular important roles, such as a Warlock tank, so they are not bogged down by these extra tasks at critical moments). I also renamed it from IsInstanceTimerManager to IsMechanicTrackerBot. 5. Moved all helper files in raid strategies to Util folders (was needed for ICC, MC, and Ulduar). 6. Renamed and reordered includes of Ulduar files in AiObjectContext.cpp to match other raid strategies. a. This initially caused compile errors which made me realize that the existing code had several problems with missing includes and was compiling only due to the prior ordering in AiObjectContext.cpp. Therefore, I added the missing includes to Molten Core, Ulduar, and Vault of Archavon strategies. b. Ulduar and Old Kingdom were also using the same constant name for a spell--the reordering caused a compile error here as well, which just highlighted an existing problem that was being hidden. I renamed the constant for Ulduar to fix this, but I think the better approach going forward would be to use a namespace or enum class. But that is for another time and probably another person. 7. Several changes with respect to Ulduar files: a. The position constants and enums for spells and NPCs and such were in the trigger header file. I did not think that made sense so moved them to existing helper files. b. Since the strategy does not use multipliers, I removed all files and references to multipliers in it. c. I removed some unneeded includes. I did not do a detailed review to determine what else could be removed--I just took some out that I could tell right away were not needed. d. I renamed the ingame strategy name from "uld" to "ulduar," which I think is clearer and is still plenty short. 8. Partial refactor of Gruul and Magtheridon strategies: a. I did not due a full refactoring but made some quick changes to things I did previously that were rather stupid like repeating calculations, having useless logic like pointless IsAlive() checks for creatures already on the hostile references list, and not using the existing Position class for coordinates. b. There were a few substantive changes, such as allowing players to pick Maulgar mage and moonkin tanks with the assistant flag, but a greater refactoring of the strategies themselves is beyond this PR. c. I was clearing some containers used for Gruul and Magtheridon strategies; the methods are now fixed to erase only the applicable keys so that in the unlikely event that one server has multiple groups running Gruul or Magtheridon at the same time, there won't be timer or position tracker conflicts. ## How to Test the Changes 1. Enter any raid instance that has any code impacted by this PR 2. Engage bosses and observe if any strategies are now broken I personally tested Maulgar, Gruul, and Magtheridon and confirmed that they still work as intended. ## Complexity & Impact I do not expect this PR to have any relevant changes to in-game performance, but I will defer to those more knowledgeable than I if there are concerns in this area. As I've mentioned before, you can consider me to be like a person who has taken half an intro C++ course at best. ## AI Assistance None beyond autocomplete of repetitive changes. --------- Co-authored-by: bashermens <31279994+hermensbas@users.noreply.github.com>
317 lines
11 KiB
C++
317 lines
11 KiB
C++
#include "RaidUlduarStrategy.h"
|
|
|
|
void RaidUlduarStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
|
{
|
|
//
|
|
// Flame Leviathan
|
|
//
|
|
triggers.push_back(new TriggerNode(
|
|
"flame leviathan vehicle near",
|
|
{ NextAction("flame leviathan enter vehicle", ACTION_RAID + 2) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"flame leviathan on vehicle",
|
|
{ NextAction("flame leviathan vehicle", ACTION_RAID + 1) }));
|
|
|
|
//
|
|
// Razorscale
|
|
//
|
|
triggers.push_back(new TriggerNode(
|
|
"razorscale avoid devouring flames",
|
|
{ NextAction("razorscale avoid devouring flames", ACTION_RAID + 1) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"razorscale avoid sentinel",
|
|
{ NextAction("razorscale avoid sentinel", ACTION_RAID + 2) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"razorscale flying alone",
|
|
{ NextAction("razorscale ignore flying alone", ACTION_MOVE + 5) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"razorscale avoid whirlwind",
|
|
{ NextAction("razorscale avoid whirlwind", ACTION_RAID + 3) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"razorscale grounded",
|
|
{ NextAction("razorscale grounded", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"razorscale harpoon trigger",
|
|
{ NextAction("razorscale harpoon action", ACTION_MOVE) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"razorscale fuse armor trigger",
|
|
{ NextAction("razorscale fuse armor action", ACTION_RAID + 2) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"razorscale fire resistance trigger",
|
|
{ NextAction("razorscale fire resistance action", ACTION_RAID) }));
|
|
|
|
//
|
|
// Ignis
|
|
//
|
|
triggers.push_back(new TriggerNode(
|
|
"ignis fire resistance trigger",
|
|
{ NextAction("ignis fire resistance action", ACTION_RAID) }));
|
|
|
|
//
|
|
// Iron Assembly
|
|
//
|
|
triggers.push_back(new TriggerNode(
|
|
"iron assembly lightning tendrils trigger",
|
|
{ NextAction("iron assembly lightning tendrils action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"iron assembly overload trigger",
|
|
{ NextAction("iron assembly overload action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"iron assembly rune of power trigger",
|
|
{ NextAction("iron assembly rune of power action", ACTION_RAID) }));
|
|
|
|
//
|
|
// Kologarn
|
|
//
|
|
triggers.push_back(new TriggerNode(
|
|
"kologarn fall from floor trigger",
|
|
{ NextAction("kologarn fall from floor action", ACTION_RAID + 1) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"kologarn rti target trigger",
|
|
{ NextAction("kologarn rti target action", ACTION_RAID + 1) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"kologarn eyebeam trigger",
|
|
{ NextAction("kologarn eyebeam action", ACTION_RAID + 1) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"kologarn attack dps target trigger",
|
|
{ NextAction("attack rti target", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"kologarn mark dps target trigger",
|
|
{ NextAction("kologarn mark dps target action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"kologarn nature resistance trigger",
|
|
{ NextAction("kologarn nature resistance action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"kologarn rubble slowdown trigger",
|
|
{ NextAction("kologarn rubble slowdown action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"kologarn crunch armor trigger",
|
|
{ NextAction("kologarn crunch armor action", ACTION_RAID) }));
|
|
|
|
//
|
|
// Auriaya
|
|
//
|
|
triggers.push_back(new TriggerNode(
|
|
"auriaya fall from floor trigger",
|
|
{ NextAction("auriaya fall from floor action", ACTION_RAID) }));
|
|
|
|
//
|
|
// Hodir
|
|
//
|
|
triggers.push_back(new TriggerNode(
|
|
"hodir near snowpacked icicle",
|
|
{ NextAction("hodir move snowpacked icicle", ACTION_RAID + 1) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"hodir biting cold",
|
|
{ NextAction("hodir biting cold jump", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"hodir frost resistance trigger",
|
|
{ NextAction("hodir frost resistance action", ACTION_RAID) }));
|
|
|
|
//
|
|
// Freya
|
|
//
|
|
triggers.push_back(new TriggerNode(
|
|
"freya near nature bomb",
|
|
{ NextAction("freya move away nature bomb", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"freya nature resistance trigger",
|
|
{ NextAction("freya nature resistance action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"freya fire resistance trigger",
|
|
{ NextAction("freya fire resistance action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"freya mark dps target trigger",
|
|
{ NextAction("freya mark dps target action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"freya move to healing spore trigger",
|
|
{ NextAction("freya move to healing spore action", ACTION_RAID) }));
|
|
|
|
//
|
|
// Thorim
|
|
//
|
|
triggers.push_back(new TriggerNode(
|
|
"thorim nature resistance trigger",
|
|
{ NextAction("thorim nature resistance action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"thorim frost resistance trigger",
|
|
{ NextAction("thorim frost resistance action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"thorim unbalancing strike trigger",
|
|
{ NextAction("thorim unbalancing strike action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"thorim mark dps target trigger",
|
|
{ NextAction("thorim mark dps target action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"thorim gauntlet positioning trigger",
|
|
{ NextAction("thorim gauntlet positioning action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"thorim arena positioning trigger",
|
|
{ NextAction("thorim arena positioning action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"thorim fall from floor trigger",
|
|
{ NextAction("thorim fall from floor action", ACTION_RAID + 1) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"thorim phase 2 positioning trigger",
|
|
{ NextAction("thorim phase 2 positioning action", ACTION_RAID) }));
|
|
|
|
//
|
|
// Mimiron
|
|
//
|
|
triggers.push_back(new TriggerNode(
|
|
"mimiron p3wx2 laser barrage trigger",
|
|
{ NextAction("mimiron p3wx2 laser barrage action", ACTION_RAID + 2) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"mimiron shock blast trigger",
|
|
{ NextAction("mimiron shock blast action", ACTION_RAID + 1) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"mimiron fire resistance trigger",
|
|
{ NextAction("mimiron fire resistance action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"mimiron phase 1 positioning trigger",
|
|
{ NextAction("mimiron phase 1 positioning action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"mimiron rapid burst trigger",
|
|
{ NextAction("mimiron rapid burst action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"mimiron aerial command unit trigger",
|
|
{ NextAction("mimiron aerial command unit action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"mimiron rocket strike trigger",
|
|
{ NextAction("mimiron rocket strike action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"mimiron phase 4 mark dps trigger",
|
|
{ NextAction("mimiron phase 4 mark dps action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"mimiron cheat trigger",
|
|
{ NextAction("mimiron cheat action", ACTION_RAID) }));
|
|
|
|
//
|
|
// General Vezax
|
|
//
|
|
triggers.push_back(new TriggerNode(
|
|
"vezax cheat trigger",
|
|
{ NextAction("vezax cheat action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"vezax shadow crash trigger",
|
|
{ NextAction("vezax shadow crash action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"vezax mark of the faceless trigger",
|
|
{ NextAction("vezax mark of the faceless action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"vezax shadow resistance trigger",
|
|
{ NextAction("vezax shadow resistance action", ACTION_RAID) }));
|
|
|
|
//
|
|
// Yogg-Saron
|
|
//
|
|
triggers.push_back(new TriggerNode(
|
|
"sara shadow resistance trigger",
|
|
{ NextAction("sara shadow resistance action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"yogg-saron shadow resistance trigger",
|
|
{ NextAction("yogg-saron shadow resistance action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"yogg-saron ominous cloud cheat trigger",
|
|
{ NextAction("yogg-saron ominous cloud cheat action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"yogg-saron guardian positioning trigger",
|
|
{ NextAction("yogg-saron guardian positioning action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"yogg-saron sanity trigger",
|
|
{ NextAction("yogg-saron sanity action", ACTION_RAID + 1) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"yogg-saron death orb trigger",
|
|
{ NextAction("yogg-saron death orb action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"yogg-saron malady of the mind trigger",
|
|
{ NextAction("yogg-saron malady of the mind action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"yogg-saron mark target trigger",
|
|
{ NextAction("yogg-saron mark target action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"yogg-saron brain link trigger",
|
|
{ NextAction("yogg-saron brain link action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"yogg-saron move to enter portal trigger",
|
|
{ NextAction("yogg-saron move to enter portal action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"yogg-saron use portal trigger",
|
|
{ NextAction("yogg-saron use portal action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"yogg-saron fall from floor trigger",
|
|
{ NextAction("yogg-saron fall from floor action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"yogg-saron boss room movement cheat trigger",
|
|
{ NextAction("yogg-saron boss room movement cheat action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"yogg-saron illusion room trigger",
|
|
{ NextAction("yogg-saron illusion room action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"yogg-saron move to exit portal trigger",
|
|
{ NextAction("yogg-saron move to exit portal action", ACTION_RAID) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"yogg-saron lunatic gaze trigger",
|
|
{ NextAction("yogg-saron lunatic gaze action", ACTION_EMERGENCY) }));
|
|
|
|
triggers.push_back(new TriggerNode(
|
|
"yogg-saron phase 3 positioning trigger",
|
|
{ NextAction("yogg-saron phase 3 positioning action", ACTION_RAID) }));
|
|
}
|