Enable gaining of group leadership while in raids

Note: raid leaders can only gain raid leadership, so they won't
ever gain group leadership while leading a raid, even if they don't
end up gaining group due to the restrictions.

From what I can tell, this should be in line with live
This commit is contained in:
Michael Cook (mackal) 2014-10-18 13:27:33 -04:00
parent e8eb774458
commit 3f056462d6
3 changed files with 45 additions and 20 deletions

View File

@ -2,6 +2,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50)
-------------------------------------------------------
== 10/18/2014==
demonstar55: Implement group mentor, sharing leadership exp (SoF+ only)
demonstar55: Add gaining of group leadership while in raids
== 10/16/2014 ==
Uleat: Fixed the auto-conversion view naming error and renamed the views in the script files. Added a fix sql for databases that auto-converted.

View File

@ -4256,12 +4256,28 @@ bool Client::IsLeadershipEXPOn() {
Group *g = GetGroup();
if(g && g->IsLeader(this) && (g->GroupCount() > 2))
if (g && g->IsLeader(this) && g->GroupCount() > 2)
return true;
Raid *r = GetRaid();
if(r && r->IsLeader(this) && (r->RaidCount() > 17))
if (!r)
return false;
// raid leaders can only gain raid AA XP
if (r->IsLeader(this)) {
if (r->RaidCount() > 17)
return true;
else
return false;
}
uint32 gid = r->GetGroup(this);
if (gid > 11) // not in a group
return false;
if (r->IsGroupLeader(GetName()) && r->GroupCount(gid) > 2)
return true;
return false;

View File

@ -133,14 +133,12 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) {
}
}
if(IsLeadershipEXPOn() && (conlevel == CON_BLUE || conlevel == CON_WHITE || conlevel == CON_YELLOW || conlevel == CON_RED)) {
if (IsLeadershipEXPOn() && (conlevel == CON_BLUE || conlevel == CON_WHITE || conlevel == CON_YELLOW || conlevel == CON_RED)) {
add_exp = static_cast<uint32>(static_cast<float>(add_exp) * 0.8f);
if(GetGroup())
{
if((m_pp.group_leadership_points < MaxBankedGroupLeadershipPoints(GetLevel()))
&& (RuleI(Character, KillsPerGroupLeadershipAA) > 0))
{
if (GetGroup()) {
if (m_pp.group_leadership_points < MaxBankedGroupLeadershipPoints(GetLevel())
&& RuleI(Character, KillsPerGroupLeadershipAA) > 0) {
uint32 exp = GROUP_EXP_PER_POINT / RuleI(Character, KillsPerGroupLeadershipAA);
Client *mentoree = GetGroup()->GetMentoree();
if (GetGroup()->GetMentorPercent() && mentoree &&
@ -154,20 +152,30 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) {
AddLeadershipEXP(exp, 0); // ends up rounded up if mentored, no idea how live actually does it
Message_StringID(MT_Leadership, GAIN_GROUP_LEADERSHIP_EXP);
}
}
else
} else {
Message_StringID(MT_Leadership, MAX_GROUP_LEADERSHIP_POINTS);
}
else
{
if((m_pp.raid_leadership_points < MaxBankedRaidLeadershipPoints(GetLevel()))
&& (RuleI(Character, KillsPerRaidLeadershipAA) > 0))
{
AddLeadershipEXP(0, RAID_EXP_PER_POINT / RuleI(Character, KillsPerRaidLeadershipAA));
Message_StringID(MT_Leadership, GAIN_RAID_LEADERSHIP_EXP);
}
else
Message_StringID(MT_Leadership, MAX_RAID_LEADERSHIP_POINTS);
} else {
Raid *raid = GetRaid();
// Raid leaders CAN NOT gain group AA XP, other group leaders can though!
if (raid->IsLeader(this)) {
if (m_pp.raid_leadership_points < MaxBankedRaidLeadershipPoints(GetLevel())
&& RuleI(Character, KillsPerRaidLeadershipAA) > 0) {
AddLeadershipEXP(0, RAID_EXP_PER_POINT / RuleI(Character, KillsPerRaidLeadershipAA));
Message_StringID(MT_Leadership, GAIN_RAID_LEADERSHIP_EXP);
} else {
Message_StringID(MT_Leadership, MAX_RAID_LEADERSHIP_POINTS);
}
} else {
if (m_pp.group_leadership_points < MaxBankedGroupLeadershipPoints(GetLevel())
&& RuleI(Character, KillsPerGroupLeadershipAA) > 0) {
// mentoring stuff needs to be added here when raids are have support for it
AddLeadershipEXP(0, GROUP_EXP_PER_POINT / RuleI(Character, KillsPerGroupLeadershipAA));
Message_StringID(MT_Leadership, GAIN_GROUP_LEADERSHIP_EXP);
} else {
Message_StringID(MT_Leadership, MAX_GROUP_LEADERSHIP_POINTS);
}
}
}
}