name		 Serpentor
health		 600
speed		 10
type		 enemy
aimove		 avoid
gfxshadow	 1	 
nopain		 1
nodrop		 2
death		 1
aggression	 25
hostile		 player npc
candamage	 player obstacle npc
nodieblink	 2

animationscript	 data/chars/Serpentor/command.c
takedamagescript data/scripts/blink.c

palette		 data/chars/serpentor/idle1.gif
alternatepal	 data/chars/serpentor/blink.gif

load		 LBit
load		 Peluru


anim spawn
	offset	100 220
	delay	2000
	seta	300
	sound	data/chars/serpentor/serpentor.wav
	frame	data/chars/misc/empty.gif
	delay	100
	seta	0
	frame	data/chars/serpentor/idle1.gif

anim idle
	loop	1
	offset	100 220
	bbox	66 41 128 144
	delay	30
	frame	data/chars/serpentor/idle1.gif
	frame	data/chars/serpentor/idle2.gif

anim walk
	loop	1
	offset	100 220
	bbox	66 41 128 144
	delay	30
	frame	data/chars/serpentor/idle1.gif
	frame	data/chars/serpentor/idle2.gif


anim pain
	delay	8
	offset	100 220
	frame	data/chars/serpentor/idle1.gif
	frame	data/chars/serpentor/idle2.gif
	
anim fall
	delay	60
	offset	100 220
	frame	data/chars/serpentor/idle1.gif
	frame	data/chars/serpentor/idle2.gif

anim death
	delay	100
	offset	100 220
	frame	data/chars/serpentor/dead.gif
	delay	10
	blast	60 76 137 144 20 1
	@cmd	spawn01 "BXPlos2" 0 0 0
	frame	data/chars/misc/empty.gif

anim rise
	offset	100 220
	delay	12
	frame	data/chars/serpentor/idle1.gif
	frame	data/chars/serpentor/idle2.gif


anim attack4
@script
    void vSelf = getlocalvar("self");	

    if(frame==0){
      int MHealth = getentityproperty(vSelf,"maxhealth");
      int Health = getentityproperty(vSelf,"health");

      if(Health <= MHealth/2){
        changeentityproperty(vSelf, "animation", openborconstant("ANI_FOLLOW4"));
      }
    }
@end_script
	range	100 200
	rangez	-15 15
	delay	10
	offset	100 220
	bbox	66 41 128 144
	frame	data/chars/serpentor/idle1.gif
	delay	80
	@cmd	dasher -2 0 0
	frame	data/chars/serpentor/idle2.gif
	delay	20
	@cmd	dasher 0 0 0
	frame	data/chars/serpentor/idle1.gif
	delay	6
	frame	data/chars/serpentor/shoot1.gif
	frame	data/chars/serpentor/shoot2.gif
	sound	data/sounds/laser.wav
	@cmd	shooter2 "LBit" 106 145 1 2 -2 0
	frame	data/chars/serpentor/idle1.gif
	frame	data/chars/serpentor/shoot1.gif
	frame	data/chars/serpentor/shoot2.gif
	sound	data/sounds/laser.wav
	@cmd	shooter2 "LBit" 106 145 1 2 -2 0.2
	frame	data/chars/serpentor/idle1.gif
	frame	data/chars/serpentor/shoot1.gif
	frame	data/chars/serpentor/shoot2.gif
	delay   100
	sound	data/sounds/laser.wav
	@cmd	shooter2 "LBit" 106 145 1 2 -2 -0.2
	frame	data/chars/serpentor/idle1.gif

anim follow4
	delay	10
	offset	100 220
	bbox	66 41 128 144
	frame	data/chars/serpentor/idle1.gif
	delay	8
	frame	data/chars/serpentor/shoot1.gif
	frame	data/chars/serpentor/shoot2.gif
	frame	data/chars/serpentor/shoot1.gif
	frame	data/chars/serpentor/shoot2.gif
	frame	data/chars/serpentor/idle1.gif
	delay	20
	@cmd	target 2 1 300 0 0 1
	@cmd	dash 0 0
	frame	data/chars/serpentor/idle1.gif
	@cmd	target 2 1 300 0 0 1
	@cmd	dash 0 0
	frame	data/chars/serpentor/idle2.gif
	delay	10
	@cmd	target 2 1 300 0 0 1
	@cmd	dash 0 0
	sound	data/sounds/laser.wav
	@cmd	shooter2 "LBit" 106 145 1 2 -2 0
	frame	data/chars/serpentor/shoot1.gif
	frame	data/chars/serpentor/shoot2.gif
	@cmd	target 2 1 300 0 0 1
	@cmd	dash 0 0
	frame	data/chars/serpentor/idle1.gif
	@cmd	target 2 1 300 0 0 1
	@cmd	dash 0 0
	frame	data/chars/serpentor/idle2.gif
	@cmd	looper 5 9
	@cmd	dasher 0 0 0
	frame	data/chars/serpentor/idle1.gif
	delay   100
	frame	data/chars/serpentor/idle2.gif

