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 06-15-2001, 03:40 AM
Brady Brady is offline
Registered User
Join Date: Jun 2001
Location: Phoenix
Posts: 21
Brady is on a distinguished road
Send a message via ICQ to Brady
A walker guy

Just a little guy you can control with on and off commands, has a sword (S) and bow (D)
NPC Code:

//Open Source NPC scripted by Brady (Baddies)
//Feel free to use the script in any way that you want.
if (created) {
setstring this.mode,0;
enabledefmovement;
showcharacter;
this.speed=.5;
swordpower=1;
}
if (created || timeout) {timeout=.05}
if (playersays(on)) {this.mode=1;disabledefmovement;}
if (playersays(off)) {this.mode=0;enabledefmovement}
if (timeout && this.mode=1) {
if (keydown(0)) {dir=0;if (!onwater(x+1.5,y+2)) {setcharani walk,} else {setcharani swim,;};if (!onwall(x+1.5,y+.7)) {y-=this.speed}}
if (keydown(1)) {dir=1;if (!onwater(x+1.5,y+1.5)) {setcharani walk,} else {setcharani swim,;};if (!onwall(x+.2,y+2)) {x-=this.speed}}
if (keydown(2)) {dir=2;if (!onwater(x+1.5,y+2)) {setcharani walk,} else {setcharani swim,;};if (!onwall(x+1.5,y+3.2)) {y+=this.speed}}
if (keydown(3)) {dir=3;if (!onwater(x+1.5,y+1.5)) {setcharani walk,} else {setcharani swim,;};if (!onwall(x+2.8,y+2)) {x+=this.speed}}
if (keydown(4)) {setcharani shoot,wbow1.gif;sleep .35;timeout=.05;shootarrow dir;}
if (keydown(5)) {setcharani sword,;sleep .35;timeout=.05}
if (!keydown(0) && !keydown(1) && !keydown(2) && !keydown(3) && !keydown(5) && !onwater(x+1.5,y+1.5)) {setcharani idle,}
}

__________________
Need a reliable webhost?

Reply With Quote
  #2  
Old 06-15-2001, 05:03 AM
Bhala Bhala is offline
Disgruntled Monkey
Bhala's Avatar
Join Date: Mar 2001
Posts: 779
Bhala is on a distinguished road
Cool!
__________________
Reply With Quote
  #3  
Old 06-15-2001, 06:48 AM
Poogle Poogle is offline
Registered User
Poogle's Avatar
Join Date: Jun 2001
Posts: 2,471
Poogle is on a distinguished road
Ice Pick is a rude person I say he should stop his hacking and lose his server! Hes got a bad rep. I say we shall not go on his server and iggy him!
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 04:06 AM.


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