Fix/Feature: Bots can use travel/flight Shapeshift where appropriate (#1042)

This commit is contained in:
SaW
2025-03-03 15:10:35 +01:00
committed by GitHub
parent 9edddc5b26
commit fe21dfe48e
2 changed files with 239 additions and 147 deletions

View File

@@ -8,6 +8,10 @@
#include "UseItemAction.h"
const uint16 SPELL_TRAVEL_FORM = 783;
const uint16 SPELL_FLIGHT_FORM = 33943;
const uint16 SPELL_SWIFT_FLIGHT_FORM = 40120;
struct MountData
{
bool swiftMount = false;
@@ -30,7 +34,9 @@ public:
bool Mount();
private:
Player* master;
ShapeshiftForm masterInShapeshiftForm;
ShapeshiftForm botInShapeshiftForm;
float CalculateDismountDistance() const;
float CalculateMountDistance() const;
void Dismount();
@@ -39,6 +45,7 @@ private:
int32 CalculateMasterMountSpeed(Player* master, const MountData& mountData) const;
bool CheckForSwiftMount() const;
std::map<uint32, std::map<int32, std::vector<uint32>>> GetAllMountSpells() const;
bool TryForms(Player* master, int32 masterMountType, int32 masterSpeed) const;
bool TryPreferredMount(Player* master) const;
uint32 GetMountType(Player* master) const;
bool TryRandomMountFiltered(const std::map<int32, std::vector<uint32>>& spells, int32 masterSpeed) const;