KaerfNomekop
Swim, fishies. Swim through the veil of steel.
- Reaction score
- 609
Power Draft
By KaerfNomekop (First submission
)
By KaerfNomekop (First submission

Description:
Code:
Strikes the target with magic energy, dealing damage. Every second that this spell
is not in cooldown reduces this damage by 5, to a maximum reduction of 50.
Level 1 - 100 base damage.
Level 2 - 150 base damage.
Level 3 - 200 base damage.
Level 4 - 250 base damage.
Cooldown: 2 seconds
Manacost: 35/40/45/50
This spell was made for spamming (thus the low cooldown and manacost).
Pros:
- Made in GUI, so it's easy to understand.
- MUI - uses hashtables.
- Customizable - Maximum/minimum damage, interval between damage reductions, damage reduction amount, floating text, cooldown, manacost, effect and spell name can all be changed.
- Easy to duplicate - just copy the triggers and change the variables.
- Uses a periodic trigger, so it's more accurate.
- AFAIK, does not leak.
Cons:
- Made in GUI, so it's hugely inefficient.
- Uses hashtables, so it might be a tiny bit complicated. Ok, so maybe it's a little bit complicated.
- Uses a periodic trigger. May reduce performance.
- May contain leaks.
- Has no missile art.
- Lacks a nice backstory.
- Has 6 cons versus 6 pros.
Trigger Code:
Trigger:
- Init
- Events
- Map initialization
- Conditions
- Actions
- -------- Using the hashtable makes the spell MUI. --------
- Hashtable - Create a hashtable
- Set Hashtable = (Last created hashtable)
- -------- Whether or not floating text is displayed. --------
- Set DisplayTextBoolean = True
- -------- For the rest of the globals, the array index is the level, i.e. Cooldown[1] is the cooldown for level 1. --------
- -------- Increase/decrease the array sizes to suit the number of levels. --------
- -------- Cooldown of the spell. --------
- Set Cooldown[1] = 2.00
- Set Cooldown[2] = 2.00
- Set Cooldown[3] = 2.00
- Set Cooldown[4] = 2.00
- -------- Interval between reduction of damage. --------
- Set Interval[1] = 1.00
- Set Interval[2] = 1.00
- Set Interval[3] = 1.00
- Set Interval[4] = 1.00
- -------- Reduction of damage that occurs at every interval. --------
- Set Reduction[1] = 5.00
- Set Reduction[2] = 5.00
- Set Reduction[3] = 5.00
- Set Reduction[4] = 5.00
- -------- Maximum damage that the spell deals. --------
- Set DamageMax[1] = 100.00
- Set DamageMax[2] = 150.00
- Set DamageMax[3] = 200.00
- Set DamageMax[4] = 250.00
- -------- Minimum damage that the spell deals. Reduction happens at every interval until this value is reached. --------
- Set DamageMin[1] = 50.00
- Set DamageMin[2] = 100.00
- Set DamageMin[3] = 150.00
- Set DamageMin[4] = 200.00
- Events
Trigger:
- Learn
- Events
- Unit - A unit Learns a skill
- Conditions
- (Learned Hero Skill) Equal to Power Draft
- Actions
- Set TempInt = (Level of Power Draft for (Triggering unit))
- Hashtable - Save DamageMax[TempInt] as (Key (Triggering unit)) of (Key PowerDraftDamage) in Hashtable
- Hashtable - Save 0.00 as (Key (Triggering unit)) of (Key PowerDraftTime) in Hashtable
- Unit Group - Add (Triggering unit) to PowerDraftGroup
- Events
Trigger:
- Cast
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Power Draft
- Actions
- Set TempInt = (Level of Power Draft for (Triggering unit))
- Set TempInt2 = (Integer((Load (Key (Triggering unit)) of (Key PowerDraftDamage) from Hashtable)))
- -------- Floating text displays the damage dealt. Set DisplayTextBoolean to "false" to disable this. --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- DisplayTextBoolean Equal to True
- Then - Actions
- Set TempPoint = (Position of (Target unit of ability being cast))
- Floating Text - Create floating text that reads ((String(TempInt2)) + !) at TempPoint with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
- Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
- Floating Text - Change (Last created floating text<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite3" alt=":(" title="Frown :(" data-shortname=":(" /> Disable permanence
- Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
- Custom script: call RemoveLocation(udg_TempPoint)
- Else - Actions
- If - Conditions
- Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Real(TempInt2)) damage of attack type Spells and damage type Magic
- Unit Group - Remove (Triggering unit) from PowerDraftGroup
- Wait Cooldown[TempInt] seconds
- Hashtable - Save 0.00 as (Key (Triggering unit)) of (Key PowerDraftTime) in Hashtable
- Hashtable - Save DamageMax[TempInt] as (Key (Triggering unit)) of (Key PowerDraftDamage) in Hashtable
- Unit Group - Add (Triggering unit) to PowerDraftGroup
- Events
Trigger:
- Reduction
- Events
- Time - Every 0.05 seconds of game time
- Conditions
- (Number of units in PowerDraftGroup) Greater than 0
- Actions
- Unit Group - Pick every unit in PowerDraftGroup and do (Actions)
- Loop - Actions
- Set TempInt = (Level of Power Draft for (Picked unit))
- Set TempReal = (Load (Key (Picked unit)) of (Key PowerDraftTime) from Hashtable)
- Set TempReal2 = (Load (Key (Picked unit)) of (Key PowerDraftDamage) from Hashtable)
- Hashtable - Save (TempReal + 0.05) as (Key (Picked unit)) of (Key PowerDraftTime) in Hashtable
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- TempReal Equal to Interval[TempInt]
- Then - Actions
- Hashtable - Save 0.00 as (Key (Picked unit)) of (Key PowerDraftTime) in Hashtable
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- TempReal2 Greater than DamageMin[TempInt]
- Then - Actions
- Hashtable - Save (TempReal2 - Reduction[TempInt]) as (Key (Picked unit)) of (Key PowerDraftDamage) in Hashtable
- Else - Actions
- If - Conditions
- Else - Actions
- If - Conditions
- Loop - Actions
- Unit Group - Pick every unit in PowerDraftGroup and do (Actions)
- Events
Changelog:
29/11/2011, 0005 - v1.0 First release.
05/12/2011, 2322 - v1.1 Changed interval, added a condition to Reduction trigger.
Attachments
-
26.3 KB Views: 380
-
26.4 KB Views: 449