Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-19-2006, 09:50 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Zodiac.. Crashed by a Bush..

... This morning, Zodiac was crashed by a bush.
Directly from /stats:
1. 40.037491666 % npcs[128] (in level zodiacworld_am15.nw at pos (34, 20)) (bush)
The second NPC was the class 'leaps,' which is created when a bush is destroyed, at 9%.

I'm thinking it was done by a modem tap... But anyway, could anyone look at this script and tell me what may have happened or ways to prevent modem tapping?

PHP Code:
function onCreated() {
  
this.dead false;
  
setimgpart("zodiac_bush.png",0,0,32,32);
  
setshape(1,32,32);
  
drawunderplayer();
  
layer 0;
}

function 
onActionProjectile() {
  if (
this.dead) return;
  for (
this.0this.params[2].size(); this.a++) {
    if (
params[2][this.a][0] == "wepeff") {
      if (
params[2][this.a][1in {"slash","piercing"}) {
        
CutBush("slash");
        break;
      }
    }
    if (
params[2][this.a][0] == "magic") {
      if (
params[2][this.a][1] == "fire") {
        
CutBush("fire");
        break;
      }
    }
  }
}

function 
onActionDamage() {
  if (
this.dead) return;
  for (
this.0this.params[1].size(); this.a++) {
    if (
params[1][this.a][0] == "wepeff") {
      if (
params[1][this.a][1in {"slash","piercing"}) {
        
CutBush("slash");
        break;
      }
    }
    if (
params[1][this.a][0] == "magic") {
      if (
params[1][this.a][1] == "fire") {
        
CutBush("fire");
        break;
      }
    }
  }
}

function 
onTimeout() {
  
RespawnBush();
}

public function 
CutBush(cutfrom) {
  if (
this.dead) return;
  if (
cutfrom == "slash") {
    
this.leaps putnpc2(x,y,"join(\"leaps\");");
    
this.leaps.leaptype "bush";
  }
  if (
cutfrom == "fire") {
    
this.leaps putnpc2(x,y,"join(\"leaps\");");
    
this.leaps.leaptype "fire";
  }
  if (
random(0,1) < 0.3) {
    
this.dropitem putnpc2(xy"join(\"item\");");
    
this.dropitem.quantity 1;
    
this.dropitem.itemname "Leaves";
    
this.dropitem.arcname "items/leaves";
  }
  
setimgpart("zodiac_bush.png",32,0,32,32);
  
setshape(1,32,32);
  
dontblock();
  
setTimer(random(30,40));
  
this.dead true;
  if (
this.temporarydestroy();
}

public function 
RespawnBush() {
  
this.dead false;
  
setimgpart("zodiac_bush.png",0,0,32,32);
  
blockagain();
}

//#CLIENTSIDE
function onPlayerEnters() {
  
setshape(1,32,32);
  
drawunderplayer();
  
layer 0;

Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 06:39 AM.


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