Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-06-2010, 03:55 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Hitting in an area

I'm trying to make a custom bomb script that hits in an area. but i'm not totally sure on what all of the math functions we can use. anyone care to fill me in on some of the ones i should be using? also would i be entering this into a triggeraction, or something else?
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #2  
Old 06-06-2010, 04:38 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Are you familiar with the distance formula?



If not Google it and familiarize yourself with it, it's quite useful.

You don't really need to understand it in your case though.

PHP Code:
function hit(xyradius) {
  for (
temp.pl findNearestPlayers(xy)) {
    if (
dist(xypl.xpl.y) <= radius) {
      
pl.trigger("hit");
    }
  }
}

function 
dist(x1y1x2y2) {
  return (((
x2 x1) ^ 2) + ((y2 y1) ^ 2))) ^ 0.5;

__________________
Reply With Quote
Reply

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 09:35 PM.


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