mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Estimated group dps calculation
This commit is contained in:
@@ -5178,6 +5178,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
|
||||
|
||||
@@ -469,6 +469,7 @@ public:
|
||||
void ImbueItem(Item* item);
|
||||
void EnchantItemT(uint32 spellid, uint8 slot);
|
||||
uint32 GetBuffedCount(Player* player, std::string const spellname);
|
||||
int32 GetNearGroupMemberCount(float dis = sPlayerbotAIConfig->sightDistance);
|
||||
|
||||
virtual bool CanCastSpell(std::string const name, Unit* target, Item* itemTarget = nullptr);
|
||||
virtual bool CastSpell(std::string const name, Unit* target, Item* itemTarget = nullptr);
|
||||
|
||||
@@ -31,7 +31,7 @@ float ExpectedGroupDpsValue::Calculate()
|
||||
}
|
||||
else
|
||||
{
|
||||
dps_num = group->GetMembersCount() * 0.7;
|
||||
dps_num = botAI->GetNearGroupMemberCount() * 0.7;
|
||||
}
|
||||
uint32 mixedGearScore = PlayerbotAI::GetMixedGearScore(bot, true, false, 12);
|
||||
// efficiency record based on rare gear level, is there better calculation method?
|
||||
|
||||
Reference in New Issue
Block a user