Moridin
Snow Leopard
- Reaction score
- 144
Energy Flow
View attachment Spell - Energy Flow.w3x
Description:
GUI
MUI
Leakless
Lagless
Summons 3 orbs of energy around the caster. These orbs spin in a circle, growing larger and more powerful as they spin. Whenever the caster targets a unit with another spell, one of the orbs breaks away from the circle to explode near the target, damaging all units in an AOE.
Orbs gain 1 charge per 360 degrees of spin. Damage depends on Base damage, level of Energy Flow and number of charges gained by the orb.
Requirements:
Hashtables (TFT, WC 1.24(e) recommended)
Implementation:
Read the README File in the map.
Screenshots:
Triggers:
Credits:
Spell Resource template map by Tinki3.
Spell concept by Dest. (Originally called Energitism)
Icon by bigapple90. Check the page here.
Model by RED BARON. Check the page here.
Additional notes:
This is the first time I'm submitting a resource . Also this spell is somewhat old, so it's probably not as efficient as I thought it might be.
I'm not exactly sure as to clearing hashtable leaks, so if there ARE leaks that I haven't removed, give me a heads up.
Changelog:
View attachment Spell - Energy Flow.w3x
Description:
GUI
MUI
Leakless
Lagless
Summons 3 orbs of energy around the caster. These orbs spin in a circle, growing larger and more powerful as they spin. Whenever the caster targets a unit with another spell, one of the orbs breaks away from the circle to explode near the target, damaging all units in an AOE.
Orbs gain 1 charge per 360 degrees of spin. Damage depends on Base damage, level of Energy Flow and number of charges gained by the orb.
Requirements:
Hashtables (TFT, WC 1.24(e) recommended)
Implementation:
Read the README File in the map.
Screenshots:
Triggers:
Trigger:
- Init
- Events
- Map initialization
- Conditions
- Actions
- Hashtable - Create a hashtable
- Set EN_Hashtable = (Last created hashtable)
- Events
Trigger:
- EN Cast
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Energy Flow
- Actions
- -------- EDITABLE VALUES --------
- Set EN_NoOfBombs = 3
- Set EN_MaxBombCharge = 3
- Set EN_Base_Damage = 50
- Set EN_PerLevel_Damage = 50
- Set EN_PerCharge_Damage = 10
- Set EN_Splash = True
- Set EN_AOE_Splash = 175
- Set EN_FriendlyFire = False
- -------- Total Bomb Damage = Base Damage + (PerLevelDamage*LevelOfAbility) + (PerChargeDamage*NoOfCharges) --------
- -------- ------------------------------ --------
- Trigger - Turn on EN Spin <gen>
- Trigger - Turn on EN Activate <gen>
- Hashtable - Save False as ((Key (Triggering unit)) - 2) of 1 in EN_Hashtable
- Unit Group - Add (Triggering unit) to EN_casters
- -------- Number of charges left --------
- Hashtable - Save EN_NoOfBombs as ((Key (Triggering unit)) - 1) of 1 in EN_Hashtable
- For each (Integer A) from 1 to EN_NoOfBombs, do (Actions)
- Loop - Actions
- Unit - Remove (Load (Key (Triggering unit)) of (Integer A) in EN_Hashtable) from the game
- -------- --------------------- --------
- Set temp_point = (Position of (Triggering unit))
- Set temp_point_2 = (temp_point offset by 100.00 towards ((Real((Integer A))) x (360.00 / (Real(EN_NoOfBombs)))) degrees)
- Unit - Create 1 Charge for (Triggering player) at temp_point_2 facing Default building facing degrees
- Hashtable - Save Handle Of(Last created unit) as (Key (Triggering unit)) of (Integer A) in EN_Hashtable
- Custom script: call RemoveLocation (udg_temp_point)
- Custom script: call RemoveLocation (udg_temp_point_2)
- -------- EDITABLE VALUES --------
- -------- size and hover height --------
- Animation - Change (Last created unit)'s size to (50.00%, 50.00%, 50.00%) of its original size
- -------- ------------------------------ --------
- -------- Degrees the charge has rotated --------
- Hashtable - Save 0 as ((Key (Triggering unit)) + 1) of (Integer A) in EN_Hashtable
- -------- Power of the charge --------
- Hashtable - Save 0 as ((Key (Triggering unit)) + 2) of (Integer A) in EN_Hashtable
- -------- Angle --------
- Set EN_Current_angle[(Integer A)] = ((Real((Integer A))) x (360.00 / (Real(EN_NoOfBombs))))
- Loop - Actions
- Events
Trigger:
- EN Spin
- Events
- Time - Every 0.05 seconds of game time
- Conditions
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (EN_casters is empty) Not equal to True
- Then - Actions
- Unit Group - Pick every unit in EN_casters and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Load ((Key (Picked unit)) - 1) of 1 from EN_Hashtable) Equal to 0
- Then - Actions
- Unit Group - Remove (Picked unit) from EN_casters
- Skip remaining actions
- Else - Actions
- If - Conditions
- For each (Integer A) from 1 to (Load ((Key (Picked unit)) - 1) of 1 from EN_Hashtable), do (Actions)
- Loop - Actions
- Set Current_unit = (Load (Key (Picked unit)) of (Integer A) in EN_Hashtable)
- Set EN_Current_angle[(Integer A)] = (EN_Current_angle[(Integer A)] + 12.00)
- Set temp_point = (Position of (Picked unit))
- Set temp_point_2 = (temp_point offset by 50.00 towards EN_Current_angle[(Integer A)] degrees)
- Unit - Move Current_unit instantly to temp_point_2
- Custom script: call RemoveLocation (udg_temp_point)
- Custom script: call RemoveLocation (udg_temp_point_2)
- Hashtable - Save ((Load ((Key (Picked unit)) + 1) of (Integer A) from EN_Hashtable) + 12) as ((Key (Picked unit)) + 1) of (Integer A) in EN_Hashtable
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Load ((Key (Picked unit)) + 1) of (Integer A) from EN_Hashtable) Greater than 360
- (Load ((Key (Picked unit)) + 2) of (Integer A) from EN_Hashtable) Less than EN_MaxBombCharge
- Then - Actions
- Hashtable - Save ((Load ((Key (Picked unit)) + 2) of (Integer A) from EN_Hashtable) + 1) as ((Key (Picked unit)) + 2) of (Integer A) in EN_Hashtable
- Hashtable - Save 0 as ((Key (Picked unit)) + 1) of (Integer A) in EN_Hashtable
- Else - Actions
- If - Conditions
- -------- The actions below are just effects for the different levels of charge --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Load ((Key (Picked unit)) + 2) of (Integer A) from EN_Hashtable) Equal to 1
- Then - Actions
- Animation - Change Current_unit's size to (70.00%, 70.00%, 70.00%) of its original size
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Load ((Key (Picked unit)) + 2) of (Integer A) from EN_Hashtable) Equal to 2
- Then - Actions
- Animation - Change Current_unit's size to (90.00%, 90.00%, 90.00%) of its original size
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Load ((Key (Picked unit)) + 2) of (Integer A) from EN_Hashtable) Equal to 3
- Then - Actions
- Animation - Change Current_unit's size to (110.00%, 110.00%, 110.00%) of its original size
- Else - Actions
- If - Conditions
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Unit Group - Pick every unit in EN_casters and do (Actions)
- Else - Actions
- Trigger - Turn off EN Activate <gen>
- Trigger - Turn off EN Blowing up <gen>
- Trigger - Turn off (This trigger)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events
Trigger:
- EN Activate
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- ((Triggering unit) is in EN_casters) Equal to True
- (Target unit of ability being cast) Not equal to No unit
- Actions
- Set temp_boolean = (Load ((Key (Triggering unit)) - 2) of 1 from EN_Hashtable)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- temp_boolean Equal to False
- Then - Actions
- Hashtable - Save True as ((Key (Triggering unit)) - 2) of 1 in EN_Hashtable
- Skip remaining actions
- Else - Actions
- If - Conditions
- Set temp_int = (Load ((Key (Triggering unit)) - 1) of 1 from EN_Hashtable)
- Set EN_Activated_Charge = (Load (Key (Triggering unit)) of temp_int in EN_Hashtable)
- Set EN_Activated_Charge_handle = (Load (Key (Triggering unit)) of temp_int in EN_Hashtable)
- -------- for later use in the next trigger --------
- Unit - Set the custom value of EN_Activated_Charge to temp_int
- -------- Saving target --------
- Hashtable - Save Handle Of(Target unit of ability being cast) as (Key EN_Activated_Charge_handle) of temp_int in EN_Hashtable
- -------- Power of the charge --------
- Hashtable - Save (Load ((Key (Triggering unit)) + 2) of temp_int from EN_Hashtable) as ((Key EN_Activated_Charge_handle) + 1) of temp_int in EN_Hashtable
- Hashtable - Save (Level of Energy Flow for (Triggering unit)) as ((Key EN_Activated_Charge_handle) + 2) of temp_int in EN_Hashtable
- -------- Deducting from number of charges (balls) left --------
- Hashtable - Save (temp_int - 1) as ((Key (Triggering unit)) - 1) of 1 in EN_Hashtable
- -------- For slide trigger --------
- Unit Group - Add EN_Activated_Charge to EN_Bombs
- Trigger - Turn on EN Blowing up <gen>
- Events
Trigger:
- EN Blowing up
- Events
- Time - Every 0.05 seconds of game time
- Conditions
- Actions
- Unit Group - Pick every unit in EN_Bombs and do (Actions)
- Loop - Actions
- Set Current_unit = (Load (Key (Picked unit)) of (Custom value of (Picked unit)) in EN_Hashtable)
- Set temp_point = (Position of (Picked unit))
- Set temp_point_2 = (Position of Current_unit)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Distance between temp_point and temp_point_2) Greater than or equal to 50.00
- Then - Actions
- Set temp_point_3 = (temp_point offset by 50.00 towards (Angle from temp_point to temp_point_2) degrees)
- Unit - Move (Picked unit) instantly to temp_point_3
- Custom script: call RemoveLocation (udg_temp_point)
- Custom script: call RemoveLocation (udg_temp_point_2)
- Custom script: call RemoveLocation (udg_temp_point_3)
- Else - Actions
- Custom script: call RemoveLocation (udg_temp_point_2)
- Set EN_Current_Damage = (EN_Base_Damage + ((EN_PerLevel_Damage x (Load ((Key (Picked unit)) + 2) of (Custom value of (Picked unit)) from EN_Hashtable)) + (EN_PerCharge_Damage x (Load ((Key (Picked unit)) + 1) of (Custom value of (Picked unit)) from EN_Hashtable))))
- Set temp_unit = (Picked unit)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- EN_Splash Equal to True
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- EN_FriendlyFire Equal to True
- Then - Actions
- Unit - Cause temp_unit to damage circular area after 0.00 seconds of radius (Real(EN_AOE_Splash)) at temp_point, dealing (Real(EN_Current_Damage)) damage of attack type Spells and damage type Normal
- Else - Actions
- Set temp_group = (Units within (Real(EN_AOE_Splash)) of temp_point matching (((Matching unit) belongs to an enemy of (Owner of temp_unit)) Equal to True))
- Unit Group - Pick every unit in temp_group and do (Actions)
- Loop - Actions
- Unit - Cause temp_unit to damage (Picked unit), dealing (Real(EN_Current_Damage)) damage of attack type Spells and damage type Normal
- Loop - Actions
- Custom script: call DestroyGroup (udg_temp_group)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- Unit - Cause (Picked unit) to damage Current_unit, dealing (Real(EN_Current_Damage)) damage of attack type Spells and damage type Normal
- If - Conditions
- Unit - Remove temp_unit from the game
- Special Effect - Create a special effect at temp_point using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
- Special Effect - Destroy (Last created special effect)
- Custom script: call RemoveLocation (udg_temp_point)
- If - Conditions
- Loop - Actions
- Unit Group - Pick every unit in EN_Bombs and do (Actions)
- Events
Credits:
Spell Resource template map by Tinki3.
Spell concept by Dest. (Originally called Energitism)
Icon by bigapple90. Check the page here.
Model by RED BARON. Check the page here.
Additional notes:
This is the first time I'm submitting a resource . Also this spell is somewhat old, so it's probably not as efficient as I thought it might be.
I'm not exactly sure as to clearing hashtable leaks, so if there ARE leaks that I haven't removed, give me a heads up.
Changelog:
26/06/10 - Fixed numerous leaks pointed out. Optimized triggers to switch off when not needed. Added Friendly_Fire editable.
07/07/10 - Optimized code a little bit more. Fixed a bug where the third charge didn't move or detonate correctly.
07/07/10 - Optimized code a little bit more. Fixed a bug where the third charge didn't move or detonate correctly.