
eventloadactor BURNINGSMOKE
getactor[THISACTOR].hitag HITAGSET
setactor[THISACTOR].hitag 0
ifvare HITAGSET 1 setactorvar[THISACTOR].active 1
getactor[THISACTOR].xrepeat save_repeatx
getactor[THISACTOR].yrepeat save_repeaty
getactor[THISACTOR].xvel rx_can
ifvarn rx_can 0 { 
setactor[THISACTOR].xrepeat 2
setactor[THISACTOR].yrepeat 2
getactor[THISACTOR].cstat exp_cstat
cstator 32768 }
enda

useractor notenemy BURNINGSMOKE
getactorvar[THISACTOR].spriteid tmp
ifvarn tmp -1 ifvarn tmp 16384
{
getactorvar[THISACTOR].kill_smoke kill_smoke
cstat 642 sizeat 24 24
getactor[tmp].x x
getactor[tmp].y y
getactor[tmp].z z
addvar z -18000
setactor[THISACTOR].x x
setactor[THISACTOR].y y
setactor[THISACTOR].z z
ifvare kill_smoke 1 killit
}
else
{
ifvarn rx_can 0
{
	getactorvar[THISACTOR].active active
	ifvare active 0 
	{ 
	getactor[THISACTOR].xrepeat xrepeat
	getactor[THISACTOR].yrepeat yrepeat
	ifvarvarg xrepeat 2 subvarvar xrepeat 2
	ifvarvarg yrepeat 2 subvarvar yrepeat 2
	setactor[THISACTOR].xrepeat xrepeat
	setactor[THISACTOR].yrepeat yrepeat
	ifvarvare xrepeat 2 ifvarvare yrepeat 2 cstator 32768 
	} else 
	{
		setactor[THISACTOR].cstat exp_cstat
		getactor[THISACTOR].xrepeat xrepeat
		getactor[THISACTOR].yrepeat yrepeat
		ifvarvarl xrepeat save_repeatx addvar xrepeat 2
		setactor[THISACTOR].xrepeat xrepeat
		ifvarvarl yrepeat save_repeaty addvar yrepeat 2
		setactor[THISACTOR].yrepeat yrepeat
	}
	fall
}
}
enda

eventloadactor SMOKE2
getactor[THISACTOR].hitag HITAGSET
setactor[THISACTOR].hitag 0
ifvare HITAGSET 1 setactorvar[THISACTOR].active 1
getactor[THISACTOR].xrepeat save_repeatx
getactor[THISACTOR].yrepeat save_repeaty
getactor[THISACTOR].xvel rx_can
ifvarn rx_can 0 
{ 
setactor[THISACTOR].xrepeat 2
setactor[THISACTOR].yrepeat 2
cstat 32768 
}
enda

useractor notenemy SMOKE2
getactorvar[THISACTOR].spriteid tmp
ifvarn tmp -1 ifvarn tmp 16384
{
	getactorvar[THISACTOR].kill_smoke kill_smoke
	cstat 130 sizeat 24 24
	getactor[tmp].x x
	getactor[tmp].y y
	getactor[tmp].z z
	addvar z -13240
	setactor[THISACTOR].x x
	setactor[THISACTOR].y y
	setactor[THISACTOR].z z
	ifvare kill_smoke 1 killit
}
else
{
ifvarn rx_can 0
{
	getactorvar[THISACTOR].active active
	ifvare active 0 
	{ 
	getactor[THISACTOR].xrepeat xrepeat
	getactor[THISACTOR].yrepeat yrepeat
	ifvarvarg xrepeat 2 subvarvar xrepeat 2
	ifvarvarg yrepeat 2 subvarvar yrepeat 2
	setactor[THISACTOR].xrepeat xrepeat
	setactor[THISACTOR].yrepeat yrepeat
	ifvarvare xrepeat 2 ifvarvare yrepeat 2 cstat 32768 
	} else 
	{
		cstat 0
		getactor[THISACTOR].xrepeat xrepeat
		getactor[THISACTOR].yrepeat yrepeat
		ifvarvarl xrepeat save_repeatx addvar xrepeat 2
		setactor[THISACTOR].xrepeat xrepeat
		ifvarvarl yrepeat save_repeaty addvar yrepeat 2
		setactor[THISACTOR].yrepeat yrepeat
	}
	fall
}
}
enda

//ZBURNED
action ABURNINGGUYWALK1  0 6 -5 1 17
action ABURNINGGUYWALK2  20 6 -5 -1 15
action ABURNINGGUYFALL -383 3 1 1 25
action ABURNINGGUYDYING -378 4 1 1 10
action ABURNINGGUYDYING2 -411 3 1 1 15
action ABURNINGGUYDEAD -407 1 1 1 1

action ABURNINGCULTDYING -1653 6 1 1 17
action ABURNINGCULTDEAD -367 1 1 1 1

move BURNINGGUYWALK 140
move BURNINGGUYSTOP 

