Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   A walker guy (https://forums.graalonline.com/forums/showthread.php?t=4866)

Brady 06-15-2001 03:40 AM

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


Bhala 06-15-2001 05:03 AM

Cool!

Poogle 06-15-2001 06:48 AM

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!


All times are GMT +2. The time now is 11:43 AM.

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