mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-15 20:52:22 -04:00
Core/SmartAI: implement SMART_ACTION_OVERRIDE_LIGHT and SMART_ACTION_OVERRIDE_WEATHER (#24146)
* Core\SmartAI: implement SMART_ACTION_OVERRIDE_LIGHT and SMART_ACTION_OVERRIDE_WEATHER
* Change the invoker of action to any worldobject
* Revert "Change the invoker of action to any worldobject"
This reverts commit 2e15f7258553b7057c3e8f67c54efc77fb6d75b8.
* Add dbc-validations for new actions
* Use GetBaseObject() instead of Creature* for new actions. Add debug-logging
(cherry picked from commit c65ba35269)
This commit is contained in:
@@ -2430,6 +2430,26 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_OVERRIDE_LIGHT:
|
||||
{
|
||||
if (WorldObject* obj = GetBaseObject())
|
||||
{
|
||||
obj->GetMap()->SetZoneOverrideLight(e.action.overrideLight.zoneId, e.action.overrideLight.lightId, e.action.overrideLight.fadeInTime);
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_OVERRIDE_LIGHT: %s sets zone override light (zoneId: %u, lightId: %u, fadeInTime: %u)",
|
||||
obj->GetGUID().ToString().c_str(), e.action.overrideLight.zoneId, e.action.overrideLight.lightId, e.action.overrideLight.fadeInTime);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_OVERRIDE_WEATHER:
|
||||
{
|
||||
if (WorldObject* obj = GetBaseObject())
|
||||
{
|
||||
obj->GetMap()->SetZoneWeather(e.action.overrideWeather.zoneId, (WeatherState)e.action.overrideWeather.weatherId, float(e.action.overrideWeather.weatherGrade));
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_OVERRIDE_WEATHER: %s sets zone weather (zoneId: %u, weatherId: %u, weatherGrade: %u)",
|
||||
obj->GetGUID().ToString().c_str(), e.action.overrideWeather.zoneId, e.action.overrideWeather.weatherId, e.action.overrideWeather.weatherGrade);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_PLAY_SPELL_VISUAL_KIT:
|
||||
{
|
||||
for (WorldObject* const target : targets)
|
||||
|
||||
Reference in New Issue
Block a user