HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Triggered Spell Area of Effect

04-22-2007, 11:41 PM#1
PsychoPif
Here's what I have so far:
Trigger:
Wild Growth
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Wild Growth
Collapse Actions
Collapse Unit Group - Pick every unit in (Units within 300.00 of (Target point of ability being cast) matching (((Picked unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True)) and do (Actions)
Collapse Loop - Actions
Unit - Create 1 Dummy for (Owner of (Casting unit)) at (Position of (Picked unit)) facing Default building facing degrees
Unit - Add Entangling Roots (Dummy) to (Last created unit)
Unit - Set level of Entangling Roots (Dummy) for (Last created unit) to (Level of Wild Growth for (Casting unit))
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Entangling Roots (Picked unit)

As you can see, I have an area of 300 around the target of my dummy spell. Problem is, depending on the level (1-10) of the skill, the area range from 300 to 700. I have'nt found a way to know which unit are in the real range of the skill. Is there a way beside checking the level of the caster skill with a 10 step if then else ?

I hope I'm clear enough :)
04-23-2007, 01:58 AM#2
substance
If i understand correctly you want the dummy to cast on units OUTSIDE of the 300 area radius if the level of the spells says so?

If so, I guess you could try changing the radius to 700 and create the dummy unit at the center of the radius, that way the dummy will only cast to units 700ft away if the level of the spell allows him to.
04-23-2007, 02:11 AM#3
Dil999
To increase the size, just use arithmetic for units within range.
So, lets say you wanted it to be 50,100,150,200 etc. You do:
Pick every unit within (Integer(Level of ABILITY for triggeringunit) * 50)

So, you do Arithmetic. Then, for the first part, choose Convert Integer to Real. Then, choose Level of ability for unit. The second part of it should be 50. To start out with a range and increase (200,250,300) put what i just explained in one half of the arithmetic, and the other half adding the number.

Edit: This trigger starts at 300 and goes up by 50 each level (300,350,400)

Trigger:
Unit Group - Pick every unit in (Units within (((Real((Level of Acid Bomb for (Triggering unit)))) x 50.00) + 250.00) of (Center of (Playable map area))) and do (Actions)
Loop - Actions
04-23-2007, 02:17 AM#4
wussupallies
I'm not exactly sure what you are asking, but if you want to increase the
range from 300-700 from level 1-10 this is what you need:

400 (difference between 300 and 700), divided by 9 (difference between levels 1 and 10) gets you 44.4444444444444. I have rounded, so the answer is slightly off, but if you want to use decimals you will get it accurately.

Units within

300 + (44 x [level of skill - 1])

will get you this:

level of skill = y

y= 1, 300 + 44 (y - 1) = 300
y = 2, 300 + 44 (y - 1) = 344
y= 3, 300 + 44 (y - 1) = 388
..
y = 10, 300 + 44 (y - 1)= 696

remember that I rounded, and so the .444444 (cont'd) that was ignored is why the answer is slightly off.
04-23-2007, 09:29 AM#5
Zwan
Or a good ol fashioned real array. I just used 45, you can set it to the exact numbers if you like.

Trigger:
Range Array
Collapse Events
Unit - A unit Learns a skill
Collapse Conditions
(Learned Hero Skill) Equal to Your Skill
Collapse Actions
Set Spell_Range[1] = 300.00
Set Spell_Range[2] = 345.00
Set Spell_Range[3] = 390.00
Set Spell_Range[4] = 435.00
Set Spell_Range[5] = 480.00
Set Spell_Range[6] = 525.00
Set Spell_Range[7] = 570.00
Set Spell_Range[8] = 615.00
Set Spell_Range[9] = 660.00
Set Spell_Range[10] = 705.00
Trigger - Destroy (This trigger)

Trigger:
Trigger
Events
Conditions
Collapse Actions
Set Root_Point = (Target point of ability being cast)
Set tempRoot = (Units within Spell_Range[(Level of Your Skill for (Casting unit))] of Root_Point matching (((Picked unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True))
Collapse Unit Group - Pick every unit in tempRoot and do (Actions)
Collapse Loop - Actions
Your Actions
Your Actions
Your Actions
Your Actions
Your Actions
Point - Remove Root_Point
Unit Group - Destroy tempRoot
04-24-2007, 12:32 AM#6
PsychoPif
I ended up with:
Trigger:
Wild Growth
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Wild Growth (Old Willow)
Collapse Actions
Set tempReal = (250.00 + (Real((Level of Wild Growth (Old Willow) for (Casting unit)))))
Set tempUnitGroup = (Units within tempReal of (Target point of ability being cast) matching (((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True))
Collapse Unit Group - Pick every unit in tempUnitGroup and do (Actions)
Collapse Loop - Actions
Unit - Create 1 Dummy for (Owner of (Casting unit)) at (Position of (Picked unit)) facing Default building facing degrees
Unit - Add Entangling Roots (Dummy) to (Last created unit)
Unit - Set level of Entangling Roots (Dummy) for (Last created unit) to (Level of Wild Growth (Old Willow) for (Casting unit))
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Entangling Roots (Picked unit)
Custom script: call DestroyGroup(udg_tempUnitGroup)

One last thing though, I based my dummy skill on Flame Strike and I was getting insane lag after two cast. I changed it to Reveal and I get no more lag. Any idea why ? What's the best ability to base it on ?

Thanks all
04-24-2007, 02:55 AM#7
Pyrogasm
Base it on Silence or Channel.
04-24-2007, 03:15 AM#8
Dil999
That will do this:
If the level of the ability is 1, it does 250+1. You want to multiply the level of the ability by 50 or something, so it does (at level 2)
250+(2x50)

Oh, and you leak several points and a unit group there. Use this to fix those leaks.
04-24-2007, 11:49 AM#9
Zwan
yea, flamestrike is a wiggy spell to alter. As Pyro suggested, silence is good, cluster rockets is another option. Pound for pound, silence is one of the quickest and easiest to edit for area target spells. As for the real, 250 + 50 x [level of ability] should do the trick.
04-24-2007, 03:12 PM#10
PsychoPif
Mmm I've read that topic before and I thought I removed all the leaks. There must be something I did'nt understood, would you mind telling me what are the leaks please :)
04-24-2007, 05:00 PM#11
blu_da_noob
Target Point of Ability being Cast leaks a location. Set to variable, use, destroy.
04-24-2007, 05:10 PM#12
PsychoPif
Oh I thought that those kind of event variable like casting unit, target of ability, etc. did not leak. Does that mean that I should set the castin unit, owner of casting unit, position of picked unit, etc. to a variable to prevent leak ?
04-24-2007, 05:16 PM#13
blu_da_noob
No. Target Point of ability being cast is the key. Point means a location is being created. So you need to set it to a point variable and then remove it afterwards.
04-24-2007, 06:20 PM#14
PsychoPif
Thanks a lot, I'll do that.