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.
- 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
* 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
* 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
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)
* 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
* 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.
* 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
* Fix bots attacking despite being in a prohibited zone
* Protect pets as well and move logic to not skip IsFriendlyTo
* Fix prohibited typo
* Update AttackAction.cpp
There was existing code to ignore practice targets (anything with Dummy in the name) so I've just added the names of practice targets located in the tournament grounds:
Charge Target
Melee Target
Ranged Target
I considered just using the phrase "Target", but it is too generic and there are 246 creature_template names containing Target.
* prevent autogear on player alt bots
* update chat message to match other message format
* add config option with default set to 1
* replace end of file blank line
* remove extra space
Since they didn't have any sell value you couldn't get a bot to give you a healthstone or conjured food/water. This change allows them to be traded to you without altering any of the other logic for bot trades.
Implemented logic to ensure the strongest weapon is always placed in the main hand for dual-wielding or Titan Grip-capable bots.
When equipping a new weapon, the code now compares the new weapon’s score with the currently equipped main-hand and off-hand weapons.
If the new weapon is the strongest, it goes into the main hand. The previous main-hand weapon may be moved to the off-hand if it is allowed (e.g., not a main-hand-only weapon) and provides a performance improvement.
Titan Grip conditions are accounted for, allowing valid two-handed weapons (2H axes, maces, swords) to be placed in the off-hand as well.