Implement group mentoring while in raids (SoF+ only)

Note: This does not allow the raid leader to share raid leader XP
and since the raid leader doesn't gain group leadership, they can't
share that either.
This commit is contained in:
Michael Cook (mackal)
2014-10-19 17:20:07 -04:00
parent cef2aa64d9
commit a327c91bac
7 changed files with 130 additions and 12 deletions
+17 -1
View File
@@ -576,6 +576,7 @@ void Client::CompleteConnect()
if (grpID < 12){
raid->SendRaidGroupRemove(GetName(), grpID);
raid->SendRaidGroupAdd(GetName(), grpID);
raid->CheckGroupMentor(grpID, this);
if (raid->IsGroupLeader(GetName())) { // group leader same thing!
raid->UpdateGroupAAs(raid->GetGroup(this));
raid->GroupUpdate(grpID, false);
@@ -6869,10 +6870,25 @@ void Client::Handle_OP_GroupMentor(const EQApplicationPacket *app)
return;
}
GroupMentor_Struct *gms = (GroupMentor_Struct *)app->pBuffer;
gms->name[63] = '\0';
if (IsRaidGrouped()) {
Raid *raid = GetRaid();
if (!raid)
return;
uint32 group_id = raid->GetGroup(this);
if (group_id > 11)
return;
if (strlen(gms->name))
raid->SetGroupMentor(group_id, gms->percent, gms->name);
else
raid->ClearGroupMentor(group_id);
return;
}
Group *group = GetGroup();
if (!group)
return;
gms->name[63] = '\0';
if (strlen(gms->name))
group->SetGroupMentor(gms->percent, gms->name);