Commit Graph

55 Commits

Author SHA1 Message Date
mtm84
b661264c53 Update HunterActions.cpp (#1576)
Removes compiler warning
2025-08-18 12:05:53 +02:00
ThePenguinMan96
8545225923 Merge branch 'master' into Tame-Chat-Action-/-Pet-Chat-Action-(stances/commands) 2025-08-01 23:30:23 -07:00
brighton-chi
938872564a Revise bot logic for initializing and using consumables (#1483)
Bots will now add level- and spec-appropriate oils and stones when maintaining and, with respect to randombots, leveling. All bots (other than those with class-specific temporary weapon enchants) will apply oils and stones to their weapons. General clean-ups to associated code were made.
2025-08-01 19:28:13 +02:00
ThePenguinMan96
aa6f8153a1 Tame Chat Action / Pet Chat Action (stances/commands)
Hello everyone,

I am on a quest to make bot's pets completely functional, focuses on solving issues #1351 , #1230 , and #1137 . This PR achieves the following:

1. Changes the current "pet" chat command to "tame", which is more intuitive that only hunters can use it. The modes are "tame name (name)", "tame id (id)", "tame family (family)", "tame rename (new name)", and "tame abandon". Tame abandon is new - it simply abandons the current pet. Also, now, if you type in "tame family" by itself, it will list the available families. See pictures below for examples.
2. Added new "pet" chat command, with the following modes: "pet passive", "pet aggressive", "pet defensive", "pet stance" (shows current pet stance), "pet attack", "pet follow", and "pet stay". Previously, the pet's stance was not changeable, and there were some less than desired effects from summonable pets - see the issues above.
3. New config option: AiPlayerbot.DefaultPetStance, which changes the stance that all bot's pets are summoned as. This makes sure when feral spirits or treants are summoned by shamans and druids, they are immediately set to this configured stance. Set as 1 as default, which is defensive. (0 = Passive, 1 = Defensive, 2 = Aggressive)
4. New config option: AiPlayerbot.PetChatCommandDebug, which enables debug messages for the "pet" chat command. By default it is set to 0, which is disabled, but if you would like to see when pet's stances are changed, or when you tell the pet to attack/follow/stay, and when pet spells are auto-toggled, this is an option. I made this for myself mainly to test the command - if anyone notices any wierd pet behavior, this will be an option to help them report it as well.
5. Modified FollowActions to not constantly execute the petfollow action, overriding any stay or attack commands issued.
6. Modified GenericActions to have TogglePetSpellAutoCastAction optionally log when spells are toggled based on AiPlayerbot.PetChatCommandDebug.
7. Modified PetAttackAction to not attack if the pet is set to passive, and not override the pet's stance to passive every time it was executed.
8. Modified CombatStrategy.cpp to not constantly issue the petattack command, respecting the "pet stay" and "pet follow" commands. Pets will still automatically attack the enemy if set to aggressive or defensive.
9. Warlocks, Priests, Hunters, Shamans, Mages, Druids, and DKs (all classes that have summons): Added a "new pet" trigger that executes the "set pet stance" action. The "new pet" trigger happens only once, upon summoning a pet. It sets the pet's stance from AiPlayerbot.DefaultPetStance's value.
2025-08-01 01:18:16 -07:00
ThePenguinMan96
e40c2b21f2 Channel Cancel checks for Channeled AOE DPS Spells
Hello everyone,

I liked the channel cancel I did on mage recently, where they cancel blizzard if there is only 1 enemy left. I decided to do the same for the following classes:

Druid: Hurricane
Hunter: Volley
Priest: Mind Sear
Warlock: Rain of Fire

I moved the "ChannelCancel" action to it's own file, so other classes could benefit from it. I removed it from the mageactions.
2025-07-28 01:35:56 -07:00
Yunfan Li
feda619066 Engine optimization for better performance and mem usage (#1462)
* Optimize loot

* World channel talk

* General improvement

* Engine rebuild for performance and memory usage

* Fix crash with AutoDoQuest = 0
2025-07-25 12:11:03 +02:00
ThePenguinMan96
96cc0daea6 Hunter/Warlock AoE Fix (#1440)
Hello everyone,

This fixes these two classes so they respond to the command "co -aoe" and "co +aoe". This also fixes the survival hunter so that trap weave is not a default strategy - they will not walk into melee anymore.
2025-07-14 10:15:11 +02:00
ThePenguinMan96
8ca4ab1344 Hunter Overhaul
Hello everybody,

I saw that the hunter class had one strategy for all 3 specs, and decided to create specialized strategies for each one. Here is a list of the changes:

conf\playerbots.conf.dist: Redid the talent trees and glyphs slightly, for more consistent dps

src\AiFactory.cpp: Changed the default strategies assigned for each spec.

src\strategy\hunter\BeastMasteryHunterStrategy.cpp and src\strategy\hunter\BeastMasteryHunterStrategy.h: Strategy for BM hunters. Includes all of the original logic from DpsHunterStrategy, with the addition of kill command, bestial wrath, and intimidation.

src\strategy\hunter\DpsHunterStrategy.cpp and src\strategy\hunter\DpsHunterStrategy.h: Old Dps strategy used for all 3 specs - removed.

src\strategy\hunter\GenericHunterStrategy.cpp and src\strategy\hunter\GenericHunterStrategy.h: Tidied up code, added Dragonhawk passthrough to hawk, moved rapid fire to inittriggers for generichunterstrategy and increased its priority (it is still a boost trigger, so it will function the same).

src\strategy\hunter\HunterActions.cpp:
Added isuseful check for aspect of the hawk, to ensure it is never cast if the bot knows aspect of the dragonhawk.
Added isuseful check for arcane shot to never use it after explosive shot is learned (so the hunter can use it as it levels survival, but drops it after that). Also added a check for arcane shot, so it won't use it above 435 armor pen rating (steady shot is superior after this arp).
Added isuseful check for immolation trap so it won't use it after explosive shot is learned.

src\strategy\hunter\HunterActions.h:
General cleanup/alignment of actions based on type.
Added TTL checks to all DoTs and debuffs - hunters weren't using hunter's mark, serpent sting, black arrow, explosive shot on enemies that it thought would die too soon.
Black Arrow - added a strategy check here as well so the bot won't use it at all if trap weave is enabled. There was already a check in the trigger, but it was still getting cast, so I added this check.
Explosive Shot Rank 4, 3, 2, 1 actions- Added these so the hunter can downrank explosive shot dynamically based on the level when lock and load procs. So if the hunter is level 70, and a lock and load proc happens, it will fire rank 2 - rank 1 - rank 2, similar to how the level 80 version will fire 4-3-4.

src\strategy\hunter\HunterAiObjectContext.cpp:
Added strategy support for bm, mm, and surv (and their aoes)
Added trigger support for kill command, explosive shot, lock and load, silencing shot (as an spellcasting interrupt), and intimidation
Added action support for the 4 ranks of explosive shot and intimidation.

src\strategy\hunter\HunterTriggers.cpp: Kill command was completely non-functional because there was no buff trigger associated with it. Adding this will correct that, and the hunter will use kill command.

src\strategy\hunter\HunterTriggers.h: Added Kill command, silencing shot, intimidation, lock and load, and explosive shot triggers.

src\strategy\hunter\MarksmanshipHunterStrategy.cpp and src\strategy\hunter\MarksmanshipHunterStrategy.h: Strategy for MM hunters. Includes all of the original logic from DpsHunterStrategy, with the addition of kill command, silencing shot, chimera shot, and aimed shot.

src\strategy\hunter\SurvivalHunterStrategy.cpp and src\strategy\hunter\SurvivalHunterStrategy.h: Strategy for Survival hunters. Includes all of the original logic from DpsHunterStrategy, with the addition of kill command, explosive shot, black arrow, aimed shot, lock and load triggers + downranking explosive shot.
2025-07-11 17:10:03 -07:00
Yunfan Li
24efa7efa2 General improvement on init and strats (#1064)
* Potions strats and potions init

* Druid and shaman spell in low level

* Ammo init improvement

* Rogue low level

* Fix melee attack action (for caster with no mana)

* Disable pet spells that reduce dps

* Talents improvement

* Remove CanFreeMove check

* Reduce penalty for non-dagger weapon for rogue
2025-03-08 12:36:06 +01:00
avirar
a0278f1efb Hunter ammo equip bug and other issues with BuyAction.cpp (#986)
Resolves #947

Equip logic was failing as projectiles were never returning ITEM_USAGE_EQUIP in ItemUsageValue.cpp, added two cases where equip is returned:

If no ammo is currently set
If new ammo has higher DPS than old/currently equipped ammo
While testing this using "b [itemlink]" and "b vendor" to purchase arrows I noticed some issues with BuyAction.cpp and have resolved them:

Bots will now perform the "equip upgrades" action for any bought item that has an equip usage
When using "b vendor" to buy all useful items from vendors within interaction distance, it now sorts the list of available items by calculated item score and buys the highest scoring item (if it is higher than the currently equipped item) for each slot. It should not buy multiple items for the same slot anymore, saving gold/emblems/etc.
"b vendor" will now only attempt to buy 1 of each item. Consumable and projectile item types can be bought up to 10 times per execution as long as it is still useful to buy the item in each iteration of the for loop. All items were following this behaviour previously and since the equip command was only given after the for loop it would buy 10 of an item before triggering it wasn't useful to buy more.
And finally, resolved issues where a bot runs out of ammo mid-fight:

Re-enabled combat and non-combat "no ammo" strategies to perform "equip upgrades" action.
Modified GenericTriggers.cpp; AmmoCountTrigger::IsActive to return true when the bot has ammo but it is not equipped yet.
2025-02-21 18:32:10 +01:00
Yunfan Li
bb729e35b9 Fix stuck on knockback, enhance movement & flee and trap weave strats (#980)
* Hunter trap weave strats

* Do not allow actions to stack

* Remove trap weave by default

* Refactor on Engine

Co-authored-by: SaW <swerkhoven@outlook.com>

* Remove unused funcs in Queue

* Remove ExpireActionTime config

---------

Co-authored-by: SaW <swerkhoven@outlook.com>
2025-02-18 22:55:44 +08:00
Yunfan Li
006e0a03c8 Improvement hunter track and spell 2025-01-19 17:10:10 +08:00
Yunfan Li
406949f6dd Misdirection and tricks of the trade 2024-09-04 20:08:44 +08:00
Yunfan Li
6789237843 Dps hunter 2024-09-04 15:12:39 +08:00
Yunfan Li
a1cb9dea05 Improve class spell and use trinket 2024-08-14 18:37:21 +08:00
Yunfan Li
264c533d1f Fix move delay and reach combat 2024-08-06 00:44:50 +08:00
Yunfan Li
085b2e7f19 Improve containsstrategy performance 2024-08-05 22:07:07 +08:00
Yunfan Li
53611c9040 Run clang-format 2024-08-04 10:23:36 +08:00
Yunfan Li
b4201e1d84 [Misc] Init bag, hunter spell 2024-07-21 22:14:15 +08:00
Yunfan Li
51a88063f8 [Class spell] Hunter auto shot 2024-06-23 16:29:46 +08:00
Yunfan Li
0629c106ae Hunter crash fix 2024-04-18 21:07:13 +08:00
Yunfan Li
aab51a8182 Spell casting 2024-03-12 18:39:23 +08:00
Yunfan Li
2a44fb1885 Merge branch 'master' of github.com:liyunfan1223/mod-playerbots 2023-12-25 18:49:05 +08:00
Yunfan Li
3525e30305 Hunter pet happiness set 2023-12-25 18:48:51 +08:00
Yunfan Li
98c87300b0 Better too close distance calculation 2023-12-24 11:54:34 +08:00
Yunfan Li
111109b112 Raise flee action relevance 2023-12-22 00:05:09 +08:00
Yunfan Li
9dab10a5df Hunter melee 2023-12-19 20:10:43 +08:00
Yunfan Li
c56b1558b6 aspect of the monkey 2023-12-18 23:30:07 +08:00
Yunfan Li
af15a691b6 SightDistance, FollowChatShortcutAction, concussive shot 2023-12-18 22:32:48 +08:00
Yunfan Li
748801b10b fix action node factory 2023-11-10 20:10:03 +08:00
Yunfan Li
7063e5e00b remove meaningless flee 2023-11-10 19:46:48 +08:00
Yunfan Li
10462126b4 miscs 2023-10-25 20:29:32 +08:00
Yunfan Li
e727397963 target && hunter auto shoot 2023-10-22 15:19:12 +08:00
Yunfan Li
45d0ae00ab default actions 2023-10-22 12:50:17 +08:00
Yunfan Li
a63c6b6709 smarter dps target and tank target 2023-10-22 01:27:37 +08:00
Yunfan Li
4672b3edcf spell modification 2023-10-04 22:32:04 +08:00
Yunfan Li
e5a7f0448d bestial wrath 2023-10-04 13:03:00 +08:00
Yunfan Li
69ff31b764 hunter auto shot 2023-10-04 10:17:55 +08:00
Yunfan Li
243a4df967 optimize class spell 2023-09-08 12:44:38 +08:00
Yunfan Li
5e676e60e0 debuff on attacker 2023-09-05 01:41:13 +08:00
Yunfan Li
bb1ea0c395 naxxramas gluth 2023-09-03 17:52:44 +08:00
Yunfan Li
46b94824e4 miscs: movement, coredump fix, rndbot 2023-08-02 16:16:56 +08:00
Yunfan Li
252b2f259c fix hunter auto shot 2023-07-30 15:46:11 +08:00
Yunfan Li
e93b1edcd5 fix strategies conflict for rndbot 2023-07-30 14:33:52 +08:00
Yunfan Li
8c914e5723 sapphiron strategy fix 2023-07-24 15:58:48 +08:00
Yunfan Li
7c70f42f34 refactor: naxxramas and kel'thuzad strategy 2023-07-18 17:58:51 +08:00
Yunfan Li
98e46a3d02 miscs(raid strategy, distance triggers, etc) 2023-06-06 00:11:35 +08:00
Yunfan Li
a44b310c0a debuff trigger and action, allow multiple spell 2023-06-02 19:57:08 +08:00
Yunfan Li
d45a7dc5b8 fix party member dispel. 2023-05-29 23:03:21 +08:00
Yunfan Li
2ad567a1a8 Flee action, factory setting 2023-05-29 11:45:18 +08:00