mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
miscs(pet, log, needForQuest)
This commit is contained in:
@@ -572,6 +572,7 @@ void PlayerbotFactory::InitPet()
|
|||||||
pet->InitTalentForLevel();
|
pet->InitTalentForLevel();
|
||||||
|
|
||||||
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
|
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
|
||||||
|
bot->PetSpellInitialize();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -592,8 +593,6 @@ void PlayerbotFactory::InitPet()
|
|||||||
// LOG_INFO("playerbots", "Start make spell auto cast for {} spells. {} already auto casted.", pet->m_spells.size(), pet->GetPetAutoSpellSize());
|
// LOG_INFO("playerbots", "Start make spell auto cast for {} spells. {} already auto casted.", pet->m_spells.size(), pet->GetPetAutoSpellSize());
|
||||||
for (PetSpellMap::const_iterator itr = pet->m_spells.begin(); itr != pet->m_spells.end(); ++itr)
|
for (PetSpellMap::const_iterator itr = pet->m_spells.begin(); itr != pet->m_spells.end(); ++itr)
|
||||||
{
|
{
|
||||||
// LOG_INFO("playerbots", "Start. Make spell {} for pet {} auto cast, bot: {}. state: {}", itr->first, pet->GetName(), bot->GetName(),
|
|
||||||
// itr->second.state);
|
|
||||||
if (itr->second.state == PETSPELL_REMOVED)
|
if (itr->second.state == PETSPELL_REMOVED)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -602,18 +601,10 @@ void PlayerbotFactory::InitPet()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (spellInfo->IsPassive()) {
|
if (spellInfo->IsPassive()) {
|
||||||
// LOG_INFO("playerbots", "Start. Make spell {} for pet {} auto cast, bot: {}. Passive continue.",
|
|
||||||
// itr->first, pet->GetName(), bot->GetName());
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// LOG_INFO("playerbots", "Make spell {} for pet {} auto cast, bot: {}. old_active: {}. old_state: {}.",
|
|
||||||
// itr->first, pet->GetName(), bot->GetName(), itr->second.active, itr->second.state);
|
|
||||||
pet->ToggleAutocast(spellInfo, true);
|
pet->ToggleAutocast(spellInfo, true);
|
||||||
// LOG_INFO("playerbots", "AFTER - Make spell {} for pet {} auto cast, bot: {}. active: {}. state: {}.",
|
|
||||||
// itr->first, pet->GetName(), bot->GetName(), itr->second.active, itr->second.state);
|
|
||||||
}
|
}
|
||||||
// LOG_INFO("playerbots", "AFTER, {} already auto casted.", pet->GetPetAutoSpellSize());
|
|
||||||
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerbotFactory::ClearSkills()
|
void PlayerbotFactory::ClearSkills()
|
||||||
|
|||||||
@@ -362,7 +362,6 @@ void RandomPlayerbotFactory::CreateRandomBots()
|
|||||||
uint32 count = AccountMgr::GetCharactersCount(accountId);
|
uint32 count = AccountMgr::GetCharactersCount(accountId);
|
||||||
if (count >= 10)
|
if (count >= 10)
|
||||||
{
|
{
|
||||||
totalRandomBotChars += count;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bot_creation = true;
|
bot_creation = true;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ Unit* GrindTargetValue::FindTargetForGrinding(uint32 assistCount)
|
|||||||
float distance = 0;
|
float distance = 0;
|
||||||
Unit* result = nullptr;
|
Unit* result = nullptr;
|
||||||
|
|
||||||
std::unordered_map<uint32, bool> needForQuestMap;
|
// std::unordered_map<uint32, bool> needForQuestMap;
|
||||||
|
|
||||||
for (ObjectGuid const guid : targets)
|
for (ObjectGuid const guid : targets)
|
||||||
{
|
{
|
||||||
@@ -81,13 +81,13 @@ Unit* GrindTargetValue::FindTargetForGrinding(uint32 assistCount)
|
|||||||
if (!bot->InBattleground() && (int)unit->getLevel() - (int)bot->getLevel() > 4 && !unit->GetGUID().IsPlayer())
|
if (!bot->InBattleground() && (int)unit->getLevel() - (int)bot->getLevel() > 4 && !unit->GetGUID().IsPlayer())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (needForQuestMap.find(unit->GetEntry()) == needForQuestMap.end())
|
// if (needForQuestMap.find(unit->GetEntry()) == needForQuestMap.end())
|
||||||
needForQuestMap[unit->GetEntry()] = needForQuest(unit);
|
// needForQuestMap[unit->GetEntry()] = needForQuest(unit);
|
||||||
|
|
||||||
if (!needForQuestMap[unit->GetEntry()])
|
// if (!needForQuestMap[unit->GetEntry()])
|
||||||
if ((urand(0, 100) < 75 || (context->GetValue<TravelTarget*>("travel target")->Get()->isWorking() &&
|
// if ((urand(0, 100) < 75 || (context->GetValue<TravelTarget*>("travel target")->Get()->isWorking() &&
|
||||||
context->GetValue<TravelTarget*>("travel target")->Get()->getDestination()->getName() != "GrindTravelDestination")))
|
// context->GetValue<TravelTarget*>("travel target")->Get()->getDestination()->getName() != "GrindTravelDestination")))
|
||||||
continue;
|
// continue;
|
||||||
|
|
||||||
//if (bot->InBattleground() && bot->GetDistance(unit) > 40.0f)
|
//if (bot->InBattleground() && bot->GetDistance(unit) > 40.0f)
|
||||||
//continue;
|
//continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user