• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Arcane Eruption v1.1

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.

Hope you like it!

Changelogs

v1.1
-Fixed Arc
Contents

Arcane Eruption v1.1 (Map)

Reviews
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...

Moderator

M

Moderator

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. :D
 
Top