mirror of
https://github.com/ZhengPeiRu21/mod-individual-progression
synced 2025-11-29 23:44:51 +08:00
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:
@@ -38,6 +38,7 @@ public:
|
|||||||
sIndividualProgression->checkIPProgression(player);
|
sIndividualProgression->checkIPProgression(player);
|
||||||
sIndividualProgression->UpdateProgressionQuests(player);
|
sIndividualProgression->UpdateProgressionQuests(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (isExcludedFromProgression(player))
|
if (isExcludedFromProgression(player))
|
||||||
{
|
{
|
||||||
@@ -315,19 +316,114 @@ public:
|
|||||||
uint8 currentState = player->GetPlayerSetting("mod-individual-progression", SETTING_PROGRESSION_STATE).value;
|
uint8 currentState = player->GetPlayerSetting("mod-individual-progression", SETTING_PROGRESSION_STATE).value;
|
||||||
uint8 otherPlayerState = otherPlayer->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;
|
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
|
bool OnPlayerCanGroupAccept(Player* player, Group* group) override
|
||||||
{
|
{
|
||||||
Player* groupLeader = ObjectAccessor::FindPlayerByLowGUID(group->GetLeaderGUID().GetCounter());
|
Player* groupLeader = ObjectAccessor::FindPlayerByLowGUID(group->GetLeaderGUID().GetCounter());
|
||||||
@@ -1257,7 +1353,6 @@ public:
|
|||||||
|
|
||||||
class IndividualPlayerProgression_UnitScript : public UnitScript
|
class IndividualPlayerProgression_UnitScript : public UnitScript
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IndividualPlayerProgression_UnitScript() : UnitScript("IndividualPlayerProgression_UnitScript") { }
|
IndividualPlayerProgression_UnitScript() : UnitScript("IndividualPlayerProgression_UnitScript") { }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user