I've been working on a spell, which creates an orb which travels forward and pulls enemies into it, but I met a strange bug, as when the unit casts the spell, then the trigger doesn't start. The dummy spell (called Gravity ORB) is based on shockwave (without animation or damage), the unit has only this spell (and invulnerability). First I tried making the spell be based on Channel, but that did not work, so I changed it to shockwave.
Does anyone have an idea what causes this problem and how could I solve it? And of course if someone sees a leak or a bug in the triggering then tell me that too.
-
grav orb cast
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Gravity ORB
-
Actions
- Game - Display to (All players) the text: DEBUG-CAST
- Set GO_index[0] = (GO_index[0] + 1)
- Set GO_index[1] = (GO_index[1] + 1)
- Set GO_caster[GO_index[1]] = (Triggering unit)
- Set GO_ca_pos[GO_index[1]] = (Position of GO_caster[GO_index[1]])
- Set GO_target[GO_index[1]] = (Target point of ability being cast)
- Set GO_move[GO_index[1]] = ((Distance between GO_ca_pos[GO_index[1]] and GO_target[GO_index[1]]) / 50.00)
- Set GO_angle[GO_index[1]] = (Angle from GO_ca_pos[GO_index[1]] to GO_target[GO_index[1]])
- Set GO_dur[GO_index[1]] = 2.00
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- GO_index[0] Equal to 1
-
Then - Actions
- Trigger - Turn on grav orb loop <gen>
- Else - Actions
-
If - Conditions
- Unit - Create 1 dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
- Set GO_dummy[GO_index[1]] = (Last created unit)
- Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Undead\DarkSummoning\DarkSummonMissile.mdl
- Set GO_spec[GO_index[1]] = (Last created special effect)
-
Events
-
grav orb loop
-
Events
- Time - Every 0.02 seconds of game time
- Conditions
-
Actions
-
For each (Integer index) from 1 to GO_index[1], do (Actions)
-
Loop - Actions
- Set GO_tmp_angle = GO_angle[GO_index[index]]
- Set GO_tmp_caster = GO_caster[GO_index[index]]
- Set GO_tmp_dummy = GO_dummy[GO_index[index]]
- Set GO_tmp_move = GO_move[GO_index[index]]
- Set GO_tmp_pos = (Position of GO_tmp_dummy)
- Set GO_tmp_group = (Units within 150.00 of GO_tmp_pos matching ((((Owner of (Matching unit)) is an enemy of (Owner of GO_tmp_caster)) Equal to True) and ((dummy Equal to (Unit-type of (Matching unit))) and (((Life of (Matching unit)) Greater than 0.00) and (True Equal to True))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- GO_dur[index] Equal to 0.00
-
Then - Actions
- Unit - Add a 0.25 second Generic expiration timer to GO_tmp_dummy
- Special Effect - Destroy GO_spec[index]
- Set GO_angle[index] = 0.00
- Set GO_caster[index] = No unit
- Set GO_dummy[index] = No unit
- Set GO_move[index] = 0.00
- Custom script: call RemoveLocation(udg_GO_ca_pos[udg_index])
- Custom script: call RemoveLocation(udg_GO_target[udg_index])
- -------- -------------------------------------- --------
- Unit - Create 1 dummy for (Owner of GO_tmp_caster) at GO_tmp_pos facing Default building facing degrees
- Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
- Unit - Add knockback to (Last created unit)
- Unit - Order (Last created unit) to Special - Channel
- Set GO_index[0] = (GO_index[0] - 1)
-
Else - Actions
-
Unit Group - Pick every unit in GO_tmp_group and do (Actions)
-
Loop - Actions
- Set GO_tmptmp_pos = (Position of (Picked unit))
- Set GO_tmptmp_angle = (Angle from GO_tmptmp_pos to GO_tmp_pos)
- Unit - Move (Picked unit) instantly to (GO_tmptmp_pos offset by 15.00 towards GO_tmptmp_angle degrees)
- Unit - Cause GO_tmp_caster to damage (Picked unit), dealing 2.00 damage of attack type Spells and damage type Normal
- Custom script: call RemoveLocation(udg_GO_tmptmp_pos)
-
Loop - Actions
- Set GO_dur[index] = (GO_dur[index] - 0.02)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- GO_dur[index] Greater than 1.00
-
Then - Actions
- Unit - Move GO_tmp_dummy instantly to (GO_tmp_pos offset by GO_tmp_move towards GO_tmp_angle degrees)
- Else - Actions
-
If - Conditions
-
Unit Group - Pick every unit in GO_tmp_group and do (Actions)
-
If - Conditions
- -------- ------------------------------------ --------
- Custom script: call RemoveLocation(udg_GO_tmp_pos)
- Custom script: call DestroyGroup(udg_GO_tmp_group)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- GO_index[0] Equal to 0
-
Then - Actions
- Set GO_index[1] = 0
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
-
For each (Integer index) from 1 to GO_index[1], do (Actions)
-
Events
Does anyone have an idea what causes this problem and how could I solve it? And of course if someone sees a leak or a bug in the triggering then tell me that too.