Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
Here is the first spell I've created. I've been using GUI for a while now making many types of triggers on my own maps. I've also created a Aggro System (can be found here). But I have never tried to create my own spell.
I found this model and loved it because I'm a big fan of the Souls game franchise. So here it is, the Dark Pursuers spell, I took influence from the spell in Dark Souls and used the Fan of Knives ability as the base idea for the spell.
The Hexer summons Dark Pursuers to chase and damage random enemy units by exploding 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.
[trigger=Settings]Settings
Events
Map initialization
Conditions
Actions
-------- Damage Dealt --------
Set DP_Base_Damage = 20.00
-------- This will be added to the base damage even at level one. --------
Set DP_Damage_Increase_Per_Level = 20.00
-------- Int Multiplier --------
Set DP_IntMultiplier = 3.00
-------- 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. *150 is recommended* --------
Set DP_Movementspeed = 400.00
-------- This is the pursuer unit type --------
Set DP_Unit = Dark Pursuer
-------- The Dark Pusuers Ability --------
Set DP_Ability = Dark Pursuers
[/trigger]
[trigger=Dark Pursuers]Dark Pusuers
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to DP_Ability
Actions
-------- Do not edit this trigger unless you know what you are doing. --------
-------- Setting up variables here. --------
Set DP_maxIndex = (DP_maxIndex + 1)
Set DP_Caster[DP_maxIndex] = (Casting unit)
Set DP_Point = (Position of DP_Caster[DP_maxIndex])
Set DP_TempPlayer = (Owner of DP_Caster[DP_maxIndex])
-------- Grouping the targets --------
Set DP_Enemy_Targets = (Units within DP_Range of DP_Point matching ((((Matching unit) belongs to an enemy of DP_TempPlayer) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is A structure) Equal to False))))
For each (Integer A) from 1 to (DP_Number_Of_Missiles x (Level of DP_Ability for DP_Caster[DP_maxIndex])), do (Actions)
Loop - Actions
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
-------- Creating the unit, setting the damage it deals, move speed and lifetime. --------
Unit - Create 1 Dark Pursuer for DP_TempPlayer 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
Set DP_TempUnit[0] = (Last created unit)
Set DP_DamageArray[(Custom value of DP_TempUnit[0])] = ((DP_Base_Damage + (DP_Damage_Increase_Per_Level x (Real((Level of DP_Ability for DP_Caster[DP_maxIndex]))))) + ((Real((Intelligence of DP_Caster[DP_maxIndex] (Include bonuses)))) x DP_IntMultiplier))
Unit - Set DP_TempUnit[0] movement speed to DP_Movementspeed
Unit - Add a DP_Missile_Lifetime second Generic expiration timer to DP_TempUnit[0]
Unit - Order DP_TempUnit[0] to Attack (Random unit from DP_Enemy_Targets)
Else - Actions
Custom script: call RemoveLocation (udg_DP_Point)
Custom script: call DestroyGroup (udg_DP_Enemy_Targets)
[/trigger]
[trigger=DP Damage Check]DP Damage Check
Events
Unit - A unit Is attacked
Conditions
Actions
-------- Do not edit this trigger unless you know what you are doing. --------
-------- Setting up variables here. --------
Set DP_TempUnit[0] = (Attacked unit)
Set DP_TempUnit[1] = (Attacking unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of DP_TempUnit[1]) Equal to Dark Pursuer
Then - Actions
-------- Using the unit indexer to get the damage, then dealing it. --------
Set DP_TempUnitVaule = DP_DamageArray[(Custom value of DP_TempUnit[1])]
Unit - Cause DP_TempUnit[1] to damage DP_TempUnit[0], dealing DP_TempUnitVaule damage of attack type Spells and damage type Magic
Unit - Kill DP_TempUnit[1]
Set DP_TempUnit[0] = No unit
Set DP_TempUnit[1] = No unit
Else - Actions
[/trigger]
Credits:
Vortigon - Model for the missile and the effect on the caster. (Here is the model again and the effect on the caster is this.)
Wietlol - For helping me out a ridiculous amount with this trigger.
Bribe - For his awesome Unit Indexer.
08:56, 14th Jun 2015
BPower:
Target enumeration, aswell as a successful hit event
should be triggered and not left to "unit attacks unit".
The final outcome ingame is very vague and hard to predict.
Object editor based spells are hard...
08:56, 14th Jun 2015 BPower:
Target enumeration, aswell as a successful hit event
should be triggered and not left to "unit attacks unit".
The final outcome ingame is very vague and hard to predict.
Object editor based spells are hard configurate.
your indexing method seems wrong too. I personally don't know how to index properly, but just increasing a single variable is not how it works. I know that in order to make it dynamic you need to deindex at some point, which you never do. Not to mention that you use bribes unit indexer, why do you even need to index yourself in the first place?
Also, I think it's a good idea to replace a unit is attacked to a unit comes within range, makes more sense to me.
Indexing is very confusing to me but I've tried my best to understand it. I've never come across deindexing whilst reading about it :O.
I'm not really sure how I can change it to units in range of. I kinda prefer is attacked because its more direct, I don't want the pursuer to damage any unit that walks in front of it, I want it to home in to a target and damage that target.
Edit: Oh awesome, thanks btdonald
Edit 2: I've updated the spell and cleaned the unit leak, going to look into this template map and then see what I need to change.
Edit 3: Alright I had a read and I don't think I fully understand but is this what I am looking for?
Dark Pusuers
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to DP_Ability
Actions
-------- Do not edit this trigger unless you know what you are doing. --------
-------- Setting up variables here. --------
Set DP_maxIndex = (DP_maxIndex + 1)
Set DP_Caster[DP_maxIndex] = (Casting unit)
Set DP_Point = (Position of DP_Caster[DP_maxIndex])
Set DP_TempPlayer = (Owner of DP_Caster[DP_maxIndex])
-------- Grouping the targets --------
Set DP_Enemy_Targets = (Units within DP_Range of DP_Point matching ((((Matching unit) belongs to an enemy of DP_TempPlayer) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is A structure) Equal to False))))
For each (Integer A) from 1 to (DP_Number_Of_Missiles x (Level of DP_Ability for DP_Caster[DP_maxIndex])), do (Actions)
Loop - Actions
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
-------- Creating the unit, setting the damage it deals, move speed and lifetime. --------
Unit - Create 1 Dark Pursuer for DP_TempPlayer 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
Set DP_TempUnit[0] = (Last created unit)
Set DP_ID = (Custom value of DP_TempUnit[0])
Set DP_DamageToDeal[DP_ID] = ((DP_Base_Damage + (DP_Damage_Increase_Per_Level x (Real((Level of DP_Ability for DP_Caster[DP_maxIndex]))))) + ((Real((Intelligence of DP_Caster[DP_maxIndex] (Include bonuses)))) x DP_IntMultiplier))
Unit - Set DP_TempUnit[0] movement speed to DP_Movementspeed
Unit - Add a DP_Missile_Lifetime second Generic expiration timer to DP_TempUnit[0]
Unit - Order DP_TempUnit[0] to Attack (Random unit from DP_Enemy_Targets)
Damage detection should be done by a damage detection system.
Missiles should not be fired by unit ordering "attack". It's an unpredictable outcome.
What looks acceptable in your demo map, can be very different in a real map.
It's too simple concept for a spell submission and will not be approved by me.
Unit - Create 1 Dark Pursuer for DP_TempPlayer 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
My suggestions:
Grouping the targets, use this instead:
Unit Group - Pick every unit in (Units within DP_Range of DP_Point) and do (Actions)
Loop - Actions
Set DP_Enemy = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(DP_Enemy belongs to an enemy of DP_TempPlayer) Equal to True
(DP_Enemy is alive) Equal to True
(DP_Enemy is A structure) Equal to False
(DP_Enemy is A flying unit) Equal to False
Then - Actions
Unit Group - Add (Picked unit) to DP_Enemy_Targets
Else - Actions
You don't need to check if the group is empty, it's unnecessary. It should be:
For each (Integer A) from 1 to (DP_Number_Of_Missiles x (Level of DP_Ability for DP_Caster[DP_maxIndex])), do (Actions)
Loop - Actions
Unit - Create 1 Dark Pursuer for DP_TempPlayer 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
Set DP_TempUnit[0] = (Last created unit)
Set DP_DamageArray[(Custom value of DP_TempUnit[0])] = ((DP_Base_Damage + (DP_Damage_Increase_Per_Level x (Real((Level of DP_Ability for DP_Caster[DP_maxIndex]))))) + ((Real((Intelligence of DP_Caster[DP_maxIndex] (Include bonuses)))) x DP_IntMultiplier))
Unit - Set DP_TempUnit[0] movement speed to DP_Movementspeed
Unit - Add a DP_Missile_Lifetime second Generic expiration timer to DP_TempUnit[0]
Unit - Order DP_TempUnit[0] to Attack (Random unit from DP_Enemy_Targets)
Don't forget the location leak as I just pointed above.
Anyway, great spell!
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.