Core/Players: Remove deprecated skill related config AlwaysMaxWeaponSkill and command .maxskill
Port From (https://github.com/TrinityCore/TrinityCore/commit/bbdabd7d776a86dcb25954faf119797d52c2a425)
This commit is contained in:
@@ -1033,7 +1033,6 @@ namespace Framework.Constants
|
||||
AllowTwoSideInteractionGroup,
|
||||
AllowTwoSideInteractionGuild,
|
||||
AllowTwoSideTrade,
|
||||
AlwaysMaxskill,
|
||||
ArenaLogExtendedInfo,
|
||||
ArenaMaxRatingDifference,
|
||||
ArenaQueueAnnouncerEnable,
|
||||
|
||||
@@ -123,21 +123,6 @@ namespace Game.Chat
|
||||
return true;
|
||||
}
|
||||
|
||||
[CommandNonGroup("maxskill", RBACPermissions.CommandMaxskill)]
|
||||
static bool HandleMaxSkillCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
Player player = handler.GetSelectedPlayerOrSelf();
|
||||
if (!player)
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.NoCharSelected);
|
||||
return false;
|
||||
}
|
||||
|
||||
// each skills that have max skill value dependent from level seted to current level max skill value
|
||||
player.UpdateSkillsToMaxSkillsForLevel();
|
||||
return true;
|
||||
}
|
||||
|
||||
[CommandNonGroup("setskill", RBACPermissions.CommandSetskill)]
|
||||
static bool SetSkill(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
|
||||
@@ -46,16 +46,13 @@ namespace Game.Entities
|
||||
|
||||
if (Global.SpellMgr.GetSkillRangeType(rcEntry) == SkillRangeType.Level)
|
||||
{
|
||||
ushort max = skillInfoField.SkillMaxRank[pair.Value.Pos];
|
||||
|
||||
// update only level dependent max skill values
|
||||
if (max != 1)
|
||||
{
|
||||
if (rcEntry.Flags.HasAnyFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
|
||||
SetSkillRank(pair.Value.Pos, maxSkill);
|
||||
SetSkillMaxRank(pair.Value.Pos, maxSkill);
|
||||
if (pair.Value.State != SkillState.New)
|
||||
pair.Value.State = SkillState.Changed;
|
||||
}
|
||||
|
||||
SetSkillRank(pair.Value.Pos, maxSkill);
|
||||
SetSkillMaxRank(pair.Value.Pos, maxSkill);
|
||||
if (pair.Value.State != SkillState.New)
|
||||
pair.Value.State = SkillState.Changed;
|
||||
}
|
||||
|
||||
// Update level dependent skillline spells
|
||||
@@ -63,37 +60,6 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateSkillsToMaxSkillsForLevel()
|
||||
{
|
||||
SkillInfo skillInfoField = m_activePlayerData.Skill;
|
||||
|
||||
foreach (var pair in mSkillStatus)
|
||||
{
|
||||
if (pair.Value.State == SkillState.Deleted || skillInfoField.SkillRank[pair.Value.Pos] == 0)
|
||||
continue;
|
||||
|
||||
uint pskill = pair.Key;
|
||||
SkillRaceClassInfoRecord rcEntry = Global.DB2Mgr.GetSkillRaceClassInfo(pskill, GetRace(), GetClass());
|
||||
if (rcEntry == null)
|
||||
continue;
|
||||
|
||||
if (Global.SpellMgr.IsProfessionOrRidingSkill(rcEntry.SkillID))
|
||||
continue;
|
||||
|
||||
if (Global.SpellMgr.IsWeaponSkill(rcEntry.SkillID))
|
||||
continue;
|
||||
|
||||
ushort max = skillInfoField.SkillMaxRank[pair.Value.Pos];
|
||||
if (max > 1)
|
||||
{
|
||||
SetSkillRank(pair.Value.Pos, max);
|
||||
|
||||
if (pair.Value.State != SkillState.New)
|
||||
pair.Value.State = SkillState.Changed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ushort GetSkillValue(SkillType skill)
|
||||
{
|
||||
if (skill == 0)
|
||||
@@ -1999,8 +1965,6 @@ namespace Game.Entities
|
||||
skillValue = maxValue;
|
||||
else if (GetClass() == Class.Deathknight)
|
||||
skillValue = (ushort)Math.Min(Math.Max(1, (GetLevel() - 1) * 5), maxValue);
|
||||
else if (skillId == SkillType.FistWeapons)
|
||||
skillValue = Math.Max((ushort)1, GetSkillValue(SkillType.Unarmed));
|
||||
|
||||
SetSkill(skillId, 0, skillValue, maxValue);
|
||||
break;
|
||||
|
||||
@@ -5409,9 +5409,6 @@ namespace Game.Entities
|
||||
|
||||
UpdateAllStats();
|
||||
|
||||
if (WorldConfig.GetBoolValue(WorldCfg.AlwaysMaxskill)) // Max weapon skill when leveling up
|
||||
UpdateSkillsToMaxSkillsForLevel();
|
||||
|
||||
_ApplyAllLevelScaleItemMods(true); // Moved to above SetFullHealth so player will have full health from Heirlooms
|
||||
|
||||
Aura artifactAura = GetAura(PlayerConst.ArtifactsAllWeaponsGeneralWeaponEquippedPassive);
|
||||
|
||||
@@ -799,7 +799,6 @@ namespace Game
|
||||
Values[WorldCfg.ResetDuelHealthMana] = GetDefaultValue("ResetDuelHealthMana", false);
|
||||
Values[WorldCfg.StartAllExplored] = GetDefaultValue("PlayerStart.MapsExplored", false);
|
||||
Values[WorldCfg.StartAllRep] = GetDefaultValue("PlayerStart.AllReputation", false);
|
||||
Values[WorldCfg.AlwaysMaxskill] = GetDefaultValue("AlwaysMaxWeaponSkill", false);
|
||||
Values[WorldCfg.PvpTokenEnable] = GetDefaultValue("PvPToken.Enable", false);
|
||||
Values[WorldCfg.PvpTokenMapType] = GetDefaultValue("PvPToken.MapAllowType", 4);
|
||||
Values[WorldCfg.PvpTokenId] = GetDefaultValue("PvPToken.ItemID", 29434);
|
||||
|
||||
@@ -2807,15 +2807,6 @@ ResetDuelCooldowns = 0
|
||||
|
||||
ResetDuelHealthMana = 0
|
||||
|
||||
#
|
||||
# AlwaysMaxWeaponSkill
|
||||
# Description: Players will automatically gain max weapon/defense skill when logging in,
|
||||
# or leveling.
|
||||
# Default: 0 - (Disabled)
|
||||
# 1 - (Enabled)
|
||||
|
||||
AlwaysMaxWeaponSkill = 0
|
||||
|
||||
#
|
||||
# PvPToken.Enable
|
||||
# Description: Character will receive a token after defeating another character that yields
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
DELETE FROM `command` WHERE `name`='maxskill';
|
||||
Reference in New Issue
Block a user