name		Destro_Heli
health		300
nomove		1 1
type		enemy
death		1
nodieblink	2
nopain		1
cantgrab	1
nodrop		2
hostile		player npc
candamage	player npc obstacle

load		Burster
load		Viper2
load		HeliTarget

animationscript data/scripts/heli.c
takedamagescript data/scripts/blink.c

palette		data/chars/destro_heli/heli.png
alternatepal	data/chars/destro_heli/blink.png


anim spawn
	delay	200
        offset  60 210
        @cmd	dasher 1 0 0
	sound   data/sounds/heli1.wav
	frame	data/chars/destro_heli/heli
	delay	100
        @cmd	dasher 0 0 0
        @cmd	spawn01 "Viper2" 0 105 3
        frame	data/chars/destro_heli/heli
        @cmd	dasher -1 0 0
        frame	data/chars/destro_heli/heli
        @cmd	dasher 0 0 0
        @cmd	spawnSlave "HeliTarget" 1 60 0 0
        frame	data/chars/destro_heli/heli

anim idle
	loop	1
	delay	10
        offset  60 210
        bbox    0 6 208 120
	frame	data/chars/destro_heli/heli2
	@cmd	attack0 "ANI_FOLLOW1"
	frame	data/chars/destro_heli/heli2

anim follow1
@script
    void self = getlocalvar("self");

    if( frame == 0){
      int r = rand()%30;

      if( r > 0){
        changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW2"));
      }
    }
@end_script
	loop	1
	delay	1
        offset  60 210
        bbox    0 6 208 120
        attack	0 6 208 120 10 1 1 0 10 20
	dropv	2 3 0
        @cmd	dasher 0 0 0
	frame	data/chars/destro_heli/heli2
	delay	40
        @cmd	dasher 0 0 0.25
        frame	data/chars/destro_heli/heli2
        @cmd	dasher 0 0 -0.25
        frame	data/chars/destro_heli/heli2
        @cmd	spawnEnemy "Viper2" 0 105 3
        frame	data/chars/destro_heli/heli2
        @cmd	dasher 0 0 0.25
        frame	data/chars/destro_heli/heli2
        frame	data/chars/destro_heli/heli
        @cmd	dasher 0 0 -0.25
	@cmd	anichangeSl 1 "ANI_FOLLOW1"
        frame	data/chars/destro_heli/heli
	delay	10
        @cmd	dasher 0 0 0
	@cmd	Sltarget 1 2 2 160 0 0 0
	@cmd	shootT "Burster" 160 0 0
        frame	data/chars/destro_heli/heli3
        frame	data/chars/destro_heli/heli4
        frame	data/chars/destro_heli/heli3
        frame	data/chars/destro_heli/heli4
        frame	data/chars/destro_heli/heli3
        frame	data/chars/destro_heli/heli4
        frame	data/chars/destro_heli/heli3
        frame	data/chars/destro_heli/heli4
        frame	data/chars/destro_heli/heli3
        frame	data/chars/destro_heli/heli4
        frame	data/chars/destro_heli/heli3
        attack	0
        frame	data/chars/destro_heli/heli4
	delay	60
        attack	0 6 208 120 10 1 1 0 10 20
	dropv	2 5 0
        frame	data/chars/destro_heli/heli
	delay	40
        @cmd	dasher 0 0 -0.25
        frame	data/chars/destro_heli/heli
        @cmd	dasher 0 0 0.25
        frame	data/chars/destro_heli/heli2

anim follow2
@script
    void self = getlocalvar("self");

    if( frame == 0){
      int r = rand()%30;

      if( r > 0){
        changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW1"));
      }
    }
