mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Compare commits
6 Commits
ce2a990495
...
nl-saw-pat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f7b831422 | ||
|
|
4af85d3a14 | ||
|
|
f9fce01282 | ||
|
|
3577acebd4 | ||
|
|
ade388cba0 | ||
|
|
1848fb553a |
@@ -1769,80 +1769,6 @@ bool PlayerbotAI::IsCombo(Player* player)
|
||||
(player->getClass() == CLASS_DRUID && player->HasAura(768)); // cat druid
|
||||
}
|
||||
|
||||
bool PlayerbotAI::IsRangedDps(Player* player, bool bySpec) { return IsRanged(player, bySpec) && IsDps(player, bySpec); }
|
||||
|
||||
bool PlayerbotAI::IsHealAssistantOfIndex(Player* player, int index)
|
||||
{
|
||||
Group* group = player->GetGroup();
|
||||
if (!group)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int counter = 0;
|
||||
|
||||
for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next())
|
||||
{
|
||||
Player* member = ref->GetSource();
|
||||
|
||||
if (!member)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IsHeal(member)) // Check if the member is a healer
|
||||
{
|
||||
bool isAssistant = group->IsAssistant(member->GetGUID());
|
||||
|
||||
// Check if the index matches for both assistant and non-assistant healers
|
||||
if ((isAssistant && index == counter) || (!isAssistant && index == counter))
|
||||
{
|
||||
return player == member;
|
||||
}
|
||||
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PlayerbotAI::IsRangedDpsAssistantOfIndex(Player* player, int index)
|
||||
{
|
||||
Group* group = player->GetGroup();
|
||||
if (!group)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int counter = 0;
|
||||
|
||||
for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next())
|
||||
{
|
||||
Player* member = ref->GetSource();
|
||||
|
||||
if (!member)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IsRangedDps(member)) // Check if the member is a ranged DPS
|
||||
{
|
||||
bool isAssistant = group->IsAssistant(member->GetGUID());
|
||||
|
||||
// Check the index for both assistant and non-assistant ranges
|
||||
if ((isAssistant && index == counter) || (!isAssistant && index == counter))
|
||||
{
|
||||
return player == member;
|
||||
}
|
||||
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PlayerbotAI::HasAggro(Unit* unit)
|
||||
{
|
||||
if (!unit)
|
||||
@@ -2186,7 +2112,6 @@ bool PlayerbotAI::IsMainTank(Player* player)
|
||||
}
|
||||
|
||||
ObjectGuid mainTank = ObjectGuid();
|
||||
Group::MemberSlotList const& slots = group->GetMemberSlots();
|
||||
|
||||
for (Group::member_citerator itr = slots.begin(); itr != slots.end(); ++itr)
|
||||
{
|
||||
@@ -2298,50 +2223,109 @@ uint32 PlayerbotAI::GetGroupTankNum(Player* player)
|
||||
return result;
|
||||
}
|
||||
|
||||
bool PlayerbotAI::IsHealAssistantOfIndex(Player* player, int index)
|
||||
{
|
||||
Group* group = player->GetGroup();
|
||||
if (!group)
|
||||
return false;
|
||||
|
||||
Group::MemberSlotList const& slots = group->GetMemberSlots();
|
||||
int counter = 0;
|
||||
|
||||
for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next())
|
||||
{
|
||||
Player* member = ref->GetSource();
|
||||
if (member && group->IsAssistant(member->GetGUID()) && IsHeal(member))
|
||||
{
|
||||
if (index == counter)
|
||||
return player == member;
|
||||
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
// Non-assistants
|
||||
for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next())
|
||||
{
|
||||
Player* member = ref->GetSource();
|
||||
if (member && !group->IsAssistant(member->GetGUID()) && IsHeal(member))
|
||||
{
|
||||
if (index == counter)
|
||||
return player == member;
|
||||
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PlayerbotAI::IsRangedDps(Player* player, bool bySpec) { return IsRanged(player, bySpec) && IsDps(player, bySpec); }
|
||||
|
||||
bool PlayerbotAI::IsRangedDpsAssistantOfIndex(Player* player, int index)
|
||||
{
|
||||
Group* group = player->GetGroup();
|
||||
if (!group)
|
||||
return false;
|
||||
|
||||
Group::MemberSlotList const& slots = group->GetMemberSlots();
|
||||
int counter = 0;
|
||||
|
||||
for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next())
|
||||
{
|
||||
Player* member = ref->GetSource();
|
||||
if (member && group->IsAssistant(member->GetGUID()) && IsRangedDps(member))
|
||||
{
|
||||
if (index == counter)
|
||||
return player == member;
|
||||
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
// Non-assistants
|
||||
for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next())
|
||||
{
|
||||
Player* member = ref->GetSource();
|
||||
if (member && !group->IsAssistant(member->GetGUID()) && IsRangedDps(member))
|
||||
{
|
||||
if (index == counter)
|
||||
return player == member;
|
||||
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PlayerbotAI::IsAssistTank(Player* player) { return IsTank(player) && !IsMainTank(player); }
|
||||
|
||||
bool PlayerbotAI::IsAssistTankOfIndex(Player* player, int index)
|
||||
{
|
||||
Group* group = player->GetGroup();
|
||||
if (!group)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Group::MemberSlotList const& slots = group->GetMemberSlots();
|
||||
int counter = 0;
|
||||
|
||||
for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next())
|
||||
{
|
||||
Player* member = ref->GetSource();
|
||||
|
||||
if (!member)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (group->IsAssistant(member->GetGUID()) && IsAssistTank(member))
|
||||
if (member && group->IsAssistant(member->GetGUID()) && IsAssistTank(member))
|
||||
{
|
||||
if (index == counter)
|
||||
{
|
||||
return player == member;
|
||||
}
|
||||
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
// not enough
|
||||
// Non-assistants
|
||||
for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next())
|
||||
{
|
||||
Player* member = ref->GetSource();
|
||||
|
||||
if (!member)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!group->IsAssistant(member->GetGUID()) && IsAssistTank(member))
|
||||
if (member && !group->IsAssistant(member->GetGUID()) && IsAssistTank(member))
|
||||
{
|
||||
if (index == counter)
|
||||
{
|
||||
return player == member;
|
||||
}
|
||||
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user