I wish there was a way I could go back a few posts and just edit the original Frog posting...there probably is on graal.net or something, but I never did understand that site.
Oh well, here's the most recent version in OldScript...I'll start updating the NewScript as soon as I can get on a test server.
It'd be nice if Code mode didn't doublespace too...
NPC Code:
if (created) {
showcharacter;
dontblock;
setcharprop #3,frog.png;
setcharani tyhm_frog_baddy_rustle,;
}
if (playerenters||timeout) {
timereverywhere;
timeout=0.05;
if (isleader) {
this.counter+=0.05;
if (this.counter==0) {
timeout=1;
this.counter=1;
}else if (this.counter==1) {
setcharani tyhm_frog_baddy,;
}else if (this.counter <3) {
this.vulnerable = 1;
this.attacking = 1;
} else if (this.counter < 4){
this.vulnerable = 0;
this.attacking = 0;
} else if (this.counter == 4){
hide;
timeout = 1;
} else {
this.counter = 0;
x+=random(-5,+5);
if (x>63) x=63;
else if (x<0) x=0;
y+=random(-5,+5);
if (y>63) y=63;
else if (y<0) y=0;
show;
setcharani tyhm_frog_baddy_rustle,;
}
}
if (this.attacking > 0) {
if(playerx in |x-2,x+2| && playery in |y-4,y+1|){
hitplayer 0,1,x,y;
}
}
}
if((wa****||wasshot||exploded)&&this.vulnerable>0) {
setcharani baddydead,;
sleep 1;//I know, I know, bad form but it's temporary.
temp.i=int(random(0,20));
if (temp.i<5) lay greenrupee;
else if (temp.i<6) lay bluerupee;
else if (temp.i<9) lay heart;
this.vulnerable = 0;
this.attacking = 0;
hide;
timeout = 0;
}