druid caster form

This commit is contained in:
Yunfan Li
2023-09-05 22:11:04 +08:00
parent e69eccf071
commit 9ad8274fe8
5 changed files with 20 additions and 10 deletions

View File

@@ -2206,8 +2206,15 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell,
case SPELL_FAILED_MOVING:
case SPELL_FAILED_TRY_AGAIN:
case SPELL_CAST_OK:
case SPELL_FAILED_NOT_SHAPESHIFT:
return true;
default:
// if (!sPlayerbotAIConfig->logInGroupOnly || bot->GetGroup()) {
// if (result != SPELL_FAILED_NOT_READY && result != SPELL_CAST_OK) {
// LOG_DEBUG("playerbots", "CanCastSpell Check Failed. - target name: {}, spellid: {}, bot name: {}, result: {}",
// target->GetName(), spellid, bot->GetName(), result);
// }
// }
return false;
}
}

View File

@@ -1188,6 +1188,9 @@ void PlayerbotFactory::InitEquipment(bool incremental)
for (uint32 requiredLevel = bot->GetLevel(); requiredLevel > std::max((int32)bot->GetLevel() - delta, 0); requiredLevel--) {
for (InventoryType inventoryType : GetPossibleInventoryTypeListBySlot((EquipmentSlots)slot)) {
for (uint32 itemId : sRandomItemMgr->GetCachedEquipments(requiredLevel, inventoryType)) {
if (itemId == 46978) { // shaman earth ring totem
continue;
}
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId);
if (!proto)
continue;

View File

@@ -292,13 +292,13 @@ bool ListSpellsAction::Execute(Event event)
{
botAI->TellMasterNoFacing(i->second);
if (++count >= 50)
{
std::ostringstream msg;
msg << (spells.size() - 50) << " more...";
botAI->TellMasterNoFacing(msg.str());
break;
}
// if (++count >= 50)
// {
// std::ostringstream msg;
// msg << (spells.size() - 50) << " more...";
// botAI->TellMasterNoFacing(msg.str());
// break;
// }
}
return true;

View File

@@ -31,7 +31,7 @@ bool CastTravelFormAction::isUseful()
bool CastCasterFormAction::isUseful()
{
return botAI->HasAnyAuraOf(GetTarget(), "dire bear form", "bear form", "cat form", "travel form", "aquatic form",
"flight form", "swift flight form", "moonkin form", nullptr);
"flight form", "swift flight form", "moonkin form", nullptr) && AI_VALUE2(uint8, "mana", "self target") > sPlayerbotAIConfig->mediumHealth;
}
bool CastCasterFormAction::Execute(Event event)

View File

@@ -54,14 +54,14 @@ class GenericDruidNonCombatStrategyActionNodeFactory : public NamedObjectFactory
static ActionNode* regrowth_on_party(PlayerbotAI* ai)
{
return new ActionNode ("regrowth on party",
/*P*/ NextAction::array(0, new NextAction("caster form"), NULL),
/*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
/*A*/ NULL,
/*C*/ NULL);
}
static ActionNode* rejuvenation_on_party(PlayerbotAI* ai)
{
return new ActionNode ("rejuvenation on party",
/*P*/ NextAction::array(0, new NextAction("caster form"), NULL),
/*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
/*A*/ NULL,
/*C*/ NULL);
}