Make GM max speed customisable through mangosd.conf (#89)

To complete this update be sure to apply DB Update : Rel21_16_052_Commands_help_for_custom_gm_speed.sql
This commit is contained in:
Elmsroth 2020-05-10 01:45:10 +02:00 committed by GitHub
parent e387af0884
commit ab99ea5c71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 4 deletions

View File

@ -1073,7 +1073,7 @@ bool ChatHandler::HandleModifyASpeedCommand(char* args)
float modSpeed = (float)atof(args);
if (modSpeed > 10 || modSpeed < 0.1)
if (modSpeed > sWorld.getConfig(CONFIG_UINT32_GM_MAX_SPEED_FACTOR) || modSpeed < 0.1)
{
SendSysMessage(LANG_BAD_VALUE);
SetSentErrorMessage(true);
@ -1126,7 +1126,7 @@ bool ChatHandler::HandleModifySpeedCommand(char* args)
float modSpeed = (float)atof(args);
if (modSpeed > 10 || modSpeed < 0.1)
if (modSpeed > sWorld.getConfig(CONFIG_UINT32_GM_MAX_SPEED_FACTOR) || modSpeed < 0.1)
{
SendSysMessage(LANG_BAD_VALUE);
SetSentErrorMessage(true);
@ -1177,7 +1177,7 @@ bool ChatHandler::HandleModifySwimCommand(char* args)
float modSpeed = (float)atof(args);
if (modSpeed > 10.0f || modSpeed < 0.01f)
if (modSpeed > sWorld.getConfig(CONFIG_UINT32_GM_MAX_SPEED_FACTOR) || modSpeed < 0.01f)
{
SendSysMessage(LANG_BAD_VALUE);
SetSentErrorMessage(true);
@ -1228,7 +1228,7 @@ bool ChatHandler::HandleModifyBWalkCommand(char* args)
float modSpeed = (float)atof(args);
if (modSpeed > 10.0f || modSpeed < 0.1f)
if (modSpeed > sWorld.getConfig(CONFIG_UINT32_GM_MAX_SPEED_FACTOR) || modSpeed < 0.1f)
{
SendSysMessage(LANG_BAD_VALUE);
SetSentErrorMessage(true);

View File

@ -664,6 +664,7 @@ void World::LoadConfigSettings(bool reload)
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_UINT32_GM_INVISIBLE_AURA, "GM.InvisibleAura", 31748);
setConfig(CONFIG_UINT32_GM_MAX_SPEED_FACTOR, "GM.MaxSpeedFactor", 10);
setConfig(CONFIG_UINT32_GROUP_VISIBILITY, "Visibility.GroupMode", 0);

View File

@ -134,6 +134,7 @@ enum eConfigUInt32Values
CONFIG_UINT32_GM_LEVEL_IN_WHO_LIST,
CONFIG_UINT32_START_GM_LEVEL,
CONFIG_UINT32_GM_INVISIBLE_AURA,
CONFIG_UINT32_GM_MAX_SPEED_FACTOR,
CONFIG_UINT32_GROUP_VISIBILITY,
CONFIG_UINT32_MAIL_DELIVERY_DELAY,
CONFIG_UINT32_MASS_MAILER_SEND_PER_TICK,

View File

@ -1163,6 +1163,10 @@ Channel.SilentlyGMJoin = 0
# A spell that will be cast when a gm uses ".gm visible off" (Must be aura spell)
# Default: 31748 (Spirit Particles, big)
# 0 (Disabled)
# GM.MaxSpeedFactor
# Set the max speed factor whend using commands .mod speed / .mod aspeed etc...
# Only Integer values
# Default: 10
#
################################################################################
@ -1179,6 +1183,7 @@ GM.LogTrade = 1
GM.StartLevel = 1
GM.LowerSecurity = 0
GM.InvisibleAura = 31748
GM.MaxSpeedFactor = 10
################################################################################
# VISIBILITY AND RADIUSES