Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-04-2001, 05:58 AM
Darkman2001 Darkman2001 is offline
Registered User
Join Date: Sep 2001
Location: Washington
Posts: 82
Darkman2001 is on a distinguished road
Send a message via ICQ to Darkman2001
hat Dragon!

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;
}


__________________
- Ðarkman (NBK)
Reply With Quote
  #2  
Old 11-04-2001, 06:38 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Pretty nice, more like a snake then a dragon though
Reply With Quote
  #3  
Old 11-04-2001, 08:04 AM
Thak2 Thak2 is offline
:]
Join Date: Mar 2001
Location: BC
Posts: 1,344
Thak2 is on a distinguished road
Send a message via AIM to Thak2
Wow, very good.

Took me quite a few trys untill I beat it too .
Reply With Quote
  #4  
Old 11-04-2001, 09:58 AM
Xaviar Xaviar is offline
Registered User
Join Date: Aug 2001
Location: Fairyland
Posts: 463
Xaviar is on a distinguished road
Send a message via ICQ to Xaviar Send a message via AIM to Xaviar
Thats pretty cool, kinda reminds me of Kai's dragon thingys...I didn't much like the hit detection though..
__________________
One by one, the penguins steal my sanity.

*cookie for Xaviar* --Originally posted by Tyhm

--Xaviar

A m e r i c a
Reply With Quote
  #5  
Old 11-04-2001, 10:44 AM
Vinvect Vinvect is offline
Registered User
Join Date: Aug 2001
Location: U.S.A,California,Milpitas,In A House,In Room,On A Seat,On a Computer
Posts: 157
Vinvect is on a distinguished road
Send a message via ICQ to Vinvect Send a message via Yahoo to Vinvect
Quote:
Originally posted by Xaviar
Thats pretty cool, kinda reminds me of Kai's dragon thingys...I didn't much like the hit detection though..
Darkman2001/ur grandmama scripts bettah than u!

(lol jk about ur grandmama)
(but im tru on Darkman2001)
__________________
==========================
I Script Really Good
&
Looking For A NAT Job
==========================
Quote:
That's like a big lugee!
-Evolution The Movie
Quote:
Ha Ha Ha Give It Up!
-Cyrus From Bomberman
I'm not a Bomy anymore.
I'm a MUTATED BROCLI MONSTER!
(or SIGN MONSTER)
If you make me angry,
I'LL EAT YOU WHOLE!
ME, MUTATED BROCLI MONSTER MASTER
(or SIGN MONSTER)
WILL EAT YOU ALL UP!
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Quest Valley Owner
Looking For Staff
Pm Me
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
O.o Still Have My Braen Damaegd o.O


Thanks To Esiah, He Made This For Me!
Thanks Esiah!
Reply With Quote
  #6  
Old 11-05-2001, 07:18 AM
LilNiglet LilNiglet is offline
Registered User
Join Date: Jun 2001
Posts: 3,178
LilNiglet is on a distinguished road
Quote:
Originally posted by Vinvect

Darkman2001/ur grandmama scripts bettah than u!

(lol jk about ur grandmama)
(but im tru on Darkman2001)
SHORTEN SIG PLS.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:58 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.