Core/SAI: implement new smart actions to change AI Animkits and to enable/disable hover movement (#25623)

* Core/SAI: implement new smart actions to change AI Animkits and to enable/disable hover movement for units

SMART_ACTION_SET_AI_ANIM_KIT (parameter 1: animKitId)
SMART_ACTION_SET_HOVER (parameter1: enable/disable)

* Update SmartScriptMgr.cpp

* Update SmartScript.cpp

* removed SMART_ACTION_SET_AI_ANIM_KIT since it's reserved for master
This commit is contained in:
Ovah
2020-12-26 23:31:25 +01:00
committed by GitHub
parent 8217519ea2
commit b7ba856b63
3 changed files with 14 additions and 1 deletions

View File

@@ -2367,6 +2367,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
}
break;
}
case SMART_ACTION_SET_HOVER:
for (WorldObject* target : targets)
if (IsUnit(target))
target->ToUnit()->SetHover(e.action.setHover.enable != 0);
break;
default:
TC_LOG_ERROR("sql.sql", "SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
break;

View File

@@ -1668,6 +1668,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_SPAWN_SPAWNGROUP:
case SMART_ACTION_DESPAWN_SPAWNGROUP:
case SMART_ACTION_PLAY_CINEMATIC:
case SMART_ACTION_SET_HOVER:
break;
default:
TC_LOG_ERROR("sql.sql", "SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id);

View File

@@ -596,8 +596,10 @@ enum SMART_ACTION
SMART_ACTION_PLAY_SPELL_VISUAL_KIT = 137, // spellVisualKitId (RESERVED, PENDING CHERRYPICK)
SMART_ACTION_OVERRIDE_LIGHT = 138, // zoneId, overrideLightID, transitionMilliseconds
SMART_ACTION_OVERRIDE_WEATHER = 139, // zoneId, weatherId, intensity
SMART_ACTION_SET_AI_ANIM_KIT = 140, // don't use on 3.3.5a
SMART_ACTION_SET_HOVER = 141, // 0/1
SMART_ACTION_END = 140
SMART_ACTION_END = 142
};
struct SmartAction
@@ -1177,6 +1179,11 @@ struct SmartAction
uint32 intensity;
} overrideWeather;
struct
{
uint32 enable;
} setHover;
struct
{
uint32 toRespawnPosition;