diff --git a/src/PlayerbotFactory.cpp b/src/PlayerbotFactory.cpp index c2fd50c8..d31f5f25 100644 --- a/src/PlayerbotFactory.cpp +++ b/src/PlayerbotFactory.cpp @@ -337,10 +337,11 @@ void PlayerbotFactory::Refresh() InitAmmo(); InitFood(); InitReagents(); - InitPotions(); - InitTalents(true); + // InitPotions(); + InitTalentsTree(true); InitClassSpells(); InitAvailableSpells(); + InitSkills(); bot->DurabilityRepairAll(false, 1.0f, false); if (bot->isDead()) bot->ResurrectPlayer(1.0f, false); @@ -2144,6 +2145,9 @@ void PlayerbotFactory::InitAmmo() case ITEM_SUBCLASS_WEAPON_CROSSBOW: subClass = ITEM_SUBCLASS_ARROW; break; + case ITEM_SUBCLASS_WEAPON_THROWN: + subClass = ITEM_SUBCLASS_THROWN; + break; } if (!subClass) @@ -2292,6 +2296,9 @@ void PlayerbotFactory::InitPotions() void PlayerbotFactory::InitFood() { + if (sPlayerbotAIConfig->freeFood) { + return; + } std::map > items; ItemTemplateContainer const* itemTemplateContainer = sObjectMgr->GetItemTemplateStore(); for (ItemTemplateContainer::const_iterator i = itemTemplateContainer->begin(); i != itemTemplateContainer->end(); ++i) @@ -2961,6 +2968,7 @@ float PlayerbotFactory::CalculateItemScore(uint32 item_id, Player* bot) { score *= 0.8; } + // double hand if (proto->Class == ITEM_CLASS_WEAPON) { bool isDoubleHand = proto->Class == ITEM_CLASS_WEAPON && !(ITEM_SUBCLASS_MASK_SINGLE_HAND & (1 << proto->SubClass)) && @@ -2990,6 +2998,11 @@ float PlayerbotFactory::CalculateItemScore(uint32 item_id, Player* bot) score *= 10; } } + if (proto->Class == ITEM_CLASS_WEAPON) { + if (cls == CLASS_HUNTER && proto->SubClass == ITEM_SUBCLASS_WEAPON_THROWN) { + score *= 0.1; + } + } return (0.01 + score) * itemLevel * (quality + 1); // return score; } diff --git a/src/RandomItemMgr.cpp b/src/RandomItemMgr.cpp index 7ca5ff4e..a788250d 100644 --- a/src/RandomItemMgr.cpp +++ b/src/RandomItemMgr.cpp @@ -2179,7 +2179,7 @@ void RandomItemMgr::BuildAmmoCache() uint32 counter = 0; for (uint32 level = 1; level <= maxLevel; level += 1) { - for (uint32 subClass = ITEM_SUBCLASS_ARROW; subClass <= ITEM_SUBCLASS_BULLET; subClass++) + for (uint32 subClass = ITEM_SUBCLASS_ARROW; subClass <= ITEM_SUBCLASS_THROWN; subClass++) { QueryResult results = WorldDatabase.Query("SELECT entry FROM item_template WHERE class = {} AND subclass = {} AND RequiredLevel <= {} " "ORDER BY RequiredLevel DESC", ITEM_CLASS_PROJECTILE, subClass, level); diff --git a/src/RandomPlayerbotMgr.cpp b/src/RandomPlayerbotMgr.cpp index bf941da0..613b38eb 100644 --- a/src/RandomPlayerbotMgr.cpp +++ b/src/RandomPlayerbotMgr.cpp @@ -833,8 +833,8 @@ bool RandomPlayerbotMgr::ProcessBot(uint32 bot) } } - if (botAI->HasPlayerNearby(sPlayerbotAIConfig->grindDistance)) - update = false; + // if (botAI->HasPlayerNearby(sPlayerbotAIConfig->grindDistance)) + // update = false; } if (update) @@ -1428,8 +1428,8 @@ void RandomPlayerbotMgr::Refresh(Player* bot) botAI->ResetStrategies(false); } - if (sPlayerbotAIConfig->disableRandomLevels) - return; + // if (sPlayerbotAIConfig->disableRandomLevels) + // return; if (bot->InBattleground()) return; @@ -1472,9 +1472,6 @@ bool RandomPlayerbotMgr::IsRandomBot(Player* bot) } if (bot) { - if (sPlayerbotAIConfig->IsInRandomAccountList(bot->GetSession()->GetAccountId())) - return true; - return IsRandomBot(bot->GetGUID().GetCounter()); } diff --git a/src/strategy/actions/AutoTeleportForLevelAction.cpp b/src/strategy/actions/AutoTeleportForLevelAction.cpp index 3f1fa33a..396c522e 100644 --- a/src/strategy/actions/AutoTeleportForLevelAction.cpp +++ b/src/strategy/actions/AutoTeleportForLevelAction.cpp @@ -21,4 +21,5 @@ void AutoTeleportForLevelAction::AutoUpgradeEquip() { } PlayerbotFactory factory(bot, bot->GetLevel(), ITEM_QUALITY_RARE); factory.InitEquipment(true); + factory.InitSkills(); } \ No newline at end of file diff --git a/src/strategy/druid/HealDruidStrategy.cpp b/src/strategy/druid/HealDruidStrategy.cpp index cb386529..2bd8d46f 100644 --- a/src/strategy/druid/HealDruidStrategy.cpp +++ b/src/strategy/druid/HealDruidStrategy.cpp @@ -30,8 +30,9 @@ void HealDruidStrategy::InitTriggers(std::vector& triggers) triggers.push_back(new TriggerNode( "party member critical health", NextAction::array(0, - new NextAction("swiftmend on party", ACTION_CRITICAL_HEAL + 3), - new NextAction("wild growth", ACTION_CRITICAL_HEAL + 2), + new NextAction("swiftmend on party", ACTION_CRITICAL_HEAL + 4), + new NextAction("wild growth", ACTION_CRITICAL_HEAL + 3), + new NextAction("regrowth on party", ACTION_CRITICAL_HEAL + 2), new NextAction("nourish on party", ACTION_CRITICAL_HEAL + 1), new NextAction("healing touch on party", ACTION_CRITICAL_HEAL + 0), NULL))); diff --git a/src/strategy/values/GrindTargetValue.cpp b/src/strategy/values/GrindTargetValue.cpp index 856184e4..d499d506 100644 --- a/src/strategy/values/GrindTargetValue.cpp +++ b/src/strategy/values/GrindTargetValue.cpp @@ -96,7 +96,11 @@ Unit* GrindTargetValue::FindTargetForGrinding(uint32 assistCount) if (CreatureTemplate const* CreatureTemplate = creature->GetCreatureTemplate()) if (CreatureTemplate->rank > CREATURE_ELITE_NORMAL && !AI_VALUE(bool, "can fight elite")) continue; - + + if (!bot->IsWithinLOSInMap(unit)) { + continue; + } + if (group) { Group::MemberSlotList const& groupSlot = group->GetMemberSlots();