This is a modification of the rifleman animation set. I've added the pikeman melee combat animations to the set, resulting in riflemen who, when attack in close combat, will fight back with a mounted bayonet.
No extra files or modifications are needed as long as the directory structure is unchanged. The rifleman_fx.nif is just a copy of the rifleman.nif, therefore it can be deleted if the CIV4ArtDefines_Unit.xml is changed accordingly.
If the riflemen also should engage in close combat when fighting range units, the bActAsRanged entry of the rifleman should be changed to <bActAsRanged>0</bActAsRanged>. However, this way the only time when the riflemen shoot will be when they do a first strike.
See also my similar modification for the Infantry here.
Forum link: http://forums.civfanatics.com/showthread.php?p=8896155#post8896155
Gagonite for his tutorial 'Modifying the Visibilty of Weapons', that also covers how to add other units animations to a unit.
Rifleman with Melee Combat Animations 2016-10-05
Rifleman with Melee Combat Animations