mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-07-28 18:47:40 +00:00
feat(Core/Account): Implement ACCOUNT_FLAG_DEATH_KNIGHT_OK (#26344)
This commit is contained in:
@@ -93,7 +93,7 @@ enum AccountFlag
|
||||
ACCOUNT_FLAG_EXPANSION2_COLLECTOR = 0x4000000, // NYI WotLK Collector's Edition
|
||||
ACCOUNT_FLAG_OVERMIND_LINKED = 0x8000000, // NYI Linked with Battle.net account
|
||||
ACCOUNT_FLAG_DEMOS = 0x10000000, // NYI UNK
|
||||
ACCOUNT_FLAG_DEATH_KNIGHT_OK = 0x20000000, // NYI Has level 55 on account?
|
||||
ACCOUNT_FLAG_DEATH_KNIGHT_OK = 0x20000000, // Allowed to create Death Knight (account met heroic level requirement on WotLK+)
|
||||
// Below might be StarCraft II related
|
||||
ACCOUNT_FLAG_S2_REQUIRE_IGR = 0x40000000, // NYI UNK
|
||||
ACCOUNT_FLAG_S2_TRIAL = 0x80000000, // NYI UNK
|
||||
|
||||
@@ -378,7 +378,8 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData)
|
||||
|
||||
// speedup check for heroic class disabled case
|
||||
uint32 req_level_for_heroic = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER);
|
||||
if (!HasPermission(rbac::RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_DEATH_KNIGHT) && createInfo->Class == CLASS_DEATH_KNIGHT && req_level_for_heroic > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (!HasPermission(rbac::RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_DEATH_KNIGHT) && createInfo->Class == CLASS_DEATH_KNIGHT
|
||||
&& req_level_for_heroic > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) && !HasAccountFlag(ACCOUNT_FLAG_DEATH_KNIGHT_OK))
|
||||
{
|
||||
SendCharCreate(CHAR_CREATE_LEVEL_REQUIREMENT);
|
||||
return;
|
||||
@@ -445,7 +446,8 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData)
|
||||
}
|
||||
bool haveSameRace = false;
|
||||
uint32 heroicReqLevel = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER);
|
||||
bool hasHeroicReqLevel = (heroicReqLevel == 0);
|
||||
bool const deathKnightFlagAlreadySet = HasAccountFlag(ACCOUNT_FLAG_DEATH_KNIGHT_OK); // Account flag is superior to level requirement.
|
||||
bool hasHeroicReqLevel = (heroicReqLevel == 0) || deathKnightFlagAlreadySet;
|
||||
bool allowTwoSideAccounts = !sWorld->IsPvPRealm() || sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ACCOUNTS) || HasPermission(rbac::RBAC_PERM_TWO_SIDE_CHARACTER_CREATION);
|
||||
uint32 skipCinematics = sWorld->getIntConfig(CONFIG_SKIP_CINEMATICS);
|
||||
bool checkDeathKnightReqs = !HasPermission(rbac::RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_DEATH_KNIGHT) && createInfo->Class == CLASS_DEATH_KNIGHT;
|
||||
@@ -534,10 +536,16 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData)
|
||||
}
|
||||
}
|
||||
|
||||
if (checkDeathKnightReqs && !hasHeroicReqLevel)
|
||||
if (checkDeathKnightReqs)
|
||||
{
|
||||
SendCharCreate(CHAR_CREATE_LEVEL_REQUIREMENT);
|
||||
return;
|
||||
if (!deathKnightFlagAlreadySet && hasHeroicReqLevel)
|
||||
UpdateAccountFlag(ACCOUNT_FLAG_DEATH_KNIGHT_OK);
|
||||
|
||||
if (!hasHeroicReqLevel)
|
||||
{
|
||||
SendCharCreate(CHAR_CREATE_LEVEL_REQUIREMENT);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Check name uniqueness in the same step as saving to database
|
||||
|
||||
Reference in New Issue
Block a user