mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Group repair command attempt (#26304)
* Group repair command attempt * Update cs_group.cpp
This commit is contained in:
@@ -61,6 +61,7 @@ public:
|
||||
{ "list", rbac::RBAC_PERM_COMMAND_GROUP_LIST, false, &HandleGroupListCommand, "" },
|
||||
{ "summon", rbac::RBAC_PERM_COMMAND_GROUP_SUMMON, false, &HandleGroupSummonCommand, "" },
|
||||
{ "revive", rbac::RBAC_PERM_COMMAND_REVIVE, true, &HandleGroupReviveCommand, "" },
|
||||
{ "repair", rbac::RBAC_PERM_COMMAND_REPAIRITEMS, true, &HandleGroupRepairCommand, "" },
|
||||
{ "level", rbac::RBAC_PERM_COMMAND_CHARACTER_LEVEL, true, &HandleGroupLevelCommand, "" }
|
||||
};
|
||||
|
||||
@@ -139,6 +140,30 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
// Repair group of players
|
||||
static bool HandleGroupRepairCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
Player* playerTarget;
|
||||
ObjectGuid playerTargetGuid;
|
||||
if (!handler->extractPlayerTarget((char*)args, &playerTarget, &playerTargetGuid))
|
||||
return false;
|
||||
|
||||
Group* groupTarget = playerTarget->GetGroup();
|
||||
if (!groupTarget)
|
||||
return false;
|
||||
|
||||
for (GroupReference* it = groupTarget->GetFirstMember(); it != nullptr; it = it->next())
|
||||
{
|
||||
Player* target = it->GetSource();
|
||||
if (target)
|
||||
{
|
||||
target->DurabilityRepairAll(false, 0, false);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Summon group of player
|
||||
static bool HandleGroupSummonCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user