[Messages] Add GM Status and Invulnerability Messages (#4266)

* [Messages] Add GM Status and Invulnerability Messages

* Update zoning.cpp

* Finalize.

* Update corpse.cpp

* Update message

---------

Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
Alex King
2024-05-04 19:07:17 -04:00
committed by GitHub
parent 34c27ebb2a
commit aa0e53f5fc
16 changed files with 364 additions and 149 deletions
+17 -13
View File
@@ -373,8 +373,8 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
}
if (content_service.GetCurrentExpansion() >= Expansion::Classic && GetGM()) {
LogInfo("[{}] Bypassing Expansion zone checks because GM status is set", GetCleanName());
Message(Chat::Yellow, "Bypassing Expansion zone checks because GM status is set");
LogInfo("[{}] Bypassing zone expansion checks because GM Flag is set", GetCleanName());
Message(Chat::White, "Your GM Flag allows you to bypass zone expansion checks.");
}
if (zoning_message == ZoningMessage::ZoneSuccess) {
@@ -1369,7 +1369,7 @@ bool Client::CanEnterZone(const std::string& zone_short_name, int16 instance_ver
return false;
}
if (GetLevel() < z->min_level) {
if (!GetGM() && GetLevel() < z->min_level) {
LogInfo(
"Character [{}] does not meet minimum level requirement ([{}] < [{}])!",
GetCleanName(),
@@ -1379,7 +1379,7 @@ bool Client::CanEnterZone(const std::string& zone_short_name, int16 instance_ver
return false;
}
if (GetLevel() > z->max_level) {
if (!GetGM() && GetLevel() > z->max_level) {
LogInfo(
"Character [{}] does not meet maximum level requirement ([{}] > [{}])!",
GetCleanName(),
@@ -1399,15 +1399,19 @@ bool Client::CanEnterZone(const std::string& zone_short_name, int16 instance_ver
return false;
}
if (!z->flag_needed.empty() && Strings::IsNumber(z->flag_needed) && Strings::ToBool(z->flag_needed)) {
if (!GetGM() && !HasZoneFlag(z->zoneidnumber)) {
LogInfo(
"Character [{}] does not have the flag to be in this zone [{}]!",
GetCleanName(),
z->flag_needed
);
return false;
}
if (
!GetGM() &&
!z->flag_needed.empty() &&
Strings::IsNumber(z->flag_needed) &&
Strings::ToBool(z->flag_needed) &&
!HasZoneFlag(z->zoneidnumber)
) {
LogInfo(
"Character [{}] does not have the flag to be in this zone [{}]!",
GetCleanName(),
z->flag_needed
);
return false;
}
return true;