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!
One of my very first succesful arc spell(excluding Dark Portal which i have problems)
Tooltip
The Caster concentrates his power to summon a very powerful energy,which releases orbs of arcane energies every 0.20 scattered around him/her,dealing damage and mana burn when it drops to the ground.
|cffffcc00Level 1|r - Deals 50 damage and mana burn per orb,maximum of 500 radius,1-3 orbs,lasts for 5 seconds.
|cffffcc00Level 2|r - Deals 75 damage and mana burn per orb,maximum of 750 radius,2-4 orbs,lasts for 5 seconds.
|cffffcc00Level 3|r - Deals 100 damage and mana burn per orb,maximum of 1000 radius,3-5 orbs,lasts for 5 seconds.
[trigger=Setup]AE SetUp
Events
Map initialization
Conditions
Actions
Custom script: set udg_AE_Hash = InitHashtable()
-------- Configuration --------
-------- Determines the damage --------
Set AE_Damage[1] = 50.00
Set AE_Damage[2] = 75.00
Set AE_Damage[3] = 100.00
-------- Determines the mana burn --------
Set AE_ManaBurn[1] = 50.00
Set AE_ManaBurn[2] = 75.00
Set AE_ManaBurn[3] = 100.00
-------- Determines the duration --------
Set AE_Duration[1] = 5.00
Set AE_Duration[2] = 10.00
Set AE_Duration[3] = 15.00
-------- Determines the radius of AoE --------
Set AE_Radius[1] = 500.00
Set AE_Radius[2] = 750.00
Set AE_Radius[3] = 1000.00
-------- Determines the height of the orbs --------
-------- By Arc --------
Set AE_Height[1] = 0.50
Set AE_Height[2] = 0.75
Set AE_Height[3] = 1.00
-------- Determines the touch radius of the orb --------
Set AE_DamageRadius = 75.00
-------- Determines the number of orbs --------
-------- By Hex --------
Set AE_OrbsNumberMin[1] = 1
Set AE_OrbsNumberMax[1] = 3
Set AE_OrbsNumberMin[2] = 2
Set AE_OrbsNumberMax[2] = 4
Set AE_OrbsNumberMin[3] = 3
Set AE_OrbsNumberMax[3] = 5
-------- Determines the orb interval --------
Set AE_OrbInterval = 0.20
-------- Determines the SFX when orbs drop --------
Set AE_SFX[1] = Units\NightElf\Wisp\WispExplode.mdl
[/trigger][trigger=Cast]AE Cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Arcane Eruption
Actions
-------- Variables --------
Set AE_Caster = (Triggering unit)
Custom script: set udg_AE_CasterKey = GetHandleId(udg_AE_Caster)
-------- Starting Loop --------
Set AE_CurrentDuration = 0.00
Set AE_Level = (Level of Arcane Eruption for AE_Caster)
Hashtable - Save AE_CurrentDuration as 0 of AE_CasterKey in AE_Hash
Hashtable - Save AE_Level as 1 of AE_CasterKey in AE_Hash
Unit Group - Add AE_Caster to AE_LoopGroup
[/trigger][trigger=Loop]AE Loop
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in AE_LoopGroup and do (Actions)
Loop - Actions
Set AE_U = (Picked unit)
Custom script: set udg_AE_UKey = GetHandleId(udg_AE_U)
-------- Load --------
Set AE_CurrentDuration = (Load 0 of AE_UKey from AE_Hash)
Set AE_Level = (Load 1 of AE_UKey from AE_Hash)
Set AE_Timer = (Load 2 of AE_UKey from AE_Hash)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
AE_CurrentDuration Less than AE_Duration[AE_Level]
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
AE_Timer Greater than AE_OrbInterval
Then - Actions
-------- Creating Orbs --------
Set AE_ULoc = (Position of AE_U)
Set AE_Owner = (Owner of AE_U)
-------- Determines the hex number of orbs --------
Set AE_OrbHex = (Random integer number between AE_OrbsNumberMin[AE_Level] and AE_OrbsNumberMax[AE_Level])
For each (Integer AE_Integer) from 1 to AE_OrbHex, do (Actions)
Loop - Actions
Unit - Create 1 AE Missile for AE_Owner at AE_ULoc facing (Random angle) degrees
Set AE_Orb = (Last created unit)
Custom script: set udg_AE_OrbKey = GetHandleId(udg_AE_Orb)
-------- Variables for the orbs --------
Set AE_Distance = (Random real number between 0.00 and AE_Radius[AE_Level])
Set AE_Arc = (AE_Distance x AE_Height[AE_Level])
Set AE_CurrentHeight = 0.00
Set AE_Travelled = 0.00
-------- Due to that we will save first the travelled before we use the change height,i added a value so that it will use the height first --------
-------- Saving Variables --------
Hashtable - Save AE_Distance as 0 of AE_OrbKey in AE_Hash
Hashtable - Save AE_Arc as 1 of AE_OrbKey in AE_Hash
Hashtable - Save AE_Travelled as 2 of AE_OrbKey in AE_Hash
Hashtable - Save AE_Level as 3 of AE_OrbKey in AE_Hash
Hashtable - Save Handle OfAE_Owner as 4 of AE_OrbKey in AE_Hash
Hashtable - Save AE_CurrentHeight as 5 of AE_TempKey in AE_Hash
-------- Starting Loop --------
Unit Group - Add AE_Orb to AE_OrbsGroup
-------- Clean Leak --------
Custom script: call RemoveLocation(udg_AE_ULoc)
Hashtable - Save 0.00 as 2 of AE_UKey in AE_Hash
Else - Actions
Hashtable - Save (AE_Timer + 0.03) as 2 of AE_UKey in AE_Hash
-------- Saving Variables --------
Hashtable - Save (AE_CurrentDuration + 0.03) as 0 of AE_UKey in AE_Hash
Else - Actions
Hashtable - Clear all child hashtables of child AE_UKey in AE_Hash
Unit Group - Remove AE_U from AE_LoopGroup
Unit Group - Pick every unit in AE_OrbsGroup and do (Actions)
Loop - Actions
Set AE_Orbs = (Picked unit)
Custom script: set udg_AE_TempKey = GetHandleId(udg_AE_Orbs)
-------- Load --------
Set AE_Distance = (Load 0 of AE_TempKey from AE_Hash)
Set AE_Arc = (Load 1 of AE_TempKey from AE_Hash)
Set AE_Travelled = (Load 2 of AE_TempKey from AE_Hash)
Set AE_Level = (Load 3 of AE_TempKey from AE_Hash)
Set AE_Owner = (Load 4 of AE_TempKey in AE_Hash)
Set AE_CurrentHeight = (Load 5 of AE_TempKey from AE_Hash)
-------- Checking --------
Set AE_Loc = (Position of AE_Orbs)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
AE_Travelled Less than AE_Distance
Then - Actions
Set AE_Offset = (AE_Loc offset by (AE_Distance x 0.03) towards (Facing of AE_Orbs) degrees)
-------- Moving Unit --------
Unit - Move AE_Orbs instantly to AE_Offset
-------- Changing Height --------
Hashtable - Save (AE_Travelled + (AE_Distance x 0.03)) as 2 of AE_TempKey in AE_Hash
Hashtable - Save (((4.00 x AE_Arc) / AE_Distance) x (((Load 2 of AE_TempKey from AE_Hash) / AE_Distance) x (AE_Distance - (Load 2 of AE_TempKey from AE_Hash)))) as 5 of AE_TempKey in AE_Hash
Animation - Change AE_Orbs flying height to (Load 5 of AE_TempKey from AE_Hash) at 0.00
-------- Saving --------
Custom script: call RemoveLocation(udg_AE_Offset)
Else - Actions
-------- Damaging Units --------
Unit - Kill AE_Orbs
Set AE_DamageGroup = (Units within AE_DamageRadius of AE_Loc)
Unit Group - Pick every unit in AE_DamageGroup and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
((Picked unit) is A structure) Not equal to True
((Picked unit) is Magic Immune) Not equal to True
((Picked unit) is alive) Equal to True
((Picked unit) belongs to an enemy of AE_Owner) Equal to True
Then - Actions
-------- Damaging --------
Unit - Cause AE_Orbs to damage (Picked unit), dealing AE_Damage[AE_Level] damage of attack type Spells and damage type Normal
-------- Burning Mana --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Mana of (Picked unit)) Greater than 0.00
Then - Actions
Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - AE_ManaBurn[AE_Level])
Else - Actions
Else - Actions
-------- SFX --------
Special Effect - Create a special effect at AE_Loc using AE_SFX[1]
Special Effect - Destroy (Last created special effect)
-------- Clean UP --------
Custom script: call DestroyGroup(udg_AE_DamageGroup)
Hashtable - Clear all child hashtables of child AE_TempKey in AE_Hash
Unit Group - Remove AE_Orbs from AE_OrbsGroup
Custom script: call RemoveLocation(udg_AE_Loc)
[/trigger]
How to import:
First make sure to go to Map/Terrain Editor -> File -> Preferences then tick "Create unknown variables while pasting trigger data".\
Copy the Ability and the Dummy from the Object Editor then copy the Triggers.
16:28, 1st Sep 2012
PurgeandFire111: The code seems fine to me and the eye-candy of this spell is lovely. Good job, approved.
edit
Magtheridon96:
Though it would be nice if you were to cache the picked unit into a variable inside that group...
16:28, 1st Sep 2012
PurgeandFire111: The code seems fine to me and the eye-candy of this spell is lovely. Good job, approved.
edit
Magtheridon96:
Though it would be nice if you were to cache the picked unit into a variable inside that group enumeration block located in the second enumeration block of your loop trigger.
Looks like an epic firework show. Really awesome, dude. However, i am lazy and i never look at other people's spell code, so i talk about the overall look of the spell.
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.