Core/SAI: added new action SMART_ACTION_PLAY_ANIMKIT
This commit is contained in:
1 parent
5bfc7e25f9
commit
546d71a7b4
3 files changed
+60
-1
No files matched your search
@@ -2511,6 +2511,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;
|
||||
}
|
||||
case SMART_ACTION_REMOVE_AURAS_BY_TYPE: // can be used to exit vehicle for example
|
||||
{
|
||||
ObjectList* targets = GetTargets(e, unit);
|
||||
|
||||
Reference in new issue
Block a user