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 05-26-2001, 05:27 AM
Grey_Mage Grey_Mage is offline
Registered User
Join Date: Mar 2001
Location: Graal
Posts: 72
Grey_Mage is on a distinguished road
Send a message via AIM to Grey_Mage Send a message via Yahoo to Grey_Mage
Paintball Script Help

I need someone to please tell me how to make a "refiller" type item for this paintball gun script...

NPC Code:

if (this.init!=1) {
this.radius=0;
this.maxcount=30;
this.life=5;
this.arrowspeed=2;
this.arrowdamage=1;
setarray this.arrowx,this.maxcount+1;
setarray this.arrowy,this.maxcount+1;
setarray this.arrowdir,this.maxcount+1;
setarray this.arrowtime,this.maxcount+1;
setarray this.arrowact,this.maxcount+1;
this.init=1;
}
if (got_ammo) {
this.ammo=0;
unset got_ammo;
}
if (playertouchsme) {
setstring paint_ammo,10;
toweapons Red Paintball Gun;
timeout=.05;
}
if (weaponfired&&this.ammo=1) {
play item2.wav;
}

if(weaponfired&&this.ammo=0){
i = strtofloat(#s(paint_ammo)) - 1;
play fire.wav;
freezeplayer .4;
playersprite=33;
setstring paint_ammo,#v(i);
if (i == 0)
{
setstring paint_ammo,0;
this.ammo=1;
}
setbow wbow4.gif;
sleep .3;

if(playerdir==3){
this.arrowx[this.out]=playerx+1;
this.arrowy[this.out]=playery+1.5;
}
if(playerdir==0){
this.arrowx[this.out]=playerx+1;
this.arrowy[this.out]=playery-1;
}
if(playerdir==1){
this.arrowx[this.out]=playerx-1;
this.arrowy[this.out]=playery+1.5;
}
if(playerdir==2){
this.arrowx[this.out]=playerx+1.25;
this.arrowy[this.out]=playery+2;
}
this.arrowdir[this.out]=playerdir;
this.arrowact[this.out]=0;
this.out++;
timeout=.05;
}
if(timeout){
for(e=0;e<this.out;e++){
if(this.arrowact[e]==0){
if(this.arrowdir[e]==3){
this.arrowx[e]+=this.arrowspeed;

showimg e,firemateria.gif,this.arrowx[e],this.arrowy[e];
}

if(this.arrowdir[e]==0){
this.arrowy[e]-=this.arrowspeed;

showimg e,firemateria.gif,this.arrowx[e],this.arrowy[e];
}

if(this.arrowdir[e]==1){
this.arrowx[e]-=this.arrowspeed;

showimg e,firemateria.gif,this.arrowx[e],this.arrowy[e];
}

if(this.arrowdir[e]==2){
this.arrowy[e]+=this.arrowspeed;

showimg e,firemateria.gif,this.arrowx[e],this.arrowy[e];

}

this.arrowtime[e]++;
if(onwall(this.arrowx[e],this.arrowy[e])){
showimg 103,firemateria.gif,this.arrowx[e],this.arrowy[e];
this.arrowact[e]=1;
this.arrowtime[e]=this.life*20;
}
}else{
this.arrowtime[e]=this.life*20;
}
for (c=0; c<compuscount; c++) {
if (abs(this.arrowx[e]-compus[c].x)<=2 &&
abs(this.arrowy[e]-(compus[c].y-0.5))<=2 &&
compus[c].mode!=3&&
compus[c].mode!=5){
hitcompu c,this.arrowdamage,this.arrowx[e]+0.5,this.arrowy[e]+0.5;
showimg 103,firemateria.gif,this.arrowx[e],this.arrowy[e];
this.arrowact[e]=1;
hideimg 103;
}
}
for (d=1; d<playerscount; d++) {
if (abs((this.arrowx[e]+0.7)-(players[d].x+2))<=1 &&
abs((this.arrowy[e]+0.5)-(players[d].y+2))<=1.5){
hitplayer d,this.arrowdamage,this.arrowx[e],this.arrowy[e];
showimg 103,firemateria.gif,this.arrowx[e],this.arrowy[e];
this.arrowact[e]=1;
hideimg 103;
}
}
if (this.arrowtime[e] >= (this.life*20)) {
hideimg e;
for (b=e; b<=this.out && b<20; b++) {
this.arrowx[b] = this.arrowx[b+1];
this.arrowy[b] = this.arrowy[b+1];
this.arrowdir[b] = this.arrowdir[b+1];
this.arrowact[b] = this.arrowact[b+1];
this.arrowtime[b] = this.arrowtime[b+1] - 1;
}
this.arrowx[this.out] = -1;
this.arrowy[this.out] = -1;
this.arrowdir[this.out] = -1;
this.arrowtime[this.out] = -1;
this.arrowact[this.out] = -1;
this.out--;
a--;
hideimg this.out;
hideimg 103;
}
}
timeout=.05;
}

__________________

Quote:
Mess with the best, die like the rest...

Last edited by Grey_Mage; 05-26-2001 at 05:47 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 05:46 AM.


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