- Joined
- Feb 25, 2009
- Messages
- 2,004
I got a pretty weird problem with a spell I was making few days ago.
Here the trigger(s) I use for it:
This sometimes also happens when it is cast several the times BEFORE the first cast missle reaches its target.
Any suggestions to fix the problem are accepted.
Thanks in advance.
Test map can be found here.
Here the trigger(s) I use for it:
-
Bouncer Main
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Bouncer
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- MUI2 Equal to 0
-
Then - Actions
- Trigger - Turn on Bouncer Loop <gen>
- Else - Actions
-
If - Conditions
- Set MUI1 = (MUI1 + 1)
- Set MUI2 = (MUI2 + 1)
- Set B_Caster[MUI2] = (Triggering unit)
- Set B_Target[MUI2] = (Target unit of ability being cast)
- Set B_cPoint = (Position of (Triggering unit))
- Set B_tPoint[MUI2] = (Position of B_Target[MUI2])
- Set B_Level[MUI2] = (Level of Bouncer for (Triggering unit))
- Unit - Create 1 Projectile Dummy for (Owner of (Triggering unit)) at B_cPoint facing B_tPoint[MUI2]
- Set B_Dummy[MUI2] = (Last created unit)
- Animation - Change B_Dummy[MUI2] flying height to 75.00 at 0.00
- Special Effect - Create a special effect attached to the origin of B_Dummy[MUI2] using Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
- Set B_MissleModel[MUI2] = (Last created special effect)
- Set B_MaxBounces[MUI2] = (2 + (3 x B_Level[MUI2]))
- Set B_Damage[MUI2] = (10.00 x (Real(B_Level[MUI2])))
- Set B_Increment = (2.00 x (Real(B_Level[MUI2])))
- Set B_Angle[MUI2] = (Angle from B_cPoint to B_tPoint[MUI2])
- Custom script: call RemoveLocation (udg_B_cPoint)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
-
Bouncer Loop
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
-
For each (Integer MUI3) from 1 to MUI2, do (Actions)
-
Loop - Actions
- Set B_dPoint[MUI3] = (Position of B_Dummy[MUI3])
- Set B_tPoint[MUI3] = (Position of B_Target[MUI3])
- Set B_Angle[MUI3] = (Angle from B_dPoint[MUI3] to B_tPoint[MUI3])
- Set B_mPoint[MUI3] = (B_dPoint[MUI3] offset by 25.00 towards B_Angle[MUI3] degrees)
- Unit - Move B_Dummy[MUI3] instantly to B_mPoint[MUI3]
- Set B_Distance[MUI3] = (Distance between B_dPoint[MUI3] and B_tPoint[MUI3])
- Custom script: call RemoveLocation (udg_B_mPoint[udg_MUI3])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- B_Distance[MUI3] Less than or equal to 100.00
-
Then - Actions
- Set B_NumBounces[MUI3] = (B_NumBounces[MUI3] + 1)
- Unit - Cause B_Caster[MUI3] to damage B_Target[MUI3], dealing (B_Damage[MUI3] + (B_Increment x (Real(B_NumBounces[MUI3])))) damage of attack type Spells and damage type Unknown
- Special Effect - Create a special effect at B_tPoint[MUI3] using Abilities\Spells\Undead\Possession\PossessionMissile.mdl
- Special Effect - Destroy (Last created special effect)
- Set B_LastTarget[MUI3] = B_Target[MUI3]
- Set B_HitGroup[MUI3] = (Units within 325.00 of B_dPoint[MUI3] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of B_Dummy[MUI3])) Equal to True) and ((Matching unit) Not
- Custom script: set udg_B_Target[udg_MUI3] = FirstOfGroup(udg_B_HitGroup[udg_MUI3])
- Unit Group - Remove all units from B_HitGroup[MUI3]
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- (B_Target[MUI3] is dead) Equal to True
- B_Target[MUI3] Equal to No unit
- B_NumBounces[MUI3] Greater than or equal to B_MaxBounces[MUI3]
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
- Set B_Caster[MUI3] = No unit
- Unit - Remove B_Dummy[MUI3] from the game
- Set B_Dummy[MUI3] = No unit
- Set B_LastTarget[MUI3] = No unit
- Set B_NumBounces[MUI3] = 0
- Custom script: call RemoveLocation (udg_B_tPoint[udg_MUI3])
- Custom script: call RemoveLocation (udg_B_dPoint[udg_MUI3])
- Custom script: call DestroyGroup (udg_B_HitGroup[udg_MUI3])
- Set MUI1 = (MUI1 - 1)
- Else - Actions
-
If - Conditions
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- MUI1 Equal to 0
-
Then - Actions
- Set MUI2 = 0
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
-
For each (Integer MUI3) from 1 to MUI2, do (Actions)
-
Events
This sometimes also happens when it is cast several the times BEFORE the first cast missle reaches its target.
Any suggestions to fix the problem are accepted.
Thanks in advance.
Test map can be found here.
Last edited: