e=v4543]
!!BU:Ev6/?y-1; [Stack number of new (Metamorph) creature stack: y-1]
!!BMy-1&v4543>=174/v4543<=191:E2; [Set Commander Monster Metamorph spell castings to 2]
!!BMv4542&v4543>=174/v4543<=191:U4/?y-14; [Target Commander's spell number: y-14]
!!BMy-1&v4543>=174/v4543<=191:U4/y-14; [Set Commander Monster Metamorph's spell number]
!!BMy-1&y-1>=0:F?y-2; [New (Metamorph's) Flags: y-2]
!!VRy-2:|67108864; [Add "done acting this round" Flag]
!!VRy-2&y-9=8388608:|8388608; [Set new Metamorph stack's "clone" bit if it was a clone]
!!VRy-2&y-10=4194304:|4194304; [Set new Metamorph stack's "summoned" bit if it was summoned]
!!BMy-1&y-1>=0:Fy-2; [Write modified Flags to (Metamorph) stack: y-2]

!!VRy-6:Sy-1 *-1 -1; [Negative of New Metamorph stack number: y-6]
!!EAy-6:Ov4543; [Copy Bonus Lines for new type (v4543) to Metamorph stack (y-6)]
!!EAy-6:Ey-5/2/v4543/d; [Set Experience of Metamorph stack: y-5]

!!VRz1&v5=1:Sz156003;
!!VRz1&v5>1:Sz156004;
!!UN:N3/2/v4543/1; [New creature name (plural): z2]
!!VRz3:Sz156005;
!!BU:Mz3; [Display scroll bar message]

!!BG:N?v10; [Next stack to act: v10]
!!BMv10:P?v13; [Next stack's position: v13]
!!BMv10:C2/v13/3/1/0; [Next stack casts dummy spell on self]

--------------------------------------------------------------------------------------------------------------------

 [Post-Action Trigger if Metamorph is being attacked and retaliates]
 [to see if it transforms into the creature type that attacked it]
!?BG1&v4601>=0/v4603=0/1000/-998; [After action - only if v4601 isn't less than 0]
!!UN:P56/?y-1; [Check if script is enabled: y-1]
!!BU:C?y-3; [Check if battle is ending this turn: y-3=1 if yes]
!!FU|y-1<>1/y-3=1:E; [Exit if script isn't enabled or battle is ending]

!!BMv4601:N?y-11; [Number of attacking monsters still alive after retaliation: y-11]
!!FU&y-11>0:E; [Exit if any still alive]

!!VRv1:Sv4602; [(Metamorph's) stack number: v1]
!!BMv1:T?v2 N?v3; [Type that Metamorph is currently: v2, Number in stack: v3]
!!MA:Pv2/?v4; [Health of one (Metamorph): v4]
!!VRv4:*v3; [Total h