Aura/Chakra Script
Description: When the chakra bar on my server is below 100% then it will increment +.6 every .05 timeout; Displaying an aura of lights well its active.
Note that the light effects only show for the person who fired it.
Not sure why, I'm allready using an showimg index under 200. (range is 110-153).
Maybe fiddling with changeimgvis; or one of those affects if everyone on a level can see the light effect or simply because its a weapon and they don't have the script. Anyways…
[code]if (playerenters) {
toweapons Chakra;
}
if(weaponfired&&strtofloat(#s(player_ch))<100&&!this.chmaxed==1){
this.chmaxed=1;
timeout = 0.05;
this.x1=playerx;
this.y1=playery;
setarray this.light,43;
setarray this.x,arraylen(this.light);
setarray this.y,arraylen(this.light);
setarray this.m,arraylen(this.light);
}
else if(weaponfired&&this.chmaxed==1){
this.chmaxed=0;
}
if(timeout&&!this.chmaxed==0){
if(this.chmaxed==1&&strtofloat(#s(player_ch))<100){
this.use=0.6;
this.oldch= strtofloat(#s(player_ch));
this.newch= this.oldch+this.use;
setstring player_ch,#v(this.newch);
// lights
// Follow Start
dx=(playerx+.4)-this.x1;
dy=(playery+.6)-this.y1;
dist=(dxdx+dydy)^0.24;
this.aimx=(dx/dist)*1.75;
this.aimy=(dy/dist)*1.75;
this.x1+=this.aimx;
this.y1+=this.aimy;
// Follow End
// Effects Start
this.stop=random(0,3);
for (this.i=0;this.i<arraylen(this.light);this.i++) {
if (this.m[this.i]==0) this.m[this.i]=random(-.1,.1);
if (this.x[this.i]==0) this.x[this.i]=random(this.x1,this.x1+2);
if (this.y[this.i]==0) this.y[this.i]=random(this.y1+2,this.y1+2.5);
if (this.m[this.i]>2){
this.x[this.i]=random(this.x1,this.x1+2);
this.y[this.i]=random(this.y1+2,this.y1+2.5);
this.m[this.i]=random(-.1,.1);
}
this.m[this.i]+=random(.1,.25);
this.x[this.i]+=random(-.1,.1);
this.y[this.i]-=random(.1,.25);
showimg this.i+110,light2.png,this.x[this.i]-4,this.y[this.i]-4;
changeimgzoom this.i+110,random(.1,.3);
changeimgvis this.i+110,random(.1,.3);
changeimgcolors this.i+110,.3,.2,.7,.9;
}
// Effects End
}
else {
this.chmaxed=0;
for (this.i=0;this.i<arraylen(this.light);this.i++) hideimg this.i+110;
}
}
timeout = 0.05;[/code]