- Joined
- Aug 8, 2010
- Messages
- 1,022
Hello! I have a pretty major problem. I thought i will solve it easy at first, but then i realized that this will be one hell of a job...
In my leakless MUI spell (although if there is somewhere a leak - tell me please) i have a custom chain lightning. Everything works fine, it's MUI. But if the units affected by the lightnings are moving, the lightnings somehow stay in one place and don't move with the units, affected by the spell (it looks like the lightnings come up from nowhere). I know that this is because the dummies that cast the secondary lightnings (the bouncing lightnings) arn't moving. And the problem is in the way to make those dummies move with the unit, at which they are created. I tried many things, but i failed.
Triggers :
Help will be appreciated with a +rep! Thanks in advance!
I will upload my spell, so you can see what is happening
In my leakless MUI spell (although if there is somewhere a leak - tell me please) i have a custom chain lightning. Everything works fine, it's MUI. But if the units affected by the lightnings are moving, the lightnings somehow stay in one place and don't move with the units, affected by the spell (it looks like the lightnings come up from nowhere). I know that this is because the dummies that cast the secondary lightnings (the bouncing lightnings) arn't moving. And the problem is in the way to make those dummies move with the unit, at which they are created. I tried many things, but i failed.
Triggers :
-
Chain Shock Cast
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Chain Shock [Dummy]
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ChainID2 Equal to 0
-
Then - Actions
- Trigger - Turn on Chain Shock Loop <gen>
- Else - Actions
-
If - Conditions
- Set ChainID2 = (ChainID2 + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ChainID2 Greater than ChainIDMax
-
Then - Actions
- Set ChainID[ChainID2] = ChainID2
- Set ChainIDMax = ChainID2
- Else - Actions
-
If - Conditions
- Set ChainArray = ChainID[ChainID2]
- Set ChainBounceArray[ChainArray] = 0
- Set ChainGroupCheck[ChainArray] = 0
- Set ChainCaster[ChainArray] = (Triggering unit)
- Set ChainBounceDelay = 0.80
- Set ChainDelay[ChainArray] = ChainBounceDelay
- Set ChainAbilityLevel[ChainArray] = (Level of Chain Shock [Dummy] for (Triggering unit))
- Set ChainBounces[ChainArray] = (5 + (1 x ChainAbilityLevel[ChainArray]))
- Set ChainTarget[ChainArray] = (Target unit of ability being cast)
- Set ChainTargetPos[ChainArray] = (Position of ChainTarget[ChainArray])
- Set ChainShockedUnit[ChainArray] = ChainTarget[ChainArray]
- Set ChainBouncePoint[ChainArray] = ChainTargetPos[ChainArray]
- Unit - Cause (Triggering unit) to damage ChainTarget[ChainArray], dealing (50.00 + (50.00 x (Real(ChainAbilityLevel[ChainArray])))) damage of attack type Spells and damage type Lightning
- Custom script: call RemoveLocation(udg_ChainTargetPos[udg_ChainArray])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
-
Chain Shock Loop
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
-
For each (Integer ChainLoop) from 1 to ChainID2, do (Actions)
-
Loop - Actions
- Set ChainArray = ChainID[ChainLoop]
- Set ChainDelay[ChainArray] = (ChainDelay[ChainArray] - 0.03)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ChainBounces[ChainArray] Equal to 0
-
Then - Actions
- Set ChainID[ChainLoop] = ChainID[ChainID2]
- Set ChainID[ChainID2] = ChainArray
- Set ChainID2 = (ChainID2 - 1)
- Set ChainLoop = (ChainLoop - 1)
- Game - Display to (All players) the text: End
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ChainDelay[ChainArray] Less than or equal to 0.00
-
Then - Actions
- Set ChainBouncePoint[ChainArray] = (Position of ChainShockedUnit[ChainArray])
- Set ChainUnitGroup[ChainArray] = (Units within 500.00 of ChainBouncePoint[ChainArray] matching ((((Matching unit) belongs to an ally of (Owner of ChainCaster[ChainArray])) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Not equal to Dummy))
-
Unit Group - Pick every unit in ChainUnitGroup[ChainArray] and do (Actions)
-
Loop - Actions
- Set ChainGroupCheck[ChainArray] = (ChainGroupCheck[ChainArray] + 1)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ChainGroupCheck[ChainArray] Less than or equal to 1
-
Then - Actions
- Set ChainID[ChainLoop] = ChainID[ChainID2]
- Set ChainID[ChainID2] = ChainArray
- Set ChainID2 = (ChainID2 - 1)
- Set ChainLoop = (ChainLoop - 1)
- Game - Display to (All players) the text: End
- Custom script: call DestroyGroup(udg_ChainUnitGroup[udg_ChainArray])
- Custom script: call RemoveLocation(udg_ChainBouncePoint[udg_ChainArray])
- Skip remaining actions
-
Else - Actions
- Set ChainGroupCheck[ChainArray] = 0
-
If - Conditions
- Unit Group - Remove ChainShockedUnit[ChainArray] from ChainUnitGroup[ChainArray]
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (ChainUnitGroup[ChainArray] is empty) Equal to True
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (ChainShockedUnit[ChainArray] is alive) Equal to True
-
Then - Actions
- Unit Group - Add ChainShockedUnit[ChainArray] to ChainUnitGroup[ChainArray]
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
- Set ChainShockedUnit[ChainArray] = (Random unit from ChainUnitGroup[ChainArray])
- Unit - Create 1 Dummy for (Owner of ChainCaster[ChainArray]) at ChainBouncePoint[ChainArray] facing Default building facing degrees
- Set ChainDummy[ChainArray] = (Last created unit)
- Unit - Add a 0.40 second Generic expiration timer to ChainDummy[ChainArray]
- Unit - Add Chain Shock Secondary [Dummy] to ChainDummy[ChainArray]
- Unit - Order ChainDummy[ChainArray] to Special Archimonde - Finger Of Death ChainShockedUnit[ChainArray]
- Unit - Cause ChainDummy[ChainArray] to damage ChainShockedUnit[ChainArray], dealing (25.00 + (25.00 x (Real(ChainAbilityLevel[ChainArray])))) damage of attack type Spells and damage type Lightning
- Game - Display to (All players) the text: Daayum
- Set ChainBounces[ChainArray] = (ChainBounces[ChainArray] - 1)
- Set ChainDelay[ChainArray] = ChainBounceDelay
- Custom script: call DestroyGroup(udg_ChainUnitGroup[udg_ChainArray])
- Custom script: call RemoveLocation(udg_ChainBouncePoint[udg_ChainArray])
- Else - Actions
-
If - Conditions
-
Loop - Actions
-
For each (Integer ChainLoop) from 1 to ChainID2, do (Actions)
-
Events
I will upload my spell, so you can see what is happening
Last edited: