Core/Battlegrounds: Move to scripts And a lot of misc commits i couldn't recover.

Port From (https://github.com/TrinityCore/TrinityCore/commit/d0d5d309bb5877dc2fcb27f6cb123707a31ec1e8)
This commit is contained in:
Hondacrx
2024-08-04 15:18:22 -04:00
parent bca02a24b0
commit e9b21a91be
139 changed files with 8322 additions and 8700 deletions
+5 -15
View File
@@ -683,17 +683,11 @@ namespace Game.Chat
if (linked == "linked")
{
Battleground bg = player.GetBattleground();
if (bg != null)
nearestLoc = bg.GetClosestGraveyard(player);
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(player.GetMap(), player.GetZoneId());
if (bf != null)
nearestLoc = bf.GetClosestGraveyard(player);
else
{
BattleField bf = Global.BattleFieldMgr.GetBattlefieldToZoneId(player.GetMap(), player.GetZoneId());
if (bf != null)
nearestLoc = bf.GetClosestGraveyard(player);
else
nearestLoc = Global.ObjectMgr.GetClosestGraveyard(player, player.GetTeam(), player);
}
nearestLoc = Global.ObjectMgr.GetClosestGraveyard(player, player.GetTeam(), player);
}
else
{
@@ -788,11 +782,7 @@ namespace Game.Chat
return false;
}
var playerConditionEntry = CliDB.PlayerConditionStorage.LookupByKey(playerConditionId);
if (playerConditionEntry == null)
return false;
if (ConditionManager.IsPlayerMeetingCondition(target, playerConditionEntry))
if (ConditionManager.IsPlayerMeetingCondition(target, playerConditionId))
handler.SendSysMessage($"PlayerCondition {playerConditionId} met");
else
handler.SendSysMessage($"PlayerCondition {playerConditionId} not met");
+1 -1
View File
@@ -123,7 +123,7 @@ namespace Game.Chat
if (normalizePlayerName(*playerNameArg))
{
if (Player * player = ObjectAccessor::FindPlayerByName(*playerNameArg))
if (Player * player = Global.ObjAccessor.FindPlayerByName(*playerNameArg))
{
handler->GetSession()->GetPlayer()->RemoveFromWhisperWhiteList(player->GetGUID());
handler->PSendSysMessage(LANG_COMMAND_WHISPEROFFPLAYER, playerNameArg->c_str());
+1 -2
View File
@@ -839,8 +839,7 @@ namespace Game.Chat
{
if (a.GetMovementGeneratorType() == MovementGeneratorType.Follow)
{
FollowMovementGenerator followMovement = a as FollowMovementGenerator;
return followMovement != null && followMovement.GetTarget() == player;
return a is FollowMovementGenerator followMovement && followMovement.GetTarget() == player;
}
return false;
});