I found this old dragon script of mine. Unfortunantly i lost the graphics for it. So used graphics that come with Graal to make a HAT DRAGON!
NPC Code:
// NPC made by Ðarkman (NBK)
if (created) {timeout=.05;
this.angle=1;
this.count=100;
this.speed=.60;
this.length=200;
this.blength=20;
setarray this.breathx, this.blength;
setarray this.breathy, this.blength;
setarray this.trailx, this.length+1;
setarray this.traily, this.length+1;
this.turn=.1;
hearts=20;
this.rand=.1;}
if(timeout) {
this.count++;
this.tmx=x+cos(this.angle-1)*this.speed;
this.tmy=y+sin(this.angle-1)*this.speed;
this.tpx=x+cos(this.angle+1)*this.speed;
this.tpy=y+sin(this.angle+1)*this.speed;
this.disp=(((abs(this.tpx-(playerx+.5))^2)+(abs(this.tpy-(playery+.5))^2))^.05);
this.dism=(((abs(this.tmx-(playerx+.5))^2)+(abs(this.tmy-(playery+.5))^2))^.05);
if(this.disp>this.dism) {this.angle=this.angle-this.turn};
if(this.disp<this.dism) {this.angle=this.angle+this.turn};
this.angle=this.angle+random((-2*this.rand),(2*this.rand));
this.ox=x;
this.oy=y;
x=x+cos(this.angle)*this.speed;
y=y+sin(this.angle)*this.speed;
if(abs(this.ox-x)>abs(this.oy-y)&&this.ox-x>0) {setgifpart head16.gif, 0, 31, 31, 31};
if(abs(this.ox-x)>abs(this.oy-y)&&this.ox-x<0) {setgifpart head16.gif, 0, 93, 31, 31};
if(abs(this.ox-x)<abs(this.oy-y)&&this.oy-y<0) {setgifpart head16.gif, 0, 62, 31, 31};
if(abs(this.ox-x)<abs(this.oy-y)&&this.oy-y>0) {setgifpart head16.gif, 0, 0, 31, 31};
for(a=1;a<this.length;a++) {
this.trailx[a]=this.trailx[a+1];
this.traily[a]=this.traily[a+1];
};
this.trailx[this.length]=this.ox;
this.traily[this.length]=this.oy;
for(a=1;a<this.length;a=a+2) {
showimg a, haticon.png, this.trailx[a], this.traily[a];
if(playerx+.5>this.trailx[a]-1&&playerx+.5<this.trailx[a]+2&&playery+.5>this.traily[a]-1&&playery+.5<this.traily[a]+2) {hurt 2};
};
this.chance=int(random(0,50));
if(this.chance=1&&abs(this.disp-this.dism)<.002) {breath()};
if(this.count<this.blength) {putexplosion2 3, 1, this.breathx[this.count], this.breathy[this.count];};
timeout=.05;
}
if(washit) {
if(playerdir=0) {this.angle=4.71};
if(playerdir=1) {this.angle=3.14};
if(playerdir=2) {this.angle=1.57};
if(playerdir=3) {this.angle=0};
hearts=hearts-(playerswordpower/2);
if(hearts<=0) {death()};
}
function breath() {
for(a=0;a<this.blength;a++) {
this.breathx[a]=x+cos(this.angle)*(2*a);
this.breathy[a]=y+sin(this.angle)*(2*a);
};
this.count=0;
}
function death() {
sleep .5;
for(a=1;a<this.length;a=a+3) {
putexplosion2 3, 3, this.trailx[a], this.traily[a];
};
destroy;
}