- Joined
- Jul 9, 2012
- Messages
- 159
Hello hive members.
I have just started working with custom scripts and I can't get this one to work. It's a spell that is supposed to summon a black hole 700yards (or what it is) behind the targeted unit. It will start dragging him towards it, but he can flee from it untill the duration ends up.
But my problem is that he is locked in the drag point. He uses his run animation but cannot walk away from it, if you know what it mean
Here it is:
I have just started working with custom scripts and I can't get this one to work. It's a spell that is supposed to summon a black hole 700yards (or what it is) behind the targeted unit. It will start dragging him towards it, but he can flee from it untill the duration ends up.
But my problem is that he is locked in the drag point. He uses his run animation but cannot walk away from it, if you know what it mean
Here it is:
-
Black Hole
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Summon Black Hole
-
Actions
- Set BlackHoleCaster = (Triggering unit)
- Set BlackHoleTarget = (Target unit of ability being cast)
- Set BlackHoleTargedPoint = (Position of BlackHoleTarget)
- Set BlackHolePoint = (BlackHoleTargedPoint offset by 700.00 towards ((Facing of BlackHoleTarget) - 180.00) degrees)
- Set BlackHole_Distance = 30
- Special Effect - Create a special effect at BlackHolePoint using BlackHoleSpell.mdx
- Set TheBlackHole = (Last created special effect)
- Unit - Turn collision for BlackHoleTarget Off
- Lightning - Create a Drain Life lightning effect from source BlackHolePoint to target BlackHoleTargedPoint
- Set BlackHoleEffect = (Last created lightning effect)
- Trigger - Turn on Black Hole Loop <gen>
- Wait 10.00 seconds
- Trigger - Turn off Black Hole Loop <gen>
- Special Effect - Create a special effect at BlackHolePoint using Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
- Special Effect - Destroy (Last created special effect)
- Custom script: call RemoveLocation(udg_BlackHoleTargedPoint)
- Custom script: call RemoveLocation(udg_BlackHolePoint)
- Custom script: call RemoveLocation(udg_BlackHoleDrag)
- Lightning - Destroy BlackHoleEffect
- Special Effect - Destroy TheBlackHole
-
Events
-
Black Hole 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
- (Integer((Distance between BlackHoleTargedPoint and BlackHolePoint))) Greater than BlackHole_Distance
-
Then - Actions
- Set BlackHoleDrag = (BlackHoleTargedPoint offset by 5.00 towards (Angle from BlackHoleTargedPoint to BlackHolePoint) degrees)
- Custom script: call SetUnitX(udg_BlackHoleTarget,GetLocationX(udg_BlackHoleDrag))
- Custom script: call SetUnitY(udg_BlackHoleTarget,GetLocationY(udg_BlackHoleDrag))
- Set BlackHoleTargedPoint = (Position of BlackHoleTarget)
- Lightning - Move BlackHoleEffect to source BlackHolePoint and target BlackHoleTargedPoint
-
Else - Actions
- Trigger - Turn off (This trigger)
- Unit - Kill BlackHoleTarget
- Special Effect - Create a special effect at BlackHolePoint using Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
- Special Effect - Destroy (Last created special effect)
- Custom script: call RemoveLocation(udg_BlackHoleTargedPoint)
- Custom script: call RemoveLocation(udg_BlackHolePoint)
- Custom script: call RemoveLocation(udg_BlackHoleDrag)
- Lightning - Destroy BlackHoleEffect
- Special Effect - Destroy TheBlackHole
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
Last edited: