Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2023-08-10 13:45:03 +08:00
12 changed files with 124 additions and 32 deletions

View File

@@ -948,6 +948,14 @@ MaxArenaPoints = 10000
StartArenaPoints = 0
#
# Arena.LegacyArenaPoints
# Description: Use arena point calculation from TBC for season 1 - 5 when rating is less or equal to 1500
# Default: 1 - (Enabled)
# 0 - (Disabled)
Arena.LegacyArenaPoints = 0
#
# RecruitAFriend.MaxLevel
# Description: Highest level up to which a character can benefit from the Recruit-A-Friend
@@ -3051,14 +3059,25 @@ Arena.GamesRequired = 10
Arena.QueueAnnouncer.Enable = 0
#
# Battleground.QueueAnnouncer.PlayerOnly
# Description: Battleground queue announcement type.
# Arena.QueueAnnouncer.PlayerOnly
# Description: Arena queue announcement type.
# Default: 0 - (System message, Anyone can see it)
# 1 - (Private, Only queued players can see it)
#
Arena.QueueAnnouncer.PlayerOnly = 0
#
# Arena.QueueAnnouncer.Detail
# Description: The amount of detail to announce on teams queued for arenas.
# Default: 3 - (Announce the team's name and rating)
# 2 - (Announce only the team's name)
# 1 - (Announce only the team's rating)
# 0 - (Do not announce any information about the teams)
#
Arena.QueueAnnouncer.Detail = 3
#
# Arena.ArenaSeason.ID
# Description: Current arena season id shown in clients.

View File

@@ -658,7 +658,7 @@ uint32 ArenaTeam::GetPoints(uint32 memberRating)
if (rating <= 1500)
{
if (sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID) < 6)
if (sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID) < 6 && !sWorld->getIntConfig(CONFIG_LEGACY_ARENA_POINTS_CALC))
points = (float)rating * 0.22f + 14.0f;
else
points = 344;

View File

@@ -1143,7 +1143,22 @@ void BattlegroundQueue::SendJoinMessageArenaQueue(Player* leader, GroupQueueInfo
uint32 ArenaTeamRating = ginfo->ArenaTeamRating;
std::string TeamName = team->GetName();
sWorld->SendWorldTextOptional(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, ANNOUNCER_FLAG_DISABLE_ARENA_QUEUE, TeamName.c_str(), ArenaType, ArenaType, ArenaTeamRating);
uint32 announcementDetail = sWorld->getIntConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_DETAIL);
switch (announcementDetail)
{
case 3:
sWorld->SendWorldTextOptional(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN_NAME_RATING, ANNOUNCER_FLAG_DISABLE_ARENA_QUEUE, TeamName.c_str(), ArenaType, ArenaType, ArenaTeamRating);
break;
case 2:
sWorld->SendWorldTextOptional(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN_NAME, ANNOUNCER_FLAG_DISABLE_ARENA_QUEUE, TeamName.c_str(), ArenaType, ArenaType);
break;
case 1:
sWorld->SendWorldTextOptional(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN_RATING, ANNOUNCER_FLAG_DISABLE_ARENA_QUEUE, ArenaType, ArenaType, ArenaTeamRating);
break;
default:
sWorld->SendWorldTextOptional(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, ANNOUNCER_FLAG_DISABLE_ARENA_QUEUE, ArenaType, ArenaType);
break;
}
}
}
@@ -1168,7 +1183,22 @@ void BattlegroundQueue::SendExitMessageArenaQueue(GroupQueueInfo* ginfo)
if (ArenaType && ginfo->Players.empty())
{
sWorld->SendWorldTextOptional(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, ANNOUNCER_FLAG_DISABLE_ARENA_QUEUE, TeamName.c_str(), ArenaType, ArenaType, ArenaTeamRating);
uint32 announcementDetail = sWorld->getIntConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_DETAIL);
switch (announcementDetail)
{
case 3:
sWorld->SendWorldTextOptional(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT_NAME_RATING, ANNOUNCER_FLAG_DISABLE_ARENA_QUEUE, TeamName.c_str(), ArenaType, ArenaType, ArenaTeamRating);
break;
case 2:
sWorld->SendWorldTextOptional(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT_NAME, ANNOUNCER_FLAG_DISABLE_ARENA_QUEUE, TeamName.c_str(), ArenaType, ArenaType);
break;
case 1:
sWorld->SendWorldTextOptional(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT_RATING, ANNOUNCER_FLAG_DISABLE_ARENA_QUEUE, ArenaType, ArenaType, ArenaTeamRating);
break;
default:
sWorld->SendWorldTextOptional(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, ANNOUNCER_FLAG_DISABLE_ARENA_QUEUE, ArenaType, ArenaType);
break;
}
}
}

