sentrywiz
S
sentrywiz
I have a problem that I can't see the solution.
The issue is, when a unit is damaged by the trigger, it is being added to unit group. Then at the end of the lifespan of the projectile, that unit group is being cleared from all units in it. The point is that the trigger should damage one unit only ONCE per projectile and add it to a group so it doesn't damage it again. But the trigger repeatedly adds the same unit to the unit group and damaging it again, thus resulting in insta kill once you get hit the projectile:
I've marked where the trigger is (in the 2nd one) with the HERE >>>>>>>>
The issue is, when a unit is damaged by the trigger, it is being added to unit group. Then at the end of the lifespan of the projectile, that unit group is being cleared from all units in it. The point is that the trigger should damage one unit only ONCE per projectile and add it to a group so it doesn't damage it again. But the trigger repeatedly adds the same unit to the unit group and damaging it again, thus resulting in insta kill once you get hit the projectile:
I've marked where the trigger is (in the 2nd one) with the HERE >>>>>>>>
-
fb start
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Fast Blade
-
Actions
- Set fb_loc1 = (Position of (Triggering unit))
- Set fb_loc2 = (Target point of ability being cast)
- Set fb_loc3 = (fb_loc1 offset by 60.00 towards (Angle from fb_loc1 to fb_loc2) degrees)
- Set fb_next_unit[(Player number of (Owner of (Triggering unit)))] = 50.00
- Set fb_max_units[(Player number of (Owner of (Triggering unit)))] = 15
- Set fb_unit[(Player number of (Owner of (Triggering unit)))] = 0
- Set fb_total = (fb_total + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Triggering unit) has buff Cyclone -) Equal to True
-
Then - Actions
- Set fb_faster[(Player number of (Owner of (Triggering unit)))] = True
- Set fb_duration[(Player number of (Owner of (Triggering unit)))] = 0.50
-
Else - Actions
- Set fb_faster[(Player number of (Owner of (Triggering unit)))] = False
- Set fb_duration[(Player number of (Owner of (Triggering unit)))] = 0.80
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Triggering unit) has buff Accuracy) Equal to True
-
Then - Actions
- Set fb_wider[(Player number of (Owner of (Triggering unit)))] = True
- Set fb_dmg[(Player number of (Owner of (Triggering unit)))] = 75
- Set fb_max_dmg[(Player number of (Owner of (Triggering unit)))] = 245
-
Else - Actions
- Set fb_wider[(Player number of (Owner of (Triggering unit)))] = False
- Set fb_dmg[(Player number of (Owner of (Triggering unit)))] = 50
- Set fb_max_dmg[(Player number of (Owner of (Triggering unit)))] = 170
-
If - Conditions
- Unit - Create 1 Frog for (Owner of (Triggering unit)) at fb_loc3 facing (Angle from fb_loc1 to fb_loc2) degrees
- Unit - Add a fb_duration[(Player number of (Owner of (Triggering unit)))] second Generic expiration timer to (Last created unit)
- Unit Group - Add (Last created unit) to fb_group
- Trigger - Turn on fb loop <gen>
- Custom script: call RemoveLocation ( udg_fb_loc1 )
- Custom script: call RemoveLocation ( udg_fb_loc2 )
- Custom script: call RemoveLocation ( udg_fb_loc3 )
-
Events
-
fb loop
-
Events
- Time - Every 0.05 seconds of game time
- Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- fb_total Greater than 0
- (Number of units in fb_group) Greater than 0
-
Then - Actions
-
Unit Group - Pick every unit in fb_group and do (Actions)
-
Loop - Actions
- Set fb_player_int = (Player number of (Owner of (Picked unit)))
- Set fb_real_unit[fb_player_int] = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- fb_unit[fb_player_int] Less than fb_max_units[fb_player_int]
-
Then - Actions
- Set fb_unit[fb_player_int] = (fb_unit[fb_player_int] + 1)
- Set fb_dmg[fb_player_int] = (fb_dmg[fb_player_int] + 15)
- Set fb_loc1 = (Position of (Picked unit))
- Set fb_pos1[fb_player_int] = (Position of (Picked unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- fb_faster[(Player number of (Owner of (Picked unit)))] Equal to True
-
Then - Actions
- Set fb_pos2[fb_player_int] = (fb_pos1[fb_player_int] offset by 60.00 towards (Facing of (Picked unit)) degrees)
-
Else - Actions
- Set fb_pos2[fb_player_int] = (fb_pos1[fb_player_int] offset by 40.00 towards (Facing of (Picked unit)) degrees)
-
If - Conditions
- Unit - Move (Picked unit) instantly to fb_pos2[fb_player_int]
- Set fb_pos3[fb_player_int] = (Position of (Picked unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- fb_wider[fb_player_int] Equal to True
-
Then - Actions
- Set fb_hit_groupp[fb_player_int] = (Units within 150.00 of fb_pos3[fb_player_int] matching ((((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True) and (((Matching unit) is alive) Equal to True)))
- Animation - Change (Picked unit)'s size to (250.00%, 250.00%, 250.00%) of its original size
-
Else - Actions
- Set fb_hit_groupp[fb_player_int] = (Units within 100.00 of fb_pos3[fb_player_int] matching ((((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True) and (((Matching unit) is alive) Equal to True)))
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in fb_hit_groupp[fb_player_int]) Greater than 0
-
Then - Actions
-
HERE ->>>>>>> Unit Group - Pick every unit in fb_hit_groupp[fb_player_int] and do (Actions)
-
Loop - Actions
- Set fb_hit_unit = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (fb_hit_unit is in fb_unit_already_hit[fb_player_int]) Equal to True
-
Then - Actions
- Game - Display to (All players) for 2.00 seconds the text: ((Name of fb_hit_unit) + is in group)
-
Else - Actions
- Game - Display to (All players) for 2.00 seconds the text: ((Name of fb_hit_unit) + isn't in group)
- If (fb_dmg[fb_player_int] Greater than fb_max_dmg[fb_player_int]) then do (Set fb_dmg[fb_player_int] = fb_max_dmg[fb_player_int]) else do (Do nothing)
- Unit - Cause fb_real_unit[fb_player_int] to damage fb_hit_unit, dealing (Real(fb_dmg[fb_player_int])) damage of attack type Spells and damage type Universal
- Unit Group - Add fb_hit_unit to fb_unit_already_hit[fb_player_int]
- Floating Text - Create floating text that reads (String(fb_dmg[fb_player_int])) above fb_hit_unit with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
- Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
-
If - Conditions
-
Loop - Actions
-
HERE ->>>>>>> Unit Group - Pick every unit in fb_hit_groupp[fb_player_int] and do (Actions)
- Else - Actions
-
If - Conditions
- Custom script: call DestroyGroup ( udg_fb_hit_groupp [ udg_fb_player_int ] )
- Custom script: call RemoveLocation ( udg_fb_pos1 [ udg_fb_player_int ] )
- Custom script: call RemoveLocation ( udg_fb_pos2 [ udg_fb_player_int ] )
- Custom script: call RemoveLocation ( udg_fb_pos3 [ udg_fb_player_int ] )
-
Else - Actions
- Set fb_total = (fb_total - 1)
- Set fb_faster[fb_player_int] = False
- Unit Group - Remove (Picked unit) from fb_group
- Unit Group - Remove all units from fb_unit_already_hit[fb_player_int]
-
If - Conditions
-
Loop - Actions
-
Unit Group - Pick every unit in fb_group and do (Actions)
-
Else - Actions
- Trigger - Turn off (This trigger)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events