Merge branch 'master' into Playerbot

# Conflicts:
#	src/server/game/World/World.h
This commit is contained in:
郑佩茹
2023-02-09 12:40:25 -07:00
1253 changed files with 114535 additions and 40950 deletions

View File

@@ -455,7 +455,7 @@ void ArenaTeam::Roster(WorldSession* session)
sCharacterCache->GetCharacterNameByGuid(itr->Guid, tempName);
data << tempName; // member name
data << uint32((itr->Guid == GetCaptain() ? 0 : 1));// captain flag 0 captain 1 member
data << uint8((player ? player->getLevel() : 0)); // unknown, level?
data << uint8((player ? player->GetLevel() : 0)); // unknown, level?
data << uint8(itr->Class); // class
data << uint32(itr->WeekGames); // played this week
data << uint32(itr->WeekWins); // wins this week

View File

@@ -862,7 +862,7 @@ void Battleground::EndBattleground(PvPTeamId winnerTeamId)
UpdatePlayerScore(player, SCORE_BONUS_HONOR, GetBonusHonorFromKill(winner_kills));
// Xinef: check player level and not bracket level if (CanAwardArenaPoints())
if (player->getLevel() >= BG_AWARD_ARENA_POINTS_MIN_LEVEL)
if (player->GetLevel() >= BG_AWARD_ARENA_POINTS_MIN_LEVEL)
player->ModifyArenaPoints(winner_arena);
if (!player->GetRandomWinner())

View File

