View Single Post
  #28  
Old 11-13-2006, 01:10 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
Swampsoldier ready for conversion

NPC Code:
if (created) {
showcharacter;
dontblock;
setcharprop #3,baddygray.png;
setcharani tyhm_swamp_baddy_hide,wbow1.png;
hearts=2;
this.counter=3.6;
hide;
}
if (playerenters||timeout) {
if (isleader) {
if (this.counter==1.5) {
// putleaps 0,x,y;
setcharani tyhm_swamp_baddy_shoot,wbow1.png;
}else if (this.counter <3) {
//there's a clever way to do the following in one line.
//I don't particularly care, though.
if (abs(playerx-x)>abs(playery-y)){
if(playerx<x) dir=1;
else dir=3;
}else{
if(playery<y) dir=0;
else dir=2;
}
this.vulnerable = 1;
if (this.counter == 1.8) {
setshootparams wasshot,1;
shoot x,y+0.5,1,(dir+1)*1.57,0,-1,adv_shot,advshot1.png;
//shootarrow dir;
}
} else if (this.counter < 4.4){
this.vulnerable = 0;
hide;
} else {
this.counter = 0;
setcharani tyhm_swamp_baddy_rustle,wbow1.png;
show;
}
this.counter+=0.05;
}
timereverywhere;
timeout=0.05;
}

if((wa****||wasshot||exploded)&&this.vulnerable>0) {
hearts--;
setcharani baddyhurt,;
if (hearts<=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;
destroy;
}
}


I leave the Putleaps problem to people smarter than I - I scripted it into the gani, but it doesn't seem to Go. If I gotta gani the leaves in, I will, I'd just rather not.
Attached Files
File Type: gani tyhm_swamp_baddy_rustle.gani (829 Bytes, 132 views)
File Type: gani tyhm_swamp_baddy_shoot.gani (1.9 KB, 129 views)
File Type: gani tyhm_swamp_baddy_hide.gani (1.6 KB, 119 views)
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233

Last edited by Tyhm; 11-13-2006 at 04:32 AM..
Reply With Quote