# ----------------------------------------------------------------------------- #
# This header is used by images.dat entries:
# 050 Mortothrokor (cm\zerg\mortothrokor.grp)
.headerstart
IsId          	743
Type          	26
Init          	MortothrokorInit
Death         	MortothrokorDeath
GndAttkInit   	MortothrokorGndAttkInit
AirAttkInit   	[NONE]
Unused1       	MortothrokorUnused1
GndAttkRpt    	MortothrokorGndAttkRpt
AirAttkRpt    	[NONE]
CastSpell     	[NONE]
GndAttkToIdle 	MortothrokorGndAttkToIdle
AirAttkToIdle 	[NONE]
Unused2       	[NONE]
Walking       	MortothrokorWalking
WalkingToIdle 	MortothrokorGndAttkToIdle
SpecialState1 	[NONE]
SpecialState2 	MortothrokorSpecialState2
AlmostBuilt   	[NONE]
Built         	[NONE]
Landing       	[NONE]
LiftOff       	[NONE]
IsWorking     	[NONE]
WorkingToIdle 	[NONE]
WarpIn        	[NONE]
Unused3       	[NONE]
StarEditInit  	[NONE]
Disable       	[NONE]
Burrow        	MortothrokorBurrow
UnBurrow      	MortothrokorUnBurrow
Enable        	[NONE]
.headerend
# ----------------------------------------------------------------------------- #

MortothrokorInit:
	imgul             	1736 0 0 # Mortothrokor Shadow (cm\zerg\mortothrokor-shadow.grp)
MortothrokorGndAttkToIdle:
	playfram          	0x00
	goto              	MortothrokorLocal00

MortothrokorLocal00:
	wait              	62
	randcondjmp       	25 MortothrokorLocal01
	randcondjmp       	128 MortothrokorLocal02
	goto              	MortothrokorLocal00

MortothrokorLocal01:
	playfram          	0x55
	wait              	1
	playfram          	0x66
	wait              	10
	playfram          	0x55
	wait              	1
	playfram          	0x00
	wait              	1
	goto              	MortothrokorGndAttkToIdle

MortothrokorLocal02:
	randcondjmp       	128 MortothrokorLocal03
	playfram          	0x11
	wait              	1
	turnccwise        	1
	playfram          	0x22
	wait              	1
	turnccwise        	1
	playfram          	0x33
	wait              	1
	turnccwise        	1
	playfram          	0x44
	wait              	1
	turnccwise        	1
	playfram          	0x33
	wait              	1
	turnccwise        	1
	playfram          	0x22
	wait              	1
	turnccwise        	1
	playfram          	0x11
	wait              	1
	turnccwise        	1
	goto              	MortothrokorGndAttkToIdle

MortothrokorLocal03:
	playfram          	0x11
	wait              	1
	turncwise         	1
	playfram          	0x22
	wait              	1
	turncwise         	1
	playfram          	0x33
	wait              	1
	turncwise         	1
	playfram          	0x44
	wait              	1
	turncwise         	1
	playfram          	0x33
	wait              	1
	turncwise         	1
	playfram          	0x22
	wait              	1
	turncwise         	1
	playfram          	0x11
	wait              	1
	turncwise         	1
	goto              	MortothrokorGndAttkToIdle

MortothrokorDeath:
	playsnd           	878 # Zerg\Ultra\ZUlDth00.WAV
	setfldirect       	0
	playfram          	595
	wait              	2
	playfram          	596
	wait              	2
	playfram          	597
	wait              	2
	playfram          	598
	wait              	2
	playfram          	599
	wait              	2
	playfram          	600
	wait              	2
	playfram          	601
	wait              	2
	lowsprul			868 0 0 # Mortothrokor Remnants (cm\zerg\mortothrokor-remnants.grp)
	wait              	1
	end
	
MortothrokorUnused1:
	wait				1
	nobrkcodestart
	setfldirect       	0
	playsnd				1181 # Ultrokor revive 01
	playfram			173
	wait				2
	playfram			172
	wait				2
	playfram			171
	wait				2
	playfram			170
	wait				12
	setfldirect       	14
	nobrkcodeend
	goto				MortothrokorGndAttkToIdle

MortothrokorGndAttkInit:
	playfram          	0x00
MortothrokorGndAttkRpt:
	wait              	1
	nobrkcodestart
	playsndrand       	3 891 892 893 # Zerg\Ultra\zulAtt00.WAV | Zerg\Ultra\zulAtt01.WAV | Zerg\Ultra\zulAtt02.WAV
	wait              	1
	playfram          	0xBB
	wait              	1
	playfram          	0xCC
	attackwith 			1
	playsndbtwn			894 895	# Zerg\Ultra\zulHit00.WAV | Zerg\Ultra\zulHit01.WAV
	wait              	1
	playfram			0xDD
	wait				1
	playfram			0xEE
	attackwith 			1
	playsndbtwn			894 895	# Zerg\Ultra\zulHit00.WAV | Zerg\Ultra\zulHit01.WAV
	wait				1
	playfram			0xFF
	wait				1
	playfram          	0x110
	wait              	1
	playfram          	0x121
	wait              	1
	playfram          	0x132
	wait              	1
	playfram          	0x143
	wait              	1
	nobrkcodeend
	gotorepeatattk
	goto              	MortothrokorGndAttkToIdle

MortothrokorWalking:
	move              	4
	playfram          	0x11
	wait				1
	move              	4
	playfram          	0x22
	wait				1
	move              	4
	playfram          	0x33
	wait				1
	move              	4
	playfram          	0x44
	wait				1
	move              	4
	playfram          	0x55
	wait				1
	move              	4
	playfram          	0x66
	wait				1
	move              	4
	playfram          	0x77
	wait				1
	move              	4
	playfram          	0x88
	wait				1
	move              	4
	playfram          	0x99
	wait				1
	move              	4
	playfram          	0xAA
	wait				1
	goto              	MortothrokorWalking
	
MortothrokorSpecialState2:
 	playfram          	0xAF
	goto              	ZoryusthalethLocal07

MortothrokorBurrow:
    setfldirect			14
    imgol      			423 0 0 # Burrowing Dust (thingy\bDust.grp)
    playfram   			0x165
    wait       			1
    playfram   			0x176
    wait       			1
    playfram   			0x187
    wait       			1
    playfram   			0x198
    wait       			1
    playfram   			0x1A9
    wait       			1
    imgol      			423 0 0 # Burrowing Dust (thingy\bDust.grp)
    playfram   			0x1C0
    wait       			1
    playfram   			0x1DA
    wait       			1
    playfram   			0x1EB
    wait       			1
    playfram   			0x1FC
    wait       			1
    playfram   			0x20D
    wait       			1
    playfram   			0x21E
    wait       			1
    playfram   			0x22F
    wait       			1
    playfram   			0x240
    wait       			1
    sigorder   			4
    goto       			ZoryusthalethLocal07

MortothrokorUnBurrow:
    wait                1
    waitrand            1 2
    setfldirect         14
    imgul               423 0 0 # Burrowing Dust (thingy\bDust.grp)
    playfram            0x22F
    wait                1
    playfram            0x20D
    wait                1
    playfram            0x1DA
    wait                1
    playfram            0x185
    wait                1
    playfram            0x176
    wait                1
    playfram            0x165
    wait                1
    sigorder            4
    goto                MortothrokorGndAttkToIdle