• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Cursed Lightning

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Hello! I'm back i have a new spell called Cursed Lightning. It's not yet perfect but ill try my best to fix the bugs

Cursed Lightning Level 1 : Casts a powerful lightning to the targeted unit that deals 100 Base damage, adds 1% of missing HP to the triggering unit after damaging the targeted unit.

Cursed Lightning Level 2 : Casts a powerful lightning to the targeted unit that deals 120 Base damage, adds 1% of missing HP to the triggering unit after damaging the targeted unit.

Cursed Lightning Level 3 : Casts a powerful lightning to the targeted unit that deals 150 Base damage, adds 1% of missing HP to the triggering unit after damaging the targeted unit.


Here are the Triggers
  • Cursed Lightning Config
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Configuration --------
      • -------- -------- --------
      • -------- Ability Variable --------
      • Set CL_Ability = Cursed Lighting
      • -------- -------- --------
      • -------- Cursed Lightning's Dummy Unit --------
      • Set CL_Dummy = Dummy
      • -------- Increases each level --------
      • -------- Radius of the lightning --------
      • -------- -------- --------
      • Set CL_Radius[1] = 200.00
      • Set CL_Radius[2] = 220.00
      • Set CL_Radius[3] = 250.00
      • -------- Damage Variable --------
      • -------- -------- --------
      • Set CL_Damage[1] = 100.00
      • Set CL_Damage[2] = 120.00
      • Set CL_Damage[3] = 150.00
      • -------- -------- --------
      • -------- Special Effects Variable --------
      • -------- -------- --------
      • Set CL_Special_Effect = Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
      • -------- -------- --------
      • Set CL_Ground_Special_Effect = Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
      • -------- End of Config --------
  • Cursed Lightning Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to CL_Ability
    • Actions
      • -------- -------- --------
      • -------- Casting Variables --------
      • -------- -------- --------
      • Set CL_Caster = (Triggering unit)
      • Set CL_Player = (Triggering player)
      • Set CL_Ability_Lvl = (Level of CL_Ability for CL_Caster)
      • Set CL_TempUnit = (Target unit of ability being cast)
      • Set CL_Point = (Position of CL_TempUnit)
      • -------- -------- --------
      • Special Effect - Create a special effect attached to the origin of CL_TempUnit using CL_Ground_Special_Effect
      • Special Effect - Create a special effect at CL_Point using CL_Special_Effect
      • -------- Creating the dummy unit --------
      • -------- -------- --------
      • Unit - Create 1 CL_Dummy for Player 1 (Red) at (Position of CL_TempUnit) facing Default building facing degrees
      • Set CL_Dummy_Unit_Var = (Last created unit)
      • -------- Adding an Expiration Timer --------
      • Unit - Add a 10.00 second Generic expiration timer to CL_Dummy_Unit_Var
      • -------- -------- --------
      • -------- Applying the Special Effects to the dummy unit --------
      • -------- -------- --------
      • Trigger - Run Cursed Lightning Damage <gen> (checking conditions)
  • Cursed Lightning Damage
    • Events
    • Conditions
    • Actions
      • Set CL_Health = ((Percentage life of CL_Caster) + 1.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (CL_TempUnit belongs to an enemy of CL_Player) Equal to True
          • (CL_TempUnit is alive) Equal to True
          • (CL_TempUnit is Magic Immune) Equal to False
        • Then - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within CL_Radius[CL_Ability_Lvl] of (Position of CL_TempUnit) matching ((CL_TempUnit belongs to an enemy of CL_Player) Equal to True)) and do (Actions)
            • Loop - Actions
              • -------- ---- --------
              • Unit - Set life of CL_Caster to CL_Health%
              • Unit - Cause CL_Caster to damage CL_TempUnit, dealing CL_Damage[CL_Ability_Lvl] damage of attack type Spells and damage type Normal
              • -------- ---- --------
              • -------- Floating Text Health Bonus --------
              • Floating Text - Create floating text that reads (+ + (String(CL_Health))) above CL_Caster with Z offset 0.00, using font size 9.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
              • Set CL_FloatingTextVar = (Last created floating text)
              • Floating Text - Change CL_FloatingTextVar: Disable permanence
              • Floating Text - Change the lifespan of CL_FloatingTextVar to 5.00 seconds
              • Floating Text - Change the fading age of CL_FloatingTextVar to 4.00 seconds
              • -------- ---- --------
        • Else - Actions
  • Cursed Lightning Floating Text Damage
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to CL_Ability
    • Actions
      • -------- Floating Text Damage --------
      • Floating Text - Create floating text that reads (- + (String(CL_Damage[CL_Ability_Lvl]))) above CL_TempUnit with Z offset 0.00, using font size 9.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Set CL_FloatingText_DamageVar = (Last created floating text)
      • Floating Text - Change CL_FloatingText_DamageVar: Disable permanence
      • Floating Text - Change the lifespan of CL_FloatingText_DamageVar to 5.00 seconds
      • Floating Text - Change the fading age of CL_FloatingText_DamageVar to 4.00 seconds
