LordSaddler1
New Member
- Reaction score
- 4
I'm making an ability called Bounding Spear, (like Chain Frost in DotA) where it hits one target, then bounces to another and another an so on. My main difference is that mine is channeling and drains mana for each bounce. So far, whenever i test it, it permastuns all the units it affects, and sometimes hits the same unit 4 times, sometimes hits 6 units, and pretty much hits random units random times. Pl help me find my mistake. (I'll get leaks later)
+rep :thup:
Code:
Bounding Spear
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Bounding Spear
Actions
Set Bounding_Caster = (Triggering unit)
Set Bounding_Target = (Target unit of ability being cast)
Set Bounding_Region = (Region centered at (Position of Bounding_Target) with size (500.00, 500.00))
For each (Integer A) from 1 to (5 + (5 x (Level of Bounding Spear for Bounding_Caster))), do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Bounding_Integer Less than (5 + (5 x (Level of Bounding Spear for Bounding_Caster)))
Then - Actions
Unit Group - Pick every unit in (Random 1 units from (Units in Bounding_Region)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Bounding_Target Equal to (Picked unit)
Then - Actions
Do nothing
Else - Actions
Unit - Create 1 Casting Dummy for (Owner of Bounding_Caster) at (Position of Bounding_Target) facing Default building facing degrees
Set Bounding_Dummy = (Last created unit)
Set Bounding_Target = (Picked unit)
Set Bounding_Region = (Region centered at (Position of Bounding_Target) with size (500.00, 500.00))
Unit - Add Bounding Spear (Dummy) to Bounding_Dummy
Unit - Set level of Bounding Spear (Dummy) for Bounding_Dummy to (Level of Bounding Spear for Bounding_Caster)
Unit - Order Bounding_Dummy to Human Mountain King - Storm Bolt Bounding_Target
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Unit - Set mana of Bounding_Caster to ((Mana of Bounding_Caster) - (20.00 + (10.00 x (Real((Level of Bounding Spear for Bounding_Caster))))))
Set Bounding_Integer = (Bounding_Integer + 1)
Else - Actions
Set Bounding_Integer = 0
+rep :thup: