Merge pull request #502 from liyunfan1223/druid-cat

Improve druid cat spec
This commit is contained in:
Yunfan Li
2024-09-01 21:51:14 +08:00
committed by GitHub
42 changed files with 497 additions and 234 deletions

View File

@@ -2001,6 +2001,10 @@ bool PlayerbotAI::IsDps(Player* player)
{
return true;
}
if (tab == DRUID_TAB_FERAL && !IsTank(player))
{
return true;
}
break;
case CLASS_SHAMAN:
if (tab != SHAMAN_TAB_RESTORATION)
@@ -2795,8 +2799,8 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell,
}
uint32 CastingTime = !spellInfo->IsChanneled() ? spellInfo->CalcCastTime(bot) : spellInfo->GetDuration();
bool interruptOnMove = spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT;
if ((CastingTime || interruptOnMove) && bot->isMoving())
// bool interruptOnMove = spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT;
if ((CastingTime || spellInfo->IsAutoRepeatRangedSpell()) && bot->isMoving())
{
if (!sPlayerbotAIConfig->logInGroupOnly || (bot->GetGroup() && HasRealPlayerMaster()))
{
@@ -5177,6 +5181,32 @@ uint32 PlayerbotAI::GetBuffedCount(Player* player, std::string const spellname)
return bcount;
}
int32 PlayerbotAI::GetNearGroupMemberCount(float dis)
{
int count = 1; // yourself
if (Group* group = bot->GetGroup())
{
for (GroupReference* gref = group->GetFirstMember(); gref; gref = gref->next())
{
Player* member = gref->GetSource();
if (member == bot) // calculated
continue;
if (!member || !member->IsInWorld())
continue;
if (member->GetMapId() != bot->GetMapId())
continue;
if (member->GetExactDist(bot) > dis)
continue;
count++;
}
}
return count;
}
bool PlayerbotAI::CanMove()
{
// do not allow if not vehicle driver