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
This commit is contained in:
Yunfan Li
2025-03-08 19:36:06 +08:00
committed by GitHub
parent 7dff970e37
commit 24efa7efa2
30 changed files with 207 additions and 104 deletions

View File

@@ -652,6 +652,9 @@ void PlayerbotFactory::AddConsumables()
void PlayerbotFactory::InitPetTalents()
{
if (bot->GetLevel() <= 70 && sPlayerbotAIConfig->limitTalentsExpansion)
return;
Pet* pet = bot->GetPet();
if (!pet)
{
@@ -1670,9 +1673,6 @@ void PlayerbotFactory::InitEquipment(bool incremental, bool second_chance)
if (proto->Quality != desiredQuality)
continue;
// delay heavy check
// if (!CanEquipItem(proto))
// continue;
if (proto->Class == ITEM_CLASS_ARMOR &&
(slot == EQUIPMENT_SLOT_HEAD || slot == EQUIPMENT_SLOT_SHOULDERS ||
@@ -1688,9 +1688,6 @@ void PlayerbotFactory::InitEquipment(bool incremental, bool second_chance)
if (slot == EQUIPMENT_SLOT_OFFHAND && bot->getClass() == CLASS_ROGUE &&
proto->Class != ITEM_CLASS_WEAPON)
continue;
// delay heavy check
// uint16 dest = 0;
// if (CanEquipUnseenItem(slot, dest, itemId))
items[slot].push_back(itemId);
}
}
@@ -2830,7 +2827,28 @@ void PlayerbotFactory::InitAmmo()
if (!subClass)
return;
uint32 entry = sRandomItemMgr->GetAmmo(level, subClass);
std::vector<uint32> ammoEntryList = sRandomItemMgr->GetAmmo(level, subClass);
uint32 entry = 0;
for (uint32 tEntry : ammoEntryList)
{
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(tEntry);
if (!proto)
continue;
// disable next expansion ammo
if (sPlayerbotAIConfig->limitGearExpansion && bot->GetLevel() <= 60 && tEntry >= 23728)
continue;
if (sPlayerbotAIConfig->limitGearExpansion && bot->GetLevel() <= 70 && tEntry >= 35570)
continue;
entry = tEntry;
break;
}
if (!entry)
return;
uint32 count = bot->GetItemCount(entry);
uint32 maxCount = bot->getClass() == CLASS_HUNTER ? 6000 : 1000;
@@ -2984,6 +3002,10 @@ void PlayerbotFactory::InitPotions()
for (uint8 i = 0; i < 2; ++i)
{
uint32 effect = effects[i];
if (effect == SPELL_EFFECT_ENERGIZE && !bot->GetPower(POWER_MANA))
continue;
FindPotionVisitor visitor(bot, effect);
IterateItems(&visitor);
if (!visitor.GetResult().empty())

View File

@@ -126,7 +126,7 @@ void StatsWeightCalculator::GenerateWeights(Player* player)
void StatsWeightCalculator::GenerateBasicWeights(Player* player)
{
// Basic weights
stats_weights_[STATS_TYPE_STAMINA] += 0.01f;
stats_weights_[STATS_TYPE_STAMINA] += 0.1f;
stats_weights_[STATS_TYPE_ARMOR] += 0.001f;
stats_weights_[STATS_TYPE_BONUS] += 1.0f;
@@ -508,9 +508,10 @@ void StatsWeightCalculator::CalculateItemTypePenalty(ItemTemplate const* proto)
{
weight_ *= 0.1;
}
if (cls == CLASS_ROGUE && tab == ROGUE_TAB_ASSASSINATION && proto->SubClass != ITEM_SUBCLASS_WEAPON_DAGGER)
if (cls == CLASS_ROGUE && (tab == ROGUE_TAB_ASSASSINATION || tab == ROGUE_TAB_SUBTLETY) &&
proto->SubClass != ITEM_SUBCLASS_WEAPON_DAGGER)
{
weight_ *= 0.1;
weight_ *= 0.5;
}
if (cls == CLASS_ROGUE && player_->HasAura(13964) &&
(proto->SubClass == ITEM_SUBCLASS_WEAPON_SWORD || proto->SubClass == ITEM_SUBCLASS_WEAPON_AXE))