distance targeting for custom items

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: distance targeting for custom items
Apprentice
Member # 5821
Profile #0
I've got this problem:

I want to make some custom items that use states in the scenario script to damage all hostiles within a certain distance from the user. I looked in the appendix but the calls all seem to be for selecting a specific target. Anyone have any ideas?
Posts: 10 | Registered: Tuesday, May 17 2005 07:00
Apprentice
Member # 5821
Profile #1
Addendum to previous post:

I am NOT good at programming and I don't get technical jargon. Please reply with straightforward answers. Some actual examples would also be helpful (and will get you a mention in the credits if ever finish this thing)

thanks
Posts: 10 | Registered: Tuesday, May 17 2005 07:00
BANNED
Member # 4
Profile Homepage #2
Look at the code for Tetra-Disaster in Canopy.

--------------------
*
Posts: 6936 | Registered: Tuesday, September 18 2001 07:00
Apprentice
Member # 5821
Profile #3
Yeah, i had a look at the special spells in Canopy but ones like tetra-disaster affect all visible enemies. I want to know if it's possible to only hit enemies within, say, 8 spaces of the user.

Sorry, I probably didn't explain very well in the first place.
Posts: 10 | Registered: Tuesday, May 17 2005 07:00
Off With Their Heads
Member # 4045
Profile Homepage #4
You could do something like this:

i = 6;
while (i < 120) {
if (get_attitude(i) >= 10)
if (char_dist_to_loc(i,char_loc_x(who_used_custom_item()),char_loc_y(who_used_custom_item())) <= 8)
// (do damage with a damage_char call)
i = i + 1;
}


[ Tuesday, May 17, 2005 07:38: Message edited by: Kelandon ]

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Apprentice
Member # 5821
Profile #5
that is absolutely perfect.

thanks!
Posts: 10 | Registered: Tuesday, May 17 2005 07:00