-
Are you planning to upload your awesome spell or system to Hive? Please review the rules here.Dismiss Notice
-
Dismiss Notice
Vote on the best bounty the oceans have to offer! The poll for the 34th Modeling Contest has begun.
-
Dismiss Notice
Awaken what lies in the heart of your swarm. The 17th Techtree Contest has arrived!
-
Dismiss Notice
Check out the Staff Job Openings thread.
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.
Seeking Cluster Rockets v1.0
Submitted by
Ofel
- Tags:
- Target Object, GUI / Triggers
- Filesize:
- 39.09 KB
- Rating:
-
(4 votes)
- Downloads:
- 152
- Uploaded:
- Sep 8, 2013
- Updated:
- Dec 12, 2015
- Resources:
- 1
- Author(s):
- Ofel
- State:
- Substandard

This bundle is marked as substandard. It may contain bugs, not perform optimally or otherwise be in violation of the submission rules.
A spell inspired from Blizzard standard spell, Cluster Rockets
- Description
Shots a bunch of seeking cluster rockets towards targeted unit for a few seconds. Each rockets cause small damage to nearby enemy ground units in 150 AoE from an explosion that happen if the rocket hit a unit or tree. - Levels
Level 1 - Shots for 3 seconds, 30 damage.
Level 2 - Shots for 4 seconds, 40 damage.
Level 3 - Shots for 5 seconds, 50 damage. - Code
GUIInit-
Seeking Cluster Rockets Init
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
-------- --------------------------- --------
-
-------- Configuration --------
-
-------- --------------------------- --------
-
-------- Determines the ability --------
-
Set SCR_Ability = Seeking Cluster Rockets
-
-------- Determines the base order id of the ability --------
-
Set SCR_OrderId = (Order(banish))
-
-------- Determines the dummy unit-type --------
-
Set SCR_DummyType = Seeking Cluster Rockets Dummy
-
-------- Determines the model of the rocket --------
-
Set SCR_RocketModel = Abilities\Weapons\CannonTowerMissile\CannonTowerMissile.mdl
-
-------- Determines the rocket scale --------
-
Set SCR_RocketScale = 1.00
-
-------- Determines the rocket height --------
-
Set SCR_RocketHeight = 50.00
-
-------- Determines the rocket collision --------
-
Set SCR_RocketCollision = 50.00
-
-------- Determines the rocket facing rate --------
-
Set SCR_RocketFacingTime = 0.00
-
-------- Determines the rocket spawn offset from the caster position --------
-
Set SCR_RocketSpawnOffset = 50.00
-
-------- Determines the rocket move speed --------
-
Set SCR_RocketSpeed[1] = 30.00
-
Set SCR_RocketSpeed[2] = 30.00
-
Set SCR_RocketSpeed[3] = 30.00
-
-------- Determines the rocket expiration time. This is used to remove stucked rockets --------
-
Set SCR_RocketDebugTime = 8.00
-
-------- Determines the shot angle width --------
-
Set SCR_ShotAngleWidth = 200.00
-
-------- Determines the shot interval --------
-
Set SCR_ShotInterval[1] = 0.10
-
Set SCR_ShotInterval[2] = 0.10
-
Set SCR_ShotInterval[3] = 0.10
-
-------- Determines the minimum distance between the rocket and target to explode --------
-
Set SCR_MinDistance = 100.00
-
-------- Determines the explosion model --------
-
Set SCR_ExplosionModel = Abilities\Weapons\SteamTank\SteamTankImpact.mdl
-
-------- Determines the explosion AoE --------
-
Set SCR_ExplosionAoE[1] = 150.00
-
Set SCR_ExplosionAoE[2] = 150.00
-
Set SCR_ExplosionAoE[3] = 150.00
-
-------- Determines the explosion damage --------
-
Set SCR_ExplosionDamage[1] = 30.00
-
Set SCR_ExplosionDamage[2] = 40.00
-
Set SCR_ExplosionDamage[3] = 50.00
-
-------- Determines the explosion attack-type --------
-
Set SCR_AttackType = Siege
-
-------- Determines the explosion damage-type --------
-
Set SCR_DamageType = Fire
-
-------- If "True", nearby trees will be destroyed --------
-
Set SCR_DestroyTree = True
-
-------- --------------------------- --------
-
-------- End of Configuration --------
-
-------- =========================================================================== --------
-
-------- --------------------------- --------
-
-------- Note: This spell will start working if this trigger has been executed --------
-
-------- --------------------------- --------
-
-------- This is a configurable variable too, but this one isn't recommended to be changed --------
-
-------- This is the interval of the spell, default is 0.03. Don't change this to lower value, else the game will be laggy --------
-
Set SCR_Interval = 0.03
-
-------- All actions below isn't configurable. Please don't change anything below this line --------
-
-------- I don't have ability to explain it all, sorry :D --------
-
-------- --------------------------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Seeking Cluster Rockets Loop <gen> is on) Equal to True
-
-
Then - Actions
-
Trigger - Turn off Seeking Cluster Rockets Loop <gen>
-
-
Else - Actions
-
-
Trigger - Add to Seeking Cluster Rockets Loop <gen> the event (Time - Every SCR_Interval seconds of game time)
-
Trigger - Add to Seeking Cluster Rockets Cast <gen> the event (Unit - A unit Starts the effect of an ability)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SCR_DestroyTree Equal to True
-
-
Then - Actions
-
Custom script: set udg_SCR_HarvestOrder = String2OrderIdBJ("harvest")
-
Custom script: set udg_SCR_Harvester = CreateUnit(Player(15), 'hpea', 0, 0, 0)
-
Custom script: call UnitAddAbility(udg_SCR_Harvester, 'Aloc')
-
Unit - Hide SCR_Harvester
-
-
Else - Actions
-
-
Set SCR_ShotAngleWidth = (SCR_ShotAngleWidth / 2.00)
-
Set SCR_MinDistance = (SCR_MinDistance x SCR_MinDistance)
-
-
Cast-
Seeking Cluster Rockets Cast
-
Events
-
Conditions
-
(Ability being cast) Equal to SCR_Ability
-
-
Actions
-
Set SCR_Caster[0] = (Triggering unit)
-
For each (Integer SCR_Index) from 1 to SCR_MaxIndex, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SCR_Caster[SCR_Index] Equal to SCR_Caster[0]
-
SCR_Stage[SCR_Index] Equal to 2
-
-
Then - Actions
-
Set SCR_Stage[SCR_Index] = 3
-
-
Else - Actions
-
-
-
-
Set SCR_MaxIndex = (SCR_MaxIndex + 1)
-
Set SCR_Caster[SCR_MaxIndex] = SCR_Caster[0]
-
Set SCR_Owner[SCR_MaxIndex] = (Triggering player)
-
Set SCR_Target[SCR_MaxIndex] = (Target unit of ability being cast)
-
Set SCR_Level[SCR_MaxIndex] = (Level of SCR_Ability for SCR_Caster[SCR_MaxIndex])
-
Custom script: set udg_SCR_CasterX[udg_SCR_MaxIndex] = GetUnitX(udg_SCR_Caster[udg_SCR_MaxIndex])
-
Custom script: set udg_SCR_CasterY[udg_SCR_MaxIndex] = GetUnitY(udg_SCR_Caster[udg_SCR_MaxIndex])
-
Set SCR_Real[SCR_MaxIndex] = 0.00
-
Set SCR_Stage[SCR_MaxIndex] = 2
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SCR_MaxIndex Equal to 1
-
-
Then - Actions
-
Trigger - Turn on Seeking Cluster Rockets Loop <gen>
-
-
Else - Actions
-
-
-
Loop-
Seeking Cluster Rockets Loop
-
Events
-
Conditions
-
Actions
-
For each (Integer SCR_Index) from 1 to SCR_MaxIndex, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SCR_Stage[SCR_Index] Equal to 1
-
-
Then - Actions
-
Custom script: set udg_SCR_X[1] = GetUnitX(udg_SCR_Dummy[udg_SCR_Index])
-
Custom script: set udg_SCR_Y[1] = GetUnitY(udg_SCR_Dummy[udg_SCR_Index])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(SCR_Target[SCR_Index] is dead) Equal to False
-
SCR_Skip[SCR_Index] Equal to False
-
-
Then - Actions
-
Custom script: set udg_SCR_X[2] = GetUnitX(udg_SCR_Target[udg_SCR_Index]) - udg_SCR_X[1]
-
Custom script: set udg_SCR_Y[2] = GetUnitY(udg_SCR_Target[udg_SCR_Index]) - udg_SCR_Y[1]
-
Custom script: set udg_SCR_Real[0] = udg_SCR_X[2] * udg_SCR_X[2] + udg_SCR_Y[2] * udg_SCR_Y[2]
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SCR_Real[0] Greater than SCR_MinDistance
-
-
Then - Actions
-
Unit - Make SCR_Dummy[SCR_Index] face SCR_Target[SCR_Index] over SCR_RocketFacingTime seconds
-
Custom script: set udg_SCR_Real2[0] = GetUnitFacing(udg_SCR_Dummy[udg_SCR_Index]) * bj_DEGTORAD
-
Custom script: set udg_SCR_X[1] = udg_SCR_X[1] + udg_SCR_RocketSpeed[udg_SCR_Level[udg_SCR_Index]] * Cos(udg_SCR_Real2[0])
-
Custom script: set udg_SCR_Y[1] = udg_SCR_Y[1] + udg_SCR_RocketSpeed[udg_SCR_Level[udg_SCR_Index]] * Sin(udg_SCR_Real2[0])
-
Custom script: call SetUnitX(udg_SCR_Dummy[udg_SCR_Index], udg_SCR_X[1])
-
Custom script: call SetUnitY(udg_SCR_Dummy[udg_SCR_Index], udg_SCR_Y[1])
-
Set SCR_TempLoc = (Point(SCR_X[1], SCR_Y[1]))
-
Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within SCR_RocketCollision of SCR_TempLoc) and do (Actions)
-
Loop - Actions
-
Set SCR_TempUnit = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(SCR_TempUnit is dead) Equal to False
-
(SCR_TempUnit is A flying unit) Equal to False
-
(SCR_TempUnit is Magic Immune) Equal to False
-
(SCR_TempUnit belongs to an ally of SCR_Owner[SCR_Index]) Equal to False
-
-
Then - Actions
-
Set SCR_Skip[SCR_Index] = True
-
-
Else - Actions
-
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SCR_DestroyTree Equal to True
-
-
Then - Actions
-
Destructible - Pick every destructible within SCR_RocketCollision of SCR_TempLoc and do (Actions)
-
Loop - Actions
-
Set SCR_TempDest = (Picked destructible)
-
Custom script: call IssueTargetOrderById(udg_SCR_Harvester, udg_SCR_HarvestOrder, udg_SCR_TempDest)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Current order of SCR_Harvester) Equal to SCR_HarvestOrder
-
(SCR_TempDest is dead) Equal to False
-
-
Then - Actions
-
Set SCR_Skip[SCR_Index] = True
-
-
Else - Actions
-
-
-
-
Unit - Order SCR_Harvester to Stop
-
-
Else - Actions
-
-
Custom script: call RemoveLocation(udg_SCR_TempLoc)
-
Set SCR_Real[SCR_Index] = (SCR_Real[SCR_Index] + SCR_Interval)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SCR_Real[SCR_Index] Greater than or equal to SCR_RocketDebugTime
-
-
Then - Actions
-
Set SCR_Skip[SCR_Index] = True
-
-
Else - Actions
-
-
-
Else - Actions
-
Set SCR_Skip[SCR_Index] = True
-
-
-
-
Else - Actions
-
Custom script: call DestroyEffect(AddSpecialEffect(udg_SCR_ExplosionModel, udg_SCR_X[1], udg_SCR_Y[1]))
-
Set SCR_TempLoc = (Point(SCR_X[1], SCR_Y[1]))
-
Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within SCR_ExplosionAoE[SCR_Level[SCR_Index]] of SCR_TempLoc) and do (Actions)
-
Loop - Actions
-
Set SCR_TempUnit = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(SCR_TempUnit is dead) Equal to False
-
(SCR_TempUnit is A flying unit) Equal to False
-
(SCR_TempUnit is Magic Immune) Equal to False
-
(SCR_TempUnit belongs to an ally of SCR_Owner[SCR_Index]) Equal to False
-
-
Then - Actions
-
Unit - Cause SCR_Caster[SCR_Index] to damage SCR_TempUnit, dealing SCR_ExplosionDamage[SCR_Level[SCR_Index]] damage of attack type SCR_AttackType and damage type SCR_DamageType
-
-
Else - Actions
-
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SCR_DestroyTree Equal to True
-
-
Then - Actions
-
Destructible - Pick every destructible within SCR_ExplosionAoE[SCR_Level[SCR_Index]] of SCR_TempLoc and do (Actions)
-
Loop - Actions
-
Set SCR_TempDest = (Picked destructible)
-
Custom script: call IssueTargetOrderById(udg_SCR_Harvester, udg_SCR_HarvestOrder, udg_SCR_TempDest)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Current order of SCR_Harvester) Equal to SCR_HarvestOrder
-
-
Then - Actions
-
Destructible - Kill SCR_TempDest
-
-
Else - Actions
-
-
-
-
Unit - Order SCR_Harvester to Stop
-
-
Else - Actions
-
-
Custom script: call RemoveLocation(udg_SCR_TempLoc)
-
Special Effect - Destroy SCR_Model[SCR_Index]
-
Unit - Kill SCR_Dummy[SCR_Index]
-
Set SCR_Stage[SCR_Index] = 3
-
-
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SCR_Stage[SCR_Index] Equal to 2
-
-
Then - Actions
-
Custom script: set udg_SCR_X[1] = GetUnitX(udg_SCR_Caster[udg_SCR_Index])
-
Custom script: set udg_SCR_Y[1] = GetUnitY(udg_SCR_Caster[udg_SCR_Index])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Current order of SCR_Caster[SCR_Index]) Equal to SCR_OrderId
-
SCR_X[1] Equal to SCR_CasterX[SCR_Index]
-
SCR_Y[1] Equal to SCR_CasterY[SCR_Index]
-
(SCR_Target[SCR_Index] is dead) Equal to False
-
-
Then - Actions
-
Unit - Make SCR_Caster[SCR_Index] face SCR_Target[SCR_Index] over 0.00 seconds
-
Set SCR_Real[SCR_Index] = (SCR_Real[SCR_Index] + SCR_Interval)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SCR_Real[SCR_Index] Greater than or equal to SCR_ShotInterval[SCR_Level[SCR_Index]]
-
-
Then - Actions
-
Set SCR_Real[SCR_Index] = 0.00
-
Set SCR_Real[0] = (Facing of SCR_Caster[SCR_Index])
-
Custom script: set udg_SCR_Real2[0] = udg_SCR_Real[0] * bj_DEGTORAD
-
Custom script: set udg_SCR_X[2] = udg_SCR_X[1] + udg_SCR_RocketSpawnOffset * Cos(udg_SCR_Real2[0])
-
Custom script: set udg_SCR_Y[2] = udg_SCR_Y[1] + udg_SCR_RocketSpawnOffset * Sin(udg_SCR_Real2[0])
-
Set SCR_ShotInterval[4] = (SCR_Real[0] - SCR_ShotAngleWidth)
-
Set SCR_ShotInterval[5] = (SCR_Real[0] + SCR_ShotAngleWidth)
-
Set SCR_MaxIndex = (SCR_MaxIndex + 1)
-
Custom script: set udg_SCR_Dummy[udg_SCR_MaxIndex] = CreateUnit(udg_SCR_Owner[udg_SCR_Index], udg_SCR_DummyType, udg_SCR_X[2], udg_SCR_Y[2], GetRandomReal(udg_SCR_ShotInterval[4], udg_SCR_ShotInterval[5]))
-
Custom script: if (UnitAddAbility(udg_SCR_Dummy[udg_SCR_MaxIndex], 'Amrf') and UnitRemoveAbility(udg_SCR_Dummy[udg_SCR_MaxIndex], 'Amrf')) then
-
Custom script: endif
-
Special Effect - Create a special effect attached to the origin of SCR_Dummy[SCR_MaxIndex] using SCR_RocketModel
-
Set SCR_Model[SCR_MaxIndex] = (Last created special effect)
-
Custom script: call SetUnitScale(udg_SCR_Dummy[udg_SCR_MaxIndex], udg_SCR_RocketScale, 0, 0)
-
Animation - Change SCR_Dummy[SCR_MaxIndex] flying height to SCR_RocketHeight at 0.00
-
Set SCR_Caster[SCR_MaxIndex] = SCR_Caster[SCR_Index]
-
Set SCR_Owner[SCR_MaxIndex] = SCR_Owner[SCR_Index]
-
Set SCR_Target[SCR_MaxIndex] = SCR_Target[SCR_Index]
-
Set SCR_Level[SCR_MaxIndex] = SCR_Level[SCR_Index]
-
Set SCR_Skip[SCR_MaxIndex] = False
-
Set SCR_Real[SCR_MaxIndex] = 0.00
-
Set SCR_Stage[SCR_MaxIndex] = 1
-
-
Else - Actions
-
-
-
Else - Actions
-
Unit - Order SCR_Caster[SCR_Index] to Stop
-
Set SCR_Stage[SCR_Index] = 3
-
-
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SCR_Stage[SCR_Index] Equal to 3
-
-
Then - Actions
-
Set SCR_Caster[SCR_Index] = SCR_Caster[SCR_MaxIndex]
-
Set SCR_CasterX[SCR_Index] = SCR_CasterX[SCR_MaxIndex]
-
Set SCR_CasterY[SCR_Index] = SCR_CasterY[SCR_MaxIndex]
-
Set SCR_Dummy[SCR_Index] = SCR_Dummy[SCR_MaxIndex]
-
Set SCR_Level[SCR_Index] = SCR_Level[SCR_MaxIndex]
-
Set SCR_Model[SCR_Index] = SCR_Model[SCR_MaxIndex]
-
Set SCR_Owner[SCR_Index] = SCR_Owner[SCR_MaxIndex]
-
Set SCR_Real[SCR_Index] = SCR_Real[SCR_MaxIndex]
-
Set SCR_Real2[SCR_Index] = SCR_Real2[SCR_MaxIndex]
-
Set SCR_Skip[SCR_Index] = SCR_Skip[SCR_MaxIndex]
-
Set SCR_Stage[SCR_Index] = SCR_Stage[SCR_MaxIndex]
-
Set SCR_Target[SCR_Index] = SCR_Target[SCR_MaxIndex]
-
Set SCR_Index = (SCR_Index - 1)
-
Set SCR_MaxIndex = (SCR_MaxIndex - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SCR_MaxIndex Equal to 0
-
-
Then - Actions
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
-
Else - Actions
-
-
-
-
-
-
-
-
-
-
- Credits
- Vexorian for dummy.mdl
Keywords:
Rockets, Cluster, Explosion, AoE, MUI, GUI
Contents
Page 1 of 2