From 15bf0ab427a91b35e31ffd5551bef8d90c0d6e1a Mon Sep 17 00:00:00 2001 From: Crow Date: Fri, 3 Apr 2026 15:25:40 -0500 Subject: [PATCH] Fix Shaman Weapon Enchants & Cure Toxins/Cleanse Spirit (#2234) ## Pull Request Description 1. I've been having persistent issues with Enhancement Shamans sometimes applying Rockbiter to both weapons instead of MH Windfury and OH Flametongue. Rockbiter is the alternative for Flametongue and, through Flametongue, the alternative for Windfury. But there seemed to be no obvious reason why a Shaman that had all three abilities would ever use Rockbiter, which costs more mana than Windfury and Flametongue. Claude's take on it is that there is instability from ItemForSpellValue related to its poor way of distinguishing handedness, in addition to it having a 1-second cache, which can cause in some scenarios stale caches for the action running on each hand back-to-back. I still can't say I fully understand why the issue exists, but the most straightforward fix that should prevent this from happening is to just have separate mainhand and offhand actions for each enchant. So that's what this PR does. The relevant ActionNodes are now: - The MH-specific chain for Enhancement is WF -> FT -> RB. In practice, Enhancement should never apply RB because all Shamans under level 10 (when FT is learned) are considered Elemental. The FT -> RB node is just for Elemental. - The MH-specific Resto chain (not that Resto can dual-wield) is EL -> FT -> RB. Againt, FT -> RB is just for Elemental. - OH for Enhancement is only FT. You cannot be Enhancement before level 10, nor can Enhancement dual-wield before level 40, so no alternative is needed. 3. I commented out Frostbrand Weapon actions/triggers because the ability is not included in any strategy. I didn't delete the code because in the future somebody might want to implement it as I understand it can be useful for Enhancement Shamans in PvP. 4. Shamans are coded to use "cure poison" and "cure disease", which do not exist in WotLK, having been combined into Cure Toxins. Wishmaster has PR #1844 that has been open on this for a long time, but I decided to correct the abilities here anyway as he was going for a more limited approach, and I decided to rename all the actions and redo the structure to rely on ActionNode alternatives, which is pretty much the exact framework that should be used for this type of situation w/r/t bots. Now, Shamans prefer Cleanse Spirit (Resto talent, which costs the same as Cure Toxins and also dispels curses), with an alternative of Cure Toxins (for poisons and disease only). I tested this and it seems to work well. 5. I deleted empty ActionNodes. 6. I did some cleanup of formatting and such, but this is not intended to be a comprehensive refactor. ## Feature Evaluation - Describe the **minimum logic** required to achieve the intended behavior. - Describe the **processing cost** when this logic executes across many bots. I've followed the general intended structure of class strategies with triggers and actions. The same triggers exist, just different actions are called based on the trigger that fires, so I don't think there should be any impact on performance. ## How to Test the Changes The best way to get a grasp on if things work is probably to just do group play for a while with Shamans and make sure they apply the right enchants and properly cast Cleanse Spirit and Cure Toxins. ## Impact Assessment - Does this change increase per-bot/per-tick processing or risk scaling poorly with thousands of bots? - - [x] No, not at all - - [ ] Minimal impact (**explain below**) - - [ ] Moderate impact (**explain below**) - Does this change modify default bot behavior? - - [ ] No - - [x] Yes (**explain why**) Shamans previously did not cure poisons or disease at all, and now they do with the default "cure" strategy applied. - Does this change add new decision branches or increase maintenance complexity? - - [ ] No - - [x] Yes (**explain below**) One might say having separate actions per hand for enchants is somewhat more complex, but ultimately I think it is less confusing to keep those paths separate. ## Messages to Translate Does this change add bot messages to translate? - - [x] No - - [ ] Yes (**list messages in the table**) | Message key | Default message | | --------------- | ------------------ | | | | | | | ## AI Assistance Was AI assistance used while working on this change? - - [ ] No - - [x] Yes (**explain below**) I had Claude try to diagnose the weapon enchant issue. It proposed and provided the separate MH/OH WF/FT actions. The other things were easy enough for me to do. ## Final Checklist - - [x] Stability is not compromised. - - [x] Performance impact is understood, tested, and acceptable. - - [x] Added logic complexity is justified and explained. - - [x] Documentation updated if needed (Conf comments, WiKi commands). ## Notes for Reviewers --------- Co-authored-by: Keleborn <22352763+Celandriel@users.noreply.github.com> Co-authored-by: bash Co-authored-by: Revision Co-authored-by: kadeshar --- src/Ai/Base/Actions/GenericSpellActions.cpp | 33 +- src/Ai/Base/Actions/GenericSpellActions.h | 14 + src/Ai/Class/Shaman/Action/ShamanActions.cpp | 27 +- src/Ai/Class/Shaman/Action/ShamanActions.h | 352 ++++++++++-------- src/Ai/Class/Shaman/ShamanAiObjectContext.cpp | 194 +++++----- .../Strategy/ElementalShamanStrategy.cpp | 33 +- .../Strategy/EnhancementShamanStrategy.cpp | 17 - .../Shaman/Strategy/GenericShamanStrategy.cpp | 61 +-- .../Shaman/Strategy/RestoShamanStrategy.cpp | 97 +---- .../Strategy/ShamanNonCombatStrategy.cpp | 110 +++--- .../Shaman/Strategy/TotemsShamanStrategy.cpp | 19 +- .../Class/Shaman/Trigger/ShamanTriggers.cpp | 6 +- src/Ai/Class/Shaman/Trigger/ShamanTriggers.h | 137 +++---- 13 files changed, 520 insertions(+), 580 deletions(-) diff --git a/src/Ai/Base/Actions/GenericSpellActions.cpp b/src/Ai/Base/Actions/GenericSpellActions.cpp index 82bdb74d2..41911f62d 100644 --- a/src/Ai/Base/Actions/GenericSpellActions.cpp +++ b/src/Ai/Base/Actions/GenericSpellActions.cpp @@ -151,7 +151,9 @@ bool CastMeleeSpellAction::isUseful() return CastSpellAction::isUseful(); } -CastMeleeDebuffSpellAction::CastMeleeDebuffSpellAction(PlayerbotAI* botAI, std::string const spell, bool isOwner, float needLifeTime) : CastDebuffSpellAction(botAI, spell, isOwner, needLifeTime) +CastMeleeDebuffSpellAction::CastMeleeDebuffSpellAction( + PlayerbotAI* botAI, std::string const spell, bool isOwner, float needLifeTime) : + CastDebuffSpellAction(botAI, spell, isOwner, needLifeTime) { range = ATTACK_DISTANCE; } @@ -203,6 +205,35 @@ bool CastEnchantItemAction::isPossible() return spellId && AI_VALUE2(Item*, "item for spell", spellId); } +CastEnchantItemMainHandAction::CastEnchantItemMainHandAction(PlayerbotAI* botAI, std::string const spell) + : CastEnchantItemAction(botAI, spell) {} + +bool CastEnchantItemMainHandAction::isPossible() +{ + if (!CastEnchantItemAction::isPossible()) + return false; + + Item* item = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND); + return item && !item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT) && + item->GetTemplate()->Class == ITEM_CLASS_WEAPON; +} + +CastEnchantItemOffHandAction::CastEnchantItemOffHandAction(PlayerbotAI* botAI, std::string const spell) + : CastEnchantItemAction(botAI, spell) {} + +bool CastEnchantItemOffHandAction::isPossible() +{ + if (!CastEnchantItemAction::isPossible()) + return false; + + Item* item = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND); + if (!item || item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT)) + return false; + + uint32 invType = item->GetTemplate()->InventoryType; + return invType == INVTYPE_WEAPON || invType == INVTYPE_WEAPONOFFHAND; +} + CastHealingSpellAction::CastHealingSpellAction(PlayerbotAI* botAI, std::string const spell, uint8 estAmount, HealingManaEfficiency manaEfficiency, bool isOwner) : CastAuraSpellAction(botAI, spell, isOwner), estAmount(estAmount), manaEfficiency(manaEfficiency) diff --git a/src/Ai/Base/Actions/GenericSpellActions.h b/src/Ai/Base/Actions/GenericSpellActions.h index b15c4894a..dc0785713 100644 --- a/src/Ai/Base/Actions/GenericSpellActions.h +++ b/src/Ai/Base/Actions/GenericSpellActions.h @@ -130,6 +130,20 @@ public: std::string const GetTargetName() override { return "self target"; } }; +class CastEnchantItemMainHandAction : public CastEnchantItemAction +{ +public: + CastEnchantItemMainHandAction(PlayerbotAI* botAI, std::string const spell); + bool isPossible() override; +}; + +class CastEnchantItemOffHandAction : public CastEnchantItemAction +{ +public: + CastEnchantItemOffHandAction(PlayerbotAI* botAI, std::string const spell); + bool isPossible() override; +}; + class CastHealingSpellAction : public CastAuraSpellAction { public: diff --git a/src/Ai/Class/Shaman/Action/ShamanActions.cpp b/src/Ai/Class/Shaman/Action/ShamanActions.cpp index 3bb0ae86f..47634c4e0 100644 --- a/src/Ai/Class/Shaman/Action/ShamanActions.cpp +++ b/src/Ai/Class/Shaman/Action/ShamanActions.cpp @@ -57,7 +57,8 @@ bool CastLavaBurstAction::isUseful() if (!target) return false; - static const uint32 FLAME_SHOCK_SPELL_IDS[] = {8050, 8052, 8053, 10447, 10448, 29228, 25457, 49232, 49233}; + static const uint32 FLAME_SHOCK_SPELL_IDS[] = + {8050, 8052, 8053, 10447, 10448, 29228, 25457, 49232, 49233}; ObjectGuid botGuid = bot->GetGUID(); for (uint32 spellId : FLAME_SHOCK_SPELL_IDS) @@ -65,6 +66,7 @@ bool CastLavaBurstAction::isUseful() if (target->HasAura(spellId, botGuid)) return true; } + return false; } @@ -77,15 +79,13 @@ bool CastSpiritWalkAction::Execute(Event /*event*/) for (Unit* unit : bot->m_Controlled) { - if (unit->GetEntry() == SPIRIT_WOLF) + if (unit->GetEntry() == SPIRIT_WOLF && unit->HasSpell(SPIRIT_WALK_SPELL)) { - if (unit->HasSpell(SPIRIT_WALK_SPELL)) - { - unit->CastSpell(unit, SPIRIT_WALK_SPELL, false); - return true; - } + unit->CastSpell(unit, SPIRIT_WALK_SPELL, false); + return true; } } + return false; } @@ -105,18 +105,15 @@ bool SetTotemAction::Execute(Event /*event*/) } if (!totemSpell) + return false; + + if (const ActionButton* button = bot->GetActionButton(actionButtonId); + button && button->GetType() == ACTION_BUTTON_SPELL && + button->GetAction() == totemSpell) { return false; } - if (const ActionButton* button = bot->GetActionButton(actionButtonId)) - { - if (button->GetType() == ACTION_BUTTON_SPELL && button->GetAction() == totemSpell) - { - return false; - } - } - bot->addActionButton(actionButtonId, totemSpell, ACTION_BUTTON_SPELL); return true; } diff --git a/src/Ai/Class/Shaman/Action/ShamanActions.h b/src/Ai/Class/Shaman/Action/ShamanActions.h index 69f29f049..cdd661561 100644 --- a/src/Ai/Class/Shaman/Action/ShamanActions.h +++ b/src/Ai/Class/Shaman/Action/ShamanActions.h @@ -18,73 +18,92 @@ class PlayerbotAI; class CastWaterShieldAction : public CastBuffSpellAction { public: - CastWaterShieldAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "water shield") {} + CastWaterShieldAction(PlayerbotAI* botAI) : + CastBuffSpellAction(botAI, "water shield") {} }; class CastLightningShieldAction : public CastBuffSpellAction { public: - CastLightningShieldAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "lightning shield") {} + CastLightningShieldAction(PlayerbotAI* botAI) : + CastBuffSpellAction(botAI, "lightning shield") {} }; -class CastEarthlivingWeaponAction : public CastEnchantItemAction +class CastRockbiterWeaponMainHandAction : public CastEnchantItemMainHandAction { public: - CastEarthlivingWeaponAction(PlayerbotAI* botAI) : CastEnchantItemAction(botAI, "earthliving weapon") {} + CastRockbiterWeaponMainHandAction(PlayerbotAI* botAI) : + CastEnchantItemMainHandAction(botAI, "rockbiter weapon") {} }; -class CastRockbiterWeaponAction : public CastEnchantItemAction +class CastFlametongueWeaponMainHandAction : public CastEnchantItemMainHandAction { public: - CastRockbiterWeaponAction(PlayerbotAI* botAI) : CastEnchantItemAction(botAI, "rockbiter weapon") {} + CastFlametongueWeaponMainHandAction(PlayerbotAI* botAI) : + CastEnchantItemMainHandAction(botAI, "flametongue weapon") {} }; -class CastFlametongueWeaponAction : public CastEnchantItemAction +class CastFlametongueWeaponOffHandAction : public CastEnchantItemOffHandAction { public: - CastFlametongueWeaponAction(PlayerbotAI* botAI) : CastEnchantItemAction(botAI, "flametongue weapon") {} + CastFlametongueWeaponOffHandAction(PlayerbotAI* botAI) : + CastEnchantItemOffHandAction(botAI, "flametongue weapon") {} }; -class CastFrostbrandWeaponAction : public CastEnchantItemAction +/* class CastFrostbrandWeaponOffHandAction : public CastEnchantItemOffHandAction { public: - CastFrostbrandWeaponAction(PlayerbotAI* botAI) : CastEnchantItemAction(botAI, "frostbrand weapon") {} + CastFrostbrandWeaponOffHandAction(PlayerbotAI* botAI) : + CastEnchantItemOffHandAction(botAI, "frostbrand weapon") {} +}; */ + +class CastEarthlivingWeaponMainHandAction : public CastEnchantItemMainHandAction +{ +public: + CastEarthlivingWeaponMainHandAction(PlayerbotAI* botAI) : + CastEnchantItemMainHandAction(botAI, "earthliving weapon") {} }; -class CastWindfuryWeaponAction : public CastEnchantItemAction +class CastWindfuryWeaponMainHandAction : public CastEnchantItemMainHandAction { public: - CastWindfuryWeaponAction(PlayerbotAI* botAI) : CastEnchantItemAction(botAI, "windfury weapon") {} + CastWindfuryWeaponMainHandAction(PlayerbotAI* botAI) : + CastEnchantItemMainHandAction(botAI, "windfury weapon") {} }; class CastAncestralSpiritAction : public ResurrectPartyMemberAction { public: - CastAncestralSpiritAction(PlayerbotAI* botAI) : ResurrectPartyMemberAction(botAI, "ancestral spirit") {} + CastAncestralSpiritAction(PlayerbotAI* botAI) : + ResurrectPartyMemberAction(botAI, "ancestral spirit") {} }; class CastWaterBreathingAction : public CastBuffSpellAction { public: - CastWaterBreathingAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "water breathing") {} + CastWaterBreathingAction(PlayerbotAI* botAI) : + CastBuffSpellAction(botAI, "water breathing") {} }; class CastWaterWalkingAction : public CastBuffSpellAction { public: - CastWaterWalkingAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "water walking") {} + CastWaterWalkingAction(PlayerbotAI* botAI) : + CastBuffSpellAction(botAI, "water walking") {} }; class CastWaterBreathingOnPartyAction : public BuffOnPartyAction { public: - CastWaterBreathingOnPartyAction(PlayerbotAI* botAI) : BuffOnPartyAction(botAI, "water breathing") {} + CastWaterBreathingOnPartyAction(PlayerbotAI* botAI) : + BuffOnPartyAction(botAI, "water breathing") {} }; class CastWaterWalkingOnPartyAction : public BuffOnPartyAction { public: - CastWaterWalkingOnPartyAction(PlayerbotAI* botAI) : BuffOnPartyAction(botAI, "water walking") {} + CastWaterWalkingOnPartyAction(PlayerbotAI* botAI) : + BuffOnPartyAction(botAI, "water walking") {} }; // Boost Actions @@ -92,31 +111,36 @@ public: class CastHeroismAction : public CastBuffSpellAction { public: - CastHeroismAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "heroism") {} + CastHeroismAction(PlayerbotAI* botAI) : + CastBuffSpellAction(botAI, "heroism") {} }; class CastBloodlustAction : public CastBuffSpellAction { public: - CastBloodlustAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "bloodlust") {} + CastBloodlustAction(PlayerbotAI* botAI) : + CastBuffSpellAction(botAI, "bloodlust") {} }; class CastElementalMasteryAction : public CastBuffSpellAction { public: - CastElementalMasteryAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "elemental mastery") {} + CastElementalMasteryAction(PlayerbotAI* botAI) : + CastBuffSpellAction(botAI, "elemental mastery") {} }; class CastShamanisticRageAction : public CastBuffSpellAction { public: - CastShamanisticRageAction(PlayerbotAI* ai) : CastBuffSpellAction(ai, "shamanistic rage") {} + CastShamanisticRageAction(PlayerbotAI* botAI) : + CastBuffSpellAction(botAI, "shamanistic rage") {} }; class CastFeralSpiritAction : public CastSpellAction { public: - CastFeralSpiritAction(PlayerbotAI* ai) : CastSpellAction(ai, "feral spirit") {} + CastFeralSpiritAction(PlayerbotAI* botAI) : + CastSpellAction(botAI, "feral spirit") {} }; class CastSpiritWalkAction : public Action @@ -138,7 +162,8 @@ public: class CastWindShearOnEnemyHealerAction : public CastSpellOnEnemyHealerAction { public: - CastWindShearOnEnemyHealerAction(PlayerbotAI* botAI) : CastSpellOnEnemyHealerAction(botAI, "wind shear") {} + CastWindShearOnEnemyHealerAction(PlayerbotAI* botAI) : + CastSpellOnEnemyHealerAction(botAI, "wind shear") {} }; class CastPurgeAction : public CastSpellAction @@ -150,16 +175,15 @@ public: class CastCleanseSpiritAction : public CastCureSpellAction { public: - CastCleanseSpiritAction(PlayerbotAI* botAI) : CastCureSpellAction(botAI, "cleanse spirit") {} + CastCleanseSpiritAction(PlayerbotAI* botAI) : + CastCureSpellAction(botAI, "cleanse spirit") {} }; class CastCleanseSpiritPoisonOnPartyAction : public CurePartyMemberAction { public: - CastCleanseSpiritPoisonOnPartyAction(PlayerbotAI* botAI) - : CurePartyMemberAction(botAI, "cleanse spirit", DISPEL_POISON) - { - } + CastCleanseSpiritPoisonOnPartyAction(PlayerbotAI* botAI) : + CurePartyMemberAction(botAI, "cleanse spirit", DISPEL_POISON) {} std::string const getName() override { return "cleanse spirit poison on party"; } }; @@ -167,10 +191,8 @@ public: class CastCleanseSpiritCurseOnPartyAction : public CurePartyMemberAction { public: - CastCleanseSpiritCurseOnPartyAction(PlayerbotAI* botAI) - : CurePartyMemberAction(botAI, "cleanse spirit", DISPEL_CURSE) - { - } + CastCleanseSpiritCurseOnPartyAction(PlayerbotAI* botAI) : + CurePartyMemberAction(botAI, "cleanse spirit", DISPEL_CURSE) {} std::string const getName() override { return "cleanse spirit curse on party"; } }; @@ -178,42 +200,35 @@ public: class CastCleanseSpiritDiseaseOnPartyAction : public CurePartyMemberAction { public: - CastCleanseSpiritDiseaseOnPartyAction(PlayerbotAI* botAI) - : CurePartyMemberAction(botAI, "cleanse spirit", DISPEL_DISEASE) - { - } + CastCleanseSpiritDiseaseOnPartyAction(PlayerbotAI* botAI) : + CurePartyMemberAction(botAI, "cleanse spirit", DISPEL_DISEASE) {} std::string const getName() override { return "cleanse spirit disease on party"; } }; -class CastCurePoisonActionSham : public CastCureSpellAction +class CastCureToxinsActionSham : public CastCureSpellAction { public: - CastCurePoisonActionSham(PlayerbotAI* botAI) : CastCureSpellAction(botAI, "cure poison") {} + CastCureToxinsActionSham(PlayerbotAI* botAI) : + CastCureSpellAction(botAI, "cure toxins") {} }; -class CastCurePoisonOnPartyActionSham : public CurePartyMemberAction +class CastCureToxinsPoisonOnPartyActionSham : public CurePartyMemberAction { public: - CastCurePoisonOnPartyActionSham(PlayerbotAI* botAI) : CurePartyMemberAction(botAI, "cure poison", DISPEL_POISON) {} + CastCureToxinsPoisonOnPartyActionSham(PlayerbotAI* botAI) : + CurePartyMemberAction(botAI, "cure toxins", DISPEL_POISON) {} - std::string const getName() override { return "cure poison on party"; } + std::string const getName() override { return "cure toxins poison on party"; } }; -class CastCureDiseaseActionSham : public CastCureSpellAction +class CastCureToxinsDiseaseOnPartyActionSham : public CurePartyMemberAction { public: - CastCureDiseaseActionSham(PlayerbotAI* botAI) : CastCureSpellAction(botAI, "cure disease") {} -}; + CastCureToxinsDiseaseOnPartyActionSham(PlayerbotAI* botAI) : + CurePartyMemberAction(botAI, "cure toxins", DISPEL_DISEASE) {} -class CastCureDiseaseOnPartyActionSham : public CurePartyMemberAction -{ -public: - CastCureDiseaseOnPartyActionSham(PlayerbotAI* botAI) : CurePartyMemberAction(botAI, "cure disease", DISPEL_DISEASE) - { - } - - std::string const getName() override { return "cure disease on party"; } + std::string const getName() override { return "cure toxins disease on party"; } }; // Damage and Debuff Actions @@ -221,68 +236,77 @@ public: class CastFireNovaAction : public CastMeleeSpellAction { public: - CastFireNovaAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "fire nova") {} + CastFireNovaAction(PlayerbotAI* botAI) : + CastMeleeSpellAction(botAI, "fire nova") {} + bool isUseful() override; }; class CastStormstrikeAction : public CastMeleeSpellAction { public: - CastStormstrikeAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "stormstrike") {} + CastStormstrikeAction(PlayerbotAI* botAI) : + CastMeleeSpellAction(botAI, "stormstrike") {} }; class CastLavaLashAction : public CastMeleeSpellAction { public: - CastLavaLashAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "lava lash") {} + CastLavaLashAction(PlayerbotAI* botAI) : + CastMeleeSpellAction(botAI, "lava lash") {} }; class CastFlameShockAction : public CastDebuffSpellAction { public: - CastFlameShockAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "flame shock", true, 6.0f) {} - bool isUseful() override - { - // Bypass TTL check - return CastAuraSpellAction::isUseful(); - } + CastFlameShockAction(PlayerbotAI* botAI) : + CastDebuffSpellAction(botAI, "flame shock", true, 6.0f) {} + + bool isUseful() override { return CastAuraSpellAction::isUseful(); } }; class CastEarthShockAction : public CastSpellAction { public: - CastEarthShockAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "earth shock") {} + CastEarthShockAction(PlayerbotAI* botAI) : + CastSpellAction(botAI, "earth shock") {} }; class CastFrostShockAction : public CastSnareSpellAction { public: - CastFrostShockAction(PlayerbotAI* botAI) : CastSnareSpellAction(botAI, "frost shock") {} + CastFrostShockAction(PlayerbotAI* botAI) : + CastSnareSpellAction(botAI, "frost shock") {} }; class CastChainLightningAction : public CastSpellAction { public: - CastChainLightningAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "chain lightning") {} + CastChainLightningAction(PlayerbotAI* botAI) : + CastSpellAction(botAI, "chain lightning") {} + ActionThreatType getThreatType() override { return ActionThreatType::Aoe; } }; class CastLightningBoltAction : public CastSpellAction { public: - CastLightningBoltAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "lightning bolt") {} + CastLightningBoltAction(PlayerbotAI* botAI) : + CastSpellAction(botAI, "lightning bolt") {} }; class CastThunderstormAction : public CastSpellAction { public: - CastThunderstormAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "thunderstorm") {} + CastThunderstormAction(PlayerbotAI* botAI) : + CastSpellAction(botAI, "thunderstorm") {} }; class CastLavaBurstAction : public CastSpellAction { public: - CastLavaBurstAction(PlayerbotAI* ai) : CastSpellAction(ai, "lava burst") {} + CastLavaBurstAction(PlayerbotAI* botAI) : + CastSpellAction(botAI, "lava burst") {} bool isUseful() override; }; @@ -291,73 +315,71 @@ public: class CastLesserHealingWaveAction : public CastHealingSpellAction { public: - CastLesserHealingWaveAction(PlayerbotAI* botAI) : CastHealingSpellAction(botAI, "lesser healing wave") {} + CastLesserHealingWaveAction(PlayerbotAI* botAI) : + CastHealingSpellAction(botAI, "lesser healing wave") {} }; class CastLesserHealingWaveOnPartyAction : public HealPartyMemberAction { public: - CastLesserHealingWaveOnPartyAction(PlayerbotAI* botAI) - : HealPartyMemberAction(botAI, "lesser healing wave", 25.0f, HealingManaEfficiency::LOW) - { - } + CastLesserHealingWaveOnPartyAction(PlayerbotAI* botAI) : + HealPartyMemberAction(botAI, "lesser healing wave", 25.0f, HealingManaEfficiency::LOW) {} }; class CastHealingWaveAction : public CastHealingSpellAction { public: - CastHealingWaveAction(PlayerbotAI* botAI) : CastHealingSpellAction(botAI, "healing wave") {} + CastHealingWaveAction(PlayerbotAI* botAI) : + CastHealingSpellAction(botAI, "healing wave") {} }; class CastHealingWaveOnPartyAction : public HealPartyMemberAction { public: - CastHealingWaveOnPartyAction(PlayerbotAI* botAI) - : HealPartyMemberAction(botAI, "healing wave", 50.0f, HealingManaEfficiency::MEDIUM) - { - } + CastHealingWaveOnPartyAction(PlayerbotAI* botAI) : + HealPartyMemberAction(botAI, "healing wave", 50.0f, HealingManaEfficiency::MEDIUM) {} }; class CastChainHealAction : public HealPartyMemberAction { public: - CastChainHealAction(PlayerbotAI* botAI) - : HealPartyMemberAction(botAI, "chain heal", 15.0f, HealingManaEfficiency::HIGH) - { - } + CastChainHealAction(PlayerbotAI* botAI) : + HealPartyMemberAction(botAI, "chain heal", 15.0f, HealingManaEfficiency::HIGH) {} }; class CastRiptideAction : public CastHealingSpellAction { public: - CastRiptideAction(PlayerbotAI* botAI) : CastHealingSpellAction(botAI, "riptide") {} + CastRiptideAction(PlayerbotAI* botAI) : + CastHealingSpellAction(botAI, "riptide") {} }; class CastRiptideOnPartyAction : public HealPartyMemberAction { public: - CastRiptideOnPartyAction(PlayerbotAI* botAI) - : HealPartyMemberAction(botAI, "riptide", 15.0f, HealingManaEfficiency::VERY_HIGH) - { - } + CastRiptideOnPartyAction(PlayerbotAI* botAI) : + HealPartyMemberAction(botAI, "riptide", 15.0f, HealingManaEfficiency::VERY_HIGH) {} }; class CastEarthShieldAction : public CastBuffSpellAction { public: - CastEarthShieldAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "earth shield") {} + CastEarthShieldAction(PlayerbotAI* botAI) : + CastBuffSpellAction(botAI, "earth shield") {} }; class CastEarthShieldOnPartyAction : public BuffOnPartyAction { public: - CastEarthShieldOnPartyAction(PlayerbotAI* botAI) : BuffOnPartyAction(botAI, "earth shield") {} + CastEarthShieldOnPartyAction(PlayerbotAI* botAI) : + BuffOnPartyAction(botAI, "earth shield") {} }; class CastEarthShieldOnMainTankAction : public BuffOnMainTankAction { public: - CastEarthShieldOnMainTankAction(PlayerbotAI* ai) : BuffOnMainTankAction(ai, "earth shield", false) {} + CastEarthShieldOnMainTankAction(PlayerbotAI* botAI) : + BuffOnMainTankAction(botAI, "earth shield", false) {} }; // Totem Spells @@ -365,8 +387,9 @@ public: class CastTotemAction : public CastBuffSpellAction { public: - CastTotemAction(PlayerbotAI* botAI, std::string const spell, std::string const buffName = "") - : CastBuffSpellAction(botAI, spell) + CastTotemAction( + PlayerbotAI* botAI, std::string const spell, + std::string const buffName = "") : CastBuffSpellAction(botAI, spell) { buff = (buffName == "") ? spell : buffName; } @@ -380,56 +403,66 @@ protected: class CastCallOfTheElementsAction : public CastSpellAction { public: - CastCallOfTheElementsAction(PlayerbotAI* ai) : CastSpellAction(ai, "call of the elements") {} + CastCallOfTheElementsAction(PlayerbotAI* botAI) : + CastSpellAction(botAI, "call of the elements") {} }; class CastTotemicRecallAction : public CastSpellAction { public: - CastTotemicRecallAction(PlayerbotAI* ai) : CastSpellAction(ai, "totemic recall") {} + CastTotemicRecallAction(PlayerbotAI* botAI) : + CastSpellAction(botAI, "totemic recall") {} }; class CastStrengthOfEarthTotemAction : public CastTotemAction { public: - CastStrengthOfEarthTotemAction(PlayerbotAI* botAI) : CastTotemAction(botAI, "strength of earth totem", "strength of earth") {} + CastStrengthOfEarthTotemAction(PlayerbotAI* botAI) : + CastTotemAction(botAI, "strength of earth totem", "strength of earth") {} }; class CastStoneskinTotemAction : public CastTotemAction { public: - CastStoneskinTotemAction(PlayerbotAI* botAI) : CastTotemAction(botAI, "stoneskin totem", "stoneskin") {} + CastStoneskinTotemAction(PlayerbotAI* botAI) : + CastTotemAction(botAI, "stoneskin totem", "stoneskin") {} }; class CastTremorTotemAction : public CastTotemAction { public: - CastTremorTotemAction(PlayerbotAI* botAI) : CastTotemAction(botAI, "tremor totem", "") {} + CastTremorTotemAction(PlayerbotAI* botAI) : + CastTotemAction(botAI, "tremor totem", "") {} }; class CastEarthbindTotemAction : public CastTotemAction { public: - CastEarthbindTotemAction(PlayerbotAI* botAI) : CastTotemAction(botAI, "earthbind totem", "") {} + CastEarthbindTotemAction(PlayerbotAI* botAI) : + CastTotemAction(botAI, "earthbind totem", "") {} }; class CastStoneclawTotemAction : public CastTotemAction { public: - CastStoneclawTotemAction(PlayerbotAI* botAI) : CastTotemAction(botAI, "stoneclaw totem", "") {} + CastStoneclawTotemAction(PlayerbotAI* botAI) : + CastTotemAction(botAI, "stoneclaw totem", "") {} bool isUseful() override; }; class CastSearingTotemAction : public CastTotemAction { public: - CastSearingTotemAction(PlayerbotAI* botAI) : CastTotemAction(botAI, "searing totem", "") {} + CastSearingTotemAction(PlayerbotAI* botAI) : + CastTotemAction(botAI, "searing totem", "") {} }; class CastMagmaTotemAction : public CastTotemAction { public: - CastMagmaTotemAction(PlayerbotAI* botAI) : CastTotemAction(botAI, "magma totem", "") {} + CastMagmaTotemAction(PlayerbotAI* botAI) : + CastTotemAction(botAI, "magma totem", "") {} + std::string const GetTargetName() override { return "self target"; } bool isUseful() override; }; @@ -437,26 +470,30 @@ public: class CastFlametongueTotemAction : public CastTotemAction { public: - CastFlametongueTotemAction(PlayerbotAI* botAI) : CastTotemAction(botAI, "flametongue totem", "flametongue totem") {} + CastFlametongueTotemAction(PlayerbotAI* botAI) : + CastTotemAction(botAI, "flametongue totem", "flametongue totem") {} }; class CastTotemOfWrathAction : public CastTotemAction { public: - CastTotemOfWrathAction(PlayerbotAI* botAI) : CastTotemAction(botAI, "totem of wrath", "totem of wrath") {} + CastTotemOfWrathAction(PlayerbotAI* botAI) : + CastTotemAction(botAI, "totem of wrath", "totem of wrath") {} }; class CastFrostResistanceTotemAction : public CastTotemAction { public: - CastFrostResistanceTotemAction(PlayerbotAI* botAI) - : CastTotemAction(botAI, "frost resistance totem", "frost resistance") {} + CastFrostResistanceTotemAction(PlayerbotAI* botAI) : + CastTotemAction(botAI, "frost resistance totem", "frost resistance") {} }; class CastFireElementalTotemAction : public CastTotemAction { public: - CastFireElementalTotemAction(PlayerbotAI* ai) : CastTotemAction(ai, "fire elemental totem", "") {} + CastFireElementalTotemAction(PlayerbotAI* botAI) : + CastTotemAction(botAI, "fire elemental totem", "") {} + virtual std::string const GetTargetName() override { return "self target"; } virtual bool isUseful() override { return CastTotemAction::isUseful(); } }; @@ -464,7 +501,9 @@ public: class CastFireElementalTotemMeleeAction : public CastTotemAction { public: - CastFireElementalTotemMeleeAction(PlayerbotAI* ai) : CastTotemAction(ai, "fire elemental totem", "") {} + CastFireElementalTotemMeleeAction(PlayerbotAI* botAI) : + CastTotemAction(botAI, "fire elemental totem", "") {} + virtual std::string const GetTargetName() override { return "self target"; } virtual bool isUseful() override { @@ -478,51 +517,60 @@ public: class CastHealingStreamTotemAction : public CastTotemAction { public: - CastHealingStreamTotemAction(PlayerbotAI* botAI) : CastTotemAction(botAI, "healing stream totem", "") {} + CastHealingStreamTotemAction(PlayerbotAI* botAI) : + CastTotemAction(botAI, "healing stream totem", "") {} }; class CastManaSpringTotemAction : public CastTotemAction { public: - CastManaSpringTotemAction(PlayerbotAI* botAI) : CastTotemAction(botAI, "mana spring totem", "mana spring") {} + CastManaSpringTotemAction(PlayerbotAI* botAI) : + CastTotemAction(botAI, "mana spring totem", "mana spring") {} }; class CastCleansingTotemAction : public CastTotemAction { public: - CastCleansingTotemAction(PlayerbotAI* botAI) : CastTotemAction(botAI, "cleansing totem", "") {} + CastCleansingTotemAction(PlayerbotAI* botAI) : + CastTotemAction(botAI, "cleansing totem", "") {} virtual bool isUseful(); }; class CastManaTideTotemAction : public CastTotemAction { public: - CastManaTideTotemAction(PlayerbotAI* botAI) : CastTotemAction(botAI, "mana tide totem", "") {} + CastManaTideTotemAction(PlayerbotAI* botAI) : + CastTotemAction(botAI, "mana tide totem", "") {} + std::string const GetTargetName() override { return "self target"; } }; class CastFireResistanceTotemAction : public CastTotemAction { public: - CastFireResistanceTotemAction(PlayerbotAI* botAI) : CastTotemAction(botAI, "fire resistance totem", "fire resistance") {} + CastFireResistanceTotemAction(PlayerbotAI* botAI) : + CastTotemAction(botAI, "fire resistance totem", "fire resistance") {} }; class CastWrathOfAirTotemAction : public CastTotemAction { public: - CastWrathOfAirTotemAction(PlayerbotAI* ai) : CastTotemAction(ai, "wrath of air totem", "wrath of air totem") {} + CastWrathOfAirTotemAction(PlayerbotAI* botAI) : + CastTotemAction(botAI, "wrath of air totem", "wrath of air totem") {} }; class CastWindfuryTotemAction : public CastTotemAction { public: - CastWindfuryTotemAction(PlayerbotAI* botAI) : CastTotemAction(botAI, "windfury totem", "windfury totem") {} + CastWindfuryTotemAction(PlayerbotAI* botAI) : + CastTotemAction(botAI, "windfury totem", "windfury totem") {} }; class CastNatureResistanceTotemAction : public CastTotemAction { public: - CastNatureResistanceTotemAction(PlayerbotAI* botAI) : CastTotemAction(botAI, "nature resistance totem", "nature resistance") {} + CastNatureResistanceTotemAction(PlayerbotAI* botAI) : + CastTotemAction(botAI, "nature resistance totem", "nature resistance") {} }; // Set Strategy Assigned Totems @@ -532,12 +580,8 @@ class SetTotemAction : public Action public: // Template constructor: infers N (size of the id array) at compile time template - SetTotemAction(PlayerbotAI* botAI, std::string const& totemName, const uint32 (&ids)[N], int actionButtonId) - : Action(botAI, "set " + totemName) - , totemSpellIds(ids) - , totemSpellIdsCount(N) - , actionButtonId(actionButtonId) - {} + SetTotemAction(PlayerbotAI* botAI, std::string const& totemName, const uint32 (&ids)[N], int actionButtonId) : + Action(botAI, "set " + totemName), totemSpellIds(ids), totemSpellIdsCount(N), actionButtonId(actionButtonId) {} bool Execute(Event event) override; uint32 const* totemSpellIds; @@ -548,120 +592,120 @@ public: class SetStrengthOfEarthTotemAction : public SetTotemAction { public: - SetStrengthOfEarthTotemAction(PlayerbotAI* ai) - : SetTotemAction(ai, "strength of earth totem", STRENGTH_OF_EARTH_TOTEM, TOTEM_BAR_SLOT_EARTH) {} + SetStrengthOfEarthTotemAction(PlayerbotAI* botAI) : + SetTotemAction(botAI, "strength of earth totem", STRENGTH_OF_EARTH_TOTEM, TOTEM_BAR_SLOT_EARTH) {} }; class SetStoneskinTotemAction : public SetTotemAction { public: - SetStoneskinTotemAction(PlayerbotAI* ai) - : SetTotemAction(ai, "stoneskin totem", STONESKIN_TOTEM, TOTEM_BAR_SLOT_EARTH) {} + SetStoneskinTotemAction(PlayerbotAI* botAI) : + SetTotemAction(botAI, "stoneskin totem", STONESKIN_TOTEM, TOTEM_BAR_SLOT_EARTH) {} }; class SetTremorTotemAction : public SetTotemAction { public: - SetTremorTotemAction(PlayerbotAI* ai) - : SetTotemAction(ai, "tremor totem", TREMOR_TOTEM, TOTEM_BAR_SLOT_EARTH) {} + SetTremorTotemAction(PlayerbotAI* botAI) : + SetTotemAction(botAI, "tremor totem", TREMOR_TOTEM, TOTEM_BAR_SLOT_EARTH) {} }; class SetEarthbindTotemAction : public SetTotemAction { public: - SetEarthbindTotemAction(PlayerbotAI* ai) - : SetTotemAction(ai, "earthbind totem", EARTHBIND_TOTEM, TOTEM_BAR_SLOT_EARTH) {} + SetEarthbindTotemAction(PlayerbotAI* botAI) : + SetTotemAction(botAI, "earthbind totem", EARTHBIND_TOTEM, TOTEM_BAR_SLOT_EARTH) {} }; class SetSearingTotemAction : public SetTotemAction { public: - SetSearingTotemAction(PlayerbotAI* ai) - : SetTotemAction(ai, "searing totem", SEARING_TOTEM, TOTEM_BAR_SLOT_FIRE) {} + SetSearingTotemAction(PlayerbotAI* botAI) : + SetTotemAction(botAI, "searing totem", SEARING_TOTEM, TOTEM_BAR_SLOT_FIRE) {} }; class SetMagmaTotemAction : public SetTotemAction { public: - SetMagmaTotemAction(PlayerbotAI* ai) - : SetTotemAction(ai, "magma totem", MAGMA_TOTEM, TOTEM_BAR_SLOT_FIRE) {} + SetMagmaTotemAction(PlayerbotAI* botAI) : + SetTotemAction(botAI, "magma totem", MAGMA_TOTEM, TOTEM_BAR_SLOT_FIRE) {} }; class SetFlametongueTotemAction : public SetTotemAction { public: - SetFlametongueTotemAction(PlayerbotAI* ai) - : SetTotemAction(ai, "flametongue totem", FLAMETONGUE_TOTEM, TOTEM_BAR_SLOT_FIRE) {} + SetFlametongueTotemAction(PlayerbotAI* botAI) : + SetTotemAction(botAI, "flametongue totem", FLAMETONGUE_TOTEM, TOTEM_BAR_SLOT_FIRE) {} }; class SetTotemOfWrathAction : public SetTotemAction { public: - SetTotemOfWrathAction(PlayerbotAI* ai) - : SetTotemAction(ai, "totem of wrath", TOTEM_OF_WRATH, TOTEM_BAR_SLOT_FIRE) {} + SetTotemOfWrathAction(PlayerbotAI* botAI) : + SetTotemAction(botAI, "totem of wrath", TOTEM_OF_WRATH, TOTEM_BAR_SLOT_FIRE) {} }; class SetFrostResistanceTotemAction : public SetTotemAction { public: - SetFrostResistanceTotemAction(PlayerbotAI* ai) - : SetTotemAction(ai, "frost resistance totem", FROST_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_FIRE) {} + SetFrostResistanceTotemAction(PlayerbotAI* botAI) : + SetTotemAction(botAI, "frost resistance totem", FROST_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_FIRE) {} }; class SetHealingStreamTotemAction : public SetTotemAction { public: - SetHealingStreamTotemAction(PlayerbotAI* ai) - : SetTotemAction(ai, "healing stream totem", HEALING_STREAM_TOTEM, TOTEM_BAR_SLOT_WATER) {} + SetHealingStreamTotemAction(PlayerbotAI* botAI) : + SetTotemAction(botAI, "healing stream totem", HEALING_STREAM_TOTEM, TOTEM_BAR_SLOT_WATER) {} }; class SetManaSpringTotemAction : public SetTotemAction { public: - SetManaSpringTotemAction(PlayerbotAI* ai) - : SetTotemAction(ai, "mana spring totem", MANA_SPRING_TOTEM, TOTEM_BAR_SLOT_WATER) {} + SetManaSpringTotemAction(PlayerbotAI* botAI) : + SetTotemAction(botAI, "mana spring totem", MANA_SPRING_TOTEM, TOTEM_BAR_SLOT_WATER) {} }; class SetCleansingTotemAction : public SetTotemAction { public: - SetCleansingTotemAction(PlayerbotAI* ai) - : SetTotemAction(ai, "cleansing totem", CLEANSING_TOTEM, TOTEM_BAR_SLOT_WATER) {} + SetCleansingTotemAction(PlayerbotAI* botAI) : + SetTotemAction(botAI, "cleansing totem", CLEANSING_TOTEM, TOTEM_BAR_SLOT_WATER) {} }; class SetFireResistanceTotemAction : public SetTotemAction { public: - SetFireResistanceTotemAction(PlayerbotAI* ai) - : SetTotemAction(ai, "fire resistance totem", FIRE_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_WATER) {} + SetFireResistanceTotemAction(PlayerbotAI* botAI) : + SetTotemAction(botAI, "fire resistance totem", FIRE_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_WATER) {} }; class SetWrathOfAirTotemAction : public SetTotemAction { public: - SetWrathOfAirTotemAction(PlayerbotAI* ai) - : SetTotemAction(ai, "wrath of air totem", WRATH_OF_AIR_TOTEM, TOTEM_BAR_SLOT_AIR) {} + SetWrathOfAirTotemAction(PlayerbotAI* botAI) : + SetTotemAction(botAI, "wrath of air totem", WRATH_OF_AIR_TOTEM, TOTEM_BAR_SLOT_AIR) {} }; class SetWindfuryTotemAction : public SetTotemAction { public: - SetWindfuryTotemAction(PlayerbotAI* ai) - : SetTotemAction(ai, "windfury totem", WINDFURY_TOTEM, TOTEM_BAR_SLOT_AIR) {} + SetWindfuryTotemAction(PlayerbotAI* botAI) : + SetTotemAction(botAI, "windfury totem", WINDFURY_TOTEM, TOTEM_BAR_SLOT_AIR) {} }; class SetNatureResistanceTotemAction : public SetTotemAction { public: - SetNatureResistanceTotemAction(PlayerbotAI* ai) - : SetTotemAction(ai, "nature resistance totem", NATURE_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_AIR) {} + SetNatureResistanceTotemAction(PlayerbotAI* botAI) : + SetTotemAction(botAI, "nature resistance totem", NATURE_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_AIR) {} }; class SetGroundingTotemAction : public SetTotemAction { public: - SetGroundingTotemAction(PlayerbotAI* ai) - : SetTotemAction(ai, "grounding totem", GROUNDING_TOTEM, TOTEM_BAR_SLOT_AIR) {} + SetGroundingTotemAction(PlayerbotAI* botAI) : + SetTotemAction(botAI, "grounding totem", GROUNDING_TOTEM, TOTEM_BAR_SLOT_AIR) {} }; #endif diff --git a/src/Ai/Class/Shaman/ShamanAiObjectContext.cpp b/src/Ai/Class/Shaman/ShamanAiObjectContext.cpp index 08ee3638d..73c41c4b6 100644 --- a/src/Ai/Class/Shaman/ShamanAiObjectContext.cpp +++ b/src/Ai/Class/Shaman/ShamanAiObjectContext.cpp @@ -158,10 +158,6 @@ public: creators["bloodlust"] = &ShamanATriggerFactoryInternal::bloodlust; creators["elemental mastery"] = &ShamanATriggerFactoryInternal::elemental_mastery; creators["wind shear on enemy healer"] = &ShamanATriggerFactoryInternal::wind_shear_on_enemy_healer; - creators["cure poison"] = &ShamanATriggerFactoryInternal::cure_poison; - creators["party member cure poison"] = &ShamanATriggerFactoryInternal::party_member_cure_poison; - creators["cure disease"] = &ShamanATriggerFactoryInternal::cure_disease; - creators["party member cure disease"] = &ShamanATriggerFactoryInternal::party_member_cure_disease; creators["earth shield on main tank"] = &ShamanATriggerFactoryInternal::earth_shield_on_main_tank; creators["maelstrom weapon 3"] = &ShamanATriggerFactoryInternal::maelstrom_weapon_3; creators["maelstrom weapon 4"] = &ShamanATriggerFactoryInternal::maelstrom_weapon_4; @@ -225,42 +221,38 @@ private: static Trigger* shock(PlayerbotAI* botAI) { return new ShockTrigger(botAI); } static Trigger* frost_shock_snare(PlayerbotAI* botAI) { return new FrostShockSnareTrigger(botAI); } static Trigger* wind_shear_on_enemy_healer(PlayerbotAI* botAI) { return new WindShearInterruptEnemyHealerSpellTrigger(botAI); } - static Trigger* cure_poison(PlayerbotAI* botAI) { return new CurePoisonTrigger(botAI); } - static Trigger* party_member_cure_poison(PlayerbotAI* botAI) { return new PartyMemberCurePoisonTrigger(botAI); } - static Trigger* cure_disease(PlayerbotAI* botAI) { return new CureDiseaseTrigger(botAI); } - static Trigger* party_member_cure_disease(PlayerbotAI* botAI) { return new PartyMemberCureDiseaseTrigger(botAI); } - static Trigger* earth_shield_on_main_tank(PlayerbotAI* ai) { return new EarthShieldOnMainTankTrigger(ai); } - static Trigger* flame_shock(PlayerbotAI* ai) { return new FlameShockTrigger(ai); } + static Trigger* earth_shield_on_main_tank(PlayerbotAI* botAI) { return new EarthShieldOnMainTankTrigger(botAI); } + static Trigger* flame_shock(PlayerbotAI* botAI) { return new FlameShockTrigger(botAI); } static Trigger* fire_elemental_totem(PlayerbotAI* botAI) { return new FireElementalTotemTrigger(botAI); } static Trigger* earth_shock_execute(PlayerbotAI* botAI) { return new EarthShockExecuteTrigger(botAI); } - static Trigger* spirit_walk_ready(PlayerbotAI* ai) { return new SpiritWalkTrigger(ai); } - static Trigger* chain_lightning_no_cd(PlayerbotAI* ai) { return new ChainLightningNoCdTrigger(ai); } - static Trigger* call_of_the_elements_and_enemy_within_melee(PlayerbotAI* ai) { return new CallOfTheElementsAndEnemyWithinMeleeTrigger(ai); } - static Trigger* maelstrom_weapon_5_and_medium_aoe(PlayerbotAI* ai) { return new MaelstromWeapon5AndMediumAoeTrigger(ai); } - static Trigger* maelstrom_weapon_4_and_medium_aoe(PlayerbotAI* ai) { return new MaelstromWeapon4AndMediumAoeTrigger(ai); } - static Trigger* call_of_the_elements(PlayerbotAI* ai) { return new CallOfTheElementsTrigger(ai); } - static Trigger* totemic_recall(PlayerbotAI* ai) { return new TotemicRecallTrigger(ai); } - static Trigger* no_earth_totem(PlayerbotAI* ai) { return new NoEarthTotemTrigger(ai); } - static Trigger* no_fire_totem(PlayerbotAI* ai) { return new NoFireTotemTrigger(ai); } - static Trigger* no_water_totem(PlayerbotAI* ai) { return new NoWaterTotemTrigger(ai); } - static Trigger* no_air_totem(PlayerbotAI* ai) { return new NoAirTotemTrigger(ai); } - static Trigger* set_strength_of_earth_totem(PlayerbotAI* ai) { return new SetStrengthOfEarthTotemTrigger(ai); } - static Trigger* set_stoneskin_totem(PlayerbotAI* ai) { return new SetStoneskinTotemTrigger(ai); } - static Trigger* set_tremor_totem(PlayerbotAI* ai) { return new SetTremorTotemTrigger(ai); } - static Trigger* set_earthbind_totem(PlayerbotAI* ai) { return new SetEarthbindTotemTrigger(ai); } - static Trigger* set_searing_totem(PlayerbotAI* ai) { return new SetSearingTotemTrigger(ai); } - static Trigger* set_magma_totem(PlayerbotAI* ai) { return new SetMagmaTotemTrigger(ai); } - static Trigger* set_flametongue_totem(PlayerbotAI* ai) { return new SetFlametongueTotemTrigger(ai); } - static Trigger* set_totem_of_wrath(PlayerbotAI* ai) { return new SetTotemOfWrathTrigger(ai); } - static Trigger* set_frost_resistance_totem(PlayerbotAI* ai) { return new SetFrostResistanceTotemTrigger(ai); } - static Trigger* set_healing_stream_totem(PlayerbotAI* ai) { return new SetHealingStreamTotemTrigger(ai); } - static Trigger* set_mana_spring_totem(PlayerbotAI* ai) { return new SetManaSpringTotemTrigger(ai); } - static Trigger* set_cleansing_totem(PlayerbotAI* ai) { return new SetCleansingTotemTrigger(ai); } - static Trigger* set_fire_resistance_totem(PlayerbotAI* ai) { return new SetFireResistanceTotemTrigger(ai); } - static Trigger* set_wrath_of_air_totem(PlayerbotAI* ai) { return new SetWrathOfAirTotemTrigger(ai); } - static Trigger* set_windfury_totem(PlayerbotAI* ai) { return new SetWindfuryTotemTrigger(ai); } - static Trigger* set_nature_resistance_totem(PlayerbotAI* ai) { return new SetNatureResistanceTotemTrigger(ai); } - static Trigger* set_grounding_totem(PlayerbotAI* ai) { return new SetGroundingTotemTrigger(ai); } + static Trigger* spirit_walk_ready(PlayerbotAI* botAI) { return new SpiritWalkTrigger(botAI); } + static Trigger* chain_lightning_no_cd(PlayerbotAI* botAI) { return new ChainLightningNoCdTrigger(botAI); } + static Trigger* call_of_the_elements_and_enemy_within_melee(PlayerbotAI* botAI) { return new CallOfTheElementsAndEnemyWithinMeleeTrigger(botAI); } + static Trigger* maelstrom_weapon_5_and_medium_aoe(PlayerbotAI* botAI) { return new MaelstromWeapon5AndMediumAoeTrigger(botAI); } + static Trigger* maelstrom_weapon_4_and_medium_aoe(PlayerbotAI* botAI) { return new MaelstromWeapon4AndMediumAoeTrigger(botAI); } + static Trigger* call_of_the_elements(PlayerbotAI* botAI) { return new CallOfTheElementsTrigger(botAI); } + static Trigger* totemic_recall(PlayerbotAI* botAI) { return new TotemicRecallTrigger(botAI); } + static Trigger* no_earth_totem(PlayerbotAI* botAI) { return new NoEarthTotemTrigger(botAI); } + static Trigger* no_fire_totem(PlayerbotAI* botAI) { return new NoFireTotemTrigger(botAI); } + static Trigger* no_water_totem(PlayerbotAI* botAI) { return new NoWaterTotemTrigger(botAI); } + static Trigger* no_air_totem(PlayerbotAI* botAI) { return new NoAirTotemTrigger(botAI); } + static Trigger* set_strength_of_earth_totem(PlayerbotAI* botAI) { return new SetStrengthOfEarthTotemTrigger(botAI); } + static Trigger* set_stoneskin_totem(PlayerbotAI* botAI) { return new SetStoneskinTotemTrigger(botAI); } + static Trigger* set_tremor_totem(PlayerbotAI* botAI) { return new SetTremorTotemTrigger(botAI); } + static Trigger* set_earthbind_totem(PlayerbotAI* botAI) { return new SetEarthbindTotemTrigger(botAI); } + static Trigger* set_searing_totem(PlayerbotAI* botAI) { return new SetSearingTotemTrigger(botAI); } + static Trigger* set_magma_totem(PlayerbotAI* botAI) { return new SetMagmaTotemTrigger(botAI); } + static Trigger* set_flametongue_totem(PlayerbotAI* botAI) { return new SetFlametongueTotemTrigger(botAI); } + static Trigger* set_totem_of_wrath(PlayerbotAI* botAI) { return new SetTotemOfWrathTrigger(botAI); } + static Trigger* set_frost_resistance_totem(PlayerbotAI* botAI) { return new SetFrostResistanceTotemTrigger(botAI); } + static Trigger* set_healing_stream_totem(PlayerbotAI* botAI) { return new SetHealingStreamTotemTrigger(botAI); } + static Trigger* set_mana_spring_totem(PlayerbotAI* botAI) { return new SetManaSpringTotemTrigger(botAI); } + static Trigger* set_cleansing_totem(PlayerbotAI* botAI) { return new SetCleansingTotemTrigger(botAI); } + static Trigger* set_fire_resistance_totem(PlayerbotAI* botAI) { return new SetFireResistanceTotemTrigger(botAI); } + static Trigger* set_wrath_of_air_totem(PlayerbotAI* botAI) { return new SetWrathOfAirTotemTrigger(botAI); } + static Trigger* set_windfury_totem(PlayerbotAI* botAI) { return new SetWindfuryTotemTrigger(botAI); } + static Trigger* set_nature_resistance_totem(PlayerbotAI* botAI) { return new SetNatureResistanceTotemTrigger(botAI); } + static Trigger* set_grounding_totem(PlayerbotAI* botAI) { return new SetGroundingTotemTrigger(botAI); } }; class ShamanAiObjectContextInternal : public NamedObjectContext @@ -272,11 +264,12 @@ public: creators["lightning shield"] = &ShamanAiObjectContextInternal::lightning_shield; creators["wind shear"] = &ShamanAiObjectContextInternal::wind_shear; creators["wind shear on enemy healer"] = &ShamanAiObjectContextInternal::wind_shear_on_enemy_healer; - creators["rockbiter weapon"] = &ShamanAiObjectContextInternal::rockbiter_weapon; - creators["flametongue weapon"] = &ShamanAiObjectContextInternal::flametongue_weapon; - creators["frostbrand weapon"] = &ShamanAiObjectContextInternal::frostbrand_weapon; - creators["windfury weapon"] = &ShamanAiObjectContextInternal::windfury_weapon; - creators["earthliving weapon"] = &ShamanAiObjectContextInternal::earthliving_weapon; + creators["rockbiter weapon main hand"] = &ShamanAiObjectContextInternal::rockbiter_weapon_main_hand; + creators["flametongue weapon main hand"] = &ShamanAiObjectContextInternal::flametongue_weapon_main_hand; + creators["flametongue weapon off hand"] = &ShamanAiObjectContextInternal::flametongue_weapon_off_hand; + // creators["frostbrand weapon off hand"] = &ShamanAiObjectContextInternal::frostbrand_weapon_off_hand; + creators["windfury weapon main hand"] = &ShamanAiObjectContextInternal::windfury_weapon_main_hand; + creators["earthliving weapon main hand"] = &ShamanAiObjectContextInternal::earthliving_weapon_main_hand; creators["purge"] = &ShamanAiObjectContextInternal::purge; creators["healing wave"] = &ShamanAiObjectContextInternal::healing_wave; creators["lesser healing wave"] = &ShamanAiObjectContextInternal::lesser_healing_wave; @@ -308,10 +301,9 @@ public: creators["heroism"] = &ShamanAiObjectContextInternal::heroism; creators["bloodlust"] = &ShamanAiObjectContextInternal::bloodlust; creators["elemental mastery"] = &ShamanAiObjectContextInternal::elemental_mastery; - creators["cure disease"] = &ShamanAiObjectContextInternal::cure_disease; - creators["cure disease on party"] = &ShamanAiObjectContextInternal::cure_disease_on_party; - creators["cure poison"] = &ShamanAiObjectContextInternal::cure_poison; - creators["cure poison on party"] = &ShamanAiObjectContextInternal::cure_poison_on_party; + creators["cure toxins"] = &ShamanAiObjectContextInternal::cure_toxins; + creators["cure toxins poison on party"] = &ShamanAiObjectContextInternal::cure_toxins_poison_on_party; + creators["cure toxins disease on party"] = &ShamanAiObjectContextInternal::cure_toxins_disease_on_party; creators["lava burst"] = &ShamanAiObjectContextInternal::lava_burst; creators["earth shield on main tank"] = &ShamanAiObjectContextInternal::earth_shield_on_main_tank; creators["shamanistic rage"] = &ShamanAiObjectContextInternal::shamanistic_rage; @@ -368,10 +360,10 @@ private: static Action* frost_shock(PlayerbotAI* botAI) { return new CastFrostShockAction(botAI); } static Action* earth_shock(PlayerbotAI* botAI) { return new CastEarthShockAction(botAI); } static Action* flame_shock(PlayerbotAI* botAI) { return new CastFlameShockAction(botAI); } + static Action* cleanse_spirit(PlayerbotAI* botAI) { return new CastCleanseSpiritAction(botAI); } static Action* cleanse_spirit_poison_on_party(PlayerbotAI* botAI) { return new CastCleanseSpiritPoisonOnPartyAction(botAI); } static Action* cleanse_spirit_disease_on_party(PlayerbotAI* botAI) { return new CastCleanseSpiritDiseaseOnPartyAction(botAI); } static Action* cleanse_spirit_curse_on_party(PlayerbotAI* botAI) { return new CastCleanseSpiritCurseOnPartyAction(botAI); } - static Action* cleanse_spirit(PlayerbotAI* botAI) { return new CastCleanseSpiritAction(botAI); } static Action* water_walking(PlayerbotAI* botAI) { return new CastWaterWalkingAction(botAI); } static Action* water_breathing(PlayerbotAI* botAI) { return new CastWaterBreathingAction(botAI); } static Action* water_walking_on_party(PlayerbotAI* botAI) { return new CastWaterWalkingOnPartyAction(botAI); } @@ -380,11 +372,12 @@ private: static Action* lightning_shield(PlayerbotAI* botAI) { return new CastLightningShieldAction(botAI); } static Action* fire_nova(PlayerbotAI* botAI) { return new CastFireNovaAction(botAI); } static Action* wind_shear(PlayerbotAI* botAI) { return new CastWindShearAction(botAI); } - static Action* rockbiter_weapon(PlayerbotAI* botAI) { return new CastRockbiterWeaponAction(botAI); } - static Action* flametongue_weapon(PlayerbotAI* botAI) { return new CastFlametongueWeaponAction(botAI); } - static Action* frostbrand_weapon(PlayerbotAI* botAI) { return new CastFrostbrandWeaponAction(botAI); } - static Action* windfury_weapon(PlayerbotAI* botAI) { return new CastWindfuryWeaponAction(botAI); } - static Action* earthliving_weapon(PlayerbotAI* botAI) { return new CastEarthlivingWeaponAction(botAI); } + static Action* rockbiter_weapon_main_hand(PlayerbotAI* botAI) { return new CastRockbiterWeaponMainHandAction(botAI); } + static Action* flametongue_weapon_main_hand(PlayerbotAI* botAI) { return new CastFlametongueWeaponMainHandAction(botAI); } + static Action* flametongue_weapon_off_hand(PlayerbotAI* botAI) { return new CastFlametongueWeaponOffHandAction(botAI); } + // static Action* frostbrand_weapon_off_hand(PlayerbotAI* botAI) { return new CastFrostbrandWeaponOffHandAction(botAI); } + static Action* earthliving_weapon_main_hand(PlayerbotAI* botAI) { return new CastEarthlivingWeaponMainHandAction(botAI); } + static Action* windfury_weapon_main_hand(PlayerbotAI* botAI) { return new CastWindfuryWeaponMainHandAction(botAI); } static Action* purge(PlayerbotAI* botAI) { return new CastPurgeAction(botAI); } static Action* healing_wave(PlayerbotAI* botAI) { return new CastHealingWaveAction(botAI); } static Action* lesser_healing_wave(PlayerbotAI* botAI) { return new CastLesserHealingWaveAction(botAI); } @@ -399,54 +392,53 @@ private: static Action* lava_lash(PlayerbotAI* botAI) { return new CastLavaLashAction(botAI); } static Action* ancestral_spirit(PlayerbotAI* botAI) { return new CastAncestralSpiritAction(botAI); } static Action* wind_shear_on_enemy_healer(PlayerbotAI* botAI) { return new CastWindShearOnEnemyHealerAction(botAI); } - static Action* cure_poison(PlayerbotAI* botAI) { return new CastCurePoisonActionSham(botAI); } - static Action* cure_poison_on_party(PlayerbotAI* botAI) { return new CastCurePoisonOnPartyActionSham(botAI); } - static Action* cure_disease(PlayerbotAI* botAI) { return new CastCureDiseaseActionSham(botAI); } - static Action* cure_disease_on_party(PlayerbotAI* botAI) { return new CastCureDiseaseOnPartyActionSham(botAI); } - static Action* lava_burst(PlayerbotAI* ai) { return new CastLavaBurstAction(ai); } - static Action* earth_shield_on_main_tank(PlayerbotAI* ai) { return new CastEarthShieldOnMainTankAction(ai); } - static Action* shamanistic_rage(PlayerbotAI* ai) { return new CastShamanisticRageAction(ai); } - static Action* feral_spirit(PlayerbotAI* ai) { return new CastFeralSpiritAction(ai); } - static Action* spirit_walk(PlayerbotAI* ai) { return new CastSpiritWalkAction(ai); } - static Action* call_of_the_elements(PlayerbotAI* ai) { return new CastCallOfTheElementsAction(ai); } - static Action* totemic_recall(PlayerbotAI* ai) { return new CastTotemicRecallAction(ai); } - static Action* strength_of_earth_totem(PlayerbotAI* ai) { return new CastStrengthOfEarthTotemAction(ai); } - static Action* stoneskin_totem(PlayerbotAI* ai) { return new CastStoneskinTotemAction(ai); } - static Action* tremor_totem(PlayerbotAI* ai) { return new CastTremorTotemAction(ai); } - static Action* earthbind_totem(PlayerbotAI* ai) { return new CastEarthbindTotemAction(ai); } - static Action* stoneclaw_totem(PlayerbotAI* ai) { return new CastStoneclawTotemAction(ai); } - static Action* searing_totem(PlayerbotAI* ai) { return new CastSearingTotemAction(ai); } - static Action* magma_totem(PlayerbotAI* ai) { return new CastMagmaTotemAction(ai); } - static Action* flametongue_totem(PlayerbotAI* ai) { return new CastFlametongueTotemAction(ai); } - static Action* totem_of_wrath(PlayerbotAI* ai) { return new CastTotemOfWrathAction(ai); } - static Action* frost_resistance_totem(PlayerbotAI* ai) { return new CastFrostResistanceTotemAction(ai); } - static Action* fire_elemental_totem(PlayerbotAI* ai) { return new CastFireElementalTotemAction(ai); } - static Action* fire_elemental_totem_melee(PlayerbotAI* ai) { return new CastFireElementalTotemMeleeAction(ai); } - static Action* healing_stream_totem(PlayerbotAI* ai) { return new CastHealingStreamTotemAction(ai); } - static Action* mana_spring_totem(PlayerbotAI* ai) { return new CastManaSpringTotemAction(ai); } - static Action* cleansing_totem(PlayerbotAI* ai) { return new CastCleansingTotemAction(ai); } - static Action* mana_tide_totem(PlayerbotAI* ai) { return new CastManaTideTotemAction(ai); } - static Action* fire_resistance_totem(PlayerbotAI* ai) { return new CastFireResistanceTotemAction(ai); } - static Action* wrath_of_air_totem(PlayerbotAI* ai) { return new CastWrathOfAirTotemAction(ai); } - static Action* windfury_totem(PlayerbotAI* ai) { return new CastWindfuryTotemAction(ai); } - static Action* nature_resistance_totem(PlayerbotAI* ai) { return new CastNatureResistanceTotemAction(ai); } - static Action* set_strength_of_earth_totem(PlayerbotAI* ai) { return new SetStrengthOfEarthTotemAction(ai); } - static Action* set_stoneskin_totem(PlayerbotAI* ai) { return new SetStoneskinTotemAction(ai); } - static Action* set_tremor_totem(PlayerbotAI* ai) { return new SetTremorTotemAction(ai); } - static Action* set_earthbind_totem(PlayerbotAI* ai) { return new SetEarthbindTotemAction(ai); } - static Action* set_searing_totem(PlayerbotAI* ai) { return new SetSearingTotemAction(ai); } - static Action* set_magma_totem(PlayerbotAI* ai) { return new SetMagmaTotemAction(ai); } - static Action* set_flametongue_totem(PlayerbotAI* ai) { return new SetFlametongueTotemAction(ai); } - static Action* set_totem_of_wrath(PlayerbotAI* ai) { return new SetTotemOfWrathAction(ai); } - static Action* set_frost_resistance_totem(PlayerbotAI* ai) { return new SetFrostResistanceTotemAction(ai); } - static Action* set_healing_stream_totem(PlayerbotAI* ai) { return new SetHealingStreamTotemAction(ai); } - static Action* set_mana_spring_totem(PlayerbotAI* ai) { return new SetManaSpringTotemAction(ai); } - static Action* set_cleansing_totem(PlayerbotAI* ai) { return new SetCleansingTotemAction(ai); } - static Action* set_fire_resistance_totem(PlayerbotAI* ai) { return new SetFireResistanceTotemAction(ai); } - static Action* set_wrath_of_air_totem(PlayerbotAI* ai) { return new SetWrathOfAirTotemAction(ai); } - static Action* set_windfury_totem(PlayerbotAI* ai) { return new SetWindfuryTotemAction(ai); } - static Action* set_nature_resistance_totem(PlayerbotAI* ai) { return new SetNatureResistanceTotemAction(ai); } - static Action* set_grounding_totem(PlayerbotAI* ai) { return new SetGroundingTotemAction(ai); } + static Action* cure_toxins(PlayerbotAI* botAI) { return new CastCureToxinsActionSham(botAI); } + static Action* cure_toxins_poison_on_party(PlayerbotAI* botAI) { return new CastCureToxinsPoisonOnPartyActionSham(botAI); } + static Action* cure_toxins_disease_on_party(PlayerbotAI* botAI) { return new CastCureToxinsDiseaseOnPartyActionSham(botAI); } + static Action* lava_burst(PlayerbotAI* botAI) { return new CastLavaBurstAction(botAI); } + static Action* earth_shield_on_main_tank(PlayerbotAI* botAI) { return new CastEarthShieldOnMainTankAction(botAI); } + static Action* shamanistic_rage(PlayerbotAI* botAI) { return new CastShamanisticRageAction(botAI); } + static Action* feral_spirit(PlayerbotAI* botAI) { return new CastFeralSpiritAction(botAI); } + static Action* spirit_walk(PlayerbotAI* botAI) { return new CastSpiritWalkAction(botAI); } + static Action* call_of_the_elements(PlayerbotAI* botAI) { return new CastCallOfTheElementsAction(botAI); } + static Action* totemic_recall(PlayerbotAI* botAI) { return new CastTotemicRecallAction(botAI); } + static Action* strength_of_earth_totem(PlayerbotAI* botAI) { return new CastStrengthOfEarthTotemAction(botAI); } + static Action* stoneskin_totem(PlayerbotAI* botAI) { return new CastStoneskinTotemAction(botAI); } + static Action* tremor_totem(PlayerbotAI* botAI) { return new CastTremorTotemAction(botAI); } + static Action* earthbind_totem(PlayerbotAI* botAI) { return new CastEarthbindTotemAction(botAI); } + static Action* stoneclaw_totem(PlayerbotAI* botAI) { return new CastStoneclawTotemAction(botAI); } + static Action* searing_totem(PlayerbotAI* botAI) { return new CastSearingTotemAction(botAI); } + static Action* magma_totem(PlayerbotAI* botAI) { return new CastMagmaTotemAction(botAI); } + static Action* flametongue_totem(PlayerbotAI* botAI) { return new CastFlametongueTotemAction(botAI); } + static Action* totem_of_wrath(PlayerbotAI* botAI) { return new CastTotemOfWrathAction(botAI); } + static Action* frost_resistance_totem(PlayerbotAI* botAI) { return new CastFrostResistanceTotemAction(botAI); } + static Action* fire_elemental_totem(PlayerbotAI* botAI) { return new CastFireElementalTotemAction(botAI); } + static Action* fire_elemental_totem_melee(PlayerbotAI* botAI) { return new CastFireElementalTotemMeleeAction(botAI); } + static Action* healing_stream_totem(PlayerbotAI* botAI) { return new CastHealingStreamTotemAction(botAI); } + static Action* mana_spring_totem(PlayerbotAI* botAI) { return new CastManaSpringTotemAction(botAI); } + static Action* cleansing_totem(PlayerbotAI* botAI) { return new CastCleansingTotemAction(botAI); } + static Action* mana_tide_totem(PlayerbotAI* botAI) { return new CastManaTideTotemAction(botAI); } + static Action* fire_resistance_totem(PlayerbotAI* botAI) { return new CastFireResistanceTotemAction(botAI); } + static Action* wrath_of_air_totem(PlayerbotAI* botAI) { return new CastWrathOfAirTotemAction(botAI); } + static Action* windfury_totem(PlayerbotAI* botAI) { return new CastWindfuryTotemAction(botAI); } + static Action* nature_resistance_totem(PlayerbotAI* botAI) { return new CastNatureResistanceTotemAction(botAI); } + static Action* set_strength_of_earth_totem(PlayerbotAI* botAI) { return new SetStrengthOfEarthTotemAction(botAI); } + static Action* set_stoneskin_totem(PlayerbotAI* botAI) { return new SetStoneskinTotemAction(botAI); } + static Action* set_tremor_totem(PlayerbotAI* botAI) { return new SetTremorTotemAction(botAI); } + static Action* set_earthbind_totem(PlayerbotAI* botAI) { return new SetEarthbindTotemAction(botAI); } + static Action* set_searing_totem(PlayerbotAI* botAI) { return new SetSearingTotemAction(botAI); } + static Action* set_magma_totem(PlayerbotAI* botAI) { return new SetMagmaTotemAction(botAI); } + static Action* set_flametongue_totem(PlayerbotAI* botAI) { return new SetFlametongueTotemAction(botAI); } + static Action* set_totem_of_wrath(PlayerbotAI* botAI) { return new SetTotemOfWrathAction(botAI); } + static Action* set_frost_resistance_totem(PlayerbotAI* botAI) { return new SetFrostResistanceTotemAction(botAI); } + static Action* set_healing_stream_totem(PlayerbotAI* botAI) { return new SetHealingStreamTotemAction(botAI); } + static Action* set_mana_spring_totem(PlayerbotAI* botAI) { return new SetManaSpringTotemAction(botAI); } + static Action* set_cleansing_totem(PlayerbotAI* botAI) { return new SetCleansingTotemAction(botAI); } + static Action* set_fire_resistance_totem(PlayerbotAI* botAI) { return new SetFireResistanceTotemAction(botAI); } + static Action* set_wrath_of_air_totem(PlayerbotAI* botAI) { return new SetWrathOfAirTotemAction(botAI); } + static Action* set_windfury_totem(PlayerbotAI* botAI) { return new SetWindfuryTotemAction(botAI); } + static Action* set_nature_resistance_totem(PlayerbotAI* botAI) { return new SetNatureResistanceTotemAction(botAI); } + static Action* set_grounding_totem(PlayerbotAI* botAI) { return new SetGroundingTotemAction(botAI); } }; SharedNamedObjectContextList ShamanAiObjectContext::sharedStrategyContexts; diff --git a/src/Ai/Class/Shaman/Strategy/ElementalShamanStrategy.cpp b/src/Ai/Class/Shaman/Strategy/ElementalShamanStrategy.cpp index c1295687c..5ef0d3f55 100644 --- a/src/Ai/Class/Shaman/Strategy/ElementalShamanStrategy.cpp +++ b/src/Ai/Class/Shaman/Strategy/ElementalShamanStrategy.cpp @@ -4,42 +4,11 @@ */ #include "ElementalShamanStrategy.h" - #include "Playerbots.h" -// ===== Action Node Factory ===== -class ElementalShamanStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - ElementalShamanStrategyActionNodeFactory() - { - creators["flame shock"] = &flame_shock; - creators["earth shock"] = &earth_shock; - creators["lava burst"] = &lava_burst; - creators["lightning bolt"] = &lightning_bolt; - creators["call of the elements"] = &call_of_the_elements; - creators["elemental mastery"] = &elemental_mastery; - creators["stoneclaw totem"] = &stoneclaw_totem; - creators["water shield"] = &water_shield; - creators["thunderstorm"] = &thunderstorm; - } - -private: - static ActionNode* flame_shock(PlayerbotAI*) { return new ActionNode("flame shock", {}, {}, {}); } - static ActionNode* earth_shock(PlayerbotAI*) { return new ActionNode("earth shock", {}, {}, {}); } - static ActionNode* lava_burst(PlayerbotAI*) { return new ActionNode("lava burst", {}, {}, {}); } - static ActionNode* lightning_bolt(PlayerbotAI*) { return new ActionNode("lightning bolt", {}, {}, {}); } - static ActionNode* call_of_the_elements(PlayerbotAI*) { return new ActionNode("call of the elements", {}, {}, {}); } - static ActionNode* elemental_mastery(PlayerbotAI*) { return new ActionNode("elemental mastery", {}, {}, {}); } - static ActionNode* stoneclaw_totem(PlayerbotAI*) { return new ActionNode("stoneclaw totem", {}, {}, {}); } - static ActionNode* water_shield(PlayerbotAI*) { return new ActionNode("water shield", {}, {}, {}); } - static ActionNode* thunderstorm(PlayerbotAI*) { return new ActionNode("thunderstorm", {}, {}, {}); } -}; - -// ===== Single Target Strategy ===== ElementalShamanStrategy::ElementalShamanStrategy(PlayerbotAI* botAI) : GenericShamanStrategy(botAI) { - actionNodeFactories.Add(new ElementalShamanStrategyActionNodeFactory()); + // No custom ActionNodeFactory needed } // ===== Default Actions ===== diff --git a/src/Ai/Class/Shaman/Strategy/EnhancementShamanStrategy.cpp b/src/Ai/Class/Shaman/Strategy/EnhancementShamanStrategy.cpp index 4b7fb7159..0eb548993 100644 --- a/src/Ai/Class/Shaman/Strategy/EnhancementShamanStrategy.cpp +++ b/src/Ai/Class/Shaman/Strategy/EnhancementShamanStrategy.cpp @@ -4,7 +4,6 @@ */ #include "EnhancementShamanStrategy.h" - #include "Playerbots.h" // ===== Action Node Factory ===== @@ -13,19 +12,10 @@ class EnhancementShamanStrategyActionNodeFactory : public NamedObjectFactory& triggers) triggers.push_back(new TriggerNode("wind shear", { NextAction("wind shear", 23.0f), })); triggers.push_back(new TriggerNode("wind shear on enemy healer", { NextAction("wind shear on enemy healer", 23.0f), })); triggers.push_back(new TriggerNode("purge", { NextAction("purge", ACTION_DISPEL), })); - triggers.push_back(new TriggerNode("medium mana", { NextAction("mana potion", ACTION_DISPEL), })); triggers.push_back(new TriggerNode("new pet", { NextAction("set pet stance", 65.0f), })); } void ShamanCureStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("cure poison", { NextAction("cure poison", 21.0f), })); - triggers.push_back(new TriggerNode("party member cure poison", { NextAction("cure poison on party", 21.0f), })); triggers.push_back(new TriggerNode("cleanse spirit poison", { NextAction("cleanse spirit", 24.0f), })); triggers.push_back(new TriggerNode("party member cleanse spirit poison", { NextAction("cleanse spirit poison on party", 23.0f), })); - triggers.push_back(new TriggerNode("cure disease", { NextAction("cure disease", 31.0f), })); - triggers.push_back(new TriggerNode("party member cure disease", { NextAction("cure disease on party", 30.0f), })); triggers.push_back(new TriggerNode("cleanse spirit disease", { NextAction("cleanse spirit", 24.0f), })); triggers.push_back(new TriggerNode("party member cleanse spirit disease", { NextAction("cleanse spirit disease on party", 23.0f), })); triggers.push_back(new TriggerNode("cleanse spirit curse", { NextAction("cleanse spirit", 24.0f), })); @@ -133,11 +138,11 @@ void ShamanBoostStrategy::InitTriggers(std::vector& triggers) Player* bot = botAI->GetBot(); int tab = AiFactory::GetPlayerSpecTab(bot); - if (tab == 0) // Elemental + if (tab == SHAMAN_TAB_ELEMENTAL) { triggers.push_back(new TriggerNode("fire elemental totem", { NextAction("fire elemental totem", 23.0f), })); } - else if (tab == 1) // Enhancement + else if (tab == SHAMAN_TAB_ENHANCEMENT) { triggers.push_back(new TriggerNode("fire elemental totem", { NextAction("fire elemental totem melee", 24.0f), })); } @@ -149,23 +154,19 @@ void ShamanAoeStrategy::InitTriggers(std::vector& triggers) Player* bot = botAI->GetBot(); int tab = AiFactory::GetPlayerSpecTab(bot); - if (tab == 0) // Elemental + if (tab == SHAMAN_TAB_ELEMENTAL) { triggers.push_back(new TriggerNode("medium aoe",{ NextAction("fire nova", 23.0f), })); triggers.push_back(new TriggerNode("chain lightning no cd", { NextAction("chain lightning", 5.6f), })); } - else if (tab == 1) // Enhancement + else if (tab == SHAMAN_TAB_ENHANCEMENT) { - triggers.push_back(new TriggerNode("medium aoe",{ - NextAction("magma totem", 24.0f), - NextAction("fire nova", 23.0f), })); + triggers.push_back(new TriggerNode("medium aoe",{ NextAction("magma totem", 24.0f), + NextAction("fire nova", 23.0f), })); triggers.push_back(new TriggerNode("maelstrom weapon 5 and medium aoe", { NextAction("chain lightning", 22.0f), })); triggers.push_back(new TriggerNode("maelstrom weapon 4 and medium aoe", { NextAction("chain lightning", 21.0f), })); triggers.push_back(new TriggerNode("enemy within melee", { NextAction("fire nova", 5.1f), })); } - else if (tab == 2) // Restoration - { - // Handled by "Healer DPS" Strategy - } + // Resto AoE handled by "Healer DPS" Strategy } diff --git a/src/Ai/Class/Shaman/Strategy/RestoShamanStrategy.cpp b/src/Ai/Class/Shaman/Strategy/RestoShamanStrategy.cpp index 698531a85..37f55c6c6 100644 --- a/src/Ai/Class/Shaman/Strategy/RestoShamanStrategy.cpp +++ b/src/Ai/Class/Shaman/Strategy/RestoShamanStrategy.cpp @@ -4,64 +4,11 @@ */ #include "RestoShamanStrategy.h" - #include "Playerbots.h" -// ===== Action Node Factory ===== -class RestoShamanStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - RestoShamanStrategyActionNodeFactory() - { - creators["mana tide totem"] = &mana_tide_totem; - creators["call of the elements"] = &call_of_the_elements; - creators["stoneclaw totem"] = &stoneclaw_totem; - creators["riptide on party"] = &riptide_on_party; - creators["chain heal on party"] = &chain_heal_on_party; - creators["healing wave on party"] = &healing_wave_on_party; - creators["lesser healing wave on party"] = &lesser_healing_wave_on_party; - creators["earth shield on main tank"] = &earth_shield_on_main_tank; - creators["cleanse spirit poison on party"] = &cleanse_spirit_poison_on_party; - creators["cleanse spirit disease on party"] = &cleanse_spirit_disease_on_party; - creators["cleanse spirit curse on party"] = &cleanse_spirit_curse_on_party; - creators["cleansing totem"] = &cleansing_totem; - creators["water shield"] = &water_shield; - creators["flame shock"] = &flame_shock; - creators["lava burst"] = &lava_burst; - creators["lightning bolt"] = &lightning_bolt; - creators["chain lightning"] = &chain_lightning; - } - -private: - static ActionNode* mana_tide_totem([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("mana tide totem", - /*P*/ {}, - /*A*/ { NextAction("mana potion") }, - /*C*/ {}); - } - static ActionNode* call_of_the_elements(PlayerbotAI*) { return new ActionNode("call of the elements", {}, {}, {}); } - static ActionNode* stoneclaw_totem(PlayerbotAI*) { return new ActionNode("stoneclaw totem", {}, {}, {}); } - static ActionNode* riptide_on_party(PlayerbotAI*) { return new ActionNode("riptide on party", {}, {}, {}); } - static ActionNode* chain_heal_on_party(PlayerbotAI*) { return new ActionNode("chain heal on party", {}, {}, {}); } - static ActionNode* healing_wave_on_party(PlayerbotAI*) { return new ActionNode("healing wave on party", {}, {}, {}); } - static ActionNode* lesser_healing_wave_on_party(PlayerbotAI*) { return new ActionNode("lesser healing wave on party", {}, {}, {}); } - static ActionNode* earth_shield_on_main_tank(PlayerbotAI*) { return new ActionNode("earth shield on main tank", {}, {}, {}); } - static ActionNode* cleanse_spirit_poison_on_party(PlayerbotAI*) { return new ActionNode("cleanse spirit poison on party", {}, {}, {}); } - static ActionNode* cleanse_spirit_disease_on_party(PlayerbotAI*) { return new ActionNode("cleanse spirit disease on party", {}, {}, {}); } - static ActionNode* cleanse_spirit_curse_on_party(PlayerbotAI*) { return new ActionNode("cleanse spirit curse on party", {}, {}, {}); } - static ActionNode* cleansing_totem(PlayerbotAI*) { return new ActionNode("cleansing totem", {}, {}, {}); } - static ActionNode* water_shield(PlayerbotAI*) { return new ActionNode("water shield", {}, {}, {}); } - static ActionNode* flame_shock(PlayerbotAI*) { return new ActionNode("flame shock", {}, {}, {}); } - static ActionNode* lava_burst(PlayerbotAI*) { return new ActionNode("lava burst", {}, {}, {}); } - static ActionNode* lightning_bolt(PlayerbotAI*) { return new ActionNode("lightning bolt", {}, {}, {}); } - static ActionNode* chain_lightning(PlayerbotAI*) { return new ActionNode("chain lightning", {}, {}, {}); } -}; - -// ===== Single Target Strategy ===== RestoShamanStrategy::RestoShamanStrategy(PlayerbotAI* botAI) : GenericShamanStrategy(botAI) { - actionNodeFactories.Add(new RestoShamanStrategyActionNodeFactory()); + // No custom ActionNodeFactory needed } // ===== Trigger Initialization === @@ -75,28 +22,23 @@ void RestoShamanStrategy::InitTriggers(std::vector& triggers) triggers.push_back(new TriggerNode("medium mana", { NextAction("mana tide totem", ACTION_HIGH + 5) })); // Healing Triggers - triggers.push_back(new TriggerNode("group heal setting", { - NextAction("riptide on party", 27.0f), - NextAction("chain heal on party", 26.0f) })); + triggers.push_back(new TriggerNode("group heal setting", { NextAction("riptide on party", 27.0f), + NextAction("chain heal on party", 26.0f) })); - triggers.push_back(new TriggerNode("party member critical health", { - NextAction("riptide on party", 25.0f), - NextAction("healing wave on party", 24.0f), - NextAction("lesser healing wave on party", 23.0f) })); + triggers.push_back(new TriggerNode("party member critical health", { NextAction("riptide on party", 25.0f), + NextAction("healing wave on party", 24.0f), + NextAction("lesser healing wave on party", 23.0f) })); - triggers.push_back(new TriggerNode("party member low health", { - NextAction("riptide on party", 19.0f), - NextAction("healing wave on party", 18.0f), - NextAction("lesser healing wave on party", 17.0f) })); + triggers.push_back(new TriggerNode("party member low health", { NextAction("riptide on party", 19.0f), + NextAction("healing wave on party", 18.0f), + NextAction("lesser healing wave on party", 17.0f) })); - triggers.push_back(new TriggerNode("party member medium health", { - NextAction("riptide on party", 16.0f), - NextAction("healing wave on party", 15.0f), - NextAction("lesser healing wave on party", 14.0f) })); + triggers.push_back(new TriggerNode("party member medium health", { NextAction("riptide on party", 16.0f), + NextAction("healing wave on party", 15.0f), + NextAction("lesser healing wave on party", 14.0f) })); - triggers.push_back(new TriggerNode("party member almost full health", { - NextAction("riptide on party", 12.0f), - NextAction("lesser healing wave on party", 11.0f) })); + triggers.push_back(new TriggerNode("party member almost full health", { NextAction("riptide on party", 12.0f), + NextAction("lesser healing wave on party", 11.0f) })); triggers.push_back(new TriggerNode("earth shield on main tank", { NextAction("earth shield on main tank", ACTION_HIGH + 7) })); @@ -113,12 +55,9 @@ void RestoShamanStrategy::InitTriggers(std::vector& triggers) void ShamanHealerDpsStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("healer should attack", - { NextAction("flame shock", ACTION_DEFAULT + 0.2f), - NextAction("lava burst", ACTION_DEFAULT + 0.1f), - NextAction("lightning bolt", ACTION_DEFAULT) })); + triggers.push_back(new TriggerNode("healer should attack", { NextAction("flame shock", ACTION_DEFAULT + 0.2f), + NextAction("lava burst", ACTION_DEFAULT + 0.1f), + NextAction("lightning bolt", ACTION_DEFAULT) })); - triggers.push_back( - new TriggerNode("medium aoe and healer should attack", - { NextAction("chain lightning", ACTION_DEFAULT + 0.3f) })); + triggers.push_back( new TriggerNode("medium aoe and healer should attack", { NextAction("chain lightning", ACTION_DEFAULT + 0.3f) })); } diff --git a/src/Ai/Class/Shaman/Strategy/ShamanNonCombatStrategy.cpp b/src/Ai/Class/Shaman/Strategy/ShamanNonCombatStrategy.cpp index c72000539..1e10b46c9 100644 --- a/src/Ai/Class/Shaman/Strategy/ShamanNonCombatStrategy.cpp +++ b/src/Ai/Class/Shaman/Strategy/ShamanNonCombatStrategy.cpp @@ -13,45 +13,65 @@ class ShamanNonCombatStrategyActionNodeFactory : public NamedObjectFactory& triggers) NonCombatStrategy::InitTriggers(triggers); // Totemic Recall - triggers.push_back(new TriggerNode("totemic recall", { NextAction("totemic recall", 60.0f), })); + triggers.push_back(new TriggerNode("totemic recall", { NextAction("totemic recall", 60.0f) })); // Healing/Resurrect Triggers - triggers.push_back(new TriggerNode("party member dead", { NextAction("ancestral spirit", ACTION_CRITICAL_HEAL + 10), })); - triggers.push_back(new TriggerNode("party member critical health", { - NextAction("riptide on party", 31.0f), - NextAction("healing wave on party", 30.0f) })); - triggers.push_back(new TriggerNode("party member low health",{ - NextAction("riptide on party", 29.0f), - NextAction("healing wave on party", 28.0f) })); - triggers.push_back(new TriggerNode("party member medium health",{ - NextAction("riptide on party", 27.0f), - NextAction("healing wave on party", 26.0f) })); - triggers.push_back(new TriggerNode("party member almost full health",{ - NextAction("riptide on party", 25.0f), - NextAction("lesser healing wave on party", 24.0f) })); - triggers.push_back(new TriggerNode("group heal setting",{ NextAction("chain heal on party", 27.0f) })); + triggers.push_back(new TriggerNode("party member dead", { NextAction("ancestral spirit", ACTION_CRITICAL_HEAL + 10) })); + triggers.push_back(new TriggerNode("party member critical health", { NextAction("riptide on party", 31.0f), + NextAction("healing wave on party", 30.0f) })); + triggers.push_back(new TriggerNode("party member low health", { NextAction("riptide on party", 29.0f), + NextAction("healing wave on party", 28.0f) })); + triggers.push_back(new TriggerNode("party member medium health", { NextAction("riptide on party", 27.0f), + NextAction("healing wave on party", 26.0f) })); + triggers.push_back(new TriggerNode("party member almost full health", { NextAction("riptide on party", 25.0f), + NextAction("lesser healing wave on party", 24.0f) })); + triggers.push_back(new TriggerNode("group heal setting", { NextAction("chain heal on party", 27.0f) })); // Cure Triggers - triggers.push_back(new TriggerNode("cure poison", { NextAction("cure poison", 21.0f), })); - triggers.push_back(new TriggerNode("party member cure poison", { NextAction("cure poison on party", 21.0f), })); - triggers.push_back(new TriggerNode("cure disease", { NextAction("cure disease", 31.0f), })); - triggers.push_back(new TriggerNode("party member cure disease", { NextAction("cure disease on party", 30.0f), })); + triggers.push_back(new TriggerNode("cleanse spirit poison", { NextAction("cleanse spirit", 24.0f) })); + triggers.push_back(new TriggerNode("party member cleanse spirit poison", { NextAction("cleanse spirit poison on party", 23.0f) })); + triggers.push_back(new TriggerNode("cleanse spirit disease", { NextAction("cleanse spirit", 24.0f) })); + triggers.push_back(new TriggerNode("party member cleanse spirit disease", { NextAction("cleanse spirit disease on party", 23.0f) })); + triggers.push_back(new TriggerNode("cleanse spirit curse", { NextAction("cleanse spirit", 24.0f) })); + triggers.push_back(new TriggerNode("party member cleanse spirit curse", { NextAction("cleanse spirit curse on party", 23.0f) })); // Out of Combat Buff Triggers Player* bot = botAI->GetBot(); int tab = AiFactory::GetPlayerSpecTab(bot); - if (tab == 0) // Elemental + if (tab == SHAMAN_TAB_ELEMENTAL) { - triggers.push_back(new TriggerNode("main hand weapon no imbue", { NextAction("flametongue weapon", 22.0f), })); + triggers.push_back(new TriggerNode("main hand weapon no imbue", { NextAction("flametongue weapon main hand", 22.0f), })); triggers.push_back(new TriggerNode("water shield", { NextAction("water shield", 21.0f), })); } - else if (tab == 1) // Enhancement + else if (tab == SHAMAN_TAB_ENHANCEMENT) { - triggers.push_back(new TriggerNode("main hand weapon no imbue", { NextAction("windfury weapon", 22.0f), })); - triggers.push_back(new TriggerNode("off hand weapon no imbue", { NextAction("flametongue weapon", 21.0f), })); + triggers.push_back(new TriggerNode("main hand weapon no imbue", { NextAction("windfury weapon main hand", 22.0f), })); + triggers.push_back(new TriggerNode("off hand weapon no imbue", { NextAction("flametongue weapon off hand", 21.0f), })); triggers.push_back(new TriggerNode("lightning shield", { NextAction("lightning shield", 20.0f), })); } - else if (tab == 2) // Restoration + else if (tab == SHAMAN_TAB_RESTORATION) { - triggers.push_back(new TriggerNode("main hand weapon no imbue",{ NextAction("earthliving weapon", 22.0f), })); + triggers.push_back(new TriggerNode("main hand weapon no imbue", { NextAction("earthliving weapon main hand", 22.0f), })); triggers.push_back(new TriggerNode("water shield", { NextAction("water shield", 20.0f), })); } diff --git a/src/Ai/Class/Shaman/Strategy/TotemsShamanStrategy.cpp b/src/Ai/Class/Shaman/Strategy/TotemsShamanStrategy.cpp index d00cc5e6c..c5ae222c1 100644 --- a/src/Ai/Class/Shaman/Strategy/TotemsShamanStrategy.cpp +++ b/src/Ai/Class/Shaman/Strategy/TotemsShamanStrategy.cpp @@ -75,13 +75,9 @@ void TotemOfWrathStrategy::InitTriggers(std::vector& triggers) // If the bot hasn't learned Totem of Wrath yet, set Flametongue Totem instead. Player* bot = botAI->GetBot(); if (bot->HasSpell(30706)) - { triggers.push_back(new TriggerNode("set totem of wrath", { NextAction("set totem of wrath", 60.0f) })); - } else if (bot->HasSpell(8227)) - { triggers.push_back(new TriggerNode("set flametongue totem", { NextAction("set flametongue totem", 60.0f) })); - } triggers.push_back(new TriggerNode("no fire totem", { NextAction("totem of wrath", 55.0f) })); } @@ -117,13 +113,9 @@ void CleansingTotemStrategy::InitTriggers(std::vector& triggers) // If the bot hasn't learned Cleansing Totem yet, set Mana Spring Totem instead. Player* bot = botAI->GetBot(); if (bot->HasSpell(8170)) - { triggers.push_back(new TriggerNode("set cleansing totem", { NextAction("set cleansing totem", 60.0f) })); - } else if (bot->HasSpell(5675)) - { triggers.push_back(new TriggerNode("set mana spring totem", { NextAction("set mana spring totem", 60.0f) })); - } triggers.push_back(new TriggerNode("no water totem", { NextAction("cleansing totem", 55.0f) })); } @@ -143,15 +135,10 @@ void WrathOfAirTotemStrategy::InitTriggers(std::vector& triggers) // If the bot hasn't learned Wrath of Air Totem yet, set Grounding Totem instead. Player* bot = botAI->GetBot(); if (bot->HasSpell(3738)) - { triggers.push_back(new TriggerNode("set wrath of air totem", { NextAction("set wrath of air totem", 60.0f) })); - } else if (bot->HasSpell(8177)) - { triggers.push_back(new TriggerNode("set grounding totem", { NextAction("set grounding totem", 60.0f) })); - } - triggers.push_back( - new TriggerNode("no air totem", { NextAction("wrath of air totem", 55.0f) })); + triggers.push_back( new TriggerNode("no air totem", { NextAction("wrath of air totem", 55.0f) })); } WindfuryTotemStrategy::WindfuryTotemStrategy(PlayerbotAI* botAI) : GenericShamanStrategy(botAI) {} @@ -161,13 +148,9 @@ void WindfuryTotemStrategy::InitTriggers(std::vector& triggers) // If the bot hasn't learned Windfury Totem yet, set Grounding Totem instead. Player* bot = botAI->GetBot(); if (bot->HasSpell(8512)) - { triggers.push_back(new TriggerNode("set windfury totem", { NextAction("set windfury totem", 60.0f) })); - } else if (bot->HasSpell(8177)) - { triggers.push_back(new TriggerNode("set grounding totem", { NextAction("set grounding totem", 60.0f) })); - } triggers.push_back(new TriggerNode("no air totem", { NextAction("windfury totem", 55.0f) })); } diff --git a/src/Ai/Class/Shaman/Trigger/ShamanTriggers.cpp b/src/Ai/Class/Shaman/Trigger/ShamanTriggers.cpp index c8b36135a..e7bcbfe4c 100644 --- a/src/Ai/Class/Shaman/Trigger/ShamanTriggers.cpp +++ b/src/Ai/Class/Shaman/Trigger/ShamanTriggers.cpp @@ -261,13 +261,13 @@ bool TotemicRecallTrigger::IsActive() } // Find the active totem strategy for this slot, and return the highest-rank spellId the bot knows for it -static uint32 GetRequiredTotemSpellId(PlayerbotAI* ai, const char* strategies[], +static uint32 GetRequiredTotemSpellId(PlayerbotAI* botAI, const char* strategies[], const uint32* spellList[], const size_t spellCounts[], size_t numStrategies) { - Player* bot = ai->GetBot(); + Player* bot = botAI->GetBot(); for (size_t i = 0; i < numStrategies; ++i) { - if (ai->HasStrategy(strategies[i], BOT_STATE_COMBAT)) + if (botAI->HasStrategy(strategies[i], BOT_STATE_COMBAT)) { // Find the highest-rank spell the bot knows for (size_t j = 0; j < spellCounts[i]; ++j) diff --git a/src/Ai/Class/Shaman/Trigger/ShamanTriggers.h b/src/Ai/Class/Shaman/Trigger/ShamanTriggers.h index 9e1a86aac..800dc8342 100644 --- a/src/Ai/Class/Shaman/Trigger/ShamanTriggers.h +++ b/src/Ai/Class/Shaman/Trigger/ShamanTriggers.h @@ -41,14 +41,14 @@ const uint32 SPELL_CALL_OF_THE_ELEMENTS = 66842; class MainHandWeaponNoImbueTrigger : public BuffTrigger { public: - MainHandWeaponNoImbueTrigger(PlayerbotAI* ai) : BuffTrigger(ai, "main hand", 1) {} + MainHandWeaponNoImbueTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "main hand", 1) {} virtual bool IsActive(); }; class OffHandWeaponNoImbueTrigger : public BuffTrigger { public: - OffHandWeaponNoImbueTrigger(PlayerbotAI* ai) : BuffTrigger(ai, "off hand", 1) {} + OffHandWeaponNoImbueTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "off hand", 1) {} virtual bool IsActive(); }; @@ -121,7 +121,7 @@ public: class SpiritWalkTrigger : public Trigger { public: - SpiritWalkTrigger(PlayerbotAI* ai) : Trigger(ai, "spirit walk ready") {} + SpiritWalkTrigger(PlayerbotAI* botAI) : Trigger(botAI, "spirit walk ready") {} bool IsActive() override; @@ -165,9 +165,7 @@ class PartyMemberCleanseSpiritPoisonTrigger : public PartyMemberNeedCureTrigger { public: PartyMemberCleanseSpiritPoisonTrigger(PlayerbotAI* botAI) - : PartyMemberNeedCureTrigger(botAI, "cleanse spirit", DISPEL_POISON) - { - } + : PartyMemberNeedCureTrigger(botAI, "cleanse spirit", DISPEL_POISON) {} }; class CleanseSpiritCurseTrigger : public NeedCureTrigger @@ -180,9 +178,7 @@ class PartyMemberCleanseSpiritCurseTrigger : public PartyMemberNeedCureTrigger { public: PartyMemberCleanseSpiritCurseTrigger(PlayerbotAI* botAI) - : PartyMemberNeedCureTrigger(botAI, "cleanse spirit", DISPEL_CURSE) - { - } + : PartyMemberNeedCureTrigger(botAI, "cleanse spirit", DISPEL_CURSE) {} }; class CleanseSpiritDiseaseTrigger : public NeedCureTrigger @@ -195,34 +191,7 @@ class PartyMemberCleanseSpiritDiseaseTrigger : public PartyMemberNeedCureTrigger { public: PartyMemberCleanseSpiritDiseaseTrigger(PlayerbotAI* botAI) - : PartyMemberNeedCureTrigger(botAI, "cleanse spirit", DISPEL_DISEASE) - { - } -}; - -class CurePoisonTrigger : public NeedCureTrigger -{ -public: - CurePoisonTrigger(PlayerbotAI* botAI) : NeedCureTrigger(botAI, "cure poison", DISPEL_POISON) {} -}; - -class PartyMemberCurePoisonTrigger : public PartyMemberNeedCureTrigger -{ -public: - PartyMemberCurePoisonTrigger(PlayerbotAI* botAI) : PartyMemberNeedCureTrigger(botAI, "cure poison", DISPEL_POISON) {} -}; - -class CureDiseaseTrigger : public NeedCureTrigger -{ -public: - CureDiseaseTrigger(PlayerbotAI* botAI) : NeedCureTrigger(botAI, "cure disease", DISPEL_DISEASE) {} -}; - -class PartyMemberCureDiseaseTrigger : public PartyMemberNeedCureTrigger -{ -public: - PartyMemberCureDiseaseTrigger(PlayerbotAI* botAI) - : PartyMemberNeedCureTrigger(botAI, "cure disease", DISPEL_DISEASE) {} + : PartyMemberNeedCureTrigger(botAI, "cleanse spirit", DISPEL_DISEASE) {} }; // Damage and Debuff Triggers @@ -250,7 +219,7 @@ public: class FlameShockTrigger : public DebuffTrigger { public: - FlameShockTrigger(PlayerbotAI* ai) : DebuffTrigger(ai, "flame shock", 1, true, 6.0f) {} + FlameShockTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "flame shock", 1, true, 6.0f) {} bool IsActive() override { return BuffTrigger::IsActive(); } }; @@ -265,19 +234,19 @@ public: class MaelstromWeapon5AndMediumAoeTrigger : public TwoTriggers { public: - MaelstromWeapon5AndMediumAoeTrigger(PlayerbotAI* ai) : TwoTriggers(ai, "maelstrom weapon 5", "medium aoe") {} + MaelstromWeapon5AndMediumAoeTrigger(PlayerbotAI* botAI) : TwoTriggers(botAI, "maelstrom weapon 5", "medium aoe") {} }; class MaelstromWeapon4AndMediumAoeTrigger : public TwoTriggers { public: - MaelstromWeapon4AndMediumAoeTrigger(PlayerbotAI* ai) : TwoTriggers(ai, "maelstrom weapon 4", "medium aoe") {} + MaelstromWeapon4AndMediumAoeTrigger(PlayerbotAI* botAI) : TwoTriggers(botAI, "maelstrom weapon 4", "medium aoe") {} }; class ChainLightningNoCdTrigger : public SpellNoCooldownTrigger { public: - ChainLightningNoCdTrigger(PlayerbotAI* ai) : SpellNoCooldownTrigger(ai, "chain lightning") {} + ChainLightningNoCdTrigger(PlayerbotAI* botAI) : SpellNoCooldownTrigger(botAI, "chain lightning") {} }; // Healing Triggers @@ -307,49 +276,49 @@ protected: class CallOfTheElementsTrigger : public Trigger { public: - CallOfTheElementsTrigger(PlayerbotAI* ai) : Trigger(ai, "call of the elements") {} + CallOfTheElementsTrigger(PlayerbotAI* botAI) : Trigger(botAI, "call of the elements") {} bool IsActive() override; }; class TotemicRecallTrigger : public Trigger { public: - TotemicRecallTrigger(PlayerbotAI* ai) : Trigger(ai, "totemic recall") {} + TotemicRecallTrigger(PlayerbotAI* botAI) : Trigger(botAI, "totemic recall") {} bool IsActive() override; }; class NoEarthTotemTrigger : public Trigger { public: - NoEarthTotemTrigger(PlayerbotAI* ai) : Trigger(ai, "no earth totem") {} + NoEarthTotemTrigger(PlayerbotAI* botAI) : Trigger(botAI, "no earth totem") {} bool IsActive() override; }; class NoFireTotemTrigger : public Trigger { public: - NoFireTotemTrigger(PlayerbotAI* ai) : Trigger(ai, "no fire totem") {} + NoFireTotemTrigger(PlayerbotAI* botAI) : Trigger(botAI, "no fire totem") {} bool IsActive() override; }; class NoWaterTotemTrigger : public Trigger { public: - NoWaterTotemTrigger(PlayerbotAI* ai) : Trigger(ai, "no water totem") {} + NoWaterTotemTrigger(PlayerbotAI* botAI) : Trigger(botAI, "no water totem") {} bool IsActive() override; }; class NoAirTotemTrigger : public Trigger { public: - NoAirTotemTrigger(PlayerbotAI* ai) : Trigger(ai, "no air totem") {} + NoAirTotemTrigger(PlayerbotAI* botAI) : Trigger(botAI, "no air totem") {} bool IsActive() override; }; class CallOfTheElementsAndEnemyWithinMeleeTrigger : public TwoTriggers { public: - CallOfTheElementsAndEnemyWithinMeleeTrigger(PlayerbotAI* ai) : TwoTriggers(ai, "call of the elements", "enemy within melee") {} + CallOfTheElementsAndEnemyWithinMeleeTrigger(PlayerbotAI* botAI) : TwoTriggers(botAI, "call of the elements", "enemy within melee") {} }; // Set Strategy Assigned Totems @@ -359,8 +328,8 @@ class SetTotemTrigger : public Trigger public: // Template constructor: infers N (size of the id array) at compile time template - SetTotemTrigger(PlayerbotAI* ai, std::string const& spellName, const uint32 (&ids)[N], int actionButtonId) - : Trigger(ai, "set " + spellName) + SetTotemTrigger(PlayerbotAI* botAI, std::string const& spellName, const uint32 (&ids)[N], int actionButtonId) + : Trigger(botAI, "set " + spellName) , totemSpellIds(ids) , totemSpellIdsCount(N) , actionButtonId(actionButtonId) @@ -376,120 +345,120 @@ private: class SetStrengthOfEarthTotemTrigger : public SetTotemTrigger { public: - SetStrengthOfEarthTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "strength of earth totem", STRENGTH_OF_EARTH_TOTEM, TOTEM_BAR_SLOT_EARTH) {} + SetStrengthOfEarthTotemTrigger(PlayerbotAI* botAI) + : SetTotemTrigger(botAI, "strength of earth totem", STRENGTH_OF_EARTH_TOTEM, TOTEM_BAR_SLOT_EARTH) {} }; class SetStoneskinTotemTrigger : public SetTotemTrigger { public: - SetStoneskinTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "stoneskin totem", STONESKIN_TOTEM, TOTEM_BAR_SLOT_EARTH) {} + SetStoneskinTotemTrigger(PlayerbotAI* botAI) + : SetTotemTrigger(botAI, "stoneskin totem", STONESKIN_TOTEM, TOTEM_BAR_SLOT_EARTH) {} }; class SetTremorTotemTrigger : public SetTotemTrigger { public: - SetTremorTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "tremor totem", TREMOR_TOTEM, TOTEM_BAR_SLOT_EARTH) {} + SetTremorTotemTrigger(PlayerbotAI* botAI) + : SetTotemTrigger(botAI, "tremor totem", TREMOR_TOTEM, TOTEM_BAR_SLOT_EARTH) {} }; class SetEarthbindTotemTrigger : public SetTotemTrigger { public: - SetEarthbindTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "earthbind totem", EARTHBIND_TOTEM, TOTEM_BAR_SLOT_EARTH) {} + SetEarthbindTotemTrigger(PlayerbotAI* botAI) + : SetTotemTrigger(botAI, "earthbind totem", EARTHBIND_TOTEM, TOTEM_BAR_SLOT_EARTH) {} }; class SetSearingTotemTrigger : public SetTotemTrigger { public: - SetSearingTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "searing totem", SEARING_TOTEM, TOTEM_BAR_SLOT_FIRE) {} + SetSearingTotemTrigger(PlayerbotAI* botAI) + : SetTotemTrigger(botAI, "searing totem", SEARING_TOTEM, TOTEM_BAR_SLOT_FIRE) {} }; class SetMagmaTotemTrigger : public SetTotemTrigger { public: - SetMagmaTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "magma totem", MAGMA_TOTEM, TOTEM_BAR_SLOT_FIRE) {} + SetMagmaTotemTrigger(PlayerbotAI* botAI) + : SetTotemTrigger(botAI, "magma totem", MAGMA_TOTEM, TOTEM_BAR_SLOT_FIRE) {} }; class SetFlametongueTotemTrigger : public SetTotemTrigger { public: - SetFlametongueTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "flametongue totem", FLAMETONGUE_TOTEM, TOTEM_BAR_SLOT_FIRE) {} + SetFlametongueTotemTrigger(PlayerbotAI* botAI) + : SetTotemTrigger(botAI, "flametongue totem", FLAMETONGUE_TOTEM, TOTEM_BAR_SLOT_FIRE) {} }; class SetTotemOfWrathTrigger : public SetTotemTrigger { public: - SetTotemOfWrathTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "totem of wrath", TOTEM_OF_WRATH, TOTEM_BAR_SLOT_FIRE) {} + SetTotemOfWrathTrigger(PlayerbotAI* botAI) + : SetTotemTrigger(botAI, "totem of wrath", TOTEM_OF_WRATH, TOTEM_BAR_SLOT_FIRE) {} }; class SetFrostResistanceTotemTrigger : public SetTotemTrigger { public: - SetFrostResistanceTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "frost resistance totem", FROST_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_FIRE) {} + SetFrostResistanceTotemTrigger(PlayerbotAI* botAI) + : SetTotemTrigger(botAI, "frost resistance totem", FROST_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_FIRE) {} }; class SetHealingStreamTotemTrigger : public SetTotemTrigger { public: - SetHealingStreamTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "healing stream totem", HEALING_STREAM_TOTEM, TOTEM_BAR_SLOT_WATER) {} + SetHealingStreamTotemTrigger(PlayerbotAI* botAI) + : SetTotemTrigger(botAI, "healing stream totem", HEALING_STREAM_TOTEM, TOTEM_BAR_SLOT_WATER) {} }; class SetManaSpringTotemTrigger : public SetTotemTrigger { public: - SetManaSpringTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "mana spring totem", MANA_SPRING_TOTEM, TOTEM_BAR_SLOT_WATER) {} + SetManaSpringTotemTrigger(PlayerbotAI* botAI) + : SetTotemTrigger(botAI, "mana spring totem", MANA_SPRING_TOTEM, TOTEM_BAR_SLOT_WATER) {} }; class SetCleansingTotemTrigger : public SetTotemTrigger { public: - SetCleansingTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "cleansing totem", CLEANSING_TOTEM, TOTEM_BAR_SLOT_WATER) {} + SetCleansingTotemTrigger(PlayerbotAI* botAI) + : SetTotemTrigger(botAI, "cleansing totem", CLEANSING_TOTEM, TOTEM_BAR_SLOT_WATER) {} }; class SetFireResistanceTotemTrigger : public SetTotemTrigger { public: - SetFireResistanceTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "fire resistance totem", FIRE_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_WATER) {} + SetFireResistanceTotemTrigger(PlayerbotAI* botAI) + : SetTotemTrigger(botAI, "fire resistance totem", FIRE_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_WATER) {} }; class SetWrathOfAirTotemTrigger : public SetTotemTrigger { public: - SetWrathOfAirTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "wrath of air totem", WRATH_OF_AIR_TOTEM, TOTEM_BAR_SLOT_AIR) {} + SetWrathOfAirTotemTrigger(PlayerbotAI* botAI) + : SetTotemTrigger(botAI, "wrath of air totem", WRATH_OF_AIR_TOTEM, TOTEM_BAR_SLOT_AIR) {} }; class SetWindfuryTotemTrigger : public SetTotemTrigger { public: - SetWindfuryTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "windfury totem", WINDFURY_TOTEM, TOTEM_BAR_SLOT_AIR) {} + SetWindfuryTotemTrigger(PlayerbotAI* botAI) + : SetTotemTrigger(botAI, "windfury totem", WINDFURY_TOTEM, TOTEM_BAR_SLOT_AIR) {} }; class SetNatureResistanceTotemTrigger : public SetTotemTrigger { public: - SetNatureResistanceTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "nature resistance totem", NATURE_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_AIR) {} + SetNatureResistanceTotemTrigger(PlayerbotAI* botAI) + : SetTotemTrigger(botAI, "nature resistance totem", NATURE_RESISTANCE_TOTEM, TOTEM_BAR_SLOT_AIR) {} }; class SetGroundingTotemTrigger : public SetTotemTrigger { public: - SetGroundingTotemTrigger(PlayerbotAI* ai) - : SetTotemTrigger(ai, "grounding totem", GROUNDING_TOTEM, TOTEM_BAR_SLOT_AIR) {} + SetGroundingTotemTrigger(PlayerbotAI* botAI) + : SetTotemTrigger(botAI, "grounding totem", GROUNDING_TOTEM, TOTEM_BAR_SLOT_AIR) {} }; #endif