Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-18-2001, 04:06 AM
Merlin Merlin is offline
Banned
Merlin's Avatar
Join Date: Jul 2001
Location: Merlin - U S A Malak - United Kingdom
Posts: 2,543
Merlin is on a distinguished road
Send a message via ICQ to Merlin Send a message via AIM to Merlin
Bot

I made this bot outline because i was bored and decided to post to learn from/ make fun off ;D etc etc so feel free to modifiy it, it's default.
//NPC Made by Merlin
if (created) {
showcharacter;
setcharprop #3,head0.gif;
setcharprop #C0,orange;
setcharprop #C1,white;
setcharprop #C2,blue;
setcharprop #C3,red;
setcharprop #C4,black;
setcharprop #2,shield1.gif;
shieldpower = 1;
dir = 2;
this.loaded = true;
setcharprop #n,Default Bot;
setstring this.life,3;
timeout = .5;
}
if (timeout) {
message #s(this.life);
timeout=.5;
}
if (playertouchsme) {
if (playerdir==0) {
say2
Commands:#b
Shoot - Make Bot Shoot if loaded#b
Reload - Reload the bot's shot#b
Walk Up - walk up#b
Walk Down - walk down#b
Walk Left - walk left#b
Walk Right - walk right#b
Show Stats - Show the current Stats#b
of Bot#b
}
}
if (playerchats&&strequals(#c,show stats)) {
say2
Current Bot Stats:#b
Current bot life: #s(this.life)#b
}
if (playerchats&&strequals(#c,shoot)) {
if (this.loaded==true) {
setcharani shoot,;
shootarrow dir;
this.loaded = false;
}
}
if (playerchats&&strequals(#c,reload)) {
this.loaded = true;
}
if (playerchats&&strequals(#c,walk up)) {
walkup();
}
if (playerchats&&strequals(#c,walk down)) {
walkdown();
}
if (playerchats&&strequals(#c,walk left)) {
walkleft();
}
if (playerchats&&strequals(#c,walk right)) {
walkright();
}
function walkup() {
dir = 0;
setcharani walk,;
y=y-.5;
sleep.3;
y=y-.5;
sleep.3;
y=y-.5;
sleep.3;
y=y-.5;
sleep.3;
y=y-.5;
sleep.3;
y=y-.5;
sleep.3;
setcharani idle,;
}
function walkdown() {
dir = 2;
setcharani walk,;
y=y+.5;
sleep.3;
y=y+.5;
sleep.3;
y=y+.5;
sleep.3;
y=y+.5;
sleep.3;
y=y+.5;
sleep.3;
y=y+.5;
sleep.3;
setcharani idle,;
}
function walkleft() {
setcharani walk,;
dir = 1;
x=x-.5;
sleep.3;
x=x-.5;
sleep.3;
x=x-.5;
sleep.3;
x=x-.5;
sleep.3;
x=x-.5;
sleep.3;
x=x-.5;
sleep.3;
setcharani idle,;
}
function walkright() {
setcharani walk,;
dir = 3;
x=x+.5;
sleep.3;
x=x+.5;
sleep.3;
x=x+.5;
sleep.3;
x=x+.5;
sleep.3;
x=x+.5;
sleep.3;
x=x+.5;
sleep.3;
setcharani idle,;
}
if (washit) {
setstring this.life,#v(strtofloat(#s(this.life))-1);
timeout = .5;
}
if (wasshot) {
setstring this.life,#v(strtofloat(#s(this.life))-1);
timeout = .5;
}
if (timeout) {
if (strequals(#s(this.life),0)){
sprite = 40;
timeout = 1;
setstring this.life,3;
setcharani idle,;
timeout=.5;
}
}
if (timeout) {
if (strequals(#s(this.life),-1)){
setstring this.life,0;
}
}
if (timeout) {
if (strequals(#s(this.life),-2)){
setstring this.life,0;
}
}
if (timeout) {
if (strequals(#s(this.life),-3)){
setstring this.life,0;
}
}
if (timeout) {
if (strequals(#s(this.life),-4)){
setstring this.life,0;
}
}

Last edited by Merlin; 09-18-2001 at 05:03 AM..
Reply With Quote
 


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.