Hey guys. I've never created a spell before but I've been using triggers quite a lot in maps I've created (I created an ammo/clip system for one of my maps). These triggers are not to complex but I figured I should attempt a basic spell.
I took the spell Fan of Knives and changed it around making the missiles homing and decided to make a similar/better version in GUI.
So here it is. I tired to make it as customize-able as possible.
This is not the final version however, the way I created the spell may have a ton of leaks or has bad uses of triggers (I know its not MUI yet) but this was the most simplistic way I could think of to make the spell work, even though it may not be the best way.
I'm looking for help on how to improve it, I am just learning about hashtables at the moment (I attempted to used hashtables for the damage the pusuers do, but it didn't work so I removed that). Everything I want it to do here is done, I just want to make the triggers efficient, leakless, less buggy and MUI.
Here are the triggers:
Thanks for reading.
I took the spell Fan of Knives and changed it around making the missiles homing and decided to make a similar/better version in GUI.
So here it is. I tired to make it as customize-able as possible.
This is not the final version however, the way I created the spell may have a ton of leaks or has bad uses of triggers (I know its not MUI yet) but this was the most simplistic way I could think of to make the spell work, even though it may not be the best way.
I'm looking for help on how to improve it, I am just learning about hashtables at the moment (I attempted to used hashtables for the damage the pusuers do, but it didn't work so I removed that). Everything I want it to do here is done, I just want to make the triggers efficient, leakless, less buggy and MUI.
Here are the triggers:
The Hexer summons Dark Pursuers to chase and damage random enemy units by damaging on contact with their target. These creatures last 6 seconds and will find a new target if their current one is dead. Multiple pursuers can target the same unit.
Level 1 - 40 damage + 3 x int
Level 2 - 60 damage + 3 x int
Level 3 - 80 damage + 3 x int
Level 1 - 40 damage + 3 x int
Level 2 - 60 damage + 3 x int
Level 3 - 80 damage + 3 x int
-
Init
-
Events
- Map initialization
- Conditions
-
Actions
- -------- Damage Delt --------
- Set DP_Base_Damage = 20
- -------- This will be added to the base damage even at level one. --------
- Set DP_Damage_Increase_Per_Level = 20
- -------- Range at which the pursuers will target an enemy --------
- Set DP_Range = 600.00
- -------- Number of missiles means the number of missiles fired PER LEVEL --------
- -------- This means if the variable is 5, at level one it will fire 5 pusuers, at level two it will fire 10 pursuers --------
- Set DP_Number_Of_Missiles = 5
- -------- How long the missile lasts --------
- Set DP_Missile_Lifetime = 6.00
- -------- The speed the pusuer goes --------
- Set DP_Movementspeed = 400.00
- -------- This is the pursuer unit type --------
- Set DP_Unit = Dark Pursuer
-
Events
-
Dark Pursuers
-
Events
- Unit - A unit Begins casting an ability
-
Conditions
- (Ability being cast) Equal to Dark Pursuers
-
Actions
- Set DP_Caster = (Casting unit)
- Set DP_Point = (Position of DP_Caster)
- Set DP_Enemy_Targets = (Units within DP_Range of DP_Point matching ((((Matching unit) belongs to an enemy of (Owner of DP_Caster)) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is A structure) Equal to False))))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (DP_Enemy_Targets is empty) Equal to False
- (All units of DP_Enemy_Targets are dead) Equal to False
-
Then - Actions
-
For each (Integer A) from 1 to (DP_Number_Of_Missiles x (Level of Dark Pursuers for DP_Caster)), do (Actions)
-
Loop - Actions
- Unit - Create 1 Dark Pursuer for (Owner of (Casting unit)) at (DP_Point offset by ((Random real number between 1.00 and 5.00), (Random real number between 1.00 and 5.00))) facing Default building facing degrees
- Unit - Set (Last created unit) movement speed to DP_Movementspeed
- Unit - Add a DP_Missile_Lifetime second Generic expiration timer to (Last created unit)
- Unit - Order (Last created unit) to Attack (Random unit from DP_Enemy_Targets)
-
Loop - Actions
-
For each (Integer A) from 1 to (DP_Number_Of_Missiles x (Level of Dark Pursuers for DP_Caster)), do (Actions)
- Else - Actions
-
If - Conditions
- Custom script: call RemoveLocation (udg_DP_Point)
- Custom script: call DestroyGroup (udg_DP_Enemy_Targets)
-
Events
-
DP Damage Check
-
Events
- Unit - A unit Is attacked
- Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of (Attacking unit)) Equal to Dark Pursuer
-
Then - Actions
- Unit - Cause (Attacking unit) to damage (Attacked unit), dealing (((Real(DP_Base_Damage)) + ((Real(DP_Damage_Increase_Per_Level)) x (Real((Level of Dark Pursuers for DP_Caster))))) + ((Real((Intelligence of DP_Caster (Include bonuses)))) x 3.00)) damage of attack type Spells and damage type Magic
- Unit - Kill (Attacking unit)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events