Heh, I made an attempt at this a year ago, but when it needed some help, everyone just made a mockery of it,
http://forums.graal2001.com/forums/s...threadid=17326. Since someone else wants to try, maybe times have changed. I tried to make it as close to a real tile bush as possible at the time. Here's where I got to, with some minor bugs in the onwall detection:
NPC Code:
if (created){
drawunderplayer;
this.mode=1;
this.touch={0,-1,-1,0,0,1,1}
canbecarried;
setstring this.bushlvl,#L; this.bushx=x; this.bushy=y;
timeout=0.05;
}
if (timeout){
if (abs(x-(playerx+2*this.touch[2*playerdir]))<1.5&&
abs(y-(playery+2*this.touch[2*playerdir+1]))<1.5) this.mode=1;
else this.mode=0;
if (this.mode==0) dontblock;
else blockagain;
timeout=0.05;
}
if (washit||exploded||wasthrown||carrying){
putleaps 0,x,y;
if (!wasthrown){
bushlay=int(random(0,9));
if (bushlay==0) lay2 heart,x,y;
if (bushlay==1) lay2 bombs,x,y;
if (bushlay==2) lay2 greenrupee,x,y;
if (bushlay==3) lay2 bluerupee,x,y;
}
hide;
sleep 8;
if (!strequals(#L,#s(this.bushlvl))){
deletestring bushlvl,i;
destroy;
}
deletestring bushlvl,i;
x=this.bushx; y=this.bushy; show;
}
The script's supposed to be called using putnpc2, to avoid mishaps in transportation. Everything can be improved with newer commands and serverside (everything here was before setshape

) but I haven't messed with it since that message. Hope this helps...
