• 🏆 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!

Any guides or tips towards correcting my "chain of lightning" trigger?

Status
Not open for further replies.
Level 3
Joined
Mar 3, 2023
Messages
17
Wondering if someone could give me a hint towards what I'm doing incorrectly here. I've been working on a stat based spells only to lead to failure so I tried to recreate this trigger from this post after many attempts to do it myself + other guides on hive, the spell will deal damage to the first unit however the others receive lightning animation on them but no damage. I'm really trying to learn how to build these spells myself and correct my other attribute spells accordingly, appreciate any pointers here.
(I'd say I'm new ish to custom spells and damage engines)


  • Lightning Blast Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Lightning Blast
    • Actions
      • -------- -------------------------------------------------------------------------------------------- --------
      • -------- Set Variables --------
      • -------- -------------------------------------------------------------------------------------------- --------
      • Set VariableSet LB_Caster = (Triggering unit)
      • Set VariableSet LB_Owner = (Owner of LB_Caster)
      • Set VariableSet LB_Target = (Target unit of ability being cast)
      • Set VariableSet LB_Level = (Level of Lightning Blast for LB_Caster)
      • Set VariableSet LB_Level_Convert = (Real(LB_Level))
      • Set VariableSet LB_Damage = ((LB_Level_Convert x 0.25) x (Real((Intelligence of LB_Caster (Include bonuses)))))
      • Set VariableSet LB_Count = 4
      • Set VariableSet LB_Point = (Position of LB_Target)
      • -------- -------------------------------------------------------------------------------------------- --------
      • -------- -------------------------------------------------------------------------------------------- --------
      • Unit - Cause LB_Caster to damage LB_Target, dealing LB_Damage damage of attack type Spells and damage type Normal
      • Unit - Create 1 Dummy for LB_Owner at LB_Point facing Default building facing degrees
      • Set VariableSet Temp_Unit = (Last created unit)
      • Unit - Add a 1.00 second Generic expiration timer to Temp_Unit
      • Unit - Add Lightning Blast to Temp_Unit
      • Unit - Set level of Lightning Blast for Temp_Unit to LB_Level
      • Unit - Order Temp_Unit to Undead Banshee - Curse LB_Target
  • Lightning Blast Loop
    • Events
      • Time - Every 0.40 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LB_Count Greater than 0
        • Then - Actions
          • Set VariableSet tempGroup = (Units within 750.00 of LB_Point matching ((((Matching unit) has buff Lightning Blast Dummy ) Equal to False) and ((((Matching unit) belongs to an enemy of LB_Owner.) Equal to True) and (((Matching unit) is alive) Equal to True))).)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in tempGroup) Greater than 0
            • Then - Actions
              • Set VariableSet LB_Count = (LB_Count - 1)
              • Set VariableSet LB_Target = (Random unit from tempGroup)
              • Set VariableSet tempLocation = (Position of LB_Target)
              • Set VariableSet LB_Damage = ((LB_Level_Convert x 0.25) x (Real((Intelligence of LB_Caster (Include bonuses)))))
              • Unit - Cause LB_Caster to damage LB_Target, dealing LB_Damage damage of attack type Spells and damage type Normal
              • Lightning - Move LB_Light to source (Position of LB_Caster) and target (Position of LB_Caster)
              • Custom script: set udg_LB_Light = AddLightningEx("CLPB", true , GetLocationX(udg_LB_Point), GetLocationY(udg_LB_Point), GetLocationZ(udg_LB_Point) + 70, GetLocationX(udg_tempLocation), GetLocationY(udg_tempLocation), GetLocationZ(udg_tempLocation) + 70)
              • Custom script: call RemoveLocation(udg_LB_Point)
              • Set VariableSet LB_Point = (Position of LB_Target)
              • Custom script: call RemoveLocation(udg_tempLocation)
              • Unit - Create 1 Dummy for LB_Owner at LB_Point facing Default building facing degrees
              • Set VariableSet Temp_Unit = (Last created unit)
              • Unit - Add a 1.00 second Generic expiration timer to Temp_Unit
              • Unit - Add Lightning Blast to Temp_Unit
              • Unit - Set level of Lightning Blast for Temp_Unit to LB_Level
              • Unit - Order Temp_Unit to Undead Banshee - Curse LB_Target
            • Else - Actions
              • Lightning - Destroy LB_Light
              • Custom script: call DestroyGroup(udg_tempGroup)
              • Custom script: call RemoveLocation(udg_LB_Point)
              • Custom script: call RemoveLocation(udg_tempLocation)
              • Trigger - Turn off (This trigger)
        • Else - Actions
          • Lightning - Destroy LB_Light
          • Custom script: call DestroyGroup(udg_tempGroup)
          • Custom script: call RemoveLocation(udg_LB_Point)
          • Custom script: call RemoveLocation(udg_tempLocation)
          • Trigger - Turn off (This trigger)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,539
That trigger has a lot of potential issues and isn't MUI or MPI. I have a custom chain lightning spell in here that should do everything you want and more:
You'd just need to remove some aspects from it because it currently targets Destructibles as well.


Anyway, looking at your triggers, the main issues I see are:

This leaks two Points and appears to be unnecessary:
  • Lightning - Move LB_Light to source (Position of LB_Caster) and target (Position of LB_Caster)
You're creating a new Lightning right below it, why would you need to move an existing Lightning?

You're never Turning On Lightning Blast Loop from the Lightning Blast Copy trigger:
  • Unit - Order Temp_Unit to Undead Banshee - Curse LB_Target
  • -------- -------------------------------------------------------------------------------------------- --------
  • -------- -------------------------------------------------------------------------------------------- --------
  • Trigger - Turn on Lightning Blast Loop
The Loop trigger should be Initially Off, you only want it to run if Lightning Blast is active.

An ability like Chain Lightning will "snapshot" it's damage upon casting so doing this in the Loop trigger seems off:
  • Set VariableSet LB_Damage = ((LB_Level_Convert x 0.25) x (Real((Intelligence of LB_Caster (Include bonuses)))))
You've already Set this variable in the casting trigger.

If your Dummy unit isn't setup correctly then you'll have all sorts of issues. A proper Dummy unit requires these settings (99% of the time):

Copy and paste the Locust unit and proceed to change the following.
Set it's Movement Type: None, Speed Base: 0, Attacks Enabled: None, Model: None, Shadow: None.
 
Last edited:
Status
Not open for further replies.
Top