From 27fe48e33d4ac9781641a8da56328daf15b9de1e Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 11 Dec 2017 10:49:47 -0500 Subject: [PATCH] Core/Misc: Removed Death knight creation restrictions --- Source/Framework/Constants/AccountConst.cs | 2 +- Source/Framework/Constants/SharedConst.cs | 2 - Source/Game/Handlers/CharacterHandler.cs | 81 ++-------------------- Source/Game/Server/WorldConfig.cs | 9 --- Source/WorldServer/WorldServer.conf.dist | 18 ----- 5 files changed, 5 insertions(+), 107 deletions(-) diff --git a/Source/Framework/Constants/AccountConst.cs b/Source/Framework/Constants/AccountConst.cs index c1043f8a8..ea24fbdb5 100644 --- a/Source/Framework/Constants/AccountConst.cs +++ b/Source/Framework/Constants/AccountConst.cs @@ -69,7 +69,7 @@ namespace Framework.Constants SkipCheckCharacterCreationClassmask = 15, SkipCheckCharacterCreationRacemask = 16, SkipCheckCharacterCreationReservedname = 17, - SkipCheckCharacterCreationDeathKnight = 18, + SkipCheckCharacterCreationDeathKnight = 18, // deprecated since Draenor DON'T reuse SkipCheckChatChannelReq = 19, SkipCheckDisableMap = 20, SkipCheckMoreTalentsThanAllowed = 21, diff --git a/Source/Framework/Constants/SharedConst.cs b/Source/Framework/Constants/SharedConst.cs index 3091a6196..c0795659a 100644 --- a/Source/Framework/Constants/SharedConst.cs +++ b/Source/Framework/Constants/SharedConst.cs @@ -1018,7 +1018,6 @@ namespace Framework.Constants CharacterCreatingDisabledClassmask, CharacterCreatingDisabledRacemask, CharacterCreatingMinLevelForDemonHunter, - CharacterCreatingMinLevelForDeathKnight, CharactersPerAccount, CharactersPerRealm, ChardeleteDeathKnightMinLevel, @@ -1069,7 +1068,6 @@ namespace Framework.Constants DeathBonesWorld, DeathCorpseReclaimDelayPve, DeathCorpseReclaimDelayPvp, - DeathKnightsPerRealm, DeathSicknessLevel, DeclinedNamesUsed, DemonHuntersPerRealm, diff --git a/Source/Game/Handlers/CharacterHandler.cs b/Source/Game/Handlers/CharacterHandler.cs index 50d4eb197..7b3a5eeef 100644 --- a/Source/Game/Handlers/CharacterHandler.cs +++ b/Source/Game/Handlers/CharacterHandler.cs @@ -271,23 +271,6 @@ namespace Game return; } - if (charCreate.CreateInfo.ClassId == Class.Deathknight && !HasPermission(RBACPermissions.SkipCheckCharacterCreationDeathKnight)) - { - // speedup check for death knight class disabled case - if (WorldConfig.GetIntValue(WorldCfg.DeathKnightsPerRealm) == 0) - { - SendCharCreate(ResponseCodes.CharCreateUniqueClassLimit); - return; - } - - // speedup check for death knight class disabled case - if (WorldConfig.GetIntValue(WorldCfg.CharacterCreatingMinLevelForDeathKnight) > WorldConfig.GetIntValue(WorldCfg.MaxPlayerLevel)) - { - SendCharCreate(ResponseCodes.CharCreateLevelRequirement); - return; - } - } - CharacterCreateInfo createInfo = charCreate.CreateInfo; PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHECK_NAME); stmt.AddValue(0, charCreate.CreateInfo.Name); @@ -338,44 +321,17 @@ namespace Game Action finalizeCharacterCreation = result1 => { bool haveSameRace = false; - int deathKnightReqLevel = WorldConfig.GetIntValue(WorldCfg.CharacterCreatingMinLevelForDeathKnight); int demonHunterReqLevel = WorldConfig.GetIntValue(WorldCfg.CharacterCreatingMinLevelForDemonHunter); - bool hasDeathKnightReqLevel = (deathKnightReqLevel == 0); bool hasDemonHunterReqLevel = (demonHunterReqLevel == 0); - bool checkDeathKnightReqs = createInfo.ClassId == Class.Deathknight && !HasPermission(RBACPermissions.SkipCheckCharacterCreationDeathKnight); bool checkDemonHunterReqs = createInfo.ClassId == Class.DemonHunter && !HasPermission(RBACPermissions.SkipCheckCharacterCreationDemonHunter); if (result1 != null && !result1.IsEmpty()) { Team team = Player.TeamForRace(createInfo.RaceId); - int freeDeathKnightSlots = WorldConfig.GetIntValue(WorldCfg.DeathKnightsPerRealm); int freeDemonHunterSlots = WorldConfig.GetIntValue(WorldCfg.DemonHuntersPerRealm); byte accRace = result1.Read(1); - if (checkDeathKnightReqs) - { - byte accClass = result1.Read(2); - if (accClass == (byte)Class.Deathknight) - { - if (freeDeathKnightSlots > 0) - --freeDeathKnightSlots; - - if (freeDeathKnightSlots == 0) - { - SendCharCreate(ResponseCodes.CharCreateUniqueClassLimit); - return; - } - } - - if (!hasDeathKnightReqLevel) - { - byte accLevel = result1.Read(0); - if (accLevel >= deathKnightReqLevel) - hasDeathKnightReqLevel = true; - } - } - if (checkDemonHunterReqs) { byte accClass = result1.Read(2); @@ -416,7 +372,7 @@ namespace Game // search same race for cinematic or same class if need // @todo check if cinematic already shown? (already logged in?; cinematic field) - while ((skipCinematics == 1 && !haveSameRace) || createInfo.ClassId == Class.Deathknight || createInfo.ClassId == Class.DemonHunter) + while ((skipCinematics == 1 && !haveSameRace) || createInfo.ClassId == Class.DemonHunter) { if (!result1.NextRow()) break; @@ -426,29 +382,6 @@ namespace Game if (!haveSameRace) haveSameRace = createInfo.RaceId == (Race)accRace; - if (checkDeathKnightReqs) - { - byte acc_class = result1.Read(2); - if (acc_class == (byte)Class.Deathknight) - { - if (freeDeathKnightSlots > 0) - --freeDeathKnightSlots; - - if (freeDeathKnightSlots == 0) - { - SendCharCreate(ResponseCodes.CharCreateUniqueClassLimit); - return; - } - } - - if (!hasDeathKnightReqLevel) - { - byte acc_level = result1.Read(0); - if (acc_level >= deathKnightReqLevel) - hasDeathKnightReqLevel = true; - } - } - if (checkDemonHunterReqs) { byte acc_class = result1.Read(2); @@ -474,15 +407,9 @@ namespace Game } } - if (checkDeathKnightReqs && !hasDeathKnightReqLevel) - { - SendCharCreate(ResponseCodes.CharCreateLevelRequirement); - return; - } - if (checkDemonHunterReqs && !hasDemonHunterReqLevel) { - SendCharCreate(ResponseCodes.CharCreateLevelRequirement); + SendCharCreate(ResponseCodes.CharCreateFailed); return; } @@ -531,7 +458,7 @@ namespace Game newChar.CleanupsBeforeDelete(); }; - if (!allowTwoSideAccounts || skipCinematics == 1 || createInfo.ClassId == Class.Deathknight || createInfo.ClassId == Class.DemonHunter) + if (!allowTwoSideAccounts || skipCinematics == 1 || createInfo.ClassId == Class.DemonHunter) { finalizeCharacterCreation(new SQLResult()); return; @@ -539,7 +466,7 @@ namespace Game stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_CREATE_INFO); stmt.AddValue(0, GetAccountId()); - stmt.AddValue(1, (skipCinematics == 1 || createInfo.ClassId == Class.Deathknight || createInfo.ClassId == Class.DemonHunter) ? 12 : 1); + stmt.AddValue(1, (skipCinematics == 1 || createInfo.ClassId == Class.DemonHunter) ? 12 : 1); queryCallback.WithCallback(finalizeCharacterCreation).SetNextQuery(DB.Characters.AsyncQuery(stmt)); })); } diff --git a/Source/Game/Server/WorldConfig.cs b/Source/Game/Server/WorldConfig.cs index 3a3c965c8..99d4a7163 100644 --- a/Source/Game/Server/WorldConfig.cs +++ b/Source/Game/Server/WorldConfig.cs @@ -363,15 +363,6 @@ namespace Game Values[WorldCfg.CharactersPerAccount] = Values[WorldCfg.CharactersPerRealm]; } - Values[WorldCfg.DeathKnightsPerRealm] = GetDefaultValue("DeathKnightsPerRealm", 1); - if ((int)Values[WorldCfg.DeathKnightsPerRealm] < 0 || (int)Values[WorldCfg.DeathKnightsPerRealm] > 12) - { - Log.outError(LogFilter.ServerLoading, "DeathKnightsPerRealm ({0}) must be in range 0..12. Set to 1.", Values[WorldCfg.DeathKnightsPerRealm]); - Values[WorldCfg.DeathKnightsPerRealm] = 1; - } - - Values[WorldCfg.CharacterCreatingMinLevelForDeathKnight] = GetDefaultValue("CharacterCreating.MinLevelForDeathKnight", 55); - Values[WorldCfg.DemonHuntersPerRealm] = GetDefaultValue("DemonHuntersPerRealm", 1); if ((int)Values[WorldCfg.DemonHuntersPerRealm] < 0 || (int)Values[WorldCfg.DemonHuntersPerRealm] > 12) { diff --git a/Source/WorldServer/WorldServer.conf.dist b/Source/WorldServer/WorldServer.conf.dist index 4f456a4b9..03f3508ed 100644 --- a/Source/WorldServer/WorldServer.conf.dist +++ b/Source/WorldServer/WorldServer.conf.dist @@ -766,24 +766,6 @@ CharactersPerAccount = 50 CharactersPerRealm = 12 -# -# DeathKnightsPerRealm -# Description: Limit number of death knight characters per account on this realm. -# Range: 1-12 -# Default: 1 - -DeathKnightsPerRealm = 1 - -# -# CharacterCreating.MinLevelForDeathKnight -# Description: Limit creating death knights only for account with another -# character of specific level (ignored for GM accounts). -# Default: 55 - (Enabled, Requires at least another level 55 character) -# 0 - (Disabled) -# 1 - (Enabled, Requires at least another level 1 character) - -CharacterCreating.MinLevelForDeathKnight = 55 - # # DemonHuntersPerRealm # Description: Limit number of demon hunter characters per account on this realm.