mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[12043] When GM is invisible use a transparency visual aura
Based on TC commit by DDuarte, ideas by Kretol and Aokromes Add config setting GM.InvisibleAura to configure the to be used aura Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
5060d55b05
commit
c8c6418d6e
6 changed files with 27 additions and 3 deletions
|
|
@ -33,6 +33,7 @@
|
|||
#include "MapPersistentStateMgr.h"
|
||||
#include "Mail.h"
|
||||
#include "Util.h"
|
||||
#include "SpellMgr.h"
|
||||
#ifdef _DEBUG_VMAPS
|
||||
#include "VMapFactory.h"
|
||||
#endif
|
||||
|
|
@ -231,15 +232,24 @@ bool ChatHandler::HandleGMVisibleCommand(char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
Player* player = m_session->GetPlayer();
|
||||
SpellEntry const* invisibleAuraInfo = sSpellStore.LookupEntry(sWorld.getConfig(CONFIG_UINT32_GM_INVISIBLE_AURA));
|
||||
if (!invisibleAuraInfo || !IsSpellAppliesAura(invisibleAuraInfo))
|
||||
invisibleAuraInfo = NULL;
|
||||
|
||||
if (value)
|
||||
{
|
||||
m_session->GetPlayer()->SetGMVisible(true);
|
||||
player->SetGMVisible(true);
|
||||
m_session->SendNotification(LANG_INVISIBLE_VISIBLE);
|
||||
if (invisibleAuraInfo)
|
||||
player->RemoveAurasDueToSpell(invisibleAuraInfo->Id);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_session->SendNotification(LANG_INVISIBLE_INVISIBLE);
|
||||
m_session->GetPlayer()->SetGMVisible(false);
|
||||
player->SetGMVisible(false);
|
||||
if (invisibleAuraInfo)
|
||||
player->CastSpell(player, invisibleAuraInfo, true);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue