Updated bot casting roles to not refresh with every spell cast (oversight in recent casting chances commit)

This commit is contained in:
Uleat
2017-02-24 04:48:33 -05:00
parent 72ed770037
commit 3383f65ff7
5 changed files with 147 additions and 59 deletions
+13 -3
View File
@@ -132,7 +132,8 @@ enum SpellTypeIndex {
MaxSpellTypes
};
enum BotCastingChanceConditional : uint8 { nHS = 0, pH, pS, pHS, cntHS }; // negative Healer/Slower, positive Healer, postive Slower, positive Healer/Slower
// negative Healer/Slower, positive Healer, postive Slower, positive Healer/Slower
enum BotCastingChanceConditional : uint8 { nHS = 0, pH, pS, pHS, cntHS = 4 };
class Bot : public NPC {
@@ -475,8 +476,11 @@ public:
BotRoleType GetBotRole() { return _botRole; }
BotStanceType GetBotStance() { return _botStance; }
uint8 GetChanceToCastBySpellType(uint32 spellType);
bool IsGroupPrimaryHealer();
bool IsGroupPrimarySlower();
bool IsGroupHealer() { return m_CastingRoles.GroupHealer; }
bool IsGroupSlower() { return m_CastingRoles.GroupSlower; }
static void UpdateGroupCastingRoles(const Group* group, bool disband = false);
bool IsBotCaster() { return IsCasterClass(GetClass()); }
bool IsBotINTCaster() { return IsINTCasterClass(GetClass()); }
bool IsBotWISCaster() { return IsWISCasterClass(GetClass()); }
@@ -640,6 +644,10 @@ protected:
virtual bool AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0);
virtual float GetMaxMeleeRangeToTarget(Mob* target);
BotCastingRoles& GetCastingRoles() { return m_CastingRoles; }
void SetGroupHealer(bool flag = true) { m_CastingRoles.GroupHealer = flag; }
void SetGroupSlower(bool flag = true) { m_CastingRoles.GroupSlower = flag; }
private:
// Class Members
uint32 _botID;
@@ -679,6 +687,8 @@ private:
Timer evade_timer;
BotCastingRoles m_CastingRoles;
std::shared_ptr<HealRotation> m_member_of_heal_rotation;
std::map<uint32, BotAA> botAAs;