mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-16 13:09:50 -04:00
Core/SAI: added new action SMART_ACTION_PLAY_ANIMKIT (#19170)
This commit is contained in:
@@ -2433,6 +2433,38 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
ENSURE_AI(SmartAI, me->AI())->SetEvadeDisabled(e.action.disableEvade.disable != 0);
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_PLAY_ANIMKIT:
|
||||
{
|
||||
ObjectList* targets = GetTargets(e, unit);
|
||||
if (!targets)
|
||||
break;
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
{
|
||||
if (IsCreature(*itr))
|
||||
{
|
||||
if (e.action.animKit.type == 0)
|
||||
(*itr)->ToCreature()->PlayOneShotAnimKitId(e.action.animKit.animKit);
|
||||
else if (e.action.animKit.type == 1)
|
||||
(*itr)->ToCreature()->SetAIAnimKitId(e.action.animKit.animKit);
|
||||
else if (e.action.animKit.type == 2)
|
||||
(*itr)->ToCreature()->SetMeleeAnimKitId(e.action.animKit.animKit);
|
||||
else if (e.action.animKit.type == 3)
|
||||
(*itr)->ToCreature()->SetMovementAnimKitId(e.action.animKit.animKit);
|
||||
else
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "SmartScript: Invalid type for SMART_ACTION_PLAY_ANIMKIT, skipping");
|
||||
break;
|
||||
}
|
||||
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_PLAY_ANIMKIT: target: %s (%s), AnimKit: %u, Type: %u",
|
||||
(*itr)->GetName().c_str(), (*itr)->GetGUID().ToString().c_str(), e.action.animKit.animKit, e.action.animKit.type);
|
||||
}
|
||||
}
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
TC_LOG_ERROR("sql.sql", "SmartScript::ProcessAction: Entry " SI64FMTD " SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user