ai AIBURNINGGUYWALK ABURNINGGUYWALK1 BURNINGGUYWALK faceplayer
ai AIBURNINGGUYFALL ABURNINGGUYFALL BURNINGGUYSTOP
ai AIBURNINGGUYDYING ABURNINGGUYDYING BURNINGGUYSTOP
ai AIBURNINGGUYDYING2 ABURNINGGUYDYING2 BURNINGGUYSTOP
ai AIBURNINGGUYDEAD ABURNINGGUYDEAD BURNINGGUYSTOP
ai AIBURNINGCULTDYING ABURNINGCULTDYING BURNINGGUYSTOP 
ai AIBURNINGCULTDEAD ABURNINGCULTDEAD BURNINGGUYSTOP 

spriteshadow BURNINGGUY
spritenoshade BURNINGGUY

useractor notenemy BURNINGGUY fall
setactorvar[THISACTOR].width 128
setactorvar[THISACTOR].height 8192
getactorvar[THISACTOR].bguy_id bguy_id
ifai NO 
{ 
	setactorvar[THISACTOR].lights_on 1
	cstator 257
	setactor[THISACTOR].extra 1000
	ai AIBURNINGGUYWALK
	espawn BURNINGSMOKE
	setactorvar[RETURN].spriteid THISACTOR
	setvarvar smoke_id RETURN
	ifvare bguy_id 1 { soundonce AZOMPAIN } else 
	ifvare bguy_id 2 { ifrnd 85 { soundonce CULTFIR1 } else ifrnd 85 { soundonce CULTFIR2 } else soundonce CULTFIR3 } else 
	ifvare bguy_id 3 { soundonce FZOMPAIN }
}
ifai AIBURNINGGUYWALK 
{ 	
	//ifaction ABURNINGGUYWALK1 ifactioncount 3 action ABURNINGGUYWALK2
	//ifaction ABURNINGGUYWALK2 ifactioncount 4 action ABURNINGGUYWALK1
	ifpdistl 1024 
	{ 
		ifvare bguy_id 2 
		{ 
			stopsound CULTFIR1
			stopsound CULTFIR2	
			stopsound CULTFIR3 
			soundonce CULTDIE1 
			setvarvar in1 50
			setvar in2 JIBS9
			state spawn_multiply
			setactorvar[smoke_id].kill_smoke 1
			cstat 0
			setactorvar[THISACTOR].lights_on 0
			ai AIBURNINGCULTDYING 
		} else 
		{ 
			setactorvar[smoke_id].kill_smoke 1
			setvarvar in1 50
			setvar in2 JIBS9
			state spawn_multiply		
			ai AIBURNINGGUYFALL 
		}
		setactor[THISACTOR].extra 0
	} 
	
	else 
	ifcount 52 
	{ 
		ifvare bguy_id 1 { soundonce AZOMDIE1 ai AIBURNINGGUYFALL } 
		ifvare bguy_id 3 { ifrnd 85 soundonce FZOMDIE1 else ifrnd 85 soundonce FZOMDIE2 else soundonce FZOMDIE3 ai AIBURNINGGUYFALL } 
		ifvare bguy_id 2
		{
			ifrnd 128
			{
				ifrnd 64 soundonce CULTDIE1 else ifrnd 64 soundonce CULTDIE2 else soundonce CULTDIE3 ai AIBURNINGGUYFALL
			} else
			{
				stopsound CULTFIR1
				stopsound CULTFIR2	
				stopsound CULTFIR3 
				soundonce CULTDIE1 
				setvarvar in1 50
				setvar in2 JIBS9
				state spawn_multiply
				cstat 0
				ai AIBURNINGCULTDYING 
			}
		}
		ifvare bguy_id 4 { ai AIBURNINGGUYFALL } 
		setactorvar[smoke_id].kill_smoke 1
		setactor[THISACTOR].extra 0
	} 
	
} 
ifai AIBURNINGGUYFALL 
{ 
	cstat 0
	ifvare peractor 0
	{
		setvarvar in1 20
		setvar in2 JIBS9
		state spawn_multiply
		state bloodspraystate  
		state bloodspraystate 
		state bloodspraystate
		espawn SMOKE2
		setactorvar[RETURN].spriteid THISACTOR
		setvarvar smoke_id RETURN
		setvar peractor 1
	}
	ifactioncount 3 ai AIBURNINGGUYDYING 
	
}
ifai AIBURNINGGUYDYING	
{
ifcount 104 ai AIBURNINGGUYDYING2
}
ifai AIBURNINGGUYDYING2	ifactioncount 3 { setactorvar[smoke_id].kill_smoke 1 setactorvar[THISACTOR].lights_on 0 ai AIBURNINGGUYDEAD }


ifai AIBURNINGCULTDYING
{
	sizeat 28 28
	ifactioncount 6	{ setactorvar[THISACTOR].lights_on 0 ai AIBURNINGCULTDEAD }
}
enda