Trigger Halpz!1

Soulshadow

New Member
Reaction score
6
Alright, here is my spell. It's called Hand of Death, basically, it's a mass finger of death cast-point spell. I'm trying to get it to flow, and also, the lightning effects seem to destroy erratically. Can anyone help me sort this out?

Code:
Hand of Death Effect
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Ability being cast) Equal to Hand of Death 1 (Archimonde)
                (Ability being cast) Equal to Hand of Death 2 (Archimonde)
                (Ability being cast) Equal to Hand of Death 3 (Archimonde)
                (Ability being cast) Equal to Hand of Death 4 (Archimonde)
                (Ability being cast) Equal to Hand of Death 5 (Archimonde)
    Actions
        If ((Level of (Casting unit)) Greater than 15) then do (Set IntBonusDMG = (Integer(((0.10 x ((Real((Level of (Casting unit)))) - 15.00)) x (Real((Intelligence of (Casting unit) (Include bonuses)))))))) else do (Set IntBonusDMG = 0)
        Set SpecialEffects = 51
        Unit Group - Pick every unit in (Units within 400.00 of (Position of (Casting unit)) matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True))) and do (Actions)
            Loop - Actions
                Unit - Cause (Casting unit) to damage (Picked unit), dealing ((65.00 x (1.25 x (Real((Level of Shadow Word: Death (Archimonde) for (Casting unit)))))) + (Real(IntBonusDMG))) damage of attack type Chaos and damage type Universal
                Lightning - Create a Finger of Death lightning effect from source (Position of (Casting unit)) to target (Position of (Picked unit))
        Wait 0.45 seconds
        Unit Group - Pick every unit in (Units within 400.00 of (Position of (Casting unit)) matching (((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True)) and do (Actions)
            Loop - Actions
                For each (Integer A) from 1 to 50, do (Lightning - Destroy (Last created lightning effect))
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> Lightning - Destroy (Last created lightning effect)

This does what it says, it destroys the very last one...
It also does so 50 times, and several times overall from the unit loop.

A better plan would be to remember those created in an array, and counting them as they happen.
Then destroy those once done.
 

Soulshadow

New Member
Reaction score
6
I've never used arrays before. Could you try to explain a little more?
EDIT: Just for the record I was hoping you'd be the one to reply. :p
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Set CastPoint = Position of (Triggering unit)

Set UnitGroup = Units in ... whatever units you need here
Set TempInteger = 0

Pick every unit in UnitGroup and do
- Unit - Cause (Triggering unit) to damage ...
- Set Point = Position of (Picked unit)
- Lightning - Create <whatever> from CastPoint to Point
- Custom script: call RemoveLocation( udg_Point)
- Set TempInteger = TempInteger + 1
- Set LightningArrayVariable[TempInteger] = (Last created lightning)

Custom script: call RemoveLocation( udg_CastPoint)
Custom script: call DestroyGroup( udg_UnitGroup )

Wait .5 seconds

For each Integer A from 1 to TempInteger
- Lightning - Destroy LightningArrayVariable[Integer A]


And make sure "TempInteger" is only ever used in this trigger, nowhere else.
Same for that lightning array.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top