T
ThE-eNiGmA
Guest
Posting yet again, but here is my revised, second version of bombing run, with pseudo AoE damage. It isn't balanced, but works fine except for one potential glaring flaw. It is possible for 2+ variables to have the same unit...which means that the unit, unfairly, gets (2+)x damage. Can anybody suggest a way to avoid that pitfall, or simply refine my code (without resorting to JASS if possible) LoL, I wouldnt mind knowing how to actually make the unit dive...which would be a reverse of a jump ability I know i have seen somewhere...
Bombing Run Copy
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Bombing Run
Actions
Unit - Set (Casting unit) movement speed to 400.00
Unit - Order (Casting unit) to Move To (Target point of ability being cast)
For each (Integer A) from 1 to 8, do (Actions)
Loop - Actions
Wait (Random real number between 0.05 and 0.50) game-time seconds
Set BombDrop[0] = (Random point in (Region centered at (Position of (Casting unit)) with size (400.00, 400.00)))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Region centered at BombDrop[0] with size (200.00, 200.00)) contains (Matching unit)) Equal to True
Then - Actions
Set BombedUnit[0] = (Random unit from (Units in (Region centered at (BombDrop[0] offset by (0.00, 0.00)) with size (400.00, 400.00)) matching (((((Unit-type of (Matching unit)) is A structure) Equal to True) or (((Unit-type of (Matching unit)) is A ground unit) Equal to True)) a
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Region centered at BombDrop[1] with size (200.00, 200.00)) contains (Matching unit)) Equal to True
Then - Actions
Set BombedUnit[1] = (Random unit from (Units in (Region centered at (BombDrop[0] offset by (0.00, 0.00)) with size (400.00, 400.00)) matching (((((Unit-type of (Matching unit)) is A structure) Equal to True) or (((Unit-type of (Matching unit)) is A ground unit) Equal to True)) a
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Region centered at BombDrop[2] with size (200.00, 200.00)) contains (Matching unit)) Equal to True
Then - Actions
Set BombedUnit[2] = (Random unit from (Units in (Region centered at (BombDrop[0] offset by (0.00, 0.00)) with size (400.00, 400.00)) matching (((((Unit-type of (Matching unit)) is A structure) Equal to True) or (((Unit-type of (Matching unit)) is A ground unit) Equal to True)) a
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Region centered at BombDrop[3] with size (200.00, 200.00)) contains (Matching unit)) Equal to True
Then - Actions
Set BombedUnit[3] = (Random unit from (Units in (Region centered at (BombDrop[0] offset by (0.00, 0.00)) with size (400.00, 400.00)) matching (((((Unit-type of (Matching unit)) is A structure) Equal to True) or (((Unit-type of (Matching unit)) is A ground unit) Equal to True)) a
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Region centered at BombDrop[4] with size (200.00, 200.00)) contains (Matching unit)) Equal to True
Then - Actions
Set BombedUnit[4] = (Random unit from (Units in (Region centered at (BombDrop[0] offset by (0.00, 0.00)) with size (400.00, 400.00)) matching (((((Unit-type of (Matching unit)) is A structure) Equal to True) or (((Unit-type of (Matching unit)) is A ground unit) Equal to True)) a
Else - Actions
Special Effect - Create a special effect at BombDrop[0] using Objects\Spawnmodels\Human\SmallFlameSpawn\SmallFlameSpawn.mdl
Unit - Order (Casting unit) to damage BombedUnit[0] for 100.00 using attack type Siege and damage type Demolition.
Unit - Order (Casting unit) to damage BombedUnit[1] for 100.00 using attack type Siege and damage type Demolition.
Unit - Order (Casting unit) to damage BombedUnit[2] for 100.00 using attack type Siege and damage type Demolition.
Unit - Order (Casting unit) to damage BombedUnit[3] for 100.00 using attack type Siege and damage type Demolition.
Unit - Order (Casting unit) to damage BombedUnit[4] for 100.00 using attack type Siege and damage type Demolition.
Unit - Set (Casting unit) movement speed to (Default movement speed of (Casting unit))
Bombing Run Copy
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Bombing Run
Actions
Unit - Set (Casting unit) movement speed to 400.00
Unit - Order (Casting unit) to Move To (Target point of ability being cast)
For each (Integer A) from 1 to 8, do (Actions)
Loop - Actions
Wait (Random real number between 0.05 and 0.50) game-time seconds
Set BombDrop[0] = (Random point in (Region centered at (Position of (Casting unit)) with size (400.00, 400.00)))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Region centered at BombDrop[0] with size (200.00, 200.00)) contains (Matching unit)) Equal to True
Then - Actions
Set BombedUnit[0] = (Random unit from (Units in (Region centered at (BombDrop[0] offset by (0.00, 0.00)) with size (400.00, 400.00)) matching (((((Unit-type of (Matching unit)) is A structure) Equal to True) or (((Unit-type of (Matching unit)) is A ground unit) Equal to True)) a
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Region centered at BombDrop[1] with size (200.00, 200.00)) contains (Matching unit)) Equal to True
Then - Actions
Set BombedUnit[1] = (Random unit from (Units in (Region centered at (BombDrop[0] offset by (0.00, 0.00)) with size (400.00, 400.00)) matching (((((Unit-type of (Matching unit)) is A structure) Equal to True) or (((Unit-type of (Matching unit)) is A ground unit) Equal to True)) a
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Region centered at BombDrop[2] with size (200.00, 200.00)) contains (Matching unit)) Equal to True
Then - Actions
Set BombedUnit[2] = (Random unit from (Units in (Region centered at (BombDrop[0] offset by (0.00, 0.00)) with size (400.00, 400.00)) matching (((((Unit-type of (Matching unit)) is A structure) Equal to True) or (((Unit-type of (Matching unit)) is A ground unit) Equal to True)) a
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Region centered at BombDrop[3] with size (200.00, 200.00)) contains (Matching unit)) Equal to True
Then - Actions
Set BombedUnit[3] = (Random unit from (Units in (Region centered at (BombDrop[0] offset by (0.00, 0.00)) with size (400.00, 400.00)) matching (((((Unit-type of (Matching unit)) is A structure) Equal to True) or (((Unit-type of (Matching unit)) is A ground unit) Equal to True)) a
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Region centered at BombDrop[4] with size (200.00, 200.00)) contains (Matching unit)) Equal to True
Then - Actions
Set BombedUnit[4] = (Random unit from (Units in (Region centered at (BombDrop[0] offset by (0.00, 0.00)) with size (400.00, 400.00)) matching (((((Unit-type of (Matching unit)) is A structure) Equal to True) or (((Unit-type of (Matching unit)) is A ground unit) Equal to True)) a
Else - Actions
Special Effect - Create a special effect at BombDrop[0] using Objects\Spawnmodels\Human\SmallFlameSpawn\SmallFlameSpawn.mdl
Unit - Order (Casting unit) to damage BombedUnit[0] for 100.00 using attack type Siege and damage type Demolition.
Unit - Order (Casting unit) to damage BombedUnit[1] for 100.00 using attack type Siege and damage type Demolition.
Unit - Order (Casting unit) to damage BombedUnit[2] for 100.00 using attack type Siege and damage type Demolition.
Unit - Order (Casting unit) to damage BombedUnit[3] for 100.00 using attack type Siege and damage type Demolition.
Unit - Order (Casting unit) to damage BombedUnit[4] for 100.00 using attack type Siege and damage type Demolition.
Unit - Set (Casting unit) movement speed to (Default movement speed of (Casting unit))