View File

@@ -2480,34 +2480,34 @@ Player* Pet::GetOwner() const
float Pet::GetNativeObjectScale() const
{
CreatureFamilyEntry const* creatureFamily = sCreatureFamilyStore.LookupEntry(GetCreatureTemplate()->family);
if (creatureFamily && creatureFamily->minScale > 0.0f && getPetType() == HUNTER_PET)
{
float scale;
if (GetLevel() >= creatureFamily->maxScaleLevel)
scale = creatureFamily->maxScale;
else if (GetLevel() <= creatureFamily->minScaleLevel)
scale = creatureFamily->minScale;
else
scale = creatureFamily->minScale + float(GetLevel() - creatureFamily->minScaleLevel) / creatureFamily->maxScaleLevel * (creatureFamily->maxScale - creatureFamily->minScale);
uint8 ctFamily = GetCreatureTemplate()->family;
if (CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.LookupEntry(GetNativeDisplayId()))
{
if (displayInfo->scale > 1.f && GetCreatureTemplate()->IsExotic())
{
// Exotic pets have a scale of 1
scale = 1.0f;
}
else
{
scale *= displayInfo->scale;
}
}
// hackfix: Edge case where DBC scale values for DEVILSAUR pets make them too small.
// Therefore we take data from spirit beast instead.
if (ctFamily && ctFamily == CREATURE_FAMILY_DEVILSAUR)
ctFamily = CREATURE_FAMILY_SPIRIT_BEAST;
CreatureFamilyEntry const* creatureFamily = sCreatureFamilyStore.LookupEntry(ctFamily);
if (creatureFamily && creatureFamily->minScale > 0.0f && getPetType() & HUNTER_PET)
{
float minScaleLevel = creatureFamily->minScaleLevel;
uint8 level = getLevel();
float minLevelScaleMod = level >= minScaleLevel ? (level / minScaleLevel) : 0.0f;
float maxScaleMod = creatureFamily->maxScaleLevel - minScaleLevel;
if (minLevelScaleMod > maxScaleMod)
minLevelScaleMod = maxScaleMod;
float scaleMod = creatureFamily->maxScaleLevel != minScaleLevel ? minLevelScaleMod / maxScaleMod : 0.f;
float scale = (creatureFamily->maxScale - creatureFamily->minScale) * scaleMod + creatureFamily->minScale;
return scale;
}
// Fallback value if the conditions are not met
return 1.0f;
// take value for non-hunter pets from DB
return Guardian::GetNativeObjectScale();
}
std::string Pet::GenerateActionBarData() const

View File

@@ -4766,6 +4766,14 @@ void Unit::RemoveAura(AuraApplication* aurApp, AuraRemoveMode mode)
{
if (aurApp == iter->second)
{
// Prevent Arena Preparation aura from being removed by player actions
// It's an invisibility spell so any interaction/spell cast etc. removes it.
// Should only be removed by the arena script, once the match starts.
if (aurApp->GetBase()->HasEffectType(SPELL_AURA_ARENA_PREPARATION))
{
return;
}
RemoveAura(iter, mode);
return;
}

View File

@@ -666,8 +666,8 @@ enum AcoreStrings
LANG_YOUR_BG_LEVEL_REQ_ERROR = 715,
// = 716, see LANG_PINFO_MAP_OFFLINE
LANG_BG_STARTED_ANNOUNCE_WORLD = 717,
LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN = 718,
LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT = 719,
LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN_NAME_RATING = 718,
LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT_NAME_RATING = 719,
LANG_BG_GROUP_TOO_LARGE = 720, // "Your group is too large for this battleground. Please regroup to join."
LANG_ARENA_GROUP_TOO_LARGE = 721, // "Your group is too large for this arena. Please regroup to join."
@@ -702,7 +702,13 @@ enum AcoreStrings
LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING_SECS = 751, // "Not enough players. This game will close in %u seconds."
// = 752, see LANG_PINFO_ACC_IP
// Room for BG/ARENA = 773-784, 788-799 not used
// Room for BG/ARENA = 779-784, 788-799 not used
LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN_NAME = 773,
LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT_NAME = 774,
LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN_RATING = 775,
LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT_RATING = 776,
LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN = 777,
LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT = 778,
LANG_ARENA_TESTING = 785,
LANG_AUTO_ANN = 786,
LANG_ANNOUNCE_COLOR = 787,

View File

@@ -326,8 +326,10 @@ enum WorldIntConfigs
CONFIG_ARENA_GAMES_REQUIRED,
CONFIG_ARENA_SEASON_ID,
CONFIG_ARENA_START_RATING,
CONFIG_LEGACY_ARENA_POINTS_CALC,
CONFIG_ARENA_START_PERSONAL_RATING,
CONFIG_ARENA_START_MATCHMAKER_RATING,
CONFIG_ARENA_QUEUE_ANNOUNCER_DETAIL,
CONFIG_HONOR_AFTER_DUEL,
CONFIG_PVP_TOKEN_MAP_TYPE,
CONFIG_PVP_TOKEN_ID,

View File

@@ -1180,6 +1180,7 @@ void World::LoadConfigSettings(bool reload)
_int_configs[CONFIG_ARENA_GAMES_REQUIRED] = sConfigMgr->GetOption<uint32>("Arena.GamesRequired", 10);
_int_configs[CONFIG_ARENA_SEASON_ID] = sConfigMgr->GetOption<uint32>("Arena.ArenaSeason.ID", 1);
_int_configs[CONFIG_ARENA_START_RATING] = sConfigMgr->GetOption<uint32>("Arena.ArenaStartRating", 0);
_int_configs[CONFIG_LEGACY_ARENA_POINTS_CALC] = sConfigMgr->GetOption<uint32>("Arena.LegacyArenaPoints", 0);
_int_configs[CONFIG_ARENA_START_PERSONAL_RATING] = sConfigMgr->GetOption<uint32>("Arena.ArenaStartPersonalRating", 1000);
_int_configs[CONFIG_ARENA_START_MATCHMAKER_RATING] = sConfigMgr->GetOption<uint32>("Arena.ArenaStartMatchmakerRating", 1500);
_bool_configs[CONFIG_ARENA_SEASON_IN_PROGRESS] = sConfigMgr->GetOption<bool>("Arena.ArenaSeason.InProgress", true);
@@ -1189,6 +1190,7 @@ void World::LoadConfigSettings(bool reload)
_float_configs[CONFIG_ARENA_MATCHMAKER_RATING_MODIFIER] = sConfigMgr->GetOption<float>("Arena.ArenaMatchmakerRatingModifier", 24.0f);
_bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE] = sConfigMgr->GetOption<bool>("Arena.QueueAnnouncer.Enable", false);
_bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_PLAYERONLY] = sConfigMgr->GetOption<bool>("Arena.QueueAnnouncer.PlayerOnly", false);
_int_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_DETAIL] = sConfigMgr->GetOption<uint32>("Arena.QueueAnnouncer.Detail", 3);
_bool_configs[CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN] = sConfigMgr->GetOption<bool>("OffhandCheckAtSpellUnlearn", true);
_int_configs[CONFIG_CREATURE_STOP_FOR_PLAYER] = sConfigMgr->GetOption<uint32>("Creature.MovingStopTimeForPlayer", 3 * MINUTE * IN_MILLISECONDS);