mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Fix crash:
PlayerbotAI::FindOilFor was making the server randomly crashing ChooseTravelTargetAction::getNewTarget: when active bot groupping was making the server crash as looking for unexisting params Several bug fixes and tweak to Quest and Group New fucntionnality: Bots will now share quests randomly to their party Bots will try to accomplish group member quest before moving on to new target Bots will try to sells items only after few levels ( 5 ) when in group When dropping a quest bots will try to select a new one they are on instead of idling for few time Bots will no longuer try to invite themselfs to group or if group is full Bots are now allowed to leave party by themself Bots in groupe if not leader are forbbiden to tag in bgs Bots in bot-groups no have a more limited range to look for grind target Polish logs
This commit is contained in:
@@ -4220,12 +4220,12 @@ Item* PlayerbotAI::FindStoneFor(Item* weapon) const
|
||||
return stone;
|
||||
}
|
||||
|
||||
static const uint32 uPriorizedWizardOilIds[5] =
|
||||
static const std::vector<WizardOilDisplayId> uPriorizedWizardOilIds =
|
||||
{
|
||||
MINOR_WIZARD_OIL, LESSER_WIZARD_OIL, BRILLIANT_WIZARD_OIL, WIZARD_OIL, SUPERIOR_WIZARD_OIL
|
||||
};
|
||||
|
||||
static const uint32 uPriorizedManaOilIds[4] =
|
||||
static const std::vector<ManaOilDisplayId> uPriorizedManaOilIds =
|
||||
{
|
||||
MINOR_MANA_OIL, LESSER_MANA_OIL, BRILLIANT_MANA_OIL, SUPERIOR_MANA_OIL,
|
||||
};
|
||||
@@ -4236,26 +4236,26 @@ Item* PlayerbotAI::FindOilFor(Item* weapon) const
|
||||
ItemTemplate const* pProto = weapon->GetTemplate();
|
||||
if (pProto && (pProto->SubClass == ITEM_SUBCLASS_WEAPON_SWORD || pProto->SubClass == ITEM_SUBCLASS_WEAPON_STAFF || pProto->SubClass == ITEM_SUBCLASS_WEAPON_DAGGER))
|
||||
{
|
||||
for (uint8 i = 0; i < std::size(uPriorizedWizardOilIds); ++i)
|
||||
for (const auto& id : uPriorizedWizardOilIds)
|
||||
{
|
||||
oil = FindConsumable(uPriorizedWizardOilIds[i]);
|
||||
oil = FindConsumable(uPriorizedWizardOilIds[id]);
|
||||
if (!oil)
|
||||
oil = FindConsumable(uPriorizedManaOilIds[i]);
|
||||
oil = FindConsumable(uPriorizedManaOilIds[id]);
|
||||
|
||||
if (oil)
|
||||
return oil;
|
||||
return oil;
|
||||
}
|
||||
}
|
||||
else if (pProto && (pProto->SubClass == ITEM_SUBCLASS_WEAPON_MACE || pProto->SubClass == ITEM_SUBCLASS_WEAPON_MACE2))
|
||||
{
|
||||
for (uint8 i = 0; i < std::size(uPriorizedManaOilIds); ++i)
|
||||
for (const auto& id : uPriorizedManaOilIds)
|
||||
{
|
||||
oil = FindConsumable(uPriorizedManaOilIds[i]);
|
||||
oil = FindConsumable(uPriorizedManaOilIds[id]);
|
||||
if (!oil)
|
||||
oil = FindConsumable(uPriorizedWizardOilIds[i]);
|
||||
oil = FindConsumable(uPriorizedWizardOilIds[id]);
|
||||
|
||||
if (oil)
|
||||
return oil;
|
||||
return oil;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4741,3 +4741,11 @@ uint8 PlayerbotAI::FindEquipSlot(ItemTemplate const* proto, uint32 slot, bool sw
|
||||
// no free position
|
||||
return NULL_SLOT;
|
||||
}
|
||||
bool PlayerbotAI::IsSafe(Player* player)
|
||||
{
|
||||
return player && player->GetMapId() == bot->GetMapId() && player->GetInstanceId() == bot->GetInstanceId() && !player->IsBeingTeleported();
|
||||
}
|
||||
bool PlayerbotAI::IsSafe(WorldObject* obj)
|
||||
{
|
||||
return obj && obj->GetMapId() == bot->GetMapId() && obj->GetInstanceId() == bot->GetInstanceId() && (!obj->IsPlayer() || !((Player*)obj)->IsBeingTeleported());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user