mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +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
|
|
@ -38,6 +38,7 @@
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
#include "ArenaTeam.h"
|
#include "ArenaTeam.h"
|
||||||
#include "Language.h"
|
#include "Language.h"
|
||||||
|
#include "SpellMgr.h"
|
||||||
|
|
||||||
// config option SkipCinematics supported values
|
// config option SkipCinematics supported values
|
||||||
enum CinematicsSkipMode
|
enum CinematicsSkipMode
|
||||||
|
|
@ -792,7 +793,12 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder *holder)
|
||||||
SendNotification(LANG_GM_ON);
|
SendNotification(LANG_GM_ON);
|
||||||
|
|
||||||
if (!pCurrChar->isGMVisible())
|
if (!pCurrChar->isGMVisible())
|
||||||
|
{
|
||||||
SendNotification(LANG_INVISIBLE_INVISIBLE);
|
SendNotification(LANG_INVISIBLE_INVISIBLE);
|
||||||
|
SpellEntry const* invisibleAuraInfo = sSpellStore.LookupEntry(sWorld.getConfig(CONFIG_UINT32_GM_INVISIBLE_AURA));
|
||||||
|
if (!invisibleAuraInfo || !IsSpellAppliesAura(invisibleAuraInfo))
|
||||||
|
pCurrChar->CastSpell(pCurrChar, invisibleAuraInfo, true);
|
||||||
|
}
|
||||||
|
|
||||||
std::string IP_str = GetRemoteAddress();
|
std::string IP_str = GetRemoteAddress();
|
||||||
sLog.outChar("Account: %d (IP: %s) Login Character:[%s] (guid: %u)",
|
sLog.outChar("Account: %d (IP: %s) Login Character:[%s] (guid: %u)",
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@
|
||||||
#include "MapPersistentStateMgr.h"
|
#include "MapPersistentStateMgr.h"
|
||||||
#include "Mail.h"
|
#include "Mail.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
|
#include "SpellMgr.h"
|
||||||
#ifdef _DEBUG_VMAPS
|
#ifdef _DEBUG_VMAPS
|
||||||
#include "VMapFactory.h"
|
#include "VMapFactory.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -231,15 +232,24 @@ bool ChatHandler::HandleGMVisibleCommand(char* args)
|
||||||
return false;
|
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)
|
if (value)
|
||||||
{
|
{
|
||||||
m_session->GetPlayer()->SetGMVisible(true);
|
player->SetGMVisible(true);
|
||||||
m_session->SendNotification(LANG_INVISIBLE_VISIBLE);
|
m_session->SendNotification(LANG_INVISIBLE_VISIBLE);
|
||||||
|
if (invisibleAuraInfo)
|
||||||
|
player->RemoveAurasDueToSpell(invisibleAuraInfo->Id);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_session->SendNotification(LANG_INVISIBLE_INVISIBLE);
|
m_session->SendNotification(LANG_INVISIBLE_INVISIBLE);
|
||||||
m_session->GetPlayer()->SetGMVisible(false);
|
player->SetGMVisible(false);
|
||||||
|
if (invisibleAuraInfo)
|
||||||
|
player->CastSpell(player, invisibleAuraInfo, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -628,6 +628,7 @@ void World::LoadConfigSettings(bool reload)
|
||||||
setConfigMinMax(CONFIG_UINT32_START_GM_LEVEL, "GM.StartLevel", 1, getConfig(CONFIG_UINT32_START_PLAYER_LEVEL), MAX_LEVEL);
|
setConfigMinMax(CONFIG_UINT32_START_GM_LEVEL, "GM.StartLevel", 1, getConfig(CONFIG_UINT32_START_PLAYER_LEVEL), MAX_LEVEL);
|
||||||
setConfig(CONFIG_BOOL_GM_LOWER_SECURITY, "GM.LowerSecurity", false);
|
setConfig(CONFIG_BOOL_GM_LOWER_SECURITY, "GM.LowerSecurity", false);
|
||||||
setConfig(CONFIG_BOOL_GM_ALLOW_ACHIEVEMENT_GAINS, "GM.AllowAchievementGain", true);
|
setConfig(CONFIG_BOOL_GM_ALLOW_ACHIEVEMENT_GAINS, "GM.AllowAchievementGain", true);
|
||||||
|
setConfig(CONFIG_UINT32_GM_INVISIBLE_AURA, "GM.InvisibleAura", 37800);
|
||||||
|
|
||||||
setConfig(CONFIG_UINT32_GROUP_VISIBILITY, "Visibility.GroupMode", 0);
|
setConfig(CONFIG_UINT32_GROUP_VISIBILITY, "Visibility.GroupMode", 0);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,7 @@ enum eConfigUInt32Values
|
||||||
CONFIG_UINT32_GM_LEVEL_IN_GM_LIST,
|
CONFIG_UINT32_GM_LEVEL_IN_GM_LIST,
|
||||||
CONFIG_UINT32_GM_LEVEL_IN_WHO_LIST,
|
CONFIG_UINT32_GM_LEVEL_IN_WHO_LIST,
|
||||||
CONFIG_UINT32_START_GM_LEVEL,
|
CONFIG_UINT32_START_GM_LEVEL,
|
||||||
|
CONFIG_UINT32_GM_INVISIBLE_AURA,
|
||||||
CONFIG_UINT32_GROUP_VISIBILITY,
|
CONFIG_UINT32_GROUP_VISIBILITY,
|
||||||
CONFIG_UINT32_MAIL_DELIVERY_DELAY,
|
CONFIG_UINT32_MAIL_DELIVERY_DELAY,
|
||||||
CONFIG_UINT32_MASS_MAILER_SEND_PER_TICK,
|
CONFIG_UINT32_MASS_MAILER_SEND_PER_TICK,
|
||||||
|
|
|
||||||
|
|
@ -1139,6 +1139,11 @@ Channel.SilentlyGMJoin = 0
|
||||||
# Default: 1 (enable)
|
# Default: 1 (enable)
|
||||||
# 0 (disable)
|
# 0 (disable)
|
||||||
#
|
#
|
||||||
|
# GM.InvisibleAura
|
||||||
|
# A spell that will be cast when a gm uses ".gm visible off" (Must be aura spell)
|
||||||
|
# Default: 37800 (50% Transparency)
|
||||||
|
# 0 (Disabled)
|
||||||
|
#
|
||||||
###################################################################################################################
|
###################################################################################################################
|
||||||
|
|
||||||
GM.LoginState = 2
|
GM.LoginState = 2
|
||||||
|
|
@ -1152,6 +1157,7 @@ GM.LogTrade = 1
|
||||||
GM.StartLevel = 1
|
GM.StartLevel = 1
|
||||||
GM.LowerSecurity = 0
|
GM.LowerSecurity = 0
|
||||||
GM.AllowAchievementGain = 1
|
GM.AllowAchievementGain = 1
|
||||||
|
GM.InvisibleAura = 37800
|
||||||
|
|
||||||
###################################################################################################################
|
###################################################################################################################
|
||||||
# VISIBILITY AND RADIUSES
|
# VISIBILITY AND RADIUSES
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "12042"
|
#define REVISION_NR "12043"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue