Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Mace (Some one ask for this and here it is ) (https://forums.graalonline.com/forums/showthread.php?t=5214)

Termina_GP7 06-20-2001 07:45 AM

Mace (Some one ask for this and here it is )
 
I did not make this ncp stefan did or some one on his staff so here it is :cool:

Ncp made by Some one on stefans staff or it was by stefan i dont know =)
PHP Code:

if (playertouchsme) {
  
set gotmace;
  
toweapons Mace;
  
destroy;
}
if (
playerenters) {
  for (
i=1i<=4i++) hideimg i;
  
this.step 0;
  
timeout 0;
  
show;
}
if (
weaponfired && this.step<=0) {
  
this.steps 20;
  
this.anglestep 3.14/this.steps;
  
this.flylen 10;

  for (
i=1i<=4i++) hideimg i;
  
timeout 0.05;
  
this.step 0;
  
this.angle = -3.14/4;
  
this.oldx playerx;
  
this.oldy playery;
}
if (
timeout) {
  
timeout 0.05;
  
this.step++;
  if (
this.step<4) {
  } else if (
this.step==4) {
    
freezeplayer this.steps*0.05;
    
hidesword this.steps*0.05;
    
playersprite 0;
    
this.mx 0;
    
this.my 0;
    if (
playerx>this.oldxthis.mx++;
    if (
playerx<this.oldxthis.mx--;
    if (
playery>this.oldythis.my++;
    if (
playery<this.oldythis.my--;
    if (
this.mx!=&& this.my!=0) {
      
this.mx*=0.714;
      
this.my*=0.714;
    }
    if (
this.mx==&& this.my==0) {
      if (
playerdir==0this.my--;
      if (
playerdir==1this.mx--;
      if (
playerdir==2this.my++;
      if (
playerdir==3this.mx++;
    }
  } else {
    
this.angle += this.anglestep;
    if (
this.angle>3.14/&& this.angle<3.14 )
      
this.angle+=3.14;
    if (
this.angle<3.14/4) {
      
playersprite 6;
    }  else 
playersprite 11;

    if (
this.angle>=3.14*7/4) {
      for (
i=1i<=4i++) hideimg i;
      
timeout 0;
      
this.step 0;
    } else {
      
dist cos(3.14/4) - cos(this.angle);
      for (
i=1i<=4i++) {
        
this.flyx playerx+0.5+this.flylen*this.mx*dist*i/4;
        
this.flyy playery+1+this.flylen*this.my*dist*i/4;
        if (
playerdir==0this.flyx-=0.5;
        if (
playerdir==1this.flyx+=0.5;
        if (
playerdir==2this.flyx++;
        if (
i==4showimg i,wmace.gif,this.flyx,this.flyy;
        else 
showimg i,wmace0.gif,this.flyx+0.5,
          
this.flyy+0.5;
      }
      if (
this.angle>3.14/&& this.angle<3.14 &&
          
onwall(this.flyx+0.5,this.flyy+0.5)) {
        
putleaps 4,this.flyx,this.flyy;
        
this.angle 3.14-this.angle;
      }
    }
    
this.testhurt 1;
  }
}
if (
this.testhurt == 1) {
  for (
i=0i<compuscounti++) {
    if (
abs(this.flyx-compus[i].x)<=&&
        
abs(this.flyy-(compus[i].y-0.5))<=1.5 &&
        
compus[i].mode!=&& 
compus[i].mode!=5)
      
hitcompu i,1,this.flyx+0.5,this.flyy+0.5;
  }
  for (
i=1i<playerscounti++) {
    if (
abs((this.flyx+0.7)-(players[i].x+1.5))<=&&
        
abs((this.flyy+0.5)-(players[i].y+1.5))<=1.5)
      
hitplayer i,1,this.flyx+0.5,this.flyy+0.5;
  }
  
this.testhurt 0;



Spearman 06-20-2001 08:25 AM

that comes with the older graal versions

Termina_GP7 06-20-2001 08:27 AM

i know
 
But some newbie who did not downloade the old graal pack thang did not have this so i post it up here for him and all the other newbies :D

Admins 10-22-2013 01:15 AM

Thanks to the past :)

BlueMelon 10-22-2013 02:47 AM

Reported for bumping old thread

callimuc 10-22-2013 07:44 PM

Stefan still learning from GS1. I highly suggest you learning GS2, it's way better and more complex!

Jakov_the_Jakovasaur 10-26-2013 10:22 PM


fowlplay4 10-26-2013 10:31 PM

haha


All times are GMT +2. The time now is 07:56 PM.

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