class ApplyAnimWrappersOnWeapon extends AIbehaviortaskScript
{
	private editable var m_wrapperName : CName;
	private var m_refOwner : weak< AIActionTarget_Record >;
	private var m_owner : weak< GameObject >;
	private var m_ownerPosition : Vector4;
	private var m_animationController : AnimationControllerComponent;

	protected override function Activate( context : ScriptExecutionContext )
	{
		m_refOwner = TweakDBInterface.GetAIActionTargetRecord( T"AIActionTarget.Owner" );
	}

	protected override function Update( context : ScriptExecutionContext ) : AIbehaviorUpdateOutcome
	{
		var puppet : weak< ScriptedPuppet >;
		AIActionTarget.Get( context, m_refOwner, false, m_owner, m_ownerPosition );
		puppet = ( ( ScriptedPuppet )( m_owner ) );
		AnimationControllerComponent.SetAnimWrapperWeightOnOwnerAndItems( puppet, m_wrapperName, 1.0 );
		return AIbehaviorUpdateOutcome.IN_PROGRESS;
	}

	protected override function Deactivate( context : ScriptExecutionContext ) {}
}

