mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 04:56:20 +00:00
[Feature] GM State Change Persistance (#2328)
* [Feature] GM State Change Persistance - Flymode and Invulnerable will now persist over zoning. - Appended GMSpeed, Flymode and Invulnerable to the hideme message GMs see when they first login. - Added #godmode [on/off] command to turn on or off hideme, flymode, gmspeed and invulnerable all in one shot. - /becomenpc will now disable tells to the target player. It will also automatically disable GM States that interfere with its functionality. - GM Command /toggle will not properly turn tells on/off - GMs will now be notified if they are ignoring tells when they first zone-in, provided their GM flag is up. - Added TellsOff variable to the output to #showstats * [Bug] Fix tells when gmhideme is turned off. * [Cleanup] Cleanup function and rename for consistancy. Remove un-needed this-> * Tweaks * Tweaks * Update db_update_manifest.txt * Move string building logic to a vector and use strings join * Update client_packet.cpp * Update 2022_07_28_gm_state_changes.sql * PR comment tweaks Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
@@ -24,6 +24,8 @@ void command_flymode(Client *c, const Seperator *sep)
|
||||
|
||||
target->SetFlyMode(static_cast<GravityBehavior>(flymode_id));
|
||||
target->SendAppearancePacket(AT_Levitate, flymode_id);
|
||||
uint32 account = c->AccountID();
|
||||
database.SetGMFlymode(account, flymode_id);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#include "../client.h"
|
||||
#include "../../common/repositories/account_repository.h"
|
||||
|
||||
void command_godmode(Client *c, const Seperator *sep)
|
||||
{
|
||||
bool state = atobool(sep->arg[1]);
|
||||
uint32 account_id = c->AccountID();
|
||||
|
||||
if (sep->arg[1][0] != 0) {
|
||||
auto a = AccountRepository::FindOne(database, c->AccountID());
|
||||
if (a.id > 0) {
|
||||
a.flymode = state ? 1 : 0;
|
||||
a.gmspeed = state ? 1 : 0;
|
||||
a.invulnerable = state ? 1 : 0;
|
||||
a.hideme = state ? 1 : 0;
|
||||
}
|
||||
|
||||
c->SetInvul(state);
|
||||
c->SendAppearancePacket(AT_Levitate, state);
|
||||
c->SetHideMe(state);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"Turning GodMode %s for %s (zone for gmspeed to take effect)",
|
||||
state ? "On" : "Off",
|
||||
c->GetName()
|
||||
);
|
||||
|
||||
AccountRepository::UpdateOne(database, a);
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "Usage: #godmode [on/off]");
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_invul(Client *c, const Seperator *sep)
|
||||
{
|
||||
void command_invul(Client *c, const Seperator *sep) {
|
||||
int arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Usage: #invul [On|Off]");
|
||||
@@ -15,6 +14,8 @@ void command_invul(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
target->SetInvul(invul_flag);
|
||||
uint32 account = target->AccountID();
|
||||
database.SetGMInvul(account, invul_flag);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
@@ -25,4 +26,3 @@ void command_invul(Client *c, const Seperator *sep)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user