Previews
Contents

Cursed Lightning (Map)

Reviews
Pyrogasm
Don't use the Unit - Damage Area function. It is target-agnostic and will damage the caster as well as allied units in the area like a ground attack from catapults. Additionally the damage dealt is actually N*SpellDmg where N is the number of units in...
Level 38
Joined
Feb 27, 2007
Messages
4,951
  • Don't use the Unit - Damage Area function. It is target-agnostic and will damage the caster as well as allied units in the area like a ground attack from catapults. Additionally the damage dealt is actually N*SpellDmg where N is the number of units in the group, because your trigger tells the caster to damage the entire area once for each unit inside it. I assume you did not intend this. Change the damage line to Unit - Damage Target instead. There's also no target filtering right now; when you set the group variable you should use some Matching... commands to only grab nearby units hostile to the caster that are not spell-immune rather than just grabbing all units nearby.

  • Why use a dummy unit to follow the target around when you could just reduce the armor of the target directly with something like inner fire? (there are other options too)

  • Even if having a dummy unit was the best way, simply ordering it to follow the target is not an acceptable implementation. What if the target jumps over a wall? What if it has a spell that teleports it somewhere else on the map? Etc. If you're going to do it that way you'll need to manually move the dummy unit to the target's position on a low-timeout periodic timer. This brings me to my fourth point:

  • This is not MUI, and using a timer to move the unit would make it even less so. It needs to use dynamic indexing; read this for more information: Visualize: Dynamic Indexing

  • What exactly is the point of CL_Debuff_Group? Nothing is ever added to it so I don't see how it does anything. In any case you're erroneously destroying CL_Debuff_Group in the periodic trigger, which means after the first time it runs the group can't have any units added to it and is doubly pointless. You can replace the group destroy line with a Unit Group - Remove all units command, but I'm still not sure that that should happen there at all.

  • What if the caster dies while the spell is in effect? Currently it will stop dealing damage (well, unless dead units can deal damage but not sure on that one and in any case if the unit was explicitly removed from the map the damage every 2 seconds would fail).

  • The spell's tooltip says nothing about armor reduction or periodic damage that follows the target.
 
Last edited:
Level 4
Joined
Aug 5, 2016
Messages
39
  • Don't use the Unit - Damage Area function. It is target-agnostic and will damage the caster as well as allied units in the area like a ground attack from catapults. Additionally the damage dealt is actually N*SpellDmg where N is the number of units in the group, because your trigger tells the caster to damage the entire area once for each unit inside it. I assume you did not intend this. Change the damage line to Unit - Damage Target instead. There's also no target filtering right now; when you set the group variable you should use some Matching... commands to only grab nearby units hostile to the caster that are not spell-immune rather than just grabbing all units nearby.

  • Why use a dummy unit to follow the target around when you could just reduce the armor of the target directly with something like inner fire? (there are other options too)

  • Even if having a dummy unit was the best way, simply ordering it to follow the target is not an acceptable implementation. What if the target jumps over a wall? What if it has a spell that teleports it somewhere else on the map? Etc. If you're going to do it that way you'll need to manually move the dummy unit to the target's position on a low-timeout periodic timer. This brings me to my fourth point:

  • This is not MUI, and using a timer to move the unit would make it even less so. It needs to use dynamic indexing; read this for more information: Visualize: Dynamic Indexing

  • What exactly is the point of CL_Debuff_Group? Nothing is ever added to it so I don't see how it does anything. In any case you're erroneously destroying CL_Debuff_Group in the periodic trigger, which means after the first time it runs the group can't have any units added to it and is doubly pointless. You can replace the group destroy line with a Unit Group - Remove all units command, but I'm still not sure that that should happen there at all.

  • What if the caster dies while the spell is in effect? Currently it will stop dealing damage (well, unless dead units can deal damage but not sure on that one and in any case if the unit was explicitly removed from the map the damage every 2 seconds would fail).

  • The spell's tooltip says nothing about armor reduction or periodic damage that follows the target.
