Core/Misc: Removed Death knight creation restrictions
This commit is contained in:
@@ -69,7 +69,7 @@ namespace Framework.Constants
|
|||||||
SkipCheckCharacterCreationClassmask = 15,
|
SkipCheckCharacterCreationClassmask = 15,
|
||||||
SkipCheckCharacterCreationRacemask = 16,
|
SkipCheckCharacterCreationRacemask = 16,
|
||||||
SkipCheckCharacterCreationReservedname = 17,
|
SkipCheckCharacterCreationReservedname = 17,
|
||||||
SkipCheckCharacterCreationDeathKnight = 18,
|
SkipCheckCharacterCreationDeathKnight = 18, // deprecated since Draenor DON'T reuse
|
||||||
SkipCheckChatChannelReq = 19,
|
SkipCheckChatChannelReq = 19,
|
||||||
SkipCheckDisableMap = 20,
|
SkipCheckDisableMap = 20,
|
||||||
SkipCheckMoreTalentsThanAllowed = 21,
|
SkipCheckMoreTalentsThanAllowed = 21,
|
||||||
|
|||||||
@@ -1018,7 +1018,6 @@ namespace Framework.Constants
|
|||||||
CharacterCreatingDisabledClassmask,
|
CharacterCreatingDisabledClassmask,
|
||||||
CharacterCreatingDisabledRacemask,
|
CharacterCreatingDisabledRacemask,
|
||||||
CharacterCreatingMinLevelForDemonHunter,
|
CharacterCreatingMinLevelForDemonHunter,
|
||||||
CharacterCreatingMinLevelForDeathKnight,
|
|
||||||
CharactersPerAccount,
|
CharactersPerAccount,
|
||||||
CharactersPerRealm,
|
CharactersPerRealm,
|
||||||
ChardeleteDeathKnightMinLevel,
|
ChardeleteDeathKnightMinLevel,
|
||||||
@@ -1069,7 +1068,6 @@ namespace Framework.Constants
|
|||||||
DeathBonesWorld,
|
DeathBonesWorld,
|
||||||
DeathCorpseReclaimDelayPve,
|
DeathCorpseReclaimDelayPve,
|
||||||
DeathCorpseReclaimDelayPvp,
|
DeathCorpseReclaimDelayPvp,
|
||||||
DeathKnightsPerRealm,
|
|
||||||
DeathSicknessLevel,
|
DeathSicknessLevel,
|
||||||
DeclinedNamesUsed,
|
DeclinedNamesUsed,
|
||||||
DemonHuntersPerRealm,
|
DemonHuntersPerRealm,
|
||||||
|
|||||||
@@ -271,23 +271,6 @@ namespace Game
|
|||||||
return;
|
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;
|
CharacterCreateInfo createInfo = charCreate.CreateInfo;
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHECK_NAME);
|
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHECK_NAME);
|
||||||
stmt.AddValue(0, charCreate.CreateInfo.Name);
|
stmt.AddValue(0, charCreate.CreateInfo.Name);
|
||||||
@@ -338,44 +321,17 @@ namespace Game
|
|||||||
Action<SQLResult> finalizeCharacterCreation = result1 =>
|
Action<SQLResult> finalizeCharacterCreation = result1 =>
|
||||||
{
|
{
|
||||||
bool haveSameRace = false;
|
bool haveSameRace = false;
|
||||||
int deathKnightReqLevel = WorldConfig.GetIntValue(WorldCfg.CharacterCreatingMinLevelForDeathKnight);
|
|
||||||
int demonHunterReqLevel = WorldConfig.GetIntValue(WorldCfg.CharacterCreatingMinLevelForDemonHunter);
|
int demonHunterReqLevel = WorldConfig.GetIntValue(WorldCfg.CharacterCreatingMinLevelForDemonHunter);
|
||||||
bool hasDeathKnightReqLevel = (deathKnightReqLevel == 0);
|
|
||||||
bool hasDemonHunterReqLevel = (demonHunterReqLevel == 0);
|
bool hasDemonHunterReqLevel = (demonHunterReqLevel == 0);
|
||||||
bool checkDeathKnightReqs = createInfo.ClassId == Class.Deathknight && !HasPermission(RBACPermissions.SkipCheckCharacterCreationDeathKnight);
|
|
||||||
bool checkDemonHunterReqs = createInfo.ClassId == Class.DemonHunter && !HasPermission(RBACPermissions.SkipCheckCharacterCreationDemonHunter);
|
bool checkDemonHunterReqs = createInfo.ClassId == Class.DemonHunter && !HasPermission(RBACPermissions.SkipCheckCharacterCreationDemonHunter);
|
||||||
|
|
||||||
if (result1 != null && !result1.IsEmpty())
|
if (result1 != null && !result1.IsEmpty())
|
||||||
{
|
{
|
||||||
Team team = Player.TeamForRace(createInfo.RaceId);
|
Team team = Player.TeamForRace(createInfo.RaceId);
|
||||||
int freeDeathKnightSlots = WorldConfig.GetIntValue(WorldCfg.DeathKnightsPerRealm);
|
|
||||||
int freeDemonHunterSlots = WorldConfig.GetIntValue(WorldCfg.DemonHuntersPerRealm);
|
int freeDemonHunterSlots = WorldConfig.GetIntValue(WorldCfg.DemonHuntersPerRealm);
|
||||||
|
|
||||||
byte accRace = result1.Read<byte>(1);
|
byte accRace = result1.Read<byte>(1);
|
||||||
|
|
||||||
if (checkDeathKnightReqs)
|
|
||||||
{
|
|
||||||
byte accClass = result1.Read<byte>(2);
|
|
||||||
if (accClass == (byte)Class.Deathknight)
|
|
||||||
{
|
|
||||||
if (freeDeathKnightSlots > 0)
|
|
||||||
--freeDeathKnightSlots;
|
|
||||||
|
|
||||||
if (freeDeathKnightSlots == 0)
|
|
||||||
{
|
|
||||||
SendCharCreate(ResponseCodes.CharCreateUniqueClassLimit);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!hasDeathKnightReqLevel)
|
|
||||||
{
|
|
||||||
byte accLevel = result1.Read<byte>(0);
|
|
||||||
if (accLevel >= deathKnightReqLevel)
|
|
||||||
hasDeathKnightReqLevel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (checkDemonHunterReqs)
|
if (checkDemonHunterReqs)
|
||||||
{
|
{
|
||||||
byte accClass = result1.Read<byte>(2);
|
byte accClass = result1.Read<byte>(2);
|
||||||
@@ -416,7 +372,7 @@ namespace Game
|
|||||||
|
|
||||||
// search same race for cinematic or same class if need
|
// search same race for cinematic or same class if need
|
||||||
// @todo check if cinematic already shown? (already logged in?; cinematic field)
|
// @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())
|
if (!result1.NextRow())
|
||||||
break;
|
break;
|
||||||
@@ -426,29 +382,6 @@ namespace Game
|
|||||||
if (!haveSameRace)
|
if (!haveSameRace)
|
||||||
haveSameRace = createInfo.RaceId == (Race)accRace;
|
haveSameRace = createInfo.RaceId == (Race)accRace;
|
||||||
|
|
||||||
if (checkDeathKnightReqs)
|
|
||||||
{
|
|
||||||
byte acc_class = result1.Read<byte>(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<byte>(0);
|
|
||||||
if (acc_level >= deathKnightReqLevel)
|
|
||||||
hasDeathKnightReqLevel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (checkDemonHunterReqs)
|
if (checkDemonHunterReqs)
|
||||||
{
|
{
|
||||||
byte acc_class = result1.Read<byte>(2);
|
byte acc_class = result1.Read<byte>(2);
|
||||||
@@ -474,15 +407,9 @@ namespace Game
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (checkDeathKnightReqs && !hasDeathKnightReqLevel)
|
|
||||||
{
|
|
||||||
SendCharCreate(ResponseCodes.CharCreateLevelRequirement);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (checkDemonHunterReqs && !hasDemonHunterReqLevel)
|
if (checkDemonHunterReqs && !hasDemonHunterReqLevel)
|
||||||
{
|
{
|
||||||
SendCharCreate(ResponseCodes.CharCreateLevelRequirement);
|
SendCharCreate(ResponseCodes.CharCreateFailed);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -531,7 +458,7 @@ namespace Game
|
|||||||
newChar.CleanupsBeforeDelete();
|
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());
|
finalizeCharacterCreation(new SQLResult());
|
||||||
return;
|
return;
|
||||||
@@ -539,7 +466,7 @@ namespace Game
|
|||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_CREATE_INFO);
|
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_CREATE_INFO);
|
||||||
stmt.AddValue(0, GetAccountId());
|
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));
|
queryCallback.WithCallback(finalizeCharacterCreation).SetNextQuery(DB.Characters.AsyncQuery(stmt));
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -363,15 +363,6 @@ namespace Game
|
|||||||
Values[WorldCfg.CharactersPerAccount] = Values[WorldCfg.CharactersPerRealm];
|
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);
|
Values[WorldCfg.DemonHuntersPerRealm] = GetDefaultValue("DemonHuntersPerRealm", 1);
|
||||||
if ((int)Values[WorldCfg.DemonHuntersPerRealm] < 0 || (int)Values[WorldCfg.DemonHuntersPerRealm] > 12)
|
if ((int)Values[WorldCfg.DemonHuntersPerRealm] < 0 || (int)Values[WorldCfg.DemonHuntersPerRealm] > 12)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -766,24 +766,6 @@ CharactersPerAccount = 50
|
|||||||
|
|
||||||
CharactersPerRealm = 12
|
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
|
# DemonHuntersPerRealm
|
||||||
# Description: Limit number of demon hunter characters per account on this realm.
|
# Description: Limit number of demon hunter characters per account on this realm.
|
||||||
|
|||||||
Reference in New Issue
Block a user