Commit Graph

563 Commits

Author SHA1 Message Date
Yunfan Li
38912d4a8a Auto do quest feature (new rpg strategy) (#1034)
* New rpg startup speed up and refactor

* New rpg do quest

* Fix invalid height in quest poi

* Add quest accept and reward limitation

* New rpg quest improvement

* Organize quest log, reward quests and fix grind target

* Quest dropped statistic and remove redundant code

* Decrease grind relevance lower than loot

* Fix new rpg drop quest

* Go to reward quest instead of innkeeper when quest completed

* Fix incorrect logic in do quest reward

* Fix reset quests in factory

* Fix crash on grind target value

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

* Fix a minor error in DoCompletedQuest

* Let bots get rid of impossible quests faster

* Increase loot fluency (especially for caster)

* Remove seasonal quests from auto accept

* Enhance quest accept condition check

* Add questgiver check (limit acceptation of quest 7946)

* Questgiver check and localization

* Near npc fix

* Fix quest item report

* Add lowPriorityQuest set for quests can not be done

* Improve gameobjects loot

* Do complete quest

* FIx move far to teleport check

* Accept or reward quest from game objects

* Fix possible crash in rpg game objects

* Fix ChooseNpcOrGameObjectToInteract crash

---------

Co-authored-by: SaW <swerkhoven@outlook.com>
2025-03-14 21:31:33 +08: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
SaW
4f43600e7a Silence error if preferred mounts SQL table playerbots_preferred_mounts does not exist (#1062)
* Fix error spam if DB does not exist
2025-03-06 15:03:23 +01:00
avirar
f7f949eda4 Item Usage and Loot Roll (#1059)
* Better Disenchant and final AH usage

* CalculateRollVote instead of just needing on items allowed by StoreLootAction::IsLootAllowed
2025-03-06 13:39:33 +01:00
xSparky911x
92d63c7cbc fix classbots autogear not working when altbots autogear turned off (#1060)
* fix classbots autogear not working when altbots autogear turned off
2025-03-06 13:31:46 +01:00
SaW
b9747fdd69 Reinstate cached preferred mounts (#1058) 2025-03-05 17:24:54 +01:00
SaW
bf22f20997 Fix: Bots not mounting in BG's anymore (#1056)
Bots didn't stop as they were supposed to, leading to some issues.
2025-03-04 13:42:41 +01:00
SaW
fe21dfe48e Fix/Feature: Bots can use travel/flight Shapeshift where appropriate (#1042) 2025-03-03 15:10:35 +01:00
avirar
9edddc5b26 Hunter equip bug (#1050) 2025-03-03 15:09:47 +01:00
Yunfan Li
a3e305fbed Improve XP rate config (#1035) 2025-02-28 01:05:08 +01:00
avirar
3a4e8e729b Allow bots to enter all TBC dungeons (rep/keys/quest attunements) (#1014)
Update will allow any adequately leveled bot to queue for all random and specific TBC dungeons. Normal and Heroic modes that require attunement or keys will be accessible by bots.

InitReputation: Level 70+ Bots will receive Honored rank for all the required factions needed for Heroic keys to function. I've placed the calls to InitRep before InitMounts, I feel we can do something with that in the future. Randomised rep values might allow bots to obtain other mounts?
InitKeyring: All bots receive all non-rep required keys (Shattered Halls Key, Shadow Labyrinth Key, Key to the Arcatraz), and bots with the required rep (Honored) get the other keys.
InitAttunementQuests: Level 60+ bots complete the Caverns of Time and Magister's Terrace attunement quests.
Updated acore_playerbots SQL; playerbots_dungeon_suggestion_definition; max_level increased to 73 (from 70) for all TBC Heroics and Magister's Terrace nomal. Allows more level appropriate bots to join.
2025-02-26 15:55:16 +01:00
SaW
2766d553c7 Maintenance command to retain defined special spells (#1024)
fixes a bug that caused the maintenance command to have bots lose the special spells
2025-02-26 13:32:26 +01:00
Yunfan Li
95c2ba9105 Permission check and readability improvements (#997)
* AiFactory check by spell instead of level

* Ignore group security for guild invitation
2025-02-23 20:09:59 +01:00
Yunfan Li
4b1febc62a Minor improvments on logs, stats weights and aoe distance calculation (#995)
* StatsCollector for paladin spell

* Remove error log on MoveFromGroup

* Log and timer for CreateRandomBots

* Improve aoe trigger distance calculation

* Reduce spirit weights for heal priest and paladin
2025-02-22 10:57:33 +08: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
e33c61e90a Fixes on naxxramas heigan and thaddius (#994)
* Fix naxx thaddius

* Fix naxx heigan strats
2025-02-21 17:53:07 +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
SaW
6cb1599b52 CheckMountStateAction refactor Final (#960)
- Fix for the issue that bots occasionally moved awkward when mounted inside BG's
- Removed redundant mount data retrieval
- Removed redundant extra check on if carrying a flag (already covered in isUseful)
- Removed no longer necessary code
- Combined some conditions as having them separate made little sense anymore
- Moved checking carrying flag into the BG logic
2025-02-11 11:39:29 +01:00
SaW
308c0b437e BattleGrounds: Refactor and Fix bots re-spawning when graveyard meanwhile gets lost (#937)
* Update ReleaseSpiritAction.cpp

* Update ReleaseSpiritAction.cpp

* Update ReleaseSpiritAction.cpp

* Update ReleaseSpiritAction.cpp

* Update ReleaseSpiritAction.h

* Update ReleaseSpiritAction.h

* Update ReleaseSpiritAction.cpp

* Update ReleaseSpiritAction.cpp

* Update ReleaseSpiritAction.cpp

* Refactor (#68)

* Refactored ReleaseSpiritAction.cpp

* Ref ReleaseSpiritAction.h

* Restore comment
2025-02-04 13:30:35 +01:00
SaW
f5a8b3017e BattleGround: Fix bot's already cast (ranged) spells to be redirected to bot's ghost on death (#934)
* Update ReleaseSpiritAction.h - add bg_release_time

* Update ReleaseSpiritAction.cpp

* Update ReleaseSpiritAction.cpp - Move LOG_DEBUG

Correct LOG_DEBUG position.

* Reliable fix (#67)

Reliable fix

* Reduced wait time from 8 to 6 min

* Update comment
2025-02-02 01:39:57 +01:00
SaW
e07a9e194a MSA Improvement Part 2 (#66) (#933)
Reduce iterations.
2025-02-01 20:23:25 +01:00
blinkysc
d770e0a9a0 fix(BotAI/BattleGrounds) Bots AI improved based around capture points (#927)
* Less Flag Derp

* Comments
2025-01-30 14:16:59 +01:00
avirar
27b86f8b1f Eye of the Storm changes (#924)
* EoTS: Changed FC logic to use MoveNear while not in combat

Similar to WSG commit from a few days ago

* Changed action priorities in EotS to ACTION_MOVE + x

* Adjusted EotS flag carrier objective selection

Random chance reduced from 1/2 to 1/3
Distance threshold before objective switch is considered reduced to 15.0yds
2025-01-30 14:16:34 +01:00
avirar
0c8785d8d1 Resolved issues with herb gathering (#926)
* Check game objects loot tables and determine if loot is valid

* Removed LOS checks since they already occur and removed enemy near node check

* Dismount if mounted, decresed interaction distance, added looting delay

* Decreased interaction distance

* oops, wrong file

* Check game objects loot tables and determine if loot is valid
2025-01-30 00:29:17 +01:00
avirar
247c67e449 CheckMountStateAction: Added SPELL_AURA_TRANSFORM and IsInDisallowedMountForm (#923)
Resolved issue where bots are transformed (e.g Deathbringer's Will trinket) and would stand still attempting to mount, still allows mounting when the transform allows it (e.g Pirate Costume, Transporter Malfunction)
2025-01-29 12:37:24 +01:00
SaW
f52f999c09 Refactor of the CheckMountStateAction class (#919)
* Update CheckMountStateAction.cpp

The refactoring focused on improving readability, reducing redundancy, and optimizing performance where possible.

* Update CheckMountStateAction.h

* Update CheckMountStateAction.cpp

* Update CheckMountStateAction.cpp

* Update CheckMountStateAction.cpp

* Update CheckMountStateAction.h

* Fix lowest level mount from config

* Properly fix

* Reduced masterInShapeshiftForm lookups to 1

Reduced masterInShapeshiftForm lookups to 1

* Fix for missing useFastGroundMountAtMinLevel

* Final commit: Ensure max 99 speed in BG
2025-01-28 09:08:21 +01:00
SaW
2ebeb244ec Fix bot swimming behavior at the surface and in shallow waters (#908)
- Fix for Bots don't swim properly near the surface #903
- Prevents bots teleporting/warping to the surface when in (shallow) waters.
2025-01-25 16:30:47 +01:00
avirar
f27624aa6e Removed mount action in "protect fc" + reduced support bot chance (#892) 2025-01-23 11:42:31 +01:00
avirar
1e9fd1607a Tweaked Alterac Valley so bots kill final bosses (#886)
* Updated AV strategy so only 2 towers need to be down before final boss

* Adjusted role assignments for AV: less defenders, more forward attackers

* Added strategy for team has flag in WSG

team has flag triggers bg protect fc action @ 75 priority

* Updated protectFC function with MoveNear instead of follow
2025-01-22 16:45:09 +01:00
Yunfan Li
f6cc3f6e40 Improve ICC spread and fix Valithria trigger (#884)
* Temp fix valithria find target

* Improve spread with FleePosition

* Fix Valithria trigger
2025-01-21 20:24:06 +01:00
Yunfan Li
e6be50d2e1 Merge pull request #880 from liyunfan1223/improve_dps
Improve DPS rotation
2025-01-20 15:50:45 +08:00
Yunfan Li
3a9fc170c5 Leave group instead of disband group 2025-01-19 20:13:59 +08:00
Yunfan Li
9f34d4a7f7 Fix talk crash by correcting "nearest game objects" 2025-01-19 13:04:30 +08:00
achyles222
106b36b498 Added ability to specify bot target for spell casting (#874) 2025-01-18 20:28:20 +01:00
Yunfan Li
46534e3abe Fix/Enhance warlock pet spells (#860) 2025-01-10 18:41:56 +01:00
valsan-azerty-boi
f95e812d26 add bot mount in conf 2025-01-05 21:55:13 +01:00
Yunfan Li
01c257005e Merge pull request #842 from liyunfan1223/lfg_leave_group
Fix LFG leave group and several minor issues
2025-01-04 16:12:12 +08:00
avirar
fa02cdb369 Allow use of more portal game objects (#840)
* EoE and Naxx Portals

* Added Orb of Naxxramas objects and use GAMEOBJECT_TYPE_GOOBER

* Fixed missing ! in HasEffect(SPELL_EFFECT_TELEPORT_UNITS) check

Commented out old code in case it is needed in the future for edge case portal objects.
2025-01-03 16:07:56 +01:00
avirar
c59c0cc802 Added logic for early ranged/thrown weapon equipping (#839)
Ranged weapons get caught up in the ITEM_CLASS_WEAPON logic but aren't handled. Added an early check and equip for ranged INVTYPE_
2025-01-03 16:06:06 +01:00
Yunfan Li
30437bd28f Improve inactive grind status 2025-01-01 21:10:05 +08:00
Yunfan Li
9d34a58435 Improve rpg movement and grind 2025-01-01 20:41:40 +08:00
Yunfan Li
da1c3effb7 Fix movement after spell cast 2025-01-01 20:41:08 +08:00
Yunfan Li
c5994e2961 Merge pull request #832 from liyunfan1223/move_backwards
Move backwards when enemy too close
2024-12-31 23:43:41 +08:00
Yunfan Li
1b5c6ba06a Fix FleeAction 2024-12-31 21:53:31 +08:00
Yunfan Li
cc5a3e4c76 Add backwards paramater on MoveAway (apply only on FleeAction) 2024-12-31 20:56:25 +08:00
SaW
10a45fcbde Put IsValidAttackTarget check on both bots and their pets (#833)
* Prevent PetAttackAction on invalid targets

* Prevent AttackAction on invalid targets in general
2024-12-30 19:21:38 +01:00
Yunfan Li
79a5fdd7c1 Make backwards movement for flee 2024-12-29 23:21:03 +08:00
avirar
adc0d6e72c Worldbuff feral druid bear/cat logic (#816)
* Add logic to separate cat and bear druid buffs

Check for Thick Hide (16929) talent, use regular buffs if found, use new fourth row if not.

* Added cat druid buffs (ArP food, AP flask)

* Update playerbots.conf.dist

* Refined logic for feral druids

* Use rank 3 of Thick Hide and GetActiveSpec

* Update WorldBuffAction.cpp

* Added DK Blood DPS buffs

AP Flask, STR food

* Added logic for DPS Blood DKs
2024-12-28 15:27:31 +01:00
SaW
848401be67 Make bots use mounts when player is in travel form as well (#806)
Addition to https://github.com/liyunfan1223/mod-playerbots/pull/805
2024-12-21 17:22:06 +01:00
SaW
99dd094a5b Feature: Bots use flying mounts when player has flight form (#805)
* Make bots use flying mounts when player goes into flight form

* add && !bot->InBattleground() check

* Final commit
2024-12-21 13:33:47 +01:00