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!
Calls down shooting stars from the sky which appear at a random place and moving in a circle down to the earth. When they impact on the ground they deal damage to enemy units and set them in flames.
-------- Here we create a unit which can use harvest to check later if we destroy a tree or a destructable like a bridge. Because we want only trees to get destroyed we use this harvester. --------
-------- This is the Damage over time which suffers a unit, after been hitted by a shooting star, every 0.03 seconds. --------
Set StSh_DoTDamageValue[StSh_TempInt] = ((Real(StSh_Level[StSh_TempInt])) x ((Real((Intelligence of StSh_caster[StSh_TempInt] (Include bonuses)))) x 0.01))
-------- If the damage is too low because your hero is lvl 1 for example it will automatically be 1. --------
-------- The time a unit burns after hit by a shooting star. This number stacks, which means if a unit burns still 0.4 and then gets hit it will burn 0.9 usw. --------
-------- Here we determine the damage which inflicts a star to the surrounding enemy units when he hits the ground. --------
Set StSh_DamageValue[StSh_TempInt] = ((Real(StSh_Level[StSh_TempInt])) x ((Real((Intelligence of StSh_caster[StSh_TempInt] (Include bonuses)))) x 0.50))
-------- This number is for the radius of the circle in which the stars fall. --------
Set StSh_StarCircleRadius[1] = 100.00
Set StSh_StarCircleRadius[2] = 300.00
-------- Each star gets a random number between the minimum and the maximum. To make it for all stars the same make the two variables identical. --------
-------- The speed with which the stars fall down increaes every 0.03 seconds for every star so to prevent them to fall in highspeed you can use this variable to limit their speed. --------
-------- We use a loop to check for all running instances and executing their actions. --------
For each (Integer StSh_loop_int) from 1 to StSh_IndexSize, do (Actions)
Loop - Actions
Set StSh_TempInt = StSh_Index[StSh_loop_int]
-------- If the conditions are true we continue. --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(StSh_caster[StSh_TempInt] is dead) Equal to False
StSh_caster[StSh_TempInt] Not equal to No unit
(Current order of StSh_caster[StSh_TempInt]) Equal to (Order(deathanddecay))
Then - Actions
-------- Chance to spawn a new star. --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Less than or equal to StSh_StarChance[StSh_TempInt]
Then - Actions
-------- Dynamic Index for the star. --------
Set StSh_STARIndexSize = (StSh_STARIndexSize + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StSh_STARIndexSize Greater than StSh_STARIndex_MAX
Then - Actions
Set StSh_STARIndex[StSh_STARIndexSize] = StSh_STARIndexSize
Set StSh_STARIndex_MAX = StSh_STARIndexSize
Else - Actions
Set StSh_STARIndex_temp = StSh_STARIndex[StSh_STARIndexSize]
-------- End Dynamic Indexes. --------
Set StSh_caster2[StSh_STARIndex_temp] = StSh_caster[StSh_TempInt]
Set StSh_DAMAGE[StSh_STARIndex_temp] = StSh_DamageValue[StSh_TempInt]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StSh_DoTBoolean Equal to True
Then - Actions
Set StSh_DoTDamage_Convert[StSh_STARIndex_temp] = StSh_DoTDamageValue[StSh_TempInt]
Else - Actions
Set StSh_StarHeight[StSh_STARIndex_temp] = 1000.00
Set StSh_HeightDecrease[StSh_STARIndex_temp] = 4.00
Set StSh_StarDegrees[StSh_STARIndex_temp] = (Random angle)
-------- Right or Left spin. --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 2) Equal to 1
Then - Actions
Set StSh_StarSpinDirection[StSh_STARIndex_temp] = True
-------- Right spin. --------
Else - Actions
Set StSh_StarSpinDirection[StSh_STARIndex_temp] = False
-------- Left spin. --------
Set StSh_CircleRadius[StSh_STARIndex_temp] = (Random real number between StSh_StarCircleRadius[1] and StSh_StarCircleRadius[2])
Set StSh_StarTargetLoc[StSh_STARIndex_temp] = (StSh_SpellTargetLoc[StSh_TempInt] offset by (Random real number between 0.00 and StSh_Area[StSh_TempInt]) towards (Random angle) degrees)
Set StSh_StarTargetTempLoc = (StSh_StarTargetLoc[StSh_STARIndex_temp] offset by StSh_CircleRadius[StSh_STARIndex_temp] towards StSh_StarDegrees[StSh_STARIndex_temp] degrees)
Unit - Create 1 StSh_dummy for (Owner of StSh_caster[StSh_TempInt]) at StSh_StarTargetLoc[StSh_STARIndex_temp] facing Default building facing (270.0) degrees
Set StSh_Star[StSh_STARIndex_temp] = (Last created unit)
Animation - Change StSh_Star[StSh_STARIndex_temp] flying height to StSh_StarHeight[StSh_STARIndex_temp] at 0.00
Special Effect - Create a special effect attached to the chest of StSh_Star[StSh_STARIndex_temp] using StSh_EffectVar[1]
Set StSh_StarEffect1[StSh_STARIndex_temp] = (Last created special effect)
Special Effect - Create a special effect attached to the chest of StSh_Star[StSh_STARIndex_temp] using StSh_EffectVar[2]
Set StSh_StarEffect2[StSh_STARIndex_temp] = (Last created special effect)
For each (Integer StSh_loop2_int) from 1 to StSh_STARIndexSize, do (Actions)
Loop - Actions
-------- Converting the StSh_STARIndex to StSh_STARIndex_temp to make it easier to understand and read. --------
Set StSh_STARIndex_temp = StSh_STARIndex[StSh_loop2_int]
-------- We check if the star is still in the air or hits the ground. --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StSh_StarHeight[StSh_STARIndex_temp] Greater than or equal to -5.00
Then - Actions
-------- This condition is used to increase the fall speed of the star but avoiding that it will be higher as the max Fall speed. --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StSh_HeightDecrease[StSh_STARIndex_temp] Less than StSh_MAX_fall_speed
Then - Actions
Set StSh_HeightDecrease[StSh_STARIndex_temp] = (StSh_HeightDecrease[StSh_STARIndex_temp] x 1.06)
-------- If the evaluaded result is bigger then the max fall speed it will automatically set to the max fall speed value. --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StSh_HeightDecrease[StSh_STARIndex_temp] Greater than StSh_MAX_fall_speed
Then - Actions
Set StSh_HeightDecrease[StSh_STARIndex_temp] = StSh_MAX_fall_speed
Else - Actions
Else - Actions
Set StSh_StarHeight[StSh_STARIndex_temp] = (StSh_StarHeight[StSh_STARIndex_temp] - StSh_HeightDecrease[StSh_STARIndex_temp])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StSh_StarSpinDirection[StSh_STARIndex_temp] Equal to True
Then - Actions
Set StSh_StarDegrees[StSh_STARIndex_temp] = (StSh_StarDegrees[StSh_STARIndex_temp] + StSh_StarSpinRate)
Else - Actions
Set StSh_StarDegrees[StSh_STARIndex_temp] = (StSh_StarDegrees[StSh_STARIndex_temp] - StSh_StarSpinRate)
Set StSh_StarTargetTempLoc = (StSh_StarTargetLoc[StSh_STARIndex_temp] offset by StSh_CircleRadius[StSh_STARIndex_temp] towards StSh_StarDegrees[StSh_STARIndex_temp] degrees)
Animation - Change StSh_Star[StSh_STARIndex_temp] flying height to StSh_StarHeight[StSh_STARIndex_temp] at 0.00
Unit - Move StSh_Star[StSh_STARIndex_temp] instantly to StSh_StarTargetTempLoc
-------- Order the tree checker to use harvest. If he is able to do it we know it has to be a tree. --------
Unit - Order StSh_Tree_checker to Harvest (Picked destructible)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Current order of StSh_Tree_checker) Equal to (Order(harvest))
Then - Actions
Destructible - Kill (Picked destructible)
Else - Actions
Unit - Order StSh_Tree_checker to Stop
Else - Actions
Set StSh_TempGrp = (Units within StSh_ImpactAoE of StSh_StarTargetTempLoc matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) belongs to an ally of (Owner of StSh_caster2[StSh_STARIndex_temp])) Equa
Unit Group - Pick every unit in StSh_TempGrp and do (Actions)
Loop - Actions
Unit - Cause StSh_caster2[StSh_STARIndex_temp] to damage (Picked unit), dealing StSh_DAMAGE[StSh_STARIndex_temp] damage of attack type Chaos and damage type Normal
-------- ---------------------------------DoT---------------------------------If the boolean DoT_boolean is true damaged units start to burn and suffering damage over time. --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StSh_DoTBoolean Equal to True
Then - Actions
-------- Cause to prevent that units get multiple arrays for example 6 we create this two variables to check if the unit is already burning. --------
Set StSh_DoTCheckInt = (StSh_DoTIndexSize + 2)
-------- Now we use a variable which represent the picked unit and add the integer to it. --------
Set StSh_DoTUnitCheck[StSh_DoTCheckInt] = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StSh_DoTIndexSize Equal to 0
Then - Actions
-------- Setting up the Dynamic Index for the DoT. --------
Set StSh_DoTIndexSize = (StSh_DoTIndexSize + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StSh_DoTIndexSize Greater than StSh_DoTIndex_MAX
Then - Actions
Set StSh_DoTIndex[StSh_DoTIndexSize] = StSh_DoTIndexSize
Set StSh_DoTIndex_MAX = StSh_DoTIndexSize
Else - Actions
-------- End of the Dynamic Index set up. --------
Set StSh_DoTIndex_temp = StSh_DoTIndex[StSh_DoTIndexSize]
Set StSh_DoTDuration[StSh_DoTIndex_temp] = StSh_DoT_Time
Set StSh_DoTUnit[StSh_DoTIndex_temp] = StSh_DoTUnitCheck[StSh_DoTCheckInt]
Set StSh_caster3[StSh_DoTIndex_temp] = StSh_caster2[StSh_STARIndex_temp]
Special Effect - Create a special effect attached to the chest of StSh_DoTUnit[StSh_DoTIndex_temp] using StSh_EffectVar[4]
Set StSh_DoTEffect[StSh_DoTIndex_temp] = (Last created special effect)
Set StSh_DoTDamage[StSh_DoTIndex_temp] = StSh_DoTDamage_Convert[StSh_STARIndex_temp]
Else - Actions
-------- Now we check if the picked unit is already burning or not. For these reason we loop through all existing burning units and check if our new unit belonging to them. --------
For each (Integer StSh_loop3_int) from 1 to StSh_DoTIndexSize, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StSh_DoTUnit[StSh_loop3_int] Equal to StSh_DoTUnitCheck[StSh_DoTCheckInt]
StSh_DoTCheck_Boolean Equal to False
Then - Actions
-------- We have found our unit so we set the boolean to true. --------
Set StSh_DoTCheck_Boolean = True
-------- The duration of the burn effect gets updated. --------
Set StSh_DoTDuration[StSh_loop3_int] = (StSh_DoTDuration[StSh_loop3_int] + StSh_DoT_Time)
-------- If the new damage source, caster, has a higher damage value, we replace the old with the new and make the new caster as the damage source. --------
Set StSh_DoTDamage[StSh_DoTCheckInt] = StSh_DoTDamage_Convert[StSh_STARIndex_temp]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StSh_DoTDamage[StSh_DoTCheckInt] Greater than StSh_DoTDamage[StSh_loop3_int]
Then - Actions
-------- The damage is higher so the old value gets replaced. --------
Set StSh_DoTDamage[StSh_loop3_int] = StSh_DoTDamage[StSh_DoTCheckInt]
-------- Same for the caster. --------
Set StSh_caster3[StSh_loop3_int] = StSh_caster2[StSh_STARIndex_temp]
Else - Actions
Else - Actions
-------- If we already have found our unit this is no longer needed and will cause bugs without the condition. --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StSh_DoTCheck_Boolean Equal to True
Then - Actions
Else - Actions
-------- We still haven´t found our unit in the burning ones so we leave the boolean at false to add later a new integer to it. --------
Set StSh_DoTCheck_Boolean = False
-------- If our unit was below the burning ones this will take no action but if it wasn´t and the boolean says false the unit will added as a new one to the burning ones. --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StSh_DoTCheck_Boolean Equal to False
Then - Actions
-------- Dynamic Index for the DoT. --------
Set StSh_DoTIndexSize = (StSh_DoTIndexSize + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StSh_DoTIndexSize Greater than StSh_DoTIndex_MAX
Then - Actions
Set StSh_DoTIndex[StSh_DoTIndexSize] = StSh_DoTIndexSize
Set StSh_DoTIndex_MAX = StSh_DoTIndexSize
Else - Actions
Set StSh_DoTIndex_temp = StSh_DoTIndex[StSh_DoTIndexSize]
-------- End Dynamic Index. --------
Set StSh_DoTDuration[StSh_DoTIndex_temp] = StSh_DoT_Time
Set StSh_DoTUnit[StSh_DoTIndex_temp] = StSh_DoTUnitCheck[StSh_DoTCheckInt]
Set StSh_caster3[StSh_DoTIndex_temp] = StSh_caster2[StSh_STARIndex_temp]
Special Effect - Create a special effect attached to the chest of StSh_DoTUnit[StSh_DoTIndex_temp] using StSh_EffectVar[4]
Set StSh_DoTEffect[StSh_DoTIndex_temp] = (Last created special effect)
Set StSh_DoTDamage[StSh_DoTIndex_temp] = StSh_DoTDamage_Convert[StSh_STARIndex_temp]
Else - Actions
Set StSh_DoTUnitCheck[StSh_DoTCheckInt] = No unit
Set StSh_DoTCheckInt = 0
-------- This is necessary because for the next unit the value has to start with false. --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StSh_DoTBoolean Equal to True
Then - Actions
For each (Integer StSh_loop4_int) from 1 to StSh_DoTIndexSize, do (Actions)
Loop - Actions
Set StSh_DoTIndex_temp = StSh_DoTIndex[StSh_loop4_int]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StSh_DoTDuration[StSh_DoTIndex_temp] Greater than or equal to 0.00
(StSh_DoTUnit[StSh_DoTIndex_temp] is alive) Equal to True
Then - Actions
Set StSh_DoTDuration[StSh_DoTIndex_temp] = (StSh_DoTDuration[StSh_DoTIndex_temp] - 0.03)
Unit - Cause StSh_caster3[StSh_DoTIndex_temp] to damage StSh_DoTUnit[StSh_DoTIndex_temp], dealing StSh_DoTDamage[StSh_DoTIndex_temp] damage of attack type Chaos and damage type Normal
Else - Actions
Special Effect - Destroy StSh_DoTEffect[StSh_DoTIndex_temp]
-------- Recycle Index. --------
Set StSh_DoTIndex[StSh_loop4_int] = StSh_DoTIndex[StSh_DoTIndexSize]
Set StSh_DoTIndex[StSh_DoTIndexSize] = StSh_DoTIndex_temp
Set StSh_DoTIndexSize = (StSh_DoTIndexSize - 1)
Set StSh_loop4_int = (StSh_loop4_int - 1)
Else - Actions
-------- Turn the trigger again off if the index_size is below 0... --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-------- With this condition we check if the caster is still channeling, in this case he has the order deathanddecay, if he had stopped or died the instance will be ended. --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(StSh_caster[StSh_TempInt] is dead) Equal to False
StSh_caster[StSh_TempInt] Not equal to No unit
(Current order of StSh_caster[StSh_TempInt]) Equal to (Order(deathanddecay))
-------- To prevent that a mass of stars will fall from the sky we use a condition so that ,for example, only every fifth loop creates a star. --------
-------- Here we convert the StSh_caster from the beginning of the spell to StSh_caster2 because in the Star loop we can not refer to the first set up of indexes. --------
Set StSh_caster2[StSh_STARIndex_temp] = StSh_caster[StSh_TempInt]
-------- The point where the star will spin around. --------
Set StSh_StarTargetLoc[StSh_STARIndex_temp] = (StSh_SpellTargetLoc[StSh_TempInt] offset by (Random real number between 0.00 and StSh_Area[StSh_TempInt]) towards (Random angle) degrees)
Set StSh_StarTargetTempLoc = (StSh_StarTargetLoc[StSh_STARIndex_temp] offset by StSh_CircleRadius[StSh_STARIndex_temp] towards StSh_StarDegrees[StSh_STARIndex_temp] degrees)
Unit - Create 1 StSh_dummy for (Owner of StSh_caster[StSh_TempInt]) at StSh_StarTargetLoc[StSh_STARIndex_temp] facing Default building facing (270.0) degrees
Set StSh_Star[StSh_STARIndex_temp] = (Last created unit)
-------- Creating the new location of the falling star. --------
Set StSh_StarTargetTempLoc = (StSh_StarTargetLoc[StSh_STARIndex_temp] offset by StSh_CircleRadius[StSh_STARIndex_temp] towards StSh_StarDegrees[StSh_STARIndex_temp] degrees)
-------- Checking for targets around the impact place. --------
Set StSh_TempGrp = (Units within StSh_ImpactAoE of StSh_StarTargetTempLoc matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) belongs to an ally of (Owner of StSh_caster2[StSh_STARIndex_temp])) Equa
-------- Cause the caster to damage them. --------
Unit - Cause StSh_caster2[StSh_STARIndex_temp] to damage (Picked unit), dealing StSh_DAMAGE[StSh_STARIndex_temp] damage of attack type Chaos and damage type Normal
-------- Cause to prevent that units get only one array and not for example 6 we create this two variables to check if the unit is already burning. --------
-------- Now we check if the picked unit is already burning or not. For these reason we loop through all existing burning units and check if our new unit belonging to them. --------
-------- If the new damage source, caster, has a higher damage value, we replace the old with the new and make the new caster as the damage source. --------
-------- If our unit was below the burning ones this will take no action but if it wasn´t and the boolean says false the unit will added as a new one to the burning ones. --------
-------- The caster damages the burning ones. --------
Unit - Cause StSh_caster3[StSh_DoTIndex_temp] to damage StSh_DoTUnit[StSh_DoTIndex_temp], dealing StSh_DoTDamage[StSh_DoTIndex_temp] damage of attack type Chaos and damage type Normal
15:22, 19th Nov 2009
The_Reborn_Devil:
It looks pretty nice and there are no leaks.
The triggering looks good too.
Status: Approved
Rating: Recommended
@kola:
Yes it is so long because i didn´t seperate the loops into different trigger but leave it at one trigger. I thought it would be easier to copy just two trigger instead of three. And yes the documentation does the rest
Thank you vercas for pointing that out, i wasn´t 100% sure if I got all the leaks.
Should I use less comments next time? I thought they would make it easier for the reader to understand what´s going on in the spell.
Add documentation triggers or trigger description. Stuffing your triggers with commends make them look huge.
But I am very impressed for a GUI spell.
I give you a suggestion for the documentation trigger.
Make a new trigger and convert it to custom text.
Disable it and write in it everything you need.
To "quote" GUI lines, right click them and select Copy As Text and paste them wherever you need.
(I know you know how to copy GUI lines, already, but I am pointing it out for other users to read, that if they don't know already.)
I decided to copy the trigger, one with documentation and the other one without, because I, for myself as a GUI user, would find it more helpful if i see the GUI trigger with comments instead of a text. So if you just want the trigger you can use the barely commented one and for learning the other one.
But your idea would be good aswell, I just did it this way, because I think it would be easier to understand every aspect of the spell because of its length.
Nice work...
Although I can't seem to be able to import it into my map? :S
I imported and exported the model...
I copied and pasted both the spell and the dummy...
I copied and pasted the triggers at the end...
All I got up was a spell that created special effects on the ground...
There was no falling stars... Maybe it's the model? I'm not sure... Please reply ^^
I really need this awesome spell in my map :/
and don't worry... I'll give you full credit...
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.