vypur85
Hibernate
- Reaction score
- 804
Not sure something similarly to this has been done before or not. If yes please just send this to the grave
. It's a simple ability. Did it because I was bored at work.
Description:
The Rock Golem hurls massive boulders from the ground into the air, dealing 40/80/120/160 damage to nearby enemy units. As the rocks begin to fall, they are split into random number of smaller rock chunks that deal 20/40/60/80 damage each on impact. Lasts for 5 seconds.
It is MPI
Leak-free
Easy to import
Can be quite laggy if too many cast per instance (quite many dummies created)
Implementation:
Triggers:
The spell basically plays around with 'A Unit is Dead' event. I hope it is understandable
. There are a lot of variables. Just change those in the 'Map Init for Earth Shock' trigger. Try not to change the others as there are some mathematical calculations involved (for the fly rate and land rate).
Do comment. Hope you like this simple spell
.
Please give me some time for s/shots (Done).
Update:
The spell is updated.
Added this and that to ease implementation even more.
Note:
Setting this number to a high value (eg. 20 or 30) makes the spell looks like a firework display >.<. Lol... But it lags... So, give yourself a limit, please....
The Screen Shot enlarged:
Description:
The Rock Golem hurls massive boulders from the ground into the air, dealing 40/80/120/160 damage to nearby enemy units. As the rocks begin to fall, they are split into random number of smaller rock chunks that deal 20/40/60/80 damage each on impact. Lasts for 5 seconds.
It is MPI
Leak-free
Easy to import
Can be quite laggy if too many cast per instance (quite many dummies created)
Implementation:
Code:
1. Copy and paste the Dummy and Earth Shock ability to your map.
2. Then copy and paste the triggers. Make sure variables are automatically created when copied. This can be set in Preference.
3. Change the damage and AOE values as you wish. That's all.
4. I've created variables for almost everything in 'Map Init for Earth Shock'. Just change the properties of the ability in there will do. Even for the dummy and ability. This is to ease importing task.
Spell by vypur85 (no need credits, just use as you wish)
Triggers:
This is for the setup of the ability. Adjust these to make it suit your map. Also preloads abilities and dummies to reduce lag.
Code:
Map Init for Earth Shock
Events
Map initialization
Conditions
Actions
Set Abi_EarthShock = Earth Shock
Set UnitType_EShock_Dummy = Dummy
-------- ============================================================= --------
-------- ============================================================= --------
-------- ============================================================= --------
-------- General --------
Set Real_ESchock_SpellAoe = 500.00
Set Real_ESchock_SpellDuration = 5.00
-------- Large Rock Properties (The damage increases by one time per level) --------
Set Int_EShock_MaxLargeRocks = 30
Set Real_EShock_BigRock_AoeDmg = 180.00
Set Real_EShock_EmergeDmg = 40.00
-------- Small Rock Properties --------
Set Int_EShock_MinSmallRocks = 3
Set Int_EShock_MaxSmallRocks = 8
Set Real_EShock_SmallRock_AoeDmg = 180.00
Set Real_ESchock_Damage = 20.00
Set Real_ESchock_IncreasePerLevel = 20.00
-------- Flying Properties --------
Set Real_ESchock_MaxHeight = 800.00
Set Real_ESchock_MinHeight = 400.00
-------- ============================================================= --------
-------- ============================================================= --------
-------- ============================================================= --------
-------- Preloading --------
Set Pt_EShock_DummyPos = (Center of (Playable map area))
Unit - Create 1 UnitType_EShock_Dummy for Neutral Passive at Pt_EShock_DummyPos facing Default building facing degrees
Unit - Add Storm Crow Form to (Last created unit)
Unit - Add Abi_EarthShock to (Last created unit)
Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
Unit - Remove (Last created unit) from the game
Custom script: call RemoveLocation (udg_Pt_EShock_DummyPos)
This creates initial dummies which will die and leads to the spawning of large rocks.
Code:
Earth Shock
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Abi_EarthShock
Actions
Set Unit_TriggeringUnit[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
Set Pt_EShock_TriggerUnitPos = (Position of (Triggering unit))
For each (Integer A) from 1 to Int_EShock_MaxLargeRocks, do (Actions)
Loop - Actions
Set Pt_EShock_DummyPos = (Pt_EShock_TriggerUnitPos offset by (Random real number between 0.00 and Real_ESchock_SpellAoe) towards (Random angle) degrees)
Unit - Create 1 UnitType_EShock_Dummy for (Owner of (Triggering unit)) at Pt_EShock_DummyPos facing Default building facing degrees
-------- This is to make sure that the spell will create AT LEAST 2 dummies at the beginning of the channel and at the end --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Integer A) Greater than or equal to 3
(Integer A) Less than or equal to (Int_EShock_MaxLargeRocks - 2)
Then - Actions
Unit - Add a (Random real number between 0.10 and (Real_ESchock_SpellDuration - 0.20)) second Generic expiration timer to (Last created unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Integer A) Greater than (Int_EShock_MaxLargeRocks - 2)
Then - Actions
Unit - Add a (Real_ESchock_SpellDuration - 0.10) second Generic expiration timer to (Last created unit)
Else - Actions
Unit - Add a 0.01 second Generic expiration timer to (Last created unit)
Unit - Make (Last created unit) Invulnerable
Unit - Add Abi_EarthShock to (Last created unit)
Unit - Set level of Abi_EarthShock for (Last created unit) to (Level of Abi_EarthShock for (Triggering unit))
Unit - Set the custom value of (Last created unit) to 1
Unit - Hide (Last created unit)
Custom script: call RemoveLocation (udg_Pt_EShock_DummyPos)
Custom script: call RemoveLocation (udg_Pt_EShock_TriggerUnitPos)
This is the main trigger of this ability. It detects the death of dummies thus spawning other dummies accordingly.
Code:
Dummy Dies
Events
Unit - A unit Dies
Conditions
(Unit-type of (Triggering unit)) Equal to UnitType_EShock_Dummy
Actions
-------- This creates the big rocks if the hidden dummies die --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Custom value of (Triggering unit)) Equal to 1
Then - Actions
Set Pt_EShock_DeadDummyPos = (Position of (Triggering unit))
Special Effect - Create a special effect at Pt_EShock_DeadDummyPos using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
Special Effect - Destroy (Last created special effect)
Set Real_EShock_RandomTimedLife = (Random real number between 0.50 and 1.00)
Set Real_ESchock_RandomFlyHeight = (Random real number between Real_ESchock_MinHeight and Real_ESchock_MaxHeight)
Unit - Create 1 UnitType_EShock_Dummy for (Owner of (Triggering unit)) at Pt_EShock_DeadDummyPos facing Default building facing degrees
Animation - Change (Last created unit)'s size to (200.00%, 200.00%, 200.00%) of its original size
Unit - Add a Real_EShock_RandomTimedLife second Generic expiration timer to (Last created unit)
Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
Unit - Make (Last created unit) Invulnerable
Unit - Add Abi_EarthShock to (Last created unit)
Unit - Set level of Abi_EarthShock for (Last created unit) to (Level of Abi_EarthShock for (Triggering unit))
Unit - Set the custom value of (Last created unit) to 2
Unit - Add Storm Crow Form to (Last created unit)
Unit - Remove Storm Crow Form from (Last created unit)
Animation - Change (Last created unit) flying height to Real_ESchock_RandomFlyHeight at (Real_ESchock_RandomFlyHeight / Real_EShock_RandomTimedLife)
Set Unitgp_EShock_AoeDmg = (Units within Real_EShock_BigRock_AoeDmg of Pt_EShock_DeadDummyPos matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and ((((Matching unit) is alive) Equal to
Unit Group - Pick every unit in Unitgp_EShock_AoeDmg and do (Actions)
Loop - Actions
Unit - Cause (Triggering unit) to damage (Picked unit), dealing (Real_EShock_EmergeDmg x (Real((Level of Abi_EarthShock for (Triggering unit))))) damage of attack type Spells and damage type Magic
Custom script: call DestroyGroup (udg_Unitgp_EShock_AoeDmg)
Custom script: call RemoveLocation (udg_Pt_EShock_DeadDummyPos)
Else - Actions
-------- This creates the random small cluster rocks if the large rock dies --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Custom value of (Triggering unit)) Equal to 2
Then - Actions
Set Pt_EShock_DeadDummyPos = (Position of (Triggering unit))
Set Int_ESchock_RandomSmallRock = (Random integer number between Int_EShock_MinSmallRocks and Int_EShock_MaxSmallRocks)
For each (Integer A) from 1 to Int_ESchock_RandomSmallRock, do (Actions)
Loop - Actions
Set Pt_EShock_MoveToPos = (Pt_EShock_DeadDummyPos offset by 250.00 towards ((Real((Integer A))) x (360.00 / (Real(Int_ESchock_RandomSmallRock)))) degrees)
Unit - Create 1 UnitType_EShock_Dummy for (Owner of (Triggering unit)) at Pt_EShock_DeadDummyPos facing Default building facing degrees
Animation - Change (Last created unit)'s size to (60.00%, 60.00%, 60.00%) of its original size
Unit - Add Storm Crow Form to (Last created unit)
Unit - Remove Storm Crow Form from (Last created unit)
Animation - Change (Last created unit) flying height to (Current flying height of (Triggering unit)) at 0.00
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
Unit - Make (Last created unit) Invulnerable
Unit - Add Abi_EarthShock to (Last created unit)
Unit - Set level of Abi_EarthShock for (Last created unit) to (Level of Abi_EarthShock for (Triggering unit))
Unit - Set the custom value of (Last created unit) to 3
Unit - Set (Last created unit) movement speed to 250.00
Unit - Order (Last created unit) to Move To Pt_EShock_MoveToPos
Animation - Change (Last created unit) flying height to 0.00 at ((Current flying height of (Triggering unit)) / 1.00)
Custom script: call RemoveLocation (udg_Pt_EShock_MoveToPos)
Custom script: call RemoveLocation (udg_Pt_EShock_DeadDummyPos)
Else - Actions
-------- This deals the damage if the small clusters die --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Custom value of (Triggering unit)) Equal to 3
Then - Actions
Set Pt_EShock_DeadDummyPos = (Position of (Triggering unit))
Set Unitgp_EShock_AoeDmg = (Units within Real_EShock_SmallRock_AoeDmg of Pt_EShock_DeadDummyPos matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and ((((Matching unit) is alive) Equal
Unit Group - Pick every unit in Unitgp_EShock_AoeDmg and do (Actions)
Loop - Actions
Unit - Cause (Triggering unit) to damage (Picked unit), dealing (Real_ESchock_Damage + (Real_ESchock_IncreasePerLevel x (Real((Level of Abi_EarthShock for (Triggering unit)))))) damage of attack type Spells and damage type Magic
Special Effect - Create a special effect at Pt_EShock_DeadDummyPos using Abilities\Spells\Other\Volcano\VolcanoMissile.mdl
Special Effect - Destroy (Last created special effect)
Custom script: call DestroyGroup (udg_Unitgp_EShock_AoeDmg)
Custom script: call RemoveLocation (udg_Pt_EShock_DeadDummyPos)
Else - Actions
This is to make the spell a channeling spell. You can even make it non-channeling by removing this trigger. Set the Follow Through Time of the ability to zero. If this is done, the ability can be considered MUI instead of MPI (but I prefer channeling, suits better).
Code:
Remove Dummy If Ability Stops
Events
Unit - A unit Stops casting an ability
Conditions
(Ability being cast) Equal to Abi_EarthShock
Actions
For each (Integer A) from 1 to 16, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Triggering unit)) Equal to (Player((Integer A)))
Then - Actions
Set Unitgp_EShock_Dummy = (Units of type UnitType_EShock_Dummy)
Unit Group - Pick every unit in Unitgp_EShock_Dummy and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Picked unit)) Equal to (Player((Integer A)))
((Picked unit) is alive) Equal to True
(Custom value of (Picked unit)) Equal to 1
Then - Actions
Unit - Remove (Picked unit) from the game
Else - Actions
Custom script: call DestroyGroup (udg_Unitgp_EShock_Dummy)
Else - Actions
The spell basically plays around with 'A Unit is Dead' event. I hope it is understandable
Do comment. Hope you like this simple spell
Please give me some time for s/shots (Done).
Update:
The spell is updated.
Note:
Code:
Set Int_EShock_MaxSmallRocks = 8
The Screen Shot enlarged:
Attachments
-
87.3 KB Views: 2,215
-
28.3 KB Views: 578