anim attack1
@script
    void vSelf = getlocalvar("self");	

    if(frame==0){
      int MHealth = getentityproperty(vSelf,"maxhealth");
      int Health = getentityproperty(vSelf,"health");

      if(Health <= MHealth/2){
        changeentityproperty(vSelf, "animation", openborconstant("ANI_FOLLOW1"));
      }
    }
@end_script
	range	0 100
	rangez	-15 15
	delay	10
	offset	100 220
	bbox	66 41 128 144
	frame	data/chars/serpentor/idle1.gif
	delay	80
	@cmd	dasher -2 0 0
	frame	data/chars/serpentor/idle2.gif
	delay	50
	@cmd	dasher 0 0 0
	frame	data/chars/serpentor/idle1.gif
	delay   80
	attack  127 103 98 88 30 1 0 0 20
	dropv	2 4 0
	@cmd	target 3 1.5 0 0 0 1
	@cmd	dash 0 0
	frame	data/chars/serpentor/idle2.gif
	attack  0
	@cmd	dasher 0 0 0
	delay   100
	frame	data/chars/serpentor/idle1.gif

anim follow1
	delay	10
	offset	100 220
	bbox	66 41 128 144
	frame	data/chars/serpentor/idle1.gif
	delay	80
	@cmd	dasher -2 0 0
	frame	data/chars/serpentor/idle2.gif
	delay	50
	@cmd	dasher 0 0 0
	frame	data/chars/serpentor/idle1.gif
	delay	10
	frame	data/chars/serpentor/idle2.gif
	delay   80
	attack  127 103 98 88 30 1 0 0 20
	dropv	2 4 0
	@cmd	target 3 1.5 0 0 0 1
	@cmd	dash 0 0
	frame	data/chars/serpentor/idle1.gif
	attack  0
	@cmd	dasher 0 0 0
	delay   100
	frame	data/chars/serpentor/idle2.gif
	delay	10
	@cmd	looper 3 5
	frame	data/chars/serpentor/idle2.gif

anim attack3
@script
    void vSelf = getlocalvar("self");	

    if(frame==0){
      int MHealth = getentityproperty(vSelf,"maxhealth");
      int Health = getentityproperty(vSelf,"health");

      if(Health <= MHealth/2){
        changeentityproperty(vSelf, "animation", openborconstant("ANI_FOLLOW5"));
      }
    }
@end_script
	range	150 300
	rangez	15 45
	delay	50
	offset	100 220
	bbox	66 41 128 144
	frame	data/chars/serpentor/idle1.gif
	delay	10
	@cmd	dasher 0 0 1.5
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle2.gif
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle2.gif
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle1.gif
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle1.gif
	delay	100
	@cmd	dasher 0 0 0
	frame	data/chars/serpentor/idle2.gif

anim follow3
	delay	50
	offset	100 220
	bbox	66 41 128 144
	frame	data/chars/serpentor/idle1.gif
	delay	10
	@cmd	dasher 0 0 -1.5
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle2.gif
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle2.gif
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle1.gif
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle1.gif
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle2.gif
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle2.gif
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle1.gif
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle1.gif
	delay	100
	@cmd	dasher 0 0 0
	frame	data/chars/serpentor/idle2.gif

anim attack2
@script
    void vSelf = getlocalvar("self");	

    if(frame==0){
      int MHealth = getentityproperty(vSelf,"maxhealth");
      int Health = getentityproperty(vSelf,"health");

      if(Health <= MHealth/2){
        changeentityproperty(vSelf, "animation", openborconstant("ANI_FOLLOW5"));
      }
    }
@end_script
	range	150 300
	rangez	-45 -15
	delay	50
	offset	100 220
	bbox	66 41 128 144
	frame	data/chars/serpentor/idle1.gif
	delay	10
	@cmd	dasher 0 0 -1.5
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle2.gif
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle2.gif
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle1.gif
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle1.gif
	delay	100
	@cmd	dasher 0 0 0
	frame	data/chars/serpentor/idle2.gif

anim follow2
	delay	50
	offset	100 220
	bbox	66 41 128 144
	frame	data/chars/serpentor/idle1.gif
	delay	10
	@cmd	dasher 0 0 1.5
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle2.gif
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle2.gif
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle1.gif
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle1.gif
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle2.gif
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle2.gif
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle1.gif
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 128 73 0
	frame	data/chars/serpentor/idle1.gif
	delay	100
	@cmd	dasher 0 0 0
	frame	data/chars/serpentor/idle2.gif

anim follow5
@script
    void self = getlocalvar("self");
    int z = getentityproperty(self, "z");

    if(z == openborconstant("PLAYER_MIN_Z") ) {
      changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW2")); 
    } 

    if(z == openborconstant("PLAYER_MAX_Z") ) {
      changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW3")); 
    }
@end_script
	loop	1 2 4
	delay	10
	offset	100 220
	bbox	66 41 128 144
	frame	data/chars/serpentor/idle1.gif
	delay	20
	@cmd	dodgez -1 0 1
	frame	data/chars/serpentor/idle2.gif
	frame	data/chars/serpentor/idle1.gif
	frame	data/chars/serpentor/idle2.gif
	frame	data/chars/serpentor/idle1.gif
