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 04-22-2001, 04:29 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Cool

I was bored so I made a little chicken in 15 minutes that clucks and gets scared if you pelt it, shoot it, or slash it.
It doesnt die, so no animals were harmed. you need chicken_w.gif and chicken_e.gif , also I gotta fix the showimg for a diagonal and left cuz the onwall is fine but the chicken still overlaps. oh well.

// NPC made by LiquidIce
//Chicken-
//can be hit with objects , shot, or slashed
// and will cluck and go kinda crazy and cluck for
// about 5 seconds or so.
//Made for Unholy Nation

if (playerenters) {
this.speed=.3;
if (isleader) {
setimg chicken_w.gif;
}
timeout = .1;
blockagain;
}

if (playertouchsme||waspelt||washit||wasshot) {
blockagainlocal;
if (this.speedychicken=0) {
this.speed*=2.5;
this.speedychicken=1;
this.speedycount=0;
}
}

if (timeout) {

if (this.speedychicken=1) {
setcharprop #c,cluck cluck!;
this.speedycount+=1;
if (this.speedycount=55) {
setcharprop #c,;
this.speed=this.speed/2.5;
this.speedychicken=0;
this.speedycount=0;
}
}
this.tendencymove=random(0,15);
if (this.tendencymove<3) {
this.dir = random(0,9);
}

//left
if (this.dir<1) {
if (!onwall(x+1.5-(this.speed*2),y+1.5)) {
x-=.7;
setimg chicken_w.gif;
}
else { this.dir = random(0,9); }
}
//right
if (this.dir>1&&this.dir<2) {
if (!onwall(x+1.5+(this.speed*2),y+1.5)) {
x+=.7;
setimg chicken_e.gif;
}
else { this.dir = random(0,9); }
}
//diagonal up-left
if (this.dir>2&&this.dir<3) {
if (!onwall(x+1.5-(this.speed*2),y+1.5-(this.speed*1.5))) {
x-=.7;
y-=.7;
setimg chicken_w.gif;
setcharprop #c,cluck cluck!;
}
else { this.dir = random(0,9); }
}
//diagonal up-right
if (this.dir>3&&this.dir<4) {
if (!onwall(x+1.5+(this.speed*2),y+1.5-(this.speed*1.5))) {
x+=.7;
y-=.7;
setimg chicken_e.gif;
}
else { this.dir = random(0,9); }
}
//diagonal down-left
if (this.dir>5&&this.dir<6) {
if (!onwall(x+1.5-(this.speed*2),y+1.5+(this.speed*1.5))) {
x-=.7;
y+=.7;
setimg chicken_w.gif;
setcharprop #c,cluck cluck!;
}
else { this.dir = random(0,9); }
}
//diagonal down-right
if (this.dir>7&&this.dir<8) {
if (!onwall(x+1.5+(this.speed*2),y+1.5+(this.speed*1. 5))) {
x+=.7;
y+=.7;
setimg chicken_e.gif;
}
else { this.dir = random(0,9); }
}

timeout = .1;
}



__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #2  
Old 04-22-2001, 01:17 PM
bb2k1 bb2k1 is offline
Registered User
Join Date: Apr 2001
Location: Canada
Posts: 396
bb2k1 is on a distinguished road
Send a message via ICQ to bb2k1
Cluk Cluk?
__________________

- Richter fighting his doppleganger

- Richter Belmont

"Jesus, Jesus, hes our savior. If he can't do it, we'll choose another religious flavor!"
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 11:40 PM.


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