Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
You have a dummy ability. No damage no effect. Just to cast.
With trigger when that ability is cast create a dummy unit. Turn on another loop trigger.
In the loop trigger move it forward.
Check if there are units around it and if there are deal some damage and destroy the dummy.
-------- Those integers are used to index each cast and arrow. I would use a unit indexer for that purpose. --------
-------- A indexing is a must for any non instant spell. It prevents one units arrow to bug other units arrows. --------
-------- Spell of which only one can be casted at a time without a bug is refered as OSI - One Single Instance. Only 1 unit can cast the spell on the map at the same time. If another unit casts the spell while the first units spell is still taking effect a bug occurs.Those don't use index.--------
-------- Spell of which only one can be casted at a time for each player without a bug is refered as MPI - Muilty Player Instanceable. Each player can have only one spell running at a time. Those mostly use player number as index. Systems as Custom resources are made MPI.--------
-------- Spell of which only one can be casted at a time for each unit without a bug is refered as MUI - Multy Unit Instanceable. This allows each unit to be able to cast a spell without bugging other units spells. This is the minimum for your spell to be marked as accepted. Mostly done by hashtables or indexing systems.--------
-------- A spell which doesn't interfere with each instance of the spell. A unit can cast the spell multiple times and each cast wont interrupt other casts of teh same spell is refered as SUMI - Same Unit Multy Instanceable. Mostly spells without CD or stack.--------
-------- The current spell is SUMI. --------
Set Arrow_Counts = (Arrow_Counts + 1)
Set Arrow_CountMaxSize = 8191
-------- This refreshes the index if it reaches max. --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Arrow_Counts Greater than Arrow_CountMaxSize
Then - Actions
Set Arrow_Counts = 1
Else - Actions
-------- Sets cast related variables. --------
-------- First the casting unit. You want it to deal the damage --------
Set Arrow_Caster[Arrow_Counts] = (Casting unit)
-------- The position of the caster (The start location of the spell) --------
Set Arrow_CasterLoc = (Position of Arrow_Caster[Arrow_Counts])
-------- The target of the spell. --------
Set Arrow_TargetPoint = (Target point of ability being cast)
-------- The angle betwen the caster and the target. Because the spell has fixed distance and no specific end point the arrow would be moved towards angle. --------
Set Arrow_Angle = (Angle from Arrow_CasterLoc to Arrow_TargetPoint)
-------- Creates the dummy and sets its custom value. That wouldn't stack with unit indexer but it wouldn't be done that way if unit indexer is used. --------
Unit - Create 1 Elune Arrow for (Owner of Arrow_Caster[Arrow_Counts]) at Arrow_CasterLoc facing Arrow_Angle degrees
Unit - Set the custom value of (Last created unit) to Arrow_Counts
--------Adds the arrow to a unit group. Arrows would get "selected" in the loop using this unit group.--------
Unit Group - Add (Last created unit) to Arrow_StartGroup
-------- Sets distance related variables. --------
-------- Sets max distance an arrow can travel. --------
Set Arrow_Distance[Arrow_Counts] = 2300.00
-------- Sets its current traveled distnce to 0. That is because if the index gets refreshed it the traveled distance would be around 2300. Evades epick fails. --------
Set Arrow_DistanceTravel[Arrow_Counts] = 0.00
-------- Sets its stun duration to minimum. Same reason.--------
Set Arrow_StunDuration[Arrow_Counts] = 1
-------- Sets the stun increase traveled distance to 0. Same reason.--------
Unit Group - Pick every unit in Arrow_StartGroup and do (Actions)
Loop - Actions
-------- Sets arrows values. --------
Set Arrow_CusValue = (Custom value of (Picked unit))
Set Arrow_DummyLoc = (Position of (Picked unit))
Set Arrow_Movement = (Arrow_DummyLoc offset by 20.00 towards (Facing of (Picked unit)) degrees)
Unit - Move (Picked unit) instantly to Arrow_Movement
-------- Sets treaveled distance. --------
Set Arrow_DistanceTravel[Arrow_CusValue] = (Arrow_DistanceTravel[Arrow_CusValue] + 18.00)
Set Arrow_DistanceCount[Arrow_CusValue] = (Arrow_DistanceCount[Arrow_CusValue] + 18.00)
-------- Increases stun duration for traveled distance. --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Arrow_DistanceCount[Arrow_CusValue] Greater than or equal to 225.00
Then - Actions
Set Arrow_StunDuration[Arrow_CusValue] = (Arrow_StunDuration[Arrow_CusValue] + 1)
Set Arrow_DistanceCount[Arrow_CusValue] = 0.00
Else - Actions
-------- Sets a unit group. Checks if there are units around the arrow. Thats how ppl simulate collision or hits with this kind of spells. --------
Set Arrow_UnitGroup = (Units within 150.00 of Arrow_Movement matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of Arrow_Caster[Arrow_CusValue])) Equal to True))))
-------- Sets a unit to random unit from units around the arrow. That refers to hit unit by arrow. --------
Set Arrow_RandomUnit = (Random 1 units from Arrow_UnitGroup)
Unit Group - Pick every unit in Arrow_RandomUnit and do (Actions)
Loop - Actions
-------- Deals damage. --------
Unit - Cause Arrow_Caster[Arrow_CusValue] to damage (Picked unit), dealing (90.00 x (Real((Level of Channel for Arrow_Caster[Arrow_CusValue])))) damage of attack type Spells and damage type Normal
-------- Creates a dummy unit which will stun. --------
Unit - Create 1 Dummy for (Owner of Arrow_Caster[Arrow_CusValue]) at Arrow_Movement facing Default building facing degrees
-------- Adds stun ability and sets its level to apropriate value depending on Arrow_StunDuration. --------
Unit - Add Elune Arrow Stun to (Last created unit)
Unit - Set level of Elune Arrow Stun for (Last created unit) to Arrow_StunDuration[Arrow_CusValue]
-------- Orders the dummy to use the stun ability. --------
Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
-------- Adds expiration timer to the dummy. --------
Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
-------- Checks if the arrow has traveled max distance. --------
-------- or it has hit a unit. --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
Arrow_DistanceTravel[Arrow_CusValue] Greater than or equal to Arrow_Distance[Arrow_CusValue]
(Number of units in Arrow_UnitGroup) Greater than 0
Then - Actions
-------- Removes arrow dummy from the unit group and destroys it --------
-------- Thats because even if a unit is dead or removed from game it still exists in the unit group. --------
Unit - Kill (Picked unit)
Unit Group - Remove (Picked unit) from Arrow_StartGroup
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.