🏆 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!
🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!
I made this as my first passive spell out of curiousty and also just to try something new.
Wild Energy:
Tooltip:
Passive spell, Gives a chance of 20 + (20 x level of ability)% to create an orb of energy which will home in on the nearest enemy dealing (0.5 x level of ability) x (max mana - current mana) in an area of 100 + (50 x level of ability) When a spell is casted. Mana cost of spell being casted when this spell is activated is not included.
-------- Sets the AOE of the damage of the Energy Sphere --------
Set WE_EnergyAOEBase = 100.00
Set WE_EnergyAOEPerLevel = 50.00
-------- Sets how close the Sphere must be to detonate --------
Set WE_EnergyDetonationRange = 50.00
-------- Sets the chance of the spell activating (%) --------
Set WE_EnergyChanceBase = 20
Set WE_EnergyChancePerLevel = 20
-------- Sets the search range for finding a target (if none is found the Sphere is not created) --------
Set WE_EnergyMaxSearchRangeBase = 400.00
Set WE_EnergyMaxSearchRangePerLevl = 100.00
-------- Sets the speed of how fast the search is made (change depending on your computer speed) --------
Set WE_EnergySearchGrowthSpeed = 10.00
-------- Sets the damage of the Sphere based on this x the missing mana (out of max) for the unit using it --------
Set WE_EnergyMultiplyerBase = 0.00
Set WE_EnergyMultiplyerPerLevel = 0.50
-------- Sets the speed the Sphere moves --------
Set WE_EnergySpeed = 6.00
-------- Sets how long the Sphere will follow for --------
Set WE_EnergyTime = 15.00
-------- Sets how high the lightning effect will be --------
Set WE_EnergyHeight = 75.00
-------- Sets the number of spheres created when it's activated --------
Set WE_EnergyCountMax = 1
-------- ---------- --------
Wild Energy Activation
Events
Unit - A unit Starts the effect of an ability
Conditions
(Level of Wild Energy for (Triggering unit)) Greater than or equal to 1
Actions
Set WE_u = (Triggering unit)
Set WE_EnergyChanceRandomiser = (Random integer number between 1 and 100)
Set TempIntStore = (Level of Wild Energy for WE_u)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
WE_EnergyChanceRandomiser Less than or equal to (WE_EnergyChanceBase + (WE_EnergyChancePerLevel x TempIntStore))
(Mana of WE_u) Not equal to (Max mana of WE_u)
Then - Actions
Set WE_TempPoint = (Position of WE_u)
Set WE_EnergyCurrentSearchRange = 0.00
Set WE_EnergyCount = WE_EnergyCountMax
For each (Integer WE_i) from 1 to (((Integer(WE_EnergyMaxSearchRangeBase)) + ((Integer(WE_EnergyMaxSearchRangePerLevl)) x TempIntStore)) / (Integer(WE_EnergySearchGrowthSpeed))), do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
WE_EnergyCount Not equal to 0
Then - Actions
Set WE_EnergyCurrentSearchRange = (WE_EnergyCurrentSearchRange + WE_EnergySearchGrowthSpeed)
Set WE_TempGroup = (Units within WE_EnergyCurrentSearchRange of WE_TempPoint)
Unit Group - Pick every unit in WE_TempGroup and do (Actions)
Loop - Actions
Set WE_TempU = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(WE_TempU is A ground unit) Equal to True
(WE_TempU is alive) Equal to True
(WE_TempU is Magic Immune) Equal to False
(WE_TempU is A structure) Equal to False
(WE_TempU belongs to an enemy of (Owner of WE_u)) Equal to True
Then - Actions
Set WE_TempRealStore = (Real((Level of Wild Energy for WE_u)))
Set WE_EnergyCount = (WE_EnergyCount - 1)
Trigger - Turn on Wild Energy Loop <gen>
Unit - Create 1 Energy Sphere for (Owner of WE_u) at WE_TempPoint facing Default building facing degrees
Set WE_TempU = (Last created unit)
Unit - Add a WE_EnergyTime second Generic expiration timer to WE_TempU
Unit - Change color of WE_TempU to (Color of Neutral Hostile)
Unit Group - Add WE_TempU to WE_WildEnergyGroup
Special Effect - Create a special effect at WE_TempPoint using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
Special Effect - Destroy (Last created special effect)
Custom script: set udg_WE_UHandle = GetHandleId(udg_WE_TempU)
Set WE_TempU = (Picked unit)
Hashtable - Save Handle OfWE_TempU as 1 of WE_UHandle in WE_WildEnergyHash
Hashtable - Save (((Max mana of WE_u) - (Mana of WE_u)) x (WE_EnergyMultiplyerBase + (WE_EnergyMultiplyerPerLevel x WE_TempRealStore))) as 2 of WE_UHandle in (Last created hashtable)
Hashtable - Save (WE_EnergyAOEBase + (WE_EnergyAOEPerLevel x WE_TempRealStore)) as 3 of WE_UHandle in (Last created hashtable)
Hashtable - Save Handle OfWE_u as 4 of WE_UHandle in WE_WildEnergyHash
(Unit-type of (Triggering unit)) Equal to Energy Sphere
Actions
Set WE_u = (Triggering unit)
Set WE_UHandle = (Key (Triggering unit))
Set WE_TempPoint = (Position of WE_u)
Unit - Kill WE_u
Unit Group - Remove WE_u from WE_WildEnergyGroup
Lightning - Destroy (Load 5 of WE_UHandle in WE_WildEnergyHash)
Special Effect - Create a special effect at WE_TempPoint using Objects\Spawnmodels\NightElf\NEDeathMedium\NEDeath.mdl
Special Effect - Destroy (Last created special effect)
Set WE_TempGroup = (Units within (Load 3 of WE_UHandle from WE_WildEnergyHash) of WE_TempPoint)
Unit Group - Pick every unit in WE_TempGroup and do (Actions)
Loop - Actions
Set WE_TempU = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(WE_TempU is Magic Immune) Equal to False
((Unit-type of WE_TempU) is A structure) Equal to False
(WE_TempU is A ground unit) Equal to True
(WE_TempU is alive) Equal to True
(WE_TempU belongs to an enemy of (Owner of WE_u)) Equal to True
Then - Actions
Unit - Cause (Load 4 of WE_UHandle in WE_WildEnergyHash) to damage (Picked unit), dealing (Load 2 of WE_UHandle from WE_WildEnergyHash) damage of attack type Spells and damage type Normal
Set WE_TempGroup = (Units within WE_EnergyDetonationRange of WE_TempPoint matching ((((Matching unit) is A ground unit) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of WE_u)) Equal to True) and ((((M
Unit Group - Pick every unit in WE_TempGroup and do (Actions)
Loop - Actions
Set WE_TempU = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(WE_TempU is Magic Immune) Equal to False
((Unit-type of WE_TempU) is A structure) Equal to False
(WE_TempU is A ground unit) Equal to True
(WE_TempU is alive) Equal to True
(WE_TempU belongs to an enemy of (Owner of WE_u)) Equal to True
Set WE_TempGroup = (Units within (Load 3 of WE_UHandle from WE_WildEnergyHash) of WE_TempPoint)
Unit Group - Pick every unit in WE_TempGroup and do (Actions)
Loop - Actions
Set WE_TempU = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(WE_TempU is Magic Immune) Equal to False
((Unit-type of WE_TempU) is A structure) Equal to False
(WE_TempU is A ground unit) Equal to True
(WE_TempU is alive) Equal to True
(WE_TempU belongs to an enemy of (Owner of WE_u)) Equal to True
Then - Actions
Unit - Cause (Load 4 of WE_UHandle in WE_WildEnergyHash) to damage (Picked unit), dealing (Load 2 of WE_UHandle from WE_WildEnergyHash) damage of attack type Spells and damage type Normal
You can use that 'set bj_wantDestroyGroup = true' thing instead:
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units within (Load 3 of WE_UHandle from WE_WildEnergyHash) of WE_TempPoint) and do (Actions)
Loop - Actions
Set WE_TempU = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(WE_TempU is Magic Immune) Equal to False
((Unit-type of WE_TempU) is A structure) Equal to False
(WE_TempU is A ground unit) Equal to True
(WE_TempU is alive) Equal to True
(WE_TempU belongs to an enemy of (Owner of WE_u)) Equal to True
Then - Actions
Unit - Cause (Load 4 of WE_UHandle in WE_WildEnergyHash) to damage (Picked unit), dealing (Load 2 of WE_UHandle from WE_WildEnergyHash) damage of attack type Spells and damage type Normal
Else - Actions
edit
In the second trigger:
Set WE_UHandle = (Key (Last created unit))
->
Custom script: set udg_WE_UHandle = GetHandleId(udg_WE_TempU)
(Since you already cached the last created unit previously)
Oh and that bj_wantDestroyGroup thing can apply everywhere else too.
Thanks for the notes, I'll make the appropriate changes momentarily, don't know if I'll bother with the wantdestroygroup thing - I like sticking to the standard format I normally use (even if it's a little less efficient).
Edit: Not sure about the set WE_UHandle change, I'll have to look at it again and get my head around it
Edit2: just got it, give me a second
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.