@@ -455,7 +455,7 @@ public:
void EndBattleground(PvPTeamId winnerTeamId);
// deprecated, need delete
/// @deprecated need delete
virtual void EndBattleground(TeamId winnerTeamId)
{
EndBattleground(GetPvPTeamId(winnerTeamId));

View File

@@ -575,8 +575,8 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, ObjectGuid
uint32 winner_arena = player->GetRandomWinner() ? sWorld->getIntConfig(CONFIG_BG_REWARD_WINNER_ARENA_LAST) : sWorld->getIntConfig(CONFIG_BG_REWARD_WINNER_ARENA_FIRST);
uint32 loser_kills = player->GetRandomWinner() ? sWorld->getIntConfig(CONFIG_BG_REWARD_LOSER_HONOR_LAST) : sWorld->getIntConfig(CONFIG_BG_REWARD_LOSER_HONOR_FIRST);
winner_kills = Acore::Honor::hk_honor_at_level(player->getLevel(), float(winner_kills));
loser_kills = Acore::Honor::hk_honor_at_level(player->getLevel(), float(loser_kills));
winner_kills = Acore::Honor::hk_honor_at_level(player->GetLevel(), float(winner_kills));
loser_kills = Acore::Honor::hk_honor_at_level(player->GetLevel(), float(loser_kills));
data->Initialize(SMSG_BATTLEFIELD_LIST);
*data << guid; // battlemaster guid
@@ -614,7 +614,7 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, ObjectGuid
if (it != bgDataStore.end())
{
// expected bracket entry
if (PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(it->second._Battlegrounds.begin()->second->GetMapId(), player->getLevel()))
if (PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(it->second._Battlegrounds.begin()->second->GetMapId(), player->GetLevel()))
{
uint32 count = 0;
BattlegroundBracketId bracketId = bracketEntry->GetBracketId();

View File

@@ -650,9 +650,9 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
//send a nice message to all :)
char buf[256];
if (IsTower(node))
sprintf(buf, GetAcoreString(LANG_BG_AV_TOWER_TAKEN), GetNodeName(node), (ownerId == TEAM_ALLIANCE) ? GetAcoreString(LANG_BG_AV_ALLY) : GetAcoreString(LANG_BG_AV_HORDE));
snprintf(buf, sizeof(buf), GetAcoreString(LANG_BG_AV_TOWER_TAKEN), GetNodeName(node), (ownerId == TEAM_ALLIANCE) ? GetAcoreString(LANG_BG_AV_ALLY) : GetAcoreString(LANG_BG_AV_HORDE));
else
sprintf(buf, GetAcoreString(LANG_BG_AV_GRAVE_TAKEN), GetNodeName(node), (ownerId == TEAM_ALLIANCE) ? GetAcoreString(LANG_BG_AV_ALLY) : GetAcoreString(LANG_BG_AV_HORDE));
snprintf(buf, sizeof(buf), GetAcoreString(LANG_BG_AV_GRAVE_TAKEN), GetNodeName(node), (ownerId == TEAM_ALLIANCE) ? GetAcoreString(LANG_BG_AV_ALLY) : GetAcoreString(LANG_BG_AV_HORDE));
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
if (creature)
@@ -729,7 +729,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, TeamId teamId, bool initial)
{
m_Mine_Reclaim_Timer[mine] = AV_MINE_RECLAIM_TIMER;
char buf[256];
sprintf(buf, GetAcoreString(LANG_BG_AV_MINE_TAKEN), (teamId == TEAM_ALLIANCE) ? GetAcoreString(LANG_BG_AV_ALLY) : GetAcoreString(LANG_BG_AV_HORDE),
snprintf(buf, sizeof(buf), GetAcoreString(LANG_BG_AV_MINE_TAKEN), (teamId == TEAM_ALLIANCE) ? GetAcoreString(LANG_BG_AV_ALLY) : GetAcoreString(LANG_BG_AV_HORDE),
GetAcoreString((mine == AV_NORTH_MINE) ? LANG_BG_AV_MINE_NORTH : LANG_BG_AV_MINE_SOUTH));
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
if (creature)
@@ -983,7 +983,7 @@ void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
}
//send a nice message to all :)
char buf[256];
sprintf(buf, GetAcoreString((IsTower(node)) ? LANG_BG_AV_TOWER_DEFENDED : LANG_BG_AV_GRAVE_DEFENDED), GetNodeName(node), (teamId == TEAM_ALLIANCE) ? GetAcoreString(LANG_BG_AV_ALLY) : GetAcoreString(LANG_BG_AV_HORDE));
snprintf(buf, sizeof(buf), GetAcoreString((IsTower(node)) ? LANG_BG_AV_TOWER_DEFENDED : LANG_BG_AV_GRAVE_DEFENDED), GetNodeName(node), (teamId == TEAM_ALLIANCE) ? GetAcoreString(LANG_BG_AV_ALLY) : GetAcoreString(LANG_BG_AV_HORDE));
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
if (creature)
YellToAll(creature, buf, LANG_UNIVERSAL);
@@ -1095,7 +1095,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
//send a nice message to all :)
char buf[256];
sprintf(buf, (IsTower(node)) ? GetAcoreString(LANG_BG_AV_TOWER_ASSAULTED) : GetAcoreString(LANG_BG_AV_GRAVE_ASSAULTED), GetNodeName(node), (teamId == TEAM_ALLIANCE) ? GetAcoreString(LANG_BG_AV_ALLY) : GetAcoreString(LANG_BG_AV_HORDE));
snprintf(buf, sizeof(buf), (IsTower(node)) ? GetAcoreString(LANG_BG_AV_TOWER_ASSAULTED) : GetAcoreString(LANG_BG_AV_GRAVE_ASSAULTED), GetNodeName(node), (teamId == TEAM_ALLIANCE) ? GetAcoreString(LANG_BG_AV_ALLY) : GetAcoreString(LANG_BG_AV_HORDE));
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
if (creature)
YellToAll(creature, buf, LANG_UNIVERSAL);

View File

@@ -472,6 +472,12 @@ void BattlegroundEY::EventTeamLostPoint(Player* player, uint32 point)
UpdatePointsIcons(point);
UpdatePointsCount();
DelCreature(BG_EY_TRIGGER_FEL_REAVER + point);
_reviveEvents.AddEventAtOffset([this, point]()
{
RelocateDeadPlayers(BgCreatures[point]);
DelCreature(point);
}, 500ms);
}
void BattlegroundEY::EventTeamCapturedPoint(Player* player, TeamId teamId, uint32 point)
@@ -498,8 +504,6 @@ void BattlegroundEY::EventTeamCapturedPoint(Player* player, TeamId teamId, uint3
}
_capturePointInfo[point]._ownerTeamId = teamId;
if (BgCreatures[point])
DelCreature(point);
GraveyardStruct const* sg = sGraveyard->GetGraveyard(m_CapturingPointTypes[point].GraveYardId);
AddSpiritGuide(point, sg->x, sg->y, sg->z, 3.124139f, teamId);