robinremue
Member
- Reaction score
- 16
Long time since I've posted something here Anyway here's my problem.
I got this ability that targets every unit in an area around the caster and shoots a stream of fire at each target. My problems now are:
- The stream goes through the unit and a lot further then it should go.
- I want the stream to loop, so the stream hits a target, then the stream dissapears and a new stream is created going to the target, over and over again.
Hope you guys understand my problems
I got this ability that targets every unit in an area around the caster and shoots a stream of fire at each target. My problems now are:
- The stream goes through the unit and a lot further then it should go.
- I want the stream to loop, so the stream hits a target, then the stream dissapears and a new stream is created going to the target, over and over again.
Hope you guys understand my problems
Code:
Spell
Events
Unit - A unit Begins channeling an ability
Conditions
(Ability being cast) Equal to Apocalypse
Actions
Set Angle = (Angle from Caster_Point to Target_Point)
Set Caster_Point = (Position of (Casting unit))
Set Spell_Point = (Region centered at Caster_Point with size (2048.00, 2048.00))
Set tmpReal = (Real(((Number of units in (Units in Spell_Point)) / 2)))
Set tmpInteger = (Integer(((Distance between Caster_Point and Target_Point) / tmpReal)))
Set Target_Point = (Position of Target_Unit)
Set Distance = 0.00
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units in Spell_Point)) Greater than 0
Then - Actions
Set Target_Unit = (Random unit from (Units in Spell_Point owned by Player 2 (Blue)))
For each (Integer A) from 1 to tmpInteger, do (Actions)
Loop - Actions
Unit Group - Pick every unit in (Units in Spell_Point matching ((Owner of (Picked unit)) Not equal to (Owner of (Casting unit)))) and do (Actions)
Loop - Actions
Set Distance = (Distance + tmpReal)
Set Target_Unit = (Picked unit)
Set Target_Point = (Position of Target_Unit)
Set Angle = (Angle from Caster_Point to Target_Point)
Special Effect - Create a special effect at (Caster_Point offset by Distance towards Angle degrees) using Environment\SmallBuildingFire\SmallBuildingFire2.mdl
Set Flame_effects[(Integer A)] = (Last created special effect)
Wait 0.10 seconds
Wait 0.10 seconds
Wait 2.00 seconds
For each (Integer A) from 1 to tmpInteger, do (Actions)
Loop - Actions
Special Effect - Destroy Flame_effects[(Integer A)]
Else - Actions
Do nothing