Core/Conditions: Implemented missing PlayerCondition columns - time and weather

Port From (https://github.com/TrinityCore/TrinityCore/commit/8aaf750be1ee16a299016cf038bd84bd9b387544)
This commit is contained in:
hondacrx
2021-06-04 16:49:44 -04:00
parent ba2908f508
commit c1409e4787
5 changed files with 48 additions and 10 deletions
+11 -2
View File
@@ -2043,7 +2043,14 @@ namespace Game
return false;
}
// TODO: time condition
if (condition.Time[0] != 0)
{
var from = Time.GetUnixTimeFromPackedTime(condition.Time[0]);
var to = Time.GetUnixTimeFromPackedTime(condition.Time[1]);
if (GameTime.GetGameTime() < from || GameTime.GetGameTime() > to)
return false;
}
if (condition.WorldStateExpressionID != 0)
{
@@ -2055,7 +2062,9 @@ namespace Game
return false;
}
// TODO: weather condition
if (condition.WeatherID != 0)
if (player.GetMap().GetZoneWeather(player.GetZoneId()) != (WeatherState)condition.WeatherID)
return false;
if (condition.Achievement[0] != 0)
{