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

Spell leak ?

Status
Not open for further replies.
Level 7
Joined
Oct 10, 2009
Messages
111
Trigger 1
  • Lighting Aura1
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Trigger - Turn off Lighting Aura2 <gen>
Trigger 2

  • Lighting Aura2
    • Events
      • Time - Every 6.00 seconds of game time
    • Conditions
    • Actions
      • Set LA_Caster = (Casting unit)
      • Set LA_Targets = (Units owned by Player 12 (Brown))
      • Set LA_Target = (Random unit from LA_Targets)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Lighting Aura for LA_Caster) Equal to 1
        • Then - Actions
          • Unit - Cause LA_Caster to damage LA_Target, dealing 20.00 damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect attached to the overhead of LA_Target using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
          • Wait 0.20 seconds
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Lighting Aura for LA_Caster) Equal to 2
            • Then - Actions
              • Unit - Cause LA_Caster to damage LA_Target, dealing 40.00 damage of attack type Spells and damage type Normal
              • Special Effect - Create a special effect attached to the overhead of LA_Target using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
              • Wait 0.20 seconds
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Lighting Aura for LA_Caster) Equal to 3
                • Then - Actions
                  • Unit - Cause LA_Caster to damage LA_Target, dealing 60.00 damage of attack type Spells and damage type Normal
                  • Special Effect - Create a special effect attached to the overhead of LA_Target using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
                  • Wait 0.20 seconds
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Lighting Aura for LA_Caster) Equal to 4
                    • Then - Actions
                      • Unit - Cause LA_Caster to damage LA_Target, dealing 100.00 damage of attack type Spells and damage type Normal
                      • Special Effect - Create a special effect attached to the overhead of LA_Target using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
                      • Wait 0.20 seconds
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
Trigger 3 :

  • Lighting Aura3
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Lighting Aura
    • Actions
      • Trigger - Turn on Lighting Aura2 <gen>
Can you tell me where does spell leaks ? (doesen't work ingame)

Thanks :) + rep who helps :)
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Add this
  • Custom script: call DestroyGroup(udg_LA_Targets)
after this:
  • Set LA_Target = (Random unit from LA_Targets)
It doesn't work because Event Reponse - Casting unit needs an event like:

  • Unit - A unit Begins casting an ability
  • Unit - A unit Starts the effect of an ability
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Create a unit group variable called Lightning_Aura_Group.

  • Lighting Aura2
    • Events
      • Time - Every 6.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick all units in Lightning_Aura_Group
      • Put everything below this line inside the loop
      • Set LA_Caster = (Picked unit)
      • Set LA_Targets = (Units owned by Player 12 (Brown))
      • Set LA_Target = (Random unit from LA_Targets)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Lighting Aura for LA_Caster) Equal to 1
        • Then - Actions
          • Unit - Cause LA_Caster to damage LA_Target, dealing 20.00 damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect attached to the overhead of LA_Target using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
          • Wait 0.20 seconds
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Lighting Aura for LA_Caster) Equal to 2
            • Then - Actions
              • Unit - Cause LA_Caster to damage LA_Target, dealing 40.00 damage of attack type Spells and damage type Normal
              • Special Effect - Create a special effect attached to the overhead of LA_Target using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
              • Wait 0.20 seconds
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Lighting Aura for LA_Caster) Equal to 3
                • Then - Actions
                  • Unit - Cause LA_Caster to damage LA_Target, dealing 60.00 damage of attack type Spells and damage type Normal
                  • Special Effect - Create a special effect attached to the overhead of LA_Target using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
                  • Wait 0.20 seconds
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Lighting Aura for LA_Caster) Equal to 4
                    • Then - Actions
                      • Unit - Cause LA_Caster to damage LA_Target, dealing 100.00 damage of attack type Spells and damage type Normal
                      • Special Effect - Create a special effect attached to the overhead of LA_Target using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
                      • Wait 0.20 seconds
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
Trigger 3 :

  • Lighting Aura3
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Lighting Aura
    • Actions
      • If triggering unit is not in Lightning_Aura_Group then add triggerin unit to Lightning_Aura_Group
      • Trigger - Turn on Lighting Aura2 <gen>


However this will only work properly for one unit since you use waits.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
This will only support one unit at a time.

An easy way to make it support several units is to remove the wait, but then you need to use different effect. Lightning bolt vanishes instantly when it is destroyed. Some other effects play their death animation when destroyed.

If you want to use that effect, then look for indexing or hashtable tutorial if you want to make it work for more than one unit at the same time.
 

Attachments

  • tes12.w3x
    18.4 KB · Views: 48
Level 29
Joined
Mar 10, 2009
Messages
5,016
why dont you use a formula to shorten the trigger?

something like this...

  • If - Conditions
  • (Level of Lighting Aura for LA_Caster) Greter than 0
  • Then - Actions
  • Set - Formula=(Level of Lighting Aura for LA_Caster) * 20)
  • Unit - Cause LA_Caster to damage LA_Target, dealing Formula damage of attack type Spells and damage type Normal
  • Special Effect - Create a special effect attached to the overhead of LA_Target using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
  • Wait 0.20 seconds
  • Special Effect - Destroy (Last created special effect)
 
Status
Not open for further replies.
Top