mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
feat(Core/Player): Allow spell validation to be skipped at server owner's risk (#22521)
Co-authored-by: Tereneckla <Tereneckla@pm.me>
This commit is contained in:
@@ -1765,6 +1765,16 @@ CleanCharacterDB = 0
|
|||||||
|
|
||||||
PersistentCharacterCleanFlags = 0
|
PersistentCharacterCleanFlags = 0
|
||||||
|
|
||||||
|
#
|
||||||
|
# ValidateSkillLearnedBySpells
|
||||||
|
# Description: If enabled, players will lose spells that are invalid for their race/class.
|
||||||
|
# Default: 1 - (Enabled, enforce valid spells)
|
||||||
|
# 0 - (Disabled, allow invalid spells)
|
||||||
|
# Disabling this and then having your character learn spells which require DBC edits can result in the character not being saved in the database
|
||||||
|
# Disable AT YOUR OWN RISK
|
||||||
|
|
||||||
|
ValidateSkillLearnedBySpells = 1
|
||||||
|
|
||||||
#
|
#
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
|
|
||||||
|
|||||||
@@ -3103,6 +3103,9 @@ bool Player::addSpell(uint32 spellId, uint8 addSpecMask, bool updateActive, bool
|
|||||||
|
|
||||||
bool Player::CheckSkillLearnedBySpell(uint32 spellId)
|
bool Player::CheckSkillLearnedBySpell(uint32 spellId)
|
||||||
{
|
{
|
||||||
|
if (!sWorld->getBoolConfig(CONFIG_VALIDATE_SKILL_LEARNED_BY_SPELLS))
|
||||||
|
return true;
|
||||||
|
|
||||||
SkillLineAbilityMapBounds skill_bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId);
|
SkillLineAbilityMapBounds skill_bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId);
|
||||||
uint32 errorSkill = 0;
|
uint32 errorSkill = 0;
|
||||||
for (SkillLineAbilityMap::const_iterator sla = skill_bounds.first; sla != skill_bounds.second; ++sla)
|
for (SkillLineAbilityMap::const_iterator sla = skill_bounds.first; sla != skill_bounds.second; ++sla)
|
||||||
|
|||||||
@@ -160,6 +160,7 @@ void WorldConfig::BuildConfigCache()
|
|||||||
SetConfigValue<uint32>(CONFIG_INTERVAL_SAVE, "PlayerSaveInterval", 900000);
|
SetConfigValue<uint32>(CONFIG_INTERVAL_SAVE, "PlayerSaveInterval", 900000);
|
||||||
SetConfigValue<uint32>(CONFIG_INTERVAL_DISCONNECT_TOLERANCE, "DisconnectToleranceInterval", 0);
|
SetConfigValue<uint32>(CONFIG_INTERVAL_DISCONNECT_TOLERANCE, "DisconnectToleranceInterval", 0);
|
||||||
SetConfigValue<bool>(CONFIG_STATS_SAVE_ONLY_ON_LOGOUT, "PlayerSave.Stats.SaveOnlyOnLogout", true);
|
SetConfigValue<bool>(CONFIG_STATS_SAVE_ONLY_ON_LOGOUT, "PlayerSave.Stats.SaveOnlyOnLogout", true);
|
||||||
|
SetConfigValue<bool>(CONFIG_VALIDATE_SKILL_LEARNED_BY_SPELLS, "ValidateSkillLearnedBySpells", true);
|
||||||
|
|
||||||
SetConfigValue<uint32>(CONFIG_MIN_LEVEL_STAT_SAVE, "PlayerSave.Stats.MinLevel", 0, ConfigValueCache::Reloadable::Yes, [](uint32 const& value) { return value < MAX_LEVEL; }, "< MAX_LEVEL");
|
SetConfigValue<uint32>(CONFIG_MIN_LEVEL_STAT_SAVE, "PlayerSave.Stats.MinLevel", 0, ConfigValueCache::Reloadable::Yes, [](uint32 const& value) { return value < MAX_LEVEL; }, "< MAX_LEVEL");
|
||||||
|
|
||||||
|
|||||||
@@ -474,6 +474,7 @@ enum ServerConfigs
|
|||||||
RATE_MISS_CHANCE_MULTIPLIER_TARGET_CREATURE,
|
RATE_MISS_CHANCE_MULTIPLIER_TARGET_CREATURE,
|
||||||
RATE_MISS_CHANCE_MULTIPLIER_TARGET_PLAYER,
|
RATE_MISS_CHANCE_MULTIPLIER_TARGET_PLAYER,
|
||||||
CONFIG_NEW_CHAR_STRING,
|
CONFIG_NEW_CHAR_STRING,
|
||||||
|
CONFIG_VALIDATE_SKILL_LEARNED_BY_SPELLS,
|
||||||
|
|
||||||
MAX_NUM_SERVER_CONFIGS
|
MAX_NUM_SERVER_CONFIGS
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user