- Joined
- Jun 20, 2017
- Messages
- 380
I have a channel ability that should stun the unit in range!
This is what I want,
Ability: Creates a blast that stuns any structures within blast radius for 5 seconds.
Area of Effect: 300.
Cast Range: 1000.
Cooldown: 45 seconds.
Note: Does not work on Walls.
This is what I want,
Ability: Creates a blast that stuns any structures within blast radius for 5 seconds.
Area of Effect: 300.
Cast Range: 1000.
Cooldown: 45 seconds.
Note: Does not work on Walls.
-
Pulse Grenade
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Pulse Grenade [Channel] [Custom] Item
-
-
Actions
-
-------- Increase Index. --------
-
Set VariableSet PG_Index = (PG_Index + 1)
-
-------- --------
-
-------- Set Caster. --------
-
Set VariableSet PG_Caster[PG_Index] = (Triggering unit)
-
-------- --------
-
-------- Set Casting Player. --------
-
Set VariableSet PG_CastingPlayer[PG_Index] = (Triggering player)
-
-------- --------
-
-------- Setup Points. --------
-
Set VariableSet PG_Point[PG_Index] = (Position of PG_Caster[PG_Index])
-
Set VariableSet PG_Point[0] = (Target point of ability being cast)
-
-------- --------
-
-------- Configure Ability Settings. --------
-
Set VariableSet PG_AreaOfEffect[PG_Index] = 300.00
-
Set VariableSet PG_CastRange[PG_Index] = 1000.00
-
Set VariableSet PG_Duration[PG_Index] = 5.00
-
Set VariableSet PG_Cooldown[PG_Index] = 45.00
-
-------- --------
-
-------- Setup Special Effect. --------
-
Special Effect - Create a special effect at PG_Point[PG_Index] using Abilities\Spells\Human\StormBolt\StormBoltMissile.mdl
-
Set VariableSet PG_SpecialEffect[PG_Index] = (Last created special effect)
-
-------- --------
-
-------- Setup Dummy. --------
-
Unit - Create 1 [Dummy] Pulse Grenade for (Triggering player) at PG_Point[0] facing Default building facing degrees
-
Set VariableSet PG_Dummy[PG_Index] = (Last created unit)
-
Unit - Add Pulse Grenade [Custom] Dummy to PG_Dummy[PG_Index]
-
Unit - Set level of Pulse Grenade [Custom] Dummy for PG_Dummy[PG_Index] to (Level of (Ability being cast) for PG_Caster[PG_Index])
-
-------- --------
-
Custom script: set udg_PG_HitGroup[udg_PG_Index] = CreateGroup()
-
Custom script: call RemoveLocation(udg_PG_Point[0])
-
-------- --------
-
-------- Start Loop (If it's currently off). --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
PG_Index Equal to 1
-
-
Then - Actions
-
Trigger - Turn on Pulse Grenade Loop <gen>
-
-
Else - Actions
-
-
-
-
Pulse Grenade Loop
-
Events
-
Time - Every 0.03 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer PG_Loop) from 1 to PG_Index, do (Actions)
-
Loop - Actions
-
-------- Search for units around the Ability and deal Damage (You could add other effects here besides damage). --------
-
Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within PG_AreaOfEffect[PG_Loop] of PG_Point[0].) and do (Actions)
-
Loop - Actions
-
Set VariableSet PG_PickedUnit = (Picked unit)
-
-------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(PG_PickedUnit belongs to an enemy of PG_CastingPlayer[PG_Loop].) Equal to True
-
(PG_PickedUnit is alive) Equal to True
-
(PG_PickedUnit is A structure) Equal to True
-
(PG_PickedUnit is hidden) Equal to False
-
(PG_PickedUnit is invulnerable) Equal to False
-
(PG_PickedUnit is Magic Immune) Equal to False
-
(PG_PickedUnit is in PG_HitGroup[PG_Loop].) Equal to False
-
Or - Any (Conditions) are true
-
Conditions
-
(Unit-type of PG_PickedUnit) Not equal to Wall
-
(Unit-type of PG_PickedUnit) Not equal to Wall (2)
-
(Unit-type of PG_PickedUnit) Not equal to Wall (3)
-
(Unit-type of PG_PickedUnit) Not equal to Wall (4)
-
(Unit-type of PG_PickedUnit) Not equal to Wall (5)
-
(Unit-type of PG_PickedUnit) Not equal to Wall (6)
-
(Unit-type of PG_PickedUnit) Not equal to Wall (7)
-
(Unit-type of PG_PickedUnit) Not equal to Wall (8)
-
(Unit-type of PG_PickedUnit) Not equal to Wall (9)
-
(Unit-type of PG_PickedUnit) Not equal to Wall (10)
-
(Unit-type of PG_PickedUnit) Not equal to Wall (11)
-
-
-
-
Then - Actions
-
Unit Group - Add PG_PickedUnit to PG_HitGroup[PG_Loop]
-
-------- --------
-
-------- Dummy (Stun). --------
-
Custom script: call SetUnitPosition(udg_PG_Dummy[udg_PG_Loop], GetUnitX(GetEnumUnit()), GetUnitY(GetEnumUnit()))
-
Unit - Order PG_Dummy[PG_Loop] to Human Mountain King - Storm Bolt PG_PickedUnit
-
-
Else - Actions
-
-
-
-
Custom script: call RemoveLocation(udg_PG_Point[0])
-
-------- --------
-
-------- Destroy the Special Effect/Missile Point/Hit Group. --------
-
Special Effect - Destroy PG_SpecialEffect[PG_Loop]
-
Unit - Remove PG_Dummy[PG_Loop] from the game
-
Custom script: call RemoveLocation(udg_PG_Point[udg_PG_Loop])
-
Custom script: call DestroyGroup(udg_PG_HitGroup[udg_PG_Loop])
-
-------- --------
-
-------- Adjust Index/Loop Variables (Explanation: https://www.hiveworkshop.com/threads/visualize-dynamic-indexing.241896/ ). --------
-
Set VariableSet PG_Caster[PG_Loop] = PG_Caster[PG_Index]
-
Set VariableSet PG_CastingPlayer[PG_Loop] = PG_CastingPlayer[PG_Index]
-
Set VariableSet PG_Point[PG_Loop] = PG_Point[PG_Index]
-
Set VariableSet PG_AreaOfEffect[PG_Loop] = PG_AreaOfEffect[PG_Index]
-
Set VariableSet PG_CastRange[PG_Loop] = PG_CastRange[PG_Index]
-
Set VariableSet PG_Duration[PG_Loop] = PG_Duration[PG_Index]
-
Set VariableSet PG_Cooldown[PG_Loop] = PG_Cooldown[PG_Index]
-
Set VariableSet PG_SpecialEffect[PG_Loop] = PG_SpecialEffect[PG_Index]
-
Set VariableSet PG_Dummy[PG_Loop] = PG_Dummy[PG_Index]
-
Set VariableSet PG_HitGroup[PG_Loop] = PG_HitGroup[PG_Index]
-
-------- --------
-
Set VariableSet PG_Index = (PG_Index - 1)
-
Set VariableSet PG_Loop = (PG_Loop - 1)
-
-------- --------
-
-------- Turn off this Trigger if there are no more Ability. --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
PG_Index Equal to 0
-
-
Then - Actions
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
-
-
-