Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #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
  #2  
Old 08-19-2006, 10:12 PM
Chris Chris is offline
:pluffy:
Chris's Avatar
Join Date: Jan 2005
Location: im n ur comp, takn up pixelz
Posts: 1,867
Chris is on a distinguished road
Always blaming Bush..
__________________
Reply With Quote
  #3  
Old 08-19-2006, 10:14 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Chris
Always blaming Bush..
Hahaha - and damn.. Zodiac was crashed by modem tapping a bush - brb.
Reply With Quote
  #4  
Old 08-20-2006, 02:30 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Chris
Always blaming Bush..
Ahahahahahahaa... hillarious.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #5  
Old 08-20-2006, 03:28 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
What I think that has happened is:

A person modem tapped, and slashed hundreds of time at the bush, while the cable was pulled out, when it inserted again, it sent all the triggers, and it received lots of damage triggers.

The slashes made the bush destroy, and layed a new class down (leaps), which takes a bit CPU time.

How you could solve this; replace this line:
PHP Code:
this.leaps putnpc2(x,y,"join(\"leaps\");"); 
with a showani line, that shows a gani with the leaps in it. Because if it's already showing at the first trigger, it doesn't change anything if its being tried to be shown with the same ID another time, and is already showing.

I don't know if you get what I mean, else I'll be willing to help you online (by adding me to RC for a short time or so).
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #6  
Old 08-19-2006, 11:19 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
The only thing that looks bad to me is that the script is not checking for correct params, don't know how a single npc can slow the server that much though. Eventually the machine was slow in general, there are some other servers running on the same machine.
Reply With Quote
  #7  
Old 08-20-2006, 12:52 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Stefan
The only thing that looks bad to me is that the script is not checking for correct params, don't know how a single npc can slow the server that much though. Eventually the machine was slow in general, there are some other servers running on the same machine.
Estimate around 30-40 (including my own, and GK debug)
Reply With Quote
  #8  
Old 08-20-2006, 04:02 AM
Darkyoshi12345 Darkyoshi12345 is offline
Darky
Join Date: Jun 2006
Posts: 153
Darkyoshi12345 is on a distinguished road
Wow, ONE bush crashed the server?
Reply With Quote
  #9  
Old 08-20-2006, 04:06 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Darkyoshi12345
Wow, ONE bush crashed the server?
The class for the bush, and the class for the leaps. Everyone musta hit a bush at the same time and then - POOF
Reply With Quote
  #10  
Old 08-20-2006, 07:09 AM
Darkyoshi12345 Darkyoshi12345 is offline
Darky
Join Date: Jun 2006
Posts: 153
Darkyoshi12345 is on a distinguished road
Quote:
Originally Posted by KuJi
The class for the bush, and the class for the leaps. Everyone musta hit a bush at the same time and then - POOF
Is that possible for everyone to hit a bush at a time though?
Reply With Quote
  #11  
Old 08-20-2006, 07:45 AM
smirt362 smirt362 is offline
Tee Hee
smirt362's Avatar
Join Date: Feb 2005
Location: Texas
Posts: 2,101
smirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant future
Send a message via AIM to smirt362 Send a message via MSN to smirt362
Everything is possible...but I think it's statisically improbable.

On a side note...this thread made me chuckle a little bit. It just seems so absurd.
__________________

Don Hertzfeldt <3
Reply With Quote
Reply


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 12:41 AM.


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