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!
Found this laying dormant in my WIP Triggers. I decided to share this because I haven't found any Shockwave Systems yet, but if there is already, I guess it is far better than this one, so please give a link to it and just reject this one.
An easy-to-use Ability-related system which allows the user to create spells similar to Shockwave and Carrion Swarm, which travels on a certain point. This system is not just going to do the effects made by a normal Shockwave, but it is also capable of using more effects and features ranging from simple to complex ones.
An example of a feature is adding Stun to the Shockwave, which will stun affected enemy units.
Another example is using this spell as a reference/dummy, where if it reaches the max distance, then units in an area in the max distance may get rooted.
Set SW_WaveEffect[SW_Max] = Abilities\Spells\Orc\Shockwave\ShockwaveMissile.mdl
-------- Declares what Sfx will the Shockwave be based on. --------
Set SW_WaveEffectEnd[SW_Max] = Abilities\Spells\Other\Doom\DoomDeath.mdl
-------- Declares what Sfx will played when the Shockwave reaches its max distance. --------
Set SW_LoopingSfx[SW_Max] = False
-------- If set to True, it will allow the Shockwave to display a looping Sfx. It requires declaration of "SW_WaveEffectLoop". --------
-------- An example of the "SW_WaveEffectLoop" can be found in the Incineration Wave trigger. --------
Set SW_ExtraEffectCheck[SW_Max] = False
-------- If set to True, it will allow the Shockwave to do a specific effect. It requires declaration of "SW_ExtraEffect". --------
-------- An example of the "SW_ExtraEffect" can be found in the Silence Wave trigger. --------
Set SW_ExtraEffectTargetCheck[SW_Max] = False
-------- If set to True, it will allow the Shockwave to do a specific effect on an affected. It requires declaration of "SW_ExtraEffectTarget". --------
-------- An example of the "SW_ExtraEffectTarget" can be found in the Carrion Swarm trigger. --------
Set SW_AffectAlly[SW_Max] = False
Set SW_AffectEnemy[SW_Max] = True
Set SW_AffectAir[SW_Max] = False
Set SW_AffectGround[SW_Max] = True
Set SW_AffectStructure[SW_Max] = False
-------- Allows selection of which units will be affected by the Shockwave. --------
Set SW_OneInstance[SW_Max] = False
-------- If set to True, then the instance of the effect/damage to a unit will only be once. --------
Set SW_AttackType[SW_Max] = Spells
-------- Determines what kind of attack type the Shockwave will do. --------
Set SW_DamageType[SW_Max] = Magic
-------- Determines what kind of damage type the Shockwave will do. --------
Set SW_Attachment = origin
-------- Determines where the Shockwave Sfx will be attached to from the Dummy. Only used for giving some height to the wave. --------
Set SW_Damage[1] = 10.00
Set SW_Damage[2] = 20.00
Set SW_Damage[3] = 30.00
-------- Determines the amount of damage dealt. --------
Set SW_AreaInitial[1] = 125.00
Set SW_AreaInitial[2] = 125.00
Set SW_AreaInitial[3] = 125.00
-------- Determines the initial area of the Shockwave. --------
Set SW_AreaFinal[1] = 125.00
Set SW_AreaFinal[2] = 125.00
Set SW_AreaFinal[3] = 125.00
-------- Determines the final area of the Shockwave. --------
Set SW_Speed[1] = 1050.00
Set SW_Speed[2] = 1050.00
Set SW_Speed[3] = 1050.00
-------- Determines the speed of the Shockwave. --------
Set SW_Distance[1] = 400.00
Set SW_Distance[2] = 1000.00
Set SW_Distance[3] = 1800.00
-------- Determines the max distance that the Shockwave will travel. --------
Trigger - Run Shockwave Cast <gen> (ignoring conditions)
Carrion Swarm
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Carrion Swarm (Trigger)
Actions
Set SW_Max = (SW_Max + 1)
Set SW_Caster[SW_Max] = (Triggering unit)
Set SW_Point[0] = (Position of (Triggering unit))
Set SW_Point[1] = (Target point of ability being cast)
Set SW_Lvl[SW_Max] = (Level of (Ability being cast) for (Triggering unit))
Set SW_WaveEffect[SW_Max] = Abilities\Spells\Undead\CarrionSwarm\CarrionSwarmMissile.mdl
Set SW_WaveEffectEnd[SW_Max] = <Empty String>
Set SW_LoopingSfx[SW_Max] = False
Set SW_ExtraEffectTargetCheck[SW_Max] = True
Set SW_ExtraEffectTarget[SW_Max] = Carrion Swarm Heal <gen>
Set SW_AffectAlly[SW_Max] = True
Set SW_AffectEnemy[SW_Max] = True
Set SW_AffectAir[SW_Max] = True
Set SW_AffectGround[SW_Max] = True
Set SW_AffectStructure[SW_Max] = False
Set SW_OneInstance[SW_Max] = True
Set SW_AttackType[SW_Max] = Spells
Set SW_DamageType[SW_Max] = Magic
Set SW_Attachment = origin
Set SW_Damage[1] = 100.00
Set SW_Damage[2] = 200.00
Set SW_Damage[3] = 300.00
Set SW_AreaInitial[1] = 100.00
Set SW_AreaInitial[2] = 100.00
Set SW_AreaInitial[3] = 100.00
Set SW_AreaFinal[1] = 500.00
Set SW_AreaFinal[2] = 500.00
Set SW_AreaFinal[3] = 500.00
Set SW_Speed[1] = 1100.00
Set SW_Speed[2] = 1100.00
Set SW_Speed[3] = 1100.00
Set SW_Distance[1] = 800.00
Set SW_Distance[2] = 800.00
Set SW_Distance[3] = 800.00
Trigger - Run Shockwave Cast <gen> (ignoring conditions)
Carrion Swarm Heal
Events
Conditions
(TempUnit belongs to an ally of (Owner of SW_Caster[SW_Loop])) Equal to True
Actions
Unit - Set life of TempUnit to ((Life of TempUnit) + 200.00)
Special Effect - Create a special effect attached to the origin of TempUnit using Abilities\Spells\Undead\VampiricAura\VampiricAuraTarget.mdl
Special Effect - Destroy (Last created special effect)
Incineration Wave
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Incineration Wave (Trigger)
Actions
Set SW_Max = (SW_Max + 1)
Set SW_Caster[SW_Max] = (Triggering unit)
Set SW_Point[0] = (Position of (Triggering unit))
Set SW_Point[1] = (Target point of ability being cast)
Set SW_Lvl[SW_Max] = (Level of (Ability being cast) for (Triggering unit))
Set SW_WaveEffect[SW_Max] = <Empty String>
Set SW_WaveEffectEnd[SW_Max] = <Empty String>
Set SW_WaveEffectLoop[SW_Max] = Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
Set SW_LoopingSfx[SW_Max] = True
Set SW_ExtraEffectTargetCheck[SW_Max] = True
Set SW_ExtraEffectTarget[SW_Max] = Incineration Wave Extra <gen>
Set SW_AffectAlly[SW_Max] = False
Set SW_AffectEnemy[SW_Max] = True
Set SW_AffectAir[SW_Max] = True
Set SW_AffectGround[SW_Max] = True
Set SW_AffectStructure[SW_Max] = False
Set SW_OneInstance[SW_Max] = True
Set SW_AttackType[SW_Max] = Spells
Set SW_DamageType[SW_Max] = Magic
Set SW_Damage[1] = 50.00
Set SW_Damage[2] = 100.00
Set SW_Damage[3] = 150.00
Set SW_AreaInitial[1] = 100.00
Set SW_AreaInitial[2] = 100.00
Set SW_AreaInitial[3] = 100.00
Set SW_AreaFinal[1] = 100.00
Set SW_AreaFinal[2] = 100.00
Set SW_AreaFinal[3] = 100.00
Set SW_Speed[1] = 1500.00
Set SW_Speed[2] = 1500.00
Set SW_Speed[3] = 1500.00
Set SW_Distance[1] = 900.00
Set SW_Distance[2] = 1350.00
Set SW_Distance[3] = 1800.00
Trigger - Run Shockwave Cast <gen> (ignoring conditions)
Incineration Wave Extra
Events
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Incineration Wave (Stun) for SW_Dummy[SW_Loop]) Equal to 0
Then - Actions
Unit - Add Incineration Wave (Stun) to SW_Dummy[SW_Loop]
Else - Actions
Unit - Set level of Incineration Wave (Stun) for SW_Dummy[SW_Loop] to SW_Lvl[SW_Loop]
Shockwave Cast is the trigger that will create a dummy which will be your shockwave sfx, and will determine the distance, speed and damage of the ability that is casted.
Ex: If you cast Carrion Swarm, then this trigger will load the variables that is set from the Carrion Swarm trigger, and apply it for the Shockwave Loop trigger.
Shockwave Loop
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
For each (Integer SW_Loop) from 1 to SW_Max, do (Actions)
Loop - Actions
Set SW_DistanceX[SW_Loop] = (SW_DistanceX[SW_Loop] - (SW_SpeedX[SW_Loop] / (1.00 / 0.03)))
Set SW_Angle = (Facing of SW_Dummy[SW_Loop])
Set SW_NextPoint[0] = (Position of SW_Dummy[SW_Loop])
Set SW_NextPoint[1] = (SW_NextPoint[0] offset by (SW_SpeedX[SW_Loop] / (1.00 / 0.03)) towards SW_Angle degrees)
Set SW_AreaCurrent[SW_Loop] = (SW_AreaCurrent[SW_Loop] + SW_AreaGrowth[SW_Loop])
Set SW_Group = (Units within SW_AreaCurrent[SW_Loop] of SW_NextPoint[1])
Unit - Move SW_Dummy[SW_Loop] instantly to SW_NextPoint[1], facing SW_Angle degrees
If (SW_ExtraEffectCheck[SW_Loop] Equal to True) then do (Trigger - Run SW_ExtraEffect[SW_Loop] (checking conditions)) else do (Do nothing)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SW_LoopingSfx[SW_Loop] Equal to True
Then - Actions
Special Effect - Create a special effect at SW_NextPoint[0] using SW_WaveEffectLoop[SW_Loop]
Special Effect - Destroy (Last created special effect)
Else - Actions
Unit Group - Pick every unit in SW_Group and do (Actions)
Loop - Actions
Set TempUnit = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnit belongs to an enemy of (Owner of SW_Caster[SW_Loop])) Equal to SW_AffectEnemy[SW_Loop]
SW_AffectEnemy[SW_Loop] Equal to True
(TempUnit is in SW_GroupDone[SW_Loop]) Equal to False
Or - Any (Conditions) are true
Conditions
((TempUnit is A flying unit) Equal to SW_AffectAir[SW_Loop]) and (SW_AffectAir[SW_Loop] Equal to True)
((TempUnit is A ground unit) Equal to SW_AffectGround[SW_Loop]) and (SW_AffectGround[SW_Loop] Equal to True)
((TempUnit is A structure) Equal to SW_AffectStructure[SW_Loop]) and (SW_AffectStructure[SW_Loop] Equal to True)
Then - Actions
Unit - Cause SW_Caster[SW_Loop] to damage TempUnit, dealing SW_DamageX[SW_Loop] damage of attack type SW_AttackType[SW_Loop] and damage type SW_DamageType[SW_Loop]
If (SW_ExtraEffectTargetCheck[SW_Loop] Equal to True) then do (Trigger - Run SW_ExtraEffectTarget[SW_Loop] (checking conditions)) else do (Do nothing)
If (SW_OneInstance[SW_Loop] Equal to True) then do (Unit Group - Add TempUnit to SW_GroupDone[SW_Loop]) else do (Do nothing)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnit belongs to an ally of (Owner of SW_Caster[SW_Loop])) Equal to SW_AffectAlly[SW_Loop]
SW_AffectAlly[SW_Loop] Equal to True
(TempUnit is in SW_GroupDone[SW_Loop]) Equal to False
Or - Any (Conditions) are true
Conditions
((TempUnit is A flying unit) Equal to SW_AffectAir[SW_Loop]) and (SW_AffectAir[SW_Loop] Equal to True)
((TempUnit is A ground unit) Equal to SW_AffectGround[SW_Loop]) and (SW_AffectGround[SW_Loop] Equal to True)
((TempUnit is A structure) Equal to SW_AffectStructure[SW_Loop]) and (SW_AffectStructure[SW_Loop] Equal to True)
Then - Actions
If (SW_ExtraEffectTargetCheck[SW_Loop] Equal to True) then do (Trigger - Run SW_ExtraEffectTarget[SW_Loop] (checking conditions)) else do (Do nothing)
If (SW_OneInstance[SW_Loop] Equal to True) then do (Unit Group - Add TempUnit to SW_GroupDone[SW_Loop]) else do (Do nothing)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SW_DistanceX[SW_Loop] Less than or equal to 0.00
Then - Actions
Special Effect - Create a special effect attached to the origin of SW_Dummy[SW_Loop] using SW_WaveEffectEnd[SW_Loop]
Special Effect - Destroy (Last created special effect)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SW_Max Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Shockwave Loop is the trigger that will move the created dummy, and do the damage/ extra effects that you have set and/or made.
How this works is that it will move the dummy you created in the Shockwave Cast trigger periodically, and will apply the things that you set.
Please give reps and credits if used.
Update:
v1.1 - More Configurable (as _Guhun_ suggested).[/I]
This is what I got from the Cast and Loop trigger...
Notes
You may need to add some more documentation clarifying the purpose of the cast and loop triggers.
The point variable SW_Point might fail on recursion (e.g., a spell-effect occuring on a...
Pls give us a better explaination. Is this a triggered Shockwave only or it can use other features? Like Pick every unit in a range of the projectile actual location.
Pls give us a better explaination. Is this a triggered Shockwave only or it can use other features? Like Pick every unit in a range of the projectile actual location.
Sorry, I'm bad at explaining. But you can check this instead:
Shockwave
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Shockwave (Trigger)
Actions
Set SW_Max = (SW_Max + 1)
Set SW_Caster[SW_Max] = (Triggering unit)
Set SW_Point[0] = (Position of (Triggering unit))
Set SW_Point[1] = (Target point of ability being cast)
Set SW_Lvl[SW_Max] = (Level of (Ability being cast) for (Triggering unit))
Set SW_WaveEffect[SW_Max] = Abilities\Spells\Orc\Shockwave\ShockwaveMissile.mdl
-------- The effect of the Shockwave that will move. --------
Set SW_WaveEffectEnd[SW_Max] = Abilities\Spells\Other\Doom\DoomDeath.mdl
-------- The effect of the Shockwave after reaching its max distance. --------
Set SW_AllowFXLoop[SW_Max] = False
-------- A countinuous sfx. If this is True, you will need to declare SW_WaveEffectL to use this. --------
Set SW_AllowExtraEffectLoop[SW_Max] = False
-------- An additional effect (ex. Polymorph, Slow, Stun). If this is True, you will need to declare SW_EffectId to use this. --------
Set SW_TargetAir[SW_Max] = False
-------- Determines if the shockwave will affect flying units. --------
Set SW_UnitStructure[SW_Max] = True
-------- Determines if the shockwave will affect structures. --------
Set SW_UnitGround[SW_Max] = True
-------- Determines if the shockwave will affect ground units. --------
Set SW_ContinousDamage[SW_Max] = True
-------- Determines if the damage is continuous, meaning that as long as an affected unit is in the area of the trigger, it will keep on taking damage. --------
Set SW_Damage[1] = 10.00
Set SW_Damage[2] = 20.00
Set SW_Damage[3] = 30.00
-------- Amount of damage dealt. --------
Set SW_DamageFinal[1] = 200.00
Set SW_DamageFinal[2] = 300.00
Set SW_DamageFinal[3] = 400.00
-------- Amount of damage dealt after reaching its max distance. --------
Set SW_AreaInitial[1] = 125.00
Set SW_AreaInitial[2] = 125.00
Set SW_AreaInitial[3] = 125.00
-------- Initial area of effect. --------
Set SW_AreaFinal[1] = 125.00
Set SW_AreaFinal[2] = 125.00
Set SW_AreaFinal[3] = 125.00
-------- Final area of the effect. --------
Set SW_Speed[1] = 1050.00
Set SW_Speed[2] = 1050.00
Set SW_Speed[3] = 1050.00
-------- Speed of the shockwave. --------
Set SW_Distance[1] = 400.00
Set SW_Distance[2] = 1000.00
Set SW_Distance[3] = 1800.00
-------- Max distance of the shockwave. --------
Trigger - Run Shockwave_Cast <gen> (ignoring conditions)
You should allow the user to configure whether the shockwave will affect only enemy units or if it will affect enemy units and ground units. It could also be nice to allow the user to create shockwaves that heal, instead of only dealing damage (if they specify a negative damage value, turn it into healing). Also, the system is missing a core functionaly of the default shockwaves, which allow the user to specify the maximum damage dealt by the shockwave (the sum of the damage dealt to each target).
Instead only having the extra effect as a spell, you should allow a user to specify a trigger that will run when a unit is damaged. This will allow them to do a lot more (they could do it with events, but that would require a lot of extra object data).
You should provide a better explanation of what "ExtraEffectId" is, many people that use GUI may not have experience with Order Id's, only strings. Additionally, it would be a good bonus to link a list of order Ids. Here is a good one: Order Ids
If you provide a more detailed description, since GUI comments are pretty annoying to read, people should be more inclined to check out your submission. Adding "System" or "Engine" to your title should also give readers more information about what the submission actually is before even reading it.
Anyway, this is a pretty neat system with good functionality. The logic seems pretty concise and I did't notice any leaks. Rating as-is will be 3/5, but with updates (especially allowing a custom trigger) I would gladly raise the score.
You should allow the user to configure whether the shockwave will affect only enemy units or if it will affect enemy units and ground units. It could also be nice to allow the user to create shockwaves that heal, instead of only dealing damage (if they specify a negative damage value, turn it into healing). Also, the system is missing a core functionality of the default shockwaves, which allow the user to specify the maximum damage dealt by the shockwave (the sum of the damage dealt to each target).
EDIT: Okay, I've added more option on selecting which units will get affected. I didn't add max. damage dealt because I don't feel like adding it, but it can still be made by using a custom trigger now.
Instead only having the extra effect as a spell, you should allow a user to specify a trigger that will run when a unit is damaged. This will allow them to do a lot more (they could do it with events, but that would require a lot of extra object data).
Use the extra effect, and create an trigger when the dummy casted the ability in the extra effect? But I think this is a bad idea. Okay let me see what I can do.
EDIT: Done.
This is what I got from the Cast and Loop trigger...
Notes
You may need to add some more documentation clarifying the purpose of the cast and loop triggers.
The point variable SW_Point might fail on recursion (e.g., a spell-effect occuring on a spell-effect event), though this situation is extremely rare. (e.g. a dummy casting a shockwave spell on the start of shockwave, messy stuff.)
This is what I got from the Cast and Loop trigger...
Notes
You may need to add some more documentation clarifying the purpose of the cast and loop triggers.
To streamline variable declaration, you should outsource it to a function.
The point variable SW_Point might fail on recursion (e.g., a spell-effect occuring on a spell-effect event), though this situation is extremely rare. (e.g. a dummy casting a shockwave spell on the start of shockwave, messy stuff.)
Seeing the examples derived from the main Cast trigger, I would prefer that you write a function that eases out on variable declaration.
The following part of a trigger..
Set SW_Max = (SW_Max + 1)
Set SW_Caster[SW_Max] = (Triggering unit)
Set SW_Point[0] = (Position of (Triggering unit))
Set SW_Point[1] = (Target point of ability being cast)
Set SW_Lvl[SW_Max] = (Level of (Ability being cast) for (Triggering unit))
Set SW_WaveEffect[SW_Max] = Abilities\Spells\Undead\CarrionSwarm\CarrionSwarmMissile.mdl
Set SW_WaveEffectEnd[SW_Max] = <Empty String>
Set SW_LoopingSfx[SW_Max] = False
Set SW_ExtraEffectTargetCheck[SW_Max] = True
Set SW_ExtraEffectTarget[SW_Max] = Carrion Swarm Heal <gen>
Set SW_AffectAlly[SW_Max] = True
Set SW_AffectEnemy[SW_Max] = True
Set SW_AffectAir[SW_Max] = True
Set SW_AffectGround[SW_Max] = True
Set SW_AffectStructure[SW_Max] = False
Set SW_OneInstance[SW_Max] = True
Set SW_AttackType[SW_Max] = Spells
Set SW_DamageType[SW_Max] = Magic
Set SW_Attachment = origin
Set SW_Damage[1] = 100.00
Set SW_Damage[2] = 200.00
Set SW_Damage[3] = 300.00
Set SW_AreaInitial[1] = 100.00
Set SW_AreaInitial[2] = 100.00
Set SW_AreaInitial[3] = 100.00
Set SW_AreaFinal[1] = 500.00
Set SW_AreaFinal[2] = 500.00
Set SW_AreaFinal[3] = 500.00
Set SW_Speed[1] = 1100.00
Set SW_Speed[2] = 1100.00
Set SW_Speed[3] = 1100.00
Set SW_Distance[1] = 800.00
Set SW_Distance[2] = 800.00
Set SW_Distance[3] = 800.00
Can be shortened to something like this...
Custom Script: call SW_create()
Set SW_WaveEffect[SW_Max] = Abilities\Spells\Undead\CarrionSwarm\CarrionSwarmMissile.mdl
Set SW_WaveEffectEnd[SW_Max] = <Empty String>
Set SW_LoopingSfx[SW_Max] = False
Set SW_ExtraEffectTargetCheck[SW_Max] = True
Set SW_ExtraEffectTarget[SW_Max] = Carrion Swarm Heal <gen>
Trigger - Run Shockwave Cast <gen> (ignoring conditions)
The functions can be stated like these (Suggest placing it on Map Header) (You can CnP)
Note: An additional variable SW_Point_Counter was added
JASS:
// You automate the instance creation here
function SW_create takes nothing returns integer
local integer this = udg_SW_Max + 1
set udg_SW_Max = this + 1
set udg_SW_Point_Counter = udg_S_Point_Counter + 2
set udg_SW_Caster[this] = GetTriggerUnit()
set udg_SW_Point[udg_SW_Point_Counter - 2] = GetUnitLoc(udg_SW_Caster[udg_SW_Max])
set udg_SW_Point[udg_SW_Point_Counter - 1] = GetSpellTargetLoc()
set udg_SW_Lvl[this] = GetUnitAbilityLevel(udg_SW_Caster[udg_SW_Max], GetSpellAbilityId())
return this
endfunction
function SW_setBehavior takes integer this, boolean affectAllies, boolean affectEnemy, boolean affectAir, boolean affectGround, boolean affectStructure, boolean once returns nothing
set udg_SW_AffectAlly[this] = affectAllies
set udg_SW_AffectEnemy[this] = affectEnemy
set udg_SW_AffectAir[this] = affectAir
set udg_SW_AffectGround[this] = affectGround
set udg_SW_AffectStructure[this] = affectStructure
set udg_SW_OneInstance[this] = once
endfunction
Changing the Cast trigger slightly at the end...
Comment: ---------- -------------------- Removes the
This can possibly simplify the examples you've already given from the map script towards something less taxing in the long run.
Other than that, I see no reason for this not to be approved.
As far as the trigger goes, this is already approval-worthy. The only issue right now is the dummy issuing a stop order every time it is moved (which I can then infer that SetUnitPosition is being used instead of SetUnitX and SetUnitY).
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.