Visual indicator while .gm vis off

Just a simple change I made to make it more obvious when you have visibility toggled off. I probably could have edited it better and made it more uniform, but I figured it still may be useful to some folks.

Anyway, all it does is add a Transparency spell to your character when you go invisible, and then remove that aura upon going visible again.

[CODE]From 66569abc3bfacec79aa9598c2a860744a0c23062 Mon Sep 17 00:00:00 2001

From: Kretol

Date: Wed, 11 Jul 2012 16:24:12 -0700

Subject: Apply transparency effect to GMs when going invis (and remove when going visible)


src/server/scripts/Commands/cs_gm.cpp | 9 ++++++±-

1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp

index d449b36…2e29801 100644

— a/src/server/scripts/Commands/cs_gm.cpp

+++ b/src/server/scripts/Commands/cs_gm.cpp

@@ -197,10 +197,14 @@ public:

}

std::string param = (char*)args;

  • Player* gm = handler->GetSession()->GetPlayer();

if (param == “on”)

{

  • handler->GetSession()->GetPlayer()->SetGMVisible(true);
  • if(gm->HasAura(37802,0)) {

  • gm->RemoveAurasDueToSpell(37802);

  • }

  • gm->SetGMVisible(true);

handler->GetSession()->SendNotification(LANG_INVISIBLE_VISIBLE);

return true;

}

@@ -208,7 +212,8 @@ public:

if (param == “off”)

{

handler->GetSession()->SendNotification(LANG_INVISIBLE_INVISIBLE);

  • handler->GetSession()->GetPlayer()->SetGMVisible(false);
  • gm->SetGMVisible(false);

  • gm->AddAura(37802,gm);

return true;

}

1.7.10.msysgit.1

[/CODE]

Edit [7/12]: Changed the location of SetGMVisible(true) under the .gm vis on command. This is so the aura is removed before the GM goes visible so as to (theoretically) prevent people seeing the aura being removed from the character in their combat logs.

Cool idea /emoticons/default_smile.png

nice idea

beautiful

Thx. This is very beautiful

Btw, imho 37800 better, 37802 is to transparent /emoticons/default_tongue.png

Trinity’s coding guidelines recommend using defines/enums instead of magic numbers.

I’d recommend submitting this for review once the code is cleaned up etc

By popular demand and usefulness, added to the repo in https://github.com/TrinityCore/TrinityCore/commit/c32c83ed67420a90e95f433a9d71febaefd2ecfd

nice, thx =)