mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-12-01 21:12:50 +08:00
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:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user