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

Duplicating Spell?

Status
Not open for further replies.
Level 7
Joined
Jul 9, 2008
Messages
253
Hello, I made a spell called Lightning Vengeance, that makes a circle of lightning that moves towards the caster and then explodes, dealing damage to nearby enemy units.

The problem is that when I cast it the second time, it also gets cast on the spot where I casted it the first time. So it does the spells twice. This is strange because I don't have this in my trigger ( I believe I don't )

So could anyone help me?

Here is the trigger:

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Lightning Vengeance
  • Actions
    • Set Position = (Position of (Triggering unit))
    • Unit - Create 1 Dummy - Buffer for (Owner of (Triggering unit)) at Position facing Default building facing degrees
    • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of Lightning Vengeance for (Triggering unit)) Equal to 2
      • Then - Actions
        • Unit - Set level of Lightning Protection for (Last created unit) to 2
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of Lightning Vengeance for (Triggering unit)) Equal to 3
      • Then - Actions
        • Unit - Set level of Lightning Protection for (Last created unit) to 3
      • Else - Actions
    • Unit - Order (Last created unit) to Human Priest - Inner Fire (Triggering unit)
    • Set Facing = 0.00
    • Unit - Pause (Triggering unit)
    • For each (Integer A) from 1 to 18, do (Actions)
      • Loop - Actions
        • Unit - Create 1 Dummy - Eyecandy for (Owner of (Triggering unit)) at (Position offset by 600.00 towards Facing degrees) facing Default building facing degrees
        • Unit - Order (Last created unit) to Move To Position
        • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
        • Set Facing = (Facing + 20.00)
    • Wait 1.00 seconds
    • Unit - Unpause (Triggering unit)
    • Set Facing = 0.00
    • Unit - Create 1 Dummy - Explosion for (Owner of (Triggering unit)) at Position facing Default building facing degrees
    • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
    • Unit Group - Pick every unit in (Units within 400.00 of Position matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
      • Loop - Actions
        • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((50.00 x (Real((Level of Lightning Vengeance for (Triggering unit))))) + ((Real((Strength of (Triggering unit) (Include bonuses)))) x (Real((Level of Lightning Vengeance for (Triggering unit)))))) damage of attack type Spells and damage type Normal
    • Custom script: call RemoveLocation( udg_Position )
 
Level 13
Joined
Sep 29, 2008
Messages
671
The wait action destroys the MUIness of the spell.

When did you cast the second spell? Did you cast it before 1 second?

btw, you can set your Lightning Protection like this instead of using If/Then/Else action:
  • Unit - Set level of Lightning Protection for (Last created unit) to (Level of (Ability being cast) for (Triggering unit))
 
Level 7
Joined
Jul 9, 2008
Messages
253
Sorry for not responding, was doing some other things, so I changed the RemoveLocation(udg_Position) but it still stays the same, I cast the spell again after 10 seconds (that's it's cooldown) and thanks for the tip about the level of the spell.

Here is what I got not ( still doesn't work )

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Lightning Vengeance
  • Actions
    • Set Position = (Position of (Triggering unit))
    • Unit - Create 1 Dummy - Buffer for (Owner of (Triggering unit)) at Position facing Default building facing degrees
    • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
    • Unit - Set level of Lightning Protection for (Last created unit) to (Level of Lightning Vengeance for (Triggering unit))
    • Unit - Order (Last created unit) to Human Priest - Inner Fire (Triggering unit)
    • Set Facing = 0.00
    • Unit - Create 1 Dummy - Explosion for (Owner of (Triggering unit)) at Position facing Default building facing degrees
    • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
    • Unit Group - Pick every unit in (Units within 400.00 of Position matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
      • Loop - Actions
        • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((50.00 x (Real((Level of Lightning Vengeance for (Triggering unit))))) + ((Real((Strength of (Triggering unit) (Include bonuses)))) x (Real((Level of Lightning Vengeance for (Triggering unit)))))) damage of attack type Spells and damage type Normal
    • For each (Integer A) from 1 to 18, do (Actions)
      • Loop - Actions
        • Unit - Create 1 Dummy - Eyecandy for (Owner of (Triggering unit)) at (Position offset by 600.00 towards Facing degrees) facing Default building facing degrees
        • Unit - Order (Last created unit) to Move To Position
        • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
        • Set Facing = (Facing + 20.00)
    • Set Facing = 0.00
    • Custom script: call RemoveLocation(udg_Position)
 
Level 4
Joined
Mar 14, 2009
Messages
98
The spaces didn't matter, and even if it did, it would just be causing a leak not a duplication of the spell. I'm guessing another trigger's getting in the way. Try disabling everything else, then test the spell again.
 
Status
Not open for further replies.
Top