Group Invite Restrictions (#803)

- with enforceGroupRules set to 1 there are now several restriction on who you can invite
- with enforceGroupRules set to 0 you can invite anyone and everyone.
This commit is contained in:
Grimfeather
2025-10-11 10:31:10 +02:00
committed by GitHub
parent 67f9235309
commit 029df77dc8

View File

@@ -39,6 +39,7 @@ public:
sIndividualProgression->UpdateProgressionQuests(player);
}
if (isExcludedFromProgression(player))
{
sIndividualProgression->UpdateProgressionState(player, static_cast<ProgressionState>(0));
@@ -315,19 +316,114 @@ public:
uint8 currentState = player->GetPlayerSetting("mod-individual-progression", SETTING_PROGRESSION_STATE).value;
uint8 otherPlayerState = otherPlayer->GetPlayerSetting("mod-individual-progression", SETTING_PROGRESSION_STATE).value;
if (!sIndividualProgression->enabled || !sIndividualProgression->enforceGroupRules || isExcludedFromProgression(player))
if (!sIndividualProgression->enabled)
{
return true;
}
if (sIndividualProgression->enforceGroupRules && (currentState != otherPlayerState))
if (sIndividualProgression->enforceGroupRules) // enforceGroupRules enabled
{
ChatHandler(player->GetSession()).SendSysMessage("|cff00ff00Unable to invite this player, because Enforce Group Rules is enabled.|r");
if (!isExcludedFromProgression(player)) // player has a normal account
{
if (isExcludedFromProgression(otherPlayer)) // RNDbot
{
if (!sIndividualProgression->hasPassedProgression(player, PROGRESSION_PRE_TBC)) // player is in vanilla
{
if (otherPlayer->GetLevel() <= IP_LEVEL_VANILLA)
{
return true;
}
else
{
ChatHandler(player->GetSession()).SendSysMessage("|cff00ff00Enforce Group Rules is enabled: |cffccccccthis player's level is too high.|r");
return false;
}
}
else if (!sIndividualProgression->hasPassedProgression(player, PROGRESSION_TBC_TIER_5)) // player is in TBC
{
if ((otherPlayer->GetLevel() > IP_LEVEL_VANILLA) && (otherPlayer->GetLevel() <= IP_LEVEL_TBC))
{
return true;
}
else
{
ChatHandler(player->GetSession()).SendSysMessage("|cff00ff00Enforce Group Rules is enabled: |cffccccccthis player's level is too low or too high.|r");
return false;
}
}
else // player is in WotLK
{
if (otherPlayer->GetLevel() > IP_LEVEL_TBC)
{
return true;
}
else
{
ChatHandler(player->GetSession()).SendSysMessage("|cff00ff00Enforce Group Rules is enabled: |cffccccccthis player's level is too low.|r");
return false;
}
}
}
else // player or ALTbot
{
return (currentState == otherPlayerState);
}
}
else // player has an excluded account
{
if (isExcludedFromProgression(otherPlayer)) // RNDbot
{
if (player->GetLevel() <= IP_LEVEL_VANILLA) // player is in vanilla
{
if (otherPlayer->GetLevel() <= IP_LEVEL_VANILLA)
{
return true;
}
else
{
ChatHandler(player->GetSession()).SendSysMessage("|cff00ff00Enforce Group Rules is enabled: |cffccccccthis player's level is too high.|r");
return false;
}
}
else if (player->GetLevel() <= IP_LEVEL_TBC) // player is in TBC
{
if ((otherPlayer->GetLevel() > IP_LEVEL_VANILLA) && (otherPlayer->GetLevel() <= IP_LEVEL_TBC))
{
return true;
}
else
{
ChatHandler(player->GetSession()).SendSysMessage("|cff00ff00Enforce Group Rules is enabled: |cffccccccthis player's level is too low or too high.|r");
return false;
}
}
else // player is in WotLK
{
if (otherPlayer->GetLevel() > IP_LEVEL_TBC)
{
return true;
}
else
{
ChatHandler(player->GetSession()).SendSysMessage("|cff00ff00Enforce Group Rules is enabled: |cffccccccthis player's level is too low.|r");
return false;
}
}
}
else // player or ALTbot
{
ChatHandler(player->GetSession()).SendSysMessage("|cff00ff00Enforce Group Rules is enabled: |cffccccccthis player does not have an excluded account.|r");
return false;
}
}
}
else // enforceGroupRules not enabled
{
return true;
}
return (currentState == otherPlayerState);
}
bool OnPlayerCanGroupAccept(Player* player, Group* group) override
{
Player* groupLeader = ObjectAccessor::FindPlayerByLowGUID(group->GetLeaderGUID().GetCounter());
@@ -1257,7 +1353,6 @@ public:
class IndividualPlayerProgression_UnitScript : public UnitScript
{
public:
IndividualPlayerProgression_UnitScript() : UnitScript("IndividualPlayerProgression_UnitScript") { }