Thank you for the information @Pyrogasm i'll be updating this spell to fix those bugs :)
 
Level 4
Joined
Aug 5, 2016
Messages
39
@Pyrogasm i changed the "Unit - Damage Area" - "Unit - Damage Target", but it seems like it doesn't afflict any damage to the targeted unit

i separated the Cast trigger and the damage trigger to avoid any mess.

  • Cursed Lightning Damage
    • Events
    • Conditions
    • Actions
      • Set CL_Group = (Units within CL_Radius[CL_Index] of CL_Point matching (CL_Target Equal to (Picked unit)))
      • Set CL_Player = (Triggering player)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CL_Index Greater than 1
        • Then - Actions
          • Unit Group - Pick every unit in CL_Group and do (Actions)
            • Loop - Actions
              • Unit - Cause CL_Caster to damage CL_Target, dealing CL_Damage[CL_Index] damage of attack type Spells and damage type Normal
          • Custom script: call DestroyGroup(udg_CL_Group)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_CL_Point)
 
Level 14
Joined
Oct 19, 2014
Messages
187
@Jay-B, you have to set CL_Target = Picked unit.
and the player should be set into a variable
e.g
  • Set CL_Owner = (Owner of (Triggering unit))
edit:
aslo why?
  • -------- Don't change unless there are bugs! --------
configs should always be configurable
also this :)
empty.gif
join.gif
ani.gif
Special Effect - Create a special effect attached to the origin of CL_Target using CL_Ground_Special_Effect
empty.gif
join.gif
ani.gif
Special Effect - Create a special effect at CL_Point using CL_Special_Effect
pay attention from getting rid this effects :)

in this case, you used group to your loop so I suggest to hash everything.

empty.gif
joinminus.gif
unitgroup.gif
Unit Group - Pick every unit in CL_Debuff_Group and do (Actions)
empty.gif
line.gif
joinbottomminus.gif
actions.gif
Loop - Actions
empty.gif
line.gif
empty.gif
joinbottomminus.gif
if.gif
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
empty.gif
line.gif
empty.gif
empty.gif
joinminus.gif
cond.gif
If - Conditions
empty.gif
line.gif
empty.gif
empty.gif
line.gif
joinbottom.gif
if.gif
((Picked unit) has buff Cursed Lighting (Debuff)) Equal to True
empty.gif
line.gif
empty.gif
empty.gif
joinminus.gif
actions.gif
Then - Actions
empty.gif
line.gif
empty.gif
empty.gif
line.gif
joinbottom.gif
unit.gif
Unit - Cause CL_Caster to damage (Picked unit), dealing CL_Damage_Overtime[CL_Ability_Level] damage of attack type Spells and damage type Normal
empty.gif
line.gif
empty.gif
empty.gif
joinbottomminus.gif
actions.gif
Else - Actions
empty.gif
line.gif
empty.gif
empty.gif
empty.gif
joinbottom.gif
unitgroup.gif
Unit Group - Remove (Picked unit) from CL_Debuff_Group
empty.gif
joinbottom.gif
page.gif
Custom script: call DestroyGroup(udg_CL_Debuff_Group)

also this,, you had mention picked unit for many times, I suggest to create temporary unit variable and set it above the action if then else :)
 
Level 4
Joined
Aug 5, 2016
Messages
39
@Jay-B, you have to set CL_Target = Picked unit.
and the player should be set into a variable
e.g
  • Set CL_Owner = (Owner of (Triggering unit))