@end_script
	loop	1
	delay	1
        offset  60 210
        bbox    0 6 208 120
        attack	0 6 208 120 10 1 1 0 10 20
	dropv	2 5 0
        @cmd	dasher 0 0 0
	frame	data/chars/destro_heli/heli2
	delay	40
        @cmd	dasher 0 0 -0.4
        frame	data/chars/destro_heli/heli2
        @cmd	dasher 0 0 0.4
        frame	data/chars/destro_heli/heli2
        frame	data/chars/destro_heli/heli2
        @cmd	dasher 0 0 -0.4
        frame	data/chars/destro_heli/heli2
        frame	data/chars/destro_heli/heli
        @cmd	dasher 0 0 0.4
	@cmd	anichangeSl 1 "ANI_FOLLOW1"
        frame	data/chars/destro_heli/heli
	delay	10
        @cmd	dasher 0 0 0
	@cmd	Sltarget 1 2 2 160 0 0 0
	@cmd	shootT "Burster" 160 0 0
        frame	data/chars/destro_heli/heli3
        frame	data/chars/destro_heli/heli4
        frame	data/chars/destro_heli/heli3
        frame	data/chars/destro_heli/heli4
        frame	data/chars/destro_heli/heli3
        frame	data/chars/destro_heli/heli4
        frame	data/chars/destro_heli/heli3
        frame	data/chars/destro_heli/heli4
        frame	data/chars/destro_heli/heli3
        frame	data/chars/destro_heli/heli4
        frame	data/chars/destro_heli/heli3
        attack	0
        frame	data/chars/destro_heli/heli4
	delay	60
        attack	0 6 208 120 10 1 1 0 10 20
	dropv	2 5 0
        frame	data/chars/destro_heli/heli
	delay	40
        @cmd	dasher 0 0 0.4
        @cmd	spawnEnemy "Viper2" 0 105 3
        frame	data/chars/destro_heli/heli
        @cmd	dasher 0 0 -0.4
        frame	data/chars/destro_heli/heli2

anim walk
	loop	1
	delay	100
        offset  60 210
        bbox    0 6 208 120
	frame	data/chars/destro_heli/heli
        frame	data/chars/destro_heli/heli

anim pain
	delay	5
        offset  60 210
	frame	data/chars/destro_heli/heli

anim fall
	delay	5
        offset  60 210
	frame	data/chars/destro_heli/heli

anim rise
	delay	5
        offset  60 210
	frame	data/chars/destro_heli/heli


