mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Map: Added Map::SetZoneOverrideLight std::chrono overload (#26486)
* Core/Map: Added Map::SetZoneOverrideLight std::chrono overload
* Scripts: Replace Map::SetZoneOverrideLight usages with new std::chrono overload
* Core/Map: Remove non-chrono Map::SetZoneOverrideLight overload
(cherry picked from commit e33c4b8f7f)
This commit is contained in:
@@ -2497,7 +2497,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
{
|
||||
if (WorldObject* obj = GetBaseObject())
|
||||
{
|
||||
obj->GetMap()->SetZoneOverrideLight(e.action.overrideLight.zoneId, e.action.overrideLight.areaLightId, e.action.overrideLight.overrideLightId, e.action.overrideLight.transitionMilliseconds);
|
||||
obj->GetMap()->SetZoneOverrideLight(e.action.overrideLight.zoneId, e.action.overrideLight.areaLightId, e.action.overrideLight.overrideLightId, Milliseconds(e.action.overrideLight.transitionMilliseconds));
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_OVERRIDE_LIGHT: %s sets zone override light (zoneId: %u, areaLightId: %u, overrideLightId: %u, transitionMilliseconds: %u)",
|
||||
obj->GetGUID().ToString().c_str(), e.action.overrideLight.zoneId, e.action.overrideLight.areaLightId, e.action.overrideLight.overrideLightId, e.action.overrideLight.transitionMilliseconds);
|
||||
}
|
||||
|
||||
@@ -5015,7 +5015,7 @@ void Map::SetZoneWeather(uint32 zoneId, WeatherState weatherId, float intensity)
|
||||
}
|
||||
}
|
||||
|
||||
void Map::SetZoneOverrideLight(uint32 zoneId, uint32 areaLightId, uint32 overrideLightId, uint32 transitionMilliseconds)
|
||||
void Map::SetZoneOverrideLight(uint32 zoneId, uint32 areaLightId, uint32 overrideLightId, Milliseconds transitionTime)
|
||||
{
|
||||
ZoneDynamicInfo& info = _zoneDynamicInfo[zoneId];
|
||||
// client can support only one override for each light (zone independent)
|
||||
@@ -5030,7 +5030,7 @@ void Map::SetZoneOverrideLight(uint32 zoneId, uint32 areaLightId, uint32 overrid
|
||||
ZoneDynamicInfo::LightOverride& lightOverride = info.LightOverrides.emplace_back();
|
||||
lightOverride.AreaLightId = areaLightId;
|
||||
lightOverride.OverrideLightId = overrideLightId;
|
||||
lightOverride.TransitionMilliseconds = transitionMilliseconds;
|
||||
lightOverride.TransitionMilliseconds = static_cast<uint32>(transitionTime.count());
|
||||
}
|
||||
|
||||
Map::PlayerList const& players = GetPlayers();
|
||||
@@ -5039,7 +5039,7 @@ void Map::SetZoneOverrideLight(uint32 zoneId, uint32 areaLightId, uint32 overrid
|
||||
WorldPackets::Misc::OverrideLight overrideLight;
|
||||
overrideLight.AreaLightID = areaLightId;
|
||||
overrideLight.OverrideLightID = overrideLightId;
|
||||
overrideLight.TransitionMilliseconds = transitionMilliseconds;
|
||||
overrideLight.TransitionMilliseconds = static_cast<uint32>(transitionTime.count());
|
||||
overrideLight.Write();
|
||||
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
|
||||
@@ -591,7 +591,7 @@ class TC_GAME_API Map : public GridRefManager<NGridType>
|
||||
Weather* GetOrGenerateZoneDefaultWeather(uint32 zoneId);
|
||||
WeatherState GetZoneWeather(uint32 zoneId) const;
|
||||
void SetZoneWeather(uint32 zoneId, WeatherState weatherId, float intensity);
|
||||
void SetZoneOverrideLight(uint32 zoneId, uint32 areaLightId, uint32 overrideLightId, uint32 transitionMilliseconds);
|
||||
void SetZoneOverrideLight(uint32 zoneId, uint32 areaLightId, uint32 overrideLightId, Milliseconds transitionTime);
|
||||
|
||||
void UpdateAreaDependentAuras();
|
||||
|
||||
|
||||
@@ -517,7 +517,7 @@ struct boss_the_lich_king : public BossAI
|
||||
Cell::VisitGridObjects(me, worker, 333.0f);
|
||||
|
||||
// Reset any light override
|
||||
me->GetMap()->SetZoneOverrideLight(AREA_ICECROWN_CITADEL, LIGHT_DEFAULT, 0, 5000);
|
||||
me->GetMap()->SetZoneOverrideLight(AREA_ICECROWN_CITADEL, LIGHT_DEFAULT, 0, 5s);
|
||||
|
||||
if (!ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_HIGHLORD_TIRION_FORDRING)))
|
||||
me->SummonCreature(NPC_HIGHLORD_TIRION_FORDRING_LK, TirionSpawn, TEMPSUMMON_MANUAL_DESPAWN);
|
||||
@@ -531,7 +531,7 @@ struct boss_the_lich_king : public BossAI
|
||||
me->GetMotionMaster()->MoveFall();
|
||||
if (Creature* frostmourne = me->FindNearestCreature(NPC_FROSTMOURNE_TRIGGER, 50.0f))
|
||||
frostmourne->DespawnOrUnsummon();
|
||||
me->GetMap()->SetZoneOverrideLight(AREA_ICECROWN_CITADEL, LIGHT_DEFAULT, LIGHT_FOG, 5000);
|
||||
me->GetMap()->SetZoneOverrideLight(AREA_ICECROWN_CITADEL, LIGHT_DEFAULT, LIGHT_FOG, 5s);
|
||||
me->GetMap()->SetZoneWeather(AREA_ICECROWN_CITADEL, WEATHER_STATE_FOG, 0.0f);
|
||||
|
||||
if (Is25ManRaid())
|
||||
@@ -604,7 +604,7 @@ struct boss_the_lich_king : public BossAI
|
||||
me->GetMap()->SetZoneMusic(AREA_ICECROWN_CITADEL, MUSIC_FINAL);
|
||||
break;
|
||||
case ACTION_RESTORE_LIGHT:
|
||||
me->GetMap()->SetZoneOverrideLight(AREA_ICECROWN_CITADEL, LIGHT_DEFAULT, 0, 5000);
|
||||
me->GetMap()->SetZoneOverrideLight(AREA_ICECROWN_CITADEL, LIGHT_DEFAULT, 0, 5s);
|
||||
break;
|
||||
case ACTION_BREAK_FROSTMOURNE:
|
||||
me->CastSpell(nullptr, SPELL_SUMMON_BROKEN_FROSTMOURNE, TRIGGERED_IGNORE_CAST_IN_PROGRESS);
|
||||
@@ -742,7 +742,7 @@ struct boss_the_lich_king : public BossAI
|
||||
{
|
||||
summon->CastSpell(nullptr, SPELL_BROKEN_FROSTMOURNE, true);
|
||||
|
||||
me->GetMap()->SetZoneOverrideLight(AREA_ICECROWN_CITADEL, LIGHT_DEFAULT, LIGHT_SOULSTORM, 10000);
|
||||
me->GetMap()->SetZoneOverrideLight(AREA_ICECROWN_CITADEL, LIGHT_DEFAULT, LIGHT_SOULSTORM, 10s);
|
||||
me->GetMap()->SetZoneWeather(AREA_ICECROWN_CITADEL, WEATHER_STATE_BLACKSNOW, 0.5f);
|
||||
|
||||
events.ScheduleEvent(EVENT_OUTRO_SOUL_BARRAGE, 5s, 0, PHASE_OUTRO);
|
||||
@@ -794,7 +794,7 @@ struct boss_the_lich_king : public BossAI
|
||||
|
||||
if (spellInfo->Id == REMORSELESS_WINTER_1 || spellInfo->Id == REMORSELESS_WINTER_2)
|
||||
{
|
||||
me->GetMap()->SetZoneOverrideLight(AREA_ICECROWN_CITADEL, LIGHT_DEFAULT, LIGHT_SNOWSTORM, 5000);
|
||||
me->GetMap()->SetZoneOverrideLight(AREA_ICECROWN_CITADEL, LIGHT_DEFAULT, LIGHT_SNOWSTORM, 5s);
|
||||
me->GetMap()->SetZoneWeather(AREA_ICECROWN_CITADEL, WEATHER_STATE_LIGHT_SNOW, 0.5f);
|
||||
summons.DespawnEntry(NPC_SHADOW_TRAP);
|
||||
}
|
||||
|
||||
@@ -580,7 +580,7 @@ public:
|
||||
{
|
||||
instance->SetBossState(DATA_MALYGOS_EVENT, FAIL);
|
||||
|
||||
me->GetMap()->SetZoneOverrideLight(AREA_EYE_OF_ETERNITY, LIGHT_DEFAULT, 0, 1*IN_MILLISECONDS);
|
||||
me->GetMap()->SetZoneOverrideLight(AREA_EYE_OF_ETERNITY, LIGHT_DEFAULT, 0, 1s);
|
||||
|
||||
if (!summons.empty())
|
||||
{
|
||||
@@ -698,7 +698,7 @@ public:
|
||||
me->SetDisableGravity(true);
|
||||
if (Creature* alexstraszaBunny = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_ALEXSTRASZA_BUNNY_GUID)))
|
||||
me->SetFacingToObject(alexstraszaBunny);
|
||||
me->GetMap()->SetZoneOverrideLight(AREA_EYE_OF_ETERNITY, LIGHT_DEFAULT, LIGHT_ARCANE_RUNES, 5 * IN_MILLISECONDS);
|
||||
me->GetMap()->SetZoneOverrideLight(AREA_EYE_OF_ETERNITY, LIGHT_DEFAULT, LIGHT_ARCANE_RUNES, 5s);
|
||||
events.ScheduleEvent(EVENT_FLY_OUT_OF_PLATFORM, 18s, 0, PHASE_TWO);
|
||||
break;
|
||||
case POINT_SURGE_OF_POWER_P_TWO:
|
||||
@@ -710,7 +710,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case POINT_DESTROY_PLATFORM_P_TWO:
|
||||
me->GetMap()->SetZoneOverrideLight(AREA_EYE_OF_ETERNITY, LIGHT_DEFAULT, LIGHT_OBSCURE_SPACE, 1 * IN_MILLISECONDS);
|
||||
me->GetMap()->SetZoneOverrideLight(AREA_EYE_OF_ETERNITY, LIGHT_DEFAULT, LIGHT_OBSCURE_SPACE, 1s);
|
||||
DoCast(me, SPELL_DESTROY_PLATFORM_CHANNEL);
|
||||
events.ScheduleEvent(EVENT_MOVE_TO_P_THREE_POINT, 11s, 0, PHASE_TWO);
|
||||
break;
|
||||
@@ -906,7 +906,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case EVENT_LIGHT_DIMENSION_CHANGE:
|
||||
me->GetMap()->SetZoneOverrideLight(AREA_EYE_OF_ETERNITY, LIGHT_DEFAULT, LIGHT_CHANGE_DIMENSIONS, 2 * IN_MILLISECONDS);
|
||||
me->GetMap()->SetZoneOverrideLight(AREA_EYE_OF_ETERNITY, LIGHT_DEFAULT, LIGHT_CHANGE_DIMENSIONS, 2s);
|
||||
break;
|
||||
case EVENT_DELAY_MOVE_TO_DESTROY_P:
|
||||
me->GetMotionMaster()->MovePoint(POINT_DESTROY_PLATFORM_P_TWO, MalygosPositions[0]);
|
||||
@@ -916,7 +916,7 @@ public:
|
||||
me->GetMotionMaster()->MovePoint(POINT_IDLE_P_THREE, MalygosPositions[4]);
|
||||
break;
|
||||
case EVENT_START_P_THREE:
|
||||
me->GetMap()->SetZoneOverrideLight(AREA_EYE_OF_ETERNITY, LIGHT_DEFAULT, LIGHT_OBSCURE_ARCANE_RUNES, 1 * IN_MILLISECONDS);
|
||||
me->GetMap()->SetZoneOverrideLight(AREA_EYE_OF_ETERNITY, LIGHT_DEFAULT, LIGHT_OBSCURE_ARCANE_RUNES, 1s);
|
||||
DoCast(me, SPELL_CLEAR_ALL_DEBUFFS);
|
||||
DoCast(me, SPELL_IMMUNE_CURSES);
|
||||
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
Reference in New Issue
Block a user