[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
+28 -15
View File
@@ -1159,10 +1159,10 @@ void Corpse::MakeLootRequestPackets(Client *c, const EQApplicationPacket *app)
if (c->GetGM()) {
if (c->Admin() >= AccountStatus::GMAdmin) {
m_loot_request_type = LootRequestType::GMAllowed;
}
else {
c->Message(Chat::White, "Your GM Status allows you to loot any items on this corpse.");
} else {
m_loot_request_type = LootRequestType::GMPeek;
c->Message(Chat::White, "Your GM Flag allows you to look at the items on this corpse.");
}
}
else {
@@ -1615,14 +1615,21 @@ void Corpse::LootCorpseItem(Client *c, const EQApplicationPacket *app)
// safe to ACK now
c->QueuePacket(app);
if (
!IsPlayerCorpse() &&
RuleB(Character, EnableDiscoveredItems) &&
c &&
!c->GetGM() &&
!c->IsDiscovered(inst->GetItem()->ID)
) {
c->DiscoverItem(inst->GetItem()->ID);
if (!IsPlayerCorpse()) {
if (RuleB(Character, EnableDiscoveredItems) && c && !c->IsDiscovered(inst->GetItem()->ID)) {
if (!c->GetGM()) {
c->DiscoverItem(inst->GetItem()->ID);
} else {
const std::string& item_link = database.CreateItemLink(inst->GetItem()->ID);
c->Message(
Chat::White,
fmt::format(
"Your GM Flag prevents {} from being added to discovered items.",
item_link
).c_str()
);
}
}
}
if (zone->adv_data) {
@@ -2287,10 +2294,14 @@ void Corpse::CastRezz(uint16 spell_id, Mob *caster)
// Rez timer has expired, only GMs can rez at this point. (uses rezzable)
if (!IsRezzable()) {
if (caster && caster->IsClient() && !caster->CastToClient()->GetGM()) {
caster->MessageString(Chat::White, REZZ_ALREADY_PENDING);
caster->MessageString(Chat::White, CORPSE_TOO_OLD);
return;
if (caster && caster->IsClient()) {
if (!caster->CastToClient()->GetGM()) {
caster->MessageString(Chat::White, REZZ_ALREADY_PENDING);
caster->MessageString(Chat::White, CORPSE_TOO_OLD);
return;
}
caster->Message(Chat::White, "Your GM Flag allows you to resurrect this corpse.");
}
}
@@ -2302,6 +2313,8 @@ void Corpse::CastRezz(uint16 spell_id, Mob *caster)
if (c->GetGM()) {
m_rezzed_experience = m_gm_rezzed_experience;
m_gm_rezzed_experience = 0;
c->Message(Chat::White, "Your GM Flag allows you to resurrect this corpse and return experience.");
}
}
}