Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Do the lights! (https://forums.graalonline.com/forums/showthread.php?t=62395)

protagonist 11-20-2005 08:26 PM

Do the lights!
 
Post your light effects:

NPC Code:

// NPC made by VT
if (created) {
timeout=.05;
this.angle=.1;
drawoverplayer;
}
if(timeout){
timeout = .05;
this.angle+=.2;
for(j=0;j<50;j++){
showimg j-2,light2.png,x+cos(this.angle),y+4*sin(this.angle) ;
changeimgcolors j-2,.1,.5,.1,.9;
changeimgzoom j-2,.4;
showimg j-3,light2.png,x-cos(this.angle/j),y-5*sin(this.angle);
changeimgcolors j-3,.5,.5,.1,.9;
changeimgzoom j-3,.4;
showimg j-4,light2.png,x-4*cos(1/2*this.angle/2*j),y-5*sin(this-angle);
changeimgcolors j-4,.5,.1,.1,.9;
changeimgzoom j-4,.1;
}
x+=3*cos(this.angle);
y+=.5*sin(this.angle);
}

/*original stuff which is now unused
showimg j-1,light2.png,x+4*cos(this.angle),y+sin(this.angle) ;
changeimgcolors j-1,.5,.1,.2,.9;
changeimgzoom j-1,.1;
/*




Have fun with them.

Gothiclette 03-31-2006 02:08 AM

Thats cool :redface:

unfourtanetly (SP?)
i dont have any light effects :frown:
but i did edit yours to go in a circle
i made one clockwise and counter clockwise >_<

Yen 03-31-2006 02:45 AM

PHP Code:

function onCreated() {
  if (
params[0] == "wind") {
    
this.la = new[8];
    
this.lz = new[8];
    
this.ls = new[8];
    
this.lm = new[8];
    
this.lr = new[8];
    
this.lu 0;
    
this.ll 0;
  }
  
setTimer(.05);
}
function 
onTimeout() {
  if (
this.lu == 0NewLeaf();
  
this.lu = (this.lu 1) % 6;
  for (
08a++) {
    if (
this.ls[a] > 0) {
      
this.la[a] += this.lm[a];
      
this.lz[a] += this.ls[a];
      
showimg2(a,"leaf1.png",player.sin(this.la[a]) * 1.5,player.cos(this.la[a])*.5player.this.lz[a]);
      
findimg(a).zoom .75;
      
findimg(a).rotation += this.lr[a];
      if (
a%== 0) {
        
findimg(a).image "light2s.png";
        
findimg(a).red findimg(a).blue 0;
        
findimg(a).green 1;
        
findimg(a).alpha .9;
        
findimg(a).zoom .5;
      }
      if (
this.la[ain |1.57,4.71|) findimg(a).layer 0;
      else 
findimg(a).layer 2;

        
      if (
this.lz[a] > 3.5this.ls[a] = 0;
    }
    else 
hideimg(a);
  }
}

function 
NewLeaf() {
  
this.la[this.ll] = random(0,6.28);
  
this.lz[this.ll] = 0;
  
this.ls[this.ll] = random(.03,.1);
  
this.lr[this.ll] = random(0,.5);
  
this.lm[this.ll] = random(.3,.6);
  
this.ll = (this.ll+1) % 8;


Yep.. I have like ~60 ganis with light effects in them..


All times are GMT +2. The time now is 09:26 PM.

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