anim death 
        delay	20
        offset  60 210
        quakeframe 0 20 -1
	frame	data/chars/destro_heli/heli
	@cmd	killgun 1 0
        @cmd	dasher -1 0 0
        @cmd	spawn01 "Asap" 0 105 2
        @cmd	spawn01 "Asap" 100 130 2
        @cmd	spawn01 "Asap" -50 155 2
        @cmd	spawn01 "Asap" 50 180 2
        frame	data/chars/destro_heli/heli
        @cmd	spawn01 "Asap" 125 105 2
        @cmd	spawn01 "Asap" 50 105 2
        @cmd	spawn01 "Asap" -50 130 2
        @cmd	spawn01 "Asap" 0 155 2
        @cmd	spawn01 "Asap" 100 180 2
        frame	data/chars/destro_heli/heli
        @cmd	spawn01 "Asap" -50 105 2
        @cmd	spawn01 "Asap" 50 130 2
        @cmd	spawn01 "Asap" 100 155 2
        @cmd	spawn01 "Asap" 0 180 2
        frame	data/chars/destro_heli/heli
        @cmd	spawn01 "Asap" 100 105 2
        @cmd	spawn01 "Asap" 0 130 2
        @cmd	spawn01 "Asap" 125 130 2
        @cmd	spawn01 "Asap" 50 155 2
        @cmd	spawn01 "Asap" -50 180 2
        frame	data/chars/destro_heli/heli #
        @cmd	spawn01 "Asap" 0 105 2
        @cmd	spawn01 "Asap" 100 130 2
        @cmd	spawn01 "Asap" -50 155 2
        @cmd	spawn01 "Asap" 50 180 2
        frame	data/chars/destro_heli/heli
        @cmd	spawn01 "Asap" 125 105 2
        @cmd	spawn01 "Asap" 50 105 2
        @cmd	spawn01 "Asap" -50 130 2
        @cmd	spawn01 "Asap" 0 155 2
        @cmd	spawn01 "Asap" 100 180 2
        frame	data/chars/destro_heli/heli
        @cmd	spawn01 "Asap" -50 105 2
        @cmd	spawn01 "Asap" 50 130 2
        @cmd	spawn01 "Asap" 100 155 2
        @cmd	spawn01 "Asap" 0 180 2
        frame	data/chars/destro_heli/heli
        @cmd	spawn01 "Asap" 100 105 2
        @cmd	spawn01 "Asap" 0 130 2
        @cmd	spawn01 "Asap" 125 130 2
        @cmd	spawn01 "Asap" 50 155 2
        @cmd	spawn01 "Asap" -50 180 2
        frame	data/chars/destro_heli/heli #
        @cmd	spawn01 "Asap" 0 105 2
        @cmd	spawn01 "Asap" 100 130 2
        @cmd	spawn01 "Asap" -50 155 2
        @cmd	spawn01 "Asap" 50 180 2
        frame	data/chars/destro_heli/heli
        @cmd	spawn01 "Asap" 125 105 2
        @cmd	spawn01 "Asap" 50 105 2
        @cmd	spawn01 "Asap" -50 130 2
        @cmd	spawn01 "Asap" 0 155 2
        @cmd	spawn01 "Asap" 100 180 2
        frame	data/chars/destro_heli/heli
        @cmd	spawn01 "Asap" -50 105 2
        @cmd	spawn01 "Asap" 50 130 2
        @cmd	spawn01 "Asap" 100 155 2
        @cmd	spawn01 "Asap" 0 180 2
        frame	data/chars/destro_heli/heli
        @cmd	spawn01 "Asap" 100 105 2
        @cmd	spawn01 "Asap" 0 130 2
        @cmd	spawn01 "Asap" 125 130 2
        @cmd	spawn01 "Asap" 50 155 2
        @cmd	spawn01 "Asap" -50 180 2
        frame	data/chars/destro_heli/heli #
        @cmd	spawn01 "Asap" 0 105 2
        @cmd	spawn01 "Asap" 100 130 2
        @cmd	spawn01 "Asap" -50 155 2
        @cmd	spawn01 "Asap" 50 180 2
        frame	data/chars/destro_heli/heli
        @cmd	spawn01 "Asap" 125 105 2
        @cmd	spawn01 "Asap" 50 105 2
        @cmd	spawn01 "Asap" -50 130 2
        @cmd	spawn01 "Asap" 0 155 2
        @cmd	spawn01 "Asap" 100 180 2
        frame	data/chars/destro_heli/heli
        @cmd	spawn01 "Asap" -50 105 2
        @cmd	spawn01 "Asap" 50 130 2
        @cmd	spawn01 "Asap" 100 155 2
        @cmd	spawn01 "Asap" 0 180 2
        frame	data/chars/destro_heli/heli
        @cmd	spawn01 "Asap" 100 105 2
        @cmd	spawn01 "Asap" 0 130 2
        @cmd	spawn01 "Asap" 125 130 2
        @cmd	spawn01 "Asap" 50 155 2
        @cmd	spawn01 "Asap" -50 180 2
        frame	data/chars/destro_heli/heli #
        @cmd	spawn01 "Asap" 0 105 2
        @cmd	spawn01 "Asap" 100 130 2
        @cmd	spawn01 "Asap" -50 155 2
        @cmd	spawn01 "Asap" 50 180 2
        frame	data/chars/destro_heli/heli
        @cmd	spawn01 "Asap" 125 105 2
        @cmd	spawn01 "Asap" 50 105 2
        @cmd	spawn01 "Asap" -50 130 2
        @cmd	spawn01 "Asap" 0 155 2
        @cmd	spawn01 "Asap" 100 180 2
        frame	data/chars/destro_heli/heli
        @cmd	spawn01 "Asap" -50 105 2
        @cmd	spawn01 "Asap" 50 130 2
        @cmd	spawn01 "Asap" 100 155 2
        @cmd	spawn01 "Asap" 0 180 2
        frame	data/chars/destro_heli/heli
        @cmd	spawn01 "Asap" 100 105 2
        @cmd	spawn01 "Asap" 0 130 2
        @cmd	spawn01 "Asap" 125 130 2
        @cmd	spawn01 "Asap" 50 155 2
        @cmd	spawn01 "Asap" -50 180 2
        frame	data/chars/destro_heli/heli #
	@cmd	suicide
        frame	data/chars/destro_heli/heli
