forked from mod-playerbots/mod-playerbots
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Added Zul'Gurub strategies and instance framework. #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SmashingQuasar
wants to merge
8
commits into
main
Choose a base branch
from
dev/SmashingQuasar/zul-gurub-strategy
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
67b1609
feat: Added Gurubashi Bat Rider strategy.
SmashingQuasar b3644c7
feat: Added a functional Venoxis strategy.
SmashingQuasar 861c4e7
feat: Added HakkarTheSoulflayer strategy and reworked the raid system.
SmashingQuasar bc29864
feat: Added Gri'lek The Wanderer strategy.
SmashingQuasar bdfb86d
fix: Corrected Gri'lek strategy.
SmashingQuasar 393652b
feat: Added Bloodlord Mandokir & High Priest Thekal strategies.
SmashingQuasar 10608fd
fix: Lowered Thekal and adds health difference from 5000 to 2500 for …
SmashingQuasar bd51d4f
fix: Migrated to latest core version.
SmashingQuasar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/Ai/Raid/ZulGurub/Boss/BloodlordMandokir/assistant/BloodlordMandokirAssistant.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| #pragma once | ||
|
|
||
| #include "Unit.h" | ||
| #include "Player.h" | ||
| #include "Spell.h" | ||
|
|
||
| #include "GridNotifiers.h" | ||
| // Necessary due to a poor implementation by AC. | ||
| #include "GridNotifiersImpl.h" | ||
|
|
||
| #include "Cell.h" | ||
| #include "CellImpl.h" | ||
|
|
||
| #include "../definition/enum/BloodlordMandokirEnum.h" | ||
|
|
||
|
|
||
| #include "PlayerbotAIConfig.h" | ||
|
|
||
| class BloodlordMandokirAssistant | ||
| { | ||
| public: | ||
| BloodlordMandokirAssistant() = default; | ||
| ~BloodlordMandokirAssistant() = default; | ||
|
|
||
| BloodlordMandokirAssistant(const BloodlordMandokirAssistant&) = default; | ||
| BloodlordMandokirAssistant& operator=(const BloodlordMandokirAssistant&) = default; | ||
|
|
||
| BloodlordMandokirAssistant(BloodlordMandokirAssistant&&) = default; | ||
| BloodlordMandokirAssistant& operator=(BloodlordMandokirAssistant&&) = default; | ||
|
|
||
| [[nodiscard]] bool isInCombatWithBloodlordMandokir(Player& bot) const noexcept | ||
| { | ||
| const Unit* const BloodlordMandokir = this->findActiveBoss(bot); | ||
|
|
||
| if (BloodlordMandokir == nullptr) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| return bot.IsInCombatWith(BloodlordMandokir) || BloodlordMandokir->IsInCombatWith(&bot); | ||
| } | ||
|
|
||
| [[nodiscard]] Creature* findActiveBoss(Player& bot) const noexcept | ||
| { | ||
| return bot.FindNearestCreature(uint32_t(BloodlordMandokirEnum::ENTRY), PlayerbotAIConfig::instance().sightDistance, true); | ||
| } | ||
|
|
||
| [[nodiscard]] bool isAtSafeDistanceFromBloodlordMandokir(Player& bot) const noexcept | ||
| { | ||
| const Unit* const BloodlordMandokir = this->findActiveBoss(bot); | ||
|
|
||
| if (BloodlordMandokir == nullptr) | ||
| { | ||
| return true; | ||
| } | ||
|
|
||
| const float distanceToBloodlordMandokir = bot.GetExactDist2d(BloodlordMandokir->GetPositionX(), BloodlordMandokir->GetPositionY()); | ||
|
|
||
| return distanceToBloodlordMandokir > float(BloodlordMandokirEnum::SPELL_WHIRLWIND_SAFE_DISTANCE); | ||
| }; | ||
| }; |
11 changes: 11 additions & 0 deletions
11
src/Ai/Raid/ZulGurub/Boss/BloodlordMandokir/definition/enum/BloodlordMandokirEnum.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #pragma once | ||
|
|
||
| #include <cstdint> | ||
|
|
||
| enum class BloodlordMandokirEnum : uint32_t | ||
| { | ||
| ENTRY = 11382u, | ||
| SPELL_THREATENING_GAZE = 24314u, | ||
| SPELL_WHIRLWIND = 13736u, | ||
| SPELL_WHIRLWIND_SAFE_DISTANCE = 15u | ||
| }; |
47 changes: 47 additions & 0 deletions
47
...id/ZulGurub/Boss/BloodlordMandokir/mechanics/Whirlwind/BloodlordMandokirWhirlwindAction.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| #pragma once | ||
|
|
||
| #include "Spell.h" | ||
| #include "AiObjectContext.h" | ||
| #include "MovementActions.h" | ||
| #include "PlayerbotAI.h" | ||
|
|
||
| #include "raid/leader/RaidLeaderRegistry.h" | ||
|
|
||
| class BloodlordMandokirWhirlwindAction : public MovementAction | ||
| { | ||
| public: | ||
| BloodlordMandokirWhirlwindAction( | ||
| PlayerbotAI* botAI, | ||
| const std::string name = "bloodlord mandokir whirlwind" | ||
| ) : MovementAction(botAI, name) {} | ||
|
|
||
| bool Execute(Event) override | ||
| { | ||
| if (this->bot == nullptr) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| const uint32_t instanceId = this->bot->GetInstanceId(); | ||
| RaidLeaderRegistry& raidRegistry = RaidLeaderRegistry::GetInstance(); | ||
| const ZulGurubRaidLeader& raidLeader = raidRegistry.getOrBind<ZulGurubRaidLeader>(instanceId, MAP_ZUL_GURUB); | ||
| const BloodlordMandokirAssistant& bloodlordMandokirAssistant = raidLeader.getBloodlordMandokirAssistant(); | ||
| Unit* const bloodlordMandokir = bloodlordMandokirAssistant.findActiveBoss(*this->bot); | ||
|
|
||
| if (bloodlordMandokir == nullptr) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| const float safeDistance = float(BloodlordMandokirEnum::SPELL_WHIRLWIND_SAFE_DISTANCE) - this->bot->GetDistance2d(bloodlordMandokir); | ||
|
|
||
| if (safeDistance <= 0.0f) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| this->MoveAway(bloodlordMandokir, safeDistance); | ||
|
|
||
| return true; | ||
| } | ||
| }; | ||
57 changes: 57 additions & 0 deletions
57
...ulGurub/Boss/BloodlordMandokir/mechanics/Whirlwind/BloodlordMandokirWhirlwindMultiplier.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| #pragma once | ||
|
|
||
| #include "AiObjectContext.h" | ||
| #include "BloodlordMandokirWhirlwindAction.h" | ||
| #include "MovementActions.h" | ||
| #include "Multiplier.h" | ||
| #include "PlayerbotAI.h" | ||
| #include "Value.h" | ||
|
|
||
| #include "GenericSpellActions.h" | ||
| #include "raid/leader/RaidLeaderRegistry.h" | ||
|
|
||
|
|
||
| class BloodlordMandokirWhirlwindMultiplier : public Multiplier | ||
| { | ||
| public: | ||
| BloodlordMandokirWhirlwindMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "bloodlord mandokir whirlwind") {} | ||
|
|
||
| float GetValue(Action& action) override | ||
| { | ||
| if (this->bot == nullptr) | ||
| { | ||
| return 0.0f; | ||
| } | ||
|
|
||
| const uint32_t instanceId = this->bot->GetInstanceId(); | ||
| RaidLeaderRegistry& raidRegistry = RaidLeaderRegistry::GetInstance(); | ||
| const ZulGurubRaidLeader& raidLeader = raidRegistry.getOrBind<ZulGurubRaidLeader>(instanceId, MAP_ZUL_GURUB); | ||
| const BloodlordMandokirAssistant& bloodlordMandokirAssistant = raidLeader.getBloodlordMandokirAssistant(); | ||
|
|
||
| const Creature* const bloodlordMandokir = bloodlordMandokirAssistant.findActiveBoss(*this->bot); | ||
|
|
||
| if (bloodlordMandokir == nullptr) | ||
| { | ||
| return 1.0f; | ||
| } | ||
|
|
||
| if (bloodlordMandokir->HasAura(uint32_t(BloodlordMandokirEnum::SPELL_WHIRLWIND)) == false) | ||
| { | ||
| return 1.0f; | ||
| } | ||
|
|
||
| if (bloodlordMandokirAssistant.isAtSafeDistanceFromBloodlordMandokir(*this->bot) == true) | ||
| { | ||
| return 1.0f; | ||
| } | ||
|
|
||
| const BloodlordMandokirWhirlwindAction* const movementAction = dynamic_cast<const BloodlordMandokirWhirlwindAction*>(&action); | ||
|
|
||
| if (movementAction != nullptr) | ||
| { | ||
| return 1.0f; | ||
| } | ||
|
|
||
| return 0.0f; | ||
| } | ||
| }; |
56 changes: 56 additions & 0 deletions
56
...d/ZulGurub/Boss/BloodlordMandokir/mechanics/Whirlwind/BloodlordMandokirWhirlwindTrigger.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| #pragma once | ||
|
|
||
| #include "AiObjectContext.h" | ||
| #include "BloodlordMandokir/assistant/BloodlordMandokirAssistant.h" | ||
| #include "PlayerbotAI.h" | ||
| #include "Trigger.h" | ||
|
|
||
| #include "raid/leader/RaidLeaderRegistry.h" | ||
|
|
||
| class BloodlordMandokirWhirlwindTrigger : public Trigger | ||
| { | ||
| public: | ||
| BloodlordMandokirWhirlwindTrigger(PlayerbotAI* botAI) : Trigger(botAI, "bloodlord mandokir whirlwind") {} | ||
|
|
||
| bool IsActive() override | ||
| { | ||
| if (this->bot == nullptr) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| if (this->botAI == nullptr) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| const uint32_t instanceId = this->bot->GetInstanceId(); | ||
| RaidLeaderRegistry& raidRegistry = RaidLeaderRegistry::GetInstance(); | ||
| const ZulGurubRaidLeader& raidLeader = raidRegistry.getOrBind<ZulGurubRaidLeader>(instanceId, MAP_ZUL_GURUB); | ||
| const BloodlordMandokirAssistant& bloodlordMandokirAssistant = raidLeader.getBloodlordMandokirAssistant(); | ||
|
|
||
| if (bloodlordMandokirAssistant.isInCombatWithBloodlordMandokir(*this->bot) == false) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| const Creature* const bloodlordMandokir = bloodlordMandokirAssistant.findActiveBoss(*this->bot); | ||
|
|
||
| if (bloodlordMandokir == nullptr) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| if (bloodlordMandokir->HasAura(uint32_t(BloodlordMandokirEnum::SPELL_WHIRLWIND)) == false) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| if (bloodlordMandokirAssistant.isAtSafeDistanceFromBloodlordMandokir(*this->bot) == true) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| return true; | ||
| } | ||
| }; |
112 changes: 112 additions & 0 deletions
112
src/Ai/Raid/ZulGurub/Boss/GrilekTheWanderer/assistant/GrilekTheWandererAssistant.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| #pragma once | ||
|
|
||
| #include "Unit.h" | ||
| #include "Player.h" | ||
| #include "Spell.h" | ||
|
|
||
| #include "GridNotifiers.h" | ||
| // Necessary due to a poor implementation by AC. | ||
| #include "GridNotifiersImpl.h" | ||
|
|
||
| #include "Cell.h" | ||
| #include "CellImpl.h" | ||
|
|
||
| #include "../definition/enum/GrilekTheWandererEnum.h" | ||
| #include <unordered_map> | ||
|
|
||
|
|
||
| #include "PlayerbotAIConfig.h" | ||
|
|
||
| class GrilekTheWandererAssistant | ||
| { | ||
| public: | ||
| GrilekTheWandererAssistant() = default; | ||
| ~GrilekTheWandererAssistant() = default; | ||
|
|
||
| GrilekTheWandererAssistant(const GrilekTheWandererAssistant&) = default; | ||
| GrilekTheWandererAssistant& operator=(const GrilekTheWandererAssistant&) = default; | ||
|
|
||
| GrilekTheWandererAssistant(GrilekTheWandererAssistant&&) = default; | ||
| GrilekTheWandererAssistant& operator=(GrilekTheWandererAssistant&&) = default; | ||
|
|
||
| [[nodiscard]] bool isInCombatWithGrilekTheWanderer(Player& bot) const noexcept | ||
| { | ||
| const Unit* const grilekTheWanderer = this->findActiveBoss(bot); | ||
|
|
||
| if (grilekTheWanderer == nullptr) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| return bot.IsInCombatWith(grilekTheWanderer) || grilekTheWanderer->IsInCombatWith(&bot); | ||
| } | ||
|
|
||
| [[nodiscard]] Creature* findActiveBoss(Player& bot) const noexcept | ||
| { | ||
| return bot.FindNearestCreature(uint32_t(GrilekTheWandererEnum::ENTRY), PlayerbotAIConfig::instance().sightDistance, true); | ||
| } | ||
|
|
||
| // [[nodiscard]] Creature* findActiveBoss(Player& bot) const noexcept | ||
| // { | ||
| // if (!bot.IsInCombat()) | ||
| // { | ||
| // return nullptr; | ||
| // } | ||
|
|
||
| // Map* map = bot.GetMap(); | ||
|
|
||
| // if (map == nullptr) | ||
| // { | ||
| // return nullptr; | ||
| // } | ||
|
|
||
| // const std::unordered_multimap<ObjectGuid::LowType, Creature*> store = map->GetCreatureBySpawnIdStore(); | ||
| // const std::unordered_multimap<ObjectGuid::LowType, Creature*>::const_iterator it = store.find(uint32_t(GrilekTheWandererEnum::ENTRY)); | ||
| // const std::unordered_multimap<ObjectGuid::LowType, Creature*>::const_iterator end = store.end(); | ||
|
|
||
| // if (it == end) | ||
| // { | ||
| // LOG_ERROR("playerbots") | ||
|
|
||
| // return nullptr; | ||
| // } | ||
|
|
||
| // Creature* grilekTheWanderer = it->second; | ||
|
|
||
| // if (grilekTheWanderer == nullptr) | ||
| // { | ||
| // LOG_ERROR("playerbots", "Grilek not found in map."); | ||
|
|
||
| // return nullptr; | ||
| // } | ||
|
|
||
| // if (!grilekTheWanderer->IsAlive()) | ||
| // { | ||
| // LOG_ERROR("playerbots", "Grilek dead"); | ||
| // return nullptr; | ||
| // } | ||
|
|
||
| // if (grilekTheWanderer->GetEntry() != uint32_t(GrilekTheWandererEnum::ENTRY)) | ||
| // { | ||
| // LOG_ERROR("playerbots", "Grilek entry does not match."); | ||
|
|
||
| // return nullptr; | ||
| // } | ||
|
|
||
| // return grilekTheWanderer; | ||
| // }; | ||
|
|
||
| [[nodiscard]] bool isAtSafeDistanceFromGrilekTheWanderer(Player& bot) const noexcept | ||
| { | ||
| const Unit* const grilekTheWanderer = this->findActiveBoss(bot); | ||
|
|
||
| if (grilekTheWanderer == nullptr) | ||
| { | ||
| return true; | ||
| } | ||
|
|
||
| const float distanceToGrilekTheWanderer = bot.GetExactDist2d(grilekTheWanderer->GetPositionX(), grilekTheWanderer->GetPositionY()); | ||
|
|
||
| return distanceToGrilekTheWanderer > float(GrilekTheWandererEnum::AVATAR_SAFE_DISTANCE); | ||
| }; | ||
| }; |
10 changes: 10 additions & 0 deletions
10
src/Ai/Raid/ZulGurub/Boss/GrilekTheWanderer/definition/enum/GrilekTheWandererEnum.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #pragma once | ||
|
|
||
| #include <cstdint> | ||
|
|
||
| enum class GrilekTheWandererEnum : uint32_t | ||
| { | ||
| ENTRY = 15082u, | ||
| SPELL_AVATAR = 24646u, | ||
| AVATAR_SAFE_DISTANCE = 15u, | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable should be named
distanceFromSafetyorsafeDistanceDelta