From 029df77dc854d855ba43c2861ad62c074d9c394e Mon Sep 17 00:00:00 2001 From: Grimfeather <88028633+Grimfeather@users.noreply.github.com> Date: Sat, 11 Oct 2025 10:31:10 +0200 Subject: [PATCH] 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. --- src/IndividualProgressionPlayer.cpp | 109 ++++++++++++++++++++++++++-- 1 file changed, 102 insertions(+), 7 deletions(-) diff --git a/src/IndividualProgressionPlayer.cpp b/src/IndividualProgressionPlayer.cpp index 4c85864..5bf2f95 100644 --- a/src/IndividualProgressionPlayer.cpp +++ b/src/IndividualProgressionPlayer.cpp @@ -38,6 +38,7 @@ public: sIndividualProgression->checkIPProgression(player); sIndividualProgression->UpdateProgressionQuests(player); } + if (isExcludedFromProgression(player)) { @@ -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") { }