mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01: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>
469 lines
12 KiB
C++
469 lines
12 KiB
C++
#ifndef _PLAYERBOT_RAIDULDUARTRIGGERS_H
|
|
#define _PLAYERBOT_RAIDULDUARTRIGGERS_H
|
|
|
|
#include "EventMap.h"
|
|
#include "GenericTriggers.h"
|
|
#include "RaidUlduarBossHelper.h"
|
|
#include "Trigger.h"
|
|
|
|
//
|
|
// Flame Levi
|
|
//
|
|
class FlameLeviathanOnVehicleTrigger : public Trigger
|
|
{
|
|
public:
|
|
FlameLeviathanOnVehicleTrigger(PlayerbotAI* ai) : Trigger(ai, "flame leviathan on vehicle") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class FlameLeviathanVehicleNearTrigger : public Trigger
|
|
{
|
|
public:
|
|
FlameLeviathanVehicleNearTrigger(PlayerbotAI* ai) : Trigger(ai, "flame leviathan vehicle near") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
//
|
|
// Razorscale
|
|
//
|
|
class RazorscaleFlyingAloneTrigger : public Trigger
|
|
{
|
|
public:
|
|
RazorscaleFlyingAloneTrigger(PlayerbotAI* ai) : Trigger(ai, "razorscale flying alone") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class RazorscaleDevouringFlamesTrigger : public Trigger
|
|
{
|
|
public:
|
|
RazorscaleDevouringFlamesTrigger(PlayerbotAI* ai) : Trigger(ai, "razorscale avoid devouring flames") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class RazorscaleAvoidSentinelTrigger : public Trigger
|
|
{
|
|
public:
|
|
RazorscaleAvoidSentinelTrigger(PlayerbotAI* ai) : Trigger(ai, "razorscale avoid sentinel") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class RazorscaleAvoidWhirlwindTrigger : public Trigger
|
|
{
|
|
public:
|
|
RazorscaleAvoidWhirlwindTrigger(PlayerbotAI* ai) : Trigger(ai, "razorscale avoid whirlwind") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class RazorscaleGroundedTrigger : public Trigger
|
|
{
|
|
public:
|
|
RazorscaleGroundedTrigger(PlayerbotAI* ai) : Trigger(ai, "razorscale grounded") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class RazorscaleHarpoonAvailableTrigger : public Trigger
|
|
{
|
|
public:
|
|
RazorscaleHarpoonAvailableTrigger(PlayerbotAI* ai) : Trigger(ai, "razorscale harpoon trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class RazorscaleFuseArmorTrigger : public Trigger
|
|
{
|
|
public:
|
|
RazorscaleFuseArmorTrigger(PlayerbotAI* ai) : Trigger(ai, "razorscale fuse armor trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
//
|
|
// Iron Assembly
|
|
//
|
|
class IronAssemblyLightningTendrilsTrigger : public Trigger
|
|
{
|
|
public:
|
|
IronAssemblyLightningTendrilsTrigger(PlayerbotAI* ai) : Trigger(ai, "iron assembly lightning tendrils trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class IronAssemblyOverloadTrigger : public Trigger
|
|
{
|
|
public:
|
|
IronAssemblyOverloadTrigger(PlayerbotAI* ai) : Trigger(ai, "iron assembly overload trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class IronAssemblyRuneOfPowerTrigger : public Trigger
|
|
{
|
|
public:
|
|
IronAssemblyRuneOfPowerTrigger(PlayerbotAI* ai) : Trigger(ai, "iron assembly rune of power trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
//
|
|
// Kologarn
|
|
//
|
|
class KologarnMarkDpsTargetTrigger : public Trigger
|
|
{
|
|
public:
|
|
KologarnMarkDpsTargetTrigger(PlayerbotAI* ai) : Trigger(ai, "kologarn mark dps target trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class KologarnFallFromFloorTrigger : public Trigger
|
|
{
|
|
public:
|
|
KologarnFallFromFloorTrigger(PlayerbotAI* ai) : Trigger(ai, "kologarn fall from floor trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class KologarnRubbleSlowdownTrigger : public Trigger
|
|
{
|
|
public:
|
|
KologarnRubbleSlowdownTrigger(PlayerbotAI* ai) : Trigger(ai, "kologarn rubble slowdown trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class KologarnEyebeamTrigger : public Trigger
|
|
{
|
|
public:
|
|
KologarnEyebeamTrigger(PlayerbotAI* ai) : Trigger(ai, "kologarn eyebeam trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class KologarnAttackDpsTargetTrigger : public Trigger
|
|
{
|
|
public:
|
|
KologarnAttackDpsTargetTrigger(PlayerbotAI* ai) : Trigger(ai, "kologarn attack dps target trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class KologarnRtiTargetTrigger : public Trigger
|
|
{
|
|
public:
|
|
KologarnRtiTargetTrigger(PlayerbotAI* ai) : Trigger(ai, "kologarn rti target trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class KologarnCrunchArmorTrigger : public Trigger
|
|
{
|
|
public:
|
|
KologarnCrunchArmorTrigger(PlayerbotAI* ai) : Trigger(ai, "kologarn crunch armor trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
//
|
|
// Auriaya
|
|
//
|
|
class AuriayaFallFromFloorTrigger : public Trigger
|
|
{
|
|
public:
|
|
AuriayaFallFromFloorTrigger(PlayerbotAI* ai) : Trigger(ai, "auriaya fall from floor trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
//
|
|
// Hodir
|
|
//
|
|
class HodirBitingColdTrigger : public Trigger
|
|
{
|
|
public:
|
|
HodirBitingColdTrigger(PlayerbotAI* ai) : Trigger(ai, "hodir biting cold") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class HodirNearSnowpackedIcicleTrigger : public Trigger
|
|
{
|
|
public:
|
|
HodirNearSnowpackedIcicleTrigger(PlayerbotAI* ai) : Trigger(ai, "hodir near snowpacked icicle") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
//
|
|
// Freya
|
|
//
|
|
class FreyaNearNatureBombTrigger : public Trigger
|
|
{
|
|
public:
|
|
FreyaNearNatureBombTrigger(PlayerbotAI* ai) : Trigger(ai, "freya near nature bomb") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class FreyaMarkDpsTargetTrigger : public Trigger
|
|
{
|
|
public:
|
|
FreyaMarkDpsTargetTrigger(PlayerbotAI* ai) : Trigger(ai, "freya mark dps target trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class FreyaMoveToHealingSporeTrigger : public Trigger
|
|
{
|
|
public:
|
|
FreyaMoveToHealingSporeTrigger(PlayerbotAI* ai) : Trigger(ai, "freya move to healing spore trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
//
|
|
// Thorim
|
|
//
|
|
class ThorimUnbalancingStrikeTrigger : public Trigger
|
|
{
|
|
public:
|
|
ThorimUnbalancingStrikeTrigger(PlayerbotAI* ai) : Trigger(ai, "thorim unbalancing strike trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class ThorimMarkDpsTargetTrigger : public Trigger
|
|
{
|
|
public:
|
|
ThorimMarkDpsTargetTrigger(PlayerbotAI* ai) : Trigger(ai, "thorim mark dps target trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class ThorimGauntletPositioningTrigger : public Trigger
|
|
{
|
|
public:
|
|
ThorimGauntletPositioningTrigger(PlayerbotAI* ai) : Trigger(ai, "thorim gauntlet positioning trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class ThorimArenaPositioningTrigger : public Trigger
|
|
{
|
|
public:
|
|
ThorimArenaPositioningTrigger(PlayerbotAI* ai) : Trigger(ai, "thorim arena positioning trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class ThorimFallFromFloorTrigger : public Trigger
|
|
{
|
|
public:
|
|
ThorimFallFromFloorTrigger(PlayerbotAI* ai) : Trigger(ai, "thorim fall from floor trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class ThorimPhase2PositioningTrigger : public Trigger
|
|
{
|
|
public:
|
|
ThorimPhase2PositioningTrigger(PlayerbotAI* ai) : Trigger(ai, "thorim phase 2 positioning trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
//
|
|
// Mimiron
|
|
//
|
|
class MimironShockBlastTrigger : public Trigger
|
|
{
|
|
public:
|
|
MimironShockBlastTrigger(PlayerbotAI* ai) : Trigger(ai, "mimiron shock blast trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class MimironPhase1PositioningTrigger : public Trigger
|
|
{
|
|
public:
|
|
MimironPhase1PositioningTrigger(PlayerbotAI* ai) : Trigger(ai, "mimiron phase 1 positioning trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class MimironP3Wx2LaserBarrageTrigger : public Trigger
|
|
{
|
|
public:
|
|
MimironP3Wx2LaserBarrageTrigger(PlayerbotAI* ai) : Trigger(ai, "mimiron p3wx2 laser barrage trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class MimironRapidBurstTrigger : public Trigger
|
|
{
|
|
public:
|
|
MimironRapidBurstTrigger(PlayerbotAI* ai) : Trigger(ai, "mimiron rapid burst trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class MimironAerialCommandUnitTrigger : public Trigger
|
|
{
|
|
public:
|
|
MimironAerialCommandUnitTrigger(PlayerbotAI* ai) : Trigger(ai, "mimiron aerial command unit trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class MimironRocketStrikeTrigger : public Trigger
|
|
{
|
|
public:
|
|
MimironRocketStrikeTrigger(PlayerbotAI* ai) : Trigger(ai, "mimiron rocket strike trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class MimironPhase4MarkDpsTrigger : public Trigger
|
|
{
|
|
public:
|
|
MimironPhase4MarkDpsTrigger(PlayerbotAI* ai) : Trigger(ai, "mimiron phase 4 mark dps trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class MimironCheatTrigger : public Trigger
|
|
{
|
|
public:
|
|
MimironCheatTrigger(PlayerbotAI* ai) : Trigger(ai, "mimiron cheat trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
//
|
|
// General Vezax
|
|
//
|
|
class VezaxCheatTrigger : public Trigger
|
|
{
|
|
public:
|
|
VezaxCheatTrigger(PlayerbotAI* ai) : Trigger(ai, "vezax cheat trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class VezaxShadowCrashTrigger : public Trigger
|
|
{
|
|
public:
|
|
VezaxShadowCrashTrigger(PlayerbotAI* ai) : Trigger(ai, "vezax shadow crash trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class VezaxMarkOfTheFacelessTrigger : public Trigger
|
|
{
|
|
public:
|
|
VezaxMarkOfTheFacelessTrigger(PlayerbotAI* ai) : Trigger(ai, "vezax mark of the faceless trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
//
|
|
// Yogg-Saron
|
|
//
|
|
class YoggSaronTrigger : public Trigger
|
|
{
|
|
public:
|
|
YoggSaronTrigger(PlayerbotAI* ai, std::string const name = "yogg saron trigger", int32 checkInteval = 1)
|
|
: Trigger(ai, name, checkInteval) {}
|
|
|
|
bool IsYoggSaronFight();
|
|
bool IsPhase2();
|
|
bool IsPhase3();
|
|
bool IsInBrainLevel();
|
|
bool IsInIllusionRoom();
|
|
bool IsInStormwindKeeperIllusion();
|
|
bool IsInIcecrownKeeperIllusion();
|
|
bool IsInChamberOfTheAspectsIllusion();
|
|
bool IsMasterIsInIllusionGroup();
|
|
bool IsMasterIsInBrainRoom();
|
|
Position GetIllusionRoomEntrancePosition();
|
|
Unit* GetIllusionRoomRtiTarget();
|
|
Unit* GetNextIllusionRoomRtiTarget();
|
|
Unit* GetSaraIfAlive();
|
|
};
|
|
|
|
class YoggSaronOminousCloudCheatTrigger : public YoggSaronTrigger
|
|
{
|
|
public:
|
|
YoggSaronOminousCloudCheatTrigger(PlayerbotAI* ai) : YoggSaronTrigger(ai, "yogg-saron ominous cloud cheat trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class YoggSaronGuardianPositioningTrigger : public YoggSaronTrigger
|
|
{
|
|
public:
|
|
YoggSaronGuardianPositioningTrigger(PlayerbotAI* ai) : YoggSaronTrigger(ai, "yogg-saron guardian positioning trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class YoggSaronSanityTrigger : public YoggSaronTrigger
|
|
{
|
|
public:
|
|
YoggSaronSanityTrigger(PlayerbotAI* ai) : YoggSaronTrigger(ai, "yogg-saron sanity trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class YoggSaronDeathOrbTrigger : public YoggSaronTrigger
|
|
{
|
|
public:
|
|
YoggSaronDeathOrbTrigger(PlayerbotAI* ai) : YoggSaronTrigger(ai, "yogg-saron death orb trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class YoggSaronMaladyOfTheMindTrigger : public YoggSaronTrigger
|
|
{
|
|
public:
|
|
YoggSaronMaladyOfTheMindTrigger(PlayerbotAI* ai) : YoggSaronTrigger(ai, "yogg-saron malady of the mind trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class YoggSaronMarkTargetTrigger : public YoggSaronTrigger
|
|
{
|
|
public:
|
|
YoggSaronMarkTargetTrigger(PlayerbotAI* ai) : YoggSaronTrigger(ai, "yogg-saron mark target trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class YoggSaronBrainLinkTrigger : public YoggSaronTrigger
|
|
{
|
|
public:
|
|
YoggSaronBrainLinkTrigger(PlayerbotAI* ai) : YoggSaronTrigger(ai, "yogg-saron brain link trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class YoggSaronMoveToEnterPortalTrigger : public YoggSaronTrigger
|
|
{
|
|
public:
|
|
YoggSaronMoveToEnterPortalTrigger(PlayerbotAI* ai) : YoggSaronTrigger(ai, "yogg-saron move to enter portal trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class YoggSaronFallFromFloorTrigger : public YoggSaronTrigger
|
|
{
|
|
public:
|
|
YoggSaronFallFromFloorTrigger(PlayerbotAI* ai) : YoggSaronTrigger(ai, "yogg-saron fall from floor trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class YoggSaronBossRoomMovementCheatTrigger : public YoggSaronTrigger
|
|
{
|
|
public:
|
|
YoggSaronBossRoomMovementCheatTrigger(PlayerbotAI* ai) : YoggSaronTrigger(ai, "yogg-saron boss room movement cheat trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class YoggSaronUsePortalTrigger : public YoggSaronTrigger
|
|
{
|
|
public:
|
|
YoggSaronUsePortalTrigger(PlayerbotAI* ai) : YoggSaronTrigger(ai, "yogg-saron use portal trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class YoggSaronIllusionRoomTrigger : public YoggSaronTrigger
|
|
{
|
|
public:
|
|
YoggSaronIllusionRoomTrigger(PlayerbotAI* ai) : YoggSaronTrigger(ai, "yogg-saron illusion room trigger") {}
|
|
bool IsActive() override;
|
|
|
|
private:
|
|
bool GoToBrainRoomRequired();
|
|
bool SetRtiMarkRequired();
|
|
bool SetRtiTargetRequired();
|
|
};
|
|
|
|
class YoggSaronMoveToExitPortalTrigger : public YoggSaronTrigger
|
|
{
|
|
public:
|
|
YoggSaronMoveToExitPortalTrigger(PlayerbotAI* ai) : YoggSaronTrigger(ai, "yogg-saron move to exit portal trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class YoggSaronLunaticGazeTrigger : public YoggSaronTrigger
|
|
{
|
|
public:
|
|
YoggSaronLunaticGazeTrigger(PlayerbotAI* ai) : YoggSaronTrigger(ai, "yogg-saron lunatic gaze trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
class YoggSaronPhase3PositioningTrigger : public YoggSaronTrigger
|
|
{
|
|
public:
|
|
YoggSaronPhase3PositioningTrigger(PlayerbotAI* ai) : YoggSaronTrigger(ai, "yogg-saron phase 3 positioning trigger") {}
|
|
bool IsActive() override;
|
|
};
|
|
|
|
#endif
|