Aura/Chakra Script

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]

Re: Aura/Chakra Script

oh yeah, funny thing, only images smaller than 48x48 currently work as 'global' showimgs O_o
Found it out the hardway when rescripting my lamp.

Re: Aura/Chakra Script

:o okay… good find

Re: Aura/Chakra Script

I made a Gani version like this once, since NPC servers destroyed the ability for all players to see many things, lol. Mine wasn't as nice as this one though. It was just a single soft glow around a player. Color and intesity was based on thier AP. If I come across it, I'll post it up somewhere

Re: Aura/Chakra Script

Ya I heard once gani's are always a better way to display stuff around the player, might try something along those lines later.

Thanks to beholders advice I fixed up the script and got it working right online.
Updated version:

[code]if (playerenters) {
toweapons Chakra;
}

if(weaponfired&&strtofloat(#s(player_ch))<100&&!this.chmaxed==1){
this.chmaxed=1;
timeout = 0.05;
this.x1=player.x;
this.y1=player.y;
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=(players[0].x+.4)-this.x1;
dy=(players[0].y+.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+130,light5.png,this.x[this.i]-1.8,this.y[this.i]-1.8;
changeimgzoom this.i+130,random(.7,1);
changeimgvis this.i+130,random(.1,.3);
changeimgcolors this.i+130,.3,.2,.7,.9;
}
// Effects End
}
else {
this.chmaxed=0;
for (this.i=0;this.i<arraylen(this.light);this.i++) hideimg this.i+130;
}
}

timeout = 0.05;[/code]

[attachment deleted by admin]