edit:
aslo why?
  • -------- Don't change unless there are bugs! --------
configs should always be configurable

also this :)
empty.gif
join.gif
ani.gif
Special Effect - Create a special effect attached to the origin of CL_Target using CL_Ground_Special_Effect
empty.gif
join.gif
ani.gif
Special Effect - Create a special effect at CL_Point using CL_Special_Effect
pay attention from getting rid this effects :)

in this case, you used group to your loop so I suggest to hash everything.

empty.gif
joinminus.gif
unitgroup.gif
Unit Group - Pick every unit in CL_Debuff_Group and do (Actions)
empty.gif
line.gif
joinbottomminus.gif
actions.gif
Loop - Actions
empty.gif
line.gif
empty.gif
joinbottomminus.gif
if.gif
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
empty.gif
line.gif
empty.gif
empty.gif
joinminus.gif
cond.gif
If - Conditions
empty.gif
line.gif
empty.gif
empty.gif
line.gif
joinbottom.gif
if.gif
((Picked unit) has buff Cursed Lighting (Debuff)) Equal to True
empty.gif
line.gif
empty.gif
empty.gif
joinminus.gif
actions.gif
Then - Actions
empty.gif
line.gif
empty.gif
empty.gif
line.gif
joinbottom.gif
unit.gif
Unit - Cause CL_Caster to damage (Picked unit), dealing CL_Damage_Overtime[CL_Ability_Level] damage of attack type Spells and damage type Normal
empty.gif
line.gif
empty.gif
empty.gif
joinbottomminus.gif
actions.gif
Else - Actions
empty.gif
line.gif
empty.gif
empty.gif
empty.gif
joinbottom.gif
unitgroup.gif
Unit Group - Remove (Picked unit) from CL_Debuff_Group
empty.gif
joinbottom.gif
page.gif
Custom script: call DestroyGroup(udg_CL_Debuff_Group)

also this,, you had mention picked unit for many times, I suggest to create temporary unit variable and set it above the action if then else :)

more like this?
  • Cursed Lightning Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to CL_Ability
    • Actions
      • -------- -------- --------
      • -------- Casting Variables --------
      • -------- -------- --------
      • Set CL_Caster = (Triggering unit)
      • Set CL_Player = (Owner of CL_Caster)
      • Set CL_Ability_Lvl = (Level of CL_Ability for CL_Caster)
      • Set CL_Target = (Picked unit)
      • Set CL_Point = (Position of CL_Target)
      • -------- -------- --------
      • -------- Creating the dummy unit --------
      • -------- -------- --------
      • Unit - Create 1 CL_Dummy for Player 1 (Red) at (Position of CL_Target) facing Default building facing degrees
      • Set CL_Dummy_Unit_Var = (Last created unit)
      • -------- Adding an Expiration Timer --------
      • -------- -------- --------
      • Unit - Add Cursed Lightning Debuff to CL_Dummy_Unit_Var
      • Unit - Order CL_Dummy_Unit_Var to Human Priest - Inner Fire CL_Target
      • Unit - Add a 10.00 second Generic expiration timer to CL_Dummy_Unit_Var
      • -------- -------- --------
      • -------- Applying the Special Effects to the dummy unit --------
      • -------- -------- --------
      • Special Effect - Create a special effect attached to the origin of CL_Target using CL_Ground_Special_Effect
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at CL_Point using CL_Special_Effect
      • Special Effect - Destroy (Last created special effect)
      • Trigger - Run Cursed Lightning Damage <gen> (checking conditions)
 
This needs an extensive rewrite, as recreating the spell so as to keep it in line with the envisioned mechanics is rather cumbersome.
There are logical flaws with the triggers and some unneeded variables, as well as the lack of configurability in the spell (affects allies as well?).

Some of the logical flaws have already been presented by Pyrogasm, and it is worth mentioning that the spell could actually benefit from some form of dynamic indexing, presented above as a link.

As a hint, these are the variables needed to be converted to arrays:

  • CL_Caster
  • CL_Group
As for the time being, this resource bundle shall be temporarily moved to Substandard.

Status:

  • Substandard
 
Top