Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::list<WorldObject*> tankList;
- std::list<WorldObject*> healerList;
- std::list<WorldObject*> dpsList;
- for (auto const& target : targets)
- {
- if (auto player = target->ToPlayer())
- {
- if (player->isInTankSpec())
- tankList.push_back(target);
- else if (player->GetSpecializationRole() == ROLES_HEALER)
- healerList.push_back(target);
- else
- dpsList.push_back(target);
- }
- }
- targets.clear();
- Trinity::Containers::RandomResizeList(tankList, 1);
- Trinity::Containers::RandomResizeList(healerList, 1);
- uint8 resizeCount = 5;
- if (!tankList.empty())
- --resizeCount;
- if (!healerList.empty())
- --resizeCount;
- if (!dpsList.empty())
- Trinity::Containers::RandomResizeList(dpsList, resizeCount);
- targets.splice(targets.end(), tankList);
- targets.splice(targets.end(), healerList);
- targets.splice(targets.end(), dpsList);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement