| 01-25-2004, 06:14 PM | #1 |
I want an area of effect spell point target, that gets units in the area of effect. If all the units life together = 1000 or more then I want the effect to happen (kill all units and summon super unit for myself). If not, then nothing happens. If someone could post the trigger that would be great thx :P I've already spent more than 2 hours on it... Here's my trigger so far... :/ It's very choppy... Summon Evil Incarnate Events Conditions (Ability being cast) Equal to Summon Encarnate (Evil) Actions Unit Group - Pick every unit in (Units in (Rect centered at (Target point of ability being cast) with size (500.00, 500.00))) and do (Set totalAmountofLifeinRect[1] = (Life of (Picked unit))) Set totalAmountofLifeinRect_Copy = ((totalAmountofLifeinRect[1] + totalAmountofLifeinRect[1]) + (totalAmountofLifeinRect[1] + totalAmountofLifeinRect[1])) If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions totalAmountofLifeinRect_Copy Greater than or equal to 1000.00 Then - Actions Unit - Create 1 Evil Encarnate for Player 12 (Brown) at (Target point of ability being cast) facing Default building facing degrees Set EvilIncarnate = (Last created unit) Wait 80.00 game-time seconds Unit - Kill EvilIncarnate Else - Actions |
| 01-25-2004, 06:42 PM | #2 |
Okay, I would do it differently, so here is what I would do. What you would do is first make a unit group and add all units withing 500 of (target point of ability being cast), now if you want to remove all units owned by the casting unit then you can. Now what you do is make an integer variable that would store how many units are in the unit group. Then do a loop from 1 - (integer variable) and add a random unit from the Unit group variable into a unit array, so it would look somehthing like this. Code:
[b]Events:[/b]
Unit begins casting ability
[b]Conditions:[/b]
Unit-Type = (your hero type)
Ability = (your ability)
[b]Actions:[/b]
Pick every unit withing 500 of (target Point of cast ability) and add units to UNITGROUP
Set INTEGERVARIABLE = (count number of units in UNITGROUP)
For every integer a from 1 to INTEGERVARIABLE do
set UNIT[for loop integer a] = Random unit from UNITGROUP
Remove UNIT[for loop integer a] from UNITGROUP
Wait .5 secs
for every integer b from 1 to INTEGERVARIABLE do
set HEALTHAMOUNT = ( HEALTHAMOUNT + life of UNIT[for loop integer b] )
If-then-else multiple
Conditions
HEALTHAMOUNT >= 1000.00
Then
(whatever you want to happen here)
Else
Do Nothing |
| 01-25-2004, 06:48 PM | #3 |
awesome thx. I was trying to mess with arrays cause I thought that would do it (I don't know how to use arrays :P). You rule! :D |
