Core/Dungeon Finder: Simplify Spell Luck of the draw code
Core/Dungeon Finder: Partial recode of "group list" using existing Lfg functions
This commit is contained in:
1 parent
ffb4c63fe3
commit
f753c989f2
5 files changed
+77
-55
No files matched your search
@@ -33,7 +33,7 @@
|
||||
#include "ace/INET_Addr.h"
|
||||
#include "Player.h"
|
||||
#include "Pet.h"
|
||||
#include "LFG.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "GroupMgr.h"
|
||||
|
||||
class misc_commandscript : public CommandScript
|
||||
@@ -2834,41 +2834,40 @@ public:
|
||||
{
|
||||
handler->PSendSysMessage(LANG_GROUP_TYPE, (groupTarget->isRaidGroup() ? "raid" : "party"));
|
||||
Group::MemberSlotList const& members = groupTarget->GetMemberSlots();
|
||||
Group::MemberSlotList::const_iterator itr;
|
||||
for (itr = members.begin(); itr != members.end(); ++itr)
|
||||
for (Group::MemberSlotList::const_iterator itr = members.begin(); itr != members.end(); ++itr)
|
||||
{
|
||||
std::ostringstream flags, roles;
|
||||
if ((*itr).flags & MEMBER_FLAG_ASSISTANT)
|
||||
flags << "Assistant ";
|
||||
if ((*itr).flags & MEMBER_FLAG_MAINTANK)
|
||||
flags << "MainTank ";
|
||||
if ((*itr).flags & MEMBER_FLAG_MAINASSIST)
|
||||
flags << "MainAssist ";
|
||||
Group::MemberSlot const& slot = *itr;
|
||||
|
||||
if ((*itr).roles & PLAYER_ROLE_LEADER)
|
||||
roles << "Leader ";
|
||||
if ((*itr).roles & PLAYER_ROLE_TANK)
|
||||
roles << "Tank ";
|
||||
if ((*itr).roles & PLAYER_ROLE_HEALER)
|
||||
roles << "Healer ";
|
||||
if ((*itr).roles & PLAYER_ROLE_DAMAGE)
|
||||
roles << "Damage ";
|
||||
std::string flags;
|
||||
if (slot.flags & MEMBER_FLAG_ASSISTANT)
|
||||
flags = "Assistant";
|
||||
|
||||
if (slot.flags & MEMBER_FLAG_MAINTANK)
|
||||
{
|
||||
if (!flags.empty())
|
||||
flags.append(", ");
|
||||
flags.append("MainTank");
|
||||
}
|
||||
|
||||
if (slot.flags & MEMBER_FLAG_MAINASSIST)
|
||||
{
|
||||
if (!flags.empty())
|
||||
flags.append(", ");
|
||||
flags.append("MainAssist");
|
||||
}
|
||||
|
||||
if (flags.empty())
|
||||
flags = "None";
|
||||
|
||||
Player* p = ObjectAccessor::FindPlayer((*itr).guid);
|
||||
const char* onlineState = (p && p->IsInWorld()) ? "online" : "offline";
|
||||
|
||||
std::string flagsStr = (flags.str().empty()) ? "None" : flags.str();
|
||||
std::string rolesStr = (roles.str().empty()) ? "None" : roles.str();
|
||||
|
||||
handler->PSendSysMessage(LANG_GROUP_PLAYER_NAME_GUID, (*itr).name.c_str(), onlineState, GUID_LOPART((*itr).guid), flagsStr.c_str(), rolesStr.c_str());
|
||||
handler->PSendSysMessage(LANG_GROUP_PLAYER_NAME_GUID, slot.name.c_str(), onlineState,
|
||||
GUID_LOPART(slot.guid), flags.c_str(), LFGMgr::GetRolesString(slot.roles).c_str());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
handler->PSendSysMessage(LANG_GROUP_NOT_IN_GROUP, nameTarget.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user