1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  5. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  8. The raddest synthwave tracks were chosen - Check out our Music Contest #12 - Results and congratulate the winners!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Cursed Lightning

Submitted by Jay-B
This bundle is marked as substandard. It may contain bugs, not perform optimally or otherwise be in violation of the submission rules.
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...
  1. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,891
    Resources:
    1
    Spells:
    1
    Resources:
    1
    • 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: Nov 8, 2018
  2. Jay-B

    Jay-B

    Joined:
    Aug 5, 2016
    Messages:
    41
    Resources:
    0
    Resources:
    0
    Thank you for the information @Pyrogasm i'll be updating this spell to fix those bugs :)
     
  3. Jay-B

    Jay-B

    Joined:
    Aug 5, 2016
    Messages:
    41
    Resources:
    0
    Resources:
    0
    @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)
     
  4. doomhammer99

    doomhammer99

    Joined:
    Dec 5, 2011
    Messages:
    319
    Resources:
    5
    Models:
    1
    Spells:
    3
    Tutorials:
    1
    Resources:
    5
    @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
     
  5. JC Helas

    JC Helas

    Joined:
    Oct 19, 2014
    Messages:
    155
    Resources:
    2
    Spells:
    2
    Resources:
    2
    also this :)
    [​IMG][​IMG][​IMG]Special Effect - Create a special effect attached to the origin of CL_Target using CL_Ground_Special_Effect
    [​IMG][​IMG][​IMG]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.

    [​IMG][​IMG][​IMG]Unit Group - Pick every unit in CL_Debuff_Group and do (Actions)
    [​IMG][​IMG][​IMG][​IMG]Loop - Actions
    [​IMG][​IMG][​IMG][​IMG][​IMG]If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    [​IMG][​IMG][​IMG][​IMG][​IMG][​IMG]If - Conditions
    [​IMG][​IMG][​IMG][​IMG][​IMG][​IMG][​IMG]((Picked unit) has buff Cursed Lighting (Debuff)) Equal to True
    [​IMG][​IMG][​IMG][​IMG][​IMG][​IMG]Then - Actions
    [​IMG][​IMG][​IMG][​IMG][​IMG][​IMG][​IMG]Unit - Cause CL_Caster to damage (Picked unit), dealing CL_Damage_Overtime[CL_Ability_Level] damage of attack type Spells and damage type Normal
    [​IMG][​IMG][​IMG][​IMG][​IMG][​IMG]Else - Actions
    [​IMG][​IMG][​IMG][​IMG][​IMG][​IMG][​IMG]Unit Group - Remove (Picked unit) from CL_Debuff_Group
    [​IMG][​IMG][​IMG]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 :)
     
  6. Jay-B

    Jay-B

    Joined:
    Aug 5, 2016
    Messages:
    41
    Resources:
    0
    Resources:
    0
    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)
     
  7. doomhammer99

    doomhammer99

    Joined:
    Dec 5, 2011
    Messages:
    319
    Resources:
    5
    Models:
    1
    Spells:
    3
    Tutorials:
    1
    Resources:
    5
    check pyrogasm's post about dynamic indexing
     
  8. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,305
    Resources:
    7
    Models:
    1
    Icons:
    2
    Spells:
    3
    JASS:
    1
    Resources:
    7
    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
     
  9. Jay-B

    Jay-B

    Joined:
    Aug 5, 2016
    Messages:
    41
    Resources:
    0
    Resources:
    0
    Done! the spell trigger is rewrited and i removed some of the functions that create leaks and other flaws.