Hey guys, I need help on a spell that makes a projectile jump between units (not necessarily the "jump" motion but jump move it into other units nearby) Very much like Dota's Lich's Ultimate - Chain frost.
Im sorry if its a little bit confusing, im not really good with english but i hope that you get what im trying to say. So in detail, I target one enemy, the ball moves into the enemy, after the ball hits, if moves into another enemy, and into another and so on until it hits an x number of units.
The problem is, i can't get it to stop after hitting x amounts of units, because if I try to add 1 to BBnum, and then remove BBMissile, it just almost instantly removes BBMissile. so this trigger here is an edited one, Ive deleted the lines that I thought might be "broken" or "unnecessary".
Also, I know that this trigger leaks but I have no idea on what is leaking, I know how to remove points and units though but about the other ones, I have not understood how to remove them.
Edit: edited.
Im sorry if its a little bit confusing, im not really good with english but i hope that you get what im trying to say. So in detail, I target one enemy, the ball moves into the enemy, after the ball hits, if moves into another enemy, and into another and so on until it hits an x number of units.
The problem is, i can't get it to stop after hitting x amounts of units, because if I try to add 1 to BBnum, and then remove BBMissile, it just almost instantly removes BBMissile. so this trigger here is an edited one, Ive deleted the lines that I thought might be "broken" or "unnecessary".
Also, I know that this trigger leaks but I have no idea on what is leaking, I know how to remove points and units though but about the other ones, I have not understood how to remove them.
-
BouncingBall
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-


(Ability being cast) Equal to Bouncing Ball
-
-

Actions
-


Custom script: set udg_WitchDoctor[3] = GetTriggerUnit()
-


Custom script: set udg_BBloc[0] = GetUnitLoc( udg_WitchDoctor[3] )
-


Custom script: set udg_BBnum = 1
-


Custom script: set udg_BBTarget[0] = GetSpellTargetUnit()
-


Custom script: set udg_BBloc[1] = GetUnitLoc( udg_BBTarget[0] )
-


Custom script: call CreateNUnitsAtLocFacingLocBJ( 1, 'h004', GetOwningPlayer( udg_WitchDoctor[3] ), udg_BBloc[0], udg_BBloc[udg_BBnum] )
-


Custom script: set udg_BBMissile = GetLastCreatedUnit()
-


Unit Group - Add BBTarget[0] to BBexecption
-


Custom script: call RemoveLocation( udg_BBloc[0] )
-


Custom script: call EnableTrigger( gg_trg_Bouncingloop )
-


Trigger - Turn off (This trigger)
-
-
-
Bouncingloop
-

Events
-


Time - Every 0.04 seconds of game time
-
-

Conditions
-

Actions
-


Custom script: set udg_BBloc[2] = GetUnitLoc(udg_BBMissile)
-


Custom script: set udg_BBloc[1] = GetUnitLoc(udg_BBTarget[0])
-


Set BBAngle = (Angle from BBloc[2] to BBloc[1])
-


Custom script: set udg_BBDistance = DistanceBetweenPoints( udg_BBloc[2], udg_BBloc[1] )
-


Set BBloc[3] = (BBloc[2] offset by 27.00 towards BBAngle degrees)
-


Unit - Move BBMissile instantly to BBloc[3]
-


Custom script: call RemoveLocation(udg_BBloc[3])
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




(Integer(BBDistance)) Less than or equal to 50
-
-



Then - Actions
-




Custom script: set udg_BBloc[2] = GetUnitLoc( udg_BBMissile )
-




Unit Group - Pick every unit in (Units within 700.00 of BBloc[2]) and do (Actions)
-





Loop - Actions
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








((Picked unit) is alive) Equal to True
-








((Picked unit) belongs to an enemy of (Owner of WitchDoctor[3])) Equal to True
-








((Picked unit) is in BBexecption) Not equal to True
-
-







Then - Actions
-








Unit Group - Add (Picked unit) to BBUnitGroup
-








If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-









If - Conditions
-










BBnum Less than or equal to 6
-
-









Then - Actions
-










Unit Group - Pick every unit in (Random 1 units from BBUnitGroup) and do (Actions)
-











Loop - Actions
-












Set BBTarget[0] = (Picked unit)
-












Unit Group - Remove all units from BBexecption
-












Unit Group - Add BBTarget[0] to BBexecption
-
-
-
-









Else - Actions
-
-
-







Else - Actions
-
-
-
-
-



Else - Actions
-
-


Custom script: call RemoveLocation(udg_BBloc[1])
-
-
Edit: edited.
Last edited: