1. Head to the 33rd Modeling Contest Poll and drink to your heart's desire.
    Dismiss Notice
  2. Choose your means of doom in the 17th Mini Mapping Contest Poll.
    Dismiss Notice
  3. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  4. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  5. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  6. The glory of the 20th Icon Contest is yours for the taking!
    Dismiss Notice
  7. 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.

Duplicating Spell?

Discussion in 'Triggers & Scripts' started by Quetzalcotl, Apr 14, 2009.

  1. Quetzalcotl

    Quetzalcotl

    Joined:
    Jul 9, 2008
    Messages:
    253
    Resources:
    0
    Resources:
    0
    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 )
     
  2. nerovesper

    nerovesper

    Joined:
    Sep 29, 2008
    Messages:
    614
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    Its not mui. I'll try to check it out if I'm not lazy. xD
     
  3. Quetzalcotl

    Quetzalcotl

    Joined:
    Jul 9, 2008
    Messages:
    253
    Resources:
    0
    Resources:
    0
  4. nerovesper

    nerovesper

    Joined:
    Sep 29, 2008
    Messages:
    614
    Resources:
    2
    Maps:
    1
    Spells:
    1
    Resources:
    2
    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))
     
  5. jadegolem

    jadegolem

    Joined:
    Feb 1, 2008
    Messages:
    293
    Resources:
    0
    Resources:
    0
    you spelled the leak removal wrong. its
    • Custom Script: call RemoveLocation(Position)

    not
    • Custom Script: call RemoveLocation( Position )

    you have a space so your not removing the location and the wait does kill the MUI.
     
  6. Quetzalcotl

    Quetzalcotl

    Joined:
    Jul 9, 2008
    Messages:
    253
    Resources:
    0
    Resources:
    0
    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)
     
  7. Peetoon

    Peetoon

    Joined:
    Mar 14, 2009
    Messages:
    97
    Resources:
    0
    Resources:
    0
    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.