2008-08-28, 18:03:47
I use dummies which cast cluster rocket 2000 range from the target point where you aim, and also dummies is at a 3000 height. The angle you can decide yourself. The angle 0.40 is good. Also them the projectile comes from a great height and looks good, without any unnecessary lagg. Also you can apply stun and damage from the cluster based dummy spell as well... and any effect you want.
Since cluster rocket always uses 0.75 seconds to reach target point no matter range, it makes it predicable to apply the damage with 0.75 delay. I use a dummy using fan of knifes with casting delay of 0.75 sec since it's more reliable then using the wait 0.75 function.
You see, I also did add artillery flying sounds, so the opponents kinda get a warning about a incoming artillery bombardment.
This is how I did it with the artillery item.
I'm quite sure you can make it better than I did. I got 1 point leak cuz I can't remove the target point of random strikes to be calculated from.
I use up to 12 arrays, cuz in my map mod, I have a artillery AI, so the force can cast the spell.
Since cluster rocket always uses 0.75 seconds to reach target point no matter range, it makes it predicable to apply the damage with 0.75 delay. I use a dummy using fan of knifes with casting delay of 0.75 sec since it's more reliable then using the wait 0.75 function.
Code:
Artillery Strike (item)
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Artillery Strike
Actions
Set TempPoint2 = (Target point of ability being cast)
Set TempPoint1 = (TempPoint2 offset by 2000.00 towards ((Facing of (Triggering unit)) - 180.00) degrees)
Set Artillery_Point[(Player number of (Owner of (Triggering unit)))] = (Target point of ability being cast)
Set TempPoint3 = (TempPoint2 offset by (Random real number between 55.00 and 588.00) towards (Random angle) degrees)
Unit - Create 1 Dummy for (Owner of (Triggering unit)) at TempPoint1 facing 180.00 degrees
Unit - Add Crow Form to (Last created unit)
Animation - Change (Last created unit) flying height to 3500.00 at 0.00
Unit - Add a 11.00 second Generic expiration timer to (Last created unit)
Unit - Add Artillery Strike (Dummy Cast) to (Last created unit)
Unit - Order (Last created unit) to Neutral Tinker - Cluster Rockets TempPoint3
Set ArtilleryDelayLevel[(Player number of (Owner of (Triggering unit)))] = (ArtilleryDelayLevel[(Player number of (Owner of (Triggering unit)))] - 7)
Custom script: call RemoveLocation(udg_TempPoint3)
Custom script: call RemoveLocation(udg_TempPoint1)
Custom script: call RemoveLocation(udg_TempPoint2)
Sound - Play GlueScreenMeteorLaunch2 <gen>
Wait 1.20 seconds
Sound - Play GlueScreenMeteorLaunch3 <gen>
Wait 1.20 seconds
Sound - Play GlueScreenMeteorLaunch1 <gen>
Code:
Artillery Impact
Events
Unit - A unit Starts the effect of an ability
Conditions
Or - Any (Conditions) are true
Conditions
(Ability being cast) Equal to Artillery Strike (Dummy Cast)
(Ability being cast) Equal to Artillery Strike (Fast Cast)
Actions
Set TempPoint1 = (Target point of ability being cast)
Set TempPoint2 = (Position of (Triggering unit))
Unit - Create 1 Dummy for (Owner of (Triggering unit)) at TempPoint1 facing 180.00 degrees
Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
Unit - Add Artillery Strike (250) to (Last created unit)
Unit - Order (Last created unit) to Night Elf Warden - Fan Of Knives
Unit - Create 1 Dummy for (Owner of (Triggering unit)) at TempPoint1 facing 180.00 degrees
Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
Unit - Add Artillery Strike (450) to (Last created unit)
Unit - Order (Last created unit) to Night Elf Warden - Fan Of Knives
Unit - Create 1 Dummy for (Owner of (Triggering unit)) at TempPoint1 facing 180.00 degrees
Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
Unit - Add Artillery Strike (450 Struc) to (Last created unit)
Unit - Order (Last created unit) to Night Elf Warden - Fan Of Knives
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
ArtilleryDelayLevel[(Player number of (Owner of (Triggering unit)))] Less than 0
Then - Actions
Set ArtilleryDelayLevel[(Player number of (Owner of (Triggering unit)))] = (ArtilleryDelayLevel[(Player number of (Owner of (Triggering unit)))] + 1)
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint1)
Custom script: call RemoveLocation(udg_TempPoint2)
Skip remaining actions
Set TempPoint3 = (Artillery_Point[(Player number of (Owner of (Triggering unit)))] offset by (Random real number between 55.00 and 588.00) towards (Random angle) degrees)
Unit - Create 1 Dummy for (Owner of (Triggering unit)) at TempPoint2 facing (Angle from TempPoint2 to TempPoint1) degrees
Unit - Add Crow Form to (Last created unit)
Animation - Change (Last created unit) flying height to 3500.00 at 0.00
Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
Unit - Add Artillery Strike (Fast Cast) to (Last created unit)
Unit - Order (Last created unit) to Neutral Tinker - Cluster Rockets TempPoint3
Custom script: call RemoveLocation(udg_TempPoint3)
Custom script: call RemoveLocation(udg_TempPoint2)
Custom script: call RemoveLocation(udg_TempPoint1)
Code:
Artillery Effect
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Artillery Strike (250)
Actions
Set TempPoint1 = (Position of (Triggering unit))
Special Effect - Create a special effect at TempPoint1 using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
Special Effect - Destroy (Last created special effect)
Unit - Create 1 Dummy Bomb for (Owner of (Triggering unit)) at TempPoint1 facing Default building facing degrees
Animation - Change (Last created unit)'s size to (280.00%, 280.00%, 280.00%) of its original size
Animation - Change (Last created unit)'s animation speed to 39.00% of its original speed
Unit - Kill (Last created unit)
Custom script: call RemoveLocation(udg_TempPoint1)
This is how I did it with the artillery item.
I'm quite sure you can make it better than I did. I got 1 point leak cuz I can't remove the target point of random strikes to be calculated from.
I use up to 12 arrays, cuz in my map mod, I have a artillery AI, so the force